From 85bf1b47d8a84ec4ebe2ce3a7a30f489935c436e Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Wed, 8 Jul 2026 17:04:39 +0800 Subject: [PATCH 01/27] Add post-publish-sdk pipeline to regenerate TypeSpec SDKs Ports the post-publish SDK generation automation from Azure/autorest.java to this repo, adapted for the typespec-java emitter's new home in Azure/typespec-azure (packages/typespec-java). - eng/pipelines/post-publish-sdk.yaml: regenerates all TypeSpec-based SDKs and opens an automated draft PR. Uses the published @azure-tools/typespec-java npm package by default; when the TypeSpecJavaPRId parameter is set, builds the emitter dev package from that typespec-azure PR (turbo builds workspace deps, then Build-TypeSpec.ps1 builds and packs). - eng/pipelines/scripts/sync_sdk.py: regeneration script. - eng/pipelines/scripts/patches/: SDK patches applied after generation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/post-publish-sdk.yaml | 134 +++++ .../patches/0001-key-certificates-impl.patch | 239 ++++++++ ...evert-Impl-for-onlineexperimentation.patch | 56 ++ ...revert-azure-ai-speech-transcription.patch | 113 ++++ .../0001-revert-impl-in-communication.patch | 268 +++++++++ .../0001-revert-impl-in-contentsafety.patch | 99 ++++ ...-revert-impl-in-documentintelligence.patch | 534 ++++++++++++++++++ .../patches/0001-revert-impl-in-easm.patch | 135 +++++ .../patches/0001-revert-impl-in-monitor.patch | 58 ++ .../0001-revert-impl-in-translation.patch | 59 ++ eng/pipelines/scripts/sync_sdk.py | 270 +++++++++ 11 files changed, 1965 insertions(+) create mode 100644 eng/pipelines/post-publish-sdk.yaml create mode 100644 eng/pipelines/scripts/patches/0001-key-certificates-impl.patch create mode 100644 eng/pipelines/scripts/patches/0001-revert-Impl-for-onlineexperimentation.patch create mode 100644 eng/pipelines/scripts/patches/0001-revert-azure-ai-speech-transcription.patch create mode 100644 eng/pipelines/scripts/patches/0001-revert-impl-in-communication.patch create mode 100644 eng/pipelines/scripts/patches/0001-revert-impl-in-contentsafety.patch create mode 100644 eng/pipelines/scripts/patches/0001-revert-impl-in-documentintelligence.patch create mode 100644 eng/pipelines/scripts/patches/0001-revert-impl-in-easm.patch create mode 100644 eng/pipelines/scripts/patches/0001-revert-impl-in-monitor.patch create mode 100644 eng/pipelines/scripts/patches/0001-revert-impl-in-translation.patch create mode 100644 eng/pipelines/scripts/sync_sdk.py diff --git a/eng/pipelines/post-publish-sdk.yaml b/eng/pipelines/post-publish-sdk.yaml new file mode 100644 index 000000000000..e600d9041676 --- /dev/null +++ b/eng/pipelines/post-publish-sdk.yaml @@ -0,0 +1,134 @@ +# Regenerates all TypeSpec-based SDKs in azure-sdk-for-java using the typespec-java emitter, +# then opens an automated draft PR with the results. +# +# The typespec-java emitter lives in Azure/typespec-azure (packages/typespec-java). +# By default this pipeline generates using the published @azure-tools/typespec-java npm +# package. To validate an unreleased emitter change, provide the TypeSpecJavaPRId parameter +# pointing at a Pull Request in the Azure/typespec-azure repository; the emitter dev package +# is then built from that PR and used for generation. +trigger: none +pr: none + +parameters: +- name: TypeSpecJavaPRId + displayName: >- + Pull Request in the Azure/typespec-azure repo to build the typespec-java emitter from. + Accepts a PR number (e.g. 43312) or a full ref path (e.g. refs/pull/43312/merge). + Leave empty to use the published @azure-tools/typespec-java npm package. + type: string + default: '' + +jobs: +- job: Generate_SDK + + timeoutInMinutes: 120 + + variables: + - template: /eng/pipelines/templates/variables/globals.yml + - template: /eng/pipelines/templates/variables/image.yml + - name: NodeVersion + value: '24.x' + # Local clone target for the (public) Azure/typespec-azure emitter repo. + - name: TypeSpecAzureDirectory + value: $(Agent.BuildDirectory)/typespec-azure + - name: PullRequestTitleSuffix + ${{ if ne(parameters.TypeSpecJavaPRId, '') }}: + value: " DEV (typespec-azure PR ${{ parameters.TypeSpecJavaPRId }})" + ${{ else }}: + value: "" + + pool: + name: $(LINUXPOOL) + image: $(LINUXVMIMAGE) + os: linux + + steps: + # azure-sdk-for-java (self) is the only repo resource, so it is checked out to + # $(Build.SourcesDirectory). Azure/typespec-azure is public, so it is cloned directly + # (below) instead of via a repository resource + GitHub service connection. + - checkout: self + + - task: NodeTool@0 + displayName: 'Install Node.js $(NodeVersion)' + inputs: + versionSpec: '$(NodeVersion)' + + - template: /eng/pipelines/templates/steps/maven-authenticate.yml + parameters: + SourceDirectory: $(Build.SourcesDirectory) + + - template: /eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml + parameters: + registryUrl: https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ + + # Clone the public Azure/typespec-azure repo (no service connection required). When a PR is + # specified via TypeSpecJavaPRId, fetch and check out that PR ref (number or full ref path). + - task: PowerShell@2 + displayName: 'Clone typespec-azure' + inputs: + pwsh: true + targetType: 'inline' + script: | + git clone https://github.com/Azure/typespec-azure.git "$(TypeSpecAzureDirectory)" + $prId = '${{ parameters.TypeSpecJavaPRId }}' + if ($prId) { + if ($prId -match '^\d+$') { + $ref = "refs/pull/$prId/merge" + } else { + $ref = $prId + } + Write-Host "Fetching typespec-azure ref $ref" + git -C "$(TypeSpecAzureDirectory)" fetch origin $ref + git -C "$(TypeSpecAzureDirectory)" checkout FETCH_HEAD + } + + # Build the emitter dev package (.tgz) from the typespec-azure PR. + # typespec-java depends on other workspace packages (workspace:^). First build only those + # upstream dependencies with turbo (the `^...` filter selects dependencies but excludes + # typespec-java itself). Then Build-TypeSpec.ps1 builds and packs typespec-java (its + # build:generator step runs Build-Generator.ps1, which needs JDK 11+ and Maven), producing + # the .tgz next to the package.json for sync_sdk.py to pick up. + - task: PowerShell@2 + retryCountOnTaskFailure: 1 + condition: and(succeeded(), ne('${{ parameters.TypeSpecJavaPRId }}', '')) + displayName: 'Build typespec-java dev package' + inputs: + pwsh: true + targetType: 'inline' + script: | + corepack enable + pnpm install + pnpm turbo run build --filter "@azure-tools/typespec-java^..." + ./packages/typespec-java/Build-TypeSpec.ps1 + workingDirectory: $(TypeSpecAzureDirectory) + + - script: | + npm install -g @azure-tools/typespec-client-generator-cli + displayName: 'Install tsp-client' + + - task: PowerShell@2 + displayName: 'Get Package Version' + inputs: + pwsh: true + targetType: 'inline' + script: | + $PACKAGE_VERSION = node -p -e "require('./packages/typespec-java/package.json').version" + Write-Host("##vso[task.setvariable variable=PackageVersion]$PACKAGE_VERSION") + workingDirectory: $(TypeSpecAzureDirectory) + + - script: | + python3 ./eng/pipelines/scripts/sync_sdk.py --sdk-root=$(Build.SourcesDirectory) --package-json-path=$(TypeSpecAzureDirectory)/packages/typespec-java/package.json --dev-package=${{ ne(parameters.TypeSpecJavaPRId, '') }} + displayName: 'Generate SDK' + workingDirectory: $(Build.SourcesDirectory) + + - template: /eng/common/pipelines/templates/steps/create-pull-request.yml + parameters: + WorkingDirectory: $(Build.SourcesDirectory) + ScriptDirectory: $(Build.SourcesDirectory)/eng/common/scripts + RepoName: azure-sdk-for-java + BaseBranchName: 'refs/heads/main' + PRBranchName: typespec-java-generation-$(Build.BuildId) + CommitMsg: '[Automation] Generate SDK based on TypeSpec $(PackageVersion)$(PullRequestTitleSuffix)' + PRTitle: '[Automation] Generate SDK based on TypeSpec $(PackageVersion)$(PullRequestTitleSuffix)' + PRLabels: 'DPG' + OpenAsDraft: 'true' diff --git a/eng/pipelines/scripts/patches/0001-key-certificates-impl.patch b/eng/pipelines/scripts/patches/0001-key-certificates-impl.patch new file mode 100644 index 000000000000..ea3813e85588 --- /dev/null +++ b/eng/pipelines/scripts/patches/0001-key-certificates-impl.patch @@ -0,0 +1,239 @@ +From e2df7de3f5643ff2006a8244e28ed9aa3598ecf3 Mon Sep 17 00:00:00 2001 +From: Weidong Xu +Date: Thu, 11 Jun 2026 20:39:16 +0800 +Subject: [PATCH] Revert "regen" + +This reverts commit 7ccefe36941cc38f14a52ca796167a95f263ce3f. +--- + .../models/CertificatePolicy.java | 66 ++++++++++++++----- + 1 file changed, 51 insertions(+), 15 deletions(-) + +diff --git a/sdk/keyvault/azure-security-keyvault-certificates/src/main/java/com/azure/security/keyvault/certificates/implementation/models/CertificatePolicy.java b/sdk/keyvault/azure-security-keyvault-certificates/src/main/java/com/azure/security/keyvault/certificates/implementation/models/CertificatePolicy.java +index e16ea8f5900..33d11980151 100644 +--- a/sdk/keyvault/azure-security-keyvault-certificates/src/main/java/com/azure/security/keyvault/certificates/implementation/models/CertificatePolicy.java ++++ b/sdk/keyvault/azure-security-keyvault-certificates/src/main/java/com/azure/security/keyvault/certificates/implementation/models/CertificatePolicy.java +@@ -1,6 +1,7 @@ + // Copyright (c) Microsoft Corporation. All rights reserved. + // Licensed under the MIT License. + // Code generated by Microsoft (R) TypeSpec Code Generator. ++ + package com.azure.security.keyvault.certificates.implementation.models; + + import com.azure.core.annotation.Fluent; +@@ -9,6 +10,7 @@ import com.azure.json.JsonReader; + import com.azure.json.JsonSerializable; + import com.azure.json.JsonToken; + import com.azure.json.JsonWriter; ++import com.azure.security.keyvault.certificates.models.PlatformManaged; + import java.io.IOException; + import java.util.List; + +@@ -17,7 +19,6 @@ import java.util.List; + */ + @Fluent + public final class CertificatePolicy implements JsonSerializable { +- + /* + * The certificate id. + */ +@@ -60,6 +61,12 @@ public final class CertificatePolicy implements JsonSerializable writer.writeJson(element)); + jsonWriter.writeJsonField("issuer", this.issuerParameters); + jsonWriter.writeJsonField("attributes", this.attributes); ++ jsonWriter.writeJsonField("platformManaged", this.platformManaged); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CertificatePolicy from the JsonReader. +- * ++ * + * @param jsonReader The JsonReader being read. + * @return An instance of CertificatePolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. +@@ -241,6 +273,7 @@ public final class CertificatePolicy implements JsonSerializable +Date: Mon, 22 Sep 2025 15:32:34 +0800 +Subject: [PATCH] revert Impl for onlineexperimentation + +--- + .../OnlineExperimentationClientImpl.java | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/sdk/onlineexperimentation/azure-analytics-onlineexperimentation/src/main/java/com/azure/analytics/onlineexperimentation/implementation/OnlineExperimentationClientImpl.java b/sdk/onlineexperimentation/azure-analytics-onlineexperimentation/src/main/java/com/azure/analytics/onlineexperimentation/implementation/OnlineExperimentationClientImpl.java +index 32e6622cbc6..ed26312e71d 100644 +--- a/sdk/onlineexperimentation/azure-analytics-onlineexperimentation/src/main/java/com/azure/analytics/onlineexperimentation/implementation/OnlineExperimentationClientImpl.java ++++ b/sdk/onlineexperimentation/azure-analytics-onlineexperimentation/src/main/java/com/azure/analytics/onlineexperimentation/implementation/OnlineExperimentationClientImpl.java +@@ -233,7 +233,7 @@ public final class OnlineExperimentationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteMetric(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("experimentMetricId") String experimentMetricId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/experiment-metrics/{experimentMetricId}") + @ExpectedResponses({ 204 }) +@@ -243,7 +243,7 @@ public final class OnlineExperimentationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteMetricSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("experimentMetricId") String experimentMetricId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/experiment-metrics") + @ExpectedResponses({ 200 }) +@@ -698,8 +698,9 @@ public final class OnlineExperimentationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteMetricWithResponseAsync(String experimentMetricId, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteMetric(this.getEndpoint(), +- this.getServiceVersion().getVersion(), experimentMetricId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), experimentMetricId, accept, requestOptions, context)); + } + + /** +@@ -730,8 +731,9 @@ public final class OnlineExperimentationClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteMetricWithResponse(String experimentMetricId, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return service.deleteMetricSync(this.getEndpoint(), this.getServiceVersion().getVersion(), experimentMetricId, +- requestOptions, Context.NONE); ++ accept, requestOptions, Context.NONE); + } + + /** +-- +2.51.0.windows.1 + diff --git a/eng/pipelines/scripts/patches/0001-revert-azure-ai-speech-transcription.patch b/eng/pipelines/scripts/patches/0001-revert-azure-ai-speech-transcription.patch new file mode 100644 index 000000000000..926230202d80 --- /dev/null +++ b/eng/pipelines/scripts/patches/0001-revert-azure-ai-speech-transcription.patch @@ -0,0 +1,113 @@ +From bc30c29232e16f5b29af07159d6f9bac6d3bf36c Mon Sep 17 00:00:00 2001 +From: Weidong Xu +Date: Thu, 21 May 2026 11:20:39 +0800 +Subject: [PATCH] revert azure-ai-speech-transcription + +--- + .../generated/TranscribeAudioFileTests.java | 10 +++++----- + .../generated/TranscribeAudioFromURLTests.java | 10 +++++----- + .../generated/TranscribeWithEnhancedModeTests.java | 10 +++++----- + 3 files changed, 15 insertions(+), 15 deletions(-) + +diff --git a/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeAudioFileTests.java b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeAudioFileTests.java +index a6285e1cfe2..ac8c847552a 100644 +--- a/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeAudioFileTests.java ++++ b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeAudioFileTests.java +@@ -24,7 +24,7 @@ public final class TranscribeAudioFileTests extends TranscriptionClientTestBase + // response assertion + Assertions.assertNotNull(response); + // verify property "duration" +- Assertions.assertEquals(2000, response.getDuration()); ++ Assertions.assertEquals(2000, response.getDuration().toMillis()); + // verify property "combinedPhrases" + List responseCombinedPhrases = response.getCombinedPhrases(); + ChannelCombinedPhrases responseCombinedPhrasesFirstItem = responseCombinedPhrases.iterator().next(); +@@ -34,15 +34,15 @@ public final class TranscribeAudioFileTests extends TranscriptionClientTestBase + List responsePhrases = response.getPhrases(); + TranscribedPhrase responsePhrasesFirstItem = responsePhrases.iterator().next(); + Assertions.assertNotNull(responsePhrasesFirstItem); +- Assertions.assertEquals(40, responsePhrasesFirstItem.getOffset()); +- Assertions.assertEquals(320, responsePhrasesFirstItem.getDuration()); ++ Assertions.assertEquals(40, responsePhrasesFirstItem.getOffset().toMillis()); ++ Assertions.assertEquals(320, responsePhrasesFirstItem.getDuration().toMillis()); + Assertions.assertEquals("Weather", responsePhrasesFirstItem.getText()); + List responsePhrasesFirstItemWords = responsePhrasesFirstItem.getWords(); + TranscribedWord responsePhrasesFirstItemWordsFirstItem = responsePhrasesFirstItemWords.iterator().next(); + Assertions.assertNotNull(responsePhrasesFirstItemWordsFirstItem); + Assertions.assertEquals("weather", responsePhrasesFirstItemWordsFirstItem.getText()); +- Assertions.assertEquals(40, responsePhrasesFirstItemWordsFirstItem.getOffset()); +- Assertions.assertEquals(320, responsePhrasesFirstItemWordsFirstItem.getDuration()); ++ Assertions.assertEquals(40, responsePhrasesFirstItemWordsFirstItem.getOffset().toMillis()); ++ Assertions.assertEquals(320, responsePhrasesFirstItemWordsFirstItem.getDuration().toMillis()); + Assertions.assertEquals("en-US", responsePhrasesFirstItem.getLocale()); + Assertions.assertEquals(0.78983736, responsePhrasesFirstItem.getConfidence()); + } +diff --git a/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeAudioFromURLTests.java b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeAudioFromURLTests.java +index c904299bcab..e431b89cc08 100644 +--- a/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeAudioFromURLTests.java ++++ b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeAudioFromURLTests.java +@@ -24,7 +24,7 @@ public final class TranscribeAudioFromURLTests extends TranscriptionClientTestBa + // response assertion + Assertions.assertNotNull(response); + // verify property "duration" +- Assertions.assertEquals(2000, response.getDuration()); ++ Assertions.assertEquals(2000, response.getDuration().toMillis()); + // verify property "combinedPhrases" + List responseCombinedPhrases = response.getCombinedPhrases(); + ChannelCombinedPhrases responseCombinedPhrasesFirstItem = responseCombinedPhrases.iterator().next(); +@@ -34,15 +34,15 @@ public final class TranscribeAudioFromURLTests extends TranscriptionClientTestBa + List responsePhrases = response.getPhrases(); + TranscribedPhrase responsePhrasesFirstItem = responsePhrases.iterator().next(); + Assertions.assertNotNull(responsePhrasesFirstItem); +- Assertions.assertEquals(40, responsePhrasesFirstItem.getOffset()); +- Assertions.assertEquals(320, responsePhrasesFirstItem.getDuration()); ++ Assertions.assertEquals(40, responsePhrasesFirstItem.getOffset().toMillis()); ++ Assertions.assertEquals(320, responsePhrasesFirstItem.getDuration().toMillis()); + Assertions.assertEquals("Weather", responsePhrasesFirstItem.getText()); + List responsePhrasesFirstItemWords = responsePhrasesFirstItem.getWords(); + TranscribedWord responsePhrasesFirstItemWordsFirstItem = responsePhrasesFirstItemWords.iterator().next(); + Assertions.assertNotNull(responsePhrasesFirstItemWordsFirstItem); + Assertions.assertEquals("weather", responsePhrasesFirstItemWordsFirstItem.getText()); +- Assertions.assertEquals(40, responsePhrasesFirstItemWordsFirstItem.getOffset()); +- Assertions.assertEquals(320, responsePhrasesFirstItemWordsFirstItem.getDuration()); ++ Assertions.assertEquals(40, responsePhrasesFirstItemWordsFirstItem.getOffset().toMillis()); ++ Assertions.assertEquals(320, responsePhrasesFirstItemWordsFirstItem.getDuration().toMillis()); + Assertions.assertEquals("en-US", responsePhrasesFirstItem.getLocale()); + Assertions.assertEquals(0.78983736, responsePhrasesFirstItem.getConfidence()); + } +diff --git a/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeWithEnhancedModeTests.java b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeWithEnhancedModeTests.java +index 926e39c0905..b92423bd969 100644 +--- a/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeWithEnhancedModeTests.java ++++ b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeWithEnhancedModeTests.java +@@ -24,7 +24,7 @@ public final class TranscribeWithEnhancedModeTests extends TranscriptionClientTe + // response assertion + Assertions.assertNotNull(response); + // verify property "duration" +- Assertions.assertEquals(2000, response.getDuration()); ++ Assertions.assertEquals(2000, response.getDuration().toMillis()); + // verify property "combinedPhrases" + List responseCombinedPhrases = response.getCombinedPhrases(); + ChannelCombinedPhrases responseCombinedPhrasesFirstItem = responseCombinedPhrases.iterator().next(); +@@ -34,15 +34,15 @@ public final class TranscribeWithEnhancedModeTests extends TranscriptionClientTe + List responsePhrases = response.getPhrases(); + TranscribedPhrase responsePhrasesFirstItem = responsePhrases.iterator().next(); + Assertions.assertNotNull(responsePhrasesFirstItem); +- Assertions.assertEquals(40, responsePhrasesFirstItem.getOffset()); +- Assertions.assertEquals(320, responsePhrasesFirstItem.getDuration()); ++ Assertions.assertEquals(40, responsePhrasesFirstItem.getOffset().toMillis()); ++ Assertions.assertEquals(320, responsePhrasesFirstItem.getDuration().toMillis()); + Assertions.assertEquals("天气", responsePhrasesFirstItem.getText()); + List responsePhrasesFirstItemWords = responsePhrasesFirstItem.getWords(); + TranscribedWord responsePhrasesFirstItemWordsFirstItem = responsePhrasesFirstItemWords.iterator().next(); + Assertions.assertNotNull(responsePhrasesFirstItemWordsFirstItem); + Assertions.assertEquals("天", responsePhrasesFirstItemWordsFirstItem.getText()); +- Assertions.assertEquals(0, responsePhrasesFirstItemWordsFirstItem.getOffset()); +- Assertions.assertEquals(0, responsePhrasesFirstItemWordsFirstItem.getDuration()); ++ Assertions.assertEquals(0, responsePhrasesFirstItemWordsFirstItem.getOffset().toMillis()); ++ Assertions.assertEquals(0, responsePhrasesFirstItemWordsFirstItem.getDuration().toMillis()); + Assertions.assertEquals("zh-CN", responsePhrasesFirstItem.getLocale()); + Assertions.assertEquals(0.78983736, responsePhrasesFirstItem.getConfidence()); + } +-- +2.53.0.windows.2 + diff --git a/eng/pipelines/scripts/patches/0001-revert-impl-in-communication.patch b/eng/pipelines/scripts/patches/0001-revert-impl-in-communication.patch new file mode 100644 index 000000000000..767d5d08bb4d --- /dev/null +++ b/eng/pipelines/scripts/patches/0001-revert-impl-in-communication.patch @@ -0,0 +1,268 @@ +From 46e470e80eeb94ef3da2346bce9e6368792ad4ae Mon Sep 17 00:00:00 2001 +From: Weidong Xu +Date: Thu, 7 Aug 2025 14:13:06 +0800 +Subject: [PATCH] revert impl in communication + +--- + .../JobRouterAdministrationClientImpl.java | 48 +++++++++++-------- + .../implementation/JobRouterClientImpl.java | 22 +++++---- + 2 files changed, 41 insertions(+), 29 deletions(-) + +diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java +index 78b69849b85..3a598fb5a4e 100644 +--- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java ++++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java +@@ -234,8 +234,8 @@ public final class JobRouterAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteDistributionPolicy(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, +- @PathParam("distributionPolicyId") String distributionPolicyId, RequestOptions requestOptions, +- Context context); ++ @PathParam("distributionPolicyId") String distributionPolicyId, @HeaderParam("Accept") String accept, ++ RequestOptions requestOptions, Context context); + + @Delete("/routing/distributionPolicies/{distributionPolicyId}") + @ExpectedResponses({ 204 }) +@@ -245,8 +245,8 @@ public final class JobRouterAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteDistributionPolicySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, +- @PathParam("distributionPolicyId") String distributionPolicyId, RequestOptions requestOptions, +- Context context); ++ @PathParam("distributionPolicyId") String distributionPolicyId, @HeaderParam("Accept") String accept, ++ RequestOptions requestOptions, Context context); + + @Patch("/routing/classificationPolicies/{classificationPolicyId}") + @ExpectedResponses({ 200, 201 }) +@@ -324,8 +324,8 @@ public final class JobRouterAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteClassificationPolicy(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, +- @PathParam("classificationPolicyId") String classificationPolicyId, RequestOptions requestOptions, +- Context context); ++ @PathParam("classificationPolicyId") String classificationPolicyId, @HeaderParam("Accept") String accept, ++ RequestOptions requestOptions, Context context); + + @Delete("/routing/classificationPolicies/{classificationPolicyId}") + @ExpectedResponses({ 204 }) +@@ -335,8 +335,8 @@ public final class JobRouterAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteClassificationPolicySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, +- @PathParam("classificationPolicyId") String classificationPolicyId, RequestOptions requestOptions, +- Context context); ++ @PathParam("classificationPolicyId") String classificationPolicyId, @HeaderParam("Accept") String accept, ++ RequestOptions requestOptions, Context context); + + @Patch("/routing/exceptionPolicies/{exceptionPolicyId}") + @ExpectedResponses({ 200, 201 }) +@@ -410,7 +410,7 @@ public final class JobRouterAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteExceptionPolicy(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("exceptionPolicyId") String exceptionPolicyId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/routing/exceptionPolicies/{exceptionPolicyId}") + @ExpectedResponses({ 204 }) +@@ -420,7 +420,7 @@ public final class JobRouterAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteExceptionPolicySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("exceptionPolicyId") String exceptionPolicyId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Patch("/routing/queues/{queueId}") + @ExpectedResponses({ 200, 201 }) +@@ -494,7 +494,7 @@ public final class JobRouterAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteQueue(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("queueId") String queueId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/routing/queues/{queueId}") + @ExpectedResponses({ 204 }) +@@ -504,7 +504,7 @@ public final class JobRouterAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteQueueSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("queueId") String queueId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) +@@ -1032,8 +1032,9 @@ public final class JobRouterAdministrationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteDistributionPolicyWithResponseAsync(String distributionPolicyId, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteDistributionPolicy(this.getEndpoint(), +- this.getServiceVersion().getVersion(), distributionPolicyId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), distributionPolicyId, accept, requestOptions, context)); + } + + /** +@@ -1050,8 +1051,9 @@ public final class JobRouterAdministrationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteDistributionPolicyWithResponse(String distributionPolicyId, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return service.deleteDistributionPolicySync(this.getEndpoint(), this.getServiceVersion().getVersion(), +- distributionPolicyId, requestOptions, Context.NONE); ++ distributionPolicyId, accept, requestOptions, Context.NONE); + } + + /** +@@ -1569,8 +1571,9 @@ public final class JobRouterAdministrationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteClassificationPolicyWithResponseAsync(String classificationPolicyId, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteClassificationPolicy(this.getEndpoint(), +- this.getServiceVersion().getVersion(), classificationPolicyId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), classificationPolicyId, accept, requestOptions, context)); + } + + /** +@@ -1587,8 +1590,9 @@ public final class JobRouterAdministrationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteClassificationPolicyWithResponse(String classificationPolicyId, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return service.deleteClassificationPolicySync(this.getEndpoint(), this.getServiceVersion().getVersion(), +- classificationPolicyId, requestOptions, Context.NONE); ++ classificationPolicyId, accept, requestOptions, Context.NONE); + } + + /** +@@ -2106,8 +2110,9 @@ public final class JobRouterAdministrationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteExceptionPolicyWithResponseAsync(String exceptionPolicyId, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteExceptionPolicy(this.getEndpoint(), +- this.getServiceVersion().getVersion(), exceptionPolicyId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), exceptionPolicyId, accept, requestOptions, context)); + } + + /** +@@ -2123,8 +2128,9 @@ public final class JobRouterAdministrationClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteExceptionPolicyWithResponse(String exceptionPolicyId, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return service.deleteExceptionPolicySync(this.getEndpoint(), this.getServiceVersion().getVersion(), +- exceptionPolicyId, requestOptions, Context.NONE); ++ exceptionPolicyId, accept, requestOptions, Context.NONE); + } + + /** +@@ -2548,8 +2554,9 @@ public final class JobRouterAdministrationClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteQueueWithResponseAsync(String queueId, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteQueue(this.getEndpoint(), +- this.getServiceVersion().getVersion(), queueId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), queueId, accept, requestOptions, context)); + } + + /** +@@ -2565,7 +2572,8 @@ public final class JobRouterAdministrationClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteQueueWithResponse(String queueId, RequestOptions requestOptions) { +- return service.deleteQueueSync(this.getEndpoint(), this.getServiceVersion().getVersion(), queueId, ++ final String accept = "application/json"; ++ return service.deleteQueueSync(this.getEndpoint(), this.getServiceVersion().getVersion(), queueId, accept, + requestOptions, Context.NONE); + } + +diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterClientImpl.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterClientImpl.java +index 1ab1634dd63..e0d6dc7f6e7 100644 +--- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterClientImpl.java ++++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterClientImpl.java +@@ -210,7 +210,7 @@ public final class JobRouterClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteJob(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/routing/jobs/{jobId}") + @ExpectedResponses({ 204 }) +@@ -220,7 +220,7 @@ public final class JobRouterClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteJobSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/routing/jobs/{jobId}:reclassify") + @ExpectedResponses({ 200 }) +@@ -484,7 +484,7 @@ public final class JobRouterClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteWorker(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("workerId") String workerId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/routing/workers/{workerId}") + @ExpectedResponses({ 204 }) +@@ -494,7 +494,7 @@ public final class JobRouterClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteWorkerSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("workerId") String workerId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/routing/workers") + @ExpectedResponses({ 200 }) +@@ -1012,8 +1012,9 @@ public final class JobRouterClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteJobWithResponseAsync(String jobId, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteJob(this.getEndpoint(), +- this.getServiceVersion().getVersion(), jobId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), jobId, accept, requestOptions, context)); + } + + /** +@@ -1029,8 +1030,9 @@ public final class JobRouterClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteJobWithResponse(String jobId, RequestOptions requestOptions) { +- return service.deleteJobSync(this.getEndpoint(), this.getServiceVersion().getVersion(), jobId, requestOptions, +- Context.NONE); ++ final String accept = "application/json"; ++ return service.deleteJobSync(this.getEndpoint(), this.getServiceVersion().getVersion(), jobId, accept, ++ requestOptions, Context.NONE); + } + + /** +@@ -2671,8 +2673,9 @@ public final class JobRouterClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWorkerWithResponseAsync(String workerId, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteWorker(this.getEndpoint(), +- this.getServiceVersion().getVersion(), workerId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), workerId, accept, requestOptions, context)); + } + + /** +@@ -2688,7 +2691,8 @@ public final class JobRouterClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWorkerWithResponse(String workerId, RequestOptions requestOptions) { +- return service.deleteWorkerSync(this.getEndpoint(), this.getServiceVersion().getVersion(), workerId, ++ final String accept = "application/json"; ++ return service.deleteWorkerSync(this.getEndpoint(), this.getServiceVersion().getVersion(), workerId, accept, + requestOptions, Context.NONE); + } + +-- +2.50.1.windows.1 + diff --git a/eng/pipelines/scripts/patches/0001-revert-impl-in-contentsafety.patch b/eng/pipelines/scripts/patches/0001-revert-impl-in-contentsafety.patch new file mode 100644 index 000000000000..9bace5b40da0 --- /dev/null +++ b/eng/pipelines/scripts/patches/0001-revert-impl-in-contentsafety.patch @@ -0,0 +1,99 @@ +From 1185f9ded7e644d6b64c955c2faa9422765eea24 Mon Sep 17 00:00:00 2001 +From: Weidong Xu +Date: Thu, 7 Aug 2025 14:28:55 +0800 +Subject: [PATCH] revert impl in contentsafety + +--- + .../implementation/BlocklistClientImpl.java | 24 +++++++++++-------- + 1 file changed, 14 insertions(+), 10 deletions(-) + +diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/BlocklistClientImpl.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/BlocklistClientImpl.java +index e7e96b52ccf..727d27c5547 100644 +--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/BlocklistClientImpl.java ++++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/BlocklistClientImpl.java +@@ -216,7 +216,7 @@ public final class BlocklistClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteTextBlocklist(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/text/blocklists/{blocklistName}") + @ExpectedResponses({ 204 }) +@@ -226,7 +226,7 @@ public final class BlocklistClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteTextBlocklistSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/text/blocklists/{blocklistName}") + @ExpectedResponses({ 200 }) +@@ -318,8 +318,8 @@ public final class BlocklistClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> removeBlocklistItems(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, +- @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData options, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); + + @Post("/text/blocklists/{blocklistName}:removeBlocklistItems") + @ExpectedResponses({ 204 }) +@@ -329,8 +329,8 @@ public final class BlocklistClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response removeBlocklistItemsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, +- @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData options, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) +@@ -587,8 +587,9 @@ public final class BlocklistClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTextBlocklistWithResponseAsync(String name, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteTextBlocklist(this.getEndpoint(), +- this.getServiceVersion().getVersion(), name, requestOptions, context)); ++ this.getServiceVersion().getVersion(), name, accept, requestOptions, context)); + } + + /** +@@ -606,7 +607,8 @@ public final class BlocklistClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteTextBlocklistWithResponse(String name, RequestOptions requestOptions) { +- return service.deleteTextBlocklistSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, ++ final String accept = "application/json"; ++ return service.deleteTextBlocklistSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, accept, + requestOptions, Context.NONE); + } + +@@ -1126,8 +1128,9 @@ public final class BlocklistClientImpl { + public Mono> removeBlocklistItemsWithResponseAsync(String name, BinaryData options, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.removeBlocklistItems(this.getEndpoint(), +- this.getServiceVersion().getVersion(), name, contentType, options, requestOptions, context)); ++ this.getServiceVersion().getVersion(), name, contentType, accept, options, requestOptions, context)); + } + + /** +@@ -1159,8 +1162,9 @@ public final class BlocklistClientImpl { + public Response removeBlocklistItemsWithResponse(String name, BinaryData options, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return service.removeBlocklistItemsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, +- contentType, options, requestOptions, Context.NONE); ++ contentType, accept, options, requestOptions, Context.NONE); + } + + /** +-- +2.50.1.windows.1 + diff --git a/eng/pipelines/scripts/patches/0001-revert-impl-in-documentintelligence.patch b/eng/pipelines/scripts/patches/0001-revert-impl-in-documentintelligence.patch new file mode 100644 index 000000000000..a43942ea8dee --- /dev/null +++ b/eng/pipelines/scripts/patches/0001-revert-impl-in-documentintelligence.patch @@ -0,0 +1,534 @@ +From 3efa4c0cb7a78e09ff941b751092948faa74e70a Mon Sep 17 00:00:00 2001 +From: Weidong Xu +Date: Thu, 7 Aug 2025 12:28:19 +0800 +Subject: [PATCH] revert impl in documentintelligence + +--- + ...tIntelligenceAdministrationClientImpl.java | 90 ++++++++++++------- + .../DocumentIntelligenceClientImpl.java | 68 ++++++++------ + 2 files changed, 98 insertions(+), 60 deletions(-) + +diff --git a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceAdministrationClientImpl.java b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceAdministrationClientImpl.java +index edb1f567ca1..54d0a403774 100644 +--- a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceAdministrationClientImpl.java ++++ b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceAdministrationClientImpl.java +@@ -178,7 +178,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> buildDocumentModel(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, +- @BodyParam("application/json") BinaryData buildRequest, RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData buildRequest, ++ RequestOptions requestOptions, Context context); + + @Post("/documentModels:build") + @ExpectedResponses({ 202 }) +@@ -188,7 +189,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response buildDocumentModelSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, +- @BodyParam("application/json") BinaryData buildRequest, RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData buildRequest, ++ RequestOptions requestOptions, Context context); + + @Post("/documentModels:compose") + @ExpectedResponses({ 202 }) +@@ -198,7 +200,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> composeModel(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, +- @BodyParam("application/json") BinaryData composeRequest, RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData composeRequest, ++ RequestOptions requestOptions, Context context); + + @Post("/documentModels:compose") + @ExpectedResponses({ 202 }) +@@ -208,7 +211,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response composeModelSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, +- @BodyParam("application/json") BinaryData composeRequest, RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData composeRequest, ++ RequestOptions requestOptions, Context context); + + @Post("/documentModels:authorizeCopy") + @ExpectedResponses({ 200 }) +@@ -240,8 +244,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> copyModelTo(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData copyToRequest, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData copyToRequest, RequestOptions requestOptions, Context context); + + @Post("/documentModels/{modelId}:copyTo") + @ExpectedResponses({ 202 }) +@@ -251,8 +255,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response copyModelToSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData copyToRequest, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData copyToRequest, RequestOptions requestOptions, Context context); + + @Get("/documentModels/{modelId}") + @ExpectedResponses({ 200 }) +@@ -302,7 +306,7 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteModel(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/documentModels/{modelId}") + @ExpectedResponses({ 204 }) +@@ -312,7 +316,7 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteModelSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/info") + @ExpectedResponses({ 200 }) +@@ -382,7 +386,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> buildClassifier(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, +- @BodyParam("application/json") BinaryData buildRequest, RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData buildRequest, ++ RequestOptions requestOptions, Context context); + + @Post("/documentClassifiers:build") + @ExpectedResponses({ 202 }) +@@ -392,7 +397,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response buildClassifierSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, +- @BodyParam("application/json") BinaryData buildRequest, RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData buildRequest, ++ RequestOptions requestOptions, Context context); + + @Post("/documentClassifiers:authorizeCopy") + @ExpectedResponses({ 200 }) +@@ -424,8 +430,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> copyClassifierTo(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("classifierId") String classifierId, +- @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData copyToRequest, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData copyToRequest, RequestOptions requestOptions, Context context); + + @Post("/documentClassifiers/{classifierId}:copyTo") + @ExpectedResponses({ 202 }) +@@ -435,8 +441,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response copyClassifierToSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("classifierId") String classifierId, +- @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData copyToRequest, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData copyToRequest, RequestOptions requestOptions, Context context); + + @Get("/documentClassifiers/{classifierId}") + @ExpectedResponses({ 200 }) +@@ -486,7 +492,7 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteClassifier(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("classifierId") String classifierId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/documentClassifiers/{classifierId}") + @ExpectedResponses({ 204 }) +@@ -496,7 +502,7 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteClassifierSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("classifierId") String classifierId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) +@@ -598,8 +604,9 @@ public final class DocumentIntelligenceAdministrationClientImpl { + private Mono> buildDocumentModelWithResponseAsync(BinaryData buildRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.buildDocumentModel(this.getEndpoint(), +- this.getServiceVersion().getVersion(), contentType, buildRequest, requestOptions, context)); ++ this.getServiceVersion().getVersion(), contentType, accept, buildRequest, requestOptions, context)); + } + + /** +@@ -640,8 +647,9 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + private Response buildDocumentModelWithResponse(BinaryData buildRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return service.buildDocumentModelSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, +- buildRequest, requestOptions, Context.NONE); ++ accept, buildRequest, requestOptions, Context.NONE); + } + + /** +@@ -909,8 +917,9 @@ public final class DocumentIntelligenceAdministrationClientImpl { + private Mono> composeModelWithResponseAsync(BinaryData composeRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.composeModel(this.getEndpoint(), +- this.getServiceVersion().getVersion(), contentType, composeRequest, requestOptions, context)); ++ this.getServiceVersion().getVersion(), contentType, accept, composeRequest, requestOptions, context)); + } + + /** +@@ -971,7 +980,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + private Response composeModelWithResponse(BinaryData composeRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; +- return service.composeModelSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, ++ final String accept = "application/json"; ++ return service.composeModelSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept, + composeRequest, requestOptions, Context.NONE); + } + +@@ -1391,8 +1401,10 @@ public final class DocumentIntelligenceAdministrationClientImpl { + private Mono> copyModelToWithResponseAsync(String modelId, BinaryData copyToRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; +- return FluxUtil.withContext(context -> service.copyModelTo(this.getEndpoint(), +- this.getServiceVersion().getVersion(), modelId, contentType, copyToRequest, requestOptions, context)); ++ final String accept = "application/json"; ++ return FluxUtil ++ .withContext(context -> service.copyModelTo(this.getEndpoint(), this.getServiceVersion().getVersion(), ++ modelId, contentType, accept, copyToRequest, requestOptions, context)); + } + + /** +@@ -1425,8 +1437,9 @@ public final class DocumentIntelligenceAdministrationClientImpl { + private Response copyModelToWithResponse(String modelId, BinaryData copyToRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return service.copyModelToSync(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId, contentType, +- copyToRequest, requestOptions, Context.NONE); ++ accept, copyToRequest, requestOptions, Context.NONE); + } + + /** +@@ -2116,8 +2129,9 @@ public final class DocumentIntelligenceAdministrationClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteModelWithResponseAsync(String modelId, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteModel(this.getEndpoint(), +- this.getServiceVersion().getVersion(), modelId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), modelId, accept, requestOptions, context)); + } + + /** +@@ -2133,7 +2147,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteModelWithResponse(String modelId, RequestOptions requestOptions) { +- return service.deleteModelSync(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId, ++ final String accept = "application/json"; ++ return service.deleteModelSync(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId, accept, + requestOptions, Context.NONE); + } + +@@ -2544,8 +2559,9 @@ public final class DocumentIntelligenceAdministrationClientImpl { + private Mono> buildClassifierWithResponseAsync(BinaryData buildRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.buildClassifier(this.getEndpoint(), +- this.getServiceVersion().getVersion(), contentType, buildRequest, requestOptions, context)); ++ this.getServiceVersion().getVersion(), contentType, accept, buildRequest, requestOptions, context)); + } + + /** +@@ -2587,8 +2603,9 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + private Response buildClassifierWithResponse(BinaryData buildRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return service.buildClassifierSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, +- buildRequest, requestOptions, Context.NONE); ++ accept, buildRequest, requestOptions, Context.NONE); + } + + /** +@@ -2931,8 +2948,10 @@ public final class DocumentIntelligenceAdministrationClientImpl { + private Mono> copyClassifierToWithResponseAsync(String classifierId, BinaryData copyToRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; +- return FluxUtil.withContext(context -> service.copyClassifierTo(this.getEndpoint(), +- this.getServiceVersion().getVersion(), classifierId, contentType, copyToRequest, requestOptions, context)); ++ final String accept = "application/json"; ++ return FluxUtil ++ .withContext(context -> service.copyClassifierTo(this.getEndpoint(), this.getServiceVersion().getVersion(), ++ classifierId, contentType, accept, copyToRequest, requestOptions, context)); + } + + /** +@@ -2965,8 +2984,9 @@ public final class DocumentIntelligenceAdministrationClientImpl { + private Response copyClassifierToWithResponse(String classifierId, BinaryData copyToRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return service.copyClassifierToSync(this.getEndpoint(), this.getServiceVersion().getVersion(), classifierId, +- contentType, copyToRequest, requestOptions, Context.NONE); ++ contentType, accept, copyToRequest, requestOptions, Context.NONE); + } + + /** +@@ -3479,8 +3499,9 @@ public final class DocumentIntelligenceAdministrationClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteClassifierWithResponseAsync(String classifierId, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteClassifier(this.getEndpoint(), +- this.getServiceVersion().getVersion(), classifierId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), classifierId, accept, requestOptions, context)); + } + + /** +@@ -3496,8 +3517,9 @@ public final class DocumentIntelligenceAdministrationClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteClassifierWithResponse(String classifierId, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return service.deleteClassifierSync(this.getEndpoint(), this.getServiceVersion().getVersion(), classifierId, +- requestOptions, Context.NONE); ++ accept, requestOptions, Context.NONE); + } + + /** +diff --git a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceClientImpl.java b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceClientImpl.java +index 35d46b5d152..f1ad7faf330 100644 +--- a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceClientImpl.java ++++ b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceClientImpl.java +@@ -174,8 +174,8 @@ public final class DocumentIntelligenceClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> analyzeDocument(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData analyzeRequest, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData analyzeRequest, RequestOptions requestOptions, Context context); + + @Post("/documentModels/{modelId}:analyze") + @ExpectedResponses({ 202 }) +@@ -185,8 +185,8 @@ public final class DocumentIntelligenceClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response analyzeDocumentSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData analyzeRequest, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData analyzeRequest, RequestOptions requestOptions, Context context); + + @Get("/documentModels/{modelId}/analyzeResults/{resultId}/pdf") + @ExpectedResponses({ 200 }) +@@ -240,7 +240,8 @@ public final class DocumentIntelligenceClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteAnalyzeResult(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- @PathParam("resultId") String resultId, RequestOptions requestOptions, Context context); ++ @PathParam("resultId") String resultId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, ++ Context context); + + @Delete("/documentModels/{modelId}/analyzeResults/{resultId}") + @ExpectedResponses({ 204 }) +@@ -250,7 +251,8 @@ public final class DocumentIntelligenceClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteAnalyzeResultSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- @PathParam("resultId") String resultId, RequestOptions requestOptions, Context context); ++ @PathParam("resultId") String resultId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, ++ Context context); + + @Post("/documentModels/{modelId}:analyzeBatch") + @ExpectedResponses({ 202 }) +@@ -260,7 +262,7 @@ public final class DocumentIntelligenceClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> analyzeBatchDocuments(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- @HeaderParam("content-type") String contentType, ++ @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData analyzeBatchRequest, RequestOptions requestOptions, + Context context); + +@@ -272,7 +274,7 @@ public final class DocumentIntelligenceClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response analyzeBatchDocumentsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- @HeaderParam("content-type") String contentType, ++ @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData analyzeBatchRequest, RequestOptions requestOptions, + Context context); + +@@ -304,7 +306,8 @@ public final class DocumentIntelligenceClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteAnalyzeBatchResult(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- @PathParam("resultId") String resultId, RequestOptions requestOptions, Context context); ++ @PathParam("resultId") String resultId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, ++ Context context); + + @Delete("/documentModels/{modelId}/analyzeBatchResults/{resultId}") + @ExpectedResponses({ 204 }) +@@ -314,7 +317,8 @@ public final class DocumentIntelligenceClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteAnalyzeBatchResultSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- @PathParam("resultId") String resultId, RequestOptions requestOptions, Context context); ++ @PathParam("resultId") String resultId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, ++ Context context); + + @Get("/documentModels/{modelId}/analyzeBatchResults/{resultId}") + @ExpectedResponses({ 200 }) +@@ -346,8 +350,8 @@ public final class DocumentIntelligenceClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> classifyDocument(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("classifierId") String classifierId, +- @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData classifyRequest, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData classifyRequest, RequestOptions requestOptions, Context context); + + @Post("/documentClassifiers/{classifierId}:analyze") + @ExpectedResponses({ 202 }) +@@ -357,8 +361,8 @@ public final class DocumentIntelligenceClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response classifyDocumentSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("classifierId") String classifierId, +- @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData classifyRequest, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData classifyRequest, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) +@@ -427,8 +431,10 @@ public final class DocumentIntelligenceClientImpl { + private Mono> analyzeDocumentWithResponseAsync(String modelId, BinaryData analyzeRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; +- return FluxUtil.withContext(context -> service.analyzeDocument(this.getEndpoint(), +- this.getServiceVersion().getVersion(), modelId, contentType, analyzeRequest, requestOptions, context)); ++ final String accept = "application/json"; ++ return FluxUtil ++ .withContext(context -> service.analyzeDocument(this.getEndpoint(), this.getServiceVersion().getVersion(), ++ modelId, contentType, accept, analyzeRequest, requestOptions, context)); + } + + /** +@@ -477,8 +483,9 @@ public final class DocumentIntelligenceClientImpl { + private Response analyzeDocumentWithResponse(String modelId, BinaryData analyzeRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return service.analyzeDocumentSync(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId, +- contentType, analyzeRequest, requestOptions, Context.NONE); ++ contentType, accept, analyzeRequest, requestOptions, Context.NONE); + } + + /** +@@ -842,8 +849,9 @@ public final class DocumentIntelligenceClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteAnalyzeResultWithResponseAsync(String modelId, String resultId, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteAnalyzeResult(this.getEndpoint(), +- this.getServiceVersion().getVersion(), modelId, resultId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), modelId, resultId, accept, requestOptions, context)); + } + + /** +@@ -861,8 +869,9 @@ public final class DocumentIntelligenceClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteAnalyzeResultWithResponse(String modelId, String resultId, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return service.deleteAnalyzeResultSync(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId, +- resultId, requestOptions, Context.NONE); ++ resultId, accept, requestOptions, Context.NONE); + } + + /** +@@ -920,8 +929,10 @@ public final class DocumentIntelligenceClientImpl { + private Mono> analyzeBatchDocumentsWithResponseAsync(String modelId, BinaryData analyzeBatchRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; +- return FluxUtil.withContext(context -> service.analyzeBatchDocuments(this.getEndpoint(), +- this.getServiceVersion().getVersion(), modelId, contentType, analyzeBatchRequest, requestOptions, context)); ++ final String accept = "application/json"; ++ return FluxUtil.withContext( ++ context -> service.analyzeBatchDocuments(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId, ++ contentType, accept, analyzeBatchRequest, requestOptions, context)); + } + + /** +@@ -979,8 +990,9 @@ public final class DocumentIntelligenceClientImpl { + private Response analyzeBatchDocumentsWithResponse(String modelId, BinaryData analyzeBatchRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return service.analyzeBatchDocumentsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId, +- contentType, analyzeBatchRequest, requestOptions, Context.NONE); ++ contentType, accept, analyzeBatchRequest, requestOptions, Context.NONE); + } + + /** +@@ -1507,8 +1519,9 @@ public final class DocumentIntelligenceClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteAnalyzeBatchResultWithResponseAsync(String modelId, String resultId, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteAnalyzeBatchResult(this.getEndpoint(), +- this.getServiceVersion().getVersion(), modelId, resultId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), modelId, resultId, accept, requestOptions, context)); + } + + /** +@@ -1526,8 +1539,9 @@ public final class DocumentIntelligenceClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteAnalyzeBatchResultWithResponse(String modelId, String resultId, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return service.deleteAnalyzeBatchResultSync(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId, +- resultId, requestOptions, Context.NONE); ++ resultId, accept, requestOptions, Context.NONE); + } + + /** +@@ -1686,9 +1700,10 @@ public final class DocumentIntelligenceClientImpl { + private Mono> classifyDocumentWithResponseAsync(String classifierId, BinaryData classifyRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.classifyDocument(this.getEndpoint(), this.getServiceVersion().getVersion(), +- classifierId, contentType, classifyRequest, requestOptions, context)); ++ classifierId, contentType, accept, classifyRequest, requestOptions, context)); + } + + /** +@@ -1728,8 +1743,9 @@ public final class DocumentIntelligenceClientImpl { + private Response classifyDocumentWithResponse(String classifierId, BinaryData classifyRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return service.classifyDocumentSync(this.getEndpoint(), this.getServiceVersion().getVersion(), classifierId, +- contentType, classifyRequest, requestOptions, Context.NONE); ++ contentType, accept, classifyRequest, requestOptions, Context.NONE); + } + + /** +-- +2.50.1.windows.1 + diff --git a/eng/pipelines/scripts/patches/0001-revert-impl-in-easm.patch b/eng/pipelines/scripts/patches/0001-revert-impl-in-easm.patch new file mode 100644 index 000000000000..0ff7844e6d57 --- /dev/null +++ b/eng/pipelines/scripts/patches/0001-revert-impl-in-easm.patch @@ -0,0 +1,135 @@ +From ee9efb32a58711f5bcb4667e4ae9bea70be2e138 Mon Sep 17 00:00:00 2001 +From: Weidong Xu +Date: Thu, 7 Aug 2025 13:47:27 +0800 +Subject: [PATCH] revert impl in easm + +--- + .../easm/implementation/EasmClientImpl.java | 30 +++++++++++-------- + 1 file changed, 18 insertions(+), 12 deletions(-) + +diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java +index 74965f145fd..cd574da24ef 100644 +--- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java ++++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java +@@ -315,7 +315,7 @@ public final class EasmClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteDataConnection(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("dataConnectionName") String dataConnectionName, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/dataConnections/{dataConnectionName}") + @ExpectedResponses({ 204 }) +@@ -325,7 +325,7 @@ public final class EasmClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteDataConnectionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("dataConnectionName") String dataConnectionName, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/discoGroups") + @ExpectedResponses({ 200 }) +@@ -419,7 +419,7 @@ public final class EasmClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> runDiscoGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/discoGroups/{groupName}:run") + @ExpectedResponses({ 204 }) +@@ -429,7 +429,7 @@ public final class EasmClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response runDiscoGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/discoGroups/{groupName}/runs") + @ExpectedResponses({ 200 }) +@@ -625,7 +625,7 @@ public final class EasmClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteSavedFilter(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("filterName") String filterName, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/savedFilters/{filterName}") + @ExpectedResponses({ 204 }) +@@ -635,7 +635,7 @@ public final class EasmClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteSavedFilterSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("filterName") String filterName, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/tasks") + @ExpectedResponses({ 200 }) +@@ -1886,8 +1886,9 @@ public final class EasmClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteDataConnectionWithResponseAsync(String dataConnectionName, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteDataConnection(this.getEndpoint(), +- this.getServiceVersion().getVersion(), dataConnectionName, requestOptions, context)); ++ this.getServiceVersion().getVersion(), dataConnectionName, accept, requestOptions, context)); + } + + /** +@@ -1903,8 +1904,9 @@ public final class EasmClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteDataConnectionWithResponse(String dataConnectionName, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return service.deleteDataConnectionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), +- dataConnectionName, requestOptions, Context.NONE); ++ dataConnectionName, accept, requestOptions, Context.NONE); + } + + /** +@@ -2696,8 +2698,9 @@ public final class EasmClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> runDiscoGroupWithResponseAsync(String groupName, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.runDiscoGroup(this.getEndpoint(), +- this.getServiceVersion().getVersion(), groupName, requestOptions, context)); ++ this.getServiceVersion().getVersion(), groupName, accept, requestOptions, context)); + } + + /** +@@ -2713,7 +2716,8 @@ public final class EasmClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response runDiscoGroupWithResponse(String groupName, RequestOptions requestOptions) { +- return service.runDiscoGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), groupName, ++ final String accept = "application/json"; ++ return service.runDiscoGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), groupName, accept, + requestOptions, Context.NONE); + } + +@@ -4053,8 +4057,9 @@ public final class EasmClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteSavedFilterWithResponseAsync(String filterName, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteSavedFilter(this.getEndpoint(), +- this.getServiceVersion().getVersion(), filterName, requestOptions, context)); ++ this.getServiceVersion().getVersion(), filterName, accept, requestOptions, context)); + } + + /** +@@ -4070,8 +4075,9 @@ public final class EasmClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteSavedFilterWithResponse(String filterName, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return service.deleteSavedFilterSync(this.getEndpoint(), this.getServiceVersion().getVersion(), filterName, +- requestOptions, Context.NONE); ++ accept, requestOptions, Context.NONE); + } + + /** +-- +2.50.1.windows.1 + diff --git a/eng/pipelines/scripts/patches/0001-revert-impl-in-monitor.patch b/eng/pipelines/scripts/patches/0001-revert-impl-in-monitor.patch new file mode 100644 index 000000000000..f54f516b672e --- /dev/null +++ b/eng/pipelines/scripts/patches/0001-revert-impl-in-monitor.patch @@ -0,0 +1,58 @@ +From d767417fc77ec1a5754ea6c973c258acab2cc9a6 Mon Sep 17 00:00:00 2001 +From: Weidong Xu +Date: Thu, 7 Aug 2025 12:44:57 +0800 +Subject: [PATCH] revert impl in monitor + +--- + .../implementation/LogsIngestionClientImpl.java | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/LogsIngestionClientImpl.java b/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/LogsIngestionClientImpl.java +index 1d513291f2b..7e7a7ed1484 100644 +--- a/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/LogsIngestionClientImpl.java ++++ b/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/LogsIngestionClientImpl.java +@@ -161,7 +161,8 @@ public final class LogsIngestionClientImpl { + Mono> upload(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("ruleId") String ruleId, + @PathParam("stream") String streamName, @HeaderParam("Content-Type") String contentType, +- @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, ++ RequestOptions requestOptions, Context context); + + @Post("/dataCollectionRules/{ruleId}/streams/{stream}") + @ExpectedResponses({ 204 }) +@@ -171,8 +172,8 @@ public final class LogsIngestionClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response uploadSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("ruleId") String ruleId, @PathParam("stream") String streamName, +- @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + } + + /** +@@ -211,8 +212,9 @@ public final class LogsIngestionClientImpl { + public Mono> uploadWithResponseAsync(String ruleId, String streamName, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.upload(this.getEndpoint(), this.getServiceVersion().getVersion(), +- ruleId, streamName, contentType, body, requestOptions, context)); ++ ruleId, streamName, contentType, accept, body, requestOptions, context)); + } + + /** +@@ -251,7 +253,8 @@ public final class LogsIngestionClientImpl { + public Response uploadWithResponse(String ruleId, String streamName, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return service.uploadSync(this.getEndpoint(), this.getServiceVersion().getVersion(), ruleId, streamName, +- contentType, body, requestOptions, Context.NONE); ++ contentType, accept, body, requestOptions, Context.NONE); + } + } +-- +2.50.1.windows.1 + diff --git a/eng/pipelines/scripts/patches/0001-revert-impl-in-translation.patch b/eng/pipelines/scripts/patches/0001-revert-impl-in-translation.patch new file mode 100644 index 000000000000..1a561ced9a94 --- /dev/null +++ b/eng/pipelines/scripts/patches/0001-revert-impl-in-translation.patch @@ -0,0 +1,59 @@ +From 67cd3515137238ae3c69008d0a65ec74af3338e9 Mon Sep 17 00:00:00 2001 +From: Weidong Xu +Date: Thu, 7 Aug 2025 12:13:55 +0800 +Subject: [PATCH] revert impl in translation + +--- + .../DocumentTranslationClientImpl.java | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/DocumentTranslationClientImpl.java b/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/DocumentTranslationClientImpl.java +index 9fb5a9e6fc8..cefc7bff313 100644 +--- a/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/DocumentTranslationClientImpl.java ++++ b/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/DocumentTranslationClientImpl.java +@@ -179,7 +179,8 @@ public final class DocumentTranslationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> translation(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, +- @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, ++ RequestOptions requestOptions, Context context); + + @Post("/document/batches") + @ExpectedResponses({ 202 }) +@@ -189,7 +190,8 @@ public final class DocumentTranslationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response translationSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, +- @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, ++ RequestOptions requestOptions, Context context); + + @Get("/document/batches") + @ExpectedResponses({ 200 }) +@@ -426,8 +428,9 @@ public final class DocumentTranslationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> translationWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.translation(this.getEndpoint(), +- this.getServiceVersion().getVersion(), contentType, body, requestOptions, context)); ++ this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); + } + + /** +@@ -502,8 +505,9 @@ public final class DocumentTranslationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + private Response translationWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; +- return service.translationSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, body, +- requestOptions, Context.NONE); ++ final String accept = "application/json"; ++ return service.translationSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept, ++ body, requestOptions, Context.NONE); + } + + /** +-- +2.50.1.windows.1 + diff --git a/eng/pipelines/scripts/sync_sdk.py b/eng/pipelines/scripts/sync_sdk.py new file mode 100644 index 000000000000..0f67ff979f18 --- /dev/null +++ b/eng/pipelines/scripts/sync_sdk.py @@ -0,0 +1,270 @@ +#!/usr/bin/env python3 + +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import os +import sys +import logging +import argparse +import subprocess +import glob +import shutil +import json +from typing import List + +sdk_root: str +# script is in "eng/pipelines/scripts/" +script_root: str = os.path.dirname(os.path.realpath(__file__)) + +skip_artifacts: List[str] = [ + "azure-ai-anomalydetector", # deprecated + # expect failure on below + # "azure-developer-devcenter", # 2 breaks introduced into stable api-version + # "azure-ai-vision-face", # SDK in development +] + + +def parse_args() -> argparse.Namespace: + parser = argparse.ArgumentParser() + parser.add_argument( + "--sdk-root", + type=str, + required=True, + help="azure-sdk-for-java repository root.", + ) + parser.add_argument( + "--package-json-path", + type=str, + required=True, + help="path to package.json of typespec-java.", + ) + parser.add_argument( + "--dev-package", + type=str, + required=False, + default="false", + help="use build from the branch, instead of published typespec-java.", + ) + return parser.parse_args() + + +def update_emitter(package_json_path: str, use_dev_package: bool): + if use_dev_package: + # we cannot use "tsp-client generate-config-files" in dev mode, as this command also updates the lock file + logging.info("Update emitter-package.json") + subprocess.check_call( + [ + "pwsh", + "./eng/common/scripts/typespec/New-EmitterPackageJson.ps1", + "-PackageJsonPath", + package_json_path, + "-OutputDirectory", + "eng", + ], + cwd=sdk_root, + ) + + # replace version with path to dev package + dev_package_path = None + typespec_extension_path = os.path.dirname(package_json_path) + for file in os.listdir(typespec_extension_path): + if file.endswith(".tgz"): + dev_package_path = os.path.abspath(os.path.join(typespec_extension_path, file)) + logging.info(f'Found dev package at "{dev_package_path}"') + break + if dev_package_path: + emitter_package_path = os.path.join(sdk_root, "eng", "emitter-package.json") + with open(emitter_package_path, "r") as json_file: + package_json = json.load(json_file) + package_json["dependencies"]["@azure-tools/typespec-java"] = dev_package_path + with open(emitter_package_path, "w") as json_file: + logging.info(f'Update emitter-package.json to use typespec-java from "{dev_package_path}"') + json.dump(package_json, json_file, indent=2) + else: + logging.error("Failed to locate the dev package.") + + # only enable it on dev branch + # update_latest_dev() + + logging.info("Update emitter-package-lock.json") + generate_lock_file() + else: + logging.info("Update emitter-package.json and emitter-package-lock.json") + subprocess.check_call( + ["tsp-client", "generate-config-files", "--package-json", package_json_path], cwd=sdk_root + ) + + +def update_latest_dev(): + subprocess.check_call( + ["npx", "-y", "@azure-tools/typespec-bump-deps", "eng/emitter-package.json", "--add-npm-overrides"], + cwd=sdk_root, + ) + + +def generate_lock_file(): + subprocess.check_call(["tsp-client", "generate-lock-file"], cwd=sdk_root) + + +def get_generated_folder_from_artifact(module_path: str, artifact: str, type: str) -> str: + path = os.path.join(module_path, "src", type, "java", "com") + for seg in artifact.split("-"): + path = os.path.join(path, seg) + path = os.path.join(path, "generated") + return path + + +def update_sdks(): + failed_modules = [] + for tsp_location_file in glob.glob(os.path.join(sdk_root, "sdk/*/*/tsp-location.yaml")): + module_path = os.path.dirname(tsp_location_file) + artifact = os.path.basename(module_path) + + arm_module = "-resourcemanager-" in artifact + + if artifact in skip_artifacts: + continue + + # # update commit ID for ARM module + # commit_id = "3c15c2f8c50fb3130b34887d29442da75f07fefb" + # if commit_id and arm_module: + # with open(tsp_location_file, "r", encoding="utf-8") as f_in: + # lines = f_in.readlines() + # lines_out = [] + # for line in lines: + # if line.startswith("commit:"): + # line = f"commit: {commit_id}\n" + # lines_out.append(line) + # with open(tsp_location_file, "w", encoding="utf-8") as f_out: + # f_out.writelines(lines_out) + + # logging.info("Updated tsp-location file content:\n%s", "".join(lines_out)) + + if os.path.dirname(module_path).endswith("-v2"): + # skip modules on azure-core-v2 + logging.info(f"Skip azure-core-v2 module on path {module_path}") + continue + + generated_samples_path = os.path.join( + module_path, get_generated_folder_from_artifact(module_path, artifact, "samples") + ) + generated_test_path = os.path.join( + module_path, get_generated_folder_from_artifact(module_path, artifact, "test") + ) + generated_samples_exists = os.path.isdir(generated_samples_path) + generated_test_exists = os.path.isdir(generated_test_path) + + if arm_module: + logging.info("Delete generated source code of resourcemanager module %s", artifact) + shutil.rmtree(os.path.join(module_path, "src", "main", "resources"), ignore_errors=True) + delete_generated_source_code(os.path.join(module_path, "src", "main", "java")) + + logging.info(f"Generate for module {artifact}") + try: + subprocess.check_call(["tsp-client", "update"], cwd=module_path) + except subprocess.CalledProcessError: + # one retry + # sometimes customization have intermittent failure + logging.warning(f"Retry generate for module {artifact}") + try: + subprocess.check_call(["tsp-client", "update", "--debug"], cwd=module_path) + except subprocess.CalledProcessError: + logging.error(f"Failed to generate for module {artifact}") + failed_modules.append(artifact) + + if not arm_module: + # run mvn package, as this is what's done in "TypeSpec-Compare-CurrentToCodegeneration.ps1" script + try: + subprocess.check_call( + ["mvn", "--no-transfer-progress", "codesnippet:update-codesnippet"], cwd=module_path + ) + except subprocess.CalledProcessError: + logging.error(f"Failed to update code snippet for module {artifact}") + failed_modules.append(artifact) + + if arm_module: + # revert mock test code + cmd = ["git", "checkout", "src/test"] + subprocess.check_call(cmd, cwd=module_path) + + # For ARM module, we want to keep the generated samples code. + # For data-plane, if the generated samples/test code is not there before generation, we will delete the generated code after generation, to avoid unnecessary code check-in. + if not generated_samples_exists and not arm_module: + shutil.rmtree(generated_samples_path, ignore_errors=True) + if not generated_test_exists: + shutil.rmtree(generated_test_path, ignore_errors=True) + + # revert change on pom.xml, readme.md, changelog.md, etc. + cmd = ["git", "checkout", "**/pom.xml"] + subprocess.check_call(cmd, cwd=sdk_root) + cmd = ["git", "checkout", "**/*.md"] + subprocess.check_call(cmd, cwd=sdk_root) + + # temporary, revert change on metadata.json + cmd = ["git", "checkout", "**/*_metadata.json"] + subprocess.check_call(cmd, cwd=sdk_root) + + cmd = ["git", "add", "."] + subprocess.check_call(cmd, cwd=sdk_root) + + if failed_modules: + logging.error(f"Failed modules {failed_modules}") + + +def apply_patches() -> None: + failed_patches = [] + for patch_file in glob.glob(os.path.join(script_root, "patches/*.patch")): + try: + subprocess.check_call(["git", "apply", patch_file, "--ignore-whitespace"], cwd=sdk_root) + except subprocess.CalledProcessError: + logging.error(f"Failed to apply patch {patch_file}") + failed_patches.append(patch_file) + + if failed_patches: + logging.error(f"Failed patches {failed_patches}") + + +def delete_generated_source_code(path: str) -> None: + autorest_generated_header = "Code generated by Microsoft (R) AutoRest Code Generator" + typespec_generated_header = "Code generated by Microsoft (R) TypeSpec Code Generator" + if os.path.exists(path): + for file in os.listdir(path): + cur_path = os.path.join(path, file) + if os.path.isdir(cur_path): + # Recurse into subdirectory + delete_generated_source_code(cur_path) + else: + try: + # Read file content and check for header + with open(cur_path, "r", encoding="utf-8") as f: + content = f.read() + if autorest_generated_header in content or typespec_generated_header in content: + os.remove(cur_path) # Delete the file + except Exception as e: + # Skip files that can't be read (binary files, permission issues) + print(f"Warning: Could not process file {cur_path}: {e}") + continue + + +def main(): + global sdk_root + + args = vars(parse_args()) + sdk_root = args["sdk_root"] + + update_emitter(args["package_json_path"], args["dev_package"].lower() == "true") + + update_sdks() + + apply_patches() + + +if __name__ == "__main__": + logging.basicConfig( + stream=sys.stdout, + level=logging.INFO, + format="%(asctime)s %(levelname)s %(message)s", + datefmt="%Y-%m-%d %X", + ) + main() From dd2e7c0b0a22d6e2fd8ceb0c1e44387755e0de8b Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Wed, 8 Jul 2026 17:22:03 +0800 Subject: [PATCH 02/27] Simplify TypeSpecJavaPRId parameter displayName Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/post-publish-sdk.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/eng/pipelines/post-publish-sdk.yaml b/eng/pipelines/post-publish-sdk.yaml index e600d9041676..d2a6a47ee229 100644 --- a/eng/pipelines/post-publish-sdk.yaml +++ b/eng/pipelines/post-publish-sdk.yaml @@ -11,10 +11,7 @@ pr: none parameters: - name: TypeSpecJavaPRId - displayName: >- - Pull Request in the Azure/typespec-azure repo to build the typespec-java emitter from. - Accepts a PR number (e.g. 43312) or a full ref path (e.g. refs/pull/43312/merge). - Leave empty to use the published @azure-tools/typespec-java npm package. + displayName: 'typespec-azure PR to build emitter from (number or ref; empty = published package)' type: string default: '' From 813a81fb0b227e99236d0d3bec2510f58717a121 Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Wed, 8 Jul 2026 17:25:41 +0800 Subject: [PATCH 03/27] Update TypeSpecJavaPRId parameter displayName Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/post-publish-sdk.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/post-publish-sdk.yaml b/eng/pipelines/post-publish-sdk.yaml index d2a6a47ee229..93361a678737 100644 --- a/eng/pipelines/post-publish-sdk.yaml +++ b/eng/pipelines/post-publish-sdk.yaml @@ -11,7 +11,7 @@ pr: none parameters: - name: TypeSpecJavaPRId - displayName: 'typespec-azure PR to build emitter from (number or ref; empty = published package)' + displayName: 'Pull Request ID in typespec-azure(e.g. 43321, or refs/pull/43321/merge)' type: string default: '' From 90259c8877ae28eb3f1625639e6536b0d7dc2dbd Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Wed, 8 Jul 2026 17:32:17 +0800 Subject: [PATCH 04/27] Use DevPackage boolean toggle with sentinel PRId default Replace the single PR-id parameter with a DevPackage boolean (default false) plus a PRId string that defaults to the sentinel 'none' so the run panel never requires input for the default (published-package) path. PRId is validated at runtime only when DevPackage is true. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/post-publish-sdk.yaml | 43 +++++++++++++++++++---------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/eng/pipelines/post-publish-sdk.yaml b/eng/pipelines/post-publish-sdk.yaml index 93361a678737..1a88965cf35c 100644 --- a/eng/pipelines/post-publish-sdk.yaml +++ b/eng/pipelines/post-publish-sdk.yaml @@ -2,18 +2,25 @@ # then opens an automated draft PR with the results. # # The typespec-java emitter lives in Azure/typespec-azure (packages/typespec-java). -# By default this pipeline generates using the published @azure-tools/typespec-java npm -# package. To validate an unreleased emitter change, provide the TypeSpecJavaPRId parameter -# pointing at a Pull Request in the Azure/typespec-azure repository; the emitter dev package -# is then built from that PR and used for generation. +# By default (DevPackage=false) this pipeline generates using the published +# @azure-tools/typespec-java npm package. To validate an unreleased emitter change, set +# DevPackage=true and provide PRId pointing at a Pull Request in the Azure/typespec-azure +# repository; the emitter dev package is then built from that PR and used for generation. trigger: none pr: none parameters: -- name: TypeSpecJavaPRId - displayName: 'Pull Request ID in typespec-azure(e.g. 43321, or refs/pull/43321/merge)' +# NOTE: Azure DevOps cannot conditionally show/hide runtime parameters, so both are always +# shown. DevPackage defaults to false (a boolean toggle needs no value entered); PRId is only +# used when DevPackage=true, in which case it must be provided. +- name: DevPackage + displayName: 'Build emitter from a typespec-azure PR (instead of the published npm package)' + type: boolean + default: false +- name: PRId + displayName: 'Pull Request ID in typespec-azure, only used when DevPackage=true (e.g. 43321, or refs/pull/43321/merge)' type: string - default: '' + default: 'none' jobs: - job: Generate_SDK @@ -29,8 +36,8 @@ jobs: - name: TypeSpecAzureDirectory value: $(Agent.BuildDirectory)/typespec-azure - name: PullRequestTitleSuffix - ${{ if ne(parameters.TypeSpecJavaPRId, '') }}: - value: " DEV (typespec-azure PR ${{ parameters.TypeSpecJavaPRId }})" + ${{ if eq(parameters.DevPackage, true) }}: + value: " DEV (typespec-azure PR ${{ parameters.PRId }})" ${{ else }}: value: "" @@ -58,8 +65,9 @@ jobs: parameters: registryUrl: https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ - # Clone the public Azure/typespec-azure repo (no service connection required). When a PR is - # specified via TypeSpecJavaPRId, fetch and check out that PR ref (number or full ref path). + # Clone the public Azure/typespec-azure repo (no service connection required). When building + # a dev package (DevPackage=true), fetch and check out the specified PR ref. PRId must be set + # in that case (a bare number is expanded to refs/pull//merge; a full ref is used as-is). - task: PowerShell@2 displayName: 'Clone typespec-azure' inputs: @@ -67,8 +75,13 @@ jobs: targetType: 'inline' script: | git clone https://github.com/Azure/typespec-azure.git "$(TypeSpecAzureDirectory)" - $prId = '${{ parameters.TypeSpecJavaPRId }}' - if ($prId) { + $devPackage = [System.Convert]::ToBoolean('${{ parameters.DevPackage }}') + $prId = '${{ parameters.PRId }}' + if ($devPackage) { + if (-not $prId -or $prId -eq 'none') { + Write-Error "PRId is required when DevPackage is true." + exit 1 + } if ($prId -match '^\d+$') { $ref = "refs/pull/$prId/merge" } else { @@ -87,7 +100,7 @@ jobs: # the .tgz next to the package.json for sync_sdk.py to pick up. - task: PowerShell@2 retryCountOnTaskFailure: 1 - condition: and(succeeded(), ne('${{ parameters.TypeSpecJavaPRId }}', '')) + condition: and(succeeded(), eq('${{ parameters.DevPackage }}', 'true')) displayName: 'Build typespec-java dev package' inputs: pwsh: true @@ -114,7 +127,7 @@ jobs: workingDirectory: $(TypeSpecAzureDirectory) - script: | - python3 ./eng/pipelines/scripts/sync_sdk.py --sdk-root=$(Build.SourcesDirectory) --package-json-path=$(TypeSpecAzureDirectory)/packages/typespec-java/package.json --dev-package=${{ ne(parameters.TypeSpecJavaPRId, '') }} + python3 ./eng/pipelines/scripts/sync_sdk.py --sdk-root=$(Build.SourcesDirectory) --package-json-path=$(TypeSpecAzureDirectory)/packages/typespec-java/package.json --dev-package=${{ parameters.DevPackage }} displayName: 'Generate SDK' workingDirectory: $(Build.SourcesDirectory) From 08711baa27c06aa6d4e0790d359e44b987e45121 Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Wed, 8 Jul 2026 17:36:35 +0800 Subject: [PATCH 05/27] Build emitter from main when DevPackage=true and no PRId given DevPackage=false uses the published npm package. DevPackage=true builds the emitter from source: from the typespec-azure PR in PRId, or from main when PRId is left at the 'none' sentinel. Drops the previous PRId-required error. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/post-publish-sdk.yaml | 30 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/eng/pipelines/post-publish-sdk.yaml b/eng/pipelines/post-publish-sdk.yaml index 1a88965cf35c..89dd945f46c5 100644 --- a/eng/pipelines/post-publish-sdk.yaml +++ b/eng/pipelines/post-publish-sdk.yaml @@ -3,22 +3,22 @@ # # The typespec-java emitter lives in Azure/typespec-azure (packages/typespec-java). # By default (DevPackage=false) this pipeline generates using the published -# @azure-tools/typespec-java npm package. To validate an unreleased emitter change, set -# DevPackage=true and provide PRId pointing at a Pull Request in the Azure/typespec-azure -# repository; the emitter dev package is then built from that PR and used for generation. +# @azure-tools/typespec-java npm package. Set DevPackage=true to instead build the emitter +# dev package from source: from the typespec-azure PR given by PRId, or from the default +# branch (main) when PRId is left at 'none'. trigger: none pr: none parameters: # NOTE: Azure DevOps cannot conditionally show/hide runtime parameters, so both are always -# shown. DevPackage defaults to false (a boolean toggle needs no value entered); PRId is only -# used when DevPackage=true, in which case it must be provided. +# shown. DevPackage defaults to false (a boolean toggle needs no value entered). PRId is only +# used when DevPackage=true; leave it at 'none' to build the emitter from main. - name: DevPackage - displayName: 'Build emitter from a typespec-azure PR (instead of the published npm package)' + displayName: 'Build emitter from typespec-azure source (instead of the published npm package)' type: boolean default: false - name: PRId - displayName: 'Pull Request ID in typespec-azure, only used when DevPackage=true (e.g. 43321, or refs/pull/43321/merge)' + displayName: 'typespec-azure Pull Request to build the emitter from, used only when DevPackage=true (e.g. 43321 or refs/pull/43321/merge; leave as none to build from main)' type: string default: 'none' @@ -37,7 +37,10 @@ jobs: value: $(Agent.BuildDirectory)/typespec-azure - name: PullRequestTitleSuffix ${{ if eq(parameters.DevPackage, true) }}: - value: " DEV (typespec-azure PR ${{ parameters.PRId }})" + ${{ if ne(parameters.PRId, 'none') }}: + value: " DEV (typespec-azure PR ${{ parameters.PRId }})" + ${{ else }}: + value: " DEV (typespec-azure main)" ${{ else }}: value: "" @@ -66,8 +69,9 @@ jobs: registryUrl: https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ # Clone the public Azure/typespec-azure repo (no service connection required). When building - # a dev package (DevPackage=true), fetch and check out the specified PR ref. PRId must be set - # in that case (a bare number is expanded to refs/pull//merge; a full ref is used as-is). + # a dev package (DevPackage=true) with a PRId specified, fetch and check out that PR ref + # (a bare number is expanded to refs/pull//merge; a full ref is used as-is). When PRId is + # left at 'none', the emitter is built from the default branch (main). - task: PowerShell@2 displayName: 'Clone typespec-azure' inputs: @@ -77,11 +81,7 @@ jobs: git clone https://github.com/Azure/typespec-azure.git "$(TypeSpecAzureDirectory)" $devPackage = [System.Convert]::ToBoolean('${{ parameters.DevPackage }}') $prId = '${{ parameters.PRId }}' - if ($devPackage) { - if (-not $prId -or $prId -eq 'none') { - Write-Error "PRId is required when DevPackage is true." - exit 1 - } + if ($devPackage -and $prId -and $prId -ne 'none') { if ($prId -match '^\d+$') { $ref = "refs/pull/$prId/merge" } else { From 9438cc5ed462d09a514ee836fe9f97e80ee69239 Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Wed, 8 Jul 2026 17:40:02 +0800 Subject: [PATCH 06/27] Shorten parameter displayNames Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/post-publish-sdk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/post-publish-sdk.yaml b/eng/pipelines/post-publish-sdk.yaml index 89dd945f46c5..10fb2e543dcb 100644 --- a/eng/pipelines/post-publish-sdk.yaml +++ b/eng/pipelines/post-publish-sdk.yaml @@ -14,11 +14,11 @@ parameters: # shown. DevPackage defaults to false (a boolean toggle needs no value entered). PRId is only # used when DevPackage=true; leave it at 'none' to build the emitter from main. - name: DevPackage - displayName: 'Build emitter from typespec-azure source (instead of the published npm package)' + displayName: 'DevPackage' type: boolean default: false - name: PRId - displayName: 'typespec-azure Pull Request to build the emitter from, used only when DevPackage=true (e.g. 43321 or refs/pull/43321/merge; leave as none to build from main)' + displayName: 'typespec-azure PR ID (e.g. 43321; used only when DevPackage=true, none = main)' type: string default: 'none' From 7896b122ee4df5d5bea9bba59b79270ec6b77e9f Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Wed, 8 Jul 2026 17:48:21 +0800 Subject: [PATCH 07/27] Init typespec-azure submodules for dev build The dev build failed because the 'core' submodule (microsoft/typespec) was not checked out: tspd and the http-client-java generator required by Build-Generator.ps1 live there. Initialize submodules after settling on the ref, only when DevPackage=true. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/post-publish-sdk.yaml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/eng/pipelines/post-publish-sdk.yaml b/eng/pipelines/post-publish-sdk.yaml index 10fb2e543dcb..41e87abec2b2 100644 --- a/eng/pipelines/post-publish-sdk.yaml +++ b/eng/pipelines/post-publish-sdk.yaml @@ -71,7 +71,10 @@ jobs: # Clone the public Azure/typespec-azure repo (no service connection required). When building # a dev package (DevPackage=true) with a PRId specified, fetch and check out that PR ref # (a bare number is expanded to refs/pull//merge; a full ref is used as-is). When PRId is - # left at 'none', the emitter is built from the default branch (main). + # left at 'none', the emitter is built from the default branch (main). Submodules are then + # initialized because typespec-azure vendors the TypeSpec compiler and the http-client-java + # generator via the 'core' submodule, which build:generator (Build-Generator.ps1) and tspd + # both require. - task: PowerShell@2 displayName: 'Clone typespec-azure' inputs: @@ -81,15 +84,20 @@ jobs: git clone https://github.com/Azure/typespec-azure.git "$(TypeSpecAzureDirectory)" $devPackage = [System.Convert]::ToBoolean('${{ parameters.DevPackage }}') $prId = '${{ parameters.PRId }}' - if ($devPackage -and $prId -and $prId -ne 'none') { - if ($prId -match '^\d+$') { - $ref = "refs/pull/$prId/merge" - } else { - $ref = $prId + if ($devPackage) { + if ($prId -and $prId -ne 'none') { + if ($prId -match '^\d+$') { + $ref = "refs/pull/$prId/merge" + } else { + $ref = $prId + } + Write-Host "Fetching typespec-azure ref $ref" + git -C "$(TypeSpecAzureDirectory)" fetch origin $ref + git -C "$(TypeSpecAzureDirectory)" checkout FETCH_HEAD } - Write-Host "Fetching typespec-azure ref $ref" - git -C "$(TypeSpecAzureDirectory)" fetch origin $ref - git -C "$(TypeSpecAzureDirectory)" checkout FETCH_HEAD + # The 'core' submodule (microsoft/typespec) provides tspd and the http-client-java + # generator, both required by the dev build; init it only when actually building. + git -C "$(TypeSpecAzureDirectory)" submodule update --init --recursive } # Build the emitter dev package (.tgz) from the typespec-azure PR. From ad234fb67149ae92b0dde7ec5a4ead673d9bcf26 Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Thu, 9 Jul 2026 10:58:42 +0800 Subject: [PATCH 08/27] Resolve catalog:/workspace: deps for dev emitter package tsp-client generate-lock-file failed with 'Unsupported URL Type catalog:' because New-EmitterPackageJson.ps1 was fed the typespec-azure monorepo source package.json, whose deps use the catalog:/workspace: protocols. Extract the packed tarball's package.json instead (pnpm pack resolves those protocols to concrete versions) and use it as the basis for emitter-package.json. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/scripts/sync_sdk.py | 50 ++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/eng/pipelines/scripts/sync_sdk.py b/eng/pipelines/scripts/sync_sdk.py index 0f67ff979f18..aabe296d42ee 100644 --- a/eng/pipelines/scripts/sync_sdk.py +++ b/eng/pipelines/scripts/sync_sdk.py @@ -11,6 +11,7 @@ import glob import shutil import json +import tarfile from typing import List sdk_root: str @@ -52,13 +53,36 @@ def parse_args() -> argparse.Namespace: def update_emitter(package_json_path: str, use_dev_package: bool): if use_dev_package: # we cannot use "tsp-client generate-config-files" in dev mode, as this command also updates the lock file + + # Locate the dev package tarball produced by "pnpm pack". + dev_package_path = None + typespec_extension_path = os.path.dirname(package_json_path) + for file in os.listdir(typespec_extension_path): + if file.endswith(".tgz"): + dev_package_path = os.path.abspath(os.path.join(typespec_extension_path, file)) + logging.info(f'Found dev package at "{dev_package_path}"') + break + if not dev_package_path: + logging.error("Failed to locate the dev package.") + return + + # The monorepo source package.json (typespec-azure) declares dependencies with the + # "catalog:" and "workspace:" protocols, which npm cannot resolve. The packed tarball + # contains a package.json with those protocols resolved to concrete versions, so use it + # as the basis for emitter-package.json instead of the source package.json. + resolved_package_json_path = os.path.join(typespec_extension_path, "package.resolved.json") + with tarfile.open(dev_package_path, "r:gz") as tar: + with tar.extractfile("package/package.json") as member: + with open(resolved_package_json_path, "wb") as f: + f.write(member.read()) + logging.info("Update emitter-package.json") subprocess.check_call( [ "pwsh", "./eng/common/scripts/typespec/New-EmitterPackageJson.ps1", "-PackageJsonPath", - package_json_path, + resolved_package_json_path, "-OutputDirectory", "eng", ], @@ -66,23 +90,13 @@ def update_emitter(package_json_path: str, use_dev_package: bool): ) # replace version with path to dev package - dev_package_path = None - typespec_extension_path = os.path.dirname(package_json_path) - for file in os.listdir(typespec_extension_path): - if file.endswith(".tgz"): - dev_package_path = os.path.abspath(os.path.join(typespec_extension_path, file)) - logging.info(f'Found dev package at "{dev_package_path}"') - break - if dev_package_path: - emitter_package_path = os.path.join(sdk_root, "eng", "emitter-package.json") - with open(emitter_package_path, "r") as json_file: - package_json = json.load(json_file) - package_json["dependencies"]["@azure-tools/typespec-java"] = dev_package_path - with open(emitter_package_path, "w") as json_file: - logging.info(f'Update emitter-package.json to use typespec-java from "{dev_package_path}"') - json.dump(package_json, json_file, indent=2) - else: - logging.error("Failed to locate the dev package.") + emitter_package_path = os.path.join(sdk_root, "eng", "emitter-package.json") + with open(emitter_package_path, "r") as json_file: + package_json = json.load(json_file) + package_json["dependencies"]["@azure-tools/typespec-java"] = dev_package_path + with open(emitter_package_path, "w") as json_file: + logging.info(f'Update emitter-package.json to use typespec-java from "{dev_package_path}"') + json.dump(package_json, json_file, indent=2) # only enable it on dev branch # update_latest_dev() From e10c21ec4622b9ebdc1f9909207569f84fe68535 Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Thu, 9 Jul 2026 14:27:34 +0800 Subject: [PATCH 09/27] Make version-pinned regen the default route (post-publish) The default (DevPackage=false) route now pins eng/emitter-package.json to the published emitter given by TypeSpecJavaVersion, then regenerates - matching the post-publish-sdk intent. sync_sdk.py gains --emitter-version: it npm-packs the published package, seeds emitter-package.json from the tarball's resolved package.json, and regenerates the lock. DevPackage=true still builds from source (PRId or main). The typespec-azure clone/build steps are gated to the dev route, and the default route fails fast if no version is given. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/post-publish-sdk.yaml | 80 ++++++++++++--------- eng/pipelines/scripts/sync_sdk.py | 104 +++++++++++++++++++--------- 2 files changed, 121 insertions(+), 63 deletions(-) diff --git a/eng/pipelines/post-publish-sdk.yaml b/eng/pipelines/post-publish-sdk.yaml index 41e87abec2b2..bba1d328513d 100644 --- a/eng/pipelines/post-publish-sdk.yaml +++ b/eng/pipelines/post-publish-sdk.yaml @@ -2,19 +2,24 @@ # then opens an automated draft PR with the results. # # The typespec-java emitter lives in Azure/typespec-azure (packages/typespec-java). -# By default (DevPackage=false) this pipeline generates using the published -# @azure-tools/typespec-java npm package. Set DevPackage=true to instead build the emitter -# dev package from source: from the typespec-azure PR given by PRId, or from the default -# branch (main) when PRId is left at 'none'. +# Default route (DevPackage=false): pins eng/emitter-package.json to the published +# @azure-tools/typespec-java version given by TypeSpecJavaVersion, then regenerates. This is +# the post-publish path and does not touch typespec-azure sources. +# Dev route (DevPackage=true): builds the emitter dev package from source instead - from the +# typespec-azure PR given by PRId, or from the default branch (main) when PRId is 'none'. trigger: none pr: none parameters: -# NOTE: Azure DevOps cannot conditionally show/hide runtime parameters, so both are always -# shown. DevPackage defaults to false (a boolean toggle needs no value entered). PRId is only -# used when DevPackage=true; leave it at 'none' to build the emitter from main. +# NOTE: Azure DevOps cannot conditionally show/hide runtime parameters, so all are always +# shown. For the default (post-publish) route, set TypeSpecJavaVersion and leave DevPackage +# unchecked. DevPackage/PRId are only for building the emitter from source. +- name: TypeSpecJavaVersion + displayName: 'Published @azure-tools/typespec-java version to regenerate with (e.g. 0.45.4). Required unless DevPackage=true' + type: string + default: '' - name: DevPackage - displayName: 'DevPackage' + displayName: 'DevPackage (build emitter from typespec-azure source instead of a published version)' type: boolean default: false - name: PRId @@ -32,9 +37,13 @@ jobs: - template: /eng/pipelines/templates/variables/image.yml - name: NodeVersion value: '24.x' - # Local clone target for the (public) Azure/typespec-azure emitter repo. + # Local clone target for the (public) Azure/typespec-azure emitter repo (dev route only). - name: TypeSpecAzureDirectory value: $(Agent.BuildDirectory)/typespec-azure + # For the default route this is the published version. For the dev route it is overwritten at + # runtime from the built emitter's package.json (see 'Get Package Version'). + - name: PackageVersion + value: ${{ parameters.TypeSpecJavaVersion }} - name: PullRequestTitleSuffix ${{ if eq(parameters.DevPackage, true) }}: ${{ if ne(parameters.PRId, 'none') }}: @@ -68,37 +77,43 @@ jobs: parameters: registryUrl: https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ - # Clone the public Azure/typespec-azure repo (no service connection required). When building - # a dev package (DevPackage=true) with a PRId specified, fetch and check out that PR ref - # (a bare number is expanded to refs/pull//merge; a full ref is used as-is). When PRId is - # left at 'none', the emitter is built from the default branch (main). Submodules are then - # initialized because typespec-azure vendors the TypeSpec compiler and the http-client-java - # generator via the 'core' submodule, which build:generator (Build-Generator.ps1) and tspd - # both require. + # Fail fast: the default (post-publish) route requires an explicit published version. + - task: PowerShell@2 + displayName: 'Validate parameters' + condition: and(succeeded(), ne('${{ parameters.DevPackage }}', 'true'), eq('${{ parameters.TypeSpecJavaVersion }}', '')) + inputs: + pwsh: true + targetType: 'inline' + script: | + Write-Error "TypeSpecJavaVersion is required when DevPackage is false." + exit 1 + + # Clone the public Azure/typespec-azure repo (dev route only; no service connection required). + # With a PRId specified, fetch and check out that PR ref (a bare number is expanded to + # refs/pull//merge; a full ref is used as-is). When PRId is 'none', the emitter is built + # from the default branch (main). Submodules are then initialized because typespec-azure + # vendors the TypeSpec compiler and the http-client-java generator via the 'core' submodule, + # which build:generator (Build-Generator.ps1) and tspd both require. - task: PowerShell@2 displayName: 'Clone typespec-azure' + condition: and(succeeded(), eq('${{ parameters.DevPackage }}', 'true')) inputs: pwsh: true targetType: 'inline' script: | git clone https://github.com/Azure/typespec-azure.git "$(TypeSpecAzureDirectory)" - $devPackage = [System.Convert]::ToBoolean('${{ parameters.DevPackage }}') $prId = '${{ parameters.PRId }}' - if ($devPackage) { - if ($prId -and $prId -ne 'none') { - if ($prId -match '^\d+$') { - $ref = "refs/pull/$prId/merge" - } else { - $ref = $prId - } - Write-Host "Fetching typespec-azure ref $ref" - git -C "$(TypeSpecAzureDirectory)" fetch origin $ref - git -C "$(TypeSpecAzureDirectory)" checkout FETCH_HEAD + if ($prId -and $prId -ne 'none') { + if ($prId -match '^\d+$') { + $ref = "refs/pull/$prId/merge" + } else { + $ref = $prId } - # The 'core' submodule (microsoft/typespec) provides tspd and the http-client-java - # generator, both required by the dev build; init it only when actually building. - git -C "$(TypeSpecAzureDirectory)" submodule update --init --recursive + Write-Host "Fetching typespec-azure ref $ref" + git -C "$(TypeSpecAzureDirectory)" fetch origin $ref + git -C "$(TypeSpecAzureDirectory)" checkout FETCH_HEAD } + git -C "$(TypeSpecAzureDirectory)" submodule update --init --recursive # Build the emitter dev package (.tgz) from the typespec-azure PR. # typespec-java depends on other workspace packages (workspace:^). First build only those @@ -124,8 +139,11 @@ jobs: npm install -g @azure-tools/typespec-client-generator-cli displayName: 'Install tsp-client' + # Dev route only: the built emitter's version drives the PR title. For the default route + # PackageVersion is already the published TypeSpecJavaVersion. - task: PowerShell@2 displayName: 'Get Package Version' + condition: and(succeeded(), eq('${{ parameters.DevPackage }}', 'true')) inputs: pwsh: true targetType: 'inline' @@ -135,7 +153,7 @@ jobs: workingDirectory: $(TypeSpecAzureDirectory) - script: | - python3 ./eng/pipelines/scripts/sync_sdk.py --sdk-root=$(Build.SourcesDirectory) --package-json-path=$(TypeSpecAzureDirectory)/packages/typespec-java/package.json --dev-package=${{ parameters.DevPackage }} + python3 ./eng/pipelines/scripts/sync_sdk.py --sdk-root=$(Build.SourcesDirectory) --dev-package=${{ parameters.DevPackage }} --emitter-version='${{ parameters.TypeSpecJavaVersion }}' --package-json-path=$(TypeSpecAzureDirectory)/packages/typespec-java/package.json displayName: 'Generate SDK' workingDirectory: $(Build.SourcesDirectory) diff --git a/eng/pipelines/scripts/sync_sdk.py b/eng/pipelines/scripts/sync_sdk.py index aabe296d42ee..d34b497ae805 100644 --- a/eng/pipelines/scripts/sync_sdk.py +++ b/eng/pipelines/scripts/sync_sdk.py @@ -12,6 +12,7 @@ import shutil import json import tarfile +import tempfile from typing import List sdk_root: str @@ -37,22 +38,59 @@ def parse_args() -> argparse.Namespace: parser.add_argument( "--package-json-path", type=str, - required=True, - help="path to package.json of typespec-java.", + required=False, + default="", + help="path to package.json of typespec-java. Required when --dev-package is true.", ) parser.add_argument( "--dev-package", type=str, required=False, default="false", - help="use build from the branch, instead of published typespec-java.", + help="build the emitter from source, instead of using a published typespec-java.", + ) + parser.add_argument( + "--emitter-version", + type=str, + required=False, + default="", + help="published @azure-tools/typespec-java version to regenerate with. " + "Required (default route) unless --dev-package is true.", ) return parser.parse_args() -def update_emitter(package_json_path: str, use_dev_package: bool): +EMITTER_PACKAGE_NAME = "@azure-tools/typespec-java" + + +def extract_package_json_from_tgz(tgz_path: str, dest_path: str) -> None: + # npm/pnpm pack tarballs place all files under a top-level "package/" directory. The + # package.json inside has the "catalog:"/"workspace:" protocols resolved to concrete + # versions, which is what emitter-package.json needs (npm cannot resolve those protocols). + with tarfile.open(tgz_path, "r:gz") as tar: + with tar.extractfile("package/package.json") as member: + with open(dest_path, "wb") as f: + f.write(member.read()) + + +def generate_emitter_package_json(resolved_package_json_path: str) -> None: + subprocess.check_call( + [ + "pwsh", + "./eng/common/scripts/typespec/New-EmitterPackageJson.ps1", + "-PackageJsonPath", + resolved_package_json_path, + "-OutputDirectory", + "eng", + ], + cwd=sdk_root, + ) + + +def update_emitter(package_json_path: str, use_dev_package: bool, emitter_version: str): if use_dev_package: - # we cannot use "tsp-client generate-config-files" in dev mode, as this command also updates the lock file + # Dev route: build the emitter from source. We cannot use "tsp-client + # generate-config-files" here, as it would resolve against a published version. # Locate the dev package tarball produced by "pnpm pack". dev_package_path = None @@ -66,48 +104,46 @@ def update_emitter(package_json_path: str, use_dev_package: bool): logging.error("Failed to locate the dev package.") return - # The monorepo source package.json (typespec-azure) declares dependencies with the - # "catalog:" and "workspace:" protocols, which npm cannot resolve. The packed tarball - # contains a package.json with those protocols resolved to concrete versions, so use it - # as the basis for emitter-package.json instead of the source package.json. resolved_package_json_path = os.path.join(typespec_extension_path, "package.resolved.json") - with tarfile.open(dev_package_path, "r:gz") as tar: - with tar.extractfile("package/package.json") as member: - with open(resolved_package_json_path, "wb") as f: - f.write(member.read()) + extract_package_json_from_tgz(dev_package_path, resolved_package_json_path) logging.info("Update emitter-package.json") - subprocess.check_call( - [ - "pwsh", - "./eng/common/scripts/typespec/New-EmitterPackageJson.ps1", - "-PackageJsonPath", - resolved_package_json_path, - "-OutputDirectory", - "eng", - ], - cwd=sdk_root, - ) + generate_emitter_package_json(resolved_package_json_path) # replace version with path to dev package emitter_package_path = os.path.join(sdk_root, "eng", "emitter-package.json") with open(emitter_package_path, "r") as json_file: package_json = json.load(json_file) - package_json["dependencies"]["@azure-tools/typespec-java"] = dev_package_path + package_json["dependencies"][EMITTER_PACKAGE_NAME] = dev_package_path with open(emitter_package_path, "w") as json_file: logging.info(f'Update emitter-package.json to use typespec-java from "{dev_package_path}"') json.dump(package_json, json_file, indent=2) - # only enable it on dev branch - # update_latest_dev() + logging.info("Update emitter-package-lock.json") + generate_lock_file() + elif emitter_version: + # Default route (post-publish): pin emitter-package.json to a published version. + logging.info(f"Pin emitter-package.json to published typespec-java {emitter_version}") + with tempfile.TemporaryDirectory() as tmp_dir: + # Download the published tarball so its package.json (with resolved dependency + # versions) can seed emitter-package.json, consistent with the dev route. + subprocess.check_call( + ["npm", "pack", f"{EMITTER_PACKAGE_NAME}@{emitter_version}", "--pack-destination", tmp_dir], + cwd=sdk_root, + ) + tgz_files = glob.glob(os.path.join(tmp_dir, "*.tgz")) + if not tgz_files: + raise RuntimeError(f"Failed to download typespec-java {emitter_version} from npm.") + resolved_package_json_path = os.path.join(tmp_dir, "package.resolved.json") + extract_package_json_from_tgz(tgz_files[0], resolved_package_json_path) + + logging.info("Update emitter-package.json") + generate_emitter_package_json(resolved_package_json_path) logging.info("Update emitter-package-lock.json") generate_lock_file() else: - logging.info("Update emitter-package.json and emitter-package-lock.json") - subprocess.check_call( - ["tsp-client", "generate-config-files", "--package-json", package_json_path], cwd=sdk_root - ) + raise ValueError("Either --emitter-version (default route) or --dev-package must be provided.") def update_latest_dev(): @@ -267,7 +303,11 @@ def main(): args = vars(parse_args()) sdk_root = args["sdk_root"] - update_emitter(args["package_json_path"], args["dev_package"].lower() == "true") + update_emitter( + args["package_json_path"], + args["dev_package"].lower() == "true", + args["emitter_version"], + ) update_sdks() From 377b2d8a7c097022aa08c8ea54cb14ca0dac4412 Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Thu, 9 Jul 2026 14:32:31 +0800 Subject: [PATCH 10/27] Drop DevPackage; infer route from TypeSpecJavaVersion The presence of a published version fully determines the route, so DevPackage is redundant. TypeSpecJavaVersion set = published route; empty = build emitter from source (PRId, or main). sync_sdk.py drops --dev-package and infers the route from --emitter-version. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/post-publish-sdk.yaml | 50 ++++++++-------------- eng/pipelines/scripts/sync_sdk.py | 65 +++++++++++++---------------- 2 files changed, 46 insertions(+), 69 deletions(-) diff --git a/eng/pipelines/post-publish-sdk.yaml b/eng/pipelines/post-publish-sdk.yaml index bba1d328513d..ff370b006dd8 100644 --- a/eng/pipelines/post-publish-sdk.yaml +++ b/eng/pipelines/post-publish-sdk.yaml @@ -2,28 +2,23 @@ # then opens an automated draft PR with the results. # # The typespec-java emitter lives in Azure/typespec-azure (packages/typespec-java). -# Default route (DevPackage=false): pins eng/emitter-package.json to the published -# @azure-tools/typespec-java version given by TypeSpecJavaVersion, then regenerates. This is -# the post-publish path and does not touch typespec-azure sources. -# Dev route (DevPackage=true): builds the emitter dev package from source instead - from the -# typespec-azure PR given by PRId, or from the default branch (main) when PRId is 'none'. +# Published route (TypeSpecJavaVersion set): pins eng/emitter-package.json to that published +# @azure-tools/typespec-java version, then regenerates. This is the post-publish path and does +# not touch typespec-azure sources. +# Dev route (TypeSpecJavaVersion empty): builds the emitter dev package from source instead - +# from the typespec-azure PR given by PRId, or from the default branch (main) when PRId is 'none'. trigger: none pr: none parameters: -# NOTE: Azure DevOps cannot conditionally show/hide runtime parameters, so all are always -# shown. For the default (post-publish) route, set TypeSpecJavaVersion and leave DevPackage -# unchecked. DevPackage/PRId are only for building the emitter from source. +# Set TypeSpecJavaVersion for the default (post-publish) route. Leave it empty to build the +# emitter from source, in which case PRId selects the typespec-azure PR (or main). - name: TypeSpecJavaVersion - displayName: 'Published @azure-tools/typespec-java version to regenerate with (e.g. 0.45.4). Required unless DevPackage=true' + displayName: 'Published @azure-tools/typespec-java version to regenerate with (e.g. 0.45.4). Leave empty to build the emitter from source' type: string default: '' -- name: DevPackage - displayName: 'DevPackage (build emitter from typespec-azure source instead of a published version)' - type: boolean - default: false - name: PRId - displayName: 'typespec-azure PR ID (e.g. 43321; used only when DevPackage=true, none = main)' + displayName: 'typespec-azure PR ID (e.g. 43321; used only when TypeSpecJavaVersion is empty, none = main)' type: string default: 'none' @@ -40,12 +35,12 @@ jobs: # Local clone target for the (public) Azure/typespec-azure emitter repo (dev route only). - name: TypeSpecAzureDirectory value: $(Agent.BuildDirectory)/typespec-azure - # For the default route this is the published version. For the dev route it is overwritten at + # For the published route this is the given version. For the dev route it is overwritten at # runtime from the built emitter's package.json (see 'Get Package Version'). - name: PackageVersion value: ${{ parameters.TypeSpecJavaVersion }} - name: PullRequestTitleSuffix - ${{ if eq(parameters.DevPackage, true) }}: + ${{ if eq(parameters.TypeSpecJavaVersion, '') }}: ${{ if ne(parameters.PRId, 'none') }}: value: " DEV (typespec-azure PR ${{ parameters.PRId }})" ${{ else }}: @@ -77,17 +72,6 @@ jobs: parameters: registryUrl: https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ - # Fail fast: the default (post-publish) route requires an explicit published version. - - task: PowerShell@2 - displayName: 'Validate parameters' - condition: and(succeeded(), ne('${{ parameters.DevPackage }}', 'true'), eq('${{ parameters.TypeSpecJavaVersion }}', '')) - inputs: - pwsh: true - targetType: 'inline' - script: | - Write-Error "TypeSpecJavaVersion is required when DevPackage is false." - exit 1 - # Clone the public Azure/typespec-azure repo (dev route only; no service connection required). # With a PRId specified, fetch and check out that PR ref (a bare number is expanded to # refs/pull//merge; a full ref is used as-is). When PRId is 'none', the emitter is built @@ -96,7 +80,7 @@ jobs: # which build:generator (Build-Generator.ps1) and tspd both require. - task: PowerShell@2 displayName: 'Clone typespec-azure' - condition: and(succeeded(), eq('${{ parameters.DevPackage }}', 'true')) + condition: and(succeeded(), eq('${{ parameters.TypeSpecJavaVersion }}', '')) inputs: pwsh: true targetType: 'inline' @@ -123,7 +107,7 @@ jobs: # the .tgz next to the package.json for sync_sdk.py to pick up. - task: PowerShell@2 retryCountOnTaskFailure: 1 - condition: and(succeeded(), eq('${{ parameters.DevPackage }}', 'true')) + condition: and(succeeded(), eq('${{ parameters.TypeSpecJavaVersion }}', '')) displayName: 'Build typespec-java dev package' inputs: pwsh: true @@ -139,11 +123,11 @@ jobs: npm install -g @azure-tools/typespec-client-generator-cli displayName: 'Install tsp-client' - # Dev route only: the built emitter's version drives the PR title. For the default route - # PackageVersion is already the published TypeSpecJavaVersion. + # Dev route only: the built emitter's version drives the PR title. For the published route + # PackageVersion is already the given TypeSpecJavaVersion. - task: PowerShell@2 displayName: 'Get Package Version' - condition: and(succeeded(), eq('${{ parameters.DevPackage }}', 'true')) + condition: and(succeeded(), eq('${{ parameters.TypeSpecJavaVersion }}', '')) inputs: pwsh: true targetType: 'inline' @@ -153,7 +137,7 @@ jobs: workingDirectory: $(TypeSpecAzureDirectory) - script: | - python3 ./eng/pipelines/scripts/sync_sdk.py --sdk-root=$(Build.SourcesDirectory) --dev-package=${{ parameters.DevPackage }} --emitter-version='${{ parameters.TypeSpecJavaVersion }}' --package-json-path=$(TypeSpecAzureDirectory)/packages/typespec-java/package.json + python3 ./eng/pipelines/scripts/sync_sdk.py --sdk-root=$(Build.SourcesDirectory) --emitter-version='${{ parameters.TypeSpecJavaVersion }}' --package-json-path=$(TypeSpecAzureDirectory)/packages/typespec-java/package.json displayName: 'Generate SDK' workingDirectory: $(Build.SourcesDirectory) diff --git a/eng/pipelines/scripts/sync_sdk.py b/eng/pipelines/scripts/sync_sdk.py index d34b497ae805..14d1eafe6684 100644 --- a/eng/pipelines/scripts/sync_sdk.py +++ b/eng/pipelines/scripts/sync_sdk.py @@ -40,22 +40,16 @@ def parse_args() -> argparse.Namespace: type=str, required=False, default="", - help="path to package.json of typespec-java. Required when --dev-package is true.", - ) - parser.add_argument( - "--dev-package", - type=str, - required=False, - default="false", - help="build the emitter from source, instead of using a published typespec-java.", + help="path to package.json of typespec-java. Required when --emitter-version is empty " + "(the dev build route).", ) parser.add_argument( "--emitter-version", type=str, required=False, default="", - help="published @azure-tools/typespec-java version to regenerate with. " - "Required (default route) unless --dev-package is true.", + help="published @azure-tools/typespec-java version to regenerate with. When empty, the " + "emitter is built from source (dev route) instead.", ) return parser.parse_args() @@ -87,10 +81,33 @@ def generate_emitter_package_json(resolved_package_json_path: str) -> None: ) -def update_emitter(package_json_path: str, use_dev_package: bool, emitter_version: str): - if use_dev_package: +def update_emitter(package_json_path: str, emitter_version: str): + if emitter_version: + # Published route (post-publish): pin emitter-package.json to a published version. + logging.info(f"Pin emitter-package.json to published typespec-java {emitter_version}") + with tempfile.TemporaryDirectory() as tmp_dir: + # Download the published tarball so its package.json (with resolved dependency + # versions) can seed emitter-package.json, consistent with the dev route. + subprocess.check_call( + ["npm", "pack", f"{EMITTER_PACKAGE_NAME}@{emitter_version}", "--pack-destination", tmp_dir], + cwd=sdk_root, + ) + tgz_files = glob.glob(os.path.join(tmp_dir, "*.tgz")) + if not tgz_files: + raise RuntimeError(f"Failed to download typespec-java {emitter_version} from npm.") + resolved_package_json_path = os.path.join(tmp_dir, "package.resolved.json") + extract_package_json_from_tgz(tgz_files[0], resolved_package_json_path) + + logging.info("Update emitter-package.json") + generate_emitter_package_json(resolved_package_json_path) + + logging.info("Update emitter-package-lock.json") + generate_lock_file() + else: # Dev route: build the emitter from source. We cannot use "tsp-client # generate-config-files" here, as it would resolve against a published version. + if not package_json_path: + raise ValueError("--package-json-path is required when --emitter-version is empty.") # Locate the dev package tarball produced by "pnpm pack". dev_package_path = None @@ -121,29 +138,6 @@ def update_emitter(package_json_path: str, use_dev_package: bool, emitter_versio logging.info("Update emitter-package-lock.json") generate_lock_file() - elif emitter_version: - # Default route (post-publish): pin emitter-package.json to a published version. - logging.info(f"Pin emitter-package.json to published typespec-java {emitter_version}") - with tempfile.TemporaryDirectory() as tmp_dir: - # Download the published tarball so its package.json (with resolved dependency - # versions) can seed emitter-package.json, consistent with the dev route. - subprocess.check_call( - ["npm", "pack", f"{EMITTER_PACKAGE_NAME}@{emitter_version}", "--pack-destination", tmp_dir], - cwd=sdk_root, - ) - tgz_files = glob.glob(os.path.join(tmp_dir, "*.tgz")) - if not tgz_files: - raise RuntimeError(f"Failed to download typespec-java {emitter_version} from npm.") - resolved_package_json_path = os.path.join(tmp_dir, "package.resolved.json") - extract_package_json_from_tgz(tgz_files[0], resolved_package_json_path) - - logging.info("Update emitter-package.json") - generate_emitter_package_json(resolved_package_json_path) - - logging.info("Update emitter-package-lock.json") - generate_lock_file() - else: - raise ValueError("Either --emitter-version (default route) or --dev-package must be provided.") def update_latest_dev(): @@ -305,7 +299,6 @@ def main(): update_emitter( args["package_json_path"], - args["dev_package"].lower() == "true", args["emitter_version"], ) From 7ea6d69259585cd717319275893b217eabdb0451 Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Thu, 9 Jul 2026 14:37:07 +0800 Subject: [PATCH 11/27] Default TypeSpecJavaVersion to 'none' sentinel Azure DevOps string parameters cannot be left truly empty in the run UI, so default TypeSpecJavaVersion to the 'none' sentinel (matching PRId). Pipeline conditions compare against 'none'; sync_sdk.py normalizes 'none' to empty and treats it as the dev (build-from-source) route. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/post-publish-sdk.yaml | 25 ++++++++++++++----------- eng/pipelines/scripts/sync_sdk.py | 5 +++++ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/eng/pipelines/post-publish-sdk.yaml b/eng/pipelines/post-publish-sdk.yaml index ff370b006dd8..62735b005eb8 100644 --- a/eng/pipelines/post-publish-sdk.yaml +++ b/eng/pipelines/post-publish-sdk.yaml @@ -5,20 +5,20 @@ # Published route (TypeSpecJavaVersion set): pins eng/emitter-package.json to that published # @azure-tools/typespec-java version, then regenerates. This is the post-publish path and does # not touch typespec-azure sources. -# Dev route (TypeSpecJavaVersion empty): builds the emitter dev package from source instead - -# from the typespec-azure PR given by PRId, or from the default branch (main) when PRId is 'none'. +# Dev route (TypeSpecJavaVersion is 'none'): builds the emitter dev package from source instead +# - from the typespec-azure PR given by PRId, or from the default branch (main) when PRId is 'none'. trigger: none pr: none parameters: -# Set TypeSpecJavaVersion for the default (post-publish) route. Leave it empty to build the +# Set TypeSpecJavaVersion for the default (post-publish) route. Leave it as 'none' to build the # emitter from source, in which case PRId selects the typespec-azure PR (or main). - name: TypeSpecJavaVersion - displayName: 'Published @azure-tools/typespec-java version to regenerate with (e.g. 0.45.4). Leave empty to build the emitter from source' + displayName: 'Published @azure-tools/typespec-java version to regenerate with (e.g. 0.45.4). Leave as none to build the emitter from source' type: string - default: '' + default: 'none' - name: PRId - displayName: 'typespec-azure PR ID (e.g. 43321; used only when TypeSpecJavaVersion is empty, none = main)' + displayName: 'typespec-azure PR ID (e.g. 43321; used only when TypeSpecJavaVersion is none, none = main)' type: string default: 'none' @@ -38,9 +38,12 @@ jobs: # For the published route this is the given version. For the dev route it is overwritten at # runtime from the built emitter's package.json (see 'Get Package Version'). - name: PackageVersion - value: ${{ parameters.TypeSpecJavaVersion }} + ${{ if ne(parameters.TypeSpecJavaVersion, 'none') }}: + value: ${{ parameters.TypeSpecJavaVersion }} + ${{ else }}: + value: '' - name: PullRequestTitleSuffix - ${{ if eq(parameters.TypeSpecJavaVersion, '') }}: + ${{ if eq(parameters.TypeSpecJavaVersion, 'none') }}: ${{ if ne(parameters.PRId, 'none') }}: value: " DEV (typespec-azure PR ${{ parameters.PRId }})" ${{ else }}: @@ -80,7 +83,7 @@ jobs: # which build:generator (Build-Generator.ps1) and tspd both require. - task: PowerShell@2 displayName: 'Clone typespec-azure' - condition: and(succeeded(), eq('${{ parameters.TypeSpecJavaVersion }}', '')) + condition: and(succeeded(), eq('${{ parameters.TypeSpecJavaVersion }}', 'none')) inputs: pwsh: true targetType: 'inline' @@ -107,7 +110,7 @@ jobs: # the .tgz next to the package.json for sync_sdk.py to pick up. - task: PowerShell@2 retryCountOnTaskFailure: 1 - condition: and(succeeded(), eq('${{ parameters.TypeSpecJavaVersion }}', '')) + condition: and(succeeded(), eq('${{ parameters.TypeSpecJavaVersion }}', 'none')) displayName: 'Build typespec-java dev package' inputs: pwsh: true @@ -127,7 +130,7 @@ jobs: # PackageVersion is already the given TypeSpecJavaVersion. - task: PowerShell@2 displayName: 'Get Package Version' - condition: and(succeeded(), eq('${{ parameters.TypeSpecJavaVersion }}', '')) + condition: and(succeeded(), eq('${{ parameters.TypeSpecJavaVersion }}', 'none')) inputs: pwsh: true targetType: 'inline' diff --git a/eng/pipelines/scripts/sync_sdk.py b/eng/pipelines/scripts/sync_sdk.py index 14d1eafe6684..2c7185d4b4e6 100644 --- a/eng/pipelines/scripts/sync_sdk.py +++ b/eng/pipelines/scripts/sync_sdk.py @@ -82,6 +82,11 @@ def generate_emitter_package_json(resolved_package_json_path: str) -> None: def update_emitter(package_json_path: str, emitter_version: str): + # 'none' is the pipeline sentinel for "not specified" (Azure DevOps string parameters + # cannot be left truly empty in the run UI), so normalize it to empty here. + if emitter_version.lower() == "none": + emitter_version = "" + if emitter_version: # Published route (post-publish): pin emitter-package.json to a published version. logging.info(f"Pin emitter-package.json to published typespec-java {emitter_version}") From fc918d88b68ef7e995b8b9ce84d86cab9aad2794 Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Thu, 9 Jul 2026 15:10:04 +0800 Subject: [PATCH 12/27] Refine parameter displayNames (Emitter Version) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/post-publish-sdk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/post-publish-sdk.yaml b/eng/pipelines/post-publish-sdk.yaml index 62735b005eb8..edddff3b79c8 100644 --- a/eng/pipelines/post-publish-sdk.yaml +++ b/eng/pipelines/post-publish-sdk.yaml @@ -14,11 +14,11 @@ parameters: # Set TypeSpecJavaVersion for the default (post-publish) route. Leave it as 'none' to build the # emitter from source, in which case PRId selects the typespec-azure PR (or main). - name: TypeSpecJavaVersion - displayName: 'Published @azure-tools/typespec-java version to regenerate with (e.g. 0.45.4). Leave as none to build the emitter from source' + displayName: 'Emitter Version — published @azure-tools/typespec-java to regenerate with (e.g. 0.45.4; none = build from source)' type: string default: 'none' - name: PRId - displayName: 'typespec-azure PR ID (e.g. 43321; used only when TypeSpecJavaVersion is none, none = main)' + displayName: 'typespec-azure PR ID — used only when Emitter Version is none (e.g. 43321; none = main)' type: string default: 'none' From 224711833f8ed2d766adcfbb974eb600afbf0a99 Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Thu, 9 Jul 2026 15:20:12 +0800 Subject: [PATCH 13/27] Rename to post-publish-emitter.yaml and sync_emitter.py Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../{post-publish-sdk.yaml => post-publish-emitter.yaml} | 4 ++-- eng/pipelines/scripts/{sync_sdk.py => sync_emitter.py} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename eng/pipelines/{post-publish-sdk.yaml => post-publish-emitter.yaml} (95%) rename eng/pipelines/scripts/{sync_sdk.py => sync_emitter.py} (100%) diff --git a/eng/pipelines/post-publish-sdk.yaml b/eng/pipelines/post-publish-emitter.yaml similarity index 95% rename from eng/pipelines/post-publish-sdk.yaml rename to eng/pipelines/post-publish-emitter.yaml index edddff3b79c8..42ca0ea96fb4 100644 --- a/eng/pipelines/post-publish-sdk.yaml +++ b/eng/pipelines/post-publish-emitter.yaml @@ -107,7 +107,7 @@ jobs: # upstream dependencies with turbo (the `^...` filter selects dependencies but excludes # typespec-java itself). Then Build-TypeSpec.ps1 builds and packs typespec-java (its # build:generator step runs Build-Generator.ps1, which needs JDK 11+ and Maven), producing - # the .tgz next to the package.json for sync_sdk.py to pick up. + # the .tgz next to the package.json for sync_emitter.py to pick up. - task: PowerShell@2 retryCountOnTaskFailure: 1 condition: and(succeeded(), eq('${{ parameters.TypeSpecJavaVersion }}', 'none')) @@ -140,7 +140,7 @@ jobs: workingDirectory: $(TypeSpecAzureDirectory) - script: | - python3 ./eng/pipelines/scripts/sync_sdk.py --sdk-root=$(Build.SourcesDirectory) --emitter-version='${{ parameters.TypeSpecJavaVersion }}' --package-json-path=$(TypeSpecAzureDirectory)/packages/typespec-java/package.json + python3 ./eng/pipelines/scripts/sync_emitter.py --sdk-root=$(Build.SourcesDirectory) --emitter-version='${{ parameters.TypeSpecJavaVersion }}' --package-json-path=$(TypeSpecAzureDirectory)/packages/typespec-java/package.json displayName: 'Generate SDK' workingDirectory: $(Build.SourcesDirectory) diff --git a/eng/pipelines/scripts/sync_sdk.py b/eng/pipelines/scripts/sync_emitter.py similarity index 100% rename from eng/pipelines/scripts/sync_sdk.py rename to eng/pipelines/scripts/sync_emitter.py From fc517a55c610f8603b62186492c353b4d13bb1c3 Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Thu, 9 Jul 2026 15:23:38 +0800 Subject: [PATCH 14/27] Rename pipeline parameter TypeSpecJavaVersion to EmitterVersion Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/post-publish-emitter.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/eng/pipelines/post-publish-emitter.yaml b/eng/pipelines/post-publish-emitter.yaml index 42ca0ea96fb4..291964afaf03 100644 --- a/eng/pipelines/post-publish-emitter.yaml +++ b/eng/pipelines/post-publish-emitter.yaml @@ -2,18 +2,18 @@ # then opens an automated draft PR with the results. # # The typespec-java emitter lives in Azure/typespec-azure (packages/typespec-java). -# Published route (TypeSpecJavaVersion set): pins eng/emitter-package.json to that published +# Published route (EmitterVersion set): pins eng/emitter-package.json to that published # @azure-tools/typespec-java version, then regenerates. This is the post-publish path and does # not touch typespec-azure sources. -# Dev route (TypeSpecJavaVersion is 'none'): builds the emitter dev package from source instead +# Dev route (EmitterVersion is 'none'): builds the emitter dev package from source instead # - from the typespec-azure PR given by PRId, or from the default branch (main) when PRId is 'none'. trigger: none pr: none parameters: -# Set TypeSpecJavaVersion for the default (post-publish) route. Leave it as 'none' to build the +# Set EmitterVersion for the default (post-publish) route. Leave it as 'none' to build the # emitter from source, in which case PRId selects the typespec-azure PR (or main). -- name: TypeSpecJavaVersion +- name: EmitterVersion displayName: 'Emitter Version — published @azure-tools/typespec-java to regenerate with (e.g. 0.45.4; none = build from source)' type: string default: 'none' @@ -38,12 +38,12 @@ jobs: # For the published route this is the given version. For the dev route it is overwritten at # runtime from the built emitter's package.json (see 'Get Package Version'). - name: PackageVersion - ${{ if ne(parameters.TypeSpecJavaVersion, 'none') }}: - value: ${{ parameters.TypeSpecJavaVersion }} + ${{ if ne(parameters.EmitterVersion, 'none') }}: + value: ${{ parameters.EmitterVersion }} ${{ else }}: value: '' - name: PullRequestTitleSuffix - ${{ if eq(parameters.TypeSpecJavaVersion, 'none') }}: + ${{ if eq(parameters.EmitterVersion, 'none') }}: ${{ if ne(parameters.PRId, 'none') }}: value: " DEV (typespec-azure PR ${{ parameters.PRId }})" ${{ else }}: @@ -83,7 +83,7 @@ jobs: # which build:generator (Build-Generator.ps1) and tspd both require. - task: PowerShell@2 displayName: 'Clone typespec-azure' - condition: and(succeeded(), eq('${{ parameters.TypeSpecJavaVersion }}', 'none')) + condition: and(succeeded(), eq('${{ parameters.EmitterVersion }}', 'none')) inputs: pwsh: true targetType: 'inline' @@ -110,7 +110,7 @@ jobs: # the .tgz next to the package.json for sync_emitter.py to pick up. - task: PowerShell@2 retryCountOnTaskFailure: 1 - condition: and(succeeded(), eq('${{ parameters.TypeSpecJavaVersion }}', 'none')) + condition: and(succeeded(), eq('${{ parameters.EmitterVersion }}', 'none')) displayName: 'Build typespec-java dev package' inputs: pwsh: true @@ -127,10 +127,10 @@ jobs: displayName: 'Install tsp-client' # Dev route only: the built emitter's version drives the PR title. For the published route - # PackageVersion is already the given TypeSpecJavaVersion. + # PackageVersion is already the given EmitterVersion. - task: PowerShell@2 displayName: 'Get Package Version' - condition: and(succeeded(), eq('${{ parameters.TypeSpecJavaVersion }}', 'none')) + condition: and(succeeded(), eq('${{ parameters.EmitterVersion }}', 'none')) inputs: pwsh: true targetType: 'inline' @@ -140,7 +140,7 @@ jobs: workingDirectory: $(TypeSpecAzureDirectory) - script: | - python3 ./eng/pipelines/scripts/sync_emitter.py --sdk-root=$(Build.SourcesDirectory) --emitter-version='${{ parameters.TypeSpecJavaVersion }}' --package-json-path=$(TypeSpecAzureDirectory)/packages/typespec-java/package.json + python3 ./eng/pipelines/scripts/sync_emitter.py --sdk-root=$(Build.SourcesDirectory) --emitter-version='${{ parameters.EmitterVersion }}' --package-json-path=$(TypeSpecAzureDirectory)/packages/typespec-java/package.json displayName: 'Generate SDK' workingDirectory: $(Build.SourcesDirectory) From 5de30fca086074ae471092641fba8fd1da1d3064 Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Thu, 9 Jul 2026 15:28:23 +0800 Subject: [PATCH 15/27] Use tsp-client generate-config-files for the published route Once the published tarball is downloaded via npm pack, its package.json has resolved dependency versions, so tsp-client generate-config-files can consume it directly to produce both emitter-package.json and its lock file - replacing the separate New-EmitterPackageJson.ps1 + generate-lock-file calls. The dev route still uses those two steps to inject the local .tgz path between them. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/scripts/sync_emitter.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/eng/pipelines/scripts/sync_emitter.py b/eng/pipelines/scripts/sync_emitter.py index 2c7185d4b4e6..a9ac4a610bff 100644 --- a/eng/pipelines/scripts/sync_emitter.py +++ b/eng/pipelines/scripts/sync_emitter.py @@ -91,8 +91,10 @@ def update_emitter(package_json_path: str, emitter_version: str): # Published route (post-publish): pin emitter-package.json to a published version. logging.info(f"Pin emitter-package.json to published typespec-java {emitter_version}") with tempfile.TemporaryDirectory() as tmp_dir: - # Download the published tarball so its package.json (with resolved dependency - # versions) can seed emitter-package.json, consistent with the dev route. + # Download the published tarball. Its package.json has the dependency versions + # resolved (unlike the typespec-azure monorepo source, which uses the "catalog:"/ + # "workspace:" protocols that npm cannot resolve), so tsp-client generate-config-files + # can consume it directly to produce emitter-package.json and its lock file. subprocess.check_call( ["npm", "pack", f"{EMITTER_PACKAGE_NAME}@{emitter_version}", "--pack-destination", tmp_dir], cwd=sdk_root, @@ -103,11 +105,11 @@ def update_emitter(package_json_path: str, emitter_version: str): resolved_package_json_path = os.path.join(tmp_dir, "package.resolved.json") extract_package_json_from_tgz(tgz_files[0], resolved_package_json_path) - logging.info("Update emitter-package.json") - generate_emitter_package_json(resolved_package_json_path) - - logging.info("Update emitter-package-lock.json") - generate_lock_file() + logging.info("Update emitter-package.json and emitter-package-lock.json") + subprocess.check_call( + ["tsp-client", "generate-config-files", "--package-json", resolved_package_json_path], + cwd=sdk_root, + ) else: # Dev route: build the emitter from source. We cannot use "tsp-client # generate-config-files" here, as it would resolve against a published version. From fc1b8815fa4741252f79d17227119c27420b4a86 Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Thu, 9 Jul 2026 16:25:04 +0800 Subject: [PATCH 16/27] Pin dev-route emitter deps to exact versions pnpm pack resolves workspace:^ dependencies to caret ranges (e.g. ^0.69.1) in the packed package.json. New-EmitterPackageJson.ps1 pins peer deps from those devDependencies values, so carets leaked into emitter-package.json (^0.69.0 instead of the exact 0.69.2 that autorest.java produced). Strip the leading caret/tilde from the extracted package.json so peer deps are pinned to exact versions. Simple ranges like '>=x --- eng/pipelines/scripts/sync_emitter.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/eng/pipelines/scripts/sync_emitter.py b/eng/pipelines/scripts/sync_emitter.py index a9ac4a610bff..2d1a47a36097 100644 --- a/eng/pipelines/scripts/sync_emitter.py +++ b/eng/pipelines/scripts/sync_emitter.py @@ -13,6 +13,7 @@ import json import tarfile import tempfile +import re from typing import List sdk_root: str @@ -67,6 +68,26 @@ def extract_package_json_from_tgz(tgz_path: str, dest_path: str) -> None: f.write(member.read()) +def pin_exact_versions(package_json_path: str) -> None: + # pnpm pack resolves "workspace:^" dependencies to caret ranges (e.g. "^0.69.1") in the + # packed package.json. New-EmitterPackageJson.ps1 pins each peer dependency to the value in + # devDependencies, so those caret ranges would leak into emitter-package.json. Strip the + # leading range operator so peer dependencies are pinned to exact versions (matching how the + # emitter was published/built). + with open(package_json_path, "r", encoding="utf-8") as f: + package_json = json.load(f) + for section in ("dependencies", "devDependencies", "peerDependencies"): + deps = package_json.get(section) + if not deps: + continue + for name, version in deps.items(): + if isinstance(version, str): + # Turn a simple caret/tilde range (e.g. "^0.69.1", "~1.2.3") into an exact version. + deps[name] = re.sub(r"^[\^~]\s*(?=\d)", "", version) + with open(package_json_path, "w", encoding="utf-8") as f: + json.dump(package_json, f, indent=2) + + def generate_emitter_package_json(resolved_package_json_path: str) -> None: subprocess.check_call( [ @@ -130,6 +151,7 @@ def update_emitter(package_json_path: str, emitter_version: str): resolved_package_json_path = os.path.join(typespec_extension_path, "package.resolved.json") extract_package_json_from_tgz(dev_package_path, resolved_package_json_path) + pin_exact_versions(resolved_package_json_path) logging.info("Update emitter-package.json") generate_emitter_package_json(resolved_package_json_path) From e0e3229207b41856d05a0d128af1daf63125d901 Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Thu, 9 Jul 2026 16:26:22 +0800 Subject: [PATCH 17/27] Revert "Pin dev-route emitter deps to exact versions" This reverts commit fc1b8815fa4741252f79d17227119c27420b4a86. --- eng/pipelines/scripts/sync_emitter.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/eng/pipelines/scripts/sync_emitter.py b/eng/pipelines/scripts/sync_emitter.py index 2d1a47a36097..a9ac4a610bff 100644 --- a/eng/pipelines/scripts/sync_emitter.py +++ b/eng/pipelines/scripts/sync_emitter.py @@ -13,7 +13,6 @@ import json import tarfile import tempfile -import re from typing import List sdk_root: str @@ -68,26 +67,6 @@ def extract_package_json_from_tgz(tgz_path: str, dest_path: str) -> None: f.write(member.read()) -def pin_exact_versions(package_json_path: str) -> None: - # pnpm pack resolves "workspace:^" dependencies to caret ranges (e.g. "^0.69.1") in the - # packed package.json. New-EmitterPackageJson.ps1 pins each peer dependency to the value in - # devDependencies, so those caret ranges would leak into emitter-package.json. Strip the - # leading range operator so peer dependencies are pinned to exact versions (matching how the - # emitter was published/built). - with open(package_json_path, "r", encoding="utf-8") as f: - package_json = json.load(f) - for section in ("dependencies", "devDependencies", "peerDependencies"): - deps = package_json.get(section) - if not deps: - continue - for name, version in deps.items(): - if isinstance(version, str): - # Turn a simple caret/tilde range (e.g. "^0.69.1", "~1.2.3") into an exact version. - deps[name] = re.sub(r"^[\^~]\s*(?=\d)", "", version) - with open(package_json_path, "w", encoding="utf-8") as f: - json.dump(package_json, f, indent=2) - - def generate_emitter_package_json(resolved_package_json_path: str) -> None: subprocess.check_call( [ @@ -151,7 +130,6 @@ def update_emitter(package_json_path: str, emitter_version: str): resolved_package_json_path = os.path.join(typespec_extension_path, "package.resolved.json") extract_package_json_from_tgz(dev_package_path, resolved_package_json_path) - pin_exact_versions(resolved_package_json_path) logging.info("Update emitter-package.json") generate_emitter_package_json(resolved_package_json_path) From d8442086a3be2469120faa85557570f50ac66972 Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Fri, 10 Jul 2026 10:11:35 +0800 Subject: [PATCH 18/27] Only update emitter version in emitter-package.json, not peer deps Regenerating emitter-package.json from the emitter tarball pinned the peer/dev dependency versions from that tarball, which could be stale (e.g. an older typespec-client-generator-core than the one being released). Instead, only overwrite the @azure-tools/typespec-java dependency (published version or dev .tgz path) in the existing emitter-package.json and regenerate the lock file. Other dependency versions are managed elsewhere and updated before the pipeline runs. Removes the now-unused tarball extraction / config-file generation helpers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- eng/pipelines/scripts/sync_emitter.py | 88 +++++++-------------------- 1 file changed, 23 insertions(+), 65 deletions(-) diff --git a/eng/pipelines/scripts/sync_emitter.py b/eng/pipelines/scripts/sync_emitter.py index a9ac4a610bff..ba3289d25d37 100644 --- a/eng/pipelines/scripts/sync_emitter.py +++ b/eng/pipelines/scripts/sync_emitter.py @@ -11,8 +11,6 @@ import glob import shutil import json -import tarfile -import tempfile from typing import List sdk_root: str @@ -57,28 +55,19 @@ def parse_args() -> argparse.Namespace: EMITTER_PACKAGE_NAME = "@azure-tools/typespec-java" -def extract_package_json_from_tgz(tgz_path: str, dest_path: str) -> None: - # npm/pnpm pack tarballs place all files under a top-level "package/" directory. The - # package.json inside has the "catalog:"/"workspace:" protocols resolved to concrete - # versions, which is what emitter-package.json needs (npm cannot resolve those protocols). - with tarfile.open(tgz_path, "r:gz") as tar: - with tar.extractfile("package/package.json") as member: - with open(dest_path, "wb") as f: - f.write(member.read()) - - -def generate_emitter_package_json(resolved_package_json_path: str) -> None: - subprocess.check_call( - [ - "pwsh", - "./eng/common/scripts/typespec/New-EmitterPackageJson.ps1", - "-PackageJsonPath", - resolved_package_json_path, - "-OutputDirectory", - "eng", - ], - cwd=sdk_root, - ) +def set_emitter_dependency(emitter_ref: str) -> None: + # Only update the typespec-java dependency in the existing emitter-package.json. The other + # (peer/dev) dependency versions are managed elsewhere and updated before this pipeline runs, + # so we intentionally do not regenerate them from the emitter tarball (which may pin stale + # versions, e.g. an older typespec-client-generator-core). emitter_ref is either a published + # version string or a local path to the dev package tarball. + emitter_package_path = os.path.join(sdk_root, "eng", "emitter-package.json") + with open(emitter_package_path, "r") as json_file: + package_json = json.load(json_file) + package_json["dependencies"][EMITTER_PACKAGE_NAME] = emitter_ref + with open(emitter_package_path, "w") as json_file: + logging.info(f"Update emitter-package.json to use typespec-java {emitter_ref}") + json.dump(package_json, json_file, indent=2) def update_emitter(package_json_path: str, emitter_version: str): @@ -88,35 +77,17 @@ def update_emitter(package_json_path: str, emitter_version: str): emitter_version = "" if emitter_version: - # Published route (post-publish): pin emitter-package.json to a published version. - logging.info(f"Pin emitter-package.json to published typespec-java {emitter_version}") - with tempfile.TemporaryDirectory() as tmp_dir: - # Download the published tarball. Its package.json has the dependency versions - # resolved (unlike the typespec-azure monorepo source, which uses the "catalog:"/ - # "workspace:" protocols that npm cannot resolve), so tsp-client generate-config-files - # can consume it directly to produce emitter-package.json and its lock file. - subprocess.check_call( - ["npm", "pack", f"{EMITTER_PACKAGE_NAME}@{emitter_version}", "--pack-destination", tmp_dir], - cwd=sdk_root, - ) - tgz_files = glob.glob(os.path.join(tmp_dir, "*.tgz")) - if not tgz_files: - raise RuntimeError(f"Failed to download typespec-java {emitter_version} from npm.") - resolved_package_json_path = os.path.join(tmp_dir, "package.resolved.json") - extract_package_json_from_tgz(tgz_files[0], resolved_package_json_path) - - logging.info("Update emitter-package.json and emitter-package-lock.json") - subprocess.check_call( - ["tsp-client", "generate-config-files", "--package-json", resolved_package_json_path], - cwd=sdk_root, - ) + # Published route (post-publish): point emitter-package.json at a published version + # (released or unreleased/dev), then regenerate the lock file. + set_emitter_dependency(emitter_version) else: - # Dev route: build the emitter from source. We cannot use "tsp-client - # generate-config-files" here, as it would resolve against a published version. + # Dev route: build the emitter from source, then point emitter-package.json at the local + # dev package tarball. if not package_json_path: raise ValueError("--package-json-path is required when --emitter-version is empty.") - # Locate the dev package tarball produced by "pnpm pack". + # Locate the dev package tarball built by the "Build typespec-java dev package" step of + # the post-publish-emitter pipeline (pnpm pack), next to the emitter's package.json. dev_package_path = None typespec_extension_path = os.path.dirname(package_json_path) for file in os.listdir(typespec_extension_path): @@ -128,23 +99,10 @@ def update_emitter(package_json_path: str, emitter_version: str): logging.error("Failed to locate the dev package.") return - resolved_package_json_path = os.path.join(typespec_extension_path, "package.resolved.json") - extract_package_json_from_tgz(dev_package_path, resolved_package_json_path) - - logging.info("Update emitter-package.json") - generate_emitter_package_json(resolved_package_json_path) - - # replace version with path to dev package - emitter_package_path = os.path.join(sdk_root, "eng", "emitter-package.json") - with open(emitter_package_path, "r") as json_file: - package_json = json.load(json_file) - package_json["dependencies"][EMITTER_PACKAGE_NAME] = dev_package_path - with open(emitter_package_path, "w") as json_file: - logging.info(f'Update emitter-package.json to use typespec-java from "{dev_package_path}"') - json.dump(package_json, json_file, indent=2) + set_emitter_dependency(dev_package_path) - logging.info("Update emitter-package-lock.json") - generate_lock_file() + logging.info("Update emitter-package-lock.json") + generate_lock_file() def update_latest_dev(): From b00ccb6fd955d3c9556d4dda47534f8d24404746 Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Thu, 16 Jul 2026 12:25:40 +0800 Subject: [PATCH 19/27] Seed emitter-package.json from emitter and inject designated libs Dev route now seeds emitter-package.json from the built dev package via New-EmitterPackageJson.ps1 (instead of generate-config-files, which resolves against a published version that does not exist for a dev build) and points the emitter dependency at the local tarball. Published route uses tsp-client generate-config-files against the resolved published package.json. Both routes then inject the designated TypeSpec libraries that the emitter does not declare (openai-typespec, typespec-liftr-base, typespec-azure-portal-core), pinned to their latest published version via 'npm view @latest version', and regenerate the lock file. This avoids adding those libraries as emitter dependencies in Azure/typespec-azure (PR 4866). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: abf20313-1bb4-4ae3-9764-f0562785cf32 --- eng/pipelines/scripts/sync_emitter.py | 116 +++++++++++++++++++++++--- 1 file changed, 106 insertions(+), 10 deletions(-) diff --git a/eng/pipelines/scripts/sync_emitter.py b/eng/pipelines/scripts/sync_emitter.py index ba3289d25d37..36e2b81a4da2 100644 --- a/eng/pipelines/scripts/sync_emitter.py +++ b/eng/pipelines/scripts/sync_emitter.py @@ -11,6 +11,8 @@ import glob import shutil import json +import tarfile +import tempfile from typing import List sdk_root: str @@ -54,13 +56,75 @@ def parse_args() -> argparse.Namespace: EMITTER_PACKAGE_NAME = "@azure-tools/typespec-java" +# Extra TypeSpec libraries that some specs depend on but which are intentionally NOT declared as +# dependencies of the typespec-java emitter itself (declaring them there would force every +# downstream emitter/repo to carry them - see discussion on Azure/typespec-azure PR 4866). We +# inject them into emitter-package.json here, pinned to their latest published version, so that +# generated SDKs referencing these libraries still compile. +DESIGNATED_LIBRARIES = [ + "@azure-tools/openai-typespec", + "@azure-tools/typespec-liftr-base", + "@azure-tools/typespec-azure-portal-core", +] + + +def extract_package_json_from_tgz(tgz_path: str, dest_path: str) -> None: + # npm/pnpm pack tarballs place all files under a top-level "package/" directory. The + # package.json inside has the "catalog:"/"workspace:" protocols resolved to concrete + # versions, which is what emitter-package.json needs (npm cannot resolve those protocols). + with tarfile.open(tgz_path, "r:gz") as tar: + with tar.extractfile("package/package.json") as member: + with open(dest_path, "wb") as f: + f.write(member.read()) + + +def generate_emitter_package_json(resolved_package_json_path: str) -> None: + # New-EmitterPackageJson.ps1 seeds emitter-package.json from the emitter's package.json, + # pinning the emitter and its peer dependencies. We use it (instead of + # "tsp-client generate-config-files") for the dev route, because generate-config-files + # resolves against a published version which does not exist for a locally built dev package. + subprocess.check_call( + [ + "pwsh", + "./eng/common/scripts/typespec/New-EmitterPackageJson.ps1", + "-PackageJsonPath", + resolved_package_json_path, + "-OutputDirectory", + "eng", + ], + cwd=sdk_root, + ) + + +def get_latest_published_version(package_name: str) -> str: + # "npm view @latest version" reads the latest published version from the npm registry. + # Preferred over "ncu -u" (which may be unavailable) for looking up designated library versions. + version = subprocess.check_output( + ["npm", "view", f"{package_name}@latest", "version"], + cwd=sdk_root, + text=True, + ).strip() + return version + + +def add_designated_libraries() -> None: + # Add the designated libraries (not declared by the emitter) to emitter-package.json, each + # pinned to its latest published version. Callers must regenerate the lock file afterwards. + emitter_package_path = os.path.join(sdk_root, "eng", "emitter-package.json") + with open(emitter_package_path, "r") as json_file: + package_json = json.load(json_file) + dev_dependencies = package_json.setdefault("devDependencies", {}) + for library in DESIGNATED_LIBRARIES: + version = get_latest_published_version(library) + logging.info(f"Add designated library {library}@{version} to emitter-package.json") + dev_dependencies[library] = version + with open(emitter_package_path, "w") as json_file: + json.dump(package_json, json_file, indent=2) + def set_emitter_dependency(emitter_ref: str) -> None: - # Only update the typespec-java dependency in the existing emitter-package.json. The other - # (peer/dev) dependency versions are managed elsewhere and updated before this pipeline runs, - # so we intentionally do not regenerate them from the emitter tarball (which may pin stale - # versions, e.g. an older typespec-client-generator-core). emitter_ref is either a published - # version string or a local path to the dev package tarball. + # Point the typespec-java dependency in emitter-package.json at emitter_ref, which for the dev + # route is a local path to the freshly built dev package tarball. emitter_package_path = os.path.join(sdk_root, "eng", "emitter-package.json") with open(emitter_package_path, "r") as json_file: package_json = json.load(json_file) @@ -77,12 +141,31 @@ def update_emitter(package_json_path: str, emitter_version: str): emitter_version = "" if emitter_version: - # Published route (post-publish): point emitter-package.json at a published version - # (released or unreleased/dev), then regenerate the lock file. - set_emitter_dependency(emitter_version) + # Published route (post-publish): seed emitter-package.json from the published version. + logging.info(f"Pin emitter-package.json to published typespec-java {emitter_version}") + with tempfile.TemporaryDirectory() as tmp_dir: + # Download the published tarball. Its package.json has the dependency versions + # resolved (unlike the typespec-azure monorepo source, which uses the "catalog:"/ + # "workspace:" protocols that npm cannot resolve), so tsp-client generate-config-files + # can consume it directly to produce emitter-package.json. + subprocess.check_call( + ["npm", "pack", f"{EMITTER_PACKAGE_NAME}@{emitter_version}", "--pack-destination", tmp_dir], + cwd=sdk_root, + ) + tgz_files = glob.glob(os.path.join(tmp_dir, "*.tgz")) + if not tgz_files: + raise RuntimeError(f"Failed to download typespec-java {emitter_version} from npm.") + resolved_package_json_path = os.path.join(tmp_dir, "package.resolved.json") + extract_package_json_from_tgz(tgz_files[0], resolved_package_json_path) + + logging.info("Update emitter-package.json") + subprocess.check_call( + ["tsp-client", "generate-config-files", "--package-json", resolved_package_json_path], + cwd=sdk_root, + ) else: - # Dev route: build the emitter from source, then point emitter-package.json at the local - # dev package tarball. + # Dev route: build the emitter from source, then seed emitter-package.json from the local + # dev package via New-EmitterPackageJson.ps1 and point the emitter dependency at the tarball. if not package_json_path: raise ValueError("--package-json-path is required when --emitter-version is empty.") @@ -99,8 +182,21 @@ def update_emitter(package_json_path: str, emitter_version: str): logging.error("Failed to locate the dev package.") return + # The tarball's package.json has "catalog:"/"workspace:" protocols resolved to concrete + # versions, which New-EmitterPackageJson.ps1 needs (npm cannot resolve those protocols). + resolved_package_json_path = os.path.join(typespec_extension_path, "package.resolved.json") + extract_package_json_from_tgz(dev_package_path, resolved_package_json_path) + + logging.info("Update emitter-package.json") + generate_emitter_package_json(resolved_package_json_path) + + # Point the emitter dependency at the local dev tarball (the dev build is unpublished). set_emitter_dependency(dev_package_path) + # Add the designated libraries that the emitter does not declare, then (re)generate the lock + # file so it reflects both the seeded and the designated dependencies. + add_designated_libraries() + logging.info("Update emitter-package-lock.json") generate_lock_file() From a1ee9abff958d33bfb5a39b5a53ab1ee9360bf1d Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Thu, 16 Jul 2026 13:53:50 +0800 Subject: [PATCH 20/27] Sync emitter deps via npm view + specs repo for designated libs Refine emitter-package.json generation per Azure/typespec-azure PR 4866 review: Published route: seed with 'tsp-client generate-config-files --use-npm-pinning' against the published emitter manifest (obtained via 'npm view --json', no tgz). Dev route: still inspect the built dev .tgz and seed via New-EmitterPackageJson.ps1 (generate-config-files cannot resolve an unpublished dev build), then point the emitter dependency at the local tarball. Both routes then: (1) resolve every @azure-tools/* and @typespec/* devDependency to its latest published exact version via 'npm view @latest version' (--use-npm-pinning alone still yields caret ranges), and (2) add the designated libraries the emitter does not declare (openai-typespec, typespec-liftr-base, typespec-azure-portal-core) pinned to the exact version from the azure-rest-api-specs package.json (fetched from raw.githubusercontent main), falling back to npm latest if the specs repo has not updated yet. Finally regenerate the lock file. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: abf20313-1bb4-4ae3-9764-f0562785cf32 --- eng/pipelines/scripts/sync_emitter.py | 147 ++++++++++++++++++-------- 1 file changed, 101 insertions(+), 46 deletions(-) diff --git a/eng/pipelines/scripts/sync_emitter.py b/eng/pipelines/scripts/sync_emitter.py index 36e2b81a4da2..fd4e5e2fa70b 100644 --- a/eng/pipelines/scripts/sync_emitter.py +++ b/eng/pipelines/scripts/sync_emitter.py @@ -13,6 +13,7 @@ import json import tarfile import tempfile +import urllib.request from typing import List sdk_root: str @@ -56,10 +57,14 @@ def parse_args() -> argparse.Namespace: EMITTER_PACKAGE_NAME = "@azure-tools/typespec-java" -# Extra TypeSpec libraries that some specs depend on but which are intentionally NOT declared as +# Prefixes of the TypeSpec dependency entries in emitter-package.json whose versions we resolve to +# the latest published npm version (see resolve_dependency_versions_to_latest). +TYPESPEC_DEPENDENCY_PREFIXES = ("@azure-tools/", "@typespec/") + +# TypeSpec libraries that some specs depend on but which are intentionally NOT declared as # dependencies of the typespec-java emitter itself (declaring them there would force every -# downstream emitter/repo to carry them - see discussion on Azure/typespec-azure PR 4866). We -# inject them into emitter-package.json here, pinned to their latest published version, so that +# downstream emitter/repo to carry them - see discussion on Azure/typespec-azure PR 4866). We add +# them to emitter-package.json here, versioned from the azure-rest-api-specs package.json, so that # generated SDKs referencing these libraries still compile. DESIGNATED_LIBRARIES = [ "@azure-tools/openai-typespec", @@ -67,6 +72,13 @@ def parse_args() -> argparse.Namespace: "@azure-tools/typespec-azure-portal-core", ] +# package.json of the specs repo, the source of truth for the designated library versions. +SPECS_PACKAGE_JSON_URL = "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/package.json" + + +def emitter_package_json_path() -> str: + return os.path.join(sdk_root, "eng", "emitter-package.json") + def extract_package_json_from_tgz(tgz_path: str, dest_path: str) -> None: # npm/pnpm pack tarballs place all files under a top-level "package/" directory. The @@ -80,8 +92,8 @@ def extract_package_json_from_tgz(tgz_path: str, dest_path: str) -> None: def generate_emitter_package_json(resolved_package_json_path: str) -> None: # New-EmitterPackageJson.ps1 seeds emitter-package.json from the emitter's package.json, - # pinning the emitter and its peer dependencies. We use it (instead of - # "tsp-client generate-config-files") for the dev route, because generate-config-files + # carrying its peer dependencies forward into devDependencies. We use it (instead of + # "tsp-client generate-config-files --use-npm-pinning") for the dev route, because that command # resolves against a published version which does not exist for a locally built dev package. subprocess.check_call( [ @@ -96,42 +108,77 @@ def generate_emitter_package_json(resolved_package_json_path: str) -> None: ) -def get_latest_published_version(package_name: str) -> str: - # "npm view @latest version" reads the latest published version from the npm registry. - # Preferred over "ncu -u" (which may be unavailable) for looking up designated library versions. - version = subprocess.check_output( - ["npm", "view", f"{package_name}@latest", "version"], +def npm_view_version(package_ref: str) -> str: + # "npm view version" reads a published version from the npm registry. Preferred over + # "ncu -u" (which may be unavailable in CFS environments) for looking up dependency versions. + return subprocess.check_output( + ["npm", "view", package_ref, "version"], cwd=sdk_root, text=True, ).strip() - return version -def add_designated_libraries() -> None: - # Add the designated libraries (not declared by the emitter) to emitter-package.json, each - # pinned to its latest published version. Callers must regenerate the lock file afterwards. - emitter_package_path = os.path.join(sdk_root, "eng", "emitter-package.json") - with open(emitter_package_path, "r") as json_file: - package_json = json.load(json_file) - dev_dependencies = package_json.setdefault("devDependencies", {}) - for library in DESIGNATED_LIBRARIES: - version = get_latest_published_version(library) - logging.info(f"Add designated library {library}@{version} to emitter-package.json") - dev_dependencies[library] = version - with open(emitter_package_path, "w") as json_file: +def load_emitter_package_json() -> dict: + with open(emitter_package_json_path(), "r") as json_file: + return json.load(json_file) + + +def save_emitter_package_json(package_json: dict) -> None: + with open(emitter_package_json_path(), "w") as json_file: json.dump(package_json, json_file, indent=2) def set_emitter_dependency(emitter_ref: str) -> None: # Point the typespec-java dependency in emitter-package.json at emitter_ref, which for the dev - # route is a local path to the freshly built dev package tarball. - emitter_package_path = os.path.join(sdk_root, "eng", "emitter-package.json") - with open(emitter_package_path, "r") as json_file: - package_json = json.load(json_file) + # route is a local path to the freshly built dev package tarball (the dev build is unpublished). + package_json = load_emitter_package_json() package_json["dependencies"][EMITTER_PACKAGE_NAME] = emitter_ref - with open(emitter_package_path, "w") as json_file: - logging.info(f"Update emitter-package.json to use typespec-java {emitter_ref}") - json.dump(package_json, json_file, indent=2) + logging.info(f"Update emitter-package.json to use typespec-java {emitter_ref}") + save_emitter_package_json(package_json) + + +def resolve_dependency_versions_to_latest() -> None: + # Seeding (either route) leaves the @azure-tools/* and @typespec/* devDependencies as the + # emitter's caret ranges (e.g. "^0.70.0"), but eng/emitter-package.json must pin exact versions. + # Resolve each of these entries to its latest published version via "npm view ...@latest". + # Designated libraries are handled separately (from the specs repo), so skip them here. + package_json = load_emitter_package_json() + dev_dependencies = package_json.get("devDependencies", {}) + for name in list(dev_dependencies.keys()): + if name in DESIGNATED_LIBRARIES: + continue + if name.startswith(TYPESPEC_DEPENDENCY_PREFIXES): + version = npm_view_version(f"{name}@latest") + logging.info(f"Resolve {name} to latest published version {version}") + dev_dependencies[name] = version + save_emitter_package_json(package_json) + + +def fetch_specs_dev_dependencies() -> dict: + # Read the devDependencies map from the specs repo package.json, the source of truth for the + # designated library versions. + logging.info(f"Fetch designated library versions from {SPECS_PACKAGE_JSON_URL}") + with urllib.request.urlopen(SPECS_PACKAGE_JSON_URL) as response: + specs_package_json = json.loads(response.read().decode("utf-8")) + return specs_package_json.get("devDependencies", {}) + + +def add_designated_libraries() -> None: + # Add the designated libraries (not declared by the emitter) to emitter-package.json, pinned to + # the exact version declared in the specs repo package.json. If a library is missing there (the + # specs repo may not have updated yet), fall back to its latest published npm version. + specs_dev_dependencies = fetch_specs_dev_dependencies() + package_json = load_emitter_package_json() + dev_dependencies = package_json.setdefault("devDependencies", {}) + for library in DESIGNATED_LIBRARIES: + version = specs_dev_dependencies.get(library) + if version: + logging.info(f"Add designated library {library}@{version} (from specs repo)") + else: + version = npm_view_version(f"{library}@latest") + logging.info(f"Add designated library {library}@{version} (specs repo missing it, using npm latest)") + dev_dependencies[library] = version + save_emitter_package_json(package_json) def update_emitter(package_json_path: str, emitter_version: str): @@ -141,26 +188,32 @@ def update_emitter(package_json_path: str, emitter_version: str): emitter_version = "" if emitter_version: - # Published route (post-publish): seed emitter-package.json from the published version. - logging.info(f"Pin emitter-package.json to published typespec-java {emitter_version}") + # Published route (post-publish): seed emitter-package.json from the published emitter. + logging.info(f"Seed emitter-package.json from published typespec-java {emitter_version}") with tempfile.TemporaryDirectory() as tmp_dir: - # Download the published tarball. Its package.json has the dependency versions - # resolved (unlike the typespec-azure monorepo source, which uses the "catalog:"/ - # "workspace:" protocols that npm cannot resolve), so tsp-client generate-config-files - # can consume it directly to produce emitter-package.json. - subprocess.check_call( - ["npm", "pack", f"{EMITTER_PACKAGE_NAME}@{emitter_version}", "--pack-destination", tmp_dir], + # "npm view --json" returns the published registry manifest (name, version, main, + # peerDependencies). tsp-client generate-config-files --use-npm-pinning reads its + # peerDependencies to seed emitter-package.json, pinning the emitter to this version. + manifest = subprocess.check_output( + ["npm", "view", f"{EMITTER_PACKAGE_NAME}@{emitter_version}", "--json"], cwd=sdk_root, + text=True, ) - tgz_files = glob.glob(os.path.join(tmp_dir, "*.tgz")) - if not tgz_files: - raise RuntimeError(f"Failed to download typespec-java {emitter_version} from npm.") - resolved_package_json_path = os.path.join(tmp_dir, "package.resolved.json") - extract_package_json_from_tgz(tgz_files[0], resolved_package_json_path) + published_package_json_path = os.path.join(tmp_dir, "package.json") + with open(published_package_json_path, "w") as f: + f.write(manifest) logging.info("Update emitter-package.json") subprocess.check_call( - ["tsp-client", "generate-config-files", "--package-json", resolved_package_json_path], + [ + "tsp-client", + "generate-config-files", + "--package-json", + published_package_json_path, + "--use-npm-pinning", + "--emitter-package-json-path", + emitter_package_json_path(), + ], cwd=sdk_root, ) else: @@ -193,8 +246,10 @@ def update_emitter(package_json_path: str, emitter_version: str): # Point the emitter dependency at the local dev tarball (the dev build is unpublished). set_emitter_dependency(dev_package_path) - # Add the designated libraries that the emitter does not declare, then (re)generate the lock - # file so it reflects both the seeded and the designated dependencies. + # Both routes: pin the emitter's TypeSpec dependencies to their latest published versions and + # add the designated libraries from the specs repo, then (re)generate the lock file so it + # reflects the final dependency set. + resolve_dependency_versions_to_latest() add_designated_libraries() logging.info("Update emitter-package-lock.json") From d3bf6729dfef52206a5d6d1ecef0bb7994dd28d7 Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Thu, 16 Jul 2026 14:07:03 +0800 Subject: [PATCH 21/27] Unify both routes on tsp-client generate-config-files The dev package tarball's package.json has fully resolved dependency versions (no workspace:/catalog: protocols), so generate-config-files can seed emitter-package.json for the dev route too - removing the New-EmitterPackageJson.ps1 special case. generate-config-files always runs a lock step ('npm install') that resolves the emitter dependency, which fails for an unpublished dev build. The dev route works around this by passing an --overrides file that points @azure-tools/typespec-java at the local dev tarball, so npm installs the emitter from the tarball instead of the registry. --use-npm-pinning is omitted for the dev route (it would 'npm view' the unpublished emitter); the published route keeps it. Both routes still resolve TypeSpec deps to the latest published versions and add the designated libs afterward. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: abf20313-1bb4-4ae3-9764-f0562785cf32 --- eng/pipelines/scripts/sync_emitter.py | 92 +++++++++++++-------------- 1 file changed, 43 insertions(+), 49 deletions(-) diff --git a/eng/pipelines/scripts/sync_emitter.py b/eng/pipelines/scripts/sync_emitter.py index fd4e5e2fa70b..e65ed59fb529 100644 --- a/eng/pipelines/scripts/sync_emitter.py +++ b/eng/pipelines/scripts/sync_emitter.py @@ -83,29 +83,37 @@ def emitter_package_json_path() -> str: def extract_package_json_from_tgz(tgz_path: str, dest_path: str) -> None: # npm/pnpm pack tarballs place all files under a top-level "package/" directory. The # package.json inside has the "catalog:"/"workspace:" protocols resolved to concrete - # versions, which is what emitter-package.json needs (npm cannot resolve those protocols). + # versions, which is what tsp-client generate-config-files needs (npm cannot resolve those + # protocols, and generate-config-files reads the emitter's peerDependencies from this file). with tarfile.open(tgz_path, "r:gz") as tar: with tar.extractfile("package/package.json") as member: with open(dest_path, "wb") as f: f.write(member.read()) -def generate_emitter_package_json(resolved_package_json_path: str) -> None: - # New-EmitterPackageJson.ps1 seeds emitter-package.json from the emitter's package.json, - # carrying its peer dependencies forward into devDependencies. We use it (instead of - # "tsp-client generate-config-files --use-npm-pinning") for the dev route, because that command - # resolves against a published version which does not exist for a locally built dev package. - subprocess.check_call( - [ - "pwsh", - "./eng/common/scripts/typespec/New-EmitterPackageJson.ps1", - "-PackageJsonPath", - resolved_package_json_path, - "-OutputDirectory", - "eng", - ], - cwd=sdk_root, - ) +def generate_config_files(emitter_package_json: str, use_npm_pinning: bool, overrides_path: str = "") -> None: + # tsp-client generate-config-files seeds eng/emitter-package.json from an emitter package.json + # (its peerDependencies) and then generates the lock file (via "npm install"). Used by both + # routes: + # - Published route: use_npm_pinning=True so peer versions are pinned from the published + # emitter's dependencies (looked up with "npm view"). + # - Dev route: overrides_path points the emitter dependency at the locally built dev tarball, + # so the lock-generation "npm install" resolves the (unpublished) emitter from that tarball + # instead of the registry. --use-npm-pinning is not used, because it would "npm view" the + # unpublished dev emitter, which does not exist on the registry. + command = [ + "tsp-client", + "generate-config-files", + "--package-json", + emitter_package_json, + "--emitter-package-json-path", + emitter_package_json_path(), + ] + if use_npm_pinning: + command.append("--use-npm-pinning") + if overrides_path: + command.extend(["--overrides", overrides_path]) + subprocess.check_call(command, cwd=sdk_root) def npm_view_version(package_ref: str) -> str: @@ -128,15 +136,6 @@ def save_emitter_package_json(package_json: dict) -> None: json.dump(package_json, json_file, indent=2) -def set_emitter_dependency(emitter_ref: str) -> None: - # Point the typespec-java dependency in emitter-package.json at emitter_ref, which for the dev - # route is a local path to the freshly built dev package tarball (the dev build is unpublished). - package_json = load_emitter_package_json() - package_json["dependencies"][EMITTER_PACKAGE_NAME] = emitter_ref - logging.info(f"Update emitter-package.json to use typespec-java {emitter_ref}") - save_emitter_package_json(package_json) - - def resolve_dependency_versions_to_latest() -> None: # Seeding (either route) leaves the @azure-tools/* and @typespec/* devDependencies as the # emitter's caret ranges (e.g. "^0.70.0"), but eng/emitter-package.json must pin exact versions. @@ -192,8 +191,8 @@ def update_emitter(package_json_path: str, emitter_version: str): logging.info(f"Seed emitter-package.json from published typespec-java {emitter_version}") with tempfile.TemporaryDirectory() as tmp_dir: # "npm view --json" returns the published registry manifest (name, version, main, - # peerDependencies). tsp-client generate-config-files --use-npm-pinning reads its - # peerDependencies to seed emitter-package.json, pinning the emitter to this version. + # peerDependencies). generate-config-files --use-npm-pinning reads its peerDependencies + # to seed emitter-package.json, pinning the emitter to this published version. manifest = subprocess.check_output( ["npm", "view", f"{EMITTER_PACKAGE_NAME}@{emitter_version}", "--json"], cwd=sdk_root, @@ -204,21 +203,13 @@ def update_emitter(package_json_path: str, emitter_version: str): f.write(manifest) logging.info("Update emitter-package.json") - subprocess.check_call( - [ - "tsp-client", - "generate-config-files", - "--package-json", - published_package_json_path, - "--use-npm-pinning", - "--emitter-package-json-path", - emitter_package_json_path(), - ], - cwd=sdk_root, - ) + generate_config_files(published_package_json_path, use_npm_pinning=True) else: # Dev route: build the emitter from source, then seed emitter-package.json from the local - # dev package via New-EmitterPackageJson.ps1 and point the emitter dependency at the tarball. + # dev package. The dev emitter version is unpublished, so generate-config-files consumes + # the emitter's (resolved) package.json extracted from the dev tarball, and an overrides + # file points the emitter dependency at that tarball so the lock-generation "npm install" + # can resolve the emitter locally instead of from the registry. if not package_json_path: raise ValueError("--package-json-path is required when --emitter-version is empty.") @@ -235,16 +226,19 @@ def update_emitter(package_json_path: str, emitter_version: str): logging.error("Failed to locate the dev package.") return - # The tarball's package.json has "catalog:"/"workspace:" protocols resolved to concrete - # versions, which New-EmitterPackageJson.ps1 needs (npm cannot resolve those protocols). - resolved_package_json_path = os.path.join(typespec_extension_path, "package.resolved.json") - extract_package_json_from_tgz(dev_package_path, resolved_package_json_path) + with tempfile.TemporaryDirectory() as tmp_dir: + # The tarball's package.json has "catalog:"/"workspace:" protocols resolved to concrete + # versions, which generate-config-files needs (npm cannot resolve those protocols). + resolved_package_json_path = os.path.join(tmp_dir, "package.json") + extract_package_json_from_tgz(dev_package_path, resolved_package_json_path) - logging.info("Update emitter-package.json") - generate_emitter_package_json(resolved_package_json_path) + # Point the (unpublished) emitter dependency at the local dev tarball. + overrides_path = os.path.join(tmp_dir, "overrides.json") + with open(overrides_path, "w") as f: + json.dump({EMITTER_PACKAGE_NAME: dev_package_path}, f) - # Point the emitter dependency at the local dev tarball (the dev build is unpublished). - set_emitter_dependency(dev_package_path) + logging.info("Update emitter-package.json") + generate_config_files(resolved_package_json_path, use_npm_pinning=False, overrides_path=overrides_path) # Both routes: pin the emitter's TypeSpec dependencies to their latest published versions and # add the designated libraries from the specs repo, then (re)generate the lock file so it From d0fb3bd62110aebb29b99990ac0bb99bf0c42e48 Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Thu, 16 Jul 2026 15:49:00 +0800 Subject: [PATCH 22/27] Split designated libs: openapi3 from specs, portal-core from npm latest Add @typespec/openapi3 as a designated library (it is carried in eng/emitter-package.json but is not a typespec-java emitter dependency), sourced from the specs repo package.json alongside openai-typespec and typespec-liftr-base. Version typespec-azure-portal-core from the latest published npm version instead, to track the newest release. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: abf20313-1bb4-4ae3-9764-f0562785cf32 --- eng/pipelines/scripts/sync_emitter.py | 39 +++++++++++++++++++++------ 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/eng/pipelines/scripts/sync_emitter.py b/eng/pipelines/scripts/sync_emitter.py index e65ed59fb529..f23f9dd645a7 100644 --- a/eng/pipelines/scripts/sync_emitter.py +++ b/eng/pipelines/scripts/sync_emitter.py @@ -64,15 +64,28 @@ def parse_args() -> argparse.Namespace: # TypeSpec libraries that some specs depend on but which are intentionally NOT declared as # dependencies of the typespec-java emitter itself (declaring them there would force every # downstream emitter/repo to carry them - see discussion on Azure/typespec-azure PR 4866). We add -# them to emitter-package.json here, versioned from the azure-rest-api-specs package.json, so that -# generated SDKs referencing these libraries still compile. -DESIGNATED_LIBRARIES = [ +# them to emitter-package.json here so that generated SDKs referencing these libraries compile. +# +# These are versioned from the azure-rest-api-specs package.json (the source of truth for the +# versions the specs actually use), falling back to the latest published npm version if the specs +# repo has not updated yet. +DESIGNATED_LIBRARIES_FROM_SPECS = [ "@azure-tools/openai-typespec", "@azure-tools/typespec-liftr-base", + "@typespec/openapi3", +] + +# These designated libraries are versioned from the latest published npm version instead of the +# specs repo, because we want to track the newest release rather than what the specs repo pins. +DESIGNATED_LIBRARIES_FROM_NPM_LATEST = [ "@azure-tools/typespec-azure-portal-core", ] -# package.json of the specs repo, the source of truth for the designated library versions. +# All designated libraries, used to exclude them from resolve_dependency_versions_to_latest (they +# are versioned separately by add_designated_libraries). +DESIGNATED_LIBRARIES = DESIGNATED_LIBRARIES_FROM_SPECS + DESIGNATED_LIBRARIES_FROM_NPM_LATEST + +# package.json of the specs repo, the source of truth for the specs-versioned designated libraries. SPECS_PACKAGE_JSON_URL = "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/package.json" @@ -163,13 +176,17 @@ def fetch_specs_dev_dependencies() -> dict: def add_designated_libraries() -> None: - # Add the designated libraries (not declared by the emitter) to emitter-package.json, pinned to - # the exact version declared in the specs repo package.json. If a library is missing there (the - # specs repo may not have updated yet), fall back to its latest published npm version. + # Add the designated libraries (not declared by the emitter) to emitter-package.json. Two + # groups, versioned from different sources: + # - DESIGNATED_LIBRARIES_FROM_SPECS: pinned to the exact version declared in the specs repo + # package.json (the version the specs actually use). If a library is missing there (the + # specs repo may not have updated yet), fall back to its latest published npm version. + # - DESIGNATED_LIBRARIES_FROM_NPM_LATEST: pinned to the latest published npm version. specs_dev_dependencies = fetch_specs_dev_dependencies() package_json = load_emitter_package_json() dev_dependencies = package_json.setdefault("devDependencies", {}) - for library in DESIGNATED_LIBRARIES: + + for library in DESIGNATED_LIBRARIES_FROM_SPECS: version = specs_dev_dependencies.get(library) if version: logging.info(f"Add designated library {library}@{version} (from specs repo)") @@ -177,6 +194,12 @@ def add_designated_libraries() -> None: version = npm_view_version(f"{library}@latest") logging.info(f"Add designated library {library}@{version} (specs repo missing it, using npm latest)") dev_dependencies[library] = version + + for library in DESIGNATED_LIBRARIES_FROM_NPM_LATEST: + version = npm_view_version(f"{library}@latest") + logging.info(f"Add designated library {library}@{version} (from npm latest)") + dev_dependencies[library] = version + save_emitter_package_json(package_json) From 8b94c6fdecc1cdaf33c1689c9646153c2de46c5a Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Thu, 16 Jul 2026 15:50:17 +0800 Subject: [PATCH 23/27] Version openapi3 from npm latest instead of specs repo Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: abf20313-1bb4-4ae3-9764-f0562785cf32 --- eng/pipelines/scripts/sync_emitter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/scripts/sync_emitter.py b/eng/pipelines/scripts/sync_emitter.py index f23f9dd645a7..67bfa46891b6 100644 --- a/eng/pipelines/scripts/sync_emitter.py +++ b/eng/pipelines/scripts/sync_emitter.py @@ -72,13 +72,13 @@ def parse_args() -> argparse.Namespace: DESIGNATED_LIBRARIES_FROM_SPECS = [ "@azure-tools/openai-typespec", "@azure-tools/typespec-liftr-base", - "@typespec/openapi3", ] # These designated libraries are versioned from the latest published npm version instead of the # specs repo, because we want to track the newest release rather than what the specs repo pins. DESIGNATED_LIBRARIES_FROM_NPM_LATEST = [ "@azure-tools/typespec-azure-portal-core", + "@typespec/openapi3", ] # All designated libraries, used to exclude them from resolve_dependency_versions_to_latest (they From 5af665d63ff31ac7be5e17349f72e14a207c9cd8 Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Thu, 16 Jul 2026 16:01:59 +0800 Subject: [PATCH 24/27] Document why portal-core and openapi3 are versioned from npm latest They belong to the same release group as the TypeSpec/Azure libraries the emitter depends on, which are already pinned to latest; keeping them on latest avoids peer conflicts from a lagging specs-repo pin. openai-typespec and typespec-liftr-base are released independently, so they stay sourced from the specs repo. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: abf20313-1bb4-4ae3-9764-f0562785cf32 --- eng/pipelines/scripts/sync_emitter.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/scripts/sync_emitter.py b/eng/pipelines/scripts/sync_emitter.py index 67bfa46891b6..b63b3844bcd0 100644 --- a/eng/pipelines/scripts/sync_emitter.py +++ b/eng/pipelines/scripts/sync_emitter.py @@ -68,14 +68,21 @@ def parse_args() -> argparse.Namespace: # # These are versioned from the azure-rest-api-specs package.json (the source of truth for the # versions the specs actually use), falling back to the latest published npm version if the specs -# repo has not updated yet. +# repo has not updated yet. They are released independently of the TypeSpec compiler/Azure +# libraries, so their specs-pinned version does not have to move in lockstep with the emitter's +# other dependencies. DESIGNATED_LIBRARIES_FROM_SPECS = [ "@azure-tools/openai-typespec", "@azure-tools/typespec-liftr-base", ] # These designated libraries are versioned from the latest published npm version instead of the -# specs repo, because we want to track the newest release rather than what the specs repo pins. +# specs repo. They belong to the same release group as the TypeSpec compiler / Azure libraries that +# the emitter depends on (e.g. @typespec/*, @azure-tools/typespec-azure-*), which +# resolve_dependency_versions_to_latest already pins to the latest published version. Sourcing +# these from npm latest too keeps the whole release group on the same version, avoiding peer +# conflicts that a lagging specs-repo pin (e.g. openapi3 requiring an older @typespec/http) would +# otherwise cause. DESIGNATED_LIBRARIES_FROM_NPM_LATEST = [ "@azure-tools/typespec-azure-portal-core", "@typespec/openapi3", From 1d161efe17cc20970aab252d747b27a77920bdce Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Thu, 16 Jul 2026 16:22:19 +0800 Subject: [PATCH 25/27] Temporarily skip openai-typespec and typespec-liftr-base as designated libs These two are currently peer dependencies of typespec-java, so generate-config-files pins them (openai-typespec to the exact peer 1.21.0). Re-versioning them as designated libs from the specs repo would violate the emitter's peer constraint and break the lock 'npm install' with ERESOLVE. Skip them for now (kept in DESIGNATED_LIBRARIES_SKIPPED so they stay excluded from resolve-to-latest) and pin emitter-package.json to compatible versions (openai-typespec 1.21.0, typespec-liftr-base 0.14.0). TODO: move them back into DESIGNATED_LIBRARIES_FROM_SPECS once removed from typespec-java's peerDependencies. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: abf20313-1bb4-4ae3-9764-f0562785cf32 --- eng/emitter-package.json | 2 +- eng/pipelines/scripts/sync_emitter.py | 30 +++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 865c11d13de3..5b51bbaf2bba 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -4,7 +4,7 @@ "@azure-tools/typespec-java": "0.45.5" }, "devDependencies": { - "@azure-tools/openai-typespec": "1.20.0", + "@azure-tools/openai-typespec": "1.21.0", "@azure-tools/typespec-autorest": "0.69.1", "@azure-tools/typespec-azure-core": "0.69.0", "@azure-tools/typespec-azure-resource-manager": "0.69.2", diff --git a/eng/pipelines/scripts/sync_emitter.py b/eng/pipelines/scripts/sync_emitter.py index b63b3844bcd0..d2487226daf0 100644 --- a/eng/pipelines/scripts/sync_emitter.py +++ b/eng/pipelines/scripts/sync_emitter.py @@ -71,9 +71,13 @@ def parse_args() -> argparse.Namespace: # repo has not updated yet. They are released independently of the TypeSpec compiler/Azure # libraries, so their specs-pinned version does not have to move in lockstep with the emitter's # other dependencies. +# +# TODO: openai-typespec and typespec-liftr-base are TEMPORARILY skipped (see +# DESIGNATED_LIBRARIES_SKIPPED below). Add them back to this list once they are removed from +# typespec-java's peerDependencies. DESIGNATED_LIBRARIES_FROM_SPECS = [ - "@azure-tools/openai-typespec", - "@azure-tools/typespec-liftr-base", + # "@azure-tools/openai-typespec", # TODO: re-enable when removed from typespec-java peers + # "@azure-tools/typespec-liftr-base", # TODO: re-enable when removed from typespec-java peers ] # These designated libraries are versioned from the latest published npm version instead of the @@ -88,9 +92,27 @@ def parse_args() -> argparse.Namespace: "@typespec/openapi3", ] +# Designated libraries that are TEMPORARILY skipped: they are still declared as peer dependencies +# of typespec-java, so generate-config-files already pins them (openai-typespec to the emitter's +# exact peer, e.g. 1.21.0). We must NOT re-version them here - overriding the emitter's peer pin +# with a different version (from the specs repo or npm latest) would violate the peer constraint +# and break the lock-file "npm install" with ERESOLVE. They are listed here (rather than dropped +# entirely) so they remain excluded from resolve_dependency_versions_to_latest, which would +# otherwise override the emitter's pin with the latest published version. +# +# TODO: remove this list and move these packages back into DESIGNATED_LIBRARIES_FROM_SPECS once +# they are removed from typespec-java's peerDependencies. +DESIGNATED_LIBRARIES_SKIPPED = [ + "@azure-tools/openai-typespec", + "@azure-tools/typespec-liftr-base", +] + # All designated libraries, used to exclude them from resolve_dependency_versions_to_latest (they -# are versioned separately by add_designated_libraries). -DESIGNATED_LIBRARIES = DESIGNATED_LIBRARIES_FROM_SPECS + DESIGNATED_LIBRARIES_FROM_NPM_LATEST +# are versioned separately by add_designated_libraries, or intentionally left as the emitter's peer +# pin for the skipped ones). +DESIGNATED_LIBRARIES = ( + DESIGNATED_LIBRARIES_FROM_SPECS + DESIGNATED_LIBRARIES_FROM_NPM_LATEST + DESIGNATED_LIBRARIES_SKIPPED +) # package.json of the specs repo, the source of truth for the specs-versioned designated libraries. SPECS_PACKAGE_JSON_URL = "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/package.json" From 820e19b96755c57c176becc38cde69e6a92be331 Mon Sep 17 00:00:00 2001 From: "Xiaofei Cao (from Dev Box)" Date: Thu, 16 Jul 2026 16:48:06 +0800 Subject: [PATCH 26/27] Remove stale designated libs before seeding to avoid merge ERESOLVE tsp-client generate-config-files MERGES into an existing eng/emitter-package.json and only overwrites emitter-peer entries. A designated library carried over from a previous run (e.g. @typespec/openapi3, which is not an emitter peer) kept its stale version and conflicted with the freshly pinned peers, breaking the internal lock-generation 'npm install' with ERESOLVE - the failure seen in the sync pipeline for 0.45.6. Remove the designated libraries from the existing emitter-package.json before generating, so the merge starts from only the emitter's own peers; they are added back afterward (from npm latest or the specs repo). Skipped designated libs (still emitter peers) are re-added by generate-config-files from the emitter's peerDependencies. This preserves the file's existing key order (cleaner diffs) versus deleting the whole file. Verified locally end-to-end (published route, 0.45.6): remove-designated, clean seed, internal lock, resolve-to-latest, designated libs, and final lock all succeed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: abf20313-1bb4-4ae3-9764-f0562785cf32 --- eng/pipelines/scripts/sync_emitter.py | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/eng/pipelines/scripts/sync_emitter.py b/eng/pipelines/scripts/sync_emitter.py index d2487226daf0..1424f016145c 100644 --- a/eng/pipelines/scripts/sync_emitter.py +++ b/eng/pipelines/scripts/sync_emitter.py @@ -143,6 +143,20 @@ def generate_config_files(emitter_package_json: str, use_npm_pinning: bool, over # so the lock-generation "npm install" resolves the (unpublished) emitter from that tarball # instead of the registry. --use-npm-pinning is not used, because it would "npm view" the # unpublished dev emitter, which does not exist on the registry. + # + # Remove the designated libraries from any existing eng/emitter-package.json first: + # generate-config-files MERGES into it rather than replacing it, and it only overwrites entries + # that are emitter peers. A designated library left from a previous run (e.g. @typespec/openapi3, + # which is NOT an emitter peer) would survive the merge with its stale version and break the + # lock-generation "npm install" with ERESOLVE. We add the designated libraries back (from npm + # latest or the specs repo) after seeding, so the merge starts from only the emitter's own peers. + # + # Alternative: delete the whole eng/emitter-package.json before generating (os.remove) so it is + # seeded entirely from scratch. That is more robust against non-designated orphans (e.g. an + # emitter peer that was dropped), but it regenerates the key order from the emitter manifest, + # producing noisier diffs. We remove only the designated entries to keep the existing key order. + remove_designated_libraries() + command = [ "tsp-client", "generate-config-files", @@ -178,6 +192,25 @@ def save_emitter_package_json(package_json: dict) -> None: json.dump(package_json, json_file, indent=2) +def remove_designated_libraries() -> None: + # Remove the designated libraries from an existing eng/emitter-package.json before seeding. + # generate-config-files merges into that file and only overwrites emitter-peer entries, so a + # designated library carried over from a previous run (e.g. @typespec/openapi3) would keep its + # stale version and conflict with the freshly pinned peers. They are added back afterward by + # add_designated_libraries. The skipped designated libraries (still emitter peers) are re-added + # by generate-config-files itself from the emitter's peerDependencies. + path = emitter_package_json_path() + if not os.path.exists(path): + return + package_json = load_emitter_package_json() + dev_dependencies = package_json.get("devDependencies", {}) + for library in DESIGNATED_LIBRARIES: + if library in dev_dependencies: + logging.info(f"Remove designated library {library} before seeding") + del dev_dependencies[library] + save_emitter_package_json(package_json) + + def resolve_dependency_versions_to_latest() -> None: # Seeding (either route) leaves the @azure-tools/* and @typespec/* devDependencies as the # emitter's caret ranges (e.g. "^0.70.0"), but eng/emitter-package.json must pin exact versions. From d01b4c3bda32d1290140daa2f14d009f9d525793 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 16 Jul 2026 10:26:08 +0000 Subject: [PATCH 27/27] [Automation] Generate SDK based on TypeSpec 0.45.4 DEV (typespec-azure PR 4905) --- eng/emitter-package-lock.json | 424 +- eng/emitter-package.json | 32 +- ...AppServicePlanPatchResourceProperties.java | 18 +- .../fluent/models/PushSettingsInner.java | 10 +- .../fluent/models/PushSettingsProperties.java | 11 +- .../fluent/models/SiteAuthSettingsInner.java | 92 +- .../models/SiteAuthSettingsProperties.java | 104 +- .../fluent/models/SitePatchResourceInner.java | 6 +- .../SitePatchResourcePropertiesInner.java | 7 +- .../SnapshotRestoreRequestProperties.java | 9 +- .../models/AppServicePlanPatchResource.java | 16 +- .../appservice/models/AutoHealActions.java | 7 +- .../models/SnapshotRestoreRequest.java | 8 +- .../avs/models/IdentitySource.java | 14 +- .../models/PhysicalToLogicalZoneMapping.java | 4 +- .../CognitiveServicesManager.java | 1002 ---- .../fluent/AccountCapabilityHostsClient.java | 200 - .../fluent/AccountConnectionsClient.java | 173 - .../fluent/AccountsClient.java | 466 -- .../fluent/AgentApplicationsClient.java | 318 -- .../fluent/AgentDeploymentsClient.java | 303 -- .../CognitiveServicesManagementClient.java | 363 -- .../fluent/CommitmentPlansClient.java | 626 --- .../fluent/CommitmentTiersClient.java | 43 - .../fluent/ComputeOperationsClient.java | 43 - .../fluent/ComputesClient.java | 461 -- .../fluent/DefenderForAISettingsClient.java | 140 - .../fluent/DeletedAccountsClient.java | 132 - .../fluent/DeploymentsClient.java | 379 -- .../fluent/EncryptionScopesClient.java | 169 - .../LocationBasedModelCapacitiesClient.java | 51 - .../ManagedComputeCapacitiesClient.java | 47 - .../ManagedComputeDeploymentsClient.java | 275 -- ...gedComputeUsagesOperationGroupsClient.java | 41 - .../ManagedNetworkProvisionsClient.java | 87 - ...anagedNetworkSettingsOperationsClient.java | 290 -- .../fluent/ModelCapacitiesClient.java | 49 - .../fluent/ModelsClient.java | 41 - ...SecurityPerimeterConfigurationsClient.java | 141 - .../fluent/OperationsClient.java | 40 - .../fluent/OutboundRulesClient.java | 247 - .../fluent/OutboundRulesOperationsClient.java | 56 - .../PrivateEndpointConnectionsClient.java | 216 - .../fluent/PrivateLinkResourcesClient.java | 45 - .../fluent/ProjectCapabilityHostsClient.java | 219 - .../fluent/ProjectConnectionsClient.java | 186 - .../fluent/ProjectsClient.java | 279 -- .../fluent/QuotaTiersClient.java | 142 - .../fluent/RaiBlocklistItemsClient.java | 250 - .../fluent/RaiBlocklistsClient.java | 169 - .../fluent/RaiContentFiltersClient.java | 69 - .../RaiExternalSafetyProvidersClient.java | 128 - ...ternalSafetyProvidersOperationsClient.java | 39 - .../fluent/RaiPoliciesClient.java | 168 - .../fluent/RaiToolLabelsClient.java | 167 - .../fluent/RaiTopicsClient.java | 168 - .../fluent/ResourceProvidersClient.java | 101 - .../fluent/ResourceSkusClient.java | 40 - .../fluent/SubscriptionRaiPoliciesClient.java | 119 - .../TestRaiExternalSafetyProvidersClient.java | 52 - .../fluent/UsagesClient.java | 43 - .../fluent/WorkbenchesClient.java | 503 -- .../fluent/models/AccountInner.java | 315 -- .../fluent/models/AccountModelInner.java | 291 -- .../models/AccountSkuListResultInner.java | 77 - .../fluent/models/AgentApplicationInner.java | 155 - .../fluent/models/AgentDeploymentInner.java | 155 - ...erenceResourceArmPaginatedResultInner.java | 97 - .../fluent/models/ApiKeysInner.java | 91 - .../CalculateModelCapacityResultInner.java | 112 - .../fluent/models/CapabilityHostInner.java | 155 - ...CommitmentPlanAccountAssociationInner.java | 214 - ...tmentPlanAccountAssociationProperties.java | 87 - .../fluent/models/CommitmentPlanInner.java | 286 -- .../fluent/models/CommitmentTierInner.java | 196 - .../fluent/models/ComputeInner.java | 289 -- .../models/ComputeOperationStatusInner.java | 145 - ...nectionPropertiesV2BasicResourceInner.java | 157 - .../models/DefenderForAISettingInner.java | 214 - .../DefenderForAISettingProperties.java | 88 - .../fluent/models/DeploymentInner.java | 230 - .../models/DomainAvailabilityInner.java | 143 - .../fluent/models/EncryptionScopeInner.java | 201 - ...aluateDeploymentPoliciesResponseInner.java | 80 - .../models/ManagedComputeCapacityInner.java | 146 - .../models/ManagedComputeDeploymentInner.java | 202 - .../models/ManagedComputeUsageInner.java | 196 - .../ManagedNetworkProvisionStatusInner.java | 88 - ...agedNetworkSettingsBasicResourceInner.java | 156 - .../models/ManagedNetworkSettingsInner.java | 293 -- ...kSettingsPropertiesBasicResourceInner.java | 160 - ...ModelCapacityListResultValueItemInner.java | 163 - .../fluent/models/ModelInner.java | 125 - ...rkSecurityPerimeterConfigurationInner.java | 146 - .../fluent/models/OperationInner.java | 150 - .../OutboundRuleBasicResourceInner.java | 156 - .../PrivateEndpointConnectionInner.java | 201 - ...vateEndpointConnectionListResultInner.java | 79 - .../PrivateLinkResourceListResultInner.java | 79 - .../models/ProjectCapabilityHostInner.java | 156 - .../fluent/models/ProjectInner.java | 259 -- .../fluent/models/QuotaTierInner.java | 155 - .../fluent/models/RaiBlocklistInner.java | 201 - .../fluent/models/RaiBlocklistItemInner.java | 201 - .../fluent/models/RaiContentFilterInner.java | 144 - .../RaiExternalSafetyProviderSchemaInner.java | 191 - .../fluent/models/RaiPolicyInner.java | 201 - .../fluent/models/RaiToolLabelInner.java | 201 - .../fluent/models/RaiTopicInner.java | 201 - .../fluent/models/ResourceSkuInner.java | 165 - .../SkuAvailabilityListResultInner.java | 78 - .../fluent/models/SkuResourceInner.java | 110 - .../fluent/models/UsageInner.java | 214 - .../fluent/models/UsageListResultInner.java | 93 - .../fluent/models/WorkbenchInner.java | 259 -- .../fluent/models/package-info.java | 9 - .../fluent/package-info.java | 9 - .../AccountCapabilityHostsClientImpl.java | 770 ---- .../AccountCapabilityHostsImpl.java | 152 - .../AccountConnectionsClientImpl.java | 719 --- .../AccountConnectionsImpl.java | 120 - .../implementation/AccountImpl.java | 228 - .../implementation/AccountModelImpl.java | 125 - .../AccountSkuListResultImpl.java | 40 - .../implementation/AccountsClientImpl.java | 1798 -------- .../implementation/AccountsImpl.java | 251 - .../implementation/AgentApplicationImpl.java | 164 - .../AgentApplicationsClientImpl.java | 1185 ----- .../implementation/AgentApplicationsImpl.java | 217 - .../implementation/AgentDeploymentImpl.java | 162 - .../AgentDeploymentsClientImpl.java | 1135 ----- .../implementation/AgentDeploymentsImpl.java | 226 - ...ferenceResourceArmPaginatedResultImpl.java | 44 - .../implementation/ApiKeysImpl.java | 36 - .../CalculateModelCapacityResultImpl.java | 42 - .../implementation/CapabilityHostImpl.java | 130 - ...nitiveServicesManagementClientBuilder.java | 138 - ...CognitiveServicesManagementClientImpl.java | 1012 ---- .../CommitmentPlanAccountAssociationImpl.java | 157 - .../implementation/CommitmentPlanImpl.java | 206 - .../CommitmentPlansClientImpl.java | 2469 ---------- .../implementation/CommitmentPlansImpl.java | 328 -- .../implementation/CommitmentTierImpl.java | 63 - .../CommitmentTiersClientImpl.java | 256 -- .../implementation/CommitmentTiersImpl.java | 45 - .../implementation/ComputeImpl.java | 215 - .../ComputeOperationStatusImpl.java | 50 - .../ComputeOperationsClientImpl.java | 145 - .../implementation/ComputeOperationsImpl.java | 52 - .../implementation/ComputesClientImpl.java | 1551 ------- .../implementation/ComputesImpl.java | 176 - ...nnectionPropertiesV2BasicResourceImpl.java | 155 - .../DefenderForAISettingImpl.java | 159 - .../DefenderForAISettingsClientImpl.java | 579 --- .../DefenderForAISettingsImpl.java | 108 - .../DeletedAccountsClientImpl.java | 524 --- .../implementation/DeletedAccountsImpl.java | 72 - .../implementation/DeploymentImpl.java | 194 - .../implementation/DeploymentsClientImpl.java | 1412 ------ .../implementation/DeploymentsImpl.java | 201 - .../DomainAvailabilityImpl.java | 48 - .../implementation/EncryptionScopeImpl.java | 156 - .../EncryptionScopesClientImpl.java | 663 --- .../implementation/EncryptionScopesImpl.java | 152 - ...valuateDeploymentPoliciesResponseImpl.java | 40 - ...ocationBasedModelCapacitiesClientImpl.java | 285 -- .../LocationBasedModelCapacitiesImpl.java | 51 - .../ManagedComputeCapacitiesClientImpl.java | 307 -- .../ManagedComputeCapacitiesImpl.java | 47 - .../ManagedComputeCapacityImpl.java | 50 - .../ManagedComputeDeploymentImpl.java | 158 - .../ManagedComputeDeploymentsClientImpl.java | 999 ---- .../ManagedComputeDeploymentsImpl.java | 153 - .../ManagedComputeUsageImpl.java | 70 - ...omputeUsagesOperationGroupsClientImpl.java | 255 - ...nagedComputeUsagesOperationGroupsImpl.java | 45 - .../ManagedNetworkProvisionStatusImpl.java | 33 - .../ManagedNetworkProvisionsClientImpl.java | 352 -- .../ManagedNetworkProvisionsImpl.java | 57 - ...nagedNetworkSettingsBasicResourceImpl.java | 56 - .../ManagedNetworkSettingsImpl.java | 79 - ...edNetworkSettingsOperationsClientImpl.java | 1121 ----- .../ManagedNetworkSettingsOperationsImpl.java | 160 - ...rkSettingsPropertiesBasicResourceImpl.java | 134 - .../ModelCapacitiesClientImpl.java | 277 -- .../implementation/ModelCapacitiesImpl.java | 51 - .../ModelCapacityListResultValueItemImpl.java | 54 - .../implementation/ModelImpl.java | 51 - .../implementation/ModelsClientImpl.java | 250 - .../implementation/ModelsImpl.java | 45 - ...orkSecurityPerimeterConfigurationImpl.java | 50 - ...rityPerimeterConfigurationsClientImpl.java | 587 --- ...rkSecurityPerimeterConfigurationsImpl.java | 93 - .../implementation/OperationImpl.java | 51 - .../implementation/OperationsClientImpl.java | 242 - .../implementation/OperationsImpl.java | 45 - .../OutboundRuleBasicResourceImpl.java | 138 - .../OutboundRulesClientImpl.java | 888 ---- .../implementation/OutboundRulesImpl.java | 180 - .../OutboundRulesOperationsClientImpl.java | 338 -- .../OutboundRulesOperationsImpl.java | 50 - .../PrivateEndpointConnectionImpl.java | 161 - ...ivateEndpointConnectionListResultImpl.java | 44 - .../PrivateEndpointConnectionsClientImpl.java | 682 --- .../PrivateEndpointConnectionsImpl.java | 168 - .../PrivateLinkResourceListResultImpl.java | 40 - .../PrivateLinkResourcesClientImpl.java | 150 - .../PrivateLinkResourcesImpl.java | 53 - .../ProjectCapabilityHostImpl.java | 140 - .../ProjectCapabilityHostsClientImpl.java | 821 ---- .../ProjectCapabilityHostsImpl.java | 179 - .../ProjectConnectionsClientImpl.java | 763 --- .../ProjectConnectionsImpl.java | 183 - .../implementation/ProjectImpl.java | 182 - .../implementation/ProjectsClientImpl.java | 984 ---- .../implementation/ProjectsImpl.java | 152 - .../implementation/QuotaTierImpl.java | 113 - .../implementation/QuotaTiersClientImpl.java | 553 --- .../implementation/QuotaTiersImpl.java | 84 - .../implementation/RaiBlocklistImpl.java | 155 - .../implementation/RaiBlocklistItemImpl.java | 164 - .../RaiBlocklistItemsClientImpl.java | 916 ---- .../implementation/RaiBlocklistItemsImpl.java | 215 - .../RaiBlocklistsClientImpl.java | 656 --- .../implementation/RaiBlocklistsImpl.java | 152 - .../implementation/RaiContentFilterImpl.java | 50 - .../RaiContentFiltersClientImpl.java | 338 -- .../implementation/RaiContentFiltersImpl.java | 62 - .../RaiExternalSafetyProviderSchemaImpl.java | 137 - .../RaiExternalSafetyProvidersClientImpl.java | 414 -- .../RaiExternalSafetyProvidersImpl.java | 79 - ...alSafetyProvidersOperationsClientImpl.java | 246 - ...ExternalSafetyProvidersOperationsImpl.java | 47 - .../implementation/RaiPoliciesClientImpl.java | 653 --- .../implementation/RaiPoliciesImpl.java | 152 - .../implementation/RaiPolicyImpl.java | 153 - .../implementation/RaiToolLabelImpl.java | 157 - .../RaiToolLabelsClientImpl.java | 655 --- .../implementation/RaiToolLabelsImpl.java | 152 - .../implementation/RaiTopicImpl.java | 153 - .../implementation/RaiTopicsClientImpl.java | 649 --- .../implementation/RaiTopicsImpl.java | 152 - .../implementation/ResourceManagerUtils.java | 195 - .../ResourceProvidersClientImpl.java | 324 -- .../implementation/ResourceProvidersImpl.java | 94 - .../implementation/ResourceSkuImpl.java | 65 - .../ResourceSkusClientImpl.java | 249 - .../implementation/ResourceSkusImpl.java | 45 - .../SkuAvailabilityListResultImpl.java | 40 - .../implementation/SkuResourceImpl.java | 42 - .../SubscriptionRaiPoliciesClientImpl.java | 391 -- .../SubscriptionRaiPoliciesImpl.java | 76 - ...tRaiExternalSafetyProvidersClientImpl.java | 172 - .../TestRaiExternalSafetyProvidersImpl.java | 35 - .../implementation/UsageImpl.java | 68 - .../implementation/UsageListResultImpl.java | 47 - .../implementation/UsagesClientImpl.java | 281 -- .../implementation/UsagesImpl.java | 45 - .../implementation/WorkbenchImpl.java | 211 - .../implementation/WorkbenchesClientImpl.java | 1673 ------- .../implementation/WorkbenchesImpl.java | 203 - .../models/AccountListResult.java | 93 - .../models/AccountModelListResult.java | 94 - ...ApplicationResourceArmPaginatedResult.java | 98 - ...tDeploymentResourceArmPaginatedResult.java | 98 - ...abilityHostResourceArmPaginatedResult.java | 98 - ...tmentPlanAccountAssociationListResult.java | 97 - .../models/CommitmentPlanListResult.java | 94 - .../models/CommitmentTierListResult.java | 94 - .../models/ComputeListResult.java | 94 - ...tiesV2BasicResourceArmPaginatedResult.java | 98 - .../models/DefenderForAISettingResult.java | 95 - .../models/DeploymentListResult.java | 93 - .../models/DeploymentSkuListResult.java | 93 - .../models/EncryptionScopeListResult.java | 95 - .../ManagedComputeCapacityListResult.java | 95 - .../ManagedComputeDeploymentListResult.java | 95 - .../models/ManagedComputeUsageListResult.java | 96 - .../models/ManagedNetworkListResult.java | 98 - .../models/ModelCapacityListResult.java | 94 - .../models/ModelListResult.java | 94 - ...orkSecurityPerimeterConfigurationList.java | 97 - .../models/OperationListResult.java | 96 - .../models/OutboundRuleListResult.java | 98 - ...abilityHostResourceArmPaginatedResult.java | 98 - .../models/ProjectListResult.java | 93 - .../models/QuotaTierListResult.java | 93 - .../models/RaiBlockListItemsResult.java | 95 - .../models/RaiBlockListResult.java | 94 - .../models/RaiContentFilterListResult.java | 95 - .../RaiExternalSafetyProviderResult.java | 96 - .../models/RaiPolicyListResult.java | 94 - .../models/RaiToolLabelResult.java | 94 - .../implementation/models/RaiTopicResult.java | 94 - .../models/ResourceSkuListResult.java | 95 - .../models/WorkbenchListResult.java | 94 - .../implementation/package-info.java | 9 - .../AadAuthTypeConnectionProperties.java | 216 - .../models/AbusePenalty.java | 113 - .../models/AbusePenaltyAction.java | 51 - ...AccessKeyAuthTypeConnectionProperties.java | 245 - .../cognitiveservices/models/Account.java | 442 -- .../models/AccountCapabilityHosts.java | 144 - .../models/AccountConnections.java | 158 - ...ccountKeyAuthTypeConnectionProperties.java | 245 - .../models/AccountModel.java | 151 - .../models/AccountProperties.java | 922 ---- .../cognitiveservices/models/AccountSku.java | 91 - .../models/AccountSkuListResult.java | 27 - .../cognitiveservices/models/Accounts.java | 327 -- .../cognitiveservices/models/ActionType.java | 46 - .../models/AgentApplication.java | 249 - .../models/AgentApplications.java | 249 - .../models/AgentDeployment.java | 231 - .../models/AgentDeploymentProperties.java | 303 -- .../AgentDeploymentProvisioningState.java | 71 - .../models/AgentDeploymentState.java | 81 - .../models/AgentDeploymentType.java | 57 - .../models/AgentDeployments.java | 230 - .../models/AgentProtocol.java | 56 - .../models/AgentProtocolVersion.java | 113 - .../models/AgentReference.java | 143 - .../models/AgentReferenceProperties.java | 113 - ...ntReferenceResourceArmPaginatedResult.java | 36 - .../models/AgenticApplicationProperties.java | 324 -- .../AgenticApplicationProvisioningState.java | 72 - .../ApiKeyAuthConnectionProperties.java | 263 -- .../cognitiveservices/models/ApiKeys.java | 33 - .../models/ApiProperties.java | 375 -- .../ApplicationAuthorizationPolicy.java | 105 - .../ApplicationTrafficRoutingPolicy.java | 117 - .../models/AssignedIdentity.java | 243 - .../models/BillingMeterInfo.java | 108 - .../models/BuiltInAuthorizationScheme.java | 61 - .../models/ByPassSelection.java | 51 - .../CalculateModelCapacityParameter.java | 145 - .../models/CalculateModelCapacityResult.java | 41 - ...eModelCapacityResultEstimatedCapacity.java | 95 - .../models/CallRateLimit.java | 110 - .../models/CapabilityHost.java | 189 - .../models/CapabilityHostKind.java | 46 - .../models/CapabilityHostProperties.java | 316 -- .../CapabilityHostProvisioningState.java | 71 - .../models/CapacityConfig.java | 144 - .../ChannelsBuiltInAuthorizationPolicy.java | 76 - .../CheckDomainAvailabilityParameter.java | 143 - .../models/CheckSkuAvailabilityParameter.java | 145 - .../models/ClusterComputeProperties.java | 144 - .../models/CommitmentCost.java | 91 - .../models/CommitmentPeriod.java | 161 - .../models/CommitmentPlan.java | 313 -- .../CommitmentPlanAccountAssociation.java | 231 - .../models/CommitmentPlanAssociation.java | 91 - .../models/CommitmentPlanProperties.java | 276 -- .../CommitmentPlanProvisioningState.java | 76 - .../models/CommitmentPlans.java | 414 -- .../models/CommitmentQuota.java | 91 - .../models/CommitmentTier.java | 75 - .../models/CommitmentTiers.java | 38 - .../cognitiveservices/models/Compute.java | 412 -- .../models/ComputeOperationStatus.java | 55 - .../ComputeOperationStatusProperties.java | 130 - .../models/ComputeOperationStatusType.java | 61 - .../models/ComputeOperations.java | 38 - .../models/ComputeProperties.java | 190 - .../models/ComputeProvisioningState.java | 96 - .../cognitiveservices/models/ComputeType.java | 51 - .../cognitiveservices/models/Computes.java | 233 - .../models/ConnectionAccessKey.java | 113 - .../models/ConnectionAccountKey.java | 85 - .../models/ConnectionApiKey.java | 85 - .../models/ConnectionAuthType.java | 136 - .../models/ConnectionCategory.java | 641 --- .../models/ConnectionGroup.java | 76 - .../models/ConnectionManagedIdentity.java | 113 - .../models/ConnectionOAuth2.java | 288 -- .../models/ConnectionPersonalAccessToken.java | 86 - .../models/ConnectionPropertiesV2.java | 471 -- .../ConnectionPropertiesV2BasicResource.java | 192 - .../models/ConnectionServicePrincipal.java | 141 - .../ConnectionSharedAccessSignature.java | 86 - .../models/ConnectionUpdateContent.java | 85 - .../models/ConnectionUsernamePassword.java | 143 - .../models/ConnectivityEndpoints.java | 89 - .../ContainerInstanceComputeProperties.java | 220 - .../models/ContentLevel.java | 56 - .../models/CustomBlocklistConfig.java | 108 - .../cognitiveservices/models/CustomKeys.java | 87 - .../CustomKeysConnectionProperties.java | 248 - .../models/DefenderForAISetting.java | 230 - .../models/DefenderForAISettingState.java | 51 - .../models/DefenderForAISettings.java | 98 - .../models/DeletedAccounts.java | 90 - .../cognitiveservices/models/Deployment.java | 310 -- .../models/DeploymentCapacitySettings.java | 113 - .../models/DeploymentModel.java | 260 -- .../DeploymentModelVersionUpgradeOption.java | 59 - .../DeploymentPolicyEvaluationResult.java | 115 - .../models/DeploymentProperties.java | 512 --- .../models/DeploymentProvisioningState.java | 81 - .../models/DeploymentRouting.java | 120 - .../models/DeploymentScaleSettings.java | 131 - .../models/DeploymentScaleType.java | 51 - .../models/DeploymentSizeCapacity.java | 108 - .../models/DeploymentSpeculativeDecoding.java | 115 - .../models/DeploymentState.java | 53 - .../cognitiveservices/models/Deployments.java | 250 - .../models/DeprecationStatus.java | 53 - .../models/DomainAvailability.java | 54 - .../cognitiveservices/models/Encryption.java | 113 - .../models/EncryptionScope.java | 230 - .../models/EncryptionScopeProperties.java | 125 - .../EncryptionScopeProvisioningState.java | 76 - .../models/EncryptionScopeState.java | 51 - .../models/EncryptionScopes.java | 146 - .../EvaluateDeploymentPoliciesDeployment.java | 118 - ...eploymentPoliciesDeploymentProperties.java | 116 - .../EvaluateDeploymentPoliciesRequest.java | 90 - .../EvaluateDeploymentPoliciesResponse.java | 28 - .../cognitiveservices/models/FirewallSku.java | 51 - .../models/FoundryAutoUpgrade.java | 177 - .../models/FoundryAutoUpgradeMode.java | 51 - .../models/FqdnOutboundRule.java | 132 - .../models/HostedAgentDeployment.java | 226 - .../models/HostingModel.java | 61 - .../cognitiveservices/models/Identity.java | 156 - .../models/IdentityKind.java | 66 - .../models/IdentityManagementType.java | 56 - .../models/IdentityProvisioningState.java | 71 - .../cognitiveservices/models/IpRule.java | 89 - .../models/IsolationMode.java | 56 - .../cognitiveservices/models/KeyName.java | 56 - .../cognitiveservices/models/KeySource.java | 51 - .../models/KeyVaultProperties.java | 169 - .../models/LocationBasedModelCapacities.java | 46 - .../models/ManagedAgentDeployment.java | 171 - .../models/ManagedComputeCapacities.java | 42 - .../models/ManagedComputeCapacity.java | 55 - .../ManagedComputeCapacityProperties.java | 110 - .../models/ManagedComputeDeployment.java | 216 - .../models/ManagedComputeDeploymentInfo.java | 142 - .../ManagedComputeDeploymentProperties.java | 361 -- ...dComputeDeploymentProvisioningDetails.java | 100 - .../ManagedComputeDeploymentRoutes.java | 110 - .../models/ManagedComputeDeployments.java | 149 - .../models/ManagedComputeUsage.java | 76 - .../ManagedComputeUsagesOperationGroups.java | 36 - ...dIdentityAuthTypeConnectionProperties.java | 247 - .../models/ManagedNetworkKind.java | 52 - .../ManagedNetworkProvisionOptions.java | 56 - .../models/ManagedNetworkProvisionStatus.java | 27 - .../ManagedNetworkProvisioningState.java | 71 - .../models/ManagedNetworkProvisions.java | 44 - .../models/ManagedNetworkSettings.java | 77 - .../ManagedNetworkSettingsBasicResource.java | 56 - .../models/ManagedNetworkSettingsEx.java | 195 - .../ManagedNetworkSettingsOperations.java | 152 - .../ManagedNetworkSettingsProperties.java | 106 - ...etworkSettingsPropertiesBasicResource.java | 195 - .../models/ManagedNetworkStatus.java | 51 - .../models/ManagedPERequirement.java | 56 - .../models/ManagedPEStatus.java | 56 - .../cognitiveservices/models/MetricName.java | 91 - .../cognitiveservices/models/Model.java | 47 - .../models/ModelCapacities.java | 43 - .../ModelCapacityCalculatorWorkload.java | 117 - ...apacityCalculatorWorkloadRequestParam.java | 117 - .../ModelCapacityListResultValueItem.java | 63 - .../models/ModelDeprecationInfo.java | 115 - .../models/ModelLifecycleStatus.java | 74 - .../cognitiveservices/models/ModelSku.java | 167 - .../models/ModelSkuCapacityProperties.java | 161 - .../cognitiveservices/models/Models.java | 36 - .../models/MultiRegionSettings.java | 115 - .../models/NetworkInjection.java | 147 - .../models/NetworkRuleAction.java | 52 - .../models/NetworkRuleSet.java | 177 - .../models/NetworkSecurityPerimeter.java | 108 - .../NetworkSecurityPerimeterAccessRule.java | 93 - ...SecurityPerimeterAccessRuleProperties.java | 158 - ...AccessRulePropertiesSubscriptionsItem.java | 78 - ...NetworkSecurityPerimeterConfiguration.java | 56 - ...PerimeterConfigurationAssociationInfo.java | 94 - ...urityPerimeterConfigurationProperties.java | 150 - ...etworkSecurityPerimeterConfigurations.java | 98 - .../NetworkSecurityPerimeterProfileInfo.java | 151 - .../NoneAuthTypeConnectionProperties.java | 216 - .../models/NspAccessRuleDirection.java | 51 - .../OAuth2AuthTypeConnectionProperties.java | 247 - .../cognitiveservices/models/Operation.java | 58 - .../models/OperationDisplay.java | 128 - .../cognitiveservices/models/Operations.java | 35 - ...ationSharedBuiltInAuthorizationPolicy.java | 76 - .../cognitiveservices/models/Origin.java | 57 - .../models/OutboundRule.java | 217 - .../models/OutboundRuleBasicResource.java | 194 - .../models/OutboundRules.java | 175 - .../models/OutboundRulesOperations.java | 51 - .../PatAuthTypeConnectionProperties.java | 245 - .../models/PatchResourceSku.java | 85 - .../models/PatchResourceTags.java | 87 - .../models/PatchResourceTagsAndSku.java | 98 - .../PolicyAssignmentEvaluationDetails.java | 183 - .../models/PolicyEvaluationOutcome.java | 56 - .../PolicyExpressionEvaluationDetails.java | 160 - .../cognitiveservices/models/Pool.java | 170 - .../models/PrivateEndpoint.java | 73 - .../models/PrivateEndpointConnection.java | 239 - .../PrivateEndpointConnectionListResult.java | 28 - .../PrivateEndpointConnectionProperties.java | 167 - ...teEndpointConnectionProvisioningState.java | 62 - .../models/PrivateEndpointConnections.java | 152 - .../models/PrivateEndpointOutboundRule.java | 162 - ...rivateEndpointOutboundRuleDestination.java | 115 - ...rivateEndpointServiceConnectionStatus.java | 57 - .../models/PrivateLinkResource.java | 143 - .../models/PrivateLinkResourceListResult.java | 28 - .../models/PrivateLinkResourceProperties.java | 127 - .../models/PrivateLinkResources.java | 40 - .../PrivateLinkServiceConnectionState.java | 147 - .../cognitiveservices/models/Project.java | 307 -- .../models/ProjectCapabilityHost.java | 190 - .../ProjectCapabilityHostProperties.java | 203 - .../models/ProjectCapabilityHosts.java | 153 - .../models/ProjectConnections.java | 160 - .../models/ProjectProperties.java | 164 - .../cognitiveservices/models/Projects.java | 150 - .../models/ProvisioningIssue.java | 91 - .../models/ProvisioningIssueProperties.java | 149 - .../models/ProvisioningState.java | 81 - .../models/PublicNetworkAccess.java | 51 - .../cognitiveservices/models/QuotaLimit.java | 110 - .../models/QuotaScopeType.java | 61 - .../cognitiveservices/models/QuotaTier.java | 167 - .../models/QuotaTierProperties.java | 140 - .../QuotaTierUpgradeEligibilityInfo.java | 138 - .../cognitiveservices/models/QuotaTiers.java | 108 - .../models/QuotaUsageStatus.java | 61 - .../models/RaiActionType.java | 66 - .../models/RaiBlocklist.java | 230 - .../models/RaiBlocklistConfig.java | 113 - .../models/RaiBlocklistItem.java | 231 - .../models/RaiBlocklistItemBulkRequest.java | 113 - .../models/RaiBlocklistItemProperties.java | 113 - .../models/RaiBlocklistItems.java | 217 - .../models/RaiBlocklistProperties.java | 85 - .../models/RaiBlocklists.java | 146 - .../models/RaiContentFilter.java | 55 - .../models/RaiContentFilterProperties.java | 110 - .../models/RaiContentFilters.java | 62 - .../models/RaiEgressDefaultAction.java | 51 - .../models/RaiEgressHeaderOperation.java | 56 - .../models/RaiEgressHeaderTransform.java | 179 - .../models/RaiEgressHeaderValueRef.java | 114 - .../models/RaiEgressManagedIdentityRef.java | 116 - .../models/RaiEgressMode.java | 54 - .../models/RaiEgressPolicyConfig.java | 201 - .../models/RaiEgressRewriteTarget.java | 143 - .../models/RaiEgressRule.java | 201 - .../models/RaiEgressRuleAction.java | 152 - .../models/RaiEgressRuleActionType.java | 62 - .../models/RaiEgressRuleMatch.java | 122 - .../models/RaiEgressRuleType.java | 46 - .../models/RaiEgressScheme.java | 51 - .../models/RaiEgressSecretRef.java | 144 - .../RaiExternalSafetyProviderSchema.java | 190 - ...xternalSafetyProviderSchemaProperties.java | 291 -- .../models/RaiExternalSafetyProviders.java | 91 - .../RaiExternalSafetyProvidersOperations.java | 33 - .../models/RaiMonitorConfig.java | 113 - .../cognitiveservices/models/RaiPolicies.java | 146 - .../cognitiveservices/models/RaiPolicy.java | 230 - .../models/RaiPolicyContentFilter.java | 226 - .../models/RaiPolicyContentSource.java | 71 - .../models/RaiPolicyMode.java | 62 - .../models/RaiPolicyProperties.java | 259 -- .../models/RaiPolicyType.java | 51 - .../models/RaiSafetyProviderConfig.java | 113 - .../models/RaiToolLabel.java | 217 - .../models/RaiToolLabelProperties.java | 146 - .../RaiToolLabelPropertiesAccountScope.java | 88 - ...iToolLabelPropertiesProjectScopesItem.java | 118 - .../models/RaiToolLabels.java | 144 - .../cognitiveservices/models/RaiTopic.java | 230 - .../models/RaiTopicProperties.java | 288 -- .../cognitiveservices/models/RaiTopics.java | 146 - .../models/RegenerateKeyParameters.java | 86 - .../models/RegionSetting.java | 141 - .../models/ReplacementConfig.java | 136 - .../models/RequestMatchPattern.java | 91 - .../models/ResourceBase.java | 115 - .../models/ResourceIdentityType.java | 66 - .../models/ResourceProviders.java | 87 - .../cognitiveservices/models/ResourceSku.java | 63 - .../models/ResourceSkuRestrictionInfo.java | 94 - .../models/ResourceSkuRestrictions.java | 131 - .../ResourceSkuRestrictionsReasonCode.java | 52 - .../models/ResourceSkuRestrictionsType.java | 56 - .../models/ResourceSkus.java | 35 - .../RoleBasedBuiltInAuthorizationPolicy.java | 76 - .../models/RoutingMethods.java | 56 - .../cognitiveservices/models/RoutingMode.java | 56 - .../cognitiveservices/models/RuleAction.java | 51 - .../models/RuleCategory.java | 61 - .../cognitiveservices/models/RuleStatus.java | 66 - .../cognitiveservices/models/RuleType.java | 56 - .../models/SafetyProviderConfig.java | 108 - .../SasAuthTypeConnectionProperties.java | 245 - .../models/ScenarioType.java | 52 - ...PrincipalAuthTypeConnectionProperties.java | 247 - .../models/ServiceTagOutboundRule.java | 132 - .../ServiceTagOutboundRuleDestination.java | 203 - .../cognitiveservices/models/ServiceTier.java | 55 - .../cognitiveservices/models/Sku.java | 209 - .../models/SkuAvailability.java | 159 - .../models/SkuAvailabilityListResult.java | 27 - .../models/SkuCapability.java | 91 - .../models/SkuChangeInfo.java | 108 - .../cognitiveservices/models/SkuResource.java | 40 - .../cognitiveservices/models/SkuTier.java | 67 - .../cognitiveservices/models/SshSettings.java | 113 - .../models/SubscriptionRaiPolicies.java | 83 - .../TestRaiExternalSafetyProviders.java | 18 - .../models/ThrottlingRule.java | 162 - .../models/TierUpgradePolicy.java | 51 - .../models/TrafficRoutingProtocol.java | 46 - .../models/TrafficRoutingRule.java | 169 - .../cognitiveservices/models/UnitType.java | 76 - .../models/UpgradeAvailabilityStatus.java | 51 - .../cognitiveservices/models/Usage.java | 82 - .../models/UsageListResult.java | 34 - .../cognitiveservices/models/Usages.java | 38 - .../models/UserAssignedIdentity.java | 89 - .../models/UserOwnedAmlWorkspace.java | 113 - .../models/UserOwnedStorage.java | 113 - ...ePasswordAuthTypeConnectionProperties.java | 247 - .../models/VersionedAgentReference.java | 108 - .../models/VirtualNetworkRule.java | 146 - .../cognitiveservices/models/VmPriority.java | 51 - .../cognitiveservices/models/Workbench.java | 374 -- .../models/WorkbenchProperties.java | 287 -- .../cognitiveservices/models/Workbenches.java | 245 - .../models/package-info.java | 9 - .../cognitiveservices/package-info.java | 9 - .../src/main/java/module-info.java | 16 - .../proxy-config.json | 1 - .../reflect-config.json | 1 - ...sourcemanager-cognitiveservices.properties | 1 - .../JobRouterAdministrationClientBuilder.java | 30 +- ...JobRouterAdministrationServiceVersion.java | 45 + .../JobRouterAdministrationClientImpl.java | 12 +- .../MessageTemplateClientBuilder.java | 30 +- ...ava => MessageTemplateServiceVersion.java} | 10 +- .../NotificationMessagesClientBuilder.java | 30 +- .../NotificationMessagesServiceVersion.java | 50 + .../MessageTemplateClientImpl.java | 12 +- .../NotificationMessagesClientImpl.java | 12 +- .../compute/generated/UsageListSamples.java | 2 +- .../computebulkactions/models/VMCategory.java | 16 +- .../models/ZoneDistributionStrategy.java | 9 +- .../models/ZonePreference.java | 9 +- .../models/AdditionalUnattendContent.java | 14 +- ...GuestPatchAutomaticByPlatformSettings.java | 7 +- .../models/VMDiskSecurityProfile.java | 16 +- ...ualMachineScaleSetExtensionProperties.java | 46 +- ...VirtualMachineScaleSetIPConfiguration.java | 7 +- ...caleSetNetworkConfigurationProperties.java | 21 +- .../computefleet/models/WinRMListener.java | 7 +- ...GuestPatchAutomaticByPlatformSettings.java | 7 +- .../fluent/OccurrencesClient.java | 8 +- .../implementation/OccurrencesClientImpl.java | 18 +- .../computeschedule/models/Occurrences.java | 4 +- .../models/CustomRegistryCredentials.java | 7 +- .../models/OverrideTaskStepProperties.java | 7 +- .../models/SourceRegistryCredentials.java | 16 +- .../models/AutoUpgradeProfileInner.java | 14 +- .../models/AutoUpgradeProfileProperties.java | 21 +- .../models/AutoUpgradeProfile.java | 37 +- .../models/UpdateGroup.java | 14 +- .../models/UpgradeChannel.java | 9 +- .../contentsafety/BlocklistClientBuilder.java | 30 +- .../BlocklistServiceVersion.java | 40 + .../implementation/BlocklistClientImpl.java | 12 +- .../ContentUnderstandingAsyncClient.java | 12 +- .../ContentUnderstandingClient.java | 12 +- .../models/AnalysisResult.java | 6 +- .../fluent/DeletedBackupInstancesClient.java | 8 +- .../DeletedBackupInstancesClientImpl.java | 18 +- .../models/DeletedBackupInstances.java | 4 +- .../DeploymentEnvironmentsClientBuilder.java | 30 +- .../DeploymentEnvironmentsServiceVersion.java | 40 + .../devcenter/DevBoxesClientBuilder.java | 30 +- .../devcenter/DevBoxesServiceVersion.java | 40 + .../devcenter/DevCenterServiceVersion.java | 2 +- .../DeploymentEnvironmentsClientImpl.java | 12 +- .../implementation/DevBoxesClientImpl.java | 12 +- .../fluent/CredentialsClient.java | 8 +- .../fluent/NamespaceDevicesClient.java | 8 +- .../deviceregistry/fluent/PoliciesClient.java | 8 +- .../implementation/CredentialsClientImpl.java | 18 +- .../NamespaceDevicesClientImpl.java | 18 +- .../implementation/PoliciesClientImpl.java | 18 +- .../deviceregistry/models/Credentials.java | 4 +- .../models/NamespaceDevice.java | 4 +- .../models/NamespaceDevices.java | 4 +- .../deviceregistry/models/Policies.java | 4 +- .../deviceregistry/models/Policy.java | 4 +- .../FormulasCreateOrUpdateSamples.java | 2 +- ...telligenceAdministrationClientBuilder.java | 32 +- ...elligenceAdministrationServiceVersion.java | 40 + ...tIntelligenceAdministrationClientImpl.java | 12 +- .../fluent/EdgeActionVersionsClient.java | 8 +- .../EdgeActionVersionsClientImpl.java | 18 +- .../edgeactions/models/EdgeActionVersion.java | 4 +- .../models/EdgeActionVersions.java | 4 +- .../EventGridReceiverClientBuilder.java | 30 +- .../EventGridReceiverServiceVersion.java | 44 + .../EventGridSenderClientBuilder.java | 30 +- ...ava => EventGridSenderServiceVersion.java} | 10 +- .../EventGridReceiverClientImpl.java | 12 +- .../EventGridSenderClientImpl.java | 12 +- .../fluent/PublicCloudConnectorsClient.java | 8 +- .../PublicCloudConnectorsClientImpl.java | 18 +- .../models/PublicCloudConnector.java | 4 +- .../models/PublicCloudConnectors.java | 4 +- .../resourcemanager/iothub/IotHubManager.java | 381 -- .../iothub/fluent/CertificatesClient.java | 260 -- .../iothub/fluent/IotHubClient.java | 97 - .../iothub/fluent/IotHubResourcesClient.java | 1037 ----- .../iothub/fluent/IotHubsClient.java | 95 - .../iothub/fluent/OperationsClient.java | 40 - .../PrivateEndpointConnectionsClient.java | 245 - .../PrivateLinkResourcesOperationsClient.java | 91 - .../fluent/ResourceProviderCommonsClient.java | 48 - .../models/CertificateDescriptionInner.java | 171 - .../CertificateListDescriptionInner.java | 78 - .../CertificateWithNonceDescriptionInner.java | 143 - .../models/EndpointHealthDataInner.java | 190 - .../EventHubConsumerGroupInfoInner.java | 162 - .../models/GroupIdInformationInner.java | 124 - .../fluent/models/IotHubDescriptionInner.java | 270 -- .../IotHubNameAvailabilityInfoInner.java | 110 - .../models/IotHubQuotaMetricInfoInner.java | 105 - .../models/IotHubSkuDescriptionInner.java | 110 - .../fluent/models/JobResponseInner.java | 197 - .../iothub/fluent/models/OperationInner.java | 91 - .../PrivateEndpointConnectionInner.java | 157 - .../models/PrivateLinkResourcesInner.java | 77 - .../models/RegistryStatisticsInner.java | 105 - ...AccessSignatureAuthorizationRuleInner.java | 174 - .../models/TestAllRoutesResultInner.java | 77 - .../fluent/models/TestRouteResultInner.java | 93 - .../UserSubscriptionQuotaListResultInner.java | 96 - .../iothub/fluent/models/package-info.java | 9 - .../iothub/fluent/package-info.java | 9 - .../CertificateDescriptionImpl.java | 162 - .../CertificateListDescriptionImpl.java | 44 - .../CertificateWithNonceDescriptionImpl.java | 49 - .../CertificatesClientImpl.java | 749 --- .../implementation/CertificatesImpl.java | 206 - .../EndpointHealthDataImpl.java | 54 - .../EventHubConsumerGroupInfoImpl.java | 128 - .../GroupIdInformationImpl.java | 45 - .../implementation/IotHubClientBuilder.java | 138 - .../implementation/IotHubClientImpl.java | 404 -- .../implementation/IotHubDescriptionImpl.java | 249 - .../IotHubNameAvailabilityInfoImpl.java | 41 - .../IotHubQuotaMetricInfoImpl.java | 40 - .../IotHubResourcesClientImpl.java | 4095 ----------------- .../implementation/IotHubResourcesImpl.java | 526 --- .../IotHubSkuDescriptionImpl.java | 42 - .../implementation/IotHubsClientImpl.java | 289 -- .../iothub/implementation/IotHubsImpl.java | 41 - .../implementation/JobResponseImpl.java | 62 - .../iothub/implementation/OperationImpl.java | 36 - .../implementation/OperationsClientImpl.java | 239 - .../iothub/implementation/OperationsImpl.java | 44 - .../PrivateEndpointConnectionImpl.java | 50 - .../PrivateEndpointConnectionsClientImpl.java | 725 --- .../PrivateEndpointConnectionsImpl.java | 112 - .../PrivateLinkResourcesImpl.java | 44 - ...vateLinkResourcesOperationsClientImpl.java | 266 -- .../PrivateLinkResourcesOperationsImpl.java | 72 - .../RegistryStatisticsImpl.java | 40 - .../implementation/ResourceManagerUtils.java | 195 - .../ResourceProviderCommonsClientImpl.java | 149 - .../ResourceProviderCommonsImpl.java | 52 - ...dAccessSignatureAuthorizationRuleImpl.java | 45 - .../TestAllRoutesResultImpl.java | 40 - .../implementation/TestRouteResultImpl.java | 38 - .../UserSubscriptionQuotaListResultImpl.java | 44 - .../models/EndpointHealthDataListResult.java | 96 - .../EventHubConsumerGroupsListResult.java | 97 - .../models/IotHubDescriptionListResult.java | 96 - .../IotHubQuotaMetricInfoListResult.java | 97 - .../IotHubSkuDescriptionListResult.java | 97 - .../models/JobResponseListResult.java | 95 - .../models/OperationListResult.java | 93 - ...sSignatureAuthorizationRuleListResult.java | 98 - .../iothub/implementation/package-info.java | 9 - .../iothub/models/AccessRights.java | 122 - .../iothub/models/ArmIdentity.java | 155 - .../iothub/models/ArmUserIdentity.java | 89 - .../iothub/models/AuthenticationType.java | 51 - .../iothub/models/Capabilities.java | 51 - .../iothub/models/CertificateDescription.java | 226 - .../models/CertificateListDescription.java | 27 - .../iothub/models/CertificateProperties.java | 235 - .../CertificatePropertiesWithNonce.java | 217 - .../CertificateVerificationDescription.java | 86 - .../CertificateWithNonceDescription.java | 55 - .../iothub/models/Certificates.java | 273 -- .../models/CloudToDeviceProperties.java | 151 - .../iothub/models/DefaultAction.java | 51 - .../iothub/models/DeviceRegistry.java | 115 - .../EncryptionPropertiesDescription.java | 118 - .../iothub/models/EndpointHealthData.java | 69 - .../iothub/models/EndpointHealthStatus.java | 72 - .../iothub/models/EnrichmentProperties.java | 145 - .../iothub/models/ErrorDetails.java | 180 - .../iothub/models/ErrorDetailsException.java | 42 - .../EventHubConsumerGroupBodyDescription.java | 89 - .../models/EventHubConsumerGroupInfo.java | 147 - .../models/EventHubConsumerGroupName.java | 86 - .../iothub/models/EventHubProperties.java | 171 - .../iothub/models/ExportDevicesRequest.java | 264 -- .../iothub/models/FailoverInput.java | 86 - .../models/FallbackRouteProperties.java | 213 - .../iothub/models/FeedbackProperties.java | 157 - .../iothub/models/GroupIdInformation.java | 47 - .../models/GroupIdInformationProperties.java | 113 - .../iothub/models/ImportDevicesRequest.java | 288 -- .../iothub/models/IotHubCapacity.java | 121 - .../iothub/models/IotHubDescription.java | 437 -- .../models/IotHubLocationDescription.java | 95 - .../models/IotHubNameAvailabilityInfo.java | 40 - .../IotHubNameUnavailabilityReason.java | 56 - .../iothub/models/IotHubProperties.java | 882 ---- .../models/IotHubPropertiesDeviceStreams.java | 89 - .../iothub/models/IotHubQuotaMetricInfo.java | 40 - .../iothub/models/IotHubReplicaRoleType.java | 53 - .../iothub/models/IotHubResources.java | 881 ---- .../iothub/models/IotHubScaleType.java | 61 - .../iothub/models/IotHubSku.java | 81 - .../iothub/models/IotHubSkuDescription.java | 40 - .../iothub/models/IotHubSkuInfo.java | 133 - .../iothub/models/IotHubSkuTier.java | 66 - .../iothub/models/IotHubs.java | 47 - .../iothub/models/IpFilterActionType.java | 56 - .../iothub/models/IpFilterRule.java | 142 - .../iothub/models/IpVersion.java | 56 - .../iothub/models/JobResponse.java | 76 - .../iothub/models/JobStatus.java | 76 - .../iothub/models/JobType.java | 91 - .../iothub/models/KeyVaultKeyProperties.java | 113 - .../iothub/models/ManagedIdentity.java | 85 - .../iothub/models/MatchedRoute.java | 74 - .../models/MessagingEndpointProperties.java | 154 - .../resourcemanager/iothub/models/Name.java | 91 - .../iothub/models/NetworkRuleIpAction.java | 46 - .../iothub/models/NetworkRuleSetIpRule.java | 142 - .../models/NetworkRuleSetProperties.java | 147 - .../iothub/models/Operation.java | 33 - .../iothub/models/OperationDisplay.java | 121 - .../iothub/models/OperationInputs.java | 86 - .../iothub/models/Operations.java | 35 - .../iothub/models/PrivateEndpoint.java | 73 - .../models/PrivateEndpointConnection.java | 55 - .../PrivateEndpointConnectionProperties.java | 118 - .../models/PrivateEndpointConnections.java | 154 - .../iothub/models/PrivateLinkResources.java | 27 - .../PrivateLinkResourcesOperations.java | 82 - .../PrivateLinkServiceConnectionState.java | 144 - .../PrivateLinkServiceConnectionStatus.java | 61 - .../iothub/models/PublicNetworkAccess.java | 51 - .../iothub/models/RegistryStatistics.java | 40 - .../iothub/models/ResourceIdentityType.java | 67 - .../models/ResourceProviderCommons.java | 43 - .../models/RootCertificateProperties.java | 107 - .../iothub/models/RouteCompilationError.java | 108 - .../iothub/models/RouteErrorPosition.java | 91 - .../iothub/models/RouteErrorRange.java | 91 - .../iothub/models/RouteErrorSeverity.java | 51 - .../iothub/models/RouteProperties.java | 212 - .../RoutingCosmosDBSqlApiProperties.java | 431 -- .../iothub/models/RoutingEndpoints.java | 225 - .../models/RoutingEventHubProperties.java | 318 -- .../iothub/models/RoutingMessage.java | 145 - .../iothub/models/RoutingProperties.java | 197 - ...tingServiceBusQueueEndpointProperties.java | 323 -- ...tingServiceBusTopicEndpointProperties.java | 323 -- .../iothub/models/RoutingSource.java | 81 - .../RoutingStorageContainerProperties.java | 446 -- ...ingStorageContainerPropertiesEncoding.java | 58 - .../iothub/models/RoutingTwin.java | 115 - .../iothub/models/RoutingTwinProperties.java | 117 - ...haredAccessSignatureAuthorizationRule.java | 47 - .../models/StorageEndpointProperties.java | 216 - .../iothub/models/TagsResource.java | 87 - .../iothub/models/TestAllRoutesInput.java | 141 - .../iothub/models/TestAllRoutesResult.java | 27 - .../iothub/models/TestResultStatus.java | 56 - .../iothub/models/TestRouteInput.java | 142 - .../iothub/models/TestRouteResult.java | 33 - .../iothub/models/TestRouteResultDetails.java | 78 - .../iothub/models/UserSubscriptionQuota.java | 159 - .../UserSubscriptionQuotaListResult.java | 34 - .../iothub/models/package-info.java | 9 - .../resourcemanager/iothub/package-info.java | 9 - .../src/main/java/module-info.java | 16 - .../proxy-config.json | 1 - .../reflect-config.json | 1 - .../azure-resourcemanager-iothub.properties | 1 - .../models/ResourceIdentityType.java | 2 +- .../LoadTestAdministrationClientBuilder.java | 30 +- .../LoadTestAdministrationServiceVersion.java | 75 + .../loadtesting/LoadTestRunClientBuilder.java | 30 +- ...on.java => LoadTestRunServiceVersion.java} | 10 +- .../LoadTestAdministrationClientImpl.java | 12 +- .../implementation/LoadTestRunClientImpl.java | 12 +- ...esourceUpdateNetworkSiblingSetSamples.java | 2 +- .../fluent/MonitorsClient.java | 16 +- .../implementation/MonitorsClientImpl.java | 48 +- .../models/Monitors.java | 8 +- .../models/NewRelicMonitorResource.java | 8 +- .../AzureChatExtensionConfiguration.java | 10 +- .../openai/models/AzureChatExtensionType.java | 3 +- .../AzureChatExtensionsMessageContext.java | 10 +- ...ureCosmosDBChatExtensionConfiguration.java | 7 +- ...AzureSearchChatExtensionConfiguration.java | 7 +- .../openai/models/ChatCompletionsOptions.java | 9 +- .../ai/openai/models/ChatMessageImageUrl.java | 9 +- ...asticsearchChatExtensionConfiguration.java | 7 +- .../MongoDBChatExtensionConfiguration.java | 7 +- .../PineconeChatExtensionConfiguration.java | 7 +- .../resourcemanager/quota/QuotaManager.java | 480 -- .../quota/fluent/GroupQuotaLimitsClient.java | 55 - .../GroupQuotaLimitsRequestsClient.java | 182 - .../GroupQuotaLocationSettingsClient.java | 275 -- ...aSubscriptionAllocationRequestsClient.java | 196 - ...oupQuotaSubscriptionAllocationsClient.java | 57 - .../GroupQuotaSubscriptionRequestsClient.java | 79 - .../fluent/GroupQuotaSubscriptionsClient.java | 265 -- .../quota/fluent/GroupQuotaUsagesClient.java | 51 - .../quota/fluent/GroupQuotasClient.java | 294 -- .../quota/fluent/QuotaManagementClient.java | 139 - .../quota/fluent/QuotaOperationsClient.java | 38 - .../fluent/QuotaRequestStatusClient.java | 86 - .../quota/fluent/QuotasClient.java | 274 -- .../quota/fluent/UsagesClient.java | 77 - .../models/CurrentQuotaLimitBaseInner.java | 157 - .../fluent/models/CurrentUsagesBaseInner.java | 144 - .../fluent/models/GroupQuotaDetailsName.java | 90 - .../models/GroupQuotaLimitListInner.java | 155 - .../GroupQuotaRequestBaseProperties.java | 149 - .../GroupQuotaRequestBasePropertiesName.java | 92 - .../models/GroupQuotaSubscriptionIdInner.java | 146 - ...upQuotaSubscriptionRequestStatusInner.java | 146 - .../models/GroupQuotaUsagesBaseName.java | 91 - .../GroupQuotasEnforcementStatusInner.java | 157 - .../fluent/models/GroupQuotasEntityInner.java | 155 - .../fluent/models/OperationResponseInner.java | 109 - .../QuotaAllocationRequestBaseProperties.java | 131 - ...taAllocationRequestBasePropertiesName.java | 92 - .../QuotaAllocationRequestStatusInner.java | 185 - ...uotaAllocationRequestStatusProperties.java | 133 - .../models/QuotaRequestDetailsInner.java | 194 - .../fluent/models/QuotaRequestProperties.java | 150 - .../fluent/models/ResourceUsagesInner.java | 144 - .../SubmittedResourceRequestStatusInner.java | 146 - ...SubscriptionQuotaAllocationsListInner.java | 157 - .../models/SubscriptionQuotaDetailsName.java | 90 - .../quota/fluent/models/package-info.java | 9 - .../quota/fluent/package-info.java | 9 - .../CurrentQuotaLimitBaseImpl.java | 118 - .../implementation/CurrentUsagesBaseImpl.java | 50 - .../GroupQuotaLimitListImpl.java | 50 - .../GroupQuotaLimitsClientImpl.java | 173 - .../implementation/GroupQuotaLimitsImpl.java | 55 - .../GroupQuotaLimitsRequestsClientImpl.java | 767 --- .../GroupQuotaLimitsRequestsImpl.java | 95 - .../GroupQuotaLocationSettingsClientImpl.java | 1002 ---- .../GroupQuotaLocationSettingsImpl.java | 102 - ...scriptionAllocationRequestsClientImpl.java | 723 --- ...otaSubscriptionAllocationRequestsImpl.java | 97 - ...uotaSubscriptionAllocationsClientImpl.java | 179 - ...GroupQuotaSubscriptionAllocationsImpl.java | 55 - .../GroupQuotaSubscriptionIdImpl.java | 50 - ...oupQuotaSubscriptionRequestStatusImpl.java | 50 - ...upQuotaSubscriptionRequestsClientImpl.java | 376 -- .../GroupQuotaSubscriptionRequestsImpl.java | 70 - .../GroupQuotaSubscriptionsClientImpl.java | 947 ---- .../GroupQuotaSubscriptionsImpl.java | 112 - .../GroupQuotaUsagesClientImpl.java | 291 -- .../implementation/GroupQuotaUsagesImpl.java | 49 - .../implementation/GroupQuotasClientImpl.java | 1169 ----- .../GroupQuotasEnforcementStatusImpl.java | 50 - .../implementation/GroupQuotasEntityImpl.java | 50 - .../quota/implementation/GroupQuotasImpl.java | 112 - .../implementation/OperationResponseImpl.java | 41 - .../QuotaAllocationRequestStatusImpl.java | 64 - .../QuotaManagementClientBuilder.java | 138 - .../QuotaManagementClientImpl.java | 500 -- .../QuotaOperationsClientImpl.java | 238 - .../implementation/QuotaOperationsImpl.java | 45 - .../QuotaRequestDetailsImpl.java | 76 - .../QuotaRequestStatusClientImpl.java | 426 -- .../QuotaRequestStatusImpl.java | 64 - .../implementation/QuotasClientImpl.java | 908 ---- .../quota/implementation/QuotasImpl.java | 102 - .../implementation/ResourceManagerUtils.java | 195 - .../implementation/ResourceUsagesImpl.java | 49 - .../SubmittedResourceRequestStatusImpl.java | 50 - .../SubscriptionQuotaAllocationsListImpl.java | 50 - .../implementation/UsagesClientImpl.java | 349 -- .../quota/implementation/UsagesImpl.java | 66 - .../implementation/models/GroupQuotaList.java | 96 - .../models/GroupQuotaSubscriptionIdList.java | 96 - ...oupQuotaSubscriptionRequestStatusList.java | 98 - .../implementation/models/OperationList.java | 96 - .../QuotaAllocationRequestStatusList.java | 97 - .../implementation/models/QuotaLimits.java | 96 - .../models/QuotaRequestDetailsList.java | 96 - .../models/ResourceUsageList.java | 96 - .../SubmittedResourceRequestStatusList.java | 97 - .../implementation/models/UsagesLimits.java | 96 - .../quota/implementation/package-info.java | 9 - .../AllocatedQuotaToSubscriptionList.java | 78 - .../quota/models/AllocatedToSubscription.java | 91 - .../quota/models/CurrentQuotaLimitBase.java | 183 - .../quota/models/CurrentUsagesBase.java | 55 - .../quota/models/EnforcementState.java | 56 - .../quota/models/GroupQuotaDetails.java | 277 -- .../quota/models/GroupQuotaLimit.java | 85 - .../quota/models/GroupQuotaLimitList.java | 55 - .../models/GroupQuotaLimitListProperties.java | 121 - .../models/GroupQuotaLimitProperties.java | 184 - .../quota/models/GroupQuotaLimits.java | 50 - .../models/GroupQuotaLimitsRequests.java | 124 - .../models/GroupQuotaLocationSettings.java | 154 - .../quota/models/GroupQuotaRequestBase.java | 123 - ...upQuotaSubscriptionAllocationRequests.java | 137 - .../GroupQuotaSubscriptionAllocations.java | 52 - .../models/GroupQuotaSubscriptionId.java | 55 - .../GroupQuotaSubscriptionIdProperties.java | 92 - .../GroupQuotaSubscriptionRequestStatus.java | 55 - ...taSubscriptionRequestStatusProperties.java | 119 - .../GroupQuotaSubscriptionRequests.java | 72 - .../quota/models/GroupQuotaSubscriptions.java | 151 - .../quota/models/GroupQuotaUsages.java | 46 - .../quota/models/GroupQuotaUsagesBase.java | 150 - .../quota/models/GroupQuotas.java | 168 - .../models/GroupQuotasEnforcementStatus.java | 55 - ...roupQuotasEnforcementStatusProperties.java | 138 - .../quota/models/GroupQuotasEntity.java | 55 - .../quota/models/GroupQuotasEntityBase.java | 139 - .../models/GroupQuotasEntityBasePatch.java | 113 - .../quota/models/GroupQuotasEntityPatch.java | 154 - .../GroupQuotasEntityPatchProperties.java | 87 - .../models/GroupQuotasEntityProperties.java | 103 - .../quota/models/GroupType.java | 51 - .../quota/models/LimitJsonObject.java | 100 - .../quota/models/LimitObject.java | 132 - .../quota/models/LimitType.java | 46 - .../quota/models/OperationDisplay.java | 125 - .../quota/models/OperationResponse.java | 40 - .../models/QuotaAllocationRequestBase.java | 113 - .../models/QuotaAllocationRequestStatus.java | 78 - .../quota/models/QuotaLimitTypes.java | 51 - .../quota/models/QuotaOperations.java | 33 - .../quota/models/QuotaProperties.java | 231 - .../quota/models/QuotaRequestDetails.java | 86 - .../quota/models/QuotaRequestState.java | 66 - .../quota/models/QuotaRequestStatus.java | 79 - .../resourcemanager/quota/models/Quotas.java | 107 - .../quota/models/QuotasGetHeaders.java | 39 - .../quota/models/QuotasGetResponse.java | 39 - .../quota/models/RequestState.java | 82 - .../quota/models/ResourceName.java | 101 - .../quota/models/ResourceUsages.java | 55 - .../quota/models/ServiceErrorDetail.java | 89 - .../quota/models/SubRequest.java | 174 - .../SubmittedResourceRequestStatus.java | 55 - ...mittedResourceRequestStatusProperties.java | 131 - .../models/SubscriptionQuotaAllocations.java | 88 - .../SubscriptionQuotaAllocationsList.java | 55 - ...riptionQuotaAllocationsListProperties.java | 123 - ...ubscriptionQuotaAllocationsProperties.java | 138 - .../models/SubscriptionQuotaDetails.java | 189 - .../resourcemanager/quota/models/Usages.java | 70 - .../quota/models/UsagesGetHeaders.java | 39 - .../quota/models/UsagesGetResponse.java | 39 - .../quota/models/UsagesObject.java | 92 - .../quota/models/UsagesProperties.java | 186 - .../quota/models/UsagesTypes.java | 51 - .../quota/models/package-info.java | 9 - .../resourcemanager/quota/package-info.java | 9 - .../src/main/java/module-info.java | 16 - .../proxy-config.json | 1 - .../reflect-config.json | 1 - .../azure-resourcemanager-quota.properties | 1 - .../RecoveryServicesBackupManager.java | 1125 ----- .../fluent/BackupEnginesClient.java | 79 - .../fluent/BackupJobsClient.java | 46 - .../fluent/BackupOperationResultsClient.java | 51 - .../fluent/BackupOperationStatusesClient.java | 50 - .../fluent/BackupPoliciesClient.java | 47 - .../fluent/BackupProtectableItemsClient.java | 48 - .../fluent/BackupProtectedItemsClient.java | 46 - .../BackupProtectionContainersClient.java | 45 - .../fluent/BackupProtectionIntentsClient.java | 46 - ...BackupResourceEncryptionConfigsClient.java | 74 - ...upResourceStorageConfigsNonCrrsClient.java | 104 - .../BackupResourceVaultConfigsClient.java | 106 - .../fluent/BackupStatusClient.java | 45 - .../fluent/BackupUsageSummariesClient.java | 46 - .../fluent/BackupWorkloadItemsClient.java | 55 - .../fluent/BackupsClient.java | 54 - ...PrepareDataMoveOperationResultsClient.java | 46 - .../DeletedProtectionContainersClient.java | 45 - .../ExportJobsOperationResultsClient.java | 50 - .../fluent/FeatureSupportsClient.java | 45 - .../fluent/FetchTieringCostsClient.java | 87 - .../GetTieringCostOperationResultsClient.java | 46 - .../ItemLevelRecoveryConnectionsClient.java | 99 - .../fluent/JobCancellationsClient.java | 45 - .../fluent/JobDetailsClient.java | 46 - .../fluent/JobOperationResultsClient.java | 46 - .../fluent/JobsClient.java | 42 - .../fluent/OperationOperationsClient.java | 48 - .../fluent/OperationsClient.java | 40 - .../PrivateEndpointConnectionsClient.java | 175 - .../fluent/PrivateEndpointsClient.java | 49 - .../fluent/ProtectableContainersClient.java | 48 - .../ProtectedItemOperationResultsClient.java | 53 - .../ProtectedItemOperationStatusesClient.java | 59 - .../fluent/ProtectedItemsClient.java | 176 - ...ectionContainerOperationResultsClient.java | 51 - ...ontainerRefreshOperationResultsClient.java | 47 - .../fluent/ProtectionContainersClient.java | 234 - .../fluent/ProtectionIntentsClient.java | 155 - .../fluent/ProtectionPoliciesClient.java | 150 - ...rotectionPolicyOperationResultsClient.java | 49 - ...otectionPolicyOperationStatusesClient.java | 54 - .../fluent/RecoveryPointsClient.java | 135 - ...coveryPointsRecommendedForMovesClient.java | 55 - ...ecoveryServicesBackupManagementClient.java | 412 -- .../ResourceGuardProxyOperationsClient.java | 174 - .../fluent/ResourceProvidersClient.java | 247 - .../fluent/RestoresClient.java | 102 - .../fluent/SecurityPINsClient.java | 46 - .../TieringCostOperationStatusClient.java | 46 - .../ValidateOperationResultsClient.java | 46 - .../ValidateOperationStatusesClient.java | 50 - .../fluent/ValidateOperationsClient.java | 80 - ...VMResourceFeatureSupportResponseInner.java | 78 - .../models/BackupEngineBaseResourceInner.java | 198 - .../models/BackupManagementUsageInner.java | 166 - .../BackupResourceConfigResourceInner.java | 242 - ...EncryptionConfigExtendedResourceInner.java | 201 - ...ackupResourceVaultConfigResourceInner.java | 243 - .../models/BackupStatusResponseInner.java | 253 - ...ClientDiscoveryValueForSingleApiInner.java | 131 - .../fluent/models/JobResourceInner.java | 197 - .../OperationResultInfoBaseResourceInner.java | 120 - .../fluent/models/OperationStatusInner.java | 186 - .../PreValidateEnableBackupResponseInner.java | 168 - ...rivateEndpointConnectionResourceInner.java | 243 - .../ProtectableContainerResourceInner.java | 198 - .../models/ProtectedItemResourceInner.java | 241 - .../ProtectionContainerResourceInner.java | 242 - .../models/ProtectionIntentResourceInner.java | 242 - .../models/ProtectionPolicyResourceInner.java | 242 - .../models/RecoveryPointResourceInner.java | 197 - .../ResourceGuardProxyBaseResourceInner.java | 243 - .../fluent/models/TieringCostInfoInner.java | 105 - .../fluent/models/TokenInformationInner.java | 108 - .../models/UnlockDeleteResponseInner.java | 74 - .../ValidateOperationsResponseInner.java | 77 - ...ageConfigOperationResultResponseInner.java | 105 - .../models/WorkloadItemResourceInner.java | 197 - .../WorkloadProtectableItemResourceInner.java | 199 - .../fluent/models/package-info.java | 9 - .../fluent/package-info.java | 9 - ...eVMResourceFeatureSupportResponseImpl.java | 33 - .../BackupEngineBaseResourceImpl.java | 69 - .../BackupEnginesClientImpl.java | 409 -- .../implementation/BackupEnginesImpl.java | 66 - .../implementation/BackupJobsClientImpl.java | 296 -- .../implementation/BackupJobsImpl.java | 47 - .../BackupManagementUsageImpl.java | 55 - .../BackupOperationResultsClientImpl.java | 161 - .../BackupOperationResultsImpl.java | 42 - .../BackupOperationStatusesClientImpl.java | 162 - .../BackupOperationStatusesImpl.java | 53 - .../BackupPoliciesClientImpl.java | 302 -- .../implementation/BackupPoliciesImpl.java | 47 - .../BackupProtectableItemsClientImpl.java | 311 -- .../BackupProtectableItemsImpl.java | 50 - .../BackupProtectedItemsClientImpl.java | 303 -- .../BackupProtectedItemsImpl.java | 47 - .../BackupProtectionContainersClientImpl.java | 297 -- .../BackupProtectionContainersImpl.java | 49 - .../BackupProtectionIntentsClientImpl.java | 304 -- .../BackupProtectionIntentsImpl.java | 47 - .../BackupResourceConfigResourceImpl.java | 69 - ...eEncryptionConfigExtendedResourceImpl.java | 70 - ...upResourceEncryptionConfigsClientImpl.java | 244 - .../BackupResourceEncryptionConfigsImpl.java | 64 - ...sourceStorageConfigsNonCrrsClientImpl.java | 339 -- ...ckupResourceStorageConfigsNonCrrsImpl.java | 80 - ...BackupResourceVaultConfigResourceImpl.java | 69 - .../BackupResourceVaultConfigsClientImpl.java | 343 -- .../BackupResourceVaultConfigsImpl.java | 91 - .../BackupStatusClientImpl.java | 150 - .../implementation/BackupStatusImpl.java | 54 - .../BackupStatusResponseImpl.java | 75 - .../BackupUsageSummariesClientImpl.java | 303 -- .../BackupUsageSummariesImpl.java | 47 - .../BackupWorkloadItemsClientImpl.java | 338 -- .../BackupWorkloadItemsImpl.java | 49 - .../implementation/BackupsClientImpl.java | 176 - .../implementation/BackupsImpl.java | 47 - ...areDataMoveOperationResultsClientImpl.java | 156 - ...msPrepareDataMoveOperationResultsImpl.java | 55 - .../ClientDiscoveryValueForSingleApiImpl.java | 46 - ...DeletedProtectionContainersClientImpl.java | 295 -- .../DeletedProtectionContainersImpl.java | 49 - .../ExportJobsOperationResultsClientImpl.java | 162 - .../ExportJobsOperationResultsImpl.java | 54 - .../FeatureSupportsClientImpl.java | 152 - .../implementation/FeatureSupportsImpl.java | 54 - .../FetchTieringCostsClientImpl.java | 277 -- .../implementation/FetchTieringCostsImpl.java | 54 - ...TieringCostOperationResultsClientImpl.java | 153 - .../GetTieringCostOperationResultsImpl.java | 53 - ...temLevelRecoveryConnectionsClientImpl.java | 307 -- .../ItemLevelRecoveryConnectionsImpl.java | 62 - .../JobCancellationsClientImpl.java | 149 - .../implementation/JobCancellationsImpl.java | 42 - .../implementation/JobDetailsClientImpl.java | 153 - .../implementation/JobDetailsImpl.java | 53 - .../JobOperationResultsClientImpl.java | 151 - .../JobOperationResultsImpl.java | 42 - .../implementation/JobResourceImpl.java | 69 - .../implementation/JobsClientImpl.java | 143 - .../implementation/JobsImpl.java | 42 - .../OperationOperationsClientImpl.java | 159 - .../OperationOperationsImpl.java | 55 - .../OperationResultInfoBaseResourceImpl.java | 50 - .../implementation/OperationStatusImpl.java | 60 - .../implementation/OperationsClientImpl.java | 243 - .../implementation/OperationsImpl.java | 47 - .../PreValidateEnableBackupResponseImpl.java | 53 - ...PrivateEndpointConnectionResourceImpl.java | 180 - .../PrivateEndpointConnectionsClientImpl.java | 563 --- .../PrivateEndpointConnectionsImpl.java | 149 - .../PrivateEndpointsClientImpl.java | 164 - .../implementation/PrivateEndpointsImpl.java | 56 - .../ProtectableContainerResourceImpl.java | 69 - .../ProtectableContainersClientImpl.java | 306 -- .../ProtectableContainersImpl.java | 51 - ...otectedItemOperationResultsClientImpl.java | 172 - .../ProtectedItemOperationResultsImpl.java | 56 - ...tectedItemOperationStatusesClientImpl.java | 184 - .../ProtectedItemOperationStatusesImpl.java | 56 - .../ProtectedItemResourceImpl.java | 196 - .../ProtectedItemsClientImpl.java | 545 --- .../implementation/ProtectedItemsImpl.java | 194 - ...onContainerOperationResultsClientImpl.java | 168 - ...otectionContainerOperationResultsImpl.java | 55 - ...inerRefreshOperationResultsClientImpl.java | 154 - ...nContainerRefreshOperationResultsImpl.java | 43 - .../ProtectionContainerResourceImpl.java | 194 - .../ProtectionContainersClientImpl.java | 723 --- .../ProtectionContainersImpl.java | 136 - .../ProtectionIntentResourceImpl.java | 192 - .../ProtectionIntentsClientImpl.java | 488 -- .../implementation/ProtectionIntentsImpl.java | 186 - .../ProtectionPoliciesClientImpl.java | 471 -- .../ProtectionPoliciesImpl.java | 141 - ...ctionPolicyOperationResultsClientImpl.java | 160 - .../ProtectionPolicyOperationResultsImpl.java | 55 - ...tionPolicyOperationStatusesClientImpl.java | 171 - ...ProtectionPolicyOperationStatusesImpl.java | 53 - .../ProtectionPolicyResourceImpl.java | 183 - .../RecoveryPointResourceImpl.java | 69 - .../RecoveryPointsClientImpl.java | 572 --- .../implementation/RecoveryPointsImpl.java | 94 - ...ryPointsRecommendedForMovesClientImpl.java | 310 -- ...RecoveryPointsRecommendedForMovesImpl.java | 51 - ...ServicesBackupManagementClientBuilder.java | 139 - ...eryServicesBackupManagementClientImpl.java | 1125 ----- .../ResourceGuardProxyBaseResourceImpl.java | 197 - ...esourceGuardProxyOperationsClientImpl.java | 675 --- .../ResourceGuardProxyOperationsImpl.java | 182 - .../implementation/ResourceManagerUtils.java | 195 - .../ResourceProvidersClientImpl.java | 781 ---- .../implementation/ResourceProvidersImpl.java | 88 - .../implementation/RestoresClientImpl.java | 324 -- .../implementation/RestoresImpl.java | 47 - .../SecurityPINsClientImpl.java | 156 - .../implementation/SecurityPINsImpl.java | 54 - .../implementation/TieringCostInfoImpl.java | 32 - .../TieringCostOperationStatusClientImpl.java | 153 - .../TieringCostOperationStatusImpl.java | 53 - .../implementation/TokenInformationImpl.java | 40 - .../UnlockDeleteResponseImpl.java | 32 - .../ValidateOperationResultsClientImpl.java | 155 - .../ValidateOperationResultsImpl.java | 53 - .../ValidateOperationStatusesClientImpl.java | 162 - .../ValidateOperationStatusesImpl.java | 53 - .../ValidateOperationsClientImpl.java | 262 -- .../ValidateOperationsImpl.java | 42 - .../ValidateOperationsResponseImpl.java | 33 - ...rageConfigOperationResultResponseImpl.java | 32 - .../WorkloadItemResourceImpl.java | 69 - .../WorkloadProtectableItemResourceImpl.java | 69 - .../models/BackupEngineBaseResourceList.java | 98 - .../models/BackupManagementUsageList.java | 98 - .../models/ClientDiscoveryResponse.java | 95 - .../models/JobResourceList.java | 97 - .../ProtectableContainerResourceList.java | 99 - .../models/ProtectedItemResourceList.java | 98 - .../ProtectionContainerResourceList.java | 99 - .../models/ProtectionIntentResourceList.java | 98 - .../models/ProtectionPolicyResourceList.java | 98 - .../models/RecoveryPointResourceList.java | 98 - .../ResourceGuardProxyBaseResourceList.java | 99 - .../models/WorkloadItemResourceList.java | 98 - .../WorkloadProtectableItemResourceList.java | 99 - .../implementation/package-info.java | 9 - .../models/AcquireStorageAccountLock.java | 51 - .../AzureBackupGoalFeatureSupportRequest.java | 75 - .../models/AzureBackupServerContainer.java | 246 - .../models/AzureBackupServerEngine.java | 116 - .../models/AzureFileShareBackupRequest.java | 111 - .../models/AzureFileShareProtectableItem.java | 142 - .../AzureFileShareProtectionPolicy.java | 251 - .../AzureFileShareProvisionIlrRequest.java | 133 - .../models/AzureFileShareRecoveryPoint.java | 200 - .../models/AzureFileShareRestoreRequest.java | 268 -- .../models/AzureFileShareType.java | 56 - .../models/AzureFileshareProtectedItem.java | 495 -- ...ureFileshareProtectedItemExtendedInfo.java | 186 - .../AzureIaaSClassicComputeVMContainer.java | 183 - ...reIaaSClassicComputeVMProtectableItem.java | 97 - ...zureIaaSClassicComputeVMProtectedItem.java | 406 -- .../models/AzureIaaSComputeVMContainer.java | 181 - .../AzureIaaSComputeVMProtectableItem.java | 97 - .../AzureIaaSComputeVMProtectedItem.java | 404 -- .../models/AzureIaaSvmErrorInfo.java | 123 - .../models/AzureIaaSvmHealthDetails.java | 126 - .../models/AzureIaaSvmJob.java | 233 - .../models/AzureIaaSvmJobExtendedInfo.java | 167 - .../models/AzureIaaSvmJobTaskDetails.java | 205 - .../models/AzureIaaSvmJobV2.java | 216 - .../models/AzureIaaSvmProtectedItem.java | 685 --- .../AzureIaaSvmProtectedItemExtendedInfo.java | 255 - .../models/AzureIaaSvmProtectionPolicy.java | 344 -- ...eRecoveryServiceVaultProtectionIntent.java | 169 - .../models/AzureResourceProtectionIntent.java | 168 - .../models/AzureSqlContainer.java | 145 - .../models/AzureSqlProtectedItem.java | 377 -- .../AzureSqlProtectedItemExtendedInfo.java | 150 - .../models/AzureSqlProtectionPolicy.java | 133 - ...gWorkloadContainerProtectionContainer.java | 218 - .../models/AzureStorageContainer.java | 317 -- .../models/AzureStorageErrorInfo.java | 111 - .../models/AzureStorageJob.java | 233 - .../models/AzureStorageJobExtendedInfo.java | 113 - .../models/AzureStorageJobTaskDetails.java | 91 - .../AzureStorageProtectableContainer.java | 95 - ...ureVMAppContainerProtectableContainer.java | 95 - ...zureVMAppContainerProtectionContainer.java | 214 - .../AzureVMResourceFeatureSupportRequest.java | 131 - ...AzureVMResourceFeatureSupportResponse.java | 27 - .../models/AzureVmWorkloadItem.java | 262 -- .../AzureVmWorkloadProtectableItem.java | 394 -- .../models/AzureVmWorkloadProtectedItem.java | 734 --- ...reVmWorkloadProtectedItemExtendedInfo.java | 282 -- .../AzureVmWorkloadProtectionPolicy.java | 254 - ...orkloadSAPHanaScaleoutProtectableItem.java | 122 - ...ureVmWorkloadSQLInstanceProtectedItem.java | 525 --- ...WorkloadSapAseDatabaseProtectableItem.java | 122 - ...VmWorkloadSapAseDatabaseProtectedItem.java | 468 -- ...eVmWorkloadSapAseDatabaseWorkloadItem.java | 106 - ...VmWorkloadSapAseSystemProtectableItem.java | 121 - ...ureVmWorkloadSapAseSystemWorkloadItem.java | 106 - .../AzureVmWorkloadSapHanaDBInstance.java | 121 - ...orkloadSapHanaDBInstanceProtectedItem.java | 469 -- ...orkloadSapHanaDatabaseProtectableItem.java | 122 - ...mWorkloadSapHanaDatabaseProtectedItem.java | 468 -- ...VmWorkloadSapHanaDatabaseWorkloadItem.java | 106 - .../models/AzureVmWorkloadSapHanaHsr.java | 118 - ...mWorkloadSapHanaSystemProtectableItem.java | 122 - ...reVmWorkloadSapHanaSystemWorkloadItem.java | 106 - ...adSqlAvailabilityGroupProtectableItem.java | 145 - ...eVmWorkloadSqlDatabaseProtectableItem.java | 121 - ...ureVmWorkloadSqlDatabaseProtectedItem.java | 525 --- ...zureVmWorkloadSqlDatabaseWorkloadItem.java | 106 - ...eVmWorkloadSqlInstanceProtectableItem.java | 121 - ...zureVmWorkloadSqlInstanceWorkloadItem.java | 127 - .../AzureWorkloadAutoProtectionIntent.java | 166 - .../models/AzureWorkloadBackupRequest.java | 168 - .../models/AzureWorkloadContainer.java | 318 -- ...WorkloadContainerAutoProtectionIntent.java | 142 - .../AzureWorkloadContainerExtendedInfo.java | 147 - .../models/AzureWorkloadErrorInfo.java | 145 - .../models/AzureWorkloadJob.java | 198 - .../models/AzureWorkloadJobExtendedInfo.java | 113 - .../models/AzureWorkloadJobTaskDetails.java | 91 - ...AzureWorkloadPointInTimeRecoveryPoint.java | 174 - ...zureWorkloadPointInTimeRestoreRequest.java | 244 - .../models/AzureWorkloadRecoveryPoint.java | 280 -- .../models/AzureWorkloadRestoreRequest.java | 407 -- ...orkloadSapAsePointInTimeRecoveryPoint.java | 122 - ...rkloadSapAsePointInTimeRestoreRequest.java | 246 - .../AzureWorkloadSapAseRecoveryPoint.java | 117 - .../AzureWorkloadSapAseRestoreRequest.java | 235 - ...rkloadSapHanaPointInTimeRecoveryPoint.java | 122 - ...kloadSapHanaPointInTimeRestoreRequest.java | 272 -- ...ointInTimeRestoreWithRehydrateRequest.java | 267 -- .../AzureWorkloadSapHanaRecoveryPoint.java | 118 - .../AzureWorkloadSapHanaRestoreRequest.java | 240 - ...oadSapHanaRestoreWithRehydrateRequest.java | 244 - .../AzureWorkloadSqlAutoProtectionIntent.java | 171 - ...reWorkloadSqlPointInTimeRecoveryPoint.java | 140 - ...eWorkloadSqlPointInTimeRestoreRequest.java | 316 -- ...ointInTimeRestoreWithRehydrateRequest.java | 309 -- .../models/AzureWorkloadSqlRecoveryPoint.java | 178 - ...eWorkloadSqlRecoveryPointExtendedInfo.java | 123 - .../AzureWorkloadSqlRestoreRequest.java | 334 -- ...orkloadSqlRestoreWithRehydrateRequest.java | 287 -- .../models/BackupEngineBase.java | 443 -- .../models/BackupEngineBaseResource.java | 78 - .../models/BackupEngineExtendedInfo.java | 199 - .../models/BackupEngineType.java | 56 - .../models/BackupEngines.java | 72 - .../models/BackupItemType.java | 121 - .../models/BackupJobs.java | 41 - .../models/BackupManagementType.java | 86 - .../models/BackupManagementUsage.java | 62 - .../models/BackupOperationResults.java | 47 - .../models/BackupOperationStatuses.java | 45 - .../models/BackupPolicies.java | 42 - .../models/BackupProtectableItems.java | 43 - .../models/BackupProtectedItems.java | 41 - .../models/BackupProtectionContainers.java | 40 - .../models/BackupProtectionIntents.java | 41 - .../models/BackupRequest.java | 105 - .../models/BackupRequestResource.java | 240 - .../models/BackupResourceConfig.java | 230 - .../models/BackupResourceConfigResource.java | 78 - .../BackupResourceEncryptionConfig.java | 205 - ...ackupResourceEncryptionConfigExtended.java | 113 - ...ourceEncryptionConfigExtendedResource.java | 79 - ...ackupResourceEncryptionConfigResource.java | 242 - .../BackupResourceEncryptionConfigs.java | 66 - .../BackupResourceStorageConfigsNonCrrs.java | 95 - .../models/BackupResourceVaultConfig.java | 298 -- .../BackupResourceVaultConfigResource.java | 78 - .../models/BackupResourceVaultConfigs.java | 98 - .../models/BackupStatus.java | 38 - .../models/BackupStatusRequest.java | 141 - .../models/BackupStatusResponse.java | 98 - .../models/BackupType.java | 81 - .../models/BackupUsageSummaries.java | 41 - .../models/BackupWorkloadItems.java | 50 - .../models/Backups.java | 49 - .../models/BekDetails.java | 108 - .../BmsPrepareDataMoveOperationResults.java | 41 - .../models/ClientDiscoveryDisplay.java | 125 - .../ClientDiscoveryForLogSpecification.java | 109 - .../models/ClientDiscoveryForProperties.java | 75 - ...lientDiscoveryForServiceSpecification.java | 80 - .../ClientDiscoveryValueForSingleApi.java | 49 - .../models/ClientScriptForConnect.java | 147 - .../models/ContainerIdentityInfo.java | 169 - .../models/CopyOptions.java | 66 - .../models/CreateMode.java | 56 - .../models/DailyRetentionFormat.java | 88 - .../models/DailyRetentionSchedule.java | 120 - .../models/DailySchedule.java | 92 - .../models/DataMoveLevel.java | 56 - .../models/DataSourceType.java | 121 - .../models/DatabaseInRP.java | 91 - .../recoveryservicesbackup/models/Day.java | 113 - .../models/DayOfWeek.java | 81 - .../models/DedupState.java | 56 - .../models/DeletedProtectionContainers.java | 40 - .../models/DiskExclusionProperties.java | 115 - .../models/DiskInformation.java | 91 - .../models/DistributedNodesInfo.java | 172 - .../models/DpmBackupEngine.java | 114 - .../models/DpmContainer.java | 395 -- .../models/DpmContainerExtendedInfo.java | 90 - .../models/DpmErrorInfo.java | 94 - .../recoveryservicesbackup/models/DpmJob.java | 247 - .../models/DpmJobExtendedInfo.java | 113 - .../models/DpmJobTaskDetails.java | 151 - .../models/DpmProtectedItem.java | 401 -- .../models/DpmProtectedItemExtendedInfo.java | 473 -- .../models/EncryptionAtRestType.java | 56 - .../models/EncryptionDetails.java | 199 - .../models/EnhancedSecurityState.java | 56 - .../models/ErrorDetail.java | 107 - .../models/ExportJobsOperationResultInfo.java | 145 - .../models/ExportJobsOperationResults.java | 45 - .../models/ExtendedLocation.java | 113 - .../models/ExtendedProperties.java | 113 - .../models/FabricName.java | 51 - .../models/FeatureSupportRequest.java | 101 - .../models/FeatureSupports.java | 39 - ...hTieringCostInfoForRehydrationRequest.java | 218 - .../models/FetchTieringCostInfoRequest.java | 169 - ...ieringCostSavingsInfoForPolicyRequest.java | 132 - ...ostSavingsInfoForProtectedItemRequest.java | 162 - ...TieringCostSavingsInfoForVaultRequest.java | 104 - .../models/FetchTieringCosts.java | 44 - .../models/GenericContainer.java | 201 - .../models/GenericContainerExtendedInfo.java | 145 - .../models/GenericProtectedItem.java | 462 -- .../models/GenericProtectionPolicy.java | 191 - .../models/GenericRecoveryPoint.java | 176 - .../GetTieringCostOperationResults.java | 41 - .../models/HealthStatus.java | 61 - .../models/HourlySchedule.java | 151 - .../models/HttpStatusCode.java | 281 -- .../models/IaaSvmContainer.java | 259 -- .../models/IaasVMBackupRequest.java | 111 - .../models/IaasVMRecoveryPoint.java | 431 -- .../models/IaasVMRestoreRequest.java | 818 ---- .../IaasVMRestoreWithRehydrationRequest.java | 414 -- .../models/IaasVMSnapshotConsistencyType.java | 46 - .../models/IaasVmProtectableItem.java | 200 - .../models/IaasVmilrRegistrationRequest.java | 191 - .../models/IaasvmPolicyType.java | 56 - .../models/IdentityBasedRestoreDetails.java | 113 - .../models/IdentityInfo.java | 118 - .../models/IlrRequest.java | 103 - .../models/IlrRequestResource.java | 240 - .../models/InfrastructureEncryptionState.java | 56 - .../models/InquiryInfo.java | 151 - .../models/InquiryStatus.java | 56 - .../models/InquiryValidation.java | 145 - .../models/InstanceProtectionReadiness.java | 66 - .../models/InstantItemRecoveryTarget.java | 77 - .../models/InstantRPAdditionalDetails.java | 113 - .../models/ItemLevelRecoveryConnections.java | 92 - .../recoveryservicesbackup/models/Job.java | 317 -- .../models/JobCancellations.java | 41 - .../models/JobDetails.java | 40 - .../models/JobOperationResults.java | 42 - .../models/JobResource.java | 77 - .../models/JobSupportedAction.java | 61 - .../recoveryservicesbackup/models/Jobs.java | 38 - .../models/KekDetails.java | 108 - .../models/KeyAndSecretDetails.java | 114 - .../models/KpiResourceHealthDetails.java | 119 - .../models/LastBackupStatus.java | 61 - .../models/LastUpdateStatus.java | 81 - ...coveryPointsRecommendedForMoveRequest.java | 118 - .../models/LogSchedulePolicy.java | 104 - .../models/LongTermRetentionPolicy.java | 188 - .../models/LongTermSchedulePolicy.java | 76 - .../models/MabContainer.java | 344 -- .../models/MabContainerExtendedInfo.java | 205 - .../models/MabContainerHealthDetails.java | 172 - .../models/MabErrorInfo.java | 91 - .../models/MabFileFolderProtectedItem.java | 491 -- ...abFileFolderProtectedItemExtendedInfo.java | 153 - .../recoveryservicesbackup/models/MabJob.java | 230 - .../models/MabJobExtendedInfo.java | 113 - .../models/MabJobTaskDetails.java | 151 - .../models/MabProtectionPolicy.java | 159 - .../models/MabServerType.java | 116 - .../models/MonthOfYear.java | 111 - .../models/MonthlyRetentionSchedule.java | 208 - .../models/MoveRPAcrossTiersRequest.java | 145 - .../models/NameInfo.java | 91 - .../models/OperationOperations.java | 42 - .../models/OperationResultInfo.java | 95 - .../models/OperationResultInfoBase.java | 103 - .../OperationResultInfoBaseResource.java | 43 - .../models/OperationStatus.java | 69 - .../models/OperationStatusError.java | 91 - .../models/OperationStatusExtendedInfo.java | 107 - .../OperationStatusJobExtendedInfo.java | 94 - .../OperationStatusJobsExtendedInfo.java | 116 - ...erationStatusProvisionIlrExtendedInfo.java | 95 - ...onStatusValidateOperationExtendedInfo.java | 95 - .../models/OperationStatusValues.java | 66 - .../models/OperationType.java | 61 - .../models/OperationWorkerResponse.java | 118 - .../models/Operations.java | 35 - .../models/OverwriteOptions.java | 56 - .../models/PatchRecoveryPointInput.java | 87 - .../PatchRecoveryPointPropertiesInput.java | 91 - .../models/PointInTimeRange.java | 98 - .../models/PolicyType.java | 81 - .../models/PreBackupValidation.java | 108 - .../PreValidateEnableBackupRequest.java | 175 - .../PreValidateEnableBackupResponse.java | 65 - .../models/PrepareDataMoveRequest.java | 204 - .../models/PrepareDataMoveResponse.java | 114 - .../models/PrivateEndpoint.java | 85 - .../models/PrivateEndpointConnection.java | 177 - .../PrivateEndpointConnectionResource.java | 301 -- .../PrivateEndpointConnectionStatus.java | 61 - .../models/PrivateEndpointConnections.java | 119 - .../models/PrivateEndpoints.java | 44 - .../PrivateLinkServiceConnectionState.java | 143 - .../models/ProtectableContainer.java | 221 - .../models/ProtectableContainerResource.java | 78 - .../models/ProtectableContainerType.java | 138 - .../models/ProtectableContainers.java | 42 - .../models/ProtectedItem.java | 680 --- .../models/ProtectedItemHealthStatus.java | 66 - .../models/ProtectedItemOperationResults.java | 48 - .../ProtectedItemOperationStatuses.java | 54 - .../models/ProtectedItemResource.java | 303 -- .../models/ProtectedItemState.java | 76 - .../models/ProtectedItems.java | 149 - .../models/ProtectionContainer.java | 272 -- .../ProtectionContainerOperationResults.java | 46 - ...ctionContainerRefreshOperationResults.java | 42 - .../models/ProtectionContainerResource.java | 323 -- .../models/ProtectionContainers.java | 168 - .../models/ProtectionIntent.java | 252 - .../models/ProtectionIntentItemType.java | 74 - .../models/ProtectionIntentResource.java | 302 -- .../models/ProtectionIntents.java | 166 - .../models/ProtectionLevel.java | 51 - .../models/ProtectionPolicies.java | 130 - .../models/ProtectionPolicy.java | 170 - .../ProtectionPolicyOperationResults.java | 43 - .../ProtectionPolicyOperationStatuses.java | 49 - .../models/ProtectionPolicyResource.java | 301 -- .../models/ProtectionState.java | 76 - .../models/ProtectionStatus.java | 66 - .../models/ProvisioningState.java | 61 - .../models/RecoveryMode.java | 71 - .../models/RecoveryPoint.java | 179 - .../RecoveryPointDiskConfiguration.java | 135 - .../RecoveryPointMoveReadinessInfo.java | 93 - .../models/RecoveryPointProperties.java | 108 - .../models/RecoveryPointRehydrationInfo.java | 118 - .../models/RecoveryPointResource.java | 77 - .../models/RecoveryPointTierInformation.java | 145 - .../RecoveryPointTierInformationV2.java | 115 - .../models/RecoveryPointTierStatus.java | 66 - .../models/RecoveryPointTierType.java | 66 - .../models/RecoveryPoints.java | 125 - .../RecoveryPointsRecommendedForMoves.java | 49 - .../models/RecoveryType.java | 66 - .../models/RehydrationPriority.java | 51 - .../models/ResourceGuardOperationDetail.java | 113 - .../models/ResourceGuardProxyBase.java | 175 - .../ResourceGuardProxyBaseResource.java | 325 -- .../models/ResourceGuardProxyOperations.java | 178 - .../models/ResourceHealthDetails.java | 167 - .../models/ResourceHealthStatus.java | 71 - .../models/ResourceList.java | 88 - .../models/ResourceProviders.java | 128 - .../models/RestoreFileSpecs.java | 141 - .../models/RestorePointType.java | 76 - .../models/RestoreRequest.java | 163 - .../models/RestoreRequestResource.java | 240 - .../models/RestoreRequestType.java | 56 - .../models/Restores.java | 51 - .../models/RetentionDuration.java | 118 - .../models/RetentionDurationType.java | 66 - .../models/RetentionPolicy.java | 103 - .../models/RetentionScheduleFormat.java | 56 - .../models/SchedulePolicy.java | 107 - .../models/ScheduleRunType.java | 61 - .../models/SecuredVMDetails.java | 85 - .../models/SecurityPINs.java | 40 - .../models/SecurityPinBase.java | 88 - .../models/Settings.java | 144 - .../models/SimpleRetentionPolicy.java | 104 - .../models/SimpleSchedulePolicy.java | 228 - .../models/SimpleSchedulePolicyV2.java | 190 - .../SnapshotBackupAdditionalDetails.java | 145 - .../models/SnapshotRestoreParameters.java | 114 - .../models/SoftDeleteFeatureState.java | 61 - .../models/SourceSideScanInfo.java | 117 - .../models/SourceSideScanStatus.java | 56 - .../models/SourceSideScanSummary.java | 61 - .../models/SqlDataDirectory.java | 108 - .../models/SqlDataDirectoryMapping.java | 170 - .../models/SqlDataDirectoryType.java | 56 - .../models/StorageType.java | 66 - .../models/StorageTypeState.java | 56 - .../models/SubProtectionPolicy.java | 208 - .../models/SupportStatus.java | 66 - .../models/TargetAfsRestoreInfo.java | 113 - .../models/TargetDiskNetworkAccessOption.java | 61 - .../TargetDiskNetworkAccessSettings.java | 120 - .../models/TargetRestoreInfo.java | 170 - .../models/ThreatInfo.java | 193 - .../models/ThreatSeverity.java | 61 - .../models/ThreatState.java | 61 - .../models/ThreatStatus.java | 66 - .../models/TieringCostInfo.java | 27 - .../models/TieringCostOperationStatus.java | 41 - .../models/TieringCostRehydrationInfo.java | 113 - .../models/TieringCostSavingInfo.java | 148 - .../models/TieringMode.java | 64 - .../models/TieringPolicy.java | 158 - .../models/TokenInformation.java | 40 - .../models/TriggerDataMoveRequest.java | 229 - .../models/UnlockDeleteRequest.java | 116 - .../models/UnlockDeleteResponse.java | 26 - .../models/UpdateRecoveryPointRequest.java | 85 - .../models/UsagesUnit.java | 71 - .../UserAssignedIdentityProperties.java | 114 - .../UserAssignedManagedIdentityDetails.java | 144 - .../models/VMWorkloadPolicyType.java | 61 - ...ValidateIaasVMRestoreOperationRequest.java | 90 - .../models/ValidateOperationRequest.java | 103 - .../ValidateOperationRequestResource.java | 115 - .../models/ValidateOperationResponse.java | 77 - .../models/ValidateOperationResults.java | 41 - .../models/ValidateOperationStatuses.java | 45 - .../models/ValidateOperations.java | 40 - .../models/ValidateOperationsResponse.java | 27 - .../ValidateRestoreOperationRequest.java | 130 - .../models/ValidationStatus.java | 56 - .../models/VaultJob.java | 180 - .../models/VaultJobErrorInfo.java | 111 - .../models/VaultJobExtendedInfo.java | 76 - .../models/VaultRetentionPolicy.java | 114 - ...tStorageConfigOperationResultResponse.java | 29 - .../models/VaultSubResourceType.java | 56 - .../models/WeekOfMonth.java | 76 - .../models/WeeklyRetentionFormat.java | 120 - .../models/WeeklyRetentionSchedule.java | 151 - .../models/WeeklySchedule.java | 123 - .../models/WorkloadInquiryDetails.java | 141 - .../models/WorkloadItem.java | 224 - .../models/WorkloadItemResource.java | 77 - .../models/WorkloadItemType.java | 81 - .../models/WorkloadProtectableItem.java | 241 - .../WorkloadProtectableItemResource.java | 78 - .../models/WorkloadType.java | 121 - .../models/XcoolState.java | 56 - .../models/YearlyRetentionSchedule.java | 239 - .../models/package-info.java | 9 - .../recoveryservicesbackup/package-info.java | 9 - .../src/main/java/module-info.java | 16 - .../proxy-config.json | 1 - .../reflect-config.json | 1 - ...emanager-recoveryservicesbackup.properties | 1 - .../KnowledgeBaseRetrievalServiceVersion.java | 50 + .../documents/SearchIndexServiceVersion.java | 50 + .../SearchIndexerServiceVersion.java | 50 + .../KnowledgeBaseRetrievalClientImpl.java | 12 +- .../implementation/SearchIndexClientImpl.java | 12 +- .../SearchIndexerClientImpl.java | 13 +- .../indexes/SearchIndexClientBuilder.java | 32 +- .../indexes/SearchIndexerClientBuilder.java | 32 +- .../KnowledgeBaseRetrievalClientBuilder.java | 32 +- .../security/SecurityManager.java | 1474 ------ .../AdvancedThreatProtectionsClient.java | 70 - .../security/fluent/AlertsClient.java | 484 -- .../fluent/AlertsSuppressionRulesClient.java | 119 - .../fluent/AllowedConnectionsClient.java | 107 - .../security/fluent/ApiCollectionsClient.java | 291 -- .../security/fluent/ApplicationsClient.java | 118 - .../security/fluent/AssessmentsClient.java | 136 - .../fluent/AssessmentsMetadatasClient.java | 169 - .../security/fluent/AssignmentsClient.java | 152 - .../AutoProvisioningSettingsClient.java | 92 - .../security/fluent/AutomationsClient.java | 219 - .../fluent/AzureDevOpsOrgsClient.java | 237 - .../fluent/AzureDevOpsProjectsClient.java | 225 - .../fluent/AzureDevOpsReposClient.java | 239 - .../fluent/ComplianceResultsClient.java | 69 - .../security/fluent/CompliancesClient.java | 69 - .../fluent/CustomRecommendationsClient.java | 129 - .../fluent/DefenderForStoragesClient.java | 193 - .../fluent/DevOpsConfigurationsClient.java | 253 - .../fluent/DevOpsOperationResultsClient.java | 46 - .../fluent/DeviceSecurityGroupsClient.java | 133 - .../DiscoveredSecuritySolutionsClient.java | 103 - .../ExternalSecuritySolutionsClient.java | 103 - .../security/fluent/GitHubIssuesClient.java | 82 - .../security/fluent/GitHubOwnersClient.java | 103 - .../security/fluent/GitHubReposClient.java | 80 - .../security/fluent/GitLabGroupsClient.java | 103 - .../security/fluent/GitLabProjectsClient.java | 82 - .../fluent/GitLabSubgroupsClient.java | 46 - .../fluent/GovernanceAssignmentsClient.java | 137 - .../fluent/GovernanceRulesClient.java | 241 - .../security/fluent/HealthReportsClient.java | 73 - .../InformationProtectionPoliciesClient.java | 104 - .../IotSecuritySolutionAnalyticsClient.java | 73 - ...utionsAnalyticsAggregatedAlertsClient.java | 108 - ...lutionsAnalyticsRecommendationsClient.java | 82 - .../fluent/IotSecuritySolutionsClient.java | 186 - .../JitNetworkAccessPoliciesClient.java | 259 -- .../security/fluent/LocationsClient.java | 70 - .../security/fluent/MdeOnboardingsClient.java | 62 - .../fluent/OperationResultsClient.java | 41 - .../fluent/OperationStatusesClient.java | 43 - .../security/fluent/OperationsClient.java | 40 - .../security/fluent/PricingsClient.java | 145 - .../PrivateEndpointConnectionsClient.java | 240 - .../fluent/PrivateLinkResourcesClient.java | 81 - .../security/fluent/PrivateLinksClient.java | 309 -- ...RegulatoryComplianceAssessmentsClient.java | 78 - .../RegulatoryComplianceControlsClient.java | 73 - .../RegulatoryComplianceStandardsClient.java | 66 - .../SecureScoreControlDefinitionsClient.java | 60 - .../fluent/SecureScoreControlsClient.java | 71 - .../security/fluent/SecureScoresClient.java | 69 - .../security/fluent/SecurityCenter.java | 559 --- .../SecurityConnectorApplicationsClient.java | 138 - .../fluent/SecurityConnectorsClient.java | 186 - .../fluent/SecurityContactsClient.java | 118 - .../fluent/SecurityOperatorsClient.java | 123 - .../fluent/SecuritySolutionsClient.java | 71 - ...SecuritySolutionsReferenceDatasClient.java | 65 - .../fluent/SecurityStandardsClient.java | 125 - .../fluent/SensitivitySettingsClient.java | 88 - .../ServerVulnerabilityAssessmentsClient.java | 184 - ...ulnerabilityAssessmentsSettingsClient.java | 124 - .../security/fluent/SettingsClient.java | 92 - ...rabilityAssessmentBaselineRulesClient.java | 175 - ...nerabilityAssessmentScanResultsClient.java | 83 - ...SqlVulnerabilityAssessmentScansClient.java | 168 - ...ityAssessmentSettingsOperationsClient.java | 93 - .../fluent/StandardAssignmentsClient.java | 149 - .../security/fluent/StandardsClient.java | 152 - .../security/fluent/SubAssessmentsClient.java | 103 - .../security/fluent/TasksClient.java | 228 - .../security/fluent/TopologiesClient.java | 102 - .../fluent/WorkspaceSettingsClient.java | 148 - .../AdvancedThreatProtectionProperties.java | 95 - .../AdvancedThreatProtectionSettingInner.java | 179 - .../security/fluent/models/AlertInner.java | 417 -- .../fluent/models/AlertProperties.java | 549 --- .../models/AlertSyncSettingProperties.java | 94 - .../models/AlertsSuppressionRuleInner.java | 307 -- .../AlertsSuppressionRuleProperties.java | 285 -- .../AllowedConnectionsResourceInner.java | 192 - .../AllowedConnectionsResourceProperties.java | 109 - .../fluent/models/ApiCollectionInner.java | 253 - .../models/ApiCollectionProperties.java | 238 - .../fluent/models/ApplicationInner.java | 248 - .../fluent/models/ApplicationProperties.java | 197 - .../fluent/models/AscLocationInner.java | 153 - .../fluent/models/AssignmentInner.java | 487 -- .../fluent/models/AssignmentProperties.java | 346 -- .../models/AutoProvisioningSettingInner.java | 179 - .../AutoProvisioningSettingProperties.java | 105 - .../fluent/models/AutomationInner.java | 395 -- .../fluent/models/AutomationProperties.java | 232 - .../AutomationValidationStatusInner.java | 100 - .../fluent/models/AzureDevOpsOrgInner.java | 166 - .../AzureDevOpsOrgListResponseInner.java | 106 - .../models/AzureDevOpsProjectInner.java | 166 - .../models/AzureDevOpsRepositoryInner.java | 167 - .../fluent/models/ComplianceInner.java | 185 - .../fluent/models/ComplianceProperties.java | 127 - .../fluent/models/ComplianceResultInner.java | 164 - .../models/ComplianceResultProperties.java | 83 - .../models/CustomRecommendationInner.java | 332 -- .../CustomRecommendationProperties.java | 289 -- .../models/DataExportSettingProperties.java | 94 - .../DefenderForStorageSettingInner.java | 168 - .../models/DevOpsConfigurationInner.java | 166 - .../models/DeviceSecurityGroupInner.java | 252 - .../models/DeviceSecurityGroupProperties.java | 206 - .../DiscoveredSecuritySolutionInner.java | 216 - .../DiscoveredSecuritySolutionProperties.java | 162 - .../models/ExternalSecuritySolutionInner.java | 255 - ...tSensitivitySettingsListResponseInner.java | 90 - .../GetSensitivitySettingsResponseInner.java | 157 - .../fluent/models/GitHubOwnerInner.java | 155 - .../models/GitHubOwnerListResponseInner.java | 104 - .../fluent/models/GitHubRepositoryInner.java | 155 - .../fluent/models/GitLabGroupInner.java | 155 - .../models/GitLabGroupListResponseInner.java | 104 - .../fluent/models/GitLabProjectInner.java | 155 - .../models/GovernanceAssignmentInner.java | 304 -- .../GovernanceAssignmentProperties.java | 273 -- .../fluent/models/GovernanceRuleInner.java | 502 -- .../models/GovernanceRuleProperties.java | 538 --- .../fluent/models/HealthReportInner.java | 234 - .../fluent/models/HealthReportProperties.java | 231 - .../InformationProtectionPolicyInner.java | 224 - ...InformationProtectionPolicyProperties.java | 180 - .../IoTSecurityAggregatedAlertInner.java | 297 -- .../IoTSecurityAggregatedAlertProperties.java | 287 -- ...SecurityAggregatedRecommendationInner.java | 266 -- ...ityAggregatedRecommendationProperties.java | 233 - ...oTSecuritySolutionAnalyticsModelInner.java | 216 - ...curitySolutionAnalyticsModelListInner.java | 115 - ...uritySolutionAnalyticsModelProperties.java | 203 - .../models/IoTSecuritySolutionModelInner.java | 464 -- .../models/IoTSecuritySolutionProperties.java | 414 -- .../models/JitNetworkAccessPolicyInner.java | 263 -- .../JitNetworkAccessPolicyProperties.java | 160 - .../models/JitNetworkAccessRequestInner.java | 209 - .../fluent/models/MalwareScanInner.java | 86 - .../fluent/models/MdeOnboardingDataInner.java | 177 - .../models/MdeOnboardingDataListInner.java | 88 - .../models/MdeOnboardingDataProperties.java | 104 - .../fluent/models/OperationInner.java | 161 - .../fluent/models/OperationResultInner.java | 82 - .../models/OperationStatusResultInner.java | 241 - .../security/fluent/models/PricingInner.java | 347 -- .../fluent/models/PricingListInner.java | 94 - .../fluent/models/PricingProperties.java | 357 -- .../PrivateEndpointConnectionInner.java | 227 - .../PrivateEndpointConnectionProperties.java | 179 - .../models/PrivateLinkGroupResourceInner.java | 184 - .../fluent/models/PrivateLinkProperties.java | 166 - .../models/PrivateLinkResourceInner.java | 247 - .../models/PrivateLinkResourceProperties.java | 119 - .../RegulatoryComplianceAssessmentInner.java | 230 - ...ulatoryComplianceAssessmentProperties.java | 202 - .../RegulatoryComplianceControlInner.java | 205 - ...RegulatoryComplianceControlProperties.java | 155 - .../RegulatoryComplianceStandardInner.java | 206 - ...egulatoryComplianceStandardProperties.java | 157 - .../fluent/models/RuleResultsInner.java | 155 - .../fluent/models/RulesResultsInner.java | 104 - .../fluent/models/ScanResultInner.java | 155 - .../security/fluent/models/ScanV2Inner.java | 155 - .../security/fluent/models/ScoreDetails.java | 114 - ...SecureScoreControlDefinitionItemInner.java | 205 - ...eScoreControlDefinitionItemProperties.java | 162 - .../SecureScoreControlDetailsInner.java | 239 - .../SecureScoreControlScoreDetailsInner.java | 221 - .../fluent/models/SecureScoreItemInner.java | 200 - .../models/SecureScoreItemProperties.java | 146 - ...yAssessmentMetadataPropertiesResponse.java | 388 -- ...curityAssessmentMetadataResponseInner.java | 527 --- .../models/SecurityAssessmentProperties.java | 229 - .../SecurityAssessmentPropertiesResponse.java | 175 - .../SecurityAssessmentResponseInner.java | 235 - .../fluent/models/SecurityConnectorInner.java | 377 -- .../models/SecurityConnectorProperties.java | 213 - .../fluent/models/SecurityContactInner.java | 277 -- .../models/SecurityContactProperties.java | 225 - .../fluent/models/SecurityOperatorInner.java | 155 - .../fluent/models/SecuritySolutionInner.java | 208 - .../models/SecuritySolutionProperties.java | 163 - ...curitySolutionsReferenceDataListInner.java | 91 - ...uritySolutionsReferenceDataProperties.java | 228 - .../fluent/models/SecurityStandardInner.java | 306 -- .../models/SecurityStandardProperties.java | 265 -- .../models/SecuritySubAssessmentInner.java | 249 - .../SecuritySubAssessmentProperties.java | 244 - .../fluent/models/SecurityTaskInner.java | 202 - .../fluent/models/SecurityTaskProperties.java | 155 - .../ServerVulnerabilityAssessmentInner.java | 166 - ...rverVulnerabilityAssessmentProperties.java | 85 - ...lityAssessmentsAzureSettingProperties.java | 112 - ...rverVulnerabilityAssessmentsListInner.java | 90 - ...rVulnerabilityAssessmentsSettingInner.java | 227 - .../security/fluent/models/SettingInner.java | 224 - ...ityAssessmentScanOperationResultInner.java | 159 - ...lVulnerabilityAssessmentSettingsInner.java | 169 - .../models/StandardAssignmentInner.java | 370 -- .../models/StandardAssignmentProperties.java | 347 -- .../security/fluent/models/StandardInner.java | 397 -- .../fluent/models/StandardProperties.java | 235 - .../fluent/models/TopologyResourceInner.java | 190 - .../models/TopologyResourceProperties.java | 107 - .../UpdateIoTSecuritySolutionProperties.java | 139 - .../fluent/models/WorkspaceSettingInner.java | 202 - .../models/WorkspaceSettingProperties.java | 138 - .../security/fluent/models/package-info.java | 9 - .../security/fluent/package-info.java | 9 - .../AdvancedThreatProtectionSettingImpl.java | 100 - .../AdvancedThreatProtectionsClientImpl.java | 306 -- .../AdvancedThreatProtectionsImpl.java | 76 - .../security/implementation/AlertImpl.java | 197 - .../implementation/AlertsClientImpl.java | 2443 ---------- .../security/implementation/AlertsImpl.java | 200 - .../AlertsSuppressionRuleImpl.java | 76 - .../AlertsSuppressionRulesClientImpl.java | 637 --- .../AlertsSuppressionRulesImpl.java | 90 - .../AllowedConnectionsClientImpl.java | 615 --- .../AllowedConnectionsImpl.java | 81 - .../AllowedConnectionsResourceImpl.java | 66 - .../implementation/ApiCollectionImpl.java | 86 - .../ApiCollectionsClientImpl.java | 1428 ------ .../implementation/ApiCollectionsImpl.java | 119 - .../implementation/ApplicationImpl.java | 146 - .../ApplicationsClientImpl.java | 605 --- .../implementation/ApplicationsImpl.java | 110 - .../implementation/AscLocationImpl.java | 48 - .../implementation/AssessmentsClientImpl.java | 646 --- .../implementation/AssessmentsImpl.java | 144 - .../AssessmentsMetadatasClientImpl.java | 917 ---- .../AssessmentsMetadatasImpl.java | 143 - .../implementation/AssignmentImpl.java | 260 -- .../implementation/AssignmentsClientImpl.java | 860 ---- .../implementation/AssignmentsImpl.java | 143 - .../AutoProvisioningSettingImpl.java | 96 - .../AutoProvisioningSettingsClientImpl.java | 489 -- .../AutoProvisioningSettingsImpl.java | 84 - .../implementation/AutomationImpl.java | 288 -- .../AutomationValidationStatusImpl.java | 36 - .../implementation/AutomationsClientImpl.java | 1176 ----- .../implementation/AutomationsImpl.java | 164 - .../implementation/AzureDevOpsOrgImpl.java | 129 - .../AzureDevOpsOrgListResponseImpl.java | 48 - .../AzureDevOpsOrgsClientImpl.java | 1108 ----- .../implementation/AzureDevOpsOrgsImpl.java | 127 - .../AzureDevOpsProjectImpl.java | 136 - .../AzureDevOpsProjectsClientImpl.java | 1058 ----- .../AzureDevOpsProjectsImpl.java | 123 - .../AzureDevOpsReposClientImpl.java | 1125 ----- .../implementation/AzureDevOpsReposImpl.java | 134 - .../AzureDevOpsRepositoryImpl.java | 143 - .../implementation/ComplianceImpl.java | 65 - .../implementation/ComplianceResultImpl.java | 50 - .../ComplianceResultsClientImpl.java | 367 -- .../implementation/ComplianceResultsImpl.java | 63 - .../implementation/CompliancesClientImpl.java | 361 -- .../implementation/CompliancesImpl.java | 62 - .../CustomRecommendationImpl.java | 196 - .../CustomRecommendationsClientImpl.java | 633 --- .../CustomRecommendationsImpl.java | 145 - .../DefenderForStorageSettingImpl.java | 115 - .../DefenderForStoragesClientImpl.java | 911 ---- .../DefenderForStoragesImpl.java | 156 - .../DevOpsConfigurationImpl.java | 50 - .../DevOpsConfigurationsClientImpl.java | 1151 ----- .../DevOpsConfigurationsImpl.java | 119 - .../DevOpsOperationResultsClientImpl.java | 210 - .../DevOpsOperationResultsImpl.java | 54 - .../DeviceSecurityGroupImpl.java | 181 - .../DeviceSecurityGroupsClientImpl.java | 643 --- .../DeviceSecurityGroupsImpl.java | 145 - .../DiscoveredSecuritySolutionImpl.java | 66 - ...DiscoveredSecuritySolutionsClientImpl.java | 609 --- .../DiscoveredSecuritySolutionsImpl.java | 81 - .../ExternalSecuritySolutionImpl.java | 58 - .../ExternalSecuritySolutionsClientImpl.java | 607 --- .../ExternalSecuritySolutionsImpl.java | 77 - ...etSensitivitySettingsListResponseImpl.java | 44 - .../GetSensitivitySettingsResponseImpl.java | 50 - .../GitHubIssuesClientImpl.java | 384 -- .../implementation/GitHubIssuesImpl.java | 43 - .../implementation/GitHubOwnerImpl.java | 49 - .../GitHubOwnerListResponseImpl.java | 47 - .../GitHubOwnersClientImpl.java | 566 --- .../implementation/GitHubOwnersImpl.java | 85 - .../implementation/GitHubReposClientImpl.java | 457 -- .../implementation/GitHubReposImpl.java | 70 - .../implementation/GitHubRepositoryImpl.java | 50 - .../implementation/GitLabGroupImpl.java | 49 - .../GitLabGroupListResponseImpl.java | 47 - .../GitLabGroupsClientImpl.java | 567 --- .../implementation/GitLabGroupsImpl.java | 85 - .../implementation/GitLabProjectImpl.java | 50 - .../GitLabProjectsClientImpl.java | 465 -- .../implementation/GitLabProjectsImpl.java | 70 - .../GitLabSubgroupsClientImpl.java | 208 - .../implementation/GitLabSubgroupsImpl.java | 54 - .../GovernanceAssignmentImpl.java | 185 - .../GovernanceAssignmentsClientImpl.java | 683 --- .../GovernanceAssignmentsImpl.java | 177 - .../implementation/GovernanceRuleImpl.java | 272 -- .../GovernanceRulesClientImpl.java | 1091 ----- .../implementation/GovernanceRulesImpl.java | 172 - .../implementation/HealthReportImpl.java | 104 - .../HealthReportsClientImpl.java | 378 -- .../implementation/HealthReportsImpl.java | 62 - ...formationProtectionPoliciesClientImpl.java | 526 --- .../InformationProtectionPoliciesImpl.java | 112 - .../InformationProtectionPolicyImpl.java | 164 - .../IoTSecurityAggregatedAlertImpl.java | 117 - ...TSecurityAggregatedRecommendationImpl.java | 97 - ...IoTSecuritySolutionAnalyticsModelImpl.java | 96 - ...ecuritySolutionAnalyticsModelListImpl.java | 48 - .../IoTSecuritySolutionModelImpl.java | 316 -- ...otSecuritySolutionAnalyticsClientImpl.java | 321 -- .../IotSecuritySolutionAnalyticsImpl.java | 72 - ...nsAnalyticsAggregatedAlertsClientImpl.java | 599 --- ...olutionsAnalyticsAggregatedAlertsImpl.java | 82 - ...onsAnalyticsRecommendationsClientImpl.java | 464 -- ...SolutionsAnalyticsRecommendationsImpl.java | 73 - .../IotSecuritySolutionsClientImpl.java | 1064 ----- .../IotSecuritySolutionsImpl.java | 146 - .../JitNetworkAccessPoliciesClientImpl.java | 1517 ------ .../JitNetworkAccessPoliciesImpl.java | 213 - .../JitNetworkAccessPolicyImpl.java | 191 - .../JitNetworkAccessRequestImpl.java | 53 - .../implementation/LocationsClientImpl.java | 372 -- .../implementation/LocationsImpl.java | 62 - .../implementation/MalwareScanImpl.java | 32 - .../implementation/MdeOnboardingDataImpl.java | 53 - .../MdeOnboardingDataListImpl.java | 44 - .../MdeOnboardingsClientImpl.java | 259 -- .../implementation/MdeOnboardingsImpl.java | 68 - .../implementation/OperationImpl.java | 50 - .../implementation/OperationResultImpl.java | 33 - .../OperationResultsClientImpl.java | 178 - .../implementation/OperationResultsImpl.java | 41 - .../OperationStatusResultImpl.java | 76 - .../OperationStatusesClientImpl.java | 186 - .../implementation/OperationStatusesImpl.java | 52 - .../implementation/OperationsClientImpl.java | 235 - .../implementation/OperationsImpl.java | 45 - .../security/implementation/PricingImpl.java | 107 - .../implementation/PricingListImpl.java | 42 - .../implementation/PricingsClientImpl.java | 578 --- .../security/implementation/PricingsImpl.java | 91 - .../PrivateEndpointConnectionImpl.java | 162 - .../PrivateEndpointConnectionsClientImpl.java | 1061 ----- .../PrivateEndpointConnectionsImpl.java | 163 - .../PrivateLinkGroupResourceImpl.java | 69 - .../PrivateLinkResourceImpl.java | 213 - .../PrivateLinkResourcesClientImpl.java | 444 -- .../PrivateLinkResourcesImpl.java | 67 - .../PrivateLinksClientImpl.java | 1440 ------ .../implementation/PrivateLinksImpl.java | 151 - .../RegulatoryComplianceAssessmentImpl.java | 78 - ...latoryComplianceAssessmentsClientImpl.java | 471 -- .../RegulatoryComplianceAssessmentsImpl.java | 73 - .../RegulatoryComplianceControlImpl.java | 66 - ...egulatoryComplianceControlsClientImpl.java | 429 -- .../RegulatoryComplianceControlsImpl.java | 71 - .../RegulatoryComplianceStandardImpl.java | 66 - ...gulatoryComplianceStandardsClientImpl.java | 385 -- .../RegulatoryComplianceStandardsImpl.java | 66 - .../implementation/ResourceManagerUtils.java | 195 - .../implementation/RuleResultsImpl.java | 172 - .../implementation/RulesResultsImpl.java | 46 - .../implementation/ScanResultImpl.java | 49 - .../security/implementation/ScanV2Impl.java | 49 - .../SecureScoreControlDefinitionItemImpl.java | 74 - ...cureScoreControlDefinitionsClientImpl.java | 418 -- .../SecureScoreControlDefinitionsImpl.java | 59 - .../SecureScoreControlDetailsImpl.java | 88 - .../SecureScoreControlScoreDetailsImpl.java | 71 - .../SecureScoreControlsClientImpl.java | 507 -- .../SecureScoreControlsImpl.java | 58 - .../implementation/SecureScoreItemImpl.java | 65 - .../SecureScoresClientImpl.java | 366 -- .../implementation/SecureScoresImpl.java | 62 - ...ecurityAssessmentMetadataResponseImpl.java | 260 -- .../SecurityAssessmentResponseImpl.java | 237 - .../implementation/SecurityCenterBuilder.java | 138 - .../implementation/SecurityCenterImpl.java | 1444 ------ ...curityConnectorApplicationsClientImpl.java | 743 --- .../SecurityConnectorApplicationsImpl.java | 94 - .../implementation/SecurityConnectorImpl.java | 227 - .../SecurityConnectorsClientImpl.java | 1034 ----- .../SecurityConnectorsImpl.java | 145 - .../implementation/SecurityContactImpl.java | 142 - .../SecurityContactsClientImpl.java | 615 --- .../implementation/SecurityContactsImpl.java | 115 - .../implementation/SecurityOperatorImpl.java | 50 - .../SecurityOperatorsClientImpl.java | 585 --- .../implementation/SecurityOperatorsImpl.java | 90 - .../implementation/SecuritySolutionImpl.java | 67 - .../SecuritySolutionsClientImpl.java | 391 -- .../implementation/SecuritySolutionsImpl.java | 64 - ...ecuritySolutionsReferenceDataListImpl.java | 40 - ...ritySolutionsReferenceDatasClientImpl.java | 280 -- .../SecuritySolutionsReferenceDatasImpl.java | 68 - .../implementation/SecurityStandardImpl.java | 192 - .../SecurityStandardsClientImpl.java | 614 --- .../implementation/SecurityStandardsImpl.java | 138 - .../SecuritySubAssessmentImpl.java | 89 - .../implementation/SecurityTaskImpl.java | 66 - .../SensitivitySettingsClientImpl.java | 354 -- .../SensitivitySettingsImpl.java | 86 - .../ServerVulnerabilityAssessmentImpl.java | 50 - ...verVulnerabilityAssessmentsClientImpl.java | 826 ---- .../ServerVulnerabilityAssessmentsImpl.java | 105 - ...erverVulnerabilityAssessmentsListImpl.java | 44 - ...erVulnerabilityAssessmentsSettingImpl.java | 55 - ...rabilityAssessmentsSettingsClientImpl.java | 638 --- ...rVulnerabilityAssessmentsSettingsImpl.java | 97 - .../security/implementation/SettingImpl.java | 54 - .../implementation/SettingsClientImpl.java | 480 -- .../security/implementation/SettingsImpl.java | 77 - ...lityAssessmentBaselineRulesClientImpl.java | 835 ---- ...nerabilityAssessmentBaselineRulesImpl.java | 170 - ...lityAssessmentScanOperationResultImpl.java | 51 - ...bilityAssessmentScanResultsClientImpl.java | 433 -- ...ulnerabilityAssessmentScanResultsImpl.java | 64 - ...ulnerabilityAssessmentScansClientImpl.java | 805 ---- .../SqlVulnerabilityAssessmentScansImpl.java | 102 - ...qlVulnerabilityAssessmentSettingsImpl.java | 50 - ...ssessmentSettingsOperationsClientImpl.java | 386 -- ...ilityAssessmentSettingsOperationsImpl.java | 79 - .../StandardAssignmentImpl.java | 187 - .../StandardAssignmentsClientImpl.java | 685 --- .../StandardAssignmentsImpl.java | 145 - .../security/implementation/StandardImpl.java | 237 - .../implementation/StandardsClientImpl.java | 857 ---- .../implementation/StandardsImpl.java | 143 - .../SubAssessmentsClientImpl.java | 593 --- .../implementation/SubAssessmentsImpl.java | 74 - .../implementation/TasksClientImpl.java | 1334 ------ .../security/implementation/TasksImpl.java | 129 - .../implementation/TopologiesClientImpl.java | 604 --- .../implementation/TopologiesImpl.java | 74 - .../implementation/TopologyResourceImpl.java | 66 - .../implementation/WorkspaceSettingImpl.java | 126 - .../WorkspaceSettingsClientImpl.java | 766 --- .../implementation/WorkspaceSettingsImpl.java | 110 - .../implementation/models/AlertList.java | 105 - .../models/AlertsSuppressionRulesList.java | 114 - .../models/AllowedConnectionsList.java | 104 - .../models/ApiCollectionList.java | 103 - .../models/ApplicationsList.java | 103 - .../models/AscLocationList.java | 103 - .../implementation/models/AssignmentList.java | 103 - .../models/AutoProvisioningSettingList.java | 105 - .../implementation/models/AutomationList.java | 112 - .../AzureDevOpsProjectListResponse.java | 107 - .../AzureDevOpsRepositoryListResponse.java | 107 - .../implementation/models/ComplianceList.java | 103 - .../models/ComplianceResultList.java | 113 - .../models/CustomRecommendationsList.java | 106 - .../models/DefenderForStorageSettingList.java | 106 - .../DevOpsConfigurationListResponse.java | 107 - .../models/DeviceSecurityGroupList.java | 105 - .../DiscoveredSecuritySolutionList.java | 106 - .../models/ExternalSecuritySolutionList.java | 105 - .../models/GitHubRepositoryListResponse.java | 106 - .../models/GitLabProjectListResponse.java | 105 - .../models/GovernanceAssignmentsList.java | 105 - .../models/GovernanceRuleList.java | 105 - .../models/HealthReportsList.java | 104 - .../InformationProtectionPolicyList.java | 106 - .../IoTSecurityAggregatedAlertList.java | 115 - ...TSecurityAggregatedRecommendationList.java | 116 - .../models/IoTSecuritySolutionsList.java | 113 - .../models/JitNetworkAccessPoliciesList.java | 105 - .../models/OperationListResult.java | 113 - .../PrivateEndpointConnectionListResult.java | 116 - .../PrivateLinkGroupResourceListResult.java | 115 - .../models/PrivateLinksList.java | 106 - .../RegulatoryComplianceAssessmentList.java | 115 - .../RegulatoryComplianceControlList.java | 115 - .../RegulatoryComplianceStandardList.java | 115 - .../implementation/models/ScanResults.java | 105 - .../implementation/models/ScansV2.java | 105 - .../SecureScoreControlDefinitionList.java | 106 - .../models/SecureScoreControlList.java | 105 - .../models/SecureScoresList.java | 105 - .../models/SecurityAssessmentList.java | 105 - ...ecurityAssessmentMetadataResponseList.java | 107 - .../models/SecurityConnectorsList.java | 113 - .../models/SecurityContactList.java | 113 - .../models/SecurityOperatorList.java | 96 - .../models/SecuritySolutionList.java | 105 - .../models/SecurityStandardList.java | 105 - .../models/SecuritySubAssessmentList.java | 104 - .../models/SecurityTaskList.java | 103 - ...rVulnerabilityAssessmentsSettingsList.java | 107 - .../implementation/models/SettingsList.java | 105 - .../models/StandardAssignmentsList.java | 105 - .../implementation/models/StandardList.java | 103 - .../implementation/models/TopologyList.java | 104 - .../models/WorkspaceSettingList.java | 113 - .../security/implementation/package-info.java | 9 - .../security/models/AadConnectivityState.java | 56 - .../models/AadExternalSecuritySolution.java | 193 - .../models/AadSolutionProperties.java | 169 - .../models/AccessTokenAuthentication.java | 143 - .../security/models/ActionType.java | 61 - .../models/ActionableRemediation.java | 207 - .../models/ActionableRemediationState.java | 59 - .../security/models/AdditionalData.java | 113 - .../models/AdditionalWorkspaceDataType.java | 51 - .../models/AdditionalWorkspaceType.java | 46 - .../AdditionalWorkspacesProperties.java | 155 - .../AdvancedThreatProtectionSetting.java | 135 - .../models/AdvancedThreatProtections.java | 66 - .../models/AgentlessConfiguration.java | 220 - .../security/models/AgentlessEnablement.java | 56 - .../security/models/Alert.java | 251 - .../security/models/AlertEntity.java | 108 - .../AlertPropertiesSupportingEvidence.java | 109 - .../security/models/AlertSeverity.java | 62 - ...lertSimulatorBundlesRequestProperties.java | 128 - .../models/AlertSimulatorRequestBody.java | 96 - .../AlertSimulatorRequestProperties.java | 146 - .../security/models/AlertStatus.java | 61 - .../security/models/AlertSyncSettings.java | 210 - .../security/models/Alerts.java | 416 -- .../models/AlertsSuppressionRule.java | 99 - .../models/AlertsSuppressionRules.java | 108 - .../security/models/AllowedConnections.java | 97 - .../models/AllowedConnectionsResource.java | 71 - .../models/AllowlistCustomAlertRule.java | 141 - .../models/AnnotateDefaultBranchState.java | 54 - .../security/models/ApiCollection.java | 124 - .../security/models/ApiCollections.java | 233 - .../security/models/Application.java | 269 -- .../models/ApplicationSourceResourceType.java | 46 - .../security/models/Applications.java | 134 - .../security/models/ArcAutoProvisioning.java | 124 - .../models/ArcAutoProvisioningAws.java | 121 - .../ArcAutoProvisioningConfiguration.java | 122 - .../models/ArcAutoProvisioningGcp.java | 93 - .../security/models/ArmActionType.java | 46 - .../security/models/AscLocation.java | 55 - .../security/models/AssessedResourceType.java | 63 - .../security/models/AssessmentLinks.java | 81 - .../security/models/AssessmentStatus.java | 157 - .../security/models/AssessmentStatusCode.java | 56 - .../models/AssessmentStatusResponse.java | 120 - .../security/models/AssessmentType.java | 97 - .../security/models/Assessments.java | 148 - .../security/models/AssessmentsMetadatas.java | 182 - .../models/AssignedAssessmentItem.java | 93 - .../models/AssignedComponentItem.java | 93 - .../security/models/AssignedStandardItem.java | 93 - .../security/models/Assignment.java | 625 --- .../AssignmentPropertiesAdditionalData.java | 94 - .../security/models/Assignments.java | 163 - .../models/AtaExternalSecuritySolution.java | 193 - .../models/AtaSolutionProperties.java | 167 - .../models/AttestationComplianceState.java | 56 - .../security/models/AttestationEvidence.java | 121 - .../security/models/Authentication.java | 108 - .../security/models/AuthenticationType.java | 46 - .../security/models/Authorization.java | 99 - .../security/models/AutoDiscovery.java | 56 - .../security/models/AutoProvision.java | 51 - .../models/AutoProvisioningSetting.java | 122 - .../models/AutoProvisioningSettings.java | 88 - .../models/AutomatedResponseType.java | 51 - .../security/models/Automation.java | 489 -- .../security/models/AutomationAction.java | 111 - .../models/AutomationActionEventHub.java | 187 - .../models/AutomationActionLogicApp.java | 143 - .../models/AutomationActionWorkspace.java | 115 - .../security/models/AutomationRuleSet.java | 100 - .../security/models/AutomationScope.java | 124 - .../security/models/AutomationSource.java | 131 - .../models/AutomationTriggeringRule.java | 182 - .../models/AutomationUpdateModel.java | 224 - .../models/AutomationValidationStatus.java | 33 - .../security/models/Automations.java | 195 - .../security/models/AwsEnvironmentData.java | 189 - .../models/AwsOrganizationalData.java | 112 - .../models/AwsOrganizationalDataMaster.java | 148 - .../models/AwsOrganizationalDataMember.java | 115 - .../security/models/AzureDevOpsOrg.java | 189 - .../models/AzureDevOpsOrgListResponse.java | 34 - .../models/AzureDevOpsOrgProperties.java | 212 - .../security/models/AzureDevOpsOrgs.java | 124 - .../security/models/AzureDevOpsProject.java | 191 - .../models/AzureDevOpsProjectProperties.java | 257 -- .../security/models/AzureDevOpsProjects.java | 103 - .../security/models/AzureDevOpsRepos.java | 109 - .../models/AzureDevOpsRepository.java | 192 - .../AzureDevOpsRepositoryProperties.java | 319 -- .../AzureDevOpsScopeEnvironmentData.java | 86 - .../security/models/AzureResourceDetails.java | 99 - .../models/AzureResourceIdentifier.java | 100 - .../security/models/AzureResourceLink.java | 81 - .../security/models/AzureServersSetting.java | 217 - .../security/models/Baseline.java | 108 - .../models/BaselineAdjustedResult.java | 143 - .../security/models/BenchmarkReference.java | 99 - .../models/BlobScanResultsOptions.java | 51 - .../security/models/BlobsScanSummary.java | 150 - .../security/models/BuiltInInfoType.java | 116 - .../security/models/BundleType.java | 86 - .../security/models/Categories.java | 76 - .../models/CategoryConfiguration.java | 139 - .../models/CefExternalSecuritySolution.java | 193 - .../models/CefSolutionProperties.java | 201 - .../security/models/CloudName.java | 81 - .../security/models/CloudOffering.java | 170 - .../security/models/Compliance.java | 72 - .../security/models/ComplianceResult.java | 55 - .../security/models/ComplianceResults.java | 62 - .../security/models/ComplianceSegment.java | 97 - .../security/models/Compliances.java | 62 - .../security/models/ConnectableResource.java | 126 - .../security/models/ConnectedResource.java | 113 - .../security/models/ConnectedWorkspace.java | 82 - .../security/models/ConnectionType.java | 51 - ...tainerRegistryVulnerabilityProperties.java | 238 - .../security/models/ControlType.java | 51 - .../models/CspmMonitorAwsOffering.java | 118 - ...nitorAwsOfferingNativeCloudConnection.java | 95 - .../CspmMonitorAzureDevOpsOffering.java | 87 - .../models/CspmMonitorDockerHubOffering.java | 85 - .../models/CspmMonitorGcpOffering.java | 118 - ...nitorGcpOfferingNativeCloudConnection.java | 127 - .../models/CspmMonitorGitLabOffering.java | 85 - .../models/CspmMonitorGithubOffering.java | 85 - .../models/CspmMonitorJFrogOffering.java | 85 - .../security/models/CustomAlertRule.java | 198 - .../security/models/CustomRecommendation.java | 404 -- .../models/CustomRecommendations.java | 144 - .../resourcemanager/security/models/Cve.java | 97 - .../resourcemanager/security/models/Cvss.java | 81 - .../security/models/DataExportSettings.java | 210 - .../security/models/DataSource.java | 46 - .../models/DefenderCspmAwsOffering.java | 280 -- .../models/DefenderCspmAwsOfferingCiem.java | 130 - .../DefenderCspmAwsOfferingCiemDiscovery.java | 95 - .../DefenderCspmAwsOfferingCiemOidc.java | 124 - ...pmAwsOfferingDataSensitivityDiscovery.java | 124 - .../DefenderCspmAwsOfferingDatabasesDspm.java | 124 - ...ingMdcContainersAgentlessDiscoveryK8S.java | 127 - ...sOfferingMdcContainersImageAssessment.java | 125 - .../DefenderCspmAwsOfferingVmScanners.java | 107 - .../models/DefenderCspmDockerHubOffering.java | 87 - .../models/DefenderCspmGcpOffering.java | 251 - .../DefenderCspmGcpOfferingCiemDiscovery.java | 157 - ...pmGcpOfferingDataSensitivityDiscovery.java | 156 - ...ingMdcContainersAgentlessDiscoveryK8S.java | 158 - ...pOfferingMdcContainersImageAssessment.java | 157 - .../DefenderCspmGcpOfferingVmScanners.java | 95 - .../models/DefenderCspmJFrogOffering.java | 118 - ...gOfferingMdcContainersImageAssessment.java | 97 - .../DefenderFoDatabasesAwsOffering.java | 183 - ...tabasesAwsOfferingArcAutoProvisioning.java | 108 - ...erFoDatabasesAwsOfferingDatabasesDspm.java | 124 - .../DefenderFoDatabasesAwsOfferingRds.java | 122 - .../DefenderForContainersAwsOffering.java | 471 -- ...tainersAwsOfferingCloudWatchToKinesis.java | 96 - ...erForContainersAwsOfferingKinesisToS3.java | 95 - ...rsAwsOfferingKubernetesDataCollection.java | 98 - ...ontainersAwsOfferingKubernetesService.java | 95 - ...ingMdcContainersAgentlessDiscoveryK8S.java | 127 - ...sOfferingMdcContainersImageAssessment.java | 127 - ...derForContainersAwsOfferingVmScanners.java | 107 - ...efenderForContainersDockerHubOffering.java | 87 - .../DefenderForContainersGcpOffering.java | 345 -- ...ringDataPipelineNativeCloudConnection.java | 133 - ...ingMdcContainersAgentlessDiscoveryK8S.java | 158 - ...pOfferingMdcContainersImageAssessment.java | 158 - ...inersGcpOfferingNativeCloudConnection.java | 128 - ...derForContainersGcpOfferingVmScanners.java | 95 - .../DefenderForContainersJFrogOffering.java | 87 - .../DefenderForDatabasesGcpOffering.java | 155 - ...tabasesGcpOfferingArcAutoProvisioning.java | 97 - ...fenderForDatabasesArcAutoProvisioning.java | 129 - .../models/DefenderForServersAwsOffering.java | 283 -- ...ServersAwsOfferingArcAutoProvisioning.java | 108 - ...rServersAwsOfferingDefenderForServers.java | 95 - ...ServersAwsOfferingMdeAutoProvisioning.java | 126 - .../DefenderForServersAwsOfferingSubPlan.java | 95 - ...rServersAwsOfferingVaAutoProvisioning.java | 129 - ...feringVaAutoProvisioningConfiguration.java | 98 - ...fenderForServersAwsOfferingVmScanners.java | 107 - .../models/DefenderForServersGcpOffering.java | 283 -- ...ServersGcpOfferingArcAutoProvisioning.java | 96 - ...rServersGcpOfferingDefenderForServers.java | 127 - ...ServersGcpOfferingMdeAutoProvisioning.java | 126 - .../DefenderForServersGcpOfferingSubPlan.java | 95 - ...rServersGcpOfferingVaAutoProvisioning.java | 129 - ...feringVaAutoProvisioningConfiguration.java | 98 - ...fenderForServersGcpOfferingVmScanners.java | 95 - .../models/DefenderForStorageSetting.java | 158 - .../DefenderForStorageSettingProperties.java | 194 - .../security/models/DefenderForStorages.java | 176 - .../models/DenylistCustomAlertRule.java | 141 - .../security/models/DevOpsCapability.java | 97 - .../security/models/DevOpsConfiguration.java | 55 - .../models/DevOpsConfigurationProperties.java | 282 -- .../security/models/DevOpsConfigurations.java | 147 - .../models/DevOpsOperationResults.java | 41 - .../models/DevOpsProvisioningState.java | 84 - .../security/models/DeviceSecurityGroup.java | 282 -- .../security/models/DeviceSecurityGroups.java | 144 - .../models/DiscoveredSecuritySolution.java | 83 - .../models/DiscoveredSecuritySolutions.java | 93 - .../models/DockerHubEnvironmentData.java | 144 - .../security/models/Effect.java | 56 - .../security/models/Enforce.java | 54 - .../security/models/EnvironmentData.java | 120 - .../security/models/EnvironmentDetails.java | 155 - .../security/models/EnvironmentType.java | 76 - .../security/models/EventSource.java | 107 - .../models/ExecuteGovernanceRuleParams.java | 93 - .../security/models/ExemptionCategory.java | 51 - .../security/models/ExpandControlsEnum.java | 46 - .../security/models/ExpandEnum.java | 51 - .../security/models/ExportData.java | 46 - .../security/models/Extension.java | 291 -- .../models/ExternalSecuritySolution.java | 69 - .../models/ExternalSecuritySolutionKind.java | 56 - .../ExternalSecuritySolutionProperties.java | 191 - .../models/ExternalSecuritySolutions.java | 93 - .../security/models/FilesScanSummary.java | 150 - .../models/GcpOrganizationalData.java | 112 - .../models/GcpOrganizationalDataMember.java | 143 - .../GcpOrganizationalDataOrganization.java | 196 - .../security/models/GcpProjectDetails.java | 153 - .../models/GcpProjectEnvironmentData.java | 175 - .../GetSensitivitySettingsListResponse.java | 27 - .../GetSensitivitySettingsResponse.java | 55 - ...SensitivitySettingsResponseProperties.java | 148 - ...tingsResponsePropertiesMipInformation.java | 156 - .../security/models/GitHubIssues.java | 41 - .../security/models/GitHubOwner.java | 55 - .../models/GitHubOwnerListResponse.java | 34 - .../models/GitHubOwnerProperties.java | 195 - .../security/models/GitHubOwners.java | 93 - .../security/models/GitHubRepos.java | 72 - .../security/models/GitHubRepository.java | 55 - .../models/GitHubRepositoryProperties.java | 257 -- .../security/models/GitLabGroup.java | 55 - .../models/GitLabGroupListResponse.java | 34 - .../models/GitLabGroupProperties.java | 222 - .../security/models/GitLabGroups.java | 93 - .../security/models/GitLabProject.java | 55 - .../models/GitLabProjectProperties.java | 244 - .../security/models/GitLabProjects.java | 74 - .../security/models/GitLabSubgroups.java | 41 - .../models/GithubScopeEnvironmentData.java | 85 - .../models/GitlabScopeEnvironmentData.java | 85 - .../security/models/GovernanceAssignment.java | 373 -- .../GovernanceAssignmentAdditionalData.java | 155 - .../models/GovernanceAssignments.java | 148 - .../models/GovernanceEmailNotification.java | 123 - .../security/models/GovernanceRule.java | 678 --- .../GovernanceRuleEmailNotification.java | 125 - .../models/GovernanceRuleMetadata.java | 133 - .../models/GovernanceRuleOwnerSource.java | 122 - .../models/GovernanceRuleOwnerSourceType.java | 51 - .../GovernanceRuleSourceResourceType.java | 46 - .../security/models/GovernanceRuleType.java | 51 - .../security/models/GovernanceRules.java | 189 - ...overnanceRulesOperationResultsHeaders.java | 47 - ...vernanceRulesOperationResultsResponse.java | 40 - .../models/HealthDataClassification.java | 116 - .../security/models/HealthReport.java | 107 - .../models/HealthReportResourceDetails.java | 114 - .../security/models/HealthReportStatus.java | 152 - .../security/models/HealthReports.java | 66 - .../security/models/Identity.java | 114 - .../security/models/ImplementationEffort.java | 56 - .../security/models/InfoType.java | 116 - .../models/InformationProtectionKeyword.java | 177 - .../models/InformationProtectionPolicies.java | 94 - .../models/InformationProtectionPolicy.java | 229 - .../InformationProtectionPolicyName.java | 51 - .../security/models/InformationType.java | 267 -- .../models/InheritFromParentState.java | 54 - .../security/models/Inherited.java | 54 - .../security/models/Intent.java | 138 - .../security/models/InventoryKind.java | 66 - .../security/models/InventoryList.java | 121 - .../security/models/InventoryListKind.java | 51 - .../models/IoTSecurityAggregatedAlert.java | 150 - ...atedAlertPropertiesTopDevicesListItem.java | 118 - .../IoTSecurityAggregatedRecommendation.java | 126 - .../models/IoTSecurityAlertedDevice.java | 97 - .../models/IoTSecurityDeviceAlert.java | 114 - .../IoTSecurityDeviceRecommendation.java | 115 - .../IoTSecuritySolutionAnalyticsModel.java | 91 - ...IoTSecuritySolutionAnalyticsModelList.java | 35 - ...ticsModelPropertiesDevicesMetricsItem.java | 112 - .../models/IoTSecuritySolutionModel.java | 480 -- .../security/models/IoTSeverityMetrics.java | 116 - .../models/IotSecuritySolutionAnalytics.java | 65 - .../security/models/IotSecuritySolutions.java | 163 - ...itySolutionsAnalyticsAggregatedAlerts.java | 98 - ...ritySolutionsAnalyticsRecommendations.java | 74 - .../security/models/IsEnabled.java | 51 - .../security/models/Issue.java | 202 - .../security/models/IssueCreationRequest.java | 95 - .../security/models/JFrogEnvironmentData.java | 112 - .../models/JitNetworkAccessPolicies.java | 258 -- .../models/JitNetworkAccessPolicy.java | 289 -- .../JitNetworkAccessPolicyInitiatePort.java | 166 - ...JitNetworkAccessPolicyInitiateRequest.java | 139 - ...orkAccessPolicyInitiateVirtualMachine.java | 142 - .../JitNetworkAccessPolicyVirtualMachine.java | 172 - .../models/JitNetworkAccessPortRule.java | 229 - .../models/JitNetworkAccessRequest.java | 49 - .../models/JitNetworkAccessRequestPort.java | 295 -- ...JitNetworkAccessRequestVirtualMachine.java | 142 - .../resourcemanager/security/models/Kind.java | 46 - .../security/models/Label.java | 117 - .../security/models/ListCustomAlertRule.java | 154 - .../security/models/Locations.java | 63 - .../models/LogAnalyticsIdentifier.java | 150 - .../security/models/MalwareScan.java | 26 - .../models/MalwareScanProperties.java | 171 - .../models/MalwareScanningProperties.java | 209 - .../security/models/MdeOnboardingData.java | 64 - .../models/MdeOnboardingDataList.java | 27 - .../security/models/MdeOnboardings.java | 54 - .../security/models/MinimalRiskLevel.java | 61 - .../security/models/MinimalSeverity.java | 56 - .../security/models/MipIntegrationStatus.java | 61 - .../security/models/NotificationsSource.java | 109 - .../models/NotificationsSourceAlert.java | 113 - .../models/NotificationsSourceAttackPath.java | 116 - .../security/models/OfferingType.java | 136 - .../models/OnPremiseResourceDetails.java | 244 - .../models/OnPremiseSqlResourceDetails.java | 221 - .../security/models/OnUploadFilters.java | 177 - .../security/models/OnUploadProperties.java | 158 - .../security/models/OnboardingState.java | 67 - .../security/models/Operation.java | 58 - .../security/models/OperationDisplay.java | 136 - .../security/models/OperationResult.java | 26 - .../models/OperationResultStatus.java | 56 - .../security/models/OperationResults.java | 36 - .../models/OperationResultsGetHeaders.java | 67 - .../models/OperationResultsGetResponse.java | 28 - .../security/models/OperationStatus.java | 99 - .../models/OperationStatusResult.java | 86 - .../security/models/OperationStatuses.java | 38 - .../security/models/Operations.java | 35 - .../security/models/Operator.java | 86 - .../models/OrganizationMembershipType.java | 51 - .../security/models/Origin.java | 57 - .../models/PartialAssessmentProperties.java | 93 - .../security/models/Pricing.java | 149 - .../security/models/PricingList.java | 27 - .../security/models/PricingTier.java | 53 - .../security/models/Pricings.java | 133 - .../security/models/PrivateEndpoint.java | 81 - .../models/PrivateEndpointConnection.java | 246 - ...teEndpointConnectionProvisioningState.java | 62 - .../models/PrivateEndpointConnections.java | 166 - ...rivateEndpointServiceConnectionStatus.java | 57 - .../models/PrivateLinkGroupResource.java | 70 - .../security/models/PrivateLinkResource.java | 280 -- .../security/models/PrivateLinkResources.java | 73 - .../PrivateLinkServiceConnectionState.java | 155 - .../security/models/PrivateLinkUpdate.java | 96 - .../security/models/PrivateLinks.java | 204 - .../security/models/PropertyType.java | 61 - .../security/models/Protocol.java | 56 - .../security/models/ProvisioningState.java | 76 - .../security/models/PublicNetworkAccess.java | 51 - .../security/models/QueryCheck.java | 121 - .../resourcemanager/security/models/Rank.java | 71 - .../models/RecommendationConfigStatus.java | 51 - ...RecommendationConfigurationProperties.java | 158 - .../models/RecommendationSupportedClouds.java | 56 - .../security/models/RecommendationType.java | 135 - .../RegulatoryComplianceAssessment.java | 105 - .../RegulatoryComplianceAssessments.java | 71 - .../models/RegulatoryComplianceControl.java | 86 - .../models/RegulatoryComplianceControls.java | 65 - .../models/RegulatoryComplianceStandard.java | 87 - .../models/RegulatoryComplianceStandards.java | 58 - .../security/models/Remediation.java | 135 - .../security/models/RemediationEta.java | 138 - .../security/models/ReportedSeverity.java | 61 - .../security/models/ResourceDetails.java | 111 - .../security/models/ResourceIdentifier.java | 111 - .../models/ResourceIdentifierType.java | 51 - .../security/models/ResourceIdentityType.java | 51 - .../security/models/ResourceStatus.java | 61 - .../models/ResourcesCoverageStatus.java | 61 - .../security/models/RiskLevel.java | 66 - .../security/models/RuleCategory.java | 77 - .../security/models/RuleResults.java | 250 - .../security/models/RuleResultsInput.java | 128 - .../models/RuleResultsProperties.java | 103 - .../security/models/RuleSeverity.java | 66 - .../security/models/RuleState.java | 61 - .../security/models/RuleStatus.java | 61 - .../security/models/RuleType.java | 61 - .../security/models/RulesResults.java | 34 - .../security/models/RulesResultsInput.java | 129 - .../security/models/ScanOperationStatus.java | 61 - .../security/models/ScanPropertiesV2.java | 330 -- .../security/models/ScanResult.java | 55 - .../security/models/ScanResultProperties.java | 197 - .../security/models/ScanState.java | 61 - .../security/models/ScanSummary.java | 123 - .../security/models/ScanTriggerType.java | 51 - .../security/models/ScanV2.java | 55 - .../security/models/ScanningMode.java | 46 - .../security/models/ScopeElement.java | 131 - .../SecureScoreControlDefinitionItem.java | 85 - .../SecureScoreControlDefinitionSource.java | 84 - .../models/SecureScoreControlDefinitions.java | 53 - .../models/SecureScoreControlDetails.java | 113 - .../SecureScoreControlScoreDetails.java | 84 - .../security/models/SecureScoreControls.java | 63 - .../security/models/SecureScoreItem.java | 85 - .../security/models/SecureScores.java | 62 - .../security/models/SecurityAssessment.java | 312 -- ...SecurityAssessmentMetadataPartnerData.java | 165 - .../SecurityAssessmentMetadataProperties.java | 443 -- ...etadataPropertiesResponsePublishDates.java | 136 - .../SecurityAssessmentMetadataResponse.java | 423 -- .../models/SecurityAssessmentPartnerData.java | 136 - .../SecurityAssessmentPropertiesBase.java | 289 -- .../SecurityAssessmentPropertiesBaseRisk.java | 217 - ...AssessmentPropertiesBaseRiskPathsItem.java | 164 - ...ssmentPropertiesBaseRiskPathsItemEdge.java | 171 - ...rtiesBaseRiskPathsPropertiesItemsItem.java | 130 - .../models/SecurityAssessmentResponse.java | 363 -- .../security/models/SecurityConnector.java | 451 -- .../models/SecurityConnectorApplications.java | 128 - .../security/models/SecurityConnectors.java | 165 - .../security/models/SecurityContact.java | 212 - .../security/models/SecurityContactName.java | 46 - ...yContactPropertiesNotificationsByRole.java | 135 - .../security/models/SecurityContactRole.java | 61 - .../security/models/SecurityContacts.java | 132 - .../security/models/SecurityFamily.java | 61 - .../security/models/SecurityIssue.java | 71 - .../security/models/SecurityOperator.java | 55 - .../security/models/SecurityOperators.java | 112 - .../security/models/SecuritySolution.java | 83 - .../models/SecuritySolutionStatus.java | 51 - .../security/models/SecuritySolutions.java | 64 - .../SecuritySolutionsReferenceData.java | 244 - .../SecuritySolutionsReferenceDataList.java | 27 - .../SecuritySolutionsReferenceDatas.java | 58 - .../security/models/SecurityStandard.java | 356 -- .../security/models/SecurityStandards.java | 139 - .../models/SecuritySubAssessment.java | 119 - .../security/models/SecurityTask.java | 85 - .../models/SecurityTaskParameters.java | 109 - .../SensitiveDataDiscoveryProperties.java | 114 - .../security/models/SensitivityLabel.java | 205 - .../security/models/SensitivitySettings.java | 77 - .../models/ServerVulnerabilityAssessment.java | 55 - ...AssessmentPropertiesProvisioningState.java | 69 - .../ServerVulnerabilityAssessments.java | 137 - ...sessmentsAzureSettingSelectedProvider.java | 47 - .../ServerVulnerabilityAssessmentsList.java | 27 - ...ServerVulnerabilityAssessmentsSetting.java | 63 - ...erVulnerabilityAssessmentsSettingKind.java | 48 - ...lnerabilityAssessmentsSettingKindName.java | 48 - ...erabilityAssessmentsSettingProperties.java | 65 - ...erverVulnerabilityAssessmentsSettings.java | 112 - .../models/ServerVulnerabilityProperties.java | 220 - .../security/models/Setting.java | 62 - .../security/models/SettingKind.java | 56 - .../security/models/SettingName.java | 72 - .../security/models/SettingProperties.java | 63 - .../security/models/Settings.java | 83 - .../security/models/Severity.java | 61 - .../security/models/SeverityEnum.java | 56 - .../security/models/Source.java | 71 - .../security/models/SourceType.java | 51 - .../SqlServerVulnerabilityProperties.java | 118 - ...lVulnerabilityAssessmentBaselineRules.java | 188 - ...rabilityAssessmentScanOperationResult.java | 56 - ...sessmentScanOperationResultProperties.java | 104 - ...SqlVulnerabilityAssessmentScanResults.java | 75 - .../SqlVulnerabilityAssessmentScans.java | 123 - .../SqlVulnerabilityAssessmentSettings.java | 55 - ...erabilityAssessmentSettingsOperations.java | 84 - ...erabilityAssessmentSettingsProperties.java | 115 - .../SqlVulnerabilityAssessmentState.java | 51 - .../security/models/Standard.java | 483 -- .../security/models/StandardAssignment.java | 305 -- .../models/StandardAssignmentMetadata.java | 133 - ...rdAssignmentPropertiesAttestationData.java | 185 - ...dardAssignmentPropertiesExemptionData.java | 131 - .../security/models/StandardAssignments.java | 165 - .../models/StandardComponentProperties.java | 93 - .../security/models/StandardMetadata.java | 133 - .../models/StandardSupportedCloud.java | 56 - .../models/StandardSupportedClouds.java | 56 - .../security/models/StandardType.java | 56 - .../security/models/Standards.java | 161 - .../security/models/State.java | 71 - .../security/models/Status.java | 51 - .../security/models/StatusName.java | 56 - .../security/models/StatusReason.java | 56 - .../security/models/SubAssessmentStatus.java | 129 - .../models/SubAssessmentStatusCode.java | 56 - .../security/models/SubAssessments.java | 94 - .../security/models/SubPlan.java | 51 - .../models/SuppressionAlertsScope.java | 105 - .../security/models/Tactics.java | 111 - .../resourcemanager/security/models/Tags.java | 95 - .../security/models/TagsResource.java | 95 - .../models/TargetBranchConfiguration.java | 134 - .../security/models/TaskUpdateActionType.java | 66 - .../security/models/Tasks.java | 209 - .../security/models/Techniques.java | 570 --- .../security/models/Threats.java | 81 - .../models/ThresholdCustomAlertRule.java | 181 - .../models/TimeWindowCustomAlertRule.java | 164 - .../security/models/Topologies.java | 93 - .../security/models/TopologyResource.java | 71 - .../models/TopologySingleResource.java | 208 - .../models/TopologySingleResourceChild.java | 81 - .../models/TopologySingleResourceParent.java | 81 - .../resourcemanager/security/models/Type.java | 51 - .../models/UnmaskedIpLoggingStatus.java | 51 - .../models/UpdateIotSecuritySolutionData.java | 150 - .../UpdateSensitivitySettingsRequest.java | 168 - .../UserDefinedResourcesProperties.java | 144 - .../security/models/UserImpact.java | 56 - .../security/models/VaRule.java | 228 - .../security/models/ValueType.java | 51 - .../security/models/VendorReference.java | 97 - .../security/models/VmScannersAws.java | 120 - .../security/models/VmScannersBase.java | 124 - .../models/VmScannersBaseConfiguration.java | 123 - .../security/models/VmScannersGcp.java | 92 - .../security/models/WorkspaceSetting.java | 205 - .../security/models/WorkspaceSettings.java | 138 - .../security/models/package-info.java | 9 - .../security/package-info.java | 9 - .../src/main/java/module-info.java | 16 - .../proxy-config.json | 1 - .../reflect-config.json | 1 - .../azure-resourcemanager-security.properties | 1 - .../models/ArmApplicationHealthPolicy.java | 11 +- .../fluent/ServicesClient.java | 8 +- .../implementation/ServicesClientImpl.java | 18 +- .../models/ServiceResource.java | 4 +- .../models/Services.java | 4 +- .../fluent/AdvancedPlatformMetricsClient.java | 269 -- .../storage/fluent/BlobContainersClient.java | 1239 ----- .../fluent/BlobInventoryPoliciesClient.java | 278 -- .../storage/fluent/BlobServicesClient.java | 203 - .../storage/fluent/ConnectorsClient.java | 684 --- .../storage/fluent/DataSharesClient.java | 504 -- .../storage/fluent/DeletedAccountsClient.java | 105 - .../fluent/EncryptionScopesClient.java | 324 -- .../storage/fluent/FileServicesClient.java | 342 -- .../storage/fluent/FileSharesClient.java | 573 --- .../fluent/LocalUsersOperationsClient.java | 441 -- .../fluent/ManagementPoliciesClient.java | 216 - ...SecurityPerimeterConfigurationsClient.java | 249 - ...ctReplicationPoliciesOperationsClient.java | 300 -- .../storage/fluent/OperationsClient.java | 49 - .../PrivateEndpointConnectionsClient.java | 277 -- .../fluent/PrivateLinkResourcesClient.java | 78 - .../storage/fluent/QueueServicesClient.java | 216 - .../storage/fluent/QueuesClient.java | 389 -- .../storage/fluent/SkusClient.java | 49 - .../storage/fluent/StorageAccountsClient.java | 1576 ------- .../fluent/StorageManagementClient.java | 237 - ...eTaskAssignmentInstancesReportsClient.java | 103 - .../fluent/StorageTaskAssignmentsClient.java | 703 --- ...TaskAssignmentsInstancesReportsClient.java | 89 - .../storage/fluent/TableServicesClient.java | 216 - .../storage/fluent/TablesClient.java | 340 -- .../storage/fluent/UsagesClient.java | 57 - .../AdvancedPlatformMetricsRuleInner.java | 168 - .../fluent/models/BlobContainerInner.java | 468 -- .../models/BlobInventoryPolicyInner.java | 189 - .../models/BlobInventoryPolicyProperties.java | 125 - .../fluent/models/BlobRestoreStatusInner.java | 139 - .../models/BlobServicePropertiesInner.java | 435 -- .../BlobServicePropertiesProperties.java | 394 -- .../CheckNameAvailabilityResultInner.java | 120 - .../storage/fluent/models/ConnectorInner.java | 198 - .../fluent/models/ContainerProperties.java | 494 -- .../storage/fluent/models/DataShareInner.java | 198 - .../fluent/models/DeletedAccountInner.java | 200 - .../models/DeletedAccountProperties.java | 146 - .../fluent/models/EncryptionScopeInner.java | 283 -- .../models/EncryptionScopeProperties.java | 229 - .../fluent/models/FileServiceItemsInner.java | 87 - .../models/FileServicePropertiesInner.java | 253 - .../FileServicePropertiesProperties.java | 170 - .../fluent/models/FileServiceUsageInner.java | 157 - .../storage/fluent/models/FileShareInner.java | 581 --- .../fluent/models/FileShareItemInner.java | 439 -- .../fluent/models/FileShareProperties.java | 673 --- .../models/ImmutabilityPolicyInner.java | 274 -- .../models/ImmutabilityPolicyProperty.java | 196 - .../models/LeaseContainerResponseInner.java | 101 - .../models/LeaseShareResponseInner.java | 101 - .../storage/fluent/models/LegalHoldInner.java | 157 - .../models/ListAccountSasResponseInner.java | 81 - .../fluent/models/ListContainerItemInner.java | 361 -- .../storage/fluent/models/ListQueueInner.java | 164 - .../fluent/models/ListQueueProperties.java | 84 - .../fluent/models/ListQueueServicesInner.java | 87 - .../models/ListServiceSasResponseInner.java | 81 - .../fluent/models/ListTableServicesInner.java | 87 - .../storage/fluent/models/LocalUserInner.java | 413 -- .../fluent/models/LocalUserKeysInner.java | 105 - .../fluent/models/LocalUserProperties.java | 402 -- ...ocalUserRegeneratePasswordResultInner.java | 85 - .../fluent/models/ManagementPolicyInner.java | 190 - .../models/ManagementPolicyProperties.java | 127 - ...rkSecurityPerimeterConfigurationInner.java | 207 - ...urityPerimeterConfigurationProperties.java | 171 - .../models/ObjectReplicationPolicyInner.java | 325 -- .../ObjectReplicationPolicyProperties.java | 313 -- .../storage/fluent/models/OperationInner.java | 150 - .../fluent/models/OperationProperties.java | 86 - .../PrivateEndpointConnectionInner.java | 217 - .../PrivateEndpointConnectionProperties.java | 161 - .../PrivateLinkResourceListResultInner.java | 90 - .../models/PrivateLinkResourceProperties.java | 119 - .../fluent/models/QueueProperties.java | 113 - .../models/QueueServicePropertiesInner.java | 183 - .../QueueServicePropertiesProperties.java | 104 - .../fluent/models/SkuInformationInner.java | 232 - .../fluent/models/StorageAccountInner.java | 1156 ----- .../StorageAccountListKeysResultInner.java | 89 - .../models/StorageAccountMigrationInner.java | 225 - .../StorageAccountMigrationProperties.java | 155 - ...rageAccountPropertiesCreateParameters.java | 1009 ---- .../models/StorageAccountPropertiesInner.java | 1263 ----- ...rageAccountPropertiesUpdateParameters.java | 951 ---- .../fluent/models/StorageQueueInner.java | 188 - .../models/StorageTaskAssignmentInner.java | 167 - .../StorageTaskReportInstanceInner.java | 157 - .../storage/fluent/models/TableInner.java | 188 - .../fluent/models/TableProperties.java | 117 - .../models/TableServicePropertiesInner.java | 183 - .../TableServicePropertiesProperties.java | 104 - .../models/TestConnectionResponseInner.java | 139 - .../storage/fluent/models/UsageInner.java | 134 - .../storage/fluent/models/package-info.java | 9 - .../storage/fluent/package-info.java | 9 - .../AdvancedPlatformMetricsClientImpl.java | 765 --- .../BlobContainersClientImpl.java | 2793 ----------- .../BlobInventoryPoliciesClientImpl.java | 770 ---- .../BlobServicesClientImpl.java | 587 --- .../implementation/ConnectorsClientImpl.java | 1616 ------- .../implementation/DataSharesClientImpl.java | 1255 ----- .../DeletedAccountsClientImpl.java | 353 -- .../EncryptionScopesClientImpl.java | 868 ---- .../FileServicesClientImpl.java | 891 ---- .../implementation/FileSharesClientImpl.java | 1401 ------ .../LocalUsersOperationsClientImpl.java | 1120 ----- .../ManagementPoliciesClientImpl.java | 530 --- ...rityPerimeterConfigurationsClientImpl.java | 705 --- ...plicationPoliciesOperationsClientImpl.java | 805 ---- .../implementation/OperationsClientImpl.java | 231 - .../PrivateEndpointConnectionsClientImpl.java | 772 ---- .../PrivateLinkResourcesClientImpl.java | 196 - .../QueueServicesClientImpl.java | 499 -- .../implementation/QueuesClientImpl.java | 992 ---- .../implementation/SkusClientImpl.java | 241 - .../StorageAccountsClientImpl.java | 3607 --------------- .../StorageManagementClientBuilder.java | 138 - .../StorageManagementClientImpl.java | 556 --- ...kAssignmentInstancesReportsClientImpl.java | 377 -- .../StorageTaskAssignmentsClientImpl.java | 1642 ------- ...AssignmentsInstancesReportsClientImpl.java | 340 -- .../TableServicesClientImpl.java | 499 -- .../implementation/TablesClientImpl.java | 907 ---- .../implementation/UsagesClientImpl.java | 263 -- ...AdvancedPlatformMetricsRuleListResult.java | 116 - .../models/BlobServiceItems.java | 105 - .../models/ConnectorListResult.java | 112 - .../models/DataShareListResult.java | 112 - .../models/DeletedAccountListResult.java | 113 - .../models/EncryptionScopeListResult.java | 114 - .../models/FileServiceUsages.java | 106 - .../implementation/models/FileShareItems.java | 106 - .../models/ListBlobInventoryPolicy.java | 105 - .../models/ListContainerItems.java | 107 - .../models/ListQueueResource.java | 105 - .../models/ListTableResource.java | 105 - .../implementation/models/LocalUsers.java | 112 - ...orkSecurityPerimeterConfigurationList.java | 108 - .../models/ObjectReplicationPolicies.java | 106 - .../models/OperationListResult.java | 105 - .../PrivateEndpointConnectionListResult.java | 108 - .../models/StorageAccountListResult.java | 113 - .../models/StorageSkuListResult.java | 105 - .../models/StorageTaskAssignmentsList.java | 106 - .../models/StorageTaskReportSummary.java | 106 - .../models/UsageListResult.java | 105 - .../storage/models/AccessPolicy.java | 156 - .../storage/models/AccessTier.java | 72 - .../AccountImmutabilityPolicyProperties.java | 178 - .../AccountImmutabilityPolicyState.java | 60 - .../storage/models/AccountLimits.java | 131 - .../storage/models/AccountSasParameters.java | 336 -- .../storage/models/AccountStatus.java | 56 - .../storage/models/AccountUsage.java | 110 - .../storage/models/AccountUsageElements.java | 131 - .../storage/models/Action.java | 51 - .../models/ActiveDirectoryProperties.java | 349 -- .../ActiveDirectoryPropertiesAccountType.java | 55 - .../AdvancedPlatformMetricsFilterType.java | 56 - .../AdvancedPlatformMetricsRuleConfig.java | 136 - ...AdvancedPlatformMetricsRuleProperties.java | 195 - .../AdvancedPlatformMetricsRuleType.java | 47 - .../storage/models/AllowedCopyScope.java | 56 - .../storage/models/AzureEntityResource.java | 174 - ...AzureFilesIdentityBasedAuthentication.java | 213 - ...eateOrUpdateImmutabilityPolicyHeaders.java | 47 - ...ateOrUpdateImmutabilityPolicyResponse.java | 41 - ...ainersDeleteImmutabilityPolicyHeaders.java | 47 - ...inersDeleteImmutabilityPolicyResponse.java | 40 - ...ainersExtendImmutabilityPolicyHeaders.java | 47 - ...inersExtendImmutabilityPolicyResponse.java | 40 - ...ontainersGetImmutabilityPolicyHeaders.java | 47 - ...ntainersGetImmutabilityPolicyResponse.java | 40 - ...ntainersLockImmutabilityPolicyHeaders.java | 47 - ...tainersLockImmutabilityPolicyResponse.java | 40 - .../models/BlobInventoryCreationTime.java | 97 - .../models/BlobInventoryPolicyDefinition.java | 283 -- .../models/BlobInventoryPolicyFilter.java | 299 -- .../models/BlobInventoryPolicyName.java | 46 - .../models/BlobInventoryPolicyRule.java | 200 - .../models/BlobInventoryPolicySchema.java | 185 - .../storage/models/BlobRestoreParameters.java | 144 - .../models/BlobRestoreProgressStatus.java | 58 - .../storage/models/BlobRestoreRange.java | 133 - .../storage/models/BurstingConstants.java | 116 - .../storage/models/Bypass.java | 62 - .../storage/models/ChangeFeed.java | 124 - .../storage/models/ConnectorUpdate.java | 180 - .../storage/models/CorsRule.java | 247 - .../models/CorsRuleAllowedMethodsItem.java | 91 - .../storage/models/CorsRules.java | 98 - .../storage/models/CustomDomain.java | 134 - .../storage/models/DataShareConnection.java | 125 - .../storage/models/DataShareSource.java | 155 - .../storage/models/DataShareSourceUpdate.java | 115 - .../storage/models/DataShareUpdate.java | 180 - .../storage/models/DateAfterCreation.java | 129 - .../storage/models/DateAfterModification.java | 194 - .../storage/models/DefaultAction.java | 56 - .../models/DefaultSharePermission.java | 64 - .../storage/models/DeleteRetentionPolicy.java | 158 - .../storage/models/DeletedShare.java | 134 - .../storage/models/Dimension.java | 99 - .../models/DirectoryServiceOptions.java | 61 - .../storage/models/DnsEndpointType.java | 53 - .../models/DualStackEndpointPreference.java | 96 - .../storage/models/EnabledProtocols.java | 51 - .../storage/models/Encryption.java | 219 - .../storage/models/EncryptionIdentity.java | 133 - .../storage/models/EncryptionInTransit.java | 93 - .../EncryptionScopeKeyVaultProperties.java | 134 - .../storage/models/EncryptionScopeSource.java | 51 - .../storage/models/EncryptionScopeState.java | 51 - .../storage/models/EncryptionService.java | 150 - .../storage/models/EncryptionServices.java | 189 - .../storage/models/Endpoints.java | 221 - .../storage/models/ExecutionTarget.java | 129 - .../storage/models/ExecutionTrigger.java | 135 - .../models/ExecutionTriggerUpdate.java | 124 - .../storage/models/ExpirationAction.java | 53 - .../storage/models/ExtendedLocation.java | 121 - .../storage/models/ExtendedLocationTypes.java | 46 - .../storage/models/FailoverType.java | 51 - .../models/FileServiceUsageProperties.java | 170 - .../storage/models/FileShareLimits.java | 201 - ...eSharePropertiesFileSharePaidBursting.java | 170 - .../models/FileShareRecommendations.java | 132 - .../models/FileSharesLeaseHeaders.java | 47 - .../models/FileSharesLeaseResponse.java | 39 - .../storage/models/Format.java | 51 - .../models/GeoPriorityReplicationStatus.java | 95 - .../storage/models/GeoReplicationStats.java | 182 - .../storage/models/GeoReplicationStatus.java | 59 - .../storage/models/HttpProtocol.java | 56 - .../storage/models/Identity.java | 178 - .../storage/models/IdentityType.java | 61 - .../models/ImmutabilityPolicyProperties.java | 170 - .../models/ImmutabilityPolicyState.java | 51 - .../models/ImmutabilityPolicyUpdateType.java | 56 - .../models/ImmutableStorageAccount.java | 137 - .../ImmutableStorageWithVersioning.java | 133 - .../storage/models/IntervalUnit.java | 51 - .../storage/models/InventoryRuleType.java | 46 - .../storage/models/IpRule.java | 129 - .../storage/models/IssueType.java | 51 - .../storage/models/KeyCreationTime.java | 106 - .../storage/models/KeyPermission.java | 56 - .../storage/models/KeyPolicy.java | 94 - .../storage/models/KeySource.java | 51 - .../storage/models/KeyType.java | 52 - .../storage/models/KeyVaultProperties.java | 204 - .../resourcemanager/storage/models/Kind.java | 66 - .../storage/models/LargeFileSharesState.java | 51 - .../models/LastAccessTimeTrackingPolicy.java | 189 - .../storage/models/LeaseContainerRequest.java | 222 - .../models/LeaseContainerRequestAction.java | 66 - .../storage/models/LeaseDuration.java | 51 - .../storage/models/LeaseShareAction.java | 66 - .../storage/models/LeaseShareRequest.java | 221 - .../storage/models/LeaseState.java | 66 - .../storage/models/LeaseStatus.java | 51 - .../storage/models/LegalHoldProperties.java | 128 - .../storage/models/ListContainersInclude.java | 46 - .../models/ListEncryptionScopesInclude.java | 56 - .../storage/models/ListKeyExpand.java | 51 - .../models/ListLocalUserIncludeParam.java | 46 - .../models/ManagedIdentityAuthProperties.java | 115 - .../ManagedIdentityAuthPropertiesUpdate.java | 115 - .../models/ManagementPolicyAction.java | 158 - .../models/ManagementPolicyBaseBlob.java | 254 - .../models/ManagementPolicyDefinition.java | 135 - .../models/ManagementPolicyFilter.java | 170 - .../storage/models/ManagementPolicyName.java | 46 - .../storage/models/ManagementPolicyRule.java | 199 - .../models/ManagementPolicySchema.java | 110 - .../models/ManagementPolicySnapShot.java | 222 - .../models/ManagementPolicyVersion.java | 222 - .../storage/models/MetricSpecification.java | 223 - .../storage/models/MetricsEmitted.java | 51 - .../storage/models/MigrationName.java | 46 - .../storage/models/MigrationState.java | 51 - .../storage/models/MigrationStatus.java | 66 - .../storage/models/MinimumTlsVersion.java | 62 - .../storage/models/Multichannel.java | 93 - .../resourcemanager/storage/models/Name.java | 46 - .../NativeDataSharingProvisioningState.java | 71 - .../storage/models/NetworkRuleSet.java | 267 -- .../models/NetworkSecurityPerimeter.java | 116 - ...rimeterConfigurationPropertiesProfile.java | 163 - ...gurationPropertiesResourceAssociation.java | 105 - ...rimeterConfigurationProvisioningState.java | 67 - .../storage/models/NfsSetting.java | 96 - .../storage/models/NspAccessRule.java | 101 - .../models/NspAccessRuleDirection.java | 51 - .../models/NspAccessRuleProperties.java | 163 - ...AccessRulePropertiesSubscriptionsItem.java | 84 - .../models/ObjectReplicationPolicyFilter.java | 130 - ...ectReplicationPolicyPropertiesMetrics.java | 96 - ...onPolicyPropertiesPriorityReplication.java | 99 - ...cationPolicyPropertiesTagsReplication.java | 98 - .../models/ObjectReplicationPolicyRule.java | 197 - .../storage/models/ObjectType.java | 52 - .../storage/models/OperationDisplay.java | 133 - .../storage/models/PermissionScope.java | 170 - .../storage/models/Permissions.java | 82 - .../storage/models/Placement.java | 94 - .../models/PostFailoverRedundancy.java | 51 - .../models/PostPlannedFailoverRedundancy.java | 61 - .../storage/models/PrivateEndpoint.java | 81 - ...teEndpointConnectionProvisioningState.java | 62 - ...rivateEndpointServiceConnectionStatus.java | 57 - .../storage/models/PrivateLinkResource.java | 183 - .../PrivateLinkServiceConnectionState.java | 155 - .../models/ProtectedAppendWritesHistory.java | 105 - .../storage/models/ProtocolSettings.java | 127 - .../storage/models/ProvisioningIssue.java | 101 - .../models/ProvisioningIssueProperties.java | 116 - .../storage/models/ProvisioningState.java | 91 - .../storage/models/PublicAccess.java | 61 - .../storage/models/PublicNetworkAccess.java | 57 - .../storage/models/Reason.java | 57 - .../storage/models/ReasonCode.java | 53 - .../storage/models/ResourceAccessRule.java | 121 - .../models/ResourceAssociationAccessMode.java | 56 - .../models/RestorePolicyProperties.java | 160 - .../storage/models/Restriction.java | 122 - .../storage/models/RootSquashType.java | 56 - .../storage/models/RoutingChoice.java | 51 - .../storage/models/RoutingPreference.java | 155 - .../storage/models/RuleType.java | 46 - .../storage/models/RunResult.java | 51 - .../storage/models/RunStatusEnum.java | 51 - .../storage/models/SasPolicy.java | 140 - .../storage/models/Schedule.java | 51 - .../storage/models/ServiceSasParameters.java | 598 --- .../ServiceSharedKeyAccessProperties.java | 94 - .../storage/models/ServiceSpecification.java | 89 - .../storage/models/Services.java | 62 - .../storage/models/Severity.java | 51 - .../storage/models/ShareAccessTier.java | 62 - .../storage/models/SignedIdentifier.java | 124 - .../storage/models/SignedResource.java | 62 - .../storage/models/SignedResourceTypes.java | 58 - .../resourcemanager/storage/models/Sku.java | 119 - .../storage/models/SkuCapability.java | 99 - .../storage/models/SkuConversionStatus.java | 56 - .../SkuInformationLocationInfoItem.java | 101 - .../storage/models/SkuName.java | 112 - .../storage/models/SkuTier.java | 56 - .../storage/models/SmbOAuthSettings.java | 96 - .../storage/models/SmbSetting.java | 251 - .../storage/models/SshPublicKey.java | 123 - .../resourcemanager/storage/models/State.java | 66 - .../storage/models/StaticWebsite.java | 190 - ...ccountCheckNameAvailabilityParameters.java | 119 - .../StorageAccountCreateParameters.java | 1066 ----- .../storage/models/StorageAccountExpand.java | 56 - .../StorageAccountInternetEndpoints.java | 131 - .../models/StorageAccountIpv6Endpoints.java | 203 - .../storage/models/StorageAccountKey.java | 132 - .../StorageAccountMicrosoftEndpoints.java | 163 - ...StorageAccountRegenerateKeyParameters.java | 106 - ...orageAccountSharedKeyAccessProperties.java | 195 - .../StorageAccountSkuConversionStatus.java | 146 - .../StorageAccountUpdateParameters.java | 936 ---- .../StorageConnectorAuthProperties.java | 109 - .../StorageConnectorAuthPropertiesUpdate.java | 109 - .../models/StorageConnectorAuthType.java | 46 - .../models/StorageConnectorConnection.java | 111 - .../StorageConnectorConnectionType.java | 46 - .../StorageConnectorDataSourceType.java | 46 - .../models/StorageConnectorProperties.java | 284 -- .../StorageConnectorPropertiesUpdate.java | 191 - .../models/StorageConnectorSource.java | 107 - .../models/StorageConnectorSourceType.java | 46 - .../models/StorageConnectorSourceUpdate.java | 108 - .../storage/models/StorageConnectorState.java | 51 - ...rageDataCollaborationPolicyProperties.java | 161 - .../models/StorageDataShareAccessPolicy.java | 169 - ...torageDataShareAccessPolicyPermission.java | 52 - .../storage/models/StorageDataShareAsset.java | 141 - .../models/StorageDataShareProperties.java | 254 - .../StorageDataSharePropertiesUpdate.java | 191 - ...StorageTaskAssignmentExecutionContext.java | 137 - .../StorageTaskAssignmentProperties.java | 285 -- .../models/StorageTaskAssignmentReport.java | 102 - ...eTaskAssignmentUpdateExecutionContext.java | 130 - ...StorageTaskAssignmentUpdateParameters.java | 99 - ...StorageTaskAssignmentUpdateProperties.java | 254 - .../StorageTaskAssignmentUpdateReport.java | 94 - .../models/StorageTaskReportProperties.java | 324 -- .../storage/models/TableAccessPolicy.java | 166 - .../storage/models/TableSignedIdentifier.java | 132 - .../storage/models/TagFilter.java | 169 - .../storage/models/TagProperty.java | 148 - .../models/TestExistingConnectionRequest.java | 103 - .../storage/models/TrackedResourceUpdate.java | 176 - .../storage/models/TriggerParameters.java | 239 - .../models/TriggerParametersUpdate.java | 237 - .../storage/models/TriggerType.java | 61 - .../storage/models/UpdateHistoryProperty.java | 219 - .../storage/models/UsageName.java | 97 - .../storage/models/UsageUnit.java | 76 - .../storage/models/UserAssignedIdentity.java | 97 - .../storage/models/VirtualNetworkRule.java | 162 - .../storage/models/ZonePlacementPolicy.java | 51 - .../storage/models/package-info.java | 9 - .../resourcemanager/storage/package-info.java | 9 - .../proxy-config.json | 1 - .../reflect-config.json | 1 - .../azure-resourcemanager-storage.properties | 1 - .../CachesPausePrimingJobSamples.java | 2 +- .../CachesResumePrimingJobSamples.java | 2 +- .../CachesStopPrimingJobSamples.java | 2 +- ...ingleDocumentTranslationClientBuilder.java | 31 +- ...ngleDocumentTranslationServiceVersion.java | 40 + .../DocumentTranslationClientImpl.java | 12 + .../SingleDocumentTranslationClientImpl.java | 13 +- 3248 files changed, 1732 insertions(+), 527964 deletions(-) delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/CognitiveServicesManager.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountCapabilityHostsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountConnectionsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AgentApplicationsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AgentDeploymentsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CognitiveServicesManagementClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentPlansClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentTiersClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ComputeOperationsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ComputesClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DefenderForAISettingsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DeletedAccountsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DeploymentsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/EncryptionScopesClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/LocationBasedModelCapacitiesClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedComputeCapacitiesClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedComputeDeploymentsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedComputeUsagesOperationGroupsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedNetworkProvisionsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedNetworkSettingsOperationsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ModelCapacitiesClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ModelsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/NetworkSecurityPerimeterConfigurationsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OperationsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OutboundRulesClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OutboundRulesOperationsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/PrivateEndpointConnectionsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/PrivateLinkResourcesClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectCapabilityHostsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectConnectionsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/QuotaTiersClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiBlocklistItemsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiBlocklistsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiContentFiltersClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiExternalSafetyProvidersClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiExternalSafetyProvidersOperationsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiPoliciesClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiToolLabelsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiTopicsClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ResourceProvidersClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ResourceSkusClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/SubscriptionRaiPoliciesClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/TestRaiExternalSafetyProvidersClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/UsagesClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/WorkbenchesClient.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountModelInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountSkuListResultInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentApplicationInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentDeploymentInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentReferenceResourceArmPaginatedResultInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ApiKeysInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CalculateModelCapacityResultInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CapabilityHostInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentTierInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ComputeInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ComputeOperationStatusInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ConnectionPropertiesV2BasicResourceInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DefenderForAISettingInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DefenderForAISettingProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DeploymentInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DomainAvailabilityInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/EncryptionScopeInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/EvaluateDeploymentPoliciesResponseInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedComputeCapacityInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedComputeDeploymentInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedComputeUsageInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkProvisionStatusInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsBasicResourceInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsPropertiesBasicResourceInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ModelCapacityListResultValueItemInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ModelInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/NetworkSecurityPerimeterConfigurationInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OperationInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OutboundRuleBasicResourceInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateEndpointConnectionInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateEndpointConnectionListResultInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateLinkResourceListResultInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ProjectCapabilityHostInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ProjectInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/QuotaTierInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiBlocklistInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiBlocklistItemInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiContentFilterInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiExternalSafetyProviderSchemaInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiPolicyInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiToolLabelInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiTopicInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ResourceSkuInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/SkuAvailabilityListResultInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/SkuResourceInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageListResultInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/WorkbenchInner.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/package-info.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/package-info.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountModelImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountSkuListResultImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentReferenceResourceArmPaginatedResultImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ApiKeysImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CalculateModelCapacityResultImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CapabilityHostImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientBuilder.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanAccountAssociationImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTierImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationStatusImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputesClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputesImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ConnectionPropertiesV2BasicResourceImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DomainAvailabilityImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopeImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopesClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopesImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EvaluateDeploymentPoliciesResponseImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/LocationBasedModelCapacitiesClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/LocationBasedModelCapacitiesImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeCapacitiesClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeCapacitiesImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeCapacityImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeDeploymentImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeDeploymentsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeDeploymentsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeUsageImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeUsagesOperationGroupsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeUsagesOperationGroupsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionStatusImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsBasicResourceImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsOperationsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsOperationsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsPropertiesBasicResourceImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacitiesClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacitiesImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacityListResultValueItemImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRuleBasicResourceImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesOperationsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesOperationsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionListResultImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourceListResultImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTierImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTiersClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTiersImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFilterImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFiltersClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFiltersImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProviderSchemaImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersOperationsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersOperationsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPoliciesClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPoliciesImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPolicyImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicsClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicsImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceManagerUtils.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkuImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkusClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkusImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SkuAvailabilityListResultImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SkuResourceImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SubscriptionRaiPoliciesClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SubscriptionRaiPoliciesImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/TestRaiExternalSafetyProvidersClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/TestRaiExternalSafetyProvidersImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageListResultImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/WorkbenchImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/WorkbenchesClientImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/WorkbenchesImpl.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AccountListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AccountModelListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AgentApplicationResourceArmPaginatedResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AgentDeploymentResourceArmPaginatedResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CapabilityHostResourceArmPaginatedResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentPlanAccountAssociationListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentPlanListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentTierListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ComputeListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DefenderForAISettingResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DeploymentListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DeploymentSkuListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/EncryptionScopeListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ManagedComputeCapacityListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ManagedComputeDeploymentListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ManagedComputeUsageListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ManagedNetworkListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ModelCapacityListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ModelListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/NetworkSecurityPerimeterConfigurationList.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/OperationListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/OutboundRuleListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ProjectCapabilityHostResourceArmPaginatedResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ProjectListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/QuotaTierListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiBlockListItemsResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiBlockListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiContentFilterListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiExternalSafetyProviderResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiPolicyListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiToolLabelResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiTopicResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ResourceSkuListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/WorkbenchListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/package-info.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AadAuthTypeConnectionProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenalty.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenaltyAction.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccessKeyAuthTypeConnectionProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Account.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountCapabilityHosts.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountConnections.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountKeyAuthTypeConnectionProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountModel.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountSku.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountSkuListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Accounts.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ActionType.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentApplication.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentApplications.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeployment.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentProvisioningState.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentState.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentType.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeployments.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentProtocol.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentProtocolVersion.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReference.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReferenceProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReferenceResourceArmPaginatedResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgenticApplicationProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgenticApplicationProvisioningState.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiKeyAuthConnectionProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiKeys.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApplicationAuthorizationPolicy.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApplicationTrafficRoutingPolicy.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AssignedIdentity.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/BillingMeterInfo.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/BuiltInAuthorizationScheme.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ByPassSelection.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityParameter.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityResultEstimatedCapacity.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CallRateLimit.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHost.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostKind.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProvisioningState.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapacityConfig.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ChannelsBuiltInAuthorizationPolicy.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CheckDomainAvailabilityParameter.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CheckSkuAvailabilityParameter.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ClusterComputeProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentCost.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPeriod.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlan.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAccountAssociation.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAssociation.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProvisioningState.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlans.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentQuota.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentTier.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentTiers.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Compute.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatus.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatusProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatusType.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperations.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeProvisioningState.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeType.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Computes.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccessKey.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccountKey.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionApiKey.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAuthType.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionCategory.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionGroup.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionManagedIdentity.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionOAuth2.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPersonalAccessToken.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2BasicResource.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionServicePrincipal.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionSharedAccessSignature.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUpdateContent.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUsernamePassword.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectivityEndpoints.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ContainerInstanceComputeProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ContentLevel.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomBlocklistConfig.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeys.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeysConnectionProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISetting.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISettingState.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISettings.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeletedAccounts.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployment.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentCapacitySettings.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModel.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModelVersionUpgradeOption.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentPolicyEvaluationResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProvisioningState.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentRouting.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentScaleSettings.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentScaleType.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentSizeCapacity.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentSpeculativeDecoding.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentState.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployments.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeprecationStatus.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DomainAvailability.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Encryption.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScope.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeProvisioningState.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeState.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopes.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EvaluateDeploymentPoliciesDeployment.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EvaluateDeploymentPoliciesDeploymentProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EvaluateDeploymentPoliciesRequest.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EvaluateDeploymentPoliciesResponse.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FirewallSku.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FoundryAutoUpgrade.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FoundryAutoUpgradeMode.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FqdnOutboundRule.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/HostedAgentDeployment.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/HostingModel.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Identity.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityKind.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityManagementType.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityProvisioningState.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IpRule.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IsolationMode.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeyName.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeySource.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeyVaultProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/LocationBasedModelCapacities.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedAgentDeployment.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeCapacities.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeCapacity.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeCapacityProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeployment.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeploymentInfo.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeploymentProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeploymentProvisioningDetails.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeploymentRoutes.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeployments.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeUsage.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeUsagesOperationGroups.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedIdentityAuthTypeConnectionProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkKind.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisionOptions.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisionStatus.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisioningState.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisions.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettings.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsBasicResource.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsEx.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsOperations.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsPropertiesBasicResource.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkStatus.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPERequirement.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPEStatus.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/MetricName.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Model.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacities.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityCalculatorWorkload.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityCalculatorWorkloadRequestParam.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityListResultValueItem.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelDeprecationInfo.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelLifecycleStatus.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelSku.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelSkuCapacityProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Models.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/MultiRegionSettings.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkInjection.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkRuleAction.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkRuleSet.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeter.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRule.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRuleProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfiguration.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurationAssociationInfo.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurationProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurations.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterProfileInfo.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NoneAuthTypeConnectionProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NspAccessRuleDirection.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OAuth2AuthTypeConnectionProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Operation.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OperationDisplay.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Operations.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OrganizationSharedBuiltInAuthorizationPolicy.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Origin.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRule.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRuleBasicResource.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRules.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRulesOperations.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatAuthTypeConnectionProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceSku.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTags.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTagsAndSku.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PolicyAssignmentEvaluationDetails.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PolicyEvaluationOutcome.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PolicyExpressionEvaluationDetails.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Pool.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpoint.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnection.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionProvisioningState.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnections.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointOutboundRule.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointOutboundRuleDestination.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointServiceConnectionStatus.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResource.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResourceListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResourceProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResources.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkServiceConnectionState.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Project.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHost.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHostProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHosts.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectConnections.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Projects.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningIssue.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningIssueProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningState.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PublicNetworkAccess.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaLimit.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaScopeType.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTier.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTierProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTierUpgradeEligibilityInfo.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTiers.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaUsageStatus.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiActionType.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklist.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistConfig.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItem.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItemBulkRequest.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItemProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItems.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklists.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilter.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilterProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilters.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressDefaultAction.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressHeaderOperation.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressHeaderTransform.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressHeaderValueRef.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressManagedIdentityRef.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressMode.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressPolicyConfig.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRewriteTarget.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRule.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRuleAction.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRuleActionType.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRuleMatch.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRuleType.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressScheme.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressSecretRef.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderSchema.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderSchemaProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviders.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProvidersOperations.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiMonitorConfig.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicies.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicy.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyContentFilter.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyContentSource.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyMode.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyType.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiSafetyProviderConfig.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabel.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelPropertiesAccountScope.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelPropertiesProjectScopesItem.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabels.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopic.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopicProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopics.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegenerateKeyParameters.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegionSetting.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ReplacementConfig.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RequestMatchPattern.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceBase.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceIdentityType.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceProviders.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSku.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionInfo.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictions.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionsReasonCode.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionsType.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkus.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoleBasedBuiltInAuthorizationPolicy.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoutingMethods.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoutingMode.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleAction.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleCategory.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleStatus.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleType.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SafetyProviderConfig.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SasAuthTypeConnectionProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ScenarioType.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServicePrincipalAuthTypeConnectionProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTagOutboundRule.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTagOutboundRuleDestination.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTier.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Sku.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuAvailability.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuAvailabilityListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuCapability.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuChangeInfo.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuResource.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuTier.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SshSettings.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SubscriptionRaiPolicies.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TestRaiExternalSafetyProviders.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ThrottlingRule.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TierUpgradePolicy.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TrafficRoutingProtocol.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TrafficRoutingRule.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UnitType.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UpgradeAvailabilityStatus.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usage.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsageListResult.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usages.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserAssignedIdentity.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedAmlWorkspace.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedStorage.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsernamePasswordAuthTypeConnectionProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/VersionedAgentReference.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/VirtualNetworkRule.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/VmPriority.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Workbench.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/WorkbenchProperties.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Workbenches.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/package-info.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/package-info.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/module-info.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cognitiveservices/proxy-config.json delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cognitiveservices/reflect-config.json delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/azure-resourcemanager-cognitiveservices.properties create mode 100644 sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationServiceVersion.java rename sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/{MessagesServiceVersion.java => MessageTemplateServiceVersion.java} (74%) create mode 100644 sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesServiceVersion.java create mode 100644 sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistServiceVersion.java create mode 100644 sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DeploymentEnvironmentsServiceVersion.java create mode 100644 sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DevBoxesServiceVersion.java create mode 100644 sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceAdministrationServiceVersion.java create mode 100644 sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridReceiverServiceVersion.java rename sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/{EventGridServiceVersion.java => EventGridSenderServiceVersion.java} (71%) delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/IotHubManager.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/CertificatesClient.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubClient.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubResourcesClient.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubsClient.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/OperationsClient.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/PrivateEndpointConnectionsClient.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/PrivateLinkResourcesOperationsClient.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/ResourceProviderCommonsClient.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateDescriptionInner.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateListDescriptionInner.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateWithNonceDescriptionInner.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/EndpointHealthDataInner.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/EventHubConsumerGroupInfoInner.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/GroupIdInformationInner.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubDescriptionInner.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubNameAvailabilityInfoInner.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubQuotaMetricInfoInner.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubSkuDescriptionInner.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/JobResponseInner.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/OperationInner.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/PrivateEndpointConnectionInner.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/PrivateLinkResourcesInner.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/RegistryStatisticsInner.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/SharedAccessSignatureAuthorizationRuleInner.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/TestAllRoutesResultInner.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/TestRouteResultInner.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/UserSubscriptionQuotaListResultInner.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/package-info.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/package-info.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateDescriptionImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateListDescriptionImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateWithNonceDescriptionImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesClientImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/EndpointHealthDataImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/EventHubConsumerGroupInfoImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/GroupIdInformationImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubClientBuilder.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubClientImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubDescriptionImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubNameAvailabilityInfoImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubQuotaMetricInfoImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesClientImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubSkuDescriptionImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubsClientImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubsImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/JobResponseImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationsClientImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationsImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsClientImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsClientImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/RegistryStatisticsImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceManagerUtils.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsClientImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/SharedAccessSignatureAuthorizationRuleImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/TestAllRoutesResultImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/TestRouteResultImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/UserSubscriptionQuotaListResultImpl.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/EndpointHealthDataListResult.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/EventHubConsumerGroupsListResult.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/IotHubDescriptionListResult.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/IotHubQuotaMetricInfoListResult.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/IotHubSkuDescriptionListResult.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/JobResponseListResult.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/OperationListResult.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/SharedAccessSignatureAuthorizationRuleListResult.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/package-info.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/AccessRights.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ArmIdentity.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ArmUserIdentity.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/AuthenticationType.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Capabilities.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateDescription.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateListDescription.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificatePropertiesWithNonce.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateVerificationDescription.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateWithNonceDescription.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Certificates.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CloudToDeviceProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/DefaultAction.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/DeviceRegistry.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EncryptionPropertiesDescription.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EndpointHealthData.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EndpointHealthStatus.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EnrichmentProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ErrorDetails.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ErrorDetailsException.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupBodyDescription.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupInfo.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupName.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ExportDevicesRequest.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FailoverInput.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FallbackRouteProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FeedbackProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/GroupIdInformation.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/GroupIdInformationProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ImportDevicesRequest.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubCapacity.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubDescription.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubLocationDescription.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubNameAvailabilityInfo.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubNameUnavailabilityReason.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubPropertiesDeviceStreams.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubQuotaMetricInfo.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubReplicaRoleType.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubResources.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubScaleType.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSku.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSkuDescription.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSkuInfo.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSkuTier.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubs.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IpFilterActionType.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IpFilterRule.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IpVersion.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/JobResponse.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/JobStatus.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/JobType.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/KeyVaultKeyProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ManagedIdentity.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/MatchedRoute.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/MessagingEndpointProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Name.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/NetworkRuleIpAction.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/NetworkRuleSetIpRule.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/NetworkRuleSetProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Operation.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/OperationDisplay.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/OperationInputs.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Operations.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpoint.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpointConnection.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpointConnectionProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpointConnections.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkResources.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkResourcesOperations.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkServiceConnectionState.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkServiceConnectionStatus.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PublicNetworkAccess.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RegistryStatistics.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ResourceIdentityType.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ResourceProviderCommons.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RootCertificateProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteCompilationError.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorPosition.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorRange.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorSeverity.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingCosmosDBSqlApiProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingEndpoints.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingEventHubProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingMessage.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingServiceBusQueueEndpointProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingServiceBusTopicEndpointProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingSource.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingStorageContainerProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingStorageContainerPropertiesEncoding.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwin.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwinProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/SharedAccessSignatureAuthorizationRule.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/StorageEndpointProperties.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TagsResource.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestAllRoutesInput.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestAllRoutesResult.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestResultStatus.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestRouteInput.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestRouteResult.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestRouteResultDetails.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/UserSubscriptionQuota.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/UserSubscriptionQuotaListResult.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/package-info.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/package-info.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/java/module-info.java delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-iothub/proxy-config.json delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-iothub/reflect-config.json delete mode 100644 sdk/iothub/azure-resourcemanager-iothub/src/main/resources/azure-resourcemanager-iothub.properties create mode 100644 sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationServiceVersion.java rename sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/{LoadTestingServiceVersion.java => LoadTestRunServiceVersion.java} (83%) delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/QuotaManager.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLimitsClient.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLimitsRequestsClient.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLocationSettingsClient.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionAllocationRequestsClient.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionAllocationsClient.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionRequestsClient.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionsClient.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaUsagesClient.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotasClient.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaManagementClient.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaOperationsClient.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaRequestStatusClient.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotasClient.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/UsagesClient.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/CurrentQuotaLimitBaseInner.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/CurrentUsagesBaseInner.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaDetailsName.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaLimitListInner.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaRequestBaseProperties.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaRequestBasePropertiesName.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaSubscriptionIdInner.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaSubscriptionRequestStatusInner.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaUsagesBaseName.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotasEnforcementStatusInner.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotasEntityInner.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/OperationResponseInner.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaAllocationRequestBaseProperties.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaAllocationRequestBasePropertiesName.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaAllocationRequestStatusInner.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaAllocationRequestStatusProperties.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaRequestDetailsInner.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaRequestProperties.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/ResourceUsagesInner.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/SubmittedResourceRequestStatusInner.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/SubscriptionQuotaAllocationsListInner.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/SubscriptionQuotaDetailsName.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/package-info.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/package-info.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/CurrentQuotaLimitBaseImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/CurrentUsagesBaseImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitListImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsClientImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsRequestsClientImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsRequestsImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLocationSettingsClientImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLocationSettingsImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationRequestsClientImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationRequestsImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationsClientImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationsImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionIdImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionRequestStatusImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionRequestsClientImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionRequestsImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionsClientImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionsImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaUsagesClientImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaUsagesImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasClientImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasEnforcementStatusImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasEntityImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/OperationResponseImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaAllocationRequestStatusImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaManagementClientBuilder.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaManagementClientImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaOperationsClientImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaOperationsImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaRequestDetailsImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaRequestStatusClientImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaRequestStatusImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotasClientImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotasImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/ResourceManagerUtils.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/ResourceUsagesImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/SubmittedResourceRequestStatusImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/SubscriptionQuotaAllocationsListImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/UsagesClientImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/UsagesImpl.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/GroupQuotaList.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/GroupQuotaSubscriptionIdList.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/GroupQuotaSubscriptionRequestStatusList.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/OperationList.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/QuotaAllocationRequestStatusList.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/QuotaLimits.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/QuotaRequestDetailsList.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/ResourceUsageList.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/SubmittedResourceRequestStatusList.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/UsagesLimits.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/package-info.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/AllocatedQuotaToSubscriptionList.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/AllocatedToSubscription.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/CurrentQuotaLimitBase.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/CurrentUsagesBase.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/EnforcementState.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaDetails.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimit.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitList.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitListProperties.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitProperties.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimits.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitsRequests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLocationSettings.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaRequestBase.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionAllocationRequests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionAllocations.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionId.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionIdProperties.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionRequestStatus.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionRequestStatusProperties.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionRequests.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptions.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaUsages.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaUsagesBase.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotas.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEnforcementStatus.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEnforcementStatusProperties.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntity.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityBase.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityBasePatch.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityPatch.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityPatchProperties.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityProperties.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupType.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitJsonObject.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitObject.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitType.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/OperationDisplay.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/OperationResponse.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaAllocationRequestBase.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaAllocationRequestStatus.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaLimitTypes.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaOperations.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaProperties.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestDetails.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestState.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestStatus.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/Quotas.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasGetHeaders.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasGetResponse.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/RequestState.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ResourceName.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ResourceUsages.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ServiceErrorDetail.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubRequest.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubmittedResourceRequestStatus.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubmittedResourceRequestStatusProperties.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocations.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsList.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsListProperties.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsProperties.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaDetails.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/Usages.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesGetHeaders.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesGetResponse.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesObject.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesProperties.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesTypes.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/package-info.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/package-info.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/java/module-info.java delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-quota/proxy-config.json delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-quota/reflect-config.json delete mode 100644 sdk/quota/azure-resourcemanager-quota/src/main/resources/azure-resourcemanager-quota.properties delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/RecoveryServicesBackupManager.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupEnginesClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupJobsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupOperationResultsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupOperationStatusesClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupPoliciesClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectableItemsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectedItemsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectionContainersClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectionIntentsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceEncryptionConfigsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceStorageConfigsNonCrrsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceVaultConfigsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupStatusClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupUsageSummariesClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupWorkloadItemsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BmsPrepareDataMoveOperationResultsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/DeletedProtectionContainersClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ExportJobsOperationResultsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/FeatureSupportsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/FetchTieringCostsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/GetTieringCostOperationResultsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ItemLevelRecoveryConnectionsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobCancellationsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobDetailsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobOperationResultsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationOperationsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/PrivateEndpointConnectionsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/PrivateEndpointsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectableContainersClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemOperationResultsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemOperationStatusesClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionContainerOperationResultsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionContainerRefreshOperationResultsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionContainersClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionIntentsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPoliciesClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPolicyOperationResultsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPolicyOperationStatusesClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsRecommendedForMovesClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryServicesBackupManagementClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceGuardProxyOperationsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceProvidersClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RestoresClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/SecurityPINsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/TieringCostOperationStatusClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ValidateOperationResultsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ValidateOperationStatusesClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ValidateOperationsClient.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/AzureVMResourceFeatureSupportResponseInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupEngineBaseResourceInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupManagementUsageInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceConfigResourceInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceEncryptionConfigExtendedResourceInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceVaultConfigResourceInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupStatusResponseInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ClientDiscoveryValueForSingleApiInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/JobResourceInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationResultInfoBaseResourceInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationStatusInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PreValidateEnableBackupResponseInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PrivateEndpointConnectionResourceInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectableContainerResourceInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectedItemResourceInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionContainerResourceInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionIntentResourceInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionPolicyResourceInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/RecoveryPointResourceInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ResourceGuardProxyBaseResourceInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/TieringCostInfoInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/TokenInformationInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/UnlockDeleteResponseInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ValidateOperationsResponseInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/VaultStorageConfigOperationResultResponseInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadItemResourceInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadProtectableItemResourceInner.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/package-info.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/package-info.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AzureVMResourceFeatureSupportResponseImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEngineBaseResourceImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupManagementUsageImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationResultsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationResultsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationStatusesClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationStatusesImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceConfigResourceImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigExtendedResourceImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsNonCrrsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsNonCrrsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigResourceImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusResponseImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BmsPrepareDataMoveOperationResultsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BmsPrepareDataMoveOperationResultsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ClientDiscoveryValueForSingleApiImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/DeletedProtectionContainersClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/DeletedProtectionContainersImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ExportJobsOperationResultsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ExportJobsOperationResultsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FeatureSupportsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FeatureSupportsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FetchTieringCostsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FetchTieringCostsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/GetTieringCostOperationResultsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/GetTieringCostOperationResultsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ItemLevelRecoveryConnectionsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ItemLevelRecoveryConnectionsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobCancellationsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobCancellationsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobOperationResultsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobOperationResultsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobResourceImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationOperationsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationOperationsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationResultInfoBaseResourceImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationStatusImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PreValidateEnableBackupResponseImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionResourceImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainerResourceImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemResourceImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerOperationResultsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerOperationResultsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerRefreshOperationResultsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerRefreshOperationResultsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerResourceImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainersClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainersImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentResourceImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPoliciesClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPoliciesImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationResultsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationResultsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationStatusesClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationStatusesImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyResourceImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointResourceImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupManagementClientBuilder.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupManagementClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyBaseResourceImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyOperationsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyOperationsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceManagerUtils.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceProvidersClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceProvidersImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/TieringCostInfoImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/TieringCostOperationStatusClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/TieringCostOperationStatusImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/TokenInformationImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/UnlockDeleteResponseImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationResultsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationResultsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationStatusesClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationStatusesImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationsClientImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationsImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationsResponseImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/VaultStorageConfigOperationResultResponseImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/WorkloadItemResourceImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/WorkloadProtectableItemResourceImpl.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/BackupEngineBaseResourceList.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/BackupManagementUsageList.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ClientDiscoveryResponse.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/JobResourceList.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ProtectableContainerResourceList.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ProtectedItemResourceList.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ProtectionContainerResourceList.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ProtectionIntentResourceList.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ProtectionPolicyResourceList.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/RecoveryPointResourceList.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ResourceGuardProxyBaseResourceList.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/WorkloadItemResourceList.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/WorkloadProtectableItemResourceList.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/package-info.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AcquireStorageAccountLock.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupGoalFeatureSupportRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerContainer.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerEngine.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareBackupRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectableItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectionPolicy.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProvisionIlrRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRecoveryPoint.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRestoreRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItemExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMContainer.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectableItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectedItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMContainer.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectableItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectedItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmErrorInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmHealthDetails.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJob.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobTaskDetails.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobV2.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItemExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectionPolicy.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureRecoveryServiceVaultProtectionIntent.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureResourceProtectionIntent.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlContainer.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItemExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectionPolicy.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlagWorkloadContainerProtectionContainer.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageContainer.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageErrorInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJob.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobTaskDetails.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageProtectableContainer.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectableContainer.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectionContainer.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMResourceFeatureSupportRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMResourceFeatureSupportResponse.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectableItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItemExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectionPolicy.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSAPHanaScaleoutProtectableItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSQLInstanceProtectedItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseProtectableItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseProtectedItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseWorkloadItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemProtectableItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemWorkloadItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDBInstance.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDBInstanceProtectedItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectableItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectedItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseWorkloadItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaHsr.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemProtectableItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemWorkloadItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlAvailabilityGroupProtectableItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectableItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectedItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseWorkloadItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceProtectableItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceWorkloadItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAutoProtectionIntent.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadBackupRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainer.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainerAutoProtectionIntent.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainerExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadErrorInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJob.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobTaskDetails.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRecoveryPoint.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRestoreRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPoint.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRestoreRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapAsePointInTimeRecoveryPoint.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapAsePointInTimeRestoreRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapAseRecoveryPoint.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapAseRestoreRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRecoveryPoint.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRecoveryPoint.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreWithRehydrateRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlAutoProtectionIntent.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRecoveryPoint.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPoint.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPointExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreWithRehydrateRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineBase.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineBaseResource.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngines.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupItemType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupJobs.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupManagementType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupManagementUsage.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupOperationResults.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupOperationStatuses.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupPolicies.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectableItems.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectedItems.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectionContainers.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectionIntents.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupRequestResource.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceConfig.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceConfigResource.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfig.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigExtended.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigExtendedResource.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigResource.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigs.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceStorageConfigsNonCrrs.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfig.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfigResource.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfigs.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupStatus.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupStatusRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupStatusResponse.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupUsageSummaries.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupWorkloadItems.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Backups.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BekDetails.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BmsPrepareDataMoveOperationResults.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryDisplay.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryForLogSpecification.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryForProperties.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryForServiceSpecification.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryValueForSingleApi.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientScriptForConnect.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ContainerIdentityInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CopyOptions.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CreateMode.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DailyRetentionFormat.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DailyRetentionSchedule.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DailySchedule.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DataMoveLevel.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DataSourceType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DatabaseInRP.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Day.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DayOfWeek.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DedupState.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DeletedProtectionContainers.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DiskExclusionProperties.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DiskInformation.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DistributedNodesInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmBackupEngine.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmContainer.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmContainerExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmErrorInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJob.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJobExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJobTaskDetails.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItemExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/EncryptionAtRestType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/EncryptionDetails.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/EnhancedSecurityState.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ErrorDetail.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExportJobsOperationResultInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExportJobsOperationResults.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExtendedLocation.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExtendedProperties.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FabricName.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FeatureSupportRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FeatureSupports.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCostInfoForRehydrationRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCostInfoRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCostSavingsInfoForPolicyRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCostSavingsInfoForProtectedItemRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCostSavingsInfoForVaultRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCosts.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericContainer.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericContainerExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectedItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectionPolicy.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericRecoveryPoint.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GetTieringCostOperationResults.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HealthStatus.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HourlySchedule.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HttpStatusCode.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaaSvmContainer.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMBackupRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRecoveryPoint.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreWithRehydrationRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMSnapshotConsistencyType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVmProtectableItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVmilrRegistrationRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasvmPolicyType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IdentityBasedRestoreDetails.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IdentityInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IlrRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IlrRequestResource.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InfrastructureEncryptionState.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InquiryInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InquiryStatus.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InquiryValidation.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InstanceProtectionReadiness.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InstantItemRecoveryTarget.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InstantRPAdditionalDetails.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ItemLevelRecoveryConnections.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Job.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobCancellations.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobDetails.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobOperationResults.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobResource.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobSupportedAction.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Jobs.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/KekDetails.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/KeyAndSecretDetails.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/KpiResourceHealthDetails.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LastBackupStatus.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LastUpdateStatus.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ListRecoveryPointsRecommendedForMoveRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LogSchedulePolicy.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LongTermRetentionPolicy.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LongTermSchedulePolicy.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabContainer.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabContainerExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabContainerHealthDetails.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabErrorInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabFileFolderProtectedItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabFileFolderProtectedItemExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJob.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJobExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJobTaskDetails.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabProtectionPolicy.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabServerType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MonthOfYear.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MonthlyRetentionSchedule.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MoveRPAcrossTiersRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/NameInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationOperations.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationResultInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationResultInfoBase.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationResultInfoBaseResource.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatus.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusError.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusJobExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusJobsExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusProvisionIlrExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusValidateOperationExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusValues.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationWorkerResponse.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Operations.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OverwriteOptions.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PatchRecoveryPointInput.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PatchRecoveryPointPropertiesInput.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PointInTimeRange.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PolicyType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PreBackupValidation.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PreValidateEnableBackupRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PreValidateEnableBackupResponse.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrepareDataMoveRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrepareDataMoveResponse.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpoint.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnection.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnectionResource.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnectionStatus.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnections.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpoints.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateLinkServiceConnectionState.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainer.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainerResource.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainerType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainers.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemHealthStatus.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemOperationResults.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemOperationStatuses.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemResource.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemState.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItems.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainer.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerOperationResults.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerRefreshOperationResults.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerResource.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainers.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntent.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntentItemType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntentResource.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntents.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionLevel.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicies.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicy.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyOperationResults.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyOperationStatuses.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyResource.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionState.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionStatus.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProvisioningState.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryMode.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoint.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointDiskConfiguration.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointMoveReadinessInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointProperties.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointRehydrationInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointResource.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierInformation.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierInformationV2.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierStatus.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoints.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointsRecommendedForMoves.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RehydrationPriority.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardOperationDetail.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyBase.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyBaseResource.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyOperations.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceHealthDetails.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceHealthStatus.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceList.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceProviders.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreFileSpecs.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestorePointType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequestResource.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequestType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Restores.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionDuration.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionDurationType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionPolicy.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionScheduleFormat.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SchedulePolicy.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ScheduleRunType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecuredVMDetails.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecurityPINs.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecurityPinBase.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Settings.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SimpleRetentionPolicy.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SimpleSchedulePolicy.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SimpleSchedulePolicyV2.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SnapshotBackupAdditionalDetails.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SnapshotRestoreParameters.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SoftDeleteFeatureState.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SourceSideScanInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SourceSideScanStatus.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SourceSideScanSummary.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SqlDataDirectory.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SqlDataDirectoryMapping.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SqlDataDirectoryType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/StorageType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/StorageTypeState.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SubProtectionPolicy.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SupportStatus.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetAfsRestoreInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetDiskNetworkAccessOption.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetDiskNetworkAccessSettings.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetRestoreInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ThreatInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ThreatSeverity.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ThreatState.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ThreatStatus.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringCostInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringCostOperationStatus.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringCostRehydrationInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringCostSavingInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringMode.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringPolicy.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TokenInformation.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TriggerDataMoveRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UnlockDeleteRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UnlockDeleteResponse.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UpdateRecoveryPointRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UsagesUnit.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UserAssignedIdentityProperties.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UserAssignedManagedIdentityDetails.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VMWorkloadPolicyType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateIaasVMRestoreOperationRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationRequestResource.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationResponse.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationResults.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationStatuses.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperations.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationsResponse.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateRestoreOperationRequest.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidationStatus.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJob.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJobErrorInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJobExtendedInfo.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultRetentionPolicy.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultStorageConfigOperationResultResponse.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultSubResourceType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeekOfMonth.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeeklyRetentionFormat.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeeklyRetentionSchedule.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeeklySchedule.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadInquiryDetails.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItemResource.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItemType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadProtectableItem.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadProtectableItemResource.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadType.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/XcoolState.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/YearlyRetentionSchedule.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/package-info.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/package-info.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/module-info.java delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicesbackup/proxy-config.json delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicesbackup/reflect-config.json delete mode 100644 sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/resources/azure-resourcemanager-recoveryservicesbackup.properties create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/KnowledgeBaseRetrievalServiceVersion.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchIndexServiceVersion.java create mode 100644 sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchIndexerServiceVersion.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdvancedThreatProtectionsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsSuppressionRulesClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AllowedConnectionsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApplicationsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsMetadatasClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssignmentsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AutoProvisioningSettingsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AutomationsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsOrgsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsProjectsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsReposClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ComplianceResultsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CompliancesClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomRecommendationsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DefenderForStoragesClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsConfigurationsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsOperationResultsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DeviceSecurityGroupsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DiscoveredSecuritySolutionsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ExternalSecuritySolutionsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubIssuesClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubOwnersClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubReposClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabGroupsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabProjectsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabSubgroupsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceAssignmentsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceRulesClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/InformationProtectionPoliciesClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionAnalyticsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionsAnalyticsAggregatedAlertsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionsAnalyticsRecommendationsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/JitNetworkAccessPoliciesClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/LocationsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/MdeOnboardingsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationResultsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationStatusesClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/PricingsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/PrivateEndpointConnectionsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/PrivateLinkResourcesClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/PrivateLinksClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceAssessmentsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceControlsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceStandardsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecureScoreControlDefinitionsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecureScoreControlsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecureScoresClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorApplicationsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityContactsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityOperatorsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecuritySolutionsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecuritySolutionsReferenceDatasClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityStandardsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SensitivitySettingsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ServerVulnerabilityAssessmentsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ServerVulnerabilityAssessmentsSettingsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SettingsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentBaselineRulesClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentScanResultsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentScansClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentSettingsOperationsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/StandardAssignmentsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/StandardsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SubAssessmentsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TasksClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TopologiesClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/WorkspaceSettingsClient.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdvancedThreatProtectionProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdvancedThreatProtectionSettingInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertSyncSettingProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApplicationInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApplicationProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AscLocationInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AssignmentInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AssignmentProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationValidationStatusInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgListResponseInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsProjectInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsRepositoryInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceResultInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceResultProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomRecommendationInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomRecommendationProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DataExportSettingProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DefenderForStorageSettingInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DevOpsConfigurationInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ExternalSecuritySolutionInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsListResponseInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsResponseInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerListResponseInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubRepositoryInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupListResponseInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabProjectInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelListInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionModelInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessPolicyInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessPolicyProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessRequestInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MalwareScanInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataListInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationResultInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationStatusResultInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingListInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateEndpointConnectionInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateEndpointConnectionProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateLinkGroupResourceInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateLinkProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateLinkResourceInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateLinkResourceProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RuleResultsInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RulesResultsInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanResultInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanV2Inner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScoreDetails.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDefinitionItemInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDefinitionItemProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDetailsInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlScoreDetailsInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreItemInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreItemProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataPropertiesResponse.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataResponseInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentPropertiesResponse.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentResponseInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityOperatorInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionsReferenceDataListInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionsReferenceDataProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityStandardInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityStandardProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsAzureSettingProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsListInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsSettingInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SettingInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SqlVulnerabilityAssessmentScanOperationResultInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SqlVulnerabilityAssessmentSettingsInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/StandardAssignmentInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/StandardAssignmentProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/StandardInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/StandardProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/TopologyResourceInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/TopologyResourceProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/UpdateIoTSecuritySolutionProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingInner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/package-info.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/package-info.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdvancedThreatProtectionSettingImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdvancedThreatProtectionsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdvancedThreatProtectionsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRuleImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRulesClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRulesImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsResourceImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AscLocationImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssignmentImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssignmentsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssignmentsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationValidationStatusImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgListResponseImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsRepositoryImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceResultImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceResultsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceResultsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CompliancesClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CompliancesImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomRecommendationImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomRecommendationsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomRecommendationsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStorageSettingImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExternalSecuritySolutionImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExternalSecuritySolutionsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExternalSecuritySolutionsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsListResponseImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsResponseImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubIssuesClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubIssuesImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerListResponseImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubRepositoryImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupListResponseImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRuleImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPoliciesClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPoliciesImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPolicyImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecurityAggregatedAlertImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecurityAggregatedRecommendationImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionAnalyticsModelImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionAnalyticsModelListImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionModelImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionAnalyticsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionAnalyticsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsAggregatedAlertsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsRecommendationsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsRecommendationsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPoliciesClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPoliciesImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPolicyImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessRequestImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/LocationsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/LocationsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MalwareScanImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataListImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationStatusResultImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationStatusesClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationStatusesImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingListImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateEndpointConnectionImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateEndpointConnectionsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateEndpointConnectionsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinkGroupResourceImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinkResourceImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinkResourcesClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinkResourcesImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinksClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinksImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceManagerUtils.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RuleResultsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RulesResultsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanResultImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanV2Impl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDefinitionItemImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDefinitionsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDefinitionsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDetailsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlScoreDetailsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreItemImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoresClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoresImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentMetadataResponseImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentResponseImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterBuilder.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsReferenceDataListImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsReferenceDatasClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsReferenceDatasImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityStandardImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityStandardsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityStandardsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySubAssessmentImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityTaskImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsListImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanOperationResultImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentSettingsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentSettingsOperationsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentSettingsOperationsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardAssignmentImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardAssignmentsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardAssignmentsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubAssessmentsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubAssessmentsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TasksClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TasksImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologyResourceImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsClientImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsImpl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AlertList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AlertsSuppressionRulesList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AllowedConnectionsList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ApiCollectionList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ApplicationsList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AscLocationList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AssignmentList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AutoProvisioningSettingList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AutomationList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AzureDevOpsProjectListResponse.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AzureDevOpsRepositoryListResponse.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ComplianceList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ComplianceResultList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/CustomRecommendationsList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/DefenderForStorageSettingList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/DevOpsConfigurationListResponse.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/DeviceSecurityGroupList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/DiscoveredSecuritySolutionList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ExternalSecuritySolutionList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/GitHubRepositoryListResponse.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/GitLabProjectListResponse.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/GovernanceAssignmentsList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/GovernanceRuleList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/HealthReportsList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/InformationProtectionPolicyList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/IoTSecurityAggregatedAlertList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/IoTSecurityAggregatedRecommendationList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/IoTSecuritySolutionsList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/JitNetworkAccessPoliciesList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/OperationListResult.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/PrivateEndpointConnectionListResult.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/PrivateLinkGroupResourceListResult.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/PrivateLinksList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/RegulatoryComplianceAssessmentList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/RegulatoryComplianceControlList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/RegulatoryComplianceStandardList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ScanResults.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ScansV2.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecureScoreControlDefinitionList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecureScoreControlList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecureScoresList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityAssessmentList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityAssessmentMetadataResponseList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityConnectorsList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityContactList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityOperatorList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecuritySolutionList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityStandardList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecuritySubAssessmentList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityTaskList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ServerVulnerabilityAssessmentsSettingsList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SettingsList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/StandardAssignmentsList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/StandardList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/TopologyList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/WorkspaceSettingList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/package-info.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityState.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadExternalSecuritySolution.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadSolutionProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AccessTokenAuthentication.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediation.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediationState.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalData.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspaceDataType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspaceType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspacesProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdvancedThreatProtectionSetting.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdvancedThreatProtections.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AgentlessConfiguration.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AgentlessEnablement.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alert.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertEntity.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertPropertiesSupportingEvidence.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSeverity.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSimulatorBundlesRequestProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSimulatorRequestBody.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSimulatorRequestProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertStatus.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSyncSettings.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alerts.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRule.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRules.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnections.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnectionsResource.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowlistCustomAlertRule.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AnnotateDefaultBranchState.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollection.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollections.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Application.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationSourceResourceType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Applications.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioning.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioningAws.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioningConfiguration.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioningGcp.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArmActionType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AscLocation.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessedResourceType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentLinks.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatus.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatusCode.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatusResponse.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Assessments.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentsMetadatas.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssignedAssessmentItem.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssignedComponentItem.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssignedStandardItem.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Assignment.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssignmentPropertiesAdditionalData.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Assignments.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AtaExternalSecuritySolution.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AtaSolutionProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AttestationComplianceState.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AttestationEvidence.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Authentication.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Authorization.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoDiscovery.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvision.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSetting.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSettings.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomatedResponseType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automation.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationAction.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionEventHub.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionLogicApp.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionWorkspace.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationRuleSet.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationScope.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationSource.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationTriggeringRule.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationUpdateModel.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationValidationStatus.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automations.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsEnvironmentData.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalData.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalDataMaster.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalDataMember.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrg.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgListResponse.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgs.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProject.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjects.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepos.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepository.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsScopeEnvironmentData.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureResourceDetails.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureResourceIdentifier.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureResourceLink.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureServersSetting.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Baseline.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BaselineAdjustedResult.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BenchmarkReference.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BlobScanResultsOptions.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BlobsScanSummary.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BuiltInInfoType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BundleType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Categories.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CategoryConfiguration.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CefExternalSecuritySolution.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CefSolutionProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudName.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudOffering.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Compliance.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceResult.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceResults.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceSegment.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Compliances.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectableResource.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectedResource.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectedWorkspace.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ContainerRegistryVulnerabilityProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ControlType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOffering.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOfferingNativeCloudConnection.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAzureDevOpsOffering.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorDockerHubOffering.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGcpOffering.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGcpOfferingNativeCloudConnection.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGitLabOffering.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGithubOffering.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorJFrogOffering.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAlertRule.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomRecommendation.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomRecommendations.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Cve.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Cvss.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataExportSettings.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataSource.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOffering.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiem.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemDiscovery.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemOidc.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingDataSensitivityDiscovery.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingDatabasesDspm.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersImageAssessment.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingVmScanners.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmDockerHubOffering.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOffering.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingCiemDiscovery.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingDataSensitivityDiscovery.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersImageAssessment.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingVmScanners.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmJFrogOffering.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmJFrogOfferingMdcContainersImageAssessment.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOffering.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingArcAutoProvisioning.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingDatabasesDspm.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingRds.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOffering.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingCloudWatchToKinesis.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKinesisToS3.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesDataCollection.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesService.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersImageAssessment.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingVmScanners.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersDockerHubOffering.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOffering.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersImageAssessment.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingNativeCloudConnection.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingVmScanners.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersJFrogOffering.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOffering.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingArcAutoProvisioning.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOffering.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioning.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingDefenderForServers.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingMdeAutoProvisioning.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingSubPlan.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVaAutoProvisioning.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVaAutoProvisioningConfiguration.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVmScanners.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOffering.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingArcAutoProvisioning.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingDefenderForServers.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingMdeAutoProvisioning.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingSubPlan.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVaAutoProvisioning.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVaAutoProvisioningConfiguration.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVmScanners.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorageSetting.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorageSettingProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorages.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DenylistCustomAlertRule.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsCapability.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfiguration.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurations.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsOperationResults.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsProvisioningState.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroup.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroups.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolution.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolutions.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DockerHubEnvironmentData.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Effect.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Enforce.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentData.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentDetails.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EventSource.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExecuteGovernanceRuleParams.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExemptionCategory.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExpandControlsEnum.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExpandEnum.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExportData.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Extension.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolution.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKind.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutions.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FilesScanSummary.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalData.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalDataMember.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalDataOrganization.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectDetails.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectEnvironmentData.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsListResponse.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponse.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponseProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponsePropertiesMipInformation.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubIssues.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubOwner.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubOwnerListResponse.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubOwnerProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubOwners.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepos.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepository.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitHubRepositoryProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroup.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroupListResponse.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroupProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabGroups.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProject.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProjectProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabProjects.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitLabSubgroups.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GithubScopeEnvironmentData.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitlabScopeEnvironmentData.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignment.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignmentAdditionalData.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignments.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceEmailNotification.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRule.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleEmailNotification.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleMetadata.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleOwnerSource.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleOwnerSourceType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleSourceResourceType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRules.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRulesOperationResultsHeaders.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRulesOperationResultsResponse.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthDataClassification.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReport.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReportResourceDetails.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReportStatus.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReports.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Identity.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ImplementationEffort.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InfoType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionKeyword.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionPolicies.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionPolicy.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionPolicyName.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InheritFromParentState.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Inherited.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Intent.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InventoryKind.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InventoryList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InventoryListKind.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedAlert.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedAlertPropertiesTopDevicesListItem.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedRecommendation.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAlertedDevice.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityDeviceAlert.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityDeviceRecommendation.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionAnalyticsModel.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionAnalyticsModelList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionModel.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSeverityMetrics.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSecuritySolutionAnalytics.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSecuritySolutions.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSecuritySolutionsAnalyticsAggregatedAlerts.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSecuritySolutionsAnalyticsRecommendations.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IsEnabled.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Issue.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IssueCreationRequest.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JFrogEnvironmentData.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicies.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicy.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicyInitiatePort.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicyInitiateRequest.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicyInitiateVirtualMachine.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicyVirtualMachine.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPortRule.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessRequest.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessRequestPort.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessRequestVirtualMachine.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Kind.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Label.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ListCustomAlertRule.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Locations.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/LogAnalyticsIdentifier.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MalwareScan.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MalwareScanProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MalwareScanningProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardingData.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardingDataList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardings.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MinimalRiskLevel.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MinimalSeverity.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MipIntegrationStatus.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/NotificationsSource.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/NotificationsSourceAlert.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/NotificationsSourceAttackPath.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OfferingType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseResourceDetails.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseSqlResourceDetails.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnUploadFilters.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnUploadProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnboardingState.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operation.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationDisplay.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationResult.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationResultStatus.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationResults.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationResultsGetHeaders.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationResultsGetResponse.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationStatus.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationStatusResult.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationStatuses.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operations.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operator.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OrganizationMembershipType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Origin.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PartialAssessmentProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Pricing.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PricingList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PricingTier.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Pricings.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PrivateEndpoint.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PrivateEndpointConnection.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PrivateEndpointConnectionProvisioningState.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PrivateEndpointConnections.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PrivateEndpointServiceConnectionStatus.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PrivateLinkGroupResource.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PrivateLinkResource.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PrivateLinkResources.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PrivateLinkServiceConnectionState.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PrivateLinkUpdate.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PrivateLinks.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PropertyType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Protocol.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProvisioningState.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PublicNetworkAccess.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/QueryCheck.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Rank.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationConfigStatus.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationConfigurationProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationSupportedClouds.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceAssessment.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceAssessments.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceControl.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceControls.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceStandard.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceStandards.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Remediation.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RemediationEta.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ReportedSeverity.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceDetails.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceIdentifier.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceIdentifierType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceIdentityType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceStatus.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourcesCoverageStatus.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RiskLevel.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleCategory.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleResults.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleResultsInput.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleResultsProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleSeverity.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleState.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleStatus.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RulesResults.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RulesResultsInput.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanOperationStatus.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanPropertiesV2.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanResult.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanResultProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanState.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanSummary.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanTriggerType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanV2.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanningMode.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScopeElement.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlDefinitionItem.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlDefinitionSource.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlDefinitions.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlDetails.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlScoreDetails.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControls.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreItem.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScores.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessment.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataPartnerData.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataPropertiesResponsePublishDates.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponse.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPartnerData.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPropertiesBase.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPropertiesBaseRisk.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPropertiesBaseRiskPathsItem.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPropertiesBaseRiskPathsItemEdge.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPropertiesBaseRiskPathsPropertiesItemsItem.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentResponse.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnector.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorApplications.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectors.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContact.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContactName.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContactPropertiesNotificationsByRole.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContactRole.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContacts.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityFamily.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityIssue.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityOperator.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityOperators.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolution.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionStatus.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutions.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionsReferenceData.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionsReferenceDataList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionsReferenceDatas.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityStandard.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityStandards.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySubAssessment.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityTask.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityTaskParameters.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensitiveDataDiscoveryProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensitivityLabel.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensitivitySettings.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessment.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentPropertiesProvisioningState.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessments.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsAzureSettingSelectedProvider.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsList.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSetting.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettingKind.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettingKindName.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettingProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettings.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Setting.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingKind.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingName.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Settings.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Severity.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SeverityEnum.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Source.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SourceType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SqlServerVulnerabilityProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SqlVulnerabilityAssessmentBaselineRules.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SqlVulnerabilityAssessmentScanOperationResult.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SqlVulnerabilityAssessmentScanOperationResultProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SqlVulnerabilityAssessmentScanResults.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SqlVulnerabilityAssessmentScans.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SqlVulnerabilityAssessmentSettings.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SqlVulnerabilityAssessmentSettingsOperations.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SqlVulnerabilityAssessmentSettingsProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SqlVulnerabilityAssessmentState.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Standard.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StandardAssignment.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StandardAssignmentMetadata.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StandardAssignmentPropertiesAttestationData.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StandardAssignmentPropertiesExemptionData.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StandardAssignments.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StandardComponentProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StandardMetadata.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StandardSupportedCloud.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StandardSupportedClouds.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StandardType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Standards.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/State.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Status.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusName.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusReason.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubAssessmentStatus.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubAssessmentStatusCode.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubAssessments.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubPlan.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SuppressionAlertsScope.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tactics.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tags.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TagsResource.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TargetBranchConfiguration.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TaskUpdateActionType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tasks.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Techniques.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Threats.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ThresholdCustomAlertRule.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TimeWindowCustomAlertRule.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Topologies.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologyResource.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologySingleResource.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologySingleResourceChild.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologySingleResourceParent.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Type.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UnmaskedIpLoggingStatus.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UpdateIotSecuritySolutionData.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UpdateSensitivitySettingsRequest.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UserDefinedResourcesProperties.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UserImpact.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/VaRule.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ValueType.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/VendorReference.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/VmScannersAws.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/VmScannersBase.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/VmScannersBaseConfiguration.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/VmScannersGcp.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/WorkspaceSetting.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/WorkspaceSettings.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/package-info.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/package-info.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/java/module-info.java delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-security/proxy-config.json delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-security/reflect-config.json delete mode 100644 sdk/security/azure-resourcemanager-security/src/main/resources/azure-resourcemanager-security.properties delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/AdvancedPlatformMetricsClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/BlobContainersClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/BlobInventoryPoliciesClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/BlobServicesClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/ConnectorsClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/DataSharesClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/DeletedAccountsClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/EncryptionScopesClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/FileServicesClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/FileSharesClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/LocalUsersOperationsClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/ManagementPoliciesClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/NetworkSecurityPerimeterConfigurationsClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/ObjectReplicationPoliciesOperationsClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/OperationsClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/PrivateEndpointConnectionsClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/PrivateLinkResourcesClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/QueueServicesClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/QueuesClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/SkusClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/StorageAccountsClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/StorageManagementClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/StorageTaskAssignmentInstancesReportsClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/StorageTaskAssignmentsClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/StorageTaskAssignmentsInstancesReportsClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/TableServicesClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/TablesClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/UsagesClient.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/AdvancedPlatformMetricsRuleInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobContainerInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobInventoryPolicyInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobInventoryPolicyProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobRestoreStatusInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobServicePropertiesInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/BlobServicePropertiesProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/CheckNameAvailabilityResultInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ConnectorInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ContainerProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/DataShareInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/DeletedAccountInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/DeletedAccountProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/EncryptionScopeInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/EncryptionScopeProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServiceItemsInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServicePropertiesInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServicePropertiesProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileServiceUsageInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareItemInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/FileShareProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ImmutabilityPolicyInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ImmutabilityPolicyProperty.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LeaseContainerResponseInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LeaseShareResponseInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LegalHoldInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListAccountSasResponseInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListContainerItemInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListQueueServicesInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListServiceSasResponseInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ListTableServicesInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LocalUserInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LocalUserKeysInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LocalUserProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/LocalUserRegeneratePasswordResultInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ManagementPolicyInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ManagementPolicyProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/NetworkSecurityPerimeterConfigurationInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/NetworkSecurityPerimeterConfigurationProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ObjectReplicationPolicyInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/ObjectReplicationPolicyProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/OperationInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/OperationProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateEndpointConnectionInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateEndpointConnectionProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateLinkResourceListResultInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/PrivateLinkResourceProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueServicePropertiesInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/QueueServicePropertiesProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/SkuInformationInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountListKeysResultInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountMigrationInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountMigrationProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesCreateParameters.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageAccountPropertiesUpdateParameters.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageQueueInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageTaskAssignmentInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/StorageTaskReportInstanceInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableServicePropertiesInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TableServicePropertiesProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/TestConnectionResponseInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/UsageInner.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/package-info.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/package-info.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/AdvancedPlatformMetricsClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobContainersClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobInventoryPoliciesClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/BlobServicesClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/ConnectorsClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/DataSharesClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/DeletedAccountsClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/EncryptionScopesClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/FileServicesClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/FileSharesClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/LocalUsersOperationsClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/ManagementPoliciesClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/ObjectReplicationPoliciesOperationsClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/OperationsClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/PrivateEndpointConnectionsClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/PrivateLinkResourcesClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/QueueServicesClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/QueuesClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/SkusClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageAccountsClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageManagementClientBuilder.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageManagementClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageTaskAssignmentInstancesReportsClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageTaskAssignmentsClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageTaskAssignmentsInstancesReportsClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/TableServicesClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/TablesClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/UsagesClientImpl.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/AdvancedPlatformMetricsRuleListResult.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/BlobServiceItems.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/ConnectorListResult.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/DataShareListResult.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/DeletedAccountListResult.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/EncryptionScopeListResult.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/FileServiceUsages.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/FileShareItems.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/ListBlobInventoryPolicy.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/ListContainerItems.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/ListQueueResource.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/ListTableResource.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/LocalUsers.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/NetworkSecurityPerimeterConfigurationList.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/ObjectReplicationPolicies.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/OperationListResult.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/PrivateEndpointConnectionListResult.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/StorageAccountListResult.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/StorageSkuListResult.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/StorageTaskAssignmentsList.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/StorageTaskReportSummary.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/models/UsageListResult.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccessPolicy.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccessTier.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountImmutabilityPolicyProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountImmutabilityPolicyState.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountLimits.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountSasParameters.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountStatus.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountUsage.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AccountUsageElements.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Action.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ActiveDirectoryProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ActiveDirectoryPropertiesAccountType.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AdvancedPlatformMetricsFilterType.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AdvancedPlatformMetricsRuleConfig.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AdvancedPlatformMetricsRuleProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AdvancedPlatformMetricsRuleType.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AllowedCopyScope.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AzureEntityResource.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/AzureFilesIdentityBasedAuthentication.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersCreateOrUpdateImmutabilityPolicyHeaders.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersCreateOrUpdateImmutabilityPolicyResponse.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersDeleteImmutabilityPolicyHeaders.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersDeleteImmutabilityPolicyResponse.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersExtendImmutabilityPolicyHeaders.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersExtendImmutabilityPolicyResponse.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersGetImmutabilityPolicyHeaders.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersGetImmutabilityPolicyResponse.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersLockImmutabilityPolicyHeaders.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobContainersLockImmutabilityPolicyResponse.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryCreationTime.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyDefinition.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyFilter.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyName.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicyRule.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobInventoryPolicySchema.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreParameters.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreProgressStatus.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BlobRestoreRange.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/BurstingConstants.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Bypass.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ChangeFeed.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ConnectorUpdate.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRule.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRuleAllowedMethodsItem.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CorsRules.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/CustomDomain.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DataShareConnection.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DataShareSource.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DataShareSourceUpdate.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DataShareUpdate.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DateAfterCreation.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DateAfterModification.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DefaultAction.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DefaultSharePermission.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DeleteRetentionPolicy.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DeletedShare.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Dimension.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DirectoryServiceOptions.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DnsEndpointType.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/DualStackEndpointPreference.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EnabledProtocols.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Encryption.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionIdentity.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionInTransit.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeKeyVaultProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeSource.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionScopeState.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionService.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/EncryptionServices.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Endpoints.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExecutionTarget.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExecutionTrigger.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExecutionTriggerUpdate.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExpirationAction.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExtendedLocation.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ExtendedLocationTypes.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FailoverType.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FileServiceUsageProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FileShareLimits.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FileSharePropertiesFileSharePaidBursting.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FileShareRecommendations.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FileSharesLeaseHeaders.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/FileSharesLeaseResponse.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Format.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/GeoPriorityReplicationStatus.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/GeoReplicationStats.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/GeoReplicationStatus.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/HttpProtocol.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Identity.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IdentityType.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyState.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutabilityPolicyUpdateType.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutableStorageAccount.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ImmutableStorageWithVersioning.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IntervalUnit.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/InventoryRuleType.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IpRule.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/IssueType.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyCreationTime.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyPermission.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyPolicy.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeySource.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyType.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/KeyVaultProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Kind.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LargeFileSharesState.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LastAccessTimeTrackingPolicy.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseContainerRequest.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseContainerRequestAction.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseDuration.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseShareAction.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseShareRequest.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseState.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LeaseStatus.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/LegalHoldProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListContainersInclude.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListEncryptionScopesInclude.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListKeyExpand.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ListLocalUserIncludeParam.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagedIdentityAuthProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagedIdentityAuthPropertiesUpdate.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyAction.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyBaseBlob.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyDefinition.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyFilter.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyName.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyRule.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicySchema.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicySnapShot.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ManagementPolicyVersion.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MetricSpecification.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MetricsEmitted.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MigrationName.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MigrationState.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MigrationStatus.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/MinimumTlsVersion.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Multichannel.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Name.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NativeDataSharingProvisioningState.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkRuleSet.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeter.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeterConfigurationPropertiesProfile.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NetworkSecurityPerimeterConfigurationProvisioningState.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NfsSetting.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NspAccessRule.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NspAccessRuleDirection.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NspAccessRuleProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/NspAccessRulePropertiesSubscriptionsItem.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicyFilter.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicyPropertiesMetrics.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicyPropertiesPriorityReplication.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicyPropertiesTagsReplication.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectReplicationPolicyRule.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ObjectType.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/OperationDisplay.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PermissionScope.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Permissions.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Placement.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PostFailoverRedundancy.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PostPlannedFailoverRedundancy.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpoint.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointConnectionProvisioningState.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateEndpointServiceConnectionStatus.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateLinkResource.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PrivateLinkServiceConnectionState.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProtectedAppendWritesHistory.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProtocolSettings.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProvisioningIssue.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProvisioningIssueProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ProvisioningState.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PublicAccess.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/PublicNetworkAccess.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Reason.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ReasonCode.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ResourceAccessRule.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ResourceAssociationAccessMode.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RestorePolicyProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Restriction.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RootSquashType.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RoutingChoice.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RoutingPreference.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RuleType.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RunResult.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/RunStatusEnum.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SasPolicy.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Schedule.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ServiceSasParameters.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ServiceSharedKeyAccessProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ServiceSpecification.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Services.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Severity.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ShareAccessTier.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SignedIdentifier.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SignedResource.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SignedResourceTypes.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/Sku.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuCapability.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuConversionStatus.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuInformationLocationInfoItem.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuName.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SkuTier.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SmbOAuthSettings.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SmbSetting.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/SshPublicKey.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/State.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StaticWebsite.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountCheckNameAvailabilityParameters.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountCreateParameters.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountExpand.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountInternetEndpoints.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountIpv6Endpoints.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountKey.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountMicrosoftEndpoints.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountRegenerateKeyParameters.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountSharedKeyAccessProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountSkuConversionStatus.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccountUpdateParameters.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageConnectorAuthProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageConnectorAuthPropertiesUpdate.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageConnectorAuthType.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageConnectorConnection.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageConnectorConnectionType.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageConnectorDataSourceType.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageConnectorProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageConnectorPropertiesUpdate.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageConnectorSource.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageConnectorSourceType.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageConnectorSourceUpdate.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageConnectorState.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageDataCollaborationPolicyProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageDataShareAccessPolicy.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageDataShareAccessPolicyPermission.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageDataShareAsset.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageDataShareProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageDataSharePropertiesUpdate.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentExecutionContext.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentReport.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentUpdateExecutionContext.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentUpdateParameters.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentUpdateProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskAssignmentUpdateReport.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageTaskReportProperties.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TableAccessPolicy.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TableSignedIdentifier.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TagFilter.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TagProperty.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TestExistingConnectionRequest.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TrackedResourceUpdate.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TriggerParameters.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TriggerParametersUpdate.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/TriggerType.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UpdateHistoryProperty.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageName.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UsageUnit.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/UserAssignedIdentity.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/VirtualNetworkRule.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/ZonePlacementPolicy.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/package-info.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/package-info.java delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storage/proxy-config.json delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storage/reflect-config.json delete mode 100644 sdk/storage/azure-resourcemanager-storage/src/main/resources/azure-resourcemanager-storage.properties create mode 100644 sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/SingleDocumentTranslationServiceVersion.java diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 7d897567fb9a..e99e1c084127 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -5,23 +5,27 @@ "packages": { "": { "dependencies": { - "@azure-tools/typespec-java": "0.45.5" + "@azure-tools/typespec-java": "/mnt/vss/_work/1/typespec-azure/packages/typespec-java/azure-tools-typespec-java-0.45.4.tgz" }, "devDependencies": { - "@azure-tools/openai-typespec": "1.20.0", - "@azure-tools/typespec-autorest": "0.69.1", - "@azure-tools/typespec-azure-core": "0.69.0", - "@azure-tools/typespec-azure-resource-manager": "0.69.2", - "@azure-tools/typespec-azure-rulesets": "0.69.2", - "@azure-tools/typespec-client-generator-core": "0.69.2", - "@azure-tools/typespec-liftr-base": "0.14.0", - "@typespec/compiler": "1.13.0", - "@typespec/http": "1.13.0", - "@typespec/openapi": "1.13.0", - "@typespec/openapi3": "1.13.0", - "@typespec/rest": "0.83.0", - "@typespec/versioning": "0.83.0", - "@typespec/xml": "0.83.0" + "@azure-tools/openai-typespec": "1.21.0", + "@azure-tools/typespec-autorest": "0.70.0", + "@azure-tools/typespec-azure-core": "0.70.0", + "@azure-tools/typespec-azure-portal-core": "0.70.0", + "@azure-tools/typespec-azure-resource-manager": "0.70.0", + "@azure-tools/typespec-azure-rulesets": "0.70.0", + "@azure-tools/typespec-client-generator-core": "0.70.0", + "@azure-tools/typespec-liftr-base": ">=0.14.0 <1.0.0", + "@typespec/compiler": "1.14.0", + "@typespec/events": "0.84.0", + "@typespec/http": "1.14.0", + "@typespec/openapi": "1.14.0", + "@typespec/openapi3": "1.14.0", + "@typespec/rest": "0.84.0", + "@typespec/sse": "0.84.0", + "@typespec/streams": "0.84.0", + "@typespec/versioning": "0.84.0", + "@typespec/xml": "0.84.0" } }, "node_modules/@autorest/codemodel": { @@ -37,18 +41,6 @@ "node": ">=12.0.0" } }, - "node_modules/@autorest/codemodel/node_modules/js-yaml": { - "version": "4.1.1", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/js-yaml/-/js-yaml-4.1.1.tgz", - "integrity": "sha1-hUwpJGdwW2mUduGi3swMijRYgGs=", - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/@azure-tools/async-io": { "version": "3.0.254", "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/async-io/-/async-io-3.0.254.tgz", @@ -76,26 +68,14 @@ "node": ">=12.0.0" } }, - "node_modules/@azure-tools/codegen/node_modules/js-yaml": { - "version": "4.1.1", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/js-yaml/-/js-yaml-4.1.1.tgz", - "integrity": "sha1-hUwpJGdwW2mUduGi3swMijRYgGs=", - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/@azure-tools/openai-typespec": { - "version": "1.20.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/openai-typespec/-/openai-typespec-1.20.0.tgz", - "integrity": "sha1-pcUlfx0cFVyYqgX84nCj0VkbdJk=", + "version": "1.21.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/openai-typespec/-/openai-typespec-1.21.0.tgz", + "integrity": "sha1-UXlgXVHl705Q+Qmr07Y2rTQYQWE=", "license": "MIT", "peerDependencies": { - "@typespec/http": "^1.11.0", - "@typespec/openapi": "^1.11.0" + "@typespec/http": "^1.13.0", + "@typespec/openapi": "^1.13.0" } }, "node_modules/@azure-tools/tasks": { @@ -108,23 +88,26 @@ } }, "node_modules/@azure-tools/typespec-autorest": { - "version": "0.69.1", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-autorest/-/typespec-autorest-0.69.1.tgz", - "integrity": "sha1-Xqa9GjpEsawclmX/6IwzKVIRu3Y=", + "version": "0.70.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-autorest/-/typespec-autorest-0.70.0.tgz", + "integrity": "sha1-hxXdmTz6UUqpPXEGLwyRUHHNt38=", "license": "MIT", + "dependencies": { + "yaml": "^2.8.3" + }, "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@azure-tools/typespec-azure-resource-manager": "^0.69.1", - "@azure-tools/typespec-client-generator-core": "^0.69.0", - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": "^0.83.0", - "@typespec/versioning": "^0.83.0", - "@typespec/xml": "^0.83.0" + "@azure-tools/typespec-azure-core": "^0.70.0", + "@azure-tools/typespec-azure-resource-manager": "^0.70.0", + "@azure-tools/typespec-client-generator-core": "^0.70.0", + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/versioning": "^0.84.0", + "@typespec/xml": "^0.84.0" }, "peerDependenciesMeta": { "@typespec/xml": { @@ -133,23 +116,34 @@ } }, "node_modules/@azure-tools/typespec-azure-core": { - "version": "0.69.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.69.0.tgz", - "integrity": "sha1-nUUoo+wXvMDKjoSwpsmBUbNA4OU=", + "version": "0.70.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.70.0.tgz", + "integrity": "sha1-k3VYRkt7yNAA1kiBElz71YbZH7A=", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/rest": "^0.83.0" + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/rest": "^0.84.0" + } + }, + "node_modules/@azure-tools/typespec-azure-portal-core": { + "version": "0.70.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-azure-portal-core/-/typespec-azure-portal-core-0.70.0.tgz", + "integrity": "sha1-lBhBuWg3V9oENi5XPxYBysFpB58=", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@azure-tools/typespec-azure-resource-manager": "^0.70.0", + "@typespec/compiler": "^1.14.0" } }, "node_modules/@azure-tools/typespec-azure-resource-manager": { - "version": "0.69.2", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.69.2.tgz", - "integrity": "sha1-38rBk0p9bNsdHXUYSmutW75OJe8=", + "version": "0.70.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.70.0.tgz", + "integrity": "sha1-+Skz0cnW1LADE60g/JnqYk0nixg=", "license": "MIT", "dependencies": { "change-case": "^5.4.4", @@ -159,33 +153,33 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": "^0.83.0", - "@typespec/versioning": "^0.83.0" + "@azure-tools/typespec-azure-core": "^0.70.0", + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/versioning": "^0.84.0" } }, "node_modules/@azure-tools/typespec-azure-rulesets": { - "version": "0.69.2", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.69.2.tgz", - "integrity": "sha1-wD+Y5AC8lOUTcl0s8y5m37voSHA=", + "version": "0.70.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.70.0.tgz", + "integrity": "sha1-/iCKSwMs+gWfYYd9UTZFo/AXjrQ=", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@azure-tools/typespec-azure-resource-manager": "^0.69.2", - "@azure-tools/typespec-client-generator-core": "^0.69.2", - "@typespec/compiler": "^1.13.0" + "@azure-tools/typespec-azure-core": "^0.70.0", + "@azure-tools/typespec-azure-resource-manager": "^0.70.0", + "@azure-tools/typespec-client-generator-core": "^0.70.0", + "@typespec/compiler": "^1.14.0" } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.69.2", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.69.2.tgz", - "integrity": "sha1-UGOckCevYslK4puCkn6GmTK53jQ=", + "version": "0.70.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.70.0.tgz", + "integrity": "sha1-k7nEgErM8Vd5PRVdaR8rfSPFpic=", "license": "MIT", "dependencies": { "change-case": "^5.4.4", @@ -196,46 +190,48 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@typespec/compiler": "^1.13.0", - "@typespec/events": "^0.83.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": "^0.83.0", - "@typespec/sse": "^0.83.0", - "@typespec/streams": "^0.83.0", - "@typespec/versioning": "^0.83.0", - "@typespec/xml": "^0.83.0" + "@azure-tools/typespec-azure-core": "^0.70.0", + "@typespec/compiler": "^1.14.0", + "@typespec/events": "^0.84.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/sse": "^0.84.0", + "@typespec/streams": "^0.84.0", + "@typespec/versioning": "^0.84.0", + "@typespec/xml": "^0.84.0" } }, "node_modules/@azure-tools/typespec-java": { - "version": "0.45.5", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-java/-/typespec-java-0.45.5.tgz", - "integrity": "sha1-MyKlRsphjvgGwrHwt24tCcpym0I=", + "version": "0.45.4", + "resolved": "file:../../typespec-azure/packages/typespec-java/azure-tools-typespec-java-0.45.4.tgz", + "integrity": "sha512-HAceUzcRdDnlhtQggj/LLWAMoTH+Uh9A7qMnhtBv+AwstniVw5aCzTG/Tb4ynYbybReu07VBYlBzHpWR6VOJOQ==", "license": "MIT", "dependencies": { "@autorest/codemodel": "~4.20.1", - "js-yaml": "~4.3.0", - "lodash": "~4.18.1" + "@azure-tools/codegen": "~2.10.1", + "yaml": "^2.8.3" }, "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/openai-typespec": "^1.20.0", - "@azure-tools/typespec-autorest": ">=0.69.1 <1.0.0", - "@azure-tools/typespec-azure-core": ">=0.69.0 <1.0.0", - "@azure-tools/typespec-azure-resource-manager": ">=0.69.2 <1.0.0", - "@azure-tools/typespec-azure-rulesets": ">=0.69.2 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.69.2 <1.0.0", + "@azure-tools/openai-typespec": "1.21.0", + "@azure-tools/typespec-autorest": "^0.70.0", + "@azure-tools/typespec-azure-core": "^0.70.0", + "@azure-tools/typespec-azure-resource-manager": "^0.70.0", + "@azure-tools/typespec-azure-rulesets": "^0.70.0", + "@azure-tools/typespec-client-generator-core": "^0.70.0", "@azure-tools/typespec-liftr-base": ">=0.14.0 <1.0.0", - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/openapi3": "^1.13.0", - "@typespec/rest": ">=0.83.0 <1.0.0", - "@typespec/versioning": ">=0.83.0 <1.0.0", - "@typespec/xml": ">=0.83.0 <1.0.0" + "@typespec/compiler": "^1.14.0", + "@typespec/events": "^0.84.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/sse": "^0.84.0", + "@typespec/streams": "^0.84.0", + "@typespec/versioning": "^0.84.0", + "@typespec/xml": "^0.84.0" } }, "node_modules/@azure-tools/typespec-liftr-base": { @@ -610,6 +606,7 @@ "version": "0.9.0", "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@scalar/helpers/-/helpers-0.9.0.tgz", "integrity": "sha1-s9sRNhIJtLknMzSHUj4ehMT/1A8=", + "dev": true, "license": "MIT", "engines": { "node": ">=22" @@ -619,6 +616,7 @@ "version": "0.12.17", "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@scalar/json-magic/-/json-magic-0.12.17.tgz", "integrity": "sha1-4nnGMIOcENeTdgDd5o373T8fGFM=", + "dev": true, "license": "MIT", "dependencies": { "@scalar/helpers": "0.9.0", @@ -633,6 +631,7 @@ "version": "0.28.8", "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@scalar/openapi-parser/-/openapi-parser-0.28.8.tgz", "integrity": "sha1-LVIO/1wSL5qJ4d91bsc9AFUr11U=", + "dev": true, "license": "MIT", "dependencies": { "@scalar/helpers": "0.9.0", @@ -654,6 +653,7 @@ "version": "0.9.1", "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@scalar/openapi-types/-/openapi-types-0.9.1.tgz", "integrity": "sha1-EW7oh5Byy1qr2c7hz0MUYmjbkiY=", + "dev": true, "license": "MIT", "engines": { "node": ">=22" @@ -663,6 +663,7 @@ "version": "0.2.9", "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@scalar/openapi-upgrader/-/openapi-upgrader-0.2.9.tgz", "integrity": "sha1-7ZGjDb+tJEvXpKFwZIrGS4+w+VI=", + "dev": true, "license": "MIT", "dependencies": { "@scalar/openapi-types": "0.9.1" @@ -675,6 +676,7 @@ "version": "0.79.1", "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/asset-emitter/-/asset-emitter-0.79.1.tgz", "integrity": "sha1-ustlnxj/oOyPs7Wkf44wS8qKImo=", + "dev": true, "license": "MIT", "engines": { "node": ">=20.0.0" @@ -684,9 +686,9 @@ } }, "node_modules/@typespec/compiler": { - "version": "1.13.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/compiler/-/compiler-1.13.0.tgz", - "integrity": "sha1-9rRSNTfToVgLNNYWCs7hO+AI6UA=", + "version": "1.14.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/compiler/-/compiler-1.14.0.tgz", + "integrity": "sha1-2FXCBu7K+j54eOf0JVthKC8FP0Y=", "license": "MIT", "dependencies": { "@babel/code-frame": "^7.29.0", @@ -700,8 +702,8 @@ "prettier": "^3.8.1", "semver": "^7.7.4", "tar": "^7.5.13", - "temporal-polyfill": "^0.3.2", - "vscode-languageserver": "^9.0.1", + "temporal-polyfill": "^1.0.1", + "vscode-languageserver": "^10.0.0", "vscode-languageserver-textdocument": "^1.0.12", "yaml": "^2.8.3", "yargs": "^18.0.0" @@ -715,29 +717,28 @@ } }, "node_modules/@typespec/events": { - "version": "0.83.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/events/-/events-0.83.0.tgz", - "integrity": "sha1-muxeJanyHS+6QCQoU5T8pQg/nDA=", + "version": "0.84.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/events/-/events-0.84.0.tgz", + "integrity": "sha1-U6JW0cqeb0+n5fCjTbaW3DlOYPk=", "license": "MIT", - "peer": true, "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.14.0" } }, "node_modules/@typespec/http": { - "version": "1.13.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/http/-/http-1.13.0.tgz", - "integrity": "sha1-qQ89noV+3DME0HhJLscj0suz4Zs=", + "version": "1.14.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/http/-/http-1.14.0.tgz", + "integrity": "sha1-La9yB2Ny8FhnXSBbst9wYQBiOq4=", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/streams": "^0.83.0" + "@typespec/compiler": "^1.14.0", + "@typespec/streams": "^0.84.0" }, "peerDependenciesMeta": { "@typespec/streams": { @@ -746,22 +747,23 @@ } }, "node_modules/@typespec/openapi": { - "version": "1.13.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/openapi/-/openapi-1.13.0.tgz", - "integrity": "sha1-YmlA5T5uoIaeZ0hvfS/5czuDCkA=", + "version": "1.14.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/openapi/-/openapi-1.14.0.tgz", + "integrity": "sha1-uwjWOV3VwWP59UXlR2xVUuzyCGc=", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0" + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0" } }, "node_modules/@typespec/openapi3": { - "version": "1.13.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/openapi3/-/openapi3-1.13.0.tgz", - "integrity": "sha1-a/4+2NCZhysSM4hDwmLGzrL9jwA=", + "version": "1.14.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/openapi3/-/openapi3-1.14.0.tgz", + "integrity": "sha1-y2vbsHoAsmitk11DD8LOxXxcixw=", + "dev": true, "license": "MIT", "dependencies": { "@scalar/json-magic": "^0.12.15", @@ -777,14 +779,14 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/events": "^0.83.0", - "@typespec/http": "^1.13.0", - "@typespec/json-schema": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/sse": "^0.83.0", - "@typespec/streams": "^0.83.0", - "@typespec/versioning": "^0.83.0" + "@typespec/compiler": "^1.14.0", + "@typespec/events": "^0.84.0", + "@typespec/http": "^1.14.0", + "@typespec/json-schema": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/sse": "^0.84.0", + "@typespec/streams": "^0.84.0", + "@typespec/versioning": "^0.84.0" }, "peerDependenciesMeta": { "@typespec/events": { @@ -808,69 +810,67 @@ } }, "node_modules/@typespec/rest": { - "version": "0.83.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/rest/-/rest-0.83.0.tgz", - "integrity": "sha1-VdO6JyTFMQjlEUciZ9kKaI22BkU=", + "version": "0.84.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/rest/-/rest-0.84.0.tgz", + "integrity": "sha1-kMLB39G8geZbiA3EEdQBaqteuuA=", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0" + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0" } }, "node_modules/@typespec/sse": { - "version": "0.83.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/sse/-/sse-0.83.0.tgz", - "integrity": "sha1-hNyNnk7rrJXC0Lfm4myUdYPL6Lg=", + "version": "0.84.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/sse/-/sse-0.84.0.tgz", + "integrity": "sha1-dkP/3P+tvI4Q2SV3oRz/F2JMVXo=", "license": "MIT", - "peer": true, "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/events": "^0.83.0", - "@typespec/http": "^1.13.0", - "@typespec/streams": "^0.83.0" + "@typespec/compiler": "^1.14.0", + "@typespec/events": "^0.84.0", + "@typespec/http": "^1.14.0", + "@typespec/streams": "^0.84.0" } }, "node_modules/@typespec/streams": { - "version": "0.83.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/streams/-/streams-0.83.0.tgz", - "integrity": "sha1-WJdJb4yL+BgQl4Q+d7NS+6gEcbM=", + "version": "0.84.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/streams/-/streams-0.84.0.tgz", + "integrity": "sha1-Bm3D76chBKlcou2jj913xFfTBI4=", "license": "MIT", - "peer": true, "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.14.0" } }, "node_modules/@typespec/versioning": { - "version": "0.83.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/versioning/-/versioning-0.83.0.tgz", - "integrity": "sha1-IE6Hk9aRF7JC93SQKMA5Ex/uCW8=", + "version": "0.84.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/versioning/-/versioning-0.84.0.tgz", + "integrity": "sha1-YS06C7uMMWXKp7vwuy8qV8kjr38=", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.14.0" } }, "node_modules/@typespec/xml": { - "version": "0.83.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/xml/-/xml-0.83.0.tgz", - "integrity": "sha1-PMnR1zxpV2mLz/gUfU67AqJTGXk=", + "version": "0.84.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/xml/-/xml-0.84.0.tgz", + "integrity": "sha1-aP99jZ3+wHS7f9mMJbEUT4Py7+g=", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.14.0" } }, "node_modules/ajv": { @@ -893,6 +893,7 @@ "version": "1.0.0", "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz", "integrity": "sha1-O2R2GyaLoLnmaPC0G6U/zgrXf8g=", + "dev": true, "license": "MIT", "peerDependencies": { "ajv": "^8.5.0" @@ -907,6 +908,7 @@ "version": "3.0.1", "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ajv-formats/-/ajv-formats-3.0.1.tgz", "integrity": "sha1-PV3HYryhdnnDwup+kK1rdTIwlXg=", + "dev": true, "license": "MIT", "dependencies": { "ajv": "^8.0.0" @@ -1144,19 +1146,9 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "4.3.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/js-yaml/-/js-yaml-4.3.0.tgz", - "integrity": "sha1-0ZAFcqf3zwtfVAyDZz5gutNDZZI=", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/puzrin" - }, - { - "type": "github", - "url": "https://github.com/sponsors/nodeca" - } - ], + "version": "4.1.1", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha1-hUwpJGdwW2mUduGi3swMijRYgGs=", "license": "MIT", "dependencies": { "argparse": "^2.0.1" @@ -1175,6 +1167,7 @@ "version": "5.0.1", "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/jsonpointer/-/jsonpointer-5.0.1.tgz", "integrity": "sha1-IRDgrwkA/TdGe1kH7NE6eIShtVk=", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -1184,6 +1177,7 @@ "version": "4.1.0", "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/leven/-/leven-4.1.0.tgz", "integrity": "sha1-HjcVDhcR0YuxTjgKXHeZlSNacQ4=", + "dev": true, "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" @@ -1192,12 +1186,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lodash": { - "version": "4.18.1", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lodash/-/lodash-4.18.1.tgz", - "integrity": "sha1-/ytmwfYybVlRPeJAe/iBQ5gSdxw=", - "license": "MIT" - }, "node_modules/minipass": { "version": "7.1.3", "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/minipass/-/minipass-7.1.3.tgz", @@ -1241,6 +1229,7 @@ "version": "2.0.3", "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/pathe/-/pathe-2.0.3.tgz", "integrity": "sha1-PsvsVUIWhbcKnahyss/z4cvtFxY=", + "dev": true, "license": "MIT" }, "node_modules/picocolors": { @@ -1259,9 +1248,9 @@ } }, "node_modules/prettier": { - "version": "3.9.4", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/prettier/-/prettier-3.9.4.tgz", - "integrity": "sha1-qcR3zxYUN2vR9rvFk9jA1BS87Ic=", + "version": "3.9.5", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/prettier/-/prettier-3.9.5.tgz", + "integrity": "sha1-T+yXc24zudC2ILSJFP6TtTDoNa0=", "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" @@ -1367,9 +1356,9 @@ } }, "node_modules/tar": { - "version": "7.5.19", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/tar/-/tar-7.5.19.tgz", - "integrity": "sha1-2JFea3F/gDannYOcqUSBmLACsKc=", + "version": "7.5.20", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/tar/-/tar-7.5.20.tgz", + "integrity": "sha1-N6ZaqRHL1phkAC4Uv4qSalVR4kA=", "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/fs-minipass": "^4.0.0", @@ -1383,49 +1372,56 @@ } }, "node_modules/temporal-polyfill": { - "version": "0.3.2", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/temporal-polyfill/-/temporal-polyfill-0.3.2.tgz", - "integrity": "sha1-6w9P02x36sQ9bltShRvuNkgjS4E=", + "version": "1.0.1", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/temporal-polyfill/-/temporal-polyfill-1.0.1.tgz", + "integrity": "sha1-lWd9+PpWcaeY6KqztY9FlJGIDZ8=", "license": "MIT", "dependencies": { - "temporal-spec": "0.3.1" + "temporal-spec": "1.0.0", + "temporal-utils": "1.0.1" } }, "node_modules/temporal-spec": { - "version": "0.3.1", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/temporal-spec/-/temporal-spec-0.3.1.tgz", - "integrity": "sha1-CILPKVSqxoOiSEIItfXMc2a/3RQ=", - "license": "ISC" + "version": "1.0.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/temporal-spec/-/temporal-spec-1.0.0.tgz", + "integrity": "sha1-gep3lAsAmndZ/SH0R9wPK3VHwco=", + "license": "Apache-2.0" + }, + "node_modules/temporal-utils": { + "version": "1.0.1", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/temporal-utils/-/temporal-utils-1.0.1.tgz", + "integrity": "sha1-+vJ24hZRLM0VdaRwWljXOgka64I=", + "license": "MIT" }, "node_modules/vscode-jsonrpc": { - "version": "8.2.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", - "integrity": "sha1-9D36NftR52PRfNlNzKDJRY81q/k=", + "version": "9.0.1", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vscode-jsonrpc/-/vscode-jsonrpc-9.0.1.tgz", + "integrity": "sha1-XoSKSt3wBLYzcVb3hYoAbgg4tPU=", "license": "MIT", "engines": { "node": ">=14.0.0" } }, "node_modules/vscode-languageserver": { - "version": "9.0.1", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz", - "integrity": "sha1-UArvggl+uU35DQCGeLC2tfR0AVs=", + "version": "10.1.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vscode-languageserver/-/vscode-languageserver-10.1.0.tgz", + "integrity": "sha1-6IB0MTmF2kpsCPrCvr1zN5ykv8U=", "license": "MIT", "dependencies": { - "vscode-languageserver-protocol": "3.17.5" + "vscode-languageserver-protocol": "3.18.2" }, "bin": { "installServerIntoExtension": "bin/installServerIntoExtension" } }, "node_modules/vscode-languageserver-protocol": { - "version": "3.17.5", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", - "integrity": "sha1-hkqLjzkINVcvThO9n4MT0OOsS+o=", + "version": "3.18.2", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.18.2.tgz", + "integrity": "sha1-5/s25royvHumIiV623imEmJz3cU=", "license": "MIT", "dependencies": { - "vscode-jsonrpc": "8.2.0", - "vscode-languageserver-types": "3.17.5" + "vscode-jsonrpc": "9.0.1", + "vscode-languageserver-types": "3.18.0" } }, "node_modules/vscode-languageserver-textdocument": { @@ -1435,9 +1431,9 @@ "license": "MIT" }, "node_modules/vscode-languageserver-types": { - "version": "3.17.5", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", - "integrity": "sha1-MnNnbwzy6rQLP0TQhay7fwijnYo=", + "version": "3.18.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vscode-languageserver-types/-/vscode-languageserver-types-3.18.0.tgz", + "integrity": "sha1-EyMhIpYEg2urcQyXSH5s2vub17s=", "license": "MIT" }, "node_modules/wrap-ansi": { diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 5b51bbaf2bba..c1e496ca837b 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,22 +1,26 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-java": "0.45.5" + "@azure-tools/typespec-java": "/mnt/vss/_work/1/typespec-azure/packages/typespec-java/azure-tools-typespec-java-0.45.4.tgz" }, "devDependencies": { + "@azure-tools/typespec-autorest": "0.70.0", + "@azure-tools/typespec-azure-core": "0.70.0", + "@azure-tools/typespec-azure-resource-manager": "0.70.0", + "@azure-tools/typespec-azure-rulesets": "0.70.0", + "@azure-tools/typespec-client-generator-core": "0.70.0", + "@typespec/compiler": "1.14.0", + "@typespec/http": "1.14.0", + "@typespec/openapi": "1.14.0", + "@typespec/rest": "0.84.0", + "@typespec/versioning": "0.84.0", + "@typespec/xml": "0.84.0", + "@azure-tools/typespec-liftr-base": ">=0.14.0 <1.0.0", "@azure-tools/openai-typespec": "1.21.0", - "@azure-tools/typespec-autorest": "0.69.1", - "@azure-tools/typespec-azure-core": "0.69.0", - "@azure-tools/typespec-azure-resource-manager": "0.69.2", - "@azure-tools/typespec-azure-rulesets": "0.69.2", - "@azure-tools/typespec-client-generator-core": "0.69.2", - "@azure-tools/typespec-liftr-base": "0.14.0", - "@typespec/compiler": "1.13.0", - "@typespec/http": "1.13.0", - "@typespec/openapi": "1.13.0", - "@typespec/rest": "0.83.0", - "@typespec/versioning": "0.83.0", - "@typespec/xml": "0.83.0", - "@typespec/openapi3": "1.13.0" + "@typespec/events": "0.84.0", + "@typespec/sse": "0.84.0", + "@typespec/streams": "0.84.0", + "@azure-tools/typespec-azure-portal-core": "0.70.0", + "@typespec/openapi3": "1.14.0" } } \ No newline at end of file diff --git a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServicePlanPatchResourceProperties.java b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServicePlanPatchResourceProperties.java index f03987740fc8..94269cc8eab4 100644 --- a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServicePlanPatchResourceProperties.java +++ b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServicePlanPatchResourceProperties.java @@ -60,6 +60,7 @@ public final class AppServicePlanPatchResourceProperties private String geoRegion; /* + * * If true, apps assigned to this App Service plan can be scaled independently. * If false, apps assigned to this App Service plan will scale to all instances of the plan. */ @@ -136,6 +137,7 @@ public final class AppServicePlanPatchResourceProperties private KubeEnvironmentProfile kubeEnvironmentProfile; /* + * * If true, this App Service Plan will perform availability zone balancing. * If false, this App Service Plan will not perform availability zone balancing. */ @@ -237,8 +239,8 @@ public String geoRegion() { } /** - * Get the perSiteScaling property: If <code>true</code>, apps assigned to this App Service plan can be - * scaled independently. + * Get the perSiteScaling property: + * If <code>true</code>, apps assigned to this App Service plan can be scaled independently. * If <code>false</code>, apps assigned to this App Service plan will scale to all instances of the * plan. * @@ -249,8 +251,8 @@ public Boolean perSiteScaling() { } /** - * Set the perSiteScaling property: If <code>true</code>, apps assigned to this App Service plan can be - * scaled independently. + * Set the perSiteScaling property: + * If <code>true</code>, apps assigned to this App Service plan can be scaled independently. * If <code>false</code>, apps assigned to this App Service plan will scale to all instances of the * plan. * @@ -525,8 +527,8 @@ public KubeEnvironmentProfile kubeEnvironmentProfile() { } /** - * Get the zoneRedundant property: If <code>true</code>, this App Service Plan will perform availability - * zone balancing. + * Get the zoneRedundant property: + * If <code>true</code>, this App Service Plan will perform availability zone balancing. * If <code>false</code>, this App Service Plan will not perform availability zone balancing. * * @return the zoneRedundant value. @@ -536,8 +538,8 @@ public Boolean zoneRedundant() { } /** - * Set the zoneRedundant property: If <code>true</code>, this App Service Plan will perform availability - * zone balancing. + * Set the zoneRedundant property: + * If <code>true</code>, this App Service Plan will perform availability zone balancing. * If <code>false</code>, this App Service Plan will not perform availability zone balancing. * * @param zoneRedundant the zoneRedundant value to set. diff --git a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsInner.java b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsInner.java index 97bebe48f280..8967c149c0ad 100644 --- a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsInner.java +++ b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsInner.java @@ -139,8 +139,9 @@ public PushSettingsInner withTagWhitelistJson(String tagWhitelistJson) { } /** - * Get the tagsRequiringAuth property: Gets or sets a JSON string containing a list of tags that require user - * authentication to be used in the push registration endpoint. + * Get the tagsRequiringAuth property: + * Gets or sets a JSON string containing a list of tags that require user authentication to be used in the push + * registration endpoint. * Tags can consist of alphanumeric characters and the following: * '_', '@', '#', '.', ':', '-'. * Validation should be performed at the PushRequestHandler. @@ -152,8 +153,9 @@ public String tagsRequiringAuth() { } /** - * Set the tagsRequiringAuth property: Gets or sets a JSON string containing a list of tags that require user - * authentication to be used in the push registration endpoint. + * Set the tagsRequiringAuth property: + * Gets or sets a JSON string containing a list of tags that require user authentication to be used in the push + * registration endpoint. * Tags can consist of alphanumeric characters and the following: * '_', '@', '#', '.', ':', '-'. * Validation should be performed at the PushRequestHandler. diff --git a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsProperties.java b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsProperties.java index 5b1d9dcc4724..a4f36b04fbf3 100644 --- a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsProperties.java +++ b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsProperties.java @@ -28,6 +28,7 @@ public final class PushSettingsProperties implements JsonSerializable facebookOAuthS } /** - * Get the gitHubClientId property: The Client Id of the GitHub app used for login. + * Get the gitHubClientId property: + * The Client Id of the GitHub app used for login. * This setting is required for enabling Github login. * * @return the gitHubClientId value. @@ -763,7 +766,8 @@ public String gitHubClientId() { } /** - * Set the gitHubClientId property: The Client Id of the GitHub app used for login. + * Set the gitHubClientId property: + * The Client Id of the GitHub app used for login. * This setting is required for enabling Github login. * * @param gitHubClientId the gitHubClientId value to set. @@ -778,7 +782,8 @@ public SiteAuthSettingsInner withGitHubClientId(String gitHubClientId) { } /** - * Get the gitHubClientSecret property: The Client Secret of the GitHub app used for Github Login. + * Get the gitHubClientSecret property: + * The Client Secret of the GitHub app used for Github Login. * This setting is required for enabling Github login. * * @return the gitHubClientSecret value. @@ -788,7 +793,8 @@ public String gitHubClientSecret() { } /** - * Set the gitHubClientSecret property: The Client Secret of the GitHub app used for Github Login. + * Set the gitHubClientSecret property: + * The Client Secret of the GitHub app used for Github Login. * This setting is required for enabling Github login. * * @param gitHubClientSecret the gitHubClientSecret value to set. @@ -803,8 +809,8 @@ public SiteAuthSettingsInner withGitHubClientSecret(String gitHubClientSecret) { } /** - * Get the gitHubClientSecretSettingName property: The app setting name that contains the client secret of the - * Github + * Get the gitHubClientSecretSettingName property: + * The app setting name that contains the client secret of the Github * app used for GitHub Login. * * @return the gitHubClientSecretSettingName value. @@ -814,8 +820,8 @@ public String gitHubClientSecretSettingName() { } /** - * Set the gitHubClientSecretSettingName property: The app setting name that contains the client secret of the - * Github + * Set the gitHubClientSecretSettingName property: + * The app setting name that contains the client secret of the Github * app used for GitHub Login. * * @param gitHubClientSecretSettingName the gitHubClientSecretSettingName value to set. @@ -830,8 +836,8 @@ public SiteAuthSettingsInner withGitHubClientSecretSettingName(String gitHubClie } /** - * Get the gitHubOAuthScopes property: The OAuth 2.0 scopes that will be requested as part of GitHub Login - * authentication. + * Get the gitHubOAuthScopes property: + * The OAuth 2.0 scopes that will be requested as part of GitHub Login authentication. * This setting is optional. * * @return the gitHubOAuthScopes value. @@ -841,8 +847,8 @@ public List gitHubOAuthScopes() { } /** - * Set the gitHubOAuthScopes property: The OAuth 2.0 scopes that will be requested as part of GitHub Login - * authentication. + * Set the gitHubOAuthScopes property: + * The OAuth 2.0 scopes that will be requested as part of GitHub Login authentication. * This setting is optional. * * @param gitHubOAuthScopes the gitHubOAuthScopes value to set. @@ -913,8 +919,8 @@ public SiteAuthSettingsInner withTwitterConsumerSecret(String twitterConsumerSec } /** - * Get the twitterConsumerSecretSettingName property: The app setting name that contains the OAuth 1.0a consumer - * secret of the Twitter + * Get the twitterConsumerSecretSettingName property: + * The app setting name that contains the OAuth 1.0a consumer secret of the Twitter * application used for sign-in. * * @return the twitterConsumerSecretSettingName value. @@ -924,8 +930,8 @@ public String twitterConsumerSecretSettingName() { } /** - * Set the twitterConsumerSecretSettingName property: The app setting name that contains the OAuth 1.0a consumer - * secret of the Twitter + * Set the twitterConsumerSecretSettingName property: + * The app setting name that contains the OAuth 1.0a consumer secret of the Twitter * application used for sign-in. * * @param twitterConsumerSecretSettingName the twitterConsumerSecretSettingName value to set. @@ -998,8 +1004,8 @@ public SiteAuthSettingsInner withMicrosoftAccountClientSecret(String microsoftAc } /** - * Get the microsoftAccountClientSecretSettingName property: The app setting name containing the OAuth 2.0 client - * secret that was created for the + * Get the microsoftAccountClientSecretSettingName property: + * The app setting name containing the OAuth 2.0 client secret that was created for the * app used for authentication. * * @return the microsoftAccountClientSecretSettingName value. @@ -1009,8 +1015,8 @@ public String microsoftAccountClientSecretSettingName() { } /** - * Set the microsoftAccountClientSecretSettingName property: The app setting name containing the OAuth 2.0 client - * secret that was created for the + * Set the microsoftAccountClientSecretSettingName property: + * The app setting name containing the OAuth 2.0 client secret that was created for the * app used for authentication. * * @param microsoftAccountClientSecretSettingName the microsoftAccountClientSecretSettingName value to set. @@ -1080,7 +1086,8 @@ public SiteAuthSettingsInner withIsAuthFromFile(String isAuthFromFile) { } /** - * Get the authFilePath property: The path of the config file containing auth settings. + * Get the authFilePath property: + * The path of the config file containing auth settings. * If the path is relative, base will the site's root directory. * * @return the authFilePath value. @@ -1090,7 +1097,8 @@ public String authFilePath() { } /** - * Set the authFilePath property: The path of the config file containing auth settings. + * Set the authFilePath property: + * The path of the config file containing auth settings. * If the path is relative, base will the site's root directory. * * @param authFilePath the authFilePath value to set. @@ -1105,8 +1113,8 @@ public SiteAuthSettingsInner withAuthFilePath(String authFilePath) { } /** - * Get the configVersion property: The ConfigVersion of the Authentication / Authorization feature in use for the - * current app. + * Get the configVersion property: + * The ConfigVersion of the Authentication / Authorization feature in use for the current app. * The setting in this value can control the behavior of the control plane for Authentication / Authorization. * * @return the configVersion value. @@ -1116,8 +1124,8 @@ public String configVersion() { } /** - * Set the configVersion property: The ConfigVersion of the Authentication / Authorization feature in use for the - * current app. + * Set the configVersion property: + * The ConfigVersion of the Authentication / Authorization feature in use for the current app. * The setting in this value can control the behavior of the control plane for Authentication / Authorization. * * @param configVersion the configVersion value to set. diff --git a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteAuthSettingsProperties.java b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteAuthSettingsProperties.java index 817f8320d6d3..ceeaa57b6635 100644 --- a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteAuthSettingsProperties.java +++ b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteAuthSettingsProperties.java @@ -26,6 +26,7 @@ public final class SiteAuthSettingsProperties implements JsonSerializable facebookOAuthScopes; /* + * * The Client Id of the GitHub app used for login. * This setting is required for enabling Github login */ private String gitHubClientId; /* + * * The Client Secret of the GitHub app used for Github Login. * This setting is required for enabling Github login. */ private String gitHubClientSecret; /* + * * The app setting name that contains the client secret of the Github * app used for GitHub Login. */ private String gitHubClientSecretSettingName; /* + * * The OAuth 2.0 scopes that will be requested as part of GitHub Login authentication. * This setting is optional */ @@ -219,6 +227,7 @@ public final class SiteAuthSettingsProperties implements JsonSerializable facebookO } /** - * Get the gitHubClientId property: The Client Id of the GitHub app used for login. + * Get the gitHubClientId property: + * The Client Id of the GitHub app used for login. * This setting is required for enabling Github login. * * @return the gitHubClientId value. @@ -873,7 +888,8 @@ public String gitHubClientId() { } /** - * Set the gitHubClientId property: The Client Id of the GitHub app used for login. + * Set the gitHubClientId property: + * The Client Id of the GitHub app used for login. * This setting is required for enabling Github login. * * @param gitHubClientId the gitHubClientId value to set. @@ -885,7 +901,8 @@ public SiteAuthSettingsProperties withGitHubClientId(String gitHubClientId) { } /** - * Get the gitHubClientSecret property: The Client Secret of the GitHub app used for Github Login. + * Get the gitHubClientSecret property: + * The Client Secret of the GitHub app used for Github Login. * This setting is required for enabling Github login. * * @return the gitHubClientSecret value. @@ -895,7 +912,8 @@ public String gitHubClientSecret() { } /** - * Set the gitHubClientSecret property: The Client Secret of the GitHub app used for Github Login. + * Set the gitHubClientSecret property: + * The Client Secret of the GitHub app used for Github Login. * This setting is required for enabling Github login. * * @param gitHubClientSecret the gitHubClientSecret value to set. @@ -907,8 +925,8 @@ public SiteAuthSettingsProperties withGitHubClientSecret(String gitHubClientSecr } /** - * Get the gitHubClientSecretSettingName property: The app setting name that contains the client secret of the - * Github + * Get the gitHubClientSecretSettingName property: + * The app setting name that contains the client secret of the Github * app used for GitHub Login. * * @return the gitHubClientSecretSettingName value. @@ -918,8 +936,8 @@ public String gitHubClientSecretSettingName() { } /** - * Set the gitHubClientSecretSettingName property: The app setting name that contains the client secret of the - * Github + * Set the gitHubClientSecretSettingName property: + * The app setting name that contains the client secret of the Github * app used for GitHub Login. * * @param gitHubClientSecretSettingName the gitHubClientSecretSettingName value to set. @@ -931,8 +949,8 @@ public SiteAuthSettingsProperties withGitHubClientSecretSettingName(String gitHu } /** - * Get the gitHubOAuthScopes property: The OAuth 2.0 scopes that will be requested as part of GitHub Login - * authentication. + * Get the gitHubOAuthScopes property: + * The OAuth 2.0 scopes that will be requested as part of GitHub Login authentication. * This setting is optional. * * @return the gitHubOAuthScopes value. @@ -942,8 +960,8 @@ public List gitHubOAuthScopes() { } /** - * Set the gitHubOAuthScopes property: The OAuth 2.0 scopes that will be requested as part of GitHub Login - * authentication. + * Set the gitHubOAuthScopes property: + * The OAuth 2.0 scopes that will be requested as part of GitHub Login authentication. * This setting is optional. * * @param gitHubOAuthScopes the gitHubOAuthScopes value to set. @@ -1005,8 +1023,8 @@ public SiteAuthSettingsProperties withTwitterConsumerSecret(String twitterConsum } /** - * Get the twitterConsumerSecretSettingName property: The app setting name that contains the OAuth 1.0a consumer - * secret of the Twitter + * Get the twitterConsumerSecretSettingName property: + * The app setting name that contains the OAuth 1.0a consumer secret of the Twitter * application used for sign-in. * * @return the twitterConsumerSecretSettingName value. @@ -1016,8 +1034,8 @@ public String twitterConsumerSecretSettingName() { } /** - * Set the twitterConsumerSecretSettingName property: The app setting name that contains the OAuth 1.0a consumer - * secret of the Twitter + * Set the twitterConsumerSecretSettingName property: + * The app setting name that contains the OAuth 1.0a consumer secret of the Twitter * application used for sign-in. * * @param twitterConsumerSecretSettingName the twitterConsumerSecretSettingName value to set. @@ -1081,8 +1099,8 @@ public SiteAuthSettingsProperties withMicrosoftAccountClientSecret(String micros } /** - * Get the microsoftAccountClientSecretSettingName property: The app setting name containing the OAuth 2.0 client - * secret that was created for the + * Get the microsoftAccountClientSecretSettingName property: + * The app setting name containing the OAuth 2.0 client secret that was created for the * app used for authentication. * * @return the microsoftAccountClientSecretSettingName value. @@ -1092,8 +1110,8 @@ public String microsoftAccountClientSecretSettingName() { } /** - * Set the microsoftAccountClientSecretSettingName property: The app setting name containing the OAuth 2.0 client - * secret that was created for the + * Set the microsoftAccountClientSecretSettingName property: + * The app setting name containing the OAuth 2.0 client secret that was created for the * app used for authentication. * * @param microsoftAccountClientSecretSettingName the microsoftAccountClientSecretSettingName value to set. @@ -1154,7 +1172,8 @@ public SiteAuthSettingsProperties withIsAuthFromFile(String isAuthFromFile) { } /** - * Get the authFilePath property: The path of the config file containing auth settings. + * Get the authFilePath property: + * The path of the config file containing auth settings. * If the path is relative, base will the site's root directory. * * @return the authFilePath value. @@ -1164,7 +1183,8 @@ public String authFilePath() { } /** - * Set the authFilePath property: The path of the config file containing auth settings. + * Set the authFilePath property: + * The path of the config file containing auth settings. * If the path is relative, base will the site's root directory. * * @param authFilePath the authFilePath value to set. @@ -1176,8 +1196,8 @@ public SiteAuthSettingsProperties withAuthFilePath(String authFilePath) { } /** - * Get the configVersion property: The ConfigVersion of the Authentication / Authorization feature in use for the - * current app. + * Get the configVersion property: + * The ConfigVersion of the Authentication / Authorization feature in use for the current app. * The setting in this value can control the behavior of the control plane for Authentication / Authorization. * * @return the configVersion value. @@ -1187,8 +1207,8 @@ public String configVersion() { } /** - * Set the configVersion property: The ConfigVersion of the Authentication / Authorization feature in use for the - * current app. + * Set the configVersion property: + * The ConfigVersion of the Authentication / Authorization feature in use for the current app. * The setting in this value can control the behavior of the control plane for Authentication / Authorization. * * @param configVersion the configVersion value to set. diff --git a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourceInner.java b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourceInner.java index 8e090c336f4c..f1eebeb8de6e 100644 --- a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourceInner.java +++ b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourceInner.java @@ -529,7 +529,8 @@ public SitePatchResourceInner withClientCertEnabled(Boolean clientCertEnabled) { } /** - * Get the clientCertMode property: This composes with ClientCertEnabled setting. + * Get the clientCertMode property: + * This composes with ClientCertEnabled setting. * - ClientCertEnabled: false means ClientCert is ignored. * - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. * - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. @@ -541,7 +542,8 @@ public ClientCertMode clientCertMode() { } /** - * Set the clientCertMode property: This composes with ClientCertEnabled setting. + * Set the clientCertMode property: + * This composes with ClientCertEnabled setting. * - ClientCertEnabled: false means ClientCert is ignored. * - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. * - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. diff --git a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourcePropertiesInner.java b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourcePropertiesInner.java index 7c1b31f43b3f..a45950e67a0e 100644 --- a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourcePropertiesInner.java +++ b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourcePropertiesInner.java @@ -147,6 +147,7 @@ public final class SitePatchResourcePropertiesInner implements JsonSerializable< private Boolean clientCertEnabled; /* + * * This composes with ClientCertEnabled setting. * - ClientCertEnabled: false means ClientCert is ignored. * - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. @@ -637,7 +638,8 @@ public SitePatchResourcePropertiesInner withClientCertEnabled(Boolean clientCert } /** - * Get the clientCertMode property: This composes with ClientCertEnabled setting. + * Get the clientCertMode property: + * This composes with ClientCertEnabled setting. * - ClientCertEnabled: false means ClientCert is ignored. * - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. * - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. @@ -649,7 +651,8 @@ public ClientCertMode clientCertMode() { } /** - * Set the clientCertMode property: This composes with ClientCertEnabled setting. + * Set the clientCertMode property: + * This composes with ClientCertEnabled setting. * - ClientCertEnabled: false means ClientCert is ignored. * - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. * - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. diff --git a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SnapshotRestoreRequestProperties.java b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SnapshotRestoreRequestProperties.java index bf83fd6e2861..7ac0d017fba7 100644 --- a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SnapshotRestoreRequestProperties.java +++ b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SnapshotRestoreRequestProperties.java @@ -39,6 +39,7 @@ public final class SnapshotRestoreRequestProperties implements JsonSerializable< private Boolean recoverConfiguration; /* + * * If true, custom hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. */ @@ -142,8 +143,8 @@ public SnapshotRestoreRequestProperties withRecoverConfiguration(Boolean recover } /** - * Get the ignoreConflictingHostNames property: If true, custom hostname conflicts will be ignored when recovering - * to a target web app. + * Get the ignoreConflictingHostNames property: + * If true, custom hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * * @return the ignoreConflictingHostNames value. @@ -153,8 +154,8 @@ public Boolean ignoreConflictingHostNames() { } /** - * Set the ignoreConflictingHostNames property: If true, custom hostname conflicts will be ignored when recovering - * to a target web app. + * Set the ignoreConflictingHostNames property: + * If true, custom hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * * @param ignoreConflictingHostNames the ignoreConflictingHostNames value to set. diff --git a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlanPatchResource.java b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlanPatchResource.java index 26e82aa4328f..466e5625f663 100644 --- a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlanPatchResource.java +++ b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlanPatchResource.java @@ -212,8 +212,8 @@ public String geoRegion() { } /** - * Get the perSiteScaling property: If <code>true</code>, apps assigned to this App Service plan can be - * scaled independently. + * Get the perSiteScaling property: + * If <code>true</code>, apps assigned to this App Service plan can be scaled independently. * If <code>false</code>, apps assigned to this App Service plan will scale to all instances of the * plan. * @@ -224,8 +224,8 @@ public Boolean perSiteScaling() { } /** - * Set the perSiteScaling property: If <code>true</code>, apps assigned to this App Service plan can be - * scaled independently. + * Set the perSiteScaling property: + * If <code>true</code>, apps assigned to this App Service plan can be scaled independently. * If <code>false</code>, apps assigned to this App Service plan will scale to all instances of the * plan. * @@ -535,8 +535,8 @@ public AppServicePlanPatchResource withKubeEnvironmentProfile(KubeEnvironmentPro } /** - * Get the zoneRedundant property: If <code>true</code>, this App Service Plan will perform availability - * zone balancing. + * Get the zoneRedundant property: + * If <code>true</code>, this App Service Plan will perform availability zone balancing. * If <code>false</code>, this App Service Plan will not perform availability zone balancing. * * @return the zoneRedundant value. @@ -546,8 +546,8 @@ public Boolean zoneRedundant() { } /** - * Set the zoneRedundant property: If <code>true</code>, this App Service Plan will perform availability - * zone balancing. + * Set the zoneRedundant property: + * If <code>true</code>, this App Service Plan will perform availability zone balancing. * If <code>false</code>, this App Service Plan will not perform availability zone balancing. * * @param zoneRedundant the zoneRedundant value to set. diff --git a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealActions.java b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealActions.java index ea47e5eb34b8..a530a3e3211b 100644 --- a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealActions.java +++ b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealActions.java @@ -27,6 +27,7 @@ public final class AutoHealActions implements JsonSerializable private AutoHealCustomAction customAction; /* + * * Minimum time the process must execute * before taking the action */ @@ -79,7 +80,8 @@ public AutoHealActions withCustomAction(AutoHealCustomAction customAction) { } /** - * Get the minProcessExecutionTime property: Minimum time the process must execute + * Get the minProcessExecutionTime property: + * Minimum time the process must execute * before taking the action. * * @return the minProcessExecutionTime value. @@ -89,7 +91,8 @@ public String minProcessExecutionTime() { } /** - * Set the minProcessExecutionTime property: Minimum time the process must execute + * Set the minProcessExecutionTime property: + * Minimum time the process must execute * before taking the action. * * @param minProcessExecutionTime the minProcessExecutionTime value to set. diff --git a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SnapshotRestoreRequest.java b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SnapshotRestoreRequest.java index 3b8cfd145875..66b6013d60b0 100644 --- a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SnapshotRestoreRequest.java +++ b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SnapshotRestoreRequest.java @@ -189,8 +189,8 @@ public SnapshotRestoreRequest withRecoverConfiguration(Boolean recoverConfigurat } /** - * Get the ignoreConflictingHostNames property: If true, custom hostname conflicts will be ignored when recovering - * to a target web app. + * Get the ignoreConflictingHostNames property: + * If true, custom hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * * @return the ignoreConflictingHostNames value. @@ -200,8 +200,8 @@ public Boolean ignoreConflictingHostNames() { } /** - * Set the ignoreConflictingHostNames property: If true, custom hostname conflicts will be ignored when recovering - * to a target web app. + * Set the ignoreConflictingHostNames property: + * If true, custom hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * * @param ignoreConflictingHostNames the ignoreConflictingHostNames value to set. diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IdentitySource.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IdentitySource.java index e5bcdc6c737f..d1c0924799a2 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IdentitySource.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IdentitySource.java @@ -57,12 +57,14 @@ public final class IdentitySource implements JsonSerializable { private SslEnum ssl; /* + * * The ID of an Active Directory user with a minimum of read-only access to Base * DN for users and group */ private String username; /* + * * The password of the Active Directory user with a minimum of read-only access to * Base DN for users and groups. */ @@ -235,7 +237,8 @@ public IdentitySource withSsl(SslEnum ssl) { } /** - * Get the username property: The ID of an Active Directory user with a minimum of read-only access to Base + * Get the username property: + * The ID of an Active Directory user with a minimum of read-only access to Base * DN for users and group. * * @return the username value. @@ -245,7 +248,8 @@ public String username() { } /** - * Set the username property: The ID of an Active Directory user with a minimum of read-only access to Base + * Set the username property: + * The ID of an Active Directory user with a minimum of read-only access to Base * DN for users and group. * * @param username the username value to set. @@ -257,7 +261,8 @@ public IdentitySource withUsername(String username) { } /** - * Get the password property: The password of the Active Directory user with a minimum of read-only access to + * Get the password property: + * The password of the Active Directory user with a minimum of read-only access to * Base DN for users and groups. * * @return the password value. @@ -267,7 +272,8 @@ public String password() { } /** - * Set the password property: The password of the Active Directory user with a minimum of read-only access to + * Set the password property: + * The password of the Active Directory user with a minimum of read-only access to * Base DN for users and groups. * * @param password the password value to set. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/PhysicalToLogicalZoneMapping.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/PhysicalToLogicalZoneMapping.java index f097b31ae1d6..46c4265b6aae 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/PhysicalToLogicalZoneMapping.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/PhysicalToLogicalZoneMapping.java @@ -22,6 +22,7 @@ public final class PhysicalToLogicalZoneMapping implements JsonSerializable PROPERTIES - = CoreUtils.getProperties("azure-resourcemanager-cognitiveservices.properties"); - - private HttpClient httpClient; - private HttpLogOptions httpLogOptions; - private final List policies = new ArrayList<>(); - private final List scopes = new ArrayList<>(); - private RetryPolicy retryPolicy; - private RetryOptions retryOptions; - private Duration defaultPollInterval; - - private Configurable() { - } - - /** - * Sets the http client. - * - * @param httpClient the HTTP client. - * @return the configurable object itself. - */ - public Configurable withHttpClient(HttpClient httpClient) { - this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); - return this; - } - - /** - * Sets the logging options to the HTTP pipeline. - * - * @param httpLogOptions the HTTP log options. - * @return the configurable object itself. - */ - public Configurable withLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); - return this; - } - - /** - * Adds the pipeline policy to the HTTP pipeline. - * - * @param policy the HTTP pipeline policy. - * @return the configurable object itself. - */ - public Configurable withPolicy(HttpPipelinePolicy policy) { - this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); - return this; - } - - /** - * Adds the scope to permission sets. - * - * @param scope the scope. - * @return the configurable object itself. - */ - public Configurable withScope(String scope) { - this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); - return this; - } - - /** - * Sets the retry policy to the HTTP pipeline. - * - * @param retryPolicy the HTTP pipeline retry policy. - * @return the configurable object itself. - */ - public Configurable withRetryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); - return this; - } - - /** - * Sets the retry options for the HTTP pipeline retry policy. - *

- * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. - * - * @param retryOptions the retry options for the HTTP pipeline retry policy. - * @return the configurable object itself. - */ - public Configurable withRetryOptions(RetryOptions retryOptions) { - this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); - return this; - } - - /** - * Sets the default poll interval, used when service does not provide "Retry-After" header. - * - * @param defaultPollInterval the default poll interval. - * @return the configurable object itself. - */ - public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval - = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); - if (this.defaultPollInterval.isNegative()) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); - } - return this; - } - - /** - * Creates an instance of CognitiveServices service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the CognitiveServices service API instance. - */ - public CognitiveServicesManager authenticate(TokenCredential credential, AzureProfile profile) { - 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.cognitiveservices") - .append("/") - .append(clientVersion); - if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder.append(" (") - .append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.name")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")) - .append("; auto-generated)"); - } else { - userAgentBuilder.append(" (auto-generated)"); - } - - if (scopes.isEmpty()) { - scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); - } - if (retryPolicy == null) { - if (retryOptions != null) { - retryPolicy = new RetryPolicy(retryOptions); - } else { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); - } - } - List policies = new ArrayList<>(); - policies.add(new UserAgentPolicy(userAgentBuilder.toString())); - policies.add(new AddHeadersFromContextPolicy()); - policies.add(new RequestIdPolicy()); - policies.addAll(this.policies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(retryPolicy); - policies.add(new AddDatePolicy()); - policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies.addAll(this.policies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); - return new CognitiveServicesManager(httpPipeline, profile, defaultPollInterval); - } - } - - /** - * Gets the resource collection API of ResourceProviders. - * - * @return Resource collection API of ResourceProviders. - */ - public ResourceProviders resourceProviders() { - if (this.resourceProviders == null) { - this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); - } - return resourceProviders; - } - - /** - * Gets the resource collection API of Operations. - * - * @return Resource collection API of Operations. - */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); - } - return operations; - } - - /** - * Gets the resource collection API of Accounts. It manages Account. - * - * @return Resource collection API of Accounts. - */ - public Accounts accounts() { - if (this.accounts == null) { - this.accounts = new AccountsImpl(clientObject.getAccounts(), this); - } - return accounts; - } - - /** - * Gets the resource collection API of DeletedAccounts. - * - * @return Resource collection API of DeletedAccounts. - */ - public DeletedAccounts deletedAccounts() { - if (this.deletedAccounts == null) { - this.deletedAccounts = new DeletedAccountsImpl(clientObject.getDeletedAccounts(), this); - } - return deletedAccounts; - } - - /** - * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. - * - * @return Resource collection API of PrivateEndpointConnections. - */ - public PrivateEndpointConnections privateEndpointConnections() { - if (this.privateEndpointConnections == null) { - this.privateEndpointConnections - = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); - } - return privateEndpointConnections; - } - - /** - * Gets the resource collection API of Deployments. It manages Deployment. - * - * @return Resource collection API of Deployments. - */ - public Deployments deployments() { - if (this.deployments == null) { - this.deployments = new DeploymentsImpl(clientObject.getDeployments(), this); - } - return deployments; - } - - /** - * Gets the resource collection API of CommitmentPlans. It manages CommitmentPlan, CommitmentPlanAccountAssociation. - * - * @return Resource collection API of CommitmentPlans. - */ - public CommitmentPlans commitmentPlans() { - if (this.commitmentPlans == null) { - this.commitmentPlans = new CommitmentPlansImpl(clientObject.getCommitmentPlans(), this); - } - return commitmentPlans; - } - - /** - * Gets the resource collection API of EncryptionScopes. It manages EncryptionScope. - * - * @return Resource collection API of EncryptionScopes. - */ - public EncryptionScopes encryptionScopes() { - if (this.encryptionScopes == null) { - this.encryptionScopes = new EncryptionScopesImpl(clientObject.getEncryptionScopes(), this); - } - return encryptionScopes; - } - - /** - * Gets the resource collection API of RaiPolicies. It manages RaiPolicy. - * - * @return Resource collection API of RaiPolicies. - */ - public RaiPolicies raiPolicies() { - if (this.raiPolicies == null) { - this.raiPolicies = new RaiPoliciesImpl(clientObject.getRaiPolicies(), this); - } - return raiPolicies; - } - - /** - * Gets the resource collection API of SubscriptionRaiPolicies. - * - * @return Resource collection API of SubscriptionRaiPolicies. - */ - public SubscriptionRaiPolicies subscriptionRaiPolicies() { - if (this.subscriptionRaiPolicies == null) { - this.subscriptionRaiPolicies - = new SubscriptionRaiPoliciesImpl(clientObject.getSubscriptionRaiPolicies(), this); - } - return subscriptionRaiPolicies; - } - - /** - * Gets the resource collection API of RaiBlocklistItems. It manages RaiBlocklistItem. - * - * @return Resource collection API of RaiBlocklistItems. - */ - public RaiBlocklistItems raiBlocklistItems() { - if (this.raiBlocklistItems == null) { - this.raiBlocklistItems = new RaiBlocklistItemsImpl(clientObject.getRaiBlocklistItems(), this); - } - return raiBlocklistItems; - } - - /** - * Gets the resource collection API of RaiBlocklists. It manages RaiBlocklist. - * - * @return Resource collection API of RaiBlocklists. - */ - public RaiBlocklists raiBlocklists() { - if (this.raiBlocklists == null) { - this.raiBlocklists = new RaiBlocklistsImpl(clientObject.getRaiBlocklists(), this); - } - return raiBlocklists; - } - - /** - * Gets the resource collection API of RaiTopics. It manages RaiTopic. - * - * @return Resource collection API of RaiTopics. - */ - public RaiTopics raiTopics() { - if (this.raiTopics == null) { - this.raiTopics = new RaiTopicsImpl(clientObject.getRaiTopics(), this); - } - return raiTopics; - } - - /** - * Gets the resource collection API of RaiToolLabels. It manages RaiToolLabel. - * - * @return Resource collection API of RaiToolLabels. - */ - public RaiToolLabels raiToolLabels() { - if (this.raiToolLabels == null) { - this.raiToolLabels = new RaiToolLabelsImpl(clientObject.getRaiToolLabels(), this); - } - return raiToolLabels; - } - - /** - * Gets the resource collection API of RaiContentFilters. - * - * @return Resource collection API of RaiContentFilters. - */ - public RaiContentFilters raiContentFilters() { - if (this.raiContentFilters == null) { - this.raiContentFilters = new RaiContentFiltersImpl(clientObject.getRaiContentFilters(), this); - } - return raiContentFilters; - } - - /** - * Gets the resource collection API of NetworkSecurityPerimeterConfigurations. - * - * @return Resource collection API of NetworkSecurityPerimeterConfigurations. - */ - public NetworkSecurityPerimeterConfigurations networkSecurityPerimeterConfigurations() { - if (this.networkSecurityPerimeterConfigurations == null) { - this.networkSecurityPerimeterConfigurations = new NetworkSecurityPerimeterConfigurationsImpl( - clientObject.getNetworkSecurityPerimeterConfigurations(), this); - } - return networkSecurityPerimeterConfigurations; - } - - /** - * Gets the resource collection API of DefenderForAISettings. It manages DefenderForAISetting. - * - * @return Resource collection API of DefenderForAISettings. - */ - public DefenderForAISettings defenderForAISettings() { - if (this.defenderForAISettings == null) { - this.defenderForAISettings = new DefenderForAISettingsImpl(clientObject.getDefenderForAISettings(), this); - } - return defenderForAISettings; - } - - /** - * Gets the resource collection API of Projects. It manages Project. - * - * @return Resource collection API of Projects. - */ - public Projects projects() { - if (this.projects == null) { - this.projects = new ProjectsImpl(clientObject.getProjects(), this); - } - return projects; - } - - /** - * Gets the resource collection API of ProjectConnections. It manages ConnectionPropertiesV2BasicResource. - * - * @return Resource collection API of ProjectConnections. - */ - public ProjectConnections projectConnections() { - if (this.projectConnections == null) { - this.projectConnections = new ProjectConnectionsImpl(clientObject.getProjectConnections(), this); - } - return projectConnections; - } - - /** - * Gets the resource collection API of ProjectCapabilityHosts. It manages ProjectCapabilityHost. - * - * @return Resource collection API of ProjectCapabilityHosts. - */ - public ProjectCapabilityHosts projectCapabilityHosts() { - if (this.projectCapabilityHosts == null) { - this.projectCapabilityHosts - = new ProjectCapabilityHostsImpl(clientObject.getProjectCapabilityHosts(), this); - } - return projectCapabilityHosts; - } - - /** - * Gets the resource collection API of QuotaTiers. It manages QuotaTier. - * - * @return Resource collection API of QuotaTiers. - */ - public QuotaTiers quotaTiers() { - if (this.quotaTiers == null) { - this.quotaTiers = new QuotaTiersImpl(clientObject.getQuotaTiers(), this); - } - return quotaTiers; - } - - /** - * Gets the resource collection API of AgentApplications. It manages AgentApplication. - * - * @return Resource collection API of AgentApplications. - */ - public AgentApplications agentApplications() { - if (this.agentApplications == null) { - this.agentApplications = new AgentApplicationsImpl(clientObject.getAgentApplications(), this); - } - return agentApplications; - } - - /** - * Gets the resource collection API of ManagedComputeDeployments. It manages ManagedComputeDeployment. - * - * @return Resource collection API of ManagedComputeDeployments. - */ - public ManagedComputeDeployments managedComputeDeployments() { - if (this.managedComputeDeployments == null) { - this.managedComputeDeployments - = new ManagedComputeDeploymentsImpl(clientObject.getManagedComputeDeployments(), this); - } - return managedComputeDeployments; - } - - /** - * Gets the resource collection API of ComputeOperations. - * - * @return Resource collection API of ComputeOperations. - */ - public ComputeOperations computeOperations() { - if (this.computeOperations == null) { - this.computeOperations = new ComputeOperationsImpl(clientObject.getComputeOperations(), this); - } - return computeOperations; - } - - /** - * Gets the resource collection API of ManagedComputeUsagesOperationGroups. - * - * @return Resource collection API of ManagedComputeUsagesOperationGroups. - */ - public ManagedComputeUsagesOperationGroups managedComputeUsagesOperationGroups() { - if (this.managedComputeUsagesOperationGroups == null) { - this.managedComputeUsagesOperationGroups = new ManagedComputeUsagesOperationGroupsImpl( - clientObject.getManagedComputeUsagesOperationGroups(), this); - } - return managedComputeUsagesOperationGroups; - } - - /** - * Gets the resource collection API of Computes. It manages Compute. - * - * @return Resource collection API of Computes. - */ - public Computes computes() { - if (this.computes == null) { - this.computes = new ComputesImpl(clientObject.getComputes(), this); - } - return computes; - } - - /** - * Gets the resource collection API of Workbenches. It manages Workbench. - * - * @return Resource collection API of Workbenches. - */ - public Workbenches workbenches() { - if (this.workbenches == null) { - this.workbenches = new WorkbenchesImpl(clientObject.getWorkbenches(), this); - } - return workbenches; - } - - /** - * Gets the resource collection API of ManagedComputeCapacities. - * - * @return Resource collection API of ManagedComputeCapacities. - */ - public ManagedComputeCapacities managedComputeCapacities() { - if (this.managedComputeCapacities == null) { - this.managedComputeCapacities - = new ManagedComputeCapacitiesImpl(clientObject.getManagedComputeCapacities(), this); - } - return managedComputeCapacities; - } - - /** - * Gets the resource collection API of PrivateLinkResources. - * - * @return Resource collection API of PrivateLinkResources. - */ - public PrivateLinkResources privateLinkResources() { - if (this.privateLinkResources == null) { - this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); - } - return privateLinkResources; - } - - /** - * Gets the resource collection API of TestRaiExternalSafetyProviders. It manages RaiExternalSafetyProviderSchema. - * - * @return Resource collection API of TestRaiExternalSafetyProviders. - */ - public TestRaiExternalSafetyProviders testRaiExternalSafetyProviders() { - if (this.testRaiExternalSafetyProviders == null) { - this.testRaiExternalSafetyProviders - = new TestRaiExternalSafetyProvidersImpl(clientObject.getTestRaiExternalSafetyProviders(), this); - } - return testRaiExternalSafetyProviders; - } - - /** - * Gets the resource collection API of RaiExternalSafetyProviders. - * - * @return Resource collection API of RaiExternalSafetyProviders. - */ - public RaiExternalSafetyProviders raiExternalSafetyProviders() { - if (this.raiExternalSafetyProviders == null) { - this.raiExternalSafetyProviders - = new RaiExternalSafetyProvidersImpl(clientObject.getRaiExternalSafetyProviders(), this); - } - return raiExternalSafetyProviders; - } - - /** - * Gets the resource collection API of RaiExternalSafetyProvidersOperations. - * - * @return Resource collection API of RaiExternalSafetyProvidersOperations. - */ - public RaiExternalSafetyProvidersOperations raiExternalSafetyProvidersOperations() { - if (this.raiExternalSafetyProvidersOperations == null) { - this.raiExternalSafetyProvidersOperations = new RaiExternalSafetyProvidersOperationsImpl( - clientObject.getRaiExternalSafetyProvidersOperations(), this); - } - return raiExternalSafetyProvidersOperations; - } - - /** - * Gets the resource collection API of AccountConnections. - * - * @return Resource collection API of AccountConnections. - */ - public AccountConnections accountConnections() { - if (this.accountConnections == null) { - this.accountConnections = new AccountConnectionsImpl(clientObject.getAccountConnections(), this); - } - return accountConnections; - } - - /** - * Gets the resource collection API of AccountCapabilityHosts. It manages CapabilityHost. - * - * @return Resource collection API of AccountCapabilityHosts. - */ - public AccountCapabilityHosts accountCapabilityHosts() { - if (this.accountCapabilityHosts == null) { - this.accountCapabilityHosts - = new AccountCapabilityHostsImpl(clientObject.getAccountCapabilityHosts(), this); - } - return accountCapabilityHosts; - } - - /** - * Gets the resource collection API of OutboundRules. It manages OutboundRuleBasicResource. - * - * @return Resource collection API of OutboundRules. - */ - public OutboundRules outboundRules() { - if (this.outboundRules == null) { - this.outboundRules = new OutboundRulesImpl(clientObject.getOutboundRules(), this); - } - return outboundRules; - } - - /** - * Gets the resource collection API of ManagedNetworkSettingsOperations. It manages - * ManagedNetworkSettingsPropertiesBasicResource. - * - * @return Resource collection API of ManagedNetworkSettingsOperations. - */ - public ManagedNetworkSettingsOperations managedNetworkSettingsOperations() { - if (this.managedNetworkSettingsOperations == null) { - this.managedNetworkSettingsOperations - = new ManagedNetworkSettingsOperationsImpl(clientObject.getManagedNetworkSettingsOperations(), this); - } - return managedNetworkSettingsOperations; - } - - /** - * Gets the resource collection API of OutboundRulesOperations. - * - * @return Resource collection API of OutboundRulesOperations. - */ - public OutboundRulesOperations outboundRulesOperations() { - if (this.outboundRulesOperations == null) { - this.outboundRulesOperations - = new OutboundRulesOperationsImpl(clientObject.getOutboundRulesOperations(), this); - } - return outboundRulesOperations; - } - - /** - * Gets the resource collection API of ManagedNetworkProvisions. - * - * @return Resource collection API of ManagedNetworkProvisions. - */ - public ManagedNetworkProvisions managedNetworkProvisions() { - if (this.managedNetworkProvisions == null) { - this.managedNetworkProvisions - = new ManagedNetworkProvisionsImpl(clientObject.getManagedNetworkProvisions(), this); - } - return managedNetworkProvisions; - } - - /** - * Gets the resource collection API of AgentDeployments. It manages AgentDeployment. - * - * @return Resource collection API of AgentDeployments. - */ - public AgentDeployments agentDeployments() { - if (this.agentDeployments == null) { - this.agentDeployments = new AgentDeploymentsImpl(clientObject.getAgentDeployments(), this); - } - return agentDeployments; - } - - /** - * Gets the resource collection API of ResourceSkus. - * - * @return Resource collection API of ResourceSkus. - */ - public ResourceSkus resourceSkus() { - if (this.resourceSkus == null) { - this.resourceSkus = new ResourceSkusImpl(clientObject.getResourceSkus(), this); - } - return resourceSkus; - } - - /** - * Gets the resource collection API of Usages. - * - * @return Resource collection API of Usages. - */ - public Usages usages() { - if (this.usages == null) { - this.usages = new UsagesImpl(clientObject.getUsages(), this); - } - return usages; - } - - /** - * Gets the resource collection API of CommitmentTiers. - * - * @return Resource collection API of CommitmentTiers. - */ - public CommitmentTiers commitmentTiers() { - if (this.commitmentTiers == null) { - this.commitmentTiers = new CommitmentTiersImpl(clientObject.getCommitmentTiers(), this); - } - return commitmentTiers; - } - - /** - * Gets the resource collection API of Models. - * - * @return Resource collection API of Models. - */ - public Models models() { - if (this.models == null) { - this.models = new ModelsImpl(clientObject.getModels(), this); - } - return models; - } - - /** - * Gets the resource collection API of LocationBasedModelCapacities. - * - * @return Resource collection API of LocationBasedModelCapacities. - */ - public LocationBasedModelCapacities locationBasedModelCapacities() { - if (this.locationBasedModelCapacities == null) { - this.locationBasedModelCapacities - = new LocationBasedModelCapacitiesImpl(clientObject.getLocationBasedModelCapacities(), this); - } - return locationBasedModelCapacities; - } - - /** - * Gets the resource collection API of ModelCapacities. - * - * @return Resource collection API of ModelCapacities. - */ - public ModelCapacities modelCapacities() { - if (this.modelCapacities == null) { - this.modelCapacities = new ModelCapacitiesImpl(clientObject.getModelCapacities(), this); - } - return modelCapacities; - } - - /** - * Gets wrapped service client CognitiveServicesManagementClient providing direct access to the underlying - * auto-generated API implementation, based on Azure REST API. - * - * @return Wrapped service client CognitiveServicesManagementClient. - */ - public CognitiveServicesManagementClient serviceClient() { - return this.clientObject; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountCapabilityHostsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountCapabilityHostsClient.java deleted file mode 100644 index baaa0c2a3778..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountCapabilityHostsClient.java +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.CapabilityHostInner; - -/** - * An instance of this class provides access to all the operations defined in AccountCapabilityHostsClient. - */ -public interface AccountCapabilityHostsClient { - /** - * Get account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 account capabilityHost along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, - String capabilityHostName, Context context); - - /** - * Get account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 account capabilityHost. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CapabilityHostInner get(String resourceGroupName, String accountName, String capabilityHostName); - - /** - * Create or update account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 azure Resource Manager resource envelope. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CapabilityHostInner> beginCreateOrUpdate(String resourceGroupName, - String accountName, String capabilityHostName, CapabilityHostInner capabilityHost); - - /** - * Create or update account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @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 azure Resource Manager resource envelope. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CapabilityHostInner> beginCreateOrUpdate(String resourceGroupName, - String accountName, String capabilityHostName, CapabilityHostInner capabilityHost, Context context); - - /** - * Create or update account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String capabilityHostName, - CapabilityHostInner capabilityHost); - - /** - * Create or update account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @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 azure Resource Manager resource envelope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String capabilityHostName, - CapabilityHostInner capabilityHost, Context context); - - /** - * Delete account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String capabilityHostName); - - /** - * Delete account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String capabilityHostName, Context context); - - /** - * Delete account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String capabilityHostName); - - /** - * Delete account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String capabilityHostName, Context context); - - /** - * List capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 paginated list of Capability Host entities as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * List capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 paginated list of Capability Host entities as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountConnectionsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountConnectionsClient.java deleted file mode 100644 index cd71b737a640..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountConnectionsClient.java +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; -import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; - -/** - * An instance of this class provides access to all the operations defined in AccountConnectionsClient. - */ -public interface AccountConnectionsClient { - /** - * Lists Cognitive Services account connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @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 connection base resource schema along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, - String connectionName, Context context); - - /** - * Lists Cognitive Services account connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionPropertiesV2BasicResourceInner get(String resourceGroupName, String accountName, String connectionName); - - /** - * Create or update Cognitive Services account connection under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @param connection The object for creating or updating a new account connection. - * @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 connection base resource schema along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(String resourceGroupName, String accountName, - String connectionName, ConnectionPropertiesV2BasicResourceInner connection, Context context); - - /** - * Create or update Cognitive Services account connection under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionPropertiesV2BasicResourceInner create(String resourceGroupName, String accountName, - String connectionName); - - /** - * Update Cognitive Services account connection under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @param connection Parameters for account connection update. - * @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 connection base resource schema along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String accountName, - String connectionName, ConnectionUpdateContent connection, Context context); - - /** - * Update Cognitive Services account connection under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionPropertiesV2BasicResourceInner update(String resourceGroupName, String accountName, - String connectionName); - - /** - * Delete Cognitive Services account connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String accountName, String connectionName, - Context context); - - /** - * Delete Cognitive Services account connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String connectionName); - - /** - * Lists all the available Cognitive Services account connections under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Lists all the available Cognitive Services account connections under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param target Target of the connection. - * @param category Category of the connection. - * @param includeAll query parameter that indicates if get connection call should return both connections and - * datastores. - * @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 paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, - String target, String category, Boolean includeAll, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountsClient.java deleted file mode 100644 index 165058be53d9..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountsClient.java +++ /dev/null @@ -1,466 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.AccountInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountModelInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountSkuListResultInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ApiKeysInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.EvaluateDeploymentPoliciesResponseInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.EvaluateDeploymentPoliciesRequest; -import com.azure.resourcemanager.cognitiveservices.models.RegenerateKeyParameters; - -/** - * An instance of this class provides access to all the operations defined in AccountsClient. - */ -public interface AccountsClient { - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, - Context context); - - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccountInner getByResourceGroup(String resourceGroupName, String accountName); - - /** - * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for - * developer to access intelligent APIs. It's also the resource type for billing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 cognitive Services account is an Azure resource representing the - * provisioned account, it's type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AccountInner> beginCreate(String resourceGroupName, String accountName, - AccountInner account); - - /** - * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for - * developer to access intelligent APIs. It's also the resource type for billing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created account. - * @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 cognitive Services account is an Azure resource representing the - * provisioned account, it's type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AccountInner> beginCreate(String resourceGroupName, String accountName, - AccountInner account, Context context); - - /** - * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for - * developer to access intelligent APIs. It's also the resource type for billing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccountInner create(String resourceGroupName, String accountName, AccountInner account); - - /** - * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for - * developer to access intelligent APIs. It's also the resource type for billing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created account. - * @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 cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccountInner create(String resourceGroupName, String accountName, AccountInner account, Context context); - - /** - * Updates a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 cognitive Services account is an Azure resource representing the - * provisioned account, it's type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AccountInner> beginUpdate(String resourceGroupName, String accountName, - AccountInner account); - - /** - * Updates a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created account. - * @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 cognitive Services account is an Azure resource representing the - * provisioned account, it's type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AccountInner> beginUpdate(String resourceGroupName, String accountName, - AccountInner account, Context context); - - /** - * Updates a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccountInner update(String resourceGroupName, String accountName, AccountInner account); - - /** - * Updates a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created account. - * @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 cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccountInner update(String resourceGroupName, String accountName, AccountInner account, Context context); - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName); - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 accountName, Context context); - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName); - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 accountName, Context context); - - /** - * Returns all the resources of a particular type belonging to a resource group. - * - * @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 the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Returns all the resources of a particular type belonging to 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 com.azure.core.management.exception.ManagementException 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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Lists the account keys for the specified Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 access keys for the cognitive services account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listKeysWithResponse(String resourceGroupName, String accountName, Context context); - - /** - * Lists the account keys for the specified Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the access keys for the cognitive services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApiKeysInner listKeys(String resourceGroupName, String accountName); - - /** - * Regenerates the specified account key for the specified Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param parameters regenerate key parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the access keys for the cognitive services account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response regenerateKeyWithResponse(String resourceGroupName, String accountName, - RegenerateKeyParameters parameters, Context context); - - /** - * Regenerates the specified account key for the specified Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param parameters regenerate key parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the access keys for the cognitive services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApiKeysInner regenerateKey(String resourceGroupName, String accountName, RegenerateKeyParameters parameters); - - /** - * List available SKUs for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 cognitive services accounts operation response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listSkusWithResponse(String resourceGroupName, String accountName, - Context context); - - /** - * List available SKUs for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 cognitive services accounts operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccountSkuListResultInner listSkus(String resourceGroupName, String accountName); - - /** - * Get usages for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is - * name.value (name of the metric, can have an or of multiple names). - * @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 usages for the requested Cognitive Services account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listUsagesWithResponse(String resourceGroupName, String accountName, String filter, - Context context); - - /** - * Get usages for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usages for the requested Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - UsageListResultInner listUsages(String resourceGroupName, String accountName); - - /** - * List available Models for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listModels(String resourceGroupName, String accountName); - - /** - * List available Models for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listModels(String resourceGroupName, String accountName, Context context); - - /** - * Evaluate Azure Policy compliance for a set of hypothetical deployments without creating them. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param body The content of the action request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response body for the evaluateDeploymentPolicies action along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response evaluateDeploymentPoliciesWithResponse(String resourceGroupName, - String accountName, EvaluateDeploymentPoliciesRequest body, Context context); - - /** - * Evaluate Azure Policy compliance for a set of hypothetical deployments without creating them. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param body The content of the action request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response body for the evaluateDeploymentPolicies action. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EvaluateDeploymentPoliciesResponseInner evaluateDeploymentPolicies(String resourceGroupName, String accountName, - EvaluateDeploymentPoliciesRequest body); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AgentApplicationsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AgentApplicationsClient.java deleted file mode 100644 index b478a77d2526..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AgentApplicationsClient.java +++ /dev/null @@ -1,318 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.AgentApplicationInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentReferenceResourceArmPaginatedResultInner; -import java.util.List; - -/** - * An instance of this class provides access to all the operations defined in AgentApplicationsClient. - */ -public interface AgentApplicationsClient { - /** - * Gets an Agent Application by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @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 Agent Application by name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, String projectName, - String name, Context context); - - /** - * Gets an Agent Application by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Agent Application by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AgentApplicationInner get(String resourceGroupName, String accountName, String projectName, String name); - - /** - * Creates or updates an Agent Application (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @param body Agent Application definition object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 agent Application resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AgentApplicationInner> beginCreateOrUpdate(String resourceGroupName, - String accountName, String projectName, String name, AgentApplicationInner body); - - /** - * Creates or updates an Agent Application (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @param body Agent Application definition object. - * @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 agent Application resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AgentApplicationInner> beginCreateOrUpdate(String resourceGroupName, - String accountName, String projectName, String name, AgentApplicationInner body, Context context); - - /** - * Creates or updates an Agent Application (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @param body Agent Application definition object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Application resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AgentApplicationInner createOrUpdate(String resourceGroupName, String accountName, String projectName, String name, - AgentApplicationInner body); - - /** - * Creates or updates an Agent Application (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @param body Agent Application definition object. - * @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 agent Application resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AgentApplicationInner createOrUpdate(String resourceGroupName, String accountName, String projectName, String name, - AgentApplicationInner body, Context context); - - /** - * Delete Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, String projectName, - String name); - - /** - * Delete Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @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 accountName, String projectName, - String name, Context context); - - /** - * Delete Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String projectName, String name); - - /** - * Delete Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @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 accountName, String projectName, String name, Context context); - - /** - * Lists Agent Applications in the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 paginated list of Agent Application entities as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, String projectName); - - /** - * Lists Agent Applications in the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param count Number of agent applications to be retrieved in a page of results. - * @param skip Number of agent applications to skip. - * @param skipToken Continuation token for pagination. - * @param names Names of agent applications to retrieve. - * @param searchText Search text for filtering agent applications. - * @param orderBy Field to order by. - * @param orderByAsc Whether to order in ascending order. - * @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 paginated list of Agent Application entities as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, String projectName, - Integer count, Integer skip, String skipToken, List names, String searchText, String orderBy, - Boolean orderByAsc, Context context); - - /** - * Lists agents for an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @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 paginated list of Agent Reference entities along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listAgentsWithResponse(String resourceGroupName, - String accountName, String projectName, String name, Context context); - - /** - * Lists agents for an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 paginated list of Agent Reference entities. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AgentReferenceResourceArmPaginatedResultInner listAgents(String resourceGroupName, String accountName, - String projectName, String name); - - /** - * Enables an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @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 enableWithResponse(String resourceGroupName, String accountName, String projectName, String name, - Context context); - - /** - * Enables an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 enable(String resourceGroupName, String accountName, String projectName, String name); - - /** - * Disables an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @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 disableWithResponse(String resourceGroupName, String accountName, String projectName, String name, - Context context); - - /** - * Disables an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 disable(String resourceGroupName, String accountName, String projectName, String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AgentDeploymentsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AgentDeploymentsClient.java deleted file mode 100644 index 881f9556f1f8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AgentDeploymentsClient.java +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.AgentDeploymentInner; -import java.util.List; - -/** - * An instance of this class provides access to all the operations defined in AgentDeploymentsClient. - */ -public interface AgentDeploymentsClient { - /** - * Gets an Agent Deployment by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @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 Agent Deployment by name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, String projectName, - String appName, String deploymentName, Context context); - - /** - * Gets an Agent Deployment by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Agent Deployment by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AgentDeploymentInner get(String resourceGroupName, String accountName, String projectName, String appName, - String deploymentName); - - /** - * Creates or updates an Agent Deployment (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param body Agent Deployment definition object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 agent Deployment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AgentDeploymentInner> beginCreateOrUpdate(String resourceGroupName, - String accountName, String projectName, String appName, String deploymentName, AgentDeploymentInner body); - - /** - * Creates or updates an Agent Deployment (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param body Agent Deployment definition object. - * @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 agent Deployment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AgentDeploymentInner> beginCreateOrUpdate(String resourceGroupName, - String accountName, String projectName, String appName, String deploymentName, AgentDeploymentInner body, - Context context); - - /** - * Creates or updates an Agent Deployment (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param body Agent Deployment definition object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Deployment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AgentDeploymentInner createOrUpdate(String resourceGroupName, String accountName, String projectName, - String appName, String deploymentName, AgentDeploymentInner body); - - /** - * Creates or updates an Agent Deployment (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param body Agent Deployment definition object. - * @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 agent Deployment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AgentDeploymentInner createOrUpdate(String resourceGroupName, String accountName, String projectName, - String appName, String deploymentName, AgentDeploymentInner body, Context context); - - /** - * Delete Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, String projectName, - String appName, String deploymentName); - - /** - * Delete Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @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 accountName, String projectName, - String appName, String deploymentName, Context context); - - /** - * Delete Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String projectName, String appName, - String deploymentName); - - /** - * Delete Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @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 accountName, String projectName, String appName, String deploymentName, - Context context); - - /** - * Lists Agent Deployments in the application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 paginated list of Agent Deployment entities as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, String projectName, - String appName); - - /** - * Lists Agent Deployments in the application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param count Number of agent deployments to be retrieved in a page of results. - * @param skipToken Continuation token for pagination. - * @param names Names of agent deployments to retrieve. - * @param orderBy Field to order by. - * @param orderByAsc Whether to order in ascending order. - * @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 paginated list of Agent Deployment entities as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, String projectName, - String appName, Integer count, String skipToken, List names, String orderBy, Boolean orderByAsc, - Context context); - - /** - * Starts an Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @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 startWithResponse(String resourceGroupName, String accountName, String projectName, String appName, - String deploymentName, Context context); - - /** - * Starts an Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String projectName, String appName, String deploymentName); - - /** - * Stops an Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @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 accountName, String projectName, String appName, - String deploymentName, Context context); - - /** - * Stops an Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String projectName, String appName, String deploymentName); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CognitiveServicesManagementClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CognitiveServicesManagementClient.java deleted file mode 100644 index a4627997b782..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CognitiveServicesManagementClient.java +++ /dev/null @@ -1,363 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** - * The interface for CognitiveServicesManagementClient class. - */ -public interface CognitiveServicesManagementClient { - /** - * Gets Service host. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * 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. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the ResourceProvidersClient object to access its operations. - * - * @return the ResourceProvidersClient object. - */ - ResourceProvidersClient getResourceProviders(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - - /** - * Gets the AccountsClient object to access its operations. - * - * @return the AccountsClient object. - */ - AccountsClient getAccounts(); - - /** - * Gets the DeletedAccountsClient object to access its operations. - * - * @return the DeletedAccountsClient object. - */ - DeletedAccountsClient getDeletedAccounts(); - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - PrivateEndpointConnectionsClient getPrivateEndpointConnections(); - - /** - * Gets the DeploymentsClient object to access its operations. - * - * @return the DeploymentsClient object. - */ - DeploymentsClient getDeployments(); - - /** - * Gets the CommitmentPlansClient object to access its operations. - * - * @return the CommitmentPlansClient object. - */ - CommitmentPlansClient getCommitmentPlans(); - - /** - * Gets the EncryptionScopesClient object to access its operations. - * - * @return the EncryptionScopesClient object. - */ - EncryptionScopesClient getEncryptionScopes(); - - /** - * Gets the RaiPoliciesClient object to access its operations. - * - * @return the RaiPoliciesClient object. - */ - RaiPoliciesClient getRaiPolicies(); - - /** - * Gets the SubscriptionRaiPoliciesClient object to access its operations. - * - * @return the SubscriptionRaiPoliciesClient object. - */ - SubscriptionRaiPoliciesClient getSubscriptionRaiPolicies(); - - /** - * Gets the RaiBlocklistItemsClient object to access its operations. - * - * @return the RaiBlocklistItemsClient object. - */ - RaiBlocklistItemsClient getRaiBlocklistItems(); - - /** - * Gets the RaiBlocklistsClient object to access its operations. - * - * @return the RaiBlocklistsClient object. - */ - RaiBlocklistsClient getRaiBlocklists(); - - /** - * Gets the RaiTopicsClient object to access its operations. - * - * @return the RaiTopicsClient object. - */ - RaiTopicsClient getRaiTopics(); - - /** - * Gets the RaiToolLabelsClient object to access its operations. - * - * @return the RaiToolLabelsClient object. - */ - RaiToolLabelsClient getRaiToolLabels(); - - /** - * Gets the RaiContentFiltersClient object to access its operations. - * - * @return the RaiContentFiltersClient object. - */ - RaiContentFiltersClient getRaiContentFilters(); - - /** - * Gets the NetworkSecurityPerimeterConfigurationsClient object to access its operations. - * - * @return the NetworkSecurityPerimeterConfigurationsClient object. - */ - NetworkSecurityPerimeterConfigurationsClient getNetworkSecurityPerimeterConfigurations(); - - /** - * Gets the DefenderForAISettingsClient object to access its operations. - * - * @return the DefenderForAISettingsClient object. - */ - DefenderForAISettingsClient getDefenderForAISettings(); - - /** - * Gets the ProjectsClient object to access its operations. - * - * @return the ProjectsClient object. - */ - ProjectsClient getProjects(); - - /** - * Gets the ProjectConnectionsClient object to access its operations. - * - * @return the ProjectConnectionsClient object. - */ - ProjectConnectionsClient getProjectConnections(); - - /** - * Gets the ProjectCapabilityHostsClient object to access its operations. - * - * @return the ProjectCapabilityHostsClient object. - */ - ProjectCapabilityHostsClient getProjectCapabilityHosts(); - - /** - * Gets the QuotaTiersClient object to access its operations. - * - * @return the QuotaTiersClient object. - */ - QuotaTiersClient getQuotaTiers(); - - /** - * Gets the AgentApplicationsClient object to access its operations. - * - * @return the AgentApplicationsClient object. - */ - AgentApplicationsClient getAgentApplications(); - - /** - * Gets the ManagedComputeDeploymentsClient object to access its operations. - * - * @return the ManagedComputeDeploymentsClient object. - */ - ManagedComputeDeploymentsClient getManagedComputeDeployments(); - - /** - * Gets the ComputeOperationsClient object to access its operations. - * - * @return the ComputeOperationsClient object. - */ - ComputeOperationsClient getComputeOperations(); - - /** - * Gets the ManagedComputeUsagesOperationGroupsClient object to access its operations. - * - * @return the ManagedComputeUsagesOperationGroupsClient object. - */ - ManagedComputeUsagesOperationGroupsClient getManagedComputeUsagesOperationGroups(); - - /** - * Gets the ComputesClient object to access its operations. - * - * @return the ComputesClient object. - */ - ComputesClient getComputes(); - - /** - * Gets the WorkbenchesClient object to access its operations. - * - * @return the WorkbenchesClient object. - */ - WorkbenchesClient getWorkbenches(); - - /** - * Gets the ManagedComputeCapacitiesClient object to access its operations. - * - * @return the ManagedComputeCapacitiesClient object. - */ - ManagedComputeCapacitiesClient getManagedComputeCapacities(); - - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - PrivateLinkResourcesClient getPrivateLinkResources(); - - /** - * Gets the TestRaiExternalSafetyProvidersClient object to access its operations. - * - * @return the TestRaiExternalSafetyProvidersClient object. - */ - TestRaiExternalSafetyProvidersClient getTestRaiExternalSafetyProviders(); - - /** - * Gets the RaiExternalSafetyProvidersClient object to access its operations. - * - * @return the RaiExternalSafetyProvidersClient object. - */ - RaiExternalSafetyProvidersClient getRaiExternalSafetyProviders(); - - /** - * Gets the RaiExternalSafetyProvidersOperationsClient object to access its operations. - * - * @return the RaiExternalSafetyProvidersOperationsClient object. - */ - RaiExternalSafetyProvidersOperationsClient getRaiExternalSafetyProvidersOperations(); - - /** - * Gets the AccountConnectionsClient object to access its operations. - * - * @return the AccountConnectionsClient object. - */ - AccountConnectionsClient getAccountConnections(); - - /** - * Gets the AccountCapabilityHostsClient object to access its operations. - * - * @return the AccountCapabilityHostsClient object. - */ - AccountCapabilityHostsClient getAccountCapabilityHosts(); - - /** - * Gets the OutboundRulesClient object to access its operations. - * - * @return the OutboundRulesClient object. - */ - OutboundRulesClient getOutboundRules(); - - /** - * Gets the ManagedNetworkSettingsOperationsClient object to access its operations. - * - * @return the ManagedNetworkSettingsOperationsClient object. - */ - ManagedNetworkSettingsOperationsClient getManagedNetworkSettingsOperations(); - - /** - * Gets the OutboundRulesOperationsClient object to access its operations. - * - * @return the OutboundRulesOperationsClient object. - */ - OutboundRulesOperationsClient getOutboundRulesOperations(); - - /** - * Gets the ManagedNetworkProvisionsClient object to access its operations. - * - * @return the ManagedNetworkProvisionsClient object. - */ - ManagedNetworkProvisionsClient getManagedNetworkProvisions(); - - /** - * Gets the AgentDeploymentsClient object to access its operations. - * - * @return the AgentDeploymentsClient object. - */ - AgentDeploymentsClient getAgentDeployments(); - - /** - * Gets the ResourceSkusClient object to access its operations. - * - * @return the ResourceSkusClient object. - */ - ResourceSkusClient getResourceSkus(); - - /** - * Gets the UsagesClient object to access its operations. - * - * @return the UsagesClient object. - */ - UsagesClient getUsages(); - - /** - * Gets the CommitmentTiersClient object to access its operations. - * - * @return the CommitmentTiersClient object. - */ - CommitmentTiersClient getCommitmentTiers(); - - /** - * Gets the ModelsClient object to access its operations. - * - * @return the ModelsClient object. - */ - ModelsClient getModels(); - - /** - * Gets the LocationBasedModelCapacitiesClient object to access its operations. - * - * @return the LocationBasedModelCapacitiesClient object. - */ - LocationBasedModelCapacitiesClient getLocationBasedModelCapacities(); - - /** - * Gets the ModelCapacitiesClient object to access its operations. - * - * @return the ModelCapacitiesClient object. - */ - ModelCapacitiesClient getModelCapacities(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentPlansClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentPlansClient.java deleted file mode 100644 index 293086410077..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentPlansClient.java +++ /dev/null @@ -1,626 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.CommitmentPlanAccountAssociationInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner; -import com.azure.resourcemanager.cognitiveservices.models.PatchResourceTagsAndSku; - -/** - * An instance of this class provides access to all the operations defined in CommitmentPlansClient. - */ -public interface CommitmentPlansClient { - /** - * Gets the specified commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @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 specified commitmentPlans associated with the Cognitive Services account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, - String commitmentPlanName, Context context); - - /** - * Gets the specified commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 commitmentPlans associated with the Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CommitmentPlanInner get(String resourceGroupName, String accountName, String commitmentPlanName); - - /** - * Update the state of specified commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The commitmentPlan 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 cognitive Services account commitment plan along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String commitmentPlanName, CommitmentPlanInner commitmentPlan, Context context); - - /** - * Update the state of specified commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The commitmentPlan 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 cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CommitmentPlanInner createOrUpdate(String resourceGroupName, String accountName, String commitmentPlanName, - CommitmentPlanInner commitmentPlan); - - /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, - String commitmentPlanName); - - /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @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 accountName, - String commitmentPlanName, Context context); - - /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String commitmentPlanName); - - /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @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 accountName, String commitmentPlanName, Context context); - - /** - * Gets the commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the commitmentPlans associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 commitmentPlans associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); - - /** - * Returns a Cognitive Services commitment plan specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @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 cognitive Services account commitment plan along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String commitmentPlanName, - Context context); - - /** - * Returns a Cognitive Services commitment plan specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CommitmentPlanInner getByResourceGroup(String resourceGroupName, String commitmentPlanName); - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CommitmentPlanInner> beginCreateOrUpdatePlan(String resourceGroupName, - String commitmentPlanName, CommitmentPlanInner commitmentPlan); - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @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 cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CommitmentPlanInner> beginCreateOrUpdatePlan(String resourceGroupName, - String commitmentPlanName, CommitmentPlanInner commitmentPlan, Context context); - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CommitmentPlanInner createOrUpdatePlan(String resourceGroupName, String commitmentPlanName, - CommitmentPlanInner commitmentPlan); - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @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 cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CommitmentPlanInner createOrUpdatePlan(String resourceGroupName, String commitmentPlanName, - CommitmentPlanInner commitmentPlan, Context context); - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CommitmentPlanInner> beginUpdatePlan(String resourceGroupName, - String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan); - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @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 cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CommitmentPlanInner> beginUpdatePlan(String resourceGroupName, - String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan, Context context); - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CommitmentPlanInner updatePlan(String resourceGroupName, String commitmentPlanName, - PatchResourceTagsAndSku commitmentPlan); - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @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 cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CommitmentPlanInner updatePlan(String resourceGroupName, String commitmentPlanName, - PatchResourceTagsAndSku commitmentPlan, Context context); - - /** - * Deletes a Cognitive Services commitment plan from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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> beginDeletePlan(String resourceGroupName, String commitmentPlanName); - - /** - * Deletes a Cognitive Services commitment plan from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @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> beginDeletePlan(String resourceGroupName, String commitmentPlanName, - Context context); - - /** - * Deletes a Cognitive Services commitment plan from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 deletePlan(String resourceGroupName, String commitmentPlanName); - - /** - * Deletes a Cognitive Services commitment plan from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @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 deletePlan(String resourceGroupName, String commitmentPlanName, Context context); - - /** - * Returns all the resources of a particular type belonging to a resource group. - * - * @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 the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Returns all the resources of a particular type belonging to 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 com.azure.core.management.exception.ManagementException 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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listPlansBySubscription(); - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listPlansBySubscription(Context context); - - /** - * Gets the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @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 association of the Cognitive Services commitment plan along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getAssociationWithResponse(String resourceGroupName, - String commitmentPlanName, String commitmentPlanAssociationName, Context context); - - /** - * Gets the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the association of the Cognitive Services commitment plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CommitmentPlanAccountAssociationInner getAssociation(String resourceGroupName, String commitmentPlanName, - String commitmentPlanAssociationName); - - /** - * Create or update the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @param association The commitmentPlan 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 the commitment plan association. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CommitmentPlanAccountAssociationInner> - beginCreateOrUpdateAssociation(String resourceGroupName, String commitmentPlanName, - String commitmentPlanAssociationName, CommitmentPlanAccountAssociationInner association); - - /** - * Create or update the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @param association The commitmentPlan 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 the commitment plan association. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CommitmentPlanAccountAssociationInner> - beginCreateOrUpdateAssociation(String resourceGroupName, String commitmentPlanName, - String commitmentPlanAssociationName, CommitmentPlanAccountAssociationInner association, Context context); - - /** - * Create or update the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @param association The commitmentPlan 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 commitment plan association. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CommitmentPlanAccountAssociationInner createOrUpdateAssociation(String resourceGroupName, String commitmentPlanName, - String commitmentPlanAssociationName, CommitmentPlanAccountAssociationInner association); - - /** - * Create or update the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @param association The commitmentPlan 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 commitment plan association. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CommitmentPlanAccountAssociationInner createOrUpdateAssociation(String resourceGroupName, String commitmentPlanName, - String commitmentPlanAssociationName, CommitmentPlanAccountAssociationInner association, Context context); - - /** - * Deletes the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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> beginDeleteAssociation(String resourceGroupName, String commitmentPlanName, - String commitmentPlanAssociationName); - - /** - * Deletes the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @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> beginDeleteAssociation(String resourceGroupName, String commitmentPlanName, - String commitmentPlanAssociationName, Context context); - - /** - * Deletes the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 deleteAssociation(String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName); - - /** - * Deletes the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @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 deleteAssociation(String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, - Context context); - - /** - * Gets the associations of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the associations of the Cognitive Services commitment plan as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAssociations(String resourceGroupName, - String commitmentPlanName); - - /** - * Gets the associations of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @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 associations of the Cognitive Services commitment plan as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAssociations(String resourceGroupName, - String commitmentPlanName, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentTiersClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentTiersClient.java deleted file mode 100644 index c86ecf3d7005..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentTiersClient.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentTierInner; - -/** - * An instance of this class provides access to all the operations defined in CommitmentTiersClient. - */ -public interface CommitmentTiersClient { - /** - * List Commitment Tiers. - * - * @param location The location 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 list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location); - - /** - * List Commitment Tiers. - * - * @param location The location 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 list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ComputeOperationsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ComputeOperationsClient.java deleted file mode 100644 index 863b7ee341a7..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ComputeOperationsClient.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ComputeOperationStatusInner; - -/** - * An instance of this class provides access to all the operations defined in ComputeOperationsClient. - */ -public interface ComputeOperationsClient { - /** - * Gets the status of a compute operation. - * - * @param location The name of the Azure region. - * @param operationId The ID of the compute operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a compute operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String location, String operationId, Context context); - - /** - * Gets the status of a compute operation. - * - * @param location The name of the Azure region. - * @param operationId The ID of the compute operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a compute operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ComputeOperationStatusInner get(String location, String operationId); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ComputesClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ComputesClient.java deleted file mode 100644 index f10d17f244bc..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ComputesClient.java +++ /dev/null @@ -1,461 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.ComputeInner; - -/** - * An instance of this class provides access to all the operations defined in ComputesClient. - */ -public interface ComputesClient { - /** - * Gets the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @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 specified compute associated with the Cognitive Services account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, String computeName, - Context context); - - /** - * Gets the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 compute associated with the Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ComputeInner get(String resourceGroupName, String accountName, String computeName); - - /** - * Creates or updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param resource The compute 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 cognitive Services compute resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ComputeInner> beginCreateOrUpdate(String resourceGroupName, String accountName, - String computeName, ComputeInner resource); - - /** - * Creates or updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param resource The compute 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 cognitive Services compute resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ComputeInner> beginCreateOrUpdate(String resourceGroupName, String accountName, - String computeName, ComputeInner resource, Context context); - - /** - * Creates or updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param resource The compute 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 cognitive Services compute resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ComputeInner createOrUpdate(String resourceGroupName, String accountName, String computeName, - ComputeInner resource); - - /** - * Creates or updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param resource The compute 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 cognitive Services compute resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ComputeInner createOrUpdate(String resourceGroupName, String accountName, String computeName, ComputeInner resource, - Context context); - - /** - * Updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param properties The compute properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 cognitive Services compute resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ComputeInner> beginUpdate(String resourceGroupName, String accountName, - String computeName, ComputeInner properties); - - /** - * Updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param properties The compute properties to update. - * @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 cognitive Services compute resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ComputeInner> beginUpdate(String resourceGroupName, String accountName, - String computeName, ComputeInner properties, Context context); - - /** - * Updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param properties The compute properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services compute resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ComputeInner update(String resourceGroupName, String accountName, String computeName, ComputeInner properties); - - /** - * Updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param properties The compute properties to update. - * @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 cognitive Services compute resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ComputeInner update(String resourceGroupName, String accountName, String computeName, ComputeInner properties, - Context context); - - /** - * Deletes the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, String computeName); - - /** - * Deletes the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @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 accountName, String computeName, - Context context); - - /** - * Deletes the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String computeName); - - /** - * Deletes the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @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 accountName, String computeName, Context context); - - /** - * Gets the computes associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the computes associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the computes associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 computes associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); - - /** - * Starts a stopped ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, String computeName); - - /** - * Starts a stopped ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @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 accountName, String computeName, - Context context); - - /** - * Starts a stopped ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String computeName); - - /** - * Starts a stopped ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @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 accountName, String computeName, Context context); - - /** - * Stops a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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> beginStop(String resourceGroupName, String accountName, String computeName); - - /** - * Stops a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @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> beginStop(String resourceGroupName, String accountName, String computeName, - Context context); - - /** - * Stops a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String computeName); - - /** - * Stops a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @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 stop(String resourceGroupName, String accountName, String computeName, Context context); - - /** - * Restarts a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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> beginRestart(String resourceGroupName, String accountName, String computeName); - - /** - * Restarts a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @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> beginRestart(String resourceGroupName, String accountName, String computeName, - Context context); - - /** - * Restarts a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 restart(String resourceGroupName, String accountName, String computeName); - - /** - * Restarts a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @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 restart(String resourceGroupName, String accountName, String computeName, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DefenderForAISettingsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DefenderForAISettingsClient.java deleted file mode 100644 index 0cb87c84525f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DefenderForAISettingsClient.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.DefenderForAISettingInner; - -/** - * An instance of this class provides access to all the operations defined in DefenderForAISettingsClient. - */ -public interface DefenderForAISettingsClient { - /** - * Gets the specified Defender for AI setting by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. - * @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 specified Defender for AI setting by name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, - String defenderForAISettingName, Context context); - - /** - * Gets the specified Defender for AI setting by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 Defender for AI setting by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DefenderForAISettingInner get(String resourceGroupName, String accountName, String defenderForAISettingName); - - /** - * Creates or Updates the specified Defender for AI setting. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. - * @param defenderForAISettings Properties describing the Defender for AI setting. - * @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 Defender for AI resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String defenderForAISettingName, DefenderForAISettingInner defenderForAISettings, Context context); - - /** - * Creates or Updates the specified Defender for AI setting. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. - * @param defenderForAISettings Properties describing the Defender for AI setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for AI resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DefenderForAISettingInner createOrUpdate(String resourceGroupName, String accountName, - String defenderForAISettingName, DefenderForAISettingInner defenderForAISettings); - - /** - * Updates the specified Defender for AI setting. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. - * @param defenderForAISettings Properties describing the Defender for AI setting. - * @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 Defender for AI resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String accountName, - String defenderForAISettingName, DefenderForAISettingInner defenderForAISettings, Context context); - - /** - * Updates the specified Defender for AI setting. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. - * @param defenderForAISettings Properties describing the Defender for AI setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for AI resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DefenderForAISettingInner update(String resourceGroupName, String accountName, String defenderForAISettingName, - DefenderForAISettingInner defenderForAISettings); - - /** - * Lists the Defender for AI settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 cognitive services Defender for AI Settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Lists the Defender for AI settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 cognitive services Defender for AI Settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DeletedAccountsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DeletedAccountsClient.java deleted file mode 100644 index 9b0bd8dc7546..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DeletedAccountsClient.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.AccountInner; - -/** - * An instance of this class provides access to all the operations defined in DeletedAccountsClient. - */ -public interface DeletedAccountsClient { - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String location, String resourceGroupName, String accountName, - Context context); - - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccountInner get(String location, String resourceGroupName, String accountName); - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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> beginPurge(String location, String resourceGroupName, String accountName); - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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> beginPurge(String location, String resourceGroupName, String accountName, - Context context); - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 purge(String location, String resourceGroupName, String accountName); - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 purge(String location, String resourceGroupName, String accountName, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DeploymentsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DeploymentsClient.java deleted file mode 100644 index e65adb9091ce..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DeploymentsClient.java +++ /dev/null @@ -1,379 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.DeploymentInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.SkuResourceInner; -import com.azure.resourcemanager.cognitiveservices.models.PatchResourceTagsAndSku; - -/** - * An instance of this class provides access to all the operations defined in DeploymentsClient. - */ -public interface DeploymentsClient { - /** - * Gets the specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @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 specified deployments associated with the Cognitive Services account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, String deploymentName, - Context context); - - /** - * Gets the specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 deployments associated with the Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentInner get(String resourceGroupName, String accountName, String deploymentName); - - /** - * Update the state of specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeploymentInner> beginCreateOrUpdate(String resourceGroupName, - String accountName, String deploymentName, DeploymentInner deployment); - - /** - * Update the state of specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeploymentInner> beginCreateOrUpdate(String resourceGroupName, - String accountName, String deploymentName, DeploymentInner deployment, Context context); - - /** - * Update the state of specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentInner createOrUpdate(String resourceGroupName, String accountName, String deploymentName, - DeploymentInner deployment); - - /** - * Update the state of specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentInner createOrUpdate(String resourceGroupName, String accountName, String deploymentName, - DeploymentInner deployment, Context context); - - /** - * Update specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeploymentInner> beginUpdate(String resourceGroupName, String accountName, - String deploymentName, PatchResourceTagsAndSku deployment); - - /** - * Update specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeploymentInner> beginUpdate(String resourceGroupName, String accountName, - String deploymentName, PatchResourceTagsAndSku deployment, Context context); - - /** - * Update specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentInner update(String resourceGroupName, String accountName, String deploymentName, - PatchResourceTagsAndSku deployment); - - /** - * Update specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentInner update(String resourceGroupName, String accountName, String deploymentName, - PatchResourceTagsAndSku deployment, Context context); - - /** - * Deletes the specified deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, String deploymentName); - - /** - * Deletes the specified deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @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 accountName, String deploymentName, - Context context); - - /** - * Deletes the specified deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String deploymentName); - - /** - * Deletes the specified deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @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 accountName, String deploymentName, Context context); - - /** - * Gets the deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployments associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 deployments associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); - - /** - * Lists the specified deployments skus associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSkus(String resourceGroupName, String accountName, String deploymentName); - - /** - * Lists the specified deployments skus associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSkus(String resourceGroupName, String accountName, String deploymentName, - Context context); - - /** - * Pause a deployment - * - * Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see - * #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, DataZoneStandard, and - * GlobalStandard SKUs support this operation. Inference requests to the paused deployment endpoint will receive - * HTTP 423 (Locked). This operation is idempotent. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @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 cognitive Services account deployment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response pauseWithResponse(String resourceGroupName, String accountName, String deploymentName, - Context context); - - /** - * Pause a deployment - * - * Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see - * #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, DataZoneStandard, and - * GlobalStandard SKUs support this operation. Inference requests to the paused deployment endpoint will receive - * HTTP 423 (Locked). This operation is idempotent. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentInner pause(String resourceGroupName, String accountName, String deploymentName); - - /** - * Resume a deployment - * - * Resumes inferencing on a previously paused deployment by setting the deploymentState to 'Running' (see - * #/definitions/DeploymentProperties/properties/deploymentState). This operation is idempotent and can be safely - * called on already running deployments. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @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 cognitive Services account deployment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response resumeWithResponse(String resourceGroupName, String accountName, String deploymentName, - Context context); - - /** - * Resume a deployment - * - * Resumes inferencing on a previously paused deployment by setting the deploymentState to 'Running' (see - * #/definitions/DeploymentProperties/properties/deploymentState). This operation is idempotent and can be safely - * called on already running deployments. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentInner resume(String resourceGroupName, String accountName, String deploymentName); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/EncryptionScopesClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/EncryptionScopesClient.java deleted file mode 100644 index 903ee81eb979..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/EncryptionScopesClient.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.EncryptionScopeInner; - -/** - * An instance of this class provides access to all the operations defined in EncryptionScopesClient. - */ -public interface EncryptionScopesClient { - /** - * Gets the specified EncryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @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 specified EncryptionScope associated with the Cognitive Services account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, - String encryptionScopeName, Context context); - - /** - * Gets the specified EncryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 EncryptionScope associated with the Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EncryptionScopeInner get(String resourceGroupName, String accountName, String encryptionScopeName); - - /** - * Update the state of specified encryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @param encryptionScope The encryptionScope 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 cognitive Services EncryptionScope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String encryptionScopeName, EncryptionScopeInner encryptionScope, Context context); - - /** - * Update the state of specified encryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @param encryptionScope The encryptionScope 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 cognitive Services EncryptionScope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EncryptionScopeInner createOrUpdate(String resourceGroupName, String accountName, String encryptionScopeName, - EncryptionScopeInner encryptionScope); - - /** - * Deletes the specified encryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, - String encryptionScopeName); - - /** - * Deletes the specified encryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @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 accountName, - String encryptionScopeName, Context context); - - /** - * Deletes the specified encryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String encryptionScopeName); - - /** - * Deletes the specified encryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @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 accountName, String encryptionScopeName, Context context); - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/LocationBasedModelCapacitiesClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/LocationBasedModelCapacitiesClient.java deleted file mode 100644 index 68c57b227b5c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/LocationBasedModelCapacitiesClient.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelCapacityListResultValueItemInner; - -/** - * An instance of this class provides access to all the operations defined in LocationBasedModelCapacitiesClient. - */ -public interface LocationBasedModelCapacitiesClient { - /** - * List Location Based ModelCapacities. - * - * @param location The location name. - * @param modelFormat The format of the Model. - * @param modelName The name of the Model. - * @param modelVersion The version of the Model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location, String modelFormat, String modelName, - String modelVersion); - - /** - * List Location Based ModelCapacities. - * - * @param location The location name. - * @param modelFormat The format of the Model. - * @param modelName The name of the Model. - * @param modelVersion The version of the Model. - * @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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location, String modelFormat, String modelName, - String modelVersion, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedComputeCapacitiesClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedComputeCapacitiesClient.java deleted file mode 100644 index 34d323f9432a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedComputeCapacitiesClient.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedComputeCapacityInner; - -/** - * An instance of this class provides access to all the operations defined in ManagedComputeCapacitiesClient. - */ -public interface ManagedComputeCapacitiesClient { - /** - * Gets the managed compute capacities for a subscription. Returns available capacity - * per accelerator type, including deployment size information. - * - * @param offer The offer name to query capacity for (required). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managed compute capacities for a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String offer); - - /** - * Gets the managed compute capacities for a subscription. Returns available capacity - * per accelerator type, including deployment size information. - * - * @param offer The offer name to query capacity for (required). - * @param acceleratorType Optional accelerator type filter to narrow results to a specific accelerator type. - * @param deploymentId Optional deployment resource ID. When provided, returns capacity for the specific region - * where the deployment is hosted rather than the best available region. - * @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 managed compute capacities for a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String offer, String acceleratorType, String deploymentId, - Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedComputeDeploymentsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedComputeDeploymentsClient.java deleted file mode 100644 index f64588c2a057..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedComputeDeploymentsClient.java +++ /dev/null @@ -1,275 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.ManagedComputeDeploymentInner; -import com.azure.resourcemanager.cognitiveservices.models.PatchResourceSku; - -/** - * An instance of this class provides access to all the operations defined in ManagedComputeDeploymentsClient. - */ -public interface ManagedComputeDeploymentsClient { - /** - * Gets the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @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 specified managed compute deployment associated with the Cognitive Services account along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, - String deploymentName, Context context); - - /** - * Gets the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 managed compute deployment associated with the Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedComputeDeploymentInner get(String resourceGroupName, String accountName, String deploymentName); - - /** - * Creates or updates a managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param resource The managed compute deployment 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 cognitive Services account managed compute deployment, backed by - * managed compute (GPU) resources. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ManagedComputeDeploymentInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String deploymentName, ManagedComputeDeploymentInner resource); - - /** - * Creates or updates a managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param resource The managed compute deployment 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 cognitive Services account managed compute deployment, backed by - * managed compute (GPU) resources. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ManagedComputeDeploymentInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String deploymentName, ManagedComputeDeploymentInner resource, - Context context); - - /** - * Creates or updates a managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param resource The managed compute deployment 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 cognitive Services account managed compute deployment, backed by managed compute (GPU) resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedComputeDeploymentInner createOrUpdate(String resourceGroupName, String accountName, String deploymentName, - ManagedComputeDeploymentInner resource); - - /** - * Creates or updates a managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param resource The managed compute deployment 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 cognitive Services account managed compute deployment, backed by managed compute (GPU) resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedComputeDeploymentInner createOrUpdate(String resourceGroupName, String accountName, String deploymentName, - ManagedComputeDeploymentInner resource, Context context); - - /** - * Updates the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param properties The managed compute deployment patch 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 cognitive Services account managed compute deployment, backed by - * managed compute (GPU) resources. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ManagedComputeDeploymentInner> - beginUpdate(String resourceGroupName, String accountName, String deploymentName, PatchResourceSku properties); - - /** - * Updates the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param properties The managed compute deployment patch 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 cognitive Services account managed compute deployment, backed by - * managed compute (GPU) resources. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ManagedComputeDeploymentInner> beginUpdate( - String resourceGroupName, String accountName, String deploymentName, PatchResourceSku properties, - Context context); - - /** - * Updates the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param properties The managed compute deployment patch 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 cognitive Services account managed compute deployment, backed by managed compute (GPU) resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedComputeDeploymentInner update(String resourceGroupName, String accountName, String deploymentName, - PatchResourceSku properties); - - /** - * Updates the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param properties The managed compute deployment patch 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 cognitive Services account managed compute deployment, backed by managed compute (GPU) resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedComputeDeploymentInner update(String resourceGroupName, String accountName, String deploymentName, - PatchResourceSku properties, Context context); - - /** - * Deletes the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, String deploymentName); - - /** - * Deletes the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @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 accountName, String deploymentName, - Context context); - - /** - * Deletes the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String deploymentName); - - /** - * Deletes the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @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 accountName, String deploymentName, Context context); - - /** - * Gets the managed compute deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managed compute deployments associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the managed compute deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 managed compute deployments associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedComputeUsagesOperationGroupsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedComputeUsagesOperationGroupsClient.java deleted file mode 100644 index 3ca36d9a9727..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedComputeUsagesOperationGroupsClient.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedComputeUsageInner; - -/** - * An instance of this class provides access to all the operations defined in ManagedComputeUsagesOperationGroupsClient. - */ -public interface ManagedComputeUsagesOperationGroupsClient { - /** - * List managed compute quota usages for a subscription and location. - * - * @param location The location name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed compute quota entries as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location); - - /** - * List managed compute quota usages for a subscription and location. - * - * @param location The location 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 list of managed compute quota entries as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedNetworkProvisionsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedNetworkProvisionsClient.java deleted file mode 100644 index 2d15386b47c7..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedNetworkProvisionsClient.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; -import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisionOptions; - -/** - * An instance of this class provides access to all the operations defined in ManagedNetworkProvisionsClient. - */ -public interface ManagedNetworkProvisionsClient { - /** - * Provisions the managed network of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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, ManagedNetworkProvisionStatusInner> - beginProvisionManagedNetwork(String resourceGroupName, String accountName, String managedNetworkName); - - /** - * Provisions the managed network of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body Managed Network Provisioning Options for a cognitive services account. - * @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, ManagedNetworkProvisionStatusInner> - beginProvisionManagedNetwork(String resourceGroupName, String accountName, String managedNetworkName, - ManagedNetworkProvisionOptions body, Context context); - - /** - * Provisions the managed network of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedNetworkProvisionStatusInner provisionManagedNetwork(String resourceGroupName, String accountName, - String managedNetworkName); - - /** - * Provisions the managed network of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body Managed Network Provisioning Options for a cognitive services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedNetworkProvisionStatusInner provisionManagedNetwork(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkProvisionOptions body, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedNetworkSettingsOperationsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedNetworkSettingsOperationsClient.java deleted file mode 100644 index 9b75c48f2d2a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedNetworkSettingsOperationsClient.java +++ /dev/null @@ -1,290 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.ManagedNetworkSettingsPropertiesBasicResourceInner; - -/** - * An instance of this class provides access to all the operations defined in ManagedNetworkSettingsOperationsClient. - */ -public interface ManagedNetworkSettingsOperationsClient { - /** - * Get API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @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 aPI for managed network settings of a cognitive services account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, - String accountName, String managedNetworkName, Context context); - - /** - * Get API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return aPI for managed network settings of a cognitive services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedNetworkSettingsPropertiesBasicResourceInner get(String resourceGroupName, String accountName, - String managedNetworkName); - - /** - * PUT API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 concrete proxy resource types can be created by aliasing this type - * using a specific property type. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ManagedNetworkSettingsPropertiesBasicResourceInner> - beginPut(String resourceGroupName, String accountName, String managedNetworkName, - ManagedNetworkSettingsPropertiesBasicResourceInner body); - - /** - * PUT API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @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 concrete proxy resource types can be created by aliasing this type - * using a specific property type. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ManagedNetworkSettingsPropertiesBasicResourceInner> - beginPut(String resourceGroupName, String accountName, String managedNetworkName, - ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context); - - /** - * PUT API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedNetworkSettingsPropertiesBasicResourceInner put(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body); - - /** - * PUT API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @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 concrete proxy resource types can be created by aliasing this type using a specific property type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedNetworkSettingsPropertiesBasicResourceInner put(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context); - - /** - * Patch API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 concrete proxy resource types can be created by aliasing this type - * using a specific property type. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ManagedNetworkSettingsPropertiesBasicResourceInner> - beginPatch(String resourceGroupName, String accountName, String managedNetworkName); - - /** - * Patch API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @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 concrete proxy resource types can be created by aliasing this type - * using a specific property type. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ManagedNetworkSettingsPropertiesBasicResourceInner> - beginPatch(String resourceGroupName, String accountName, String managedNetworkName, - ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context); - - /** - * Patch API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedNetworkSettingsPropertiesBasicResourceInner patch(String resourceGroupName, String accountName, - String managedNetworkName); - - /** - * Patch API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @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 concrete proxy resource types can be created by aliasing this type using a specific property type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ManagedNetworkSettingsPropertiesBasicResourceInner patch(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context); - - /** - * Delete API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, - String managedNetworkName); - - /** - * Delete API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @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 accountName, - String managedNetworkName, Context context); - - /** - * Delete API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String managedNetworkName); - - /** - * Delete API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @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 accountName, String managedNetworkName, Context context); - - /** - * List API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed networks of a cognitive services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, - String accountName); - - /** - * List API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed networks of a cognitive services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, - Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ModelCapacitiesClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ModelCapacitiesClient.java deleted file mode 100644 index 10378e4991e7..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ModelCapacitiesClient.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelCapacityListResultValueItemInner; - -/** - * An instance of this class provides access to all the operations defined in ModelCapacitiesClient. - */ -public interface ModelCapacitiesClient { - /** - * List ModelCapacities. - * - * @param modelFormat The format of the Model. - * @param modelName The name of the Model. - * @param modelVersion The version of the Model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String modelFormat, String modelName, - String modelVersion); - - /** - * List ModelCapacities. - * - * @param modelFormat The format of the Model. - * @param modelName The name of the Model. - * @param modelVersion The version of the Model. - * @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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String modelFormat, String modelName, String modelVersion, - Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ModelsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ModelsClient.java deleted file mode 100644 index deee54503676..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ModelsClient.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelInner; - -/** - * An instance of this class provides access to all the operations defined in ModelsClient. - */ -public interface ModelsClient { - /** - * List Models. - * - * @param location The location 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 list of cognitive services models as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location); - - /** - * List Models. - * - * @param location The location 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 list of cognitive services models as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/NetworkSecurityPerimeterConfigurationsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/NetworkSecurityPerimeterConfigurationsClient.java deleted file mode 100644 index 5e03df2eb99b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/NetworkSecurityPerimeterConfigurationsClient.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.NetworkSecurityPerimeterConfigurationInner; - -/** - * An instance of this class provides access to all the operations defined in - * NetworkSecurityPerimeterConfigurationsClient. - */ -public interface NetworkSecurityPerimeterConfigurationsClient { - /** - * Gets the specified NSP configurations for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 specified NSP configurations for an account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, - String nspConfigurationName, Context context); - - /** - * Gets the specified NSP configurations for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 specified NSP configurations for an account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkSecurityPerimeterConfigurationInner get(String resourceGroupName, String accountName, - String nspConfigurationName); - - /** - * Gets a list of NSP configurations for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 an account as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets a list of NSP configurations for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 an account as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, - Context context); - - /** - * Reconcile the NSP configuration for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 nSP Configuration for an Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, NetworkSecurityPerimeterConfigurationInner> - beginReconcile(String resourceGroupName, String accountName, String nspConfigurationName); - - /** - * Reconcile the NSP configuration for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 nSP Configuration for an Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, NetworkSecurityPerimeterConfigurationInner> - beginReconcile(String resourceGroupName, String accountName, String nspConfigurationName, Context context); - - /** - * Reconcile the NSP configuration for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 nSP Configuration for an Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkSecurityPerimeterConfigurationInner reconcile(String resourceGroupName, String accountName, - String nspConfigurationName); - - /** - * Reconcile the NSP configuration for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 nSP Configuration for an Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkSecurityPerimeterConfigurationInner reconcile(String resourceGroupName, String accountName, - String nspConfigurationName, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OperationsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OperationsClient.java deleted file mode 100644 index 1aa03a7b9f9d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OperationsClient.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.OperationInner; - -/** - * An instance of this class provides access to all the operations defined in OperationsClient. - */ -public interface OperationsClient { - /** - * Lists all the available Cognitive Services account operations. - * - * @throws com.azure.core.management.exception.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 REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the available Cognitive Services account 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OutboundRulesClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OutboundRulesClient.java deleted file mode 100644 index 836b79ab6a84..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OutboundRulesClient.java +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.OutboundRuleBasicResourceInner; - -/** - * An instance of this class provides access to all the operations defined in OutboundRulesClient. - */ -public interface OutboundRulesClient { - /** - * The GET API for retrieving a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound 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 concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, - String managedNetworkName, String ruleName, Context context); - - /** - * The GET API for retrieving a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OutboundRuleBasicResourceInner get(String resourceGroupName, String accountName, String managedNetworkName, - String ruleName); - - /** - * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @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 concrete proxy resource types can be created by aliasing this type - * using a specific property type. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OutboundRuleBasicResourceInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String managedNetworkName, String ruleName, - OutboundRuleBasicResourceInner body); - - /** - * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @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 concrete proxy resource types can be created by aliasing this type - * using a specific property type. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, OutboundRuleBasicResourceInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String managedNetworkName, String ruleName, - OutboundRuleBasicResourceInner body, Context context); - - /** - * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @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 concrete proxy resource types can be created by aliasing this type using a specific property type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OutboundRuleBasicResourceInner createOrUpdate(String resourceGroupName, String accountName, - String managedNetworkName, String ruleName, OutboundRuleBasicResourceInner body); - - /** - * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @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 concrete proxy resource types can be created by aliasing this type using a specific property type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OutboundRuleBasicResourceInner createOrUpdate(String resourceGroupName, String accountName, - String managedNetworkName, String ruleName, OutboundRuleBasicResourceInner body, Context context); - - /** - * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, - String managedNetworkName, String ruleName); - - /** - * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound 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 SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String managedNetworkName, String ruleName, Context context); - - /** - * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String managedNetworkName, String ruleName); - - /** - * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String managedNetworkName, String ruleName, - Context context); - - /** - * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, - String managedNetworkName); - - /** - * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, - String managedNetworkName, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OutboundRulesOperationsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OutboundRulesOperationsClient.java deleted file mode 100644 index 16793b5c4eb4..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OutboundRulesOperationsClient.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsBasicResourceInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleBasicResourceInner; - -/** - * An instance of this class provides access to all the operations defined in OutboundRulesOperationsClient. - */ -public interface OutboundRulesOperationsClient { - /** - * The POST API for updating the outbound rules of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable post(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsBasicResourceInner body); - - /** - * The POST API for updating the outbound rules of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable post(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsBasicResourceInner body, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/PrivateEndpointConnectionsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/PrivateEndpointConnectionsClient.java deleted file mode 100644 index f85e861e910a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/PrivateEndpointConnectionsClient.java +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionListResultInner; - -/** - * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. - */ -public interface PrivateEndpointConnectionsClient { - /** - * Gets the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @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 specified private endpoint connection associated with the Cognitive Services account along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, - String privateEndpointConnectionName, Context context); - - /** - * Gets the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 private endpoint connection associated with the Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner get(String resourceGroupName, String accountName, - String privateEndpointConnectionName); - - /** - * Update the state of specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @param properties The private endpoint connection 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 the Private Endpoint Connection resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties); - - /** - * Update the state of specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @param properties The private endpoint connection 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 the Private Endpoint Connection resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties, Context context); - - /** - * Update the state of specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @param properties The private endpoint connection 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 Private Endpoint Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String accountName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner properties); - - /** - * Update the state of specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @param properties The private endpoint connection 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 Private Endpoint Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String accountName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner properties, Context context); - - /** - * Deletes the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, - String privateEndpointConnectionName); - - /** - * Deletes the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @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 accountName, - String privateEndpointConnectionName, Context context); - - /** - * Deletes the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String privateEndpointConnectionName); - - /** - * Deletes the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @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 accountName, String privateEndpointConnectionName, Context context); - - /** - * Gets the private endpoint connections associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 private endpoint connections associated with the Cognitive Services account along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String resourceGroupName, String accountName, - Context context); - - /** - * Gets the private endpoint connections associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connections associated with the Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionListResultInner list(String resourceGroupName, String accountName); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/PrivateLinkResourcesClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/PrivateLinkResourcesClient.java deleted file mode 100644 index e8547e071a4a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/PrivateLinkResourcesClient.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateLinkResourceListResultInner; - -/** - * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. - */ -public interface PrivateLinkResourcesClient { - /** - * Gets the private link resources that need to be created for a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 private link resources that need to be created for a Cognitive Services account along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String resourceGroupName, String accountName, - Context context); - - /** - * Gets the private link resources that need to be created for a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkResourceListResultInner list(String resourceGroupName, String accountName); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectCapabilityHostsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectCapabilityHostsClient.java deleted file mode 100644 index b3914f0c1b13..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectCapabilityHostsClient.java +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.ProjectCapabilityHostInner; - -/** - * An instance of this class provides access to all the operations defined in ProjectCapabilityHostsClient. - */ -public interface ProjectCapabilityHostsClient { - /** - * Get project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 project capabilityHost along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, - String projectName, String capabilityHostName, Context context); - - /** - * Get project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 project capabilityHost. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProjectCapabilityHostInner get(String resourceGroupName, String accountName, String projectName, - String capabilityHostName); - - /** - * Create or update project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 azure Resource Manager resource envelope for Project - * CapabilityHost. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProjectCapabilityHostInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String projectName, String capabilityHostName, - ProjectCapabilityHostInner capabilityHost); - - /** - * Create or update project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @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 azure Resource Manager resource envelope for Project - * CapabilityHost. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProjectCapabilityHostInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String projectName, String capabilityHostName, - ProjectCapabilityHostInner capabilityHost, Context context); - - /** - * Create or update project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope for Project CapabilityHost. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProjectCapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String projectName, - String capabilityHostName, ProjectCapabilityHostInner capabilityHost); - - /** - * Create or update project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @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 azure Resource Manager resource envelope for Project CapabilityHost. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProjectCapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String projectName, - String capabilityHostName, ProjectCapabilityHostInner capabilityHost, Context context); - - /** - * Delete project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, String projectName, - String capabilityHostName); - - /** - * Delete project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, String projectName, - String capabilityHostName, Context context); - - /** - * Delete project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostName); - - /** - * Delete project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostName, - Context context); - - /** - * List capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 paginated list of Project Capability Host entities as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, String projectName); - - /** - * List capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @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 paginated list of Project Capability Host entities as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, String projectName, - Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectConnectionsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectConnectionsClient.java deleted file mode 100644 index 36755aa712a3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectConnectionsClient.java +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; -import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; - -/** - * An instance of this class provides access to all the operations defined in ProjectConnectionsClient. - */ -public interface ProjectConnectionsClient { - /** - * Lists Cognitive Services project connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @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 connection base resource schema along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, - String projectName, String connectionName, Context context); - - /** - * Lists Cognitive Services project connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionPropertiesV2BasicResourceInner get(String resourceGroupName, String accountName, String projectName, - String connectionName); - - /** - * Create or update Cognitive Services project connection under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @param connection The object for creating or updating a new account connection. - * @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 connection base resource schema along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(String resourceGroupName, String accountName, - String projectName, String connectionName, ConnectionPropertiesV2BasicResourceInner connection, - Context context); - - /** - * Create or update Cognitive Services project connection under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionPropertiesV2BasicResourceInner create(String resourceGroupName, String accountName, String projectName, - String connectionName); - - /** - * Update Cognitive Services project connection under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @param connection Parameters for account connection update. - * @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 connection base resource schema along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String accountName, - String projectName, String connectionName, ConnectionUpdateContent connection, Context context); - - /** - * Update Cognitive Services project connection under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionPropertiesV2BasicResourceInner update(String resourceGroupName, String accountName, String projectName, - String connectionName); - - /** - * Delete Cognitive Services project connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, - String connectionName, Context context); - - /** - * Delete Cognitive Services project connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String projectName, String connectionName); - - /** - * Lists all the available Cognitive Services project connections under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, - String projectName); - - /** - * Lists all the available Cognitive Services project connections under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param target Target of the connection. - * @param category Category of the connection. - * @param includeAll query parameter that indicates if get connection call should return both connections and - * datastores. - * @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 paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, - String projectName, String target, String category, Boolean includeAll, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectsClient.java deleted file mode 100644 index d2b8ab429d77..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectsClient.java +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.ProjectInner; - -/** - * An instance of this class provides access to all the operations defined in ProjectsClient. - */ -public interface ProjectsClient { - /** - * Returns a Cognitive Services project specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @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 cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, String projectName, - Context context); - - /** - * Returns a Cognitive Services project specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProjectInner get(String resourceGroupName, String accountName, String projectName); - - /** - * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's - * individual container to work on. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 cognitive Services project is an Azure resource representing the - * provisioned account's project, it's type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProjectInner> beginCreate(String resourceGroupName, String accountName, - String projectName, ProjectInner project); - - /** - * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's - * individual container to work on. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @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 cognitive Services project is an Azure resource representing the - * provisioned account's project, it's type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProjectInner> beginCreate(String resourceGroupName, String accountName, - String projectName, ProjectInner project, Context context); - - /** - * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's - * individual container to work on. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProjectInner create(String resourceGroupName, String accountName, String projectName, ProjectInner project); - - /** - * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's - * individual container to work on. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @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 cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProjectInner create(String resourceGroupName, String accountName, String projectName, ProjectInner project, - Context context); - - /** - * Updates a Cognitive Services Project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 cognitive Services project is an Azure resource representing the - * provisioned account's project, it's type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProjectInner> beginUpdate(String resourceGroupName, String accountName, - String projectName, ProjectInner project); - - /** - * Updates a Cognitive Services Project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @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 cognitive Services project is an Azure resource representing the - * provisioned account's project, it's type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProjectInner> beginUpdate(String resourceGroupName, String accountName, - String projectName, ProjectInner project, Context context); - - /** - * Updates a Cognitive Services Project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProjectInner update(String resourceGroupName, String accountName, String projectName, ProjectInner project); - - /** - * Updates a Cognitive Services Project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @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 cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProjectInner update(String resourceGroupName, String accountName, String projectName, ProjectInner project, - Context context); - - /** - * Deletes a Cognitive Services project from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, String projectName); - - /** - * Deletes a Cognitive Services project from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @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 accountName, String projectName, - Context context); - - /** - * Deletes a Cognitive Services project from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String projectName); - - /** - * Deletes a Cognitive Services project from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @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 accountName, String projectName, Context context); - - /** - * Returns all the projects in a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 cognitive services projects operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Returns all the projects in a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 cognitive services projects operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/QuotaTiersClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/QuotaTiersClient.java deleted file mode 100644 index 63bfc211e0a1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/QuotaTiersClient.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.QuotaTierInner; - -/** - * An instance of this class provides access to all the operations defined in QuotaTiersClient. - */ -public interface QuotaTiersClient { - /** - * Gets the Quota Tier for a subscription - * - * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param defaultParameter Default parameter. Leave the value as default. - * @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 Quota Tier for a subscription - * - * Gets the Quota Tier information for the given subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String defaultParameter, Context context); - - /** - * Gets the Quota Tier for a subscription - * - * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param defaultParameter Default parameter. Leave the value as default. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Quota Tier for a subscription - * - * Gets the Quota Tier information for the given subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - QuotaTierInner get(String defaultParameter); - - /** - * Updates the Quota Tier resource for a subscription. - * - * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param defaultParameter Default parameter. Leave the value as default. - * @param tier The parameters to provide for the quota tier 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 quota tier information for the subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String defaultParameter, QuotaTierInner tier, Context context); - - /** - * Updates the Quota Tier resource for a subscription. - * - * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param defaultParameter Default parameter. Leave the value as default. - * @param tier The parameters to provide for the quota tier 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 quota tier information for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - QuotaTierInner createOrUpdate(String defaultParameter, QuotaTierInner tier); - - /** - * Updates the Quota Tier resource for a subscription. The only properties that can be updated are - * "tierUpgradePolicy" - * - * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param defaultParameter Default parameter. Leave the value as default. - * @param tier The parameters to provide for the quota tier 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 quota tier information for the subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String defaultParameter, QuotaTierInner tier, Context context); - - /** - * Updates the Quota Tier resource for a subscription. The only properties that can be updated are - * "tierUpgradePolicy" - * - * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param defaultParameter Default parameter. Leave the value as default. - * @param tier The parameters to provide for the quota tier 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 quota tier information for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - QuotaTierInner update(String defaultParameter, QuotaTierInner tier); - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Quota Tiers response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Quota Tiers response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiBlocklistItemsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiBlocklistItemsClient.java deleted file mode 100644 index 4b265caf0566..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiBlocklistItemsClient.java +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.RaiBlocklistInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistItemInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemBulkRequest; -import java.util.List; - -/** - * An instance of this class provides access to all the operations defined in RaiBlocklistItemsClient. - */ -public interface RaiBlocklistItemsClient { - /** - * Gets the specified custom blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @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 specified custom blocklist Item associated with the custom blocklist along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, - String raiBlocklistName, String raiBlocklistItemName, Context context); - - /** - * Gets the specified custom blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 custom blocklist Item associated with the custom blocklist. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RaiBlocklistItemInner get(String resourceGroupName, String accountName, String raiBlocklistName, - String raiBlocklistItemName); - - /** - * Update the state of specified blocklist item associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @param raiBlocklistItem Properties describing the custom blocklist. - * @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 cognitive Services RaiBlocklist Item along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String raiBlocklistName, String raiBlocklistItemName, RaiBlocklistItemInner raiBlocklistItem, Context context); - - /** - * Update the state of specified blocklist item associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @param raiBlocklistItem Properties describing the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiBlocklist Item. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RaiBlocklistItemInner createOrUpdate(String resourceGroupName, String accountName, String raiBlocklistName, - String raiBlocklistItemName, RaiBlocklistItemInner raiBlocklistItem); - - /** - * Deletes the specified blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, - String raiBlocklistName, String raiBlocklistItemName); - - /** - * Deletes the specified blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @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 accountName, - String raiBlocklistName, String raiBlocklistItemName, Context context); - - /** - * Deletes the specified blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String raiBlocklistName, String raiBlocklistItemName); - - /** - * Deletes the specified blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @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 accountName, String raiBlocklistName, String raiBlocklistItemName, - Context context); - - /** - * Gets the blocklist items associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blocklist items associated with the custom blocklist as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, String raiBlocklistName); - - /** - * Gets the blocklist items associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @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 blocklist items associated with the custom blocklist as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, String raiBlocklistName, - Context context); - - /** - * Batch operation to add blocklist items. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItems Properties describing the custom blocklist items. - * @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 cognitive Services RaiBlocklist along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response batchAddWithResponse(String resourceGroupName, String accountName, - String raiBlocklistName, List raiBlocklistItems, Context context); - - /** - * Batch operation to add blocklist items. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItems Properties describing the custom blocklist items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiBlocklist. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RaiBlocklistInner batchAdd(String resourceGroupName, String accountName, String raiBlocklistName, - List raiBlocklistItems); - - /** - * Batch operation to delete blocklist items. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemsNames List of RAI Blocklist Items Names. - * @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 batchDeleteWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, - List raiBlocklistItemsNames, Context context); - - /** - * Batch operation to delete blocklist items. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemsNames List of RAI Blocklist Items Names. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 batchDelete(String resourceGroupName, String accountName, String raiBlocklistName, - List raiBlocklistItemsNames); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiBlocklistsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiBlocklistsClient.java deleted file mode 100644 index ed1a4642c4e4..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiBlocklistsClient.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.RaiBlocklistInner; - -/** - * An instance of this class provides access to all the operations defined in RaiBlocklistsClient. - */ -public interface RaiBlocklistsClient { - /** - * Gets the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @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 specified custom blocklist associated with the Azure OpenAI account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, - Context context); - - /** - * Gets the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 custom blocklist associated with the Azure OpenAI account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RaiBlocklistInner get(String resourceGroupName, String accountName, String raiBlocklistName); - - /** - * Update the state of specified blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklist Properties describing the custom blocklist. - * @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 cognitive Services RaiBlocklist along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String raiBlocklistName, RaiBlocklistInner raiBlocklist, Context context); - - /** - * Update the state of specified blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklist Properties describing the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiBlocklist. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RaiBlocklistInner createOrUpdate(String resourceGroupName, String accountName, String raiBlocklistName, - RaiBlocklistInner raiBlocklist); - - /** - * Deletes the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, - String raiBlocklistName); - - /** - * Deletes the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @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 accountName, - String raiBlocklistName, Context context); - - /** - * Deletes the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String raiBlocklistName); - - /** - * Deletes the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @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 accountName, String raiBlocklistName, Context context); - - /** - * Gets the custom blocklists associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom blocklists associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the custom blocklists associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 custom blocklists associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiContentFiltersClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiContentFiltersClient.java deleted file mode 100644 index 571e90f0d8dd..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiContentFiltersClient.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.RaiContentFilterInner; - -/** - * An instance of this class provides access to all the operations defined in RaiContentFiltersClient. - */ -public interface RaiContentFiltersClient { - /** - * Get Content Filters by Name. - * - * @param location The name of the Azure region. - * @param filterName The name of the RAI Content Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return content Filters by Name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String location, String filterName, Context context); - - /** - * Get Content Filters by Name. - * - * @param location The name of the Azure region. - * @param filterName The name of the RAI Content Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return content Filters by Name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RaiContentFilterInner get(String location, String filterName); - - /** - * List Content Filters types. - * - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 Content Filters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location); - - /** - * List Content Filters types. - * - * @param location The name of the Azure region. - * @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 Content Filters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiExternalSafetyProvidersClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiExternalSafetyProvidersClient.java deleted file mode 100644 index 319cd1f89937..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiExternalSafetyProvidersClient.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; - -/** - * An instance of this class provides access to all the operations defined in RaiExternalSafetyProvidersClient. - */ -public interface RaiExternalSafetyProvidersClient { - /** - * Gets the specified external safety provider associated with the Subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @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 specified external safety provider associated with the Subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String safetyProviderName, Context context); - - /** - * Gets the specified external safety provider associated with the Subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 external safety provider associated with the Subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RaiExternalSafetyProviderSchemaInner get(String safetyProviderName); - - /** - * Create the rai safety provider associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @param safetyProvider Properties describing the rai external safety provider. - * @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 cognitive Services Rai External Safety provider Schema along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String safetyProviderName, - RaiExternalSafetyProviderSchemaInner safetyProvider, Context context); - - /** - * Create the rai safety provider associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @param safetyProvider Properties describing the rai external safety provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services Rai External Safety provider Schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RaiExternalSafetyProviderSchemaInner createOrUpdate(String safetyProviderName, - RaiExternalSafetyProviderSchemaInner safetyProvider); - - /** - * Deletes the specified custom topic associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 safetyProviderName); - - /** - * Deletes the specified custom topic associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @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 safetyProviderName, Context context); - - /** - * Deletes the specified custom topic associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 safetyProviderName); - - /** - * Deletes the specified custom topic associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @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 safetyProviderName, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiExternalSafetyProvidersOperationsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiExternalSafetyProvidersOperationsClient.java deleted file mode 100644 index b115f57125fb..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiExternalSafetyProvidersOperationsClient.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; - -/** - * An instance of this class provides access to all the operations defined in - * RaiExternalSafetyProvidersOperationsClient. - */ -public interface RaiExternalSafetyProvidersOperationsClient { - /** - * Gets the safety providers associated with the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the safety providers associated with the subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets the safety providers associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the safety providers associated with the subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiPoliciesClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiPoliciesClient.java deleted file mode 100644 index d850bea71a3a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiPoliciesClient.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.RaiPolicyInner; - -/** - * An instance of this class provides access to all the operations defined in RaiPoliciesClient. - */ -public interface RaiPoliciesClient { - /** - * Gets the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @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 specified Content Filters associated with the Azure OpenAI account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, String raiPolicyName, - Context context); - - /** - * Gets the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 Content Filters associated with the Azure OpenAI account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RaiPolicyInner get(String resourceGroupName, String accountName, String raiPolicyName); - - /** - * Update the state of specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @param raiPolicy Properties describing the Content Filters. - * @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 cognitive Services RaiPolicy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String raiPolicyName, RaiPolicyInner raiPolicy, Context context); - - /** - * Update the state of specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @param raiPolicy Properties describing the Content Filters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiPolicy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RaiPolicyInner createOrUpdate(String resourceGroupName, String accountName, String raiPolicyName, - RaiPolicyInner raiPolicy); - - /** - * Deletes the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, String raiPolicyName); - - /** - * Deletes the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @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 accountName, String raiPolicyName, - Context context); - - /** - * Deletes the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String raiPolicyName); - - /** - * Deletes the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @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 accountName, String raiPolicyName, Context context); - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiToolLabelsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiToolLabelsClient.java deleted file mode 100644 index 8ed03ad13aab..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiToolLabelsClient.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.RaiToolLabelInner; - -/** - * An instance of this class provides access to all the operations defined in RaiToolLabelsClient. - */ -public interface RaiToolLabelsClient { - /** - * Gets the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @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 specified RAI Tool Label associated with the Azure OpenAI account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, - String raiToolConnectionName, Context context); - - /** - * Gets the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 RAI Tool Label associated with the Azure OpenAI account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RaiToolLabelInner get(String resourceGroupName, String accountName, String raiToolConnectionName); - - /** - * Creates the RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @param raiToolLabel Properties describing the RAI Tool Label. - * @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 cognitive Services RAI Tool Label resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String raiToolConnectionName, RaiToolLabelInner raiToolLabel, Context context); - - /** - * Creates the RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @param raiToolLabel Properties describing the RAI Tool Label. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RAI Tool Label resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RaiToolLabelInner createOrUpdate(String resourceGroupName, String accountName, String raiToolConnectionName, - RaiToolLabelInner raiToolLabel); - - /** - * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, - String raiToolConnectionName); - - /** - * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @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 accountName, - String raiToolConnectionName, Context context); - - /** - * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String raiToolConnectionName); - - /** - * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @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 accountName, String raiToolConnectionName, Context context); - - /** - * Lists all RAI Tool Labels associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 Cognitive Services RAI Tool Labels as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Lists all RAI Tool Labels associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 Cognitive Services RAI Tool Labels as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiTopicsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiTopicsClient.java deleted file mode 100644 index c00cab6b710a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiTopicsClient.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.RaiTopicInner; - -/** - * An instance of this class provides access to all the operations defined in RaiTopicsClient. - */ -public interface RaiTopicsClient { - /** - * Gets the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @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 specified custom topic associated with the Azure OpenAI account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, String raiTopicName, - Context context); - - /** - * Gets the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 custom topic associated with the Azure OpenAI account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RaiTopicInner get(String resourceGroupName, String accountName, String raiTopicName); - - /** - * Create the rai topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @param raiTopic Properties describing the rai topic. - * @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 cognitive Services Rai Topic along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String raiTopicName, RaiTopicInner raiTopic, Context context); - - /** - * Create the rai topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @param raiTopic Properties describing the rai topic. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services Rai Topic. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RaiTopicInner createOrUpdate(String resourceGroupName, String accountName, String raiTopicName, - RaiTopicInner raiTopic); - - /** - * Deletes the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, String raiTopicName); - - /** - * Deletes the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @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 accountName, String raiTopicName, - Context context); - - /** - * Deletes the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String raiTopicName); - - /** - * Deletes the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @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 accountName, String raiTopicName, Context context); - - /** - * Gets the custom topics associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom topics associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the custom topics associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 custom topics associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ResourceProvidersClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ResourceProvidersClient.java deleted file mode 100644 index f48ca445ca38..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ResourceProvidersClient.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CalculateModelCapacityResultInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.DomainAvailabilityInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.SkuAvailabilityListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.CalculateModelCapacityParameter; -import com.azure.resourcemanager.cognitiveservices.models.CheckDomainAvailabilityParameter; -import com.azure.resourcemanager.cognitiveservices.models.CheckSkuAvailabilityParameter; - -/** - * An instance of this class provides access to all the operations defined in ResourceProvidersClient. - */ -public interface ResourceProvidersClient { - /** - * Check available SKUs. - * - * @param location The location name. - * @param parameters The request body. - * @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 check SKU availability result list along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkSkuAvailabilityWithResponse(String location, - CheckSkuAvailabilityParameter parameters, Context context); - - /** - * Check available SKUs. - * - * @param location The location name. - * @param parameters The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return check SKU availability result list. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SkuAvailabilityListResultInner checkSkuAvailability(String location, CheckSkuAvailabilityParameter parameters); - - /** - * Check whether a domain is available. - * - * @param parameters The request body. - * @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 domain availability along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkDomainAvailabilityWithResponse(CheckDomainAvailabilityParameter parameters, - Context context); - - /** - * Check whether a domain is available. - * - * @param parameters The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain availability. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DomainAvailabilityInner checkDomainAvailability(CheckDomainAvailabilityParameter parameters); - - /** - * Model capacity calculator. - * - * @param parameters The request body. - * @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 calculate Model Capacity result along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response - calculateModelCapacityWithResponse(CalculateModelCapacityParameter parameters, Context context); - - /** - * Model capacity calculator. - * - * @param parameters The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return calculate Model Capacity result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CalculateModelCapacityResultInner calculateModelCapacity(CalculateModelCapacityParameter parameters); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ResourceSkusClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ResourceSkusClient.java deleted file mode 100644 index c071140a4e84..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ResourceSkusClient.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ResourceSkuInner; - -/** - * An instance of this class provides access to all the operations defined in ResourceSkusClient. - */ -public interface ResourceSkusClient { - /** - * Gets the list of Microsoft.CognitiveServices SKUs available for your Subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Microsoft.CognitiveServices SKUs available for your Subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets the list of Microsoft.CognitiveServices SKUs available for your Subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Microsoft.CognitiveServices SKUs available for your Subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/SubscriptionRaiPoliciesClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/SubscriptionRaiPoliciesClient.java deleted file mode 100644 index 89bb23f4ab15..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/SubscriptionRaiPoliciesClient.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner; - -/** - * An instance of this class provides access to all the operations defined in SubscriptionRaiPoliciesClient. - */ -public interface SubscriptionRaiPoliciesClient { - /** - * Gets the specified Content Filters associated with the Subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @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 specified Content Filters associated with the Subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String raiPolicyName, Context context); - - /** - * Gets the specified Content Filters associated with the Subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 Content Filters associated with the Subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RaiPolicyInner get(String raiPolicyName); - - /** - * Update the state of specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @param raiPolicy Properties describing the Content Filters. - * @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 cognitive Services RaiPolicy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String raiPolicyName, RaiPolicyInner raiPolicy, - Context context); - - /** - * Update the state of specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @param raiPolicy Properties describing the Content Filters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiPolicy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RaiPolicyInner createOrUpdate(String raiPolicyName, RaiPolicyInner raiPolicy); - - /** - * Deletes the specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 raiPolicyName); - - /** - * Deletes the specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @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 raiPolicyName, Context context); - - /** - * Deletes the specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 raiPolicyName); - - /** - * Deletes the specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @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 raiPolicyName, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/TestRaiExternalSafetyProvidersClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/TestRaiExternalSafetyProvidersClient.java deleted file mode 100644 index 82c0a160933e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/TestRaiExternalSafetyProvidersClient.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; - -/** - * An instance of this class provides access to all the operations defined in TestRaiExternalSafetyProvidersClient. - */ -public interface TestRaiExternalSafetyProvidersClient { - /** - * Test the rai safety provider associated with the subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @param safetyProvider Properties describing the rai external safety provider. - * @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 cognitive Services Rai External Safety provider Schema along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, - String accountName, String safetyProviderName, RaiExternalSafetyProviderSchemaInner safetyProvider, - Context context); - - /** - * Test the rai safety provider associated with the subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @param safetyProvider Properties describing the rai external safety provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services Rai External Safety provider Schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RaiExternalSafetyProviderSchemaInner createOrUpdate(String resourceGroupName, String accountName, - String safetyProviderName, RaiExternalSafetyProviderSchemaInner safetyProvider); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/UsagesClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/UsagesClient.java deleted file mode 100644 index b864822815e6..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/UsagesClient.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner; - -/** - * An instance of this class provides access to all the operations defined in UsagesClient. - */ -public interface UsagesClient { - /** - * Get usages for the requested subscription. - * - * @param location The location 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 usages for the requested subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location); - - /** - * Get usages for the requested subscription. - * - * @param location The location name. - * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is - * name.value (name of the metric, can have an or of multiple names). - * @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 usages for the requested subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location, String filter, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/WorkbenchesClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/WorkbenchesClient.java deleted file mode 100644 index ada1d7322cf3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/WorkbenchesClient.java +++ /dev/null @@ -1,503 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.WorkbenchInner; - -/** - * An instance of this class provides access to all the operations defined in WorkbenchesClient. - */ -public interface WorkbenchesClient { - /** - * Gets the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @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 specified workbench associated with the project along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, String projectName, - String workbenchName, Context context); - - /** - * Gets the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 workbench associated with the project. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkbenchInner get(String resourceGroupName, String accountName, String projectName, String workbenchName); - - /** - * Creates or updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param resource The workbench 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 workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WorkbenchInner> beginCreateOrUpdate(String resourceGroupName, - String accountName, String projectName, String workbenchName, WorkbenchInner resource); - - /** - * Creates or updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param resource The workbench 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 workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WorkbenchInner> beginCreateOrUpdate(String resourceGroupName, - String accountName, String projectName, String workbenchName, WorkbenchInner resource, Context context); - - /** - * Creates or updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param resource The workbench 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 workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkbenchInner createOrUpdate(String resourceGroupName, String accountName, String projectName, - String workbenchName, WorkbenchInner resource); - - /** - * Creates or updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param resource The workbench 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 workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkbenchInner createOrUpdate(String resourceGroupName, String accountName, String projectName, - String workbenchName, WorkbenchInner resource, Context context); - - /** - * Updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param properties The workbench properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WorkbenchInner> beginUpdate(String resourceGroupName, String accountName, - String projectName, String workbenchName, WorkbenchInner properties); - - /** - * Updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param properties The workbench properties to update. - * @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 workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, WorkbenchInner> beginUpdate(String resourceGroupName, String accountName, - String projectName, String workbenchName, WorkbenchInner properties, Context context); - - /** - * Updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param properties The workbench properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkbenchInner update(String resourceGroupName, String accountName, String projectName, String workbenchName, - WorkbenchInner properties); - - /** - * Updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param properties The workbench properties to update. - * @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 workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkbenchInner update(String resourceGroupName, String accountName, String projectName, String workbenchName, - WorkbenchInner properties, Context context); - - /** - * Deletes the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, String projectName, - String workbenchName); - - /** - * Deletes the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @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 accountName, String projectName, - String workbenchName, Context context); - - /** - * Deletes the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String projectName, String workbenchName); - - /** - * Deletes the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @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 accountName, String projectName, String workbenchName, - Context context); - - /** - * Gets the workbenches associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the workbenches associated with the project as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, String projectName); - - /** - * Gets the workbenches associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @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 workbenches associated with the project as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, String projectName, - Context context); - - /** - * Starts a stopped workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 accountName, String projectName, - String workbenchName); - - /** - * Starts a stopped workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @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 accountName, String projectName, - String workbenchName, Context context); - - /** - * Starts a stopped workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String projectName, String workbenchName); - - /** - * Starts a stopped workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @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 accountName, String projectName, String workbenchName, Context context); - - /** - * Stops a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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> beginStop(String resourceGroupName, String accountName, String projectName, - String workbenchName); - - /** - * Stops a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @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> beginStop(String resourceGroupName, String accountName, String projectName, - String workbenchName, Context context); - - /** - * Stops a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String projectName, String workbenchName); - - /** - * Stops a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @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 stop(String resourceGroupName, String accountName, String projectName, String workbenchName, Context context); - - /** - * Restarts a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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> beginRestart(String resourceGroupName, String accountName, String projectName, - String workbenchName); - - /** - * Restarts a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @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> beginRestart(String resourceGroupName, String accountName, String projectName, - String workbenchName, Context context); - - /** - * Restarts a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 restart(String resourceGroupName, String accountName, String projectName, String workbenchName); - - /** - * Restarts a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @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 restart(String resourceGroupName, String accountName, String projectName, String workbenchName, - Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountInner.java deleted file mode 100644 index 7fb7a4e2834e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountInner.java +++ /dev/null @@ -1,315 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.AccountProperties; -import com.azure.resourcemanager.cognitiveservices.models.Identity; -import com.azure.resourcemanager.cognitiveservices.models.Sku; -import java.io.IOException; -import java.util.Map; - -/** - * Cognitive Services account is an Azure resource representing the provisioned account, it's type, location and SKU. - */ -@Fluent -public final class AccountInner extends ProxyResource { - /* - * Properties of Cognitive Services account. - */ - private AccountProperties properties; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The geo-location where the resource lives - */ - private String location; - - /* - * Resource Etag. - */ - private String etag; - - /* - * The kind (type) of cognitive service account. - */ - private String kind; - - /* - * The resource model definition representing SKU - */ - private Sku sku; - - /* - * Identity for the resource. - */ - private Identity identity; - - /* - * 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 AccountInner class. - */ - public AccountInner() { - } - - /** - * Get the properties property: Properties of Cognitive Services account. - * - * @return the properties value. - */ - public AccountProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of Cognitive Services account. - * - * @param properties the properties value to set. - * @return the AccountInner object itself. - */ - public AccountInner withProperties(AccountProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the AccountInner object itself. - */ - public AccountInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The geo-location where the resource lives. - * - * @param location the location value to set. - * @return the AccountInner object itself. - */ - public AccountInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the kind property: The kind (type) of cognitive service account. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: The kind (type) of cognitive service account. - * - * @param kind the kind value to set. - * @return the AccountInner object itself. - */ - public AccountInner withKind(String kind) { - this.kind = kind; - return this; - } - - /** - * Get the sku property: The resource model definition representing SKU. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The resource model definition representing SKU. - * - * @param sku the sku value to set. - * @return the AccountInner object itself. - */ - public AccountInner withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Get the identity property: Identity for the resource. - * - * @return the identity value. - */ - public Identity identity() { - return this.identity; - } - - /** - * Set the identity property: Identity for the resource. - * - * @param identity the identity value to set. - * @return the AccountInner object itself. - */ - public AccountInner withIdentity(Identity identity) { - this.identity = identity; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeStringField("kind", this.kind); - jsonWriter.writeJsonField("sku", this.sku); - jsonWriter.writeJsonField("identity", this.identity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AccountInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AccountInner 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 AccountInner. - */ - public static AccountInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AccountInner deserializedAccountInner = new AccountInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAccountInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAccountInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAccountInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAccountInner.properties = AccountProperties.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedAccountInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedAccountInner.location = reader.getString(); - } else if ("etag".equals(fieldName)) { - deserializedAccountInner.etag = reader.getString(); - } else if ("kind".equals(fieldName)) { - deserializedAccountInner.kind = reader.getString(); - } else if ("sku".equals(fieldName)) { - deserializedAccountInner.sku = Sku.fromJson(reader); - } else if ("identity".equals(fieldName)) { - deserializedAccountInner.identity = Identity.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAccountInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAccountInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountModelInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountModelInner.java deleted file mode 100644 index 8e65a7fd2535..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountModelInner.java +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent.models; - -import com.azure.core.annotation.Immutable; -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.cognitiveservices.models.CallRateLimit; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentModel; -import com.azure.resourcemanager.cognitiveservices.models.ModelDeprecationInfo; -import com.azure.resourcemanager.cognitiveservices.models.ModelLifecycleStatus; -import com.azure.resourcemanager.cognitiveservices.models.ModelSku; -import com.azure.resourcemanager.cognitiveservices.models.ReplacementConfig; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * Cognitive Services account Model. - */ -@Immutable -public final class AccountModelInner extends DeploymentModel { - /* - * Properties of Cognitive Services account deployment model. - */ - private DeploymentModel baseModel; - - /* - * If the model is default version. - */ - private Boolean isDefaultVersion; - - /* - * The list of Model Sku. - */ - private List skus; - - /* - * The max capacity. - */ - private Integer maxCapacity; - - /* - * The capabilities. - */ - private Map capabilities; - - /* - * The capabilities for finetune models. - */ - private Map finetuneCapabilities; - - /* - * Cognitive Services account ModelDeprecationInfo. - */ - private ModelDeprecationInfo deprecation; - - /* - * Configuration for model replacement. - */ - private ReplacementConfig replacementConfig; - - /* - * Asset identifier for the model in the model catalog. - */ - private String modelCatalogAssetId; - - /* - * Model lifecycle status. - */ - private ModelLifecycleStatus lifecycleStatus; - - /* - * Metadata pertaining to creation and last modification of the resource. - */ - private SystemData systemData; - - /* - * The call rate limit Cognitive Services account. - */ - private CallRateLimit callRateLimit; - - /** - * Creates an instance of AccountModelInner class. - */ - private AccountModelInner() { - } - - /** - * Get the baseModel property: Properties of Cognitive Services account deployment model. - * - * @return the baseModel value. - */ - public DeploymentModel baseModel() { - return this.baseModel; - } - - /** - * Get the isDefaultVersion property: If the model is default version. - * - * @return the isDefaultVersion value. - */ - public Boolean isDefaultVersion() { - return this.isDefaultVersion; - } - - /** - * Get the skus property: The list of Model Sku. - * - * @return the skus value. - */ - public List skus() { - return this.skus; - } - - /** - * Get the maxCapacity property: The max capacity. - * - * @return the maxCapacity value. - */ - public Integer maxCapacity() { - return this.maxCapacity; - } - - /** - * Get the capabilities property: The capabilities. - * - * @return the capabilities value. - */ - public Map capabilities() { - return this.capabilities; - } - - /** - * Get the finetuneCapabilities property: The capabilities for finetune models. - * - * @return the finetuneCapabilities value. - */ - public Map finetuneCapabilities() { - return this.finetuneCapabilities; - } - - /** - * Get the deprecation property: Cognitive Services account ModelDeprecationInfo. - * - * @return the deprecation value. - */ - public ModelDeprecationInfo deprecation() { - return this.deprecation; - } - - /** - * Get the replacementConfig property: Configuration for model replacement. - * - * @return the replacementConfig value. - */ - public ReplacementConfig replacementConfig() { - return this.replacementConfig; - } - - /** - * Get the modelCatalogAssetId property: Asset identifier for the model in the model catalog. - * - * @return the modelCatalogAssetId value. - */ - public String modelCatalogAssetId() { - return this.modelCatalogAssetId; - } - - /** - * Get the lifecycleStatus property: Model lifecycle status. - * - * @return the lifecycleStatus value. - */ - public ModelLifecycleStatus lifecycleStatus() { - return this.lifecycleStatus; - } - - /** - * 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 callRateLimit property: The call rate limit Cognitive Services account. - * - * @return the callRateLimit value. - */ - @Override - public CallRateLimit callRateLimit() { - return this.callRateLimit; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("publisher", publisher()); - jsonWriter.writeStringField("format", format()); - jsonWriter.writeStringField("name", name()); - jsonWriter.writeStringField("version", version()); - jsonWriter.writeStringField("source", source()); - jsonWriter.writeStringField("sourceAccount", sourceAccount()); - jsonWriter.writeJsonField("baseModel", this.baseModel); - jsonWriter.writeBooleanField("isDefaultVersion", this.isDefaultVersion); - jsonWriter.writeArrayField("skus", this.skus, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeNumberField("maxCapacity", this.maxCapacity); - jsonWriter.writeMapField("capabilities", this.capabilities, (writer, element) -> writer.writeString(element)); - jsonWriter.writeMapField("finetuneCapabilities", this.finetuneCapabilities, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("deprecation", this.deprecation); - jsonWriter.writeJsonField("replacementConfig", this.replacementConfig); - jsonWriter.writeStringField("modelCatalogAssetId", this.modelCatalogAssetId); - jsonWriter.writeStringField("lifecycleStatus", - this.lifecycleStatus == null ? null : this.lifecycleStatus.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AccountModelInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AccountModelInner 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 AccountModelInner. - */ - public static AccountModelInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AccountModelInner deserializedAccountModelInner = new AccountModelInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("publisher".equals(fieldName)) { - deserializedAccountModelInner.withPublisher(reader.getString()); - } else if ("format".equals(fieldName)) { - deserializedAccountModelInner.withFormat(reader.getString()); - } else if ("name".equals(fieldName)) { - deserializedAccountModelInner.withName(reader.getString()); - } else if ("version".equals(fieldName)) { - deserializedAccountModelInner.withVersion(reader.getString()); - } else if ("source".equals(fieldName)) { - deserializedAccountModelInner.withSource(reader.getString()); - } else if ("sourceAccount".equals(fieldName)) { - deserializedAccountModelInner.withSourceAccount(reader.getString()); - } else if ("callRateLimit".equals(fieldName)) { - deserializedAccountModelInner.callRateLimit = CallRateLimit.fromJson(reader); - } else if ("baseModel".equals(fieldName)) { - deserializedAccountModelInner.baseModel = DeploymentModel.fromJson(reader); - } else if ("isDefaultVersion".equals(fieldName)) { - deserializedAccountModelInner.isDefaultVersion = reader.getNullable(JsonReader::getBoolean); - } else if ("skus".equals(fieldName)) { - List skus = reader.readArray(reader1 -> ModelSku.fromJson(reader1)); - deserializedAccountModelInner.skus = skus; - } else if ("maxCapacity".equals(fieldName)) { - deserializedAccountModelInner.maxCapacity = reader.getNullable(JsonReader::getInt); - } else if ("capabilities".equals(fieldName)) { - Map capabilities = reader.readMap(reader1 -> reader1.getString()); - deserializedAccountModelInner.capabilities = capabilities; - } else if ("finetuneCapabilities".equals(fieldName)) { - Map finetuneCapabilities = reader.readMap(reader1 -> reader1.getString()); - deserializedAccountModelInner.finetuneCapabilities = finetuneCapabilities; - } else if ("deprecation".equals(fieldName)) { - deserializedAccountModelInner.deprecation = ModelDeprecationInfo.fromJson(reader); - } else if ("replacementConfig".equals(fieldName)) { - deserializedAccountModelInner.replacementConfig = ReplacementConfig.fromJson(reader); - } else if ("modelCatalogAssetId".equals(fieldName)) { - deserializedAccountModelInner.modelCatalogAssetId = reader.getString(); - } else if ("lifecycleStatus".equals(fieldName)) { - deserializedAccountModelInner.lifecycleStatus = ModelLifecycleStatus.fromString(reader.getString()); - } else if ("systemData".equals(fieldName)) { - deserializedAccountModelInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAccountModelInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountSkuListResultInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountSkuListResultInner.java deleted file mode 100644 index cdaaa98777a3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountSkuListResultInner.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.models.AccountSku; -import java.io.IOException; -import java.util.List; - -/** - * The list of cognitive services accounts operation response. - */ -@Immutable -public final class AccountSkuListResultInner implements JsonSerializable { - /* - * Gets the list of Cognitive Services accounts and their properties. - */ - private List value; - - /** - * Creates an instance of AccountSkuListResultInner class. - */ - private AccountSkuListResultInner() { - } - - /** - * Get the value property: Gets the list of Cognitive Services accounts and their properties. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 AccountSkuListResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AccountSkuListResultInner 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 AccountSkuListResultInner. - */ - public static AccountSkuListResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AccountSkuListResultInner deserializedAccountSkuListResultInner = new AccountSkuListResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> AccountSku.fromJson(reader1)); - deserializedAccountSkuListResultInner.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedAccountSkuListResultInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentApplicationInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentApplicationInner.java deleted file mode 100644 index 4fa0de73bf6f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentApplicationInner.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.AgenticApplicationProperties; -import java.io.IOException; - -/** - * Agent Application resource. - */ -@Fluent -public final class AgentApplicationInner extends ProxyResource { - /* - * [Required] Additional attributes of the entity. - */ - private AgenticApplicationProperties 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 AgentApplicationInner class. - */ - public AgentApplicationInner() { - } - - /** - * Get the properties property: [Required] Additional attributes of the entity. - * - * @return the properties value. - */ - public AgenticApplicationProperties properties() { - return this.properties; - } - - /** - * Set the properties property: [Required] Additional attributes of the entity. - * - * @param properties the properties value to set. - * @return the AgentApplicationInner object itself. - */ - public AgentApplicationInner withProperties(AgenticApplicationProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AgentApplicationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AgentApplicationInner 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 AgentApplicationInner. - */ - public static AgentApplicationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AgentApplicationInner deserializedAgentApplicationInner = new AgentApplicationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAgentApplicationInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAgentApplicationInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAgentApplicationInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAgentApplicationInner.properties = AgenticApplicationProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAgentApplicationInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAgentApplicationInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentDeploymentInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentDeploymentInner.java deleted file mode 100644 index 04b0639f6b43..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentDeploymentInner.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.AgentDeploymentProperties; -import java.io.IOException; - -/** - * Agent Deployment resource. - */ -@Fluent -public final class AgentDeploymentInner extends ProxyResource { - /* - * [Required] Additional attributes of the entity. - */ - private AgentDeploymentProperties 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 AgentDeploymentInner class. - */ - public AgentDeploymentInner() { - } - - /** - * Get the properties property: [Required] Additional attributes of the entity. - * - * @return the properties value. - */ - public AgentDeploymentProperties properties() { - return this.properties; - } - - /** - * Set the properties property: [Required] Additional attributes of the entity. - * - * @param properties the properties value to set. - * @return the AgentDeploymentInner object itself. - */ - public AgentDeploymentInner withProperties(AgentDeploymentProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AgentDeploymentInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AgentDeploymentInner 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 AgentDeploymentInner. - */ - public static AgentDeploymentInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AgentDeploymentInner deserializedAgentDeploymentInner = new AgentDeploymentInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAgentDeploymentInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAgentDeploymentInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAgentDeploymentInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAgentDeploymentInner.properties = AgentDeploymentProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAgentDeploymentInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAgentDeploymentInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentReferenceResourceArmPaginatedResultInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentReferenceResourceArmPaginatedResultInner.java deleted file mode 100644 index 112f4f610bcc..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentReferenceResourceArmPaginatedResultInner.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.models.AgentReference; -import java.io.IOException; -import java.util.List; - -/** - * A paginated list of Agent Reference entities. - */ -@Immutable -public final class AgentReferenceResourceArmPaginatedResultInner - implements JsonSerializable { - /* - * The link to the next page of Agent Reference objects. If null, there are no additional pages. - */ - private String nextLink; - - /* - * An array of objects of type Agent Reference. - */ - private List value; - - /** - * Creates an instance of AgentReferenceResourceArmPaginatedResultInner class. - */ - private AgentReferenceResourceArmPaginatedResultInner() { - } - - /** - * Get the nextLink property: The link to the next page of Agent Reference objects. If null, there are no additional - * pages. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: An array of objects of type Agent Reference. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 AgentReferenceResourceArmPaginatedResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AgentReferenceResourceArmPaginatedResultInner 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 AgentReferenceResourceArmPaginatedResultInner. - */ - public static AgentReferenceResourceArmPaginatedResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AgentReferenceResourceArmPaginatedResultInner deserializedAgentReferenceResourceArmPaginatedResultInner - = new AgentReferenceResourceArmPaginatedResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedAgentReferenceResourceArmPaginatedResultInner.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> AgentReference.fromJson(reader1)); - deserializedAgentReferenceResourceArmPaginatedResultInner.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedAgentReferenceResourceArmPaginatedResultInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ApiKeysInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ApiKeysInner.java deleted file mode 100644 index 816274b98909..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ApiKeysInner.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * The access keys for the cognitive services account. - */ -@Immutable -public final class ApiKeysInner implements JsonSerializable { - /* - * Gets the value of key 1. - */ - private String key1; - - /* - * Gets the value of key 2. - */ - private String key2; - - /** - * Creates an instance of ApiKeysInner class. - */ - private ApiKeysInner() { - } - - /** - * Get the key1 property: Gets the value of key 1. - * - * @return the key1 value. - */ - public String key1() { - return this.key1; - } - - /** - * Get the key2 property: Gets the value of key 2. - * - * @return the key2 value. - */ - public String key2() { - return this.key2; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("key1", this.key1); - jsonWriter.writeStringField("key2", this.key2); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ApiKeysInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ApiKeysInner 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 ApiKeysInner. - */ - public static ApiKeysInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ApiKeysInner deserializedApiKeysInner = new ApiKeysInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("key1".equals(fieldName)) { - deserializedApiKeysInner.key1 = reader.getString(); - } else if ("key2".equals(fieldName)) { - deserializedApiKeysInner.key2 = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedApiKeysInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CalculateModelCapacityResultInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CalculateModelCapacityResultInner.java deleted file mode 100644 index 52cac0416dfa..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CalculateModelCapacityResultInner.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.models.CalculateModelCapacityResultEstimatedCapacity; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentModel; -import java.io.IOException; - -/** - * Calculate Model Capacity result. - */ -@Immutable -public final class CalculateModelCapacityResultInner implements JsonSerializable { - /* - * Properties of Cognitive Services account deployment model. - */ - private DeploymentModel model; - - /* - * The skuName property. - */ - private String skuName; - - /* - * Model Estimated Capacity. - */ - private CalculateModelCapacityResultEstimatedCapacity estimatedCapacity; - - /** - * Creates an instance of CalculateModelCapacityResultInner class. - */ - private CalculateModelCapacityResultInner() { - } - - /** - * Get the model property: Properties of Cognitive Services account deployment model. - * - * @return the model value. - */ - public DeploymentModel model() { - return this.model; - } - - /** - * Get the skuName property: The skuName property. - * - * @return the skuName value. - */ - public String skuName() { - return this.skuName; - } - - /** - * Get the estimatedCapacity property: Model Estimated Capacity. - * - * @return the estimatedCapacity value. - */ - public CalculateModelCapacityResultEstimatedCapacity estimatedCapacity() { - return this.estimatedCapacity; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("model", this.model); - jsonWriter.writeStringField("skuName", this.skuName); - jsonWriter.writeJsonField("estimatedCapacity", this.estimatedCapacity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CalculateModelCapacityResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CalculateModelCapacityResultInner 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 CalculateModelCapacityResultInner. - */ - public static CalculateModelCapacityResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CalculateModelCapacityResultInner deserializedCalculateModelCapacityResultInner - = new CalculateModelCapacityResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("model".equals(fieldName)) { - deserializedCalculateModelCapacityResultInner.model = DeploymentModel.fromJson(reader); - } else if ("skuName".equals(fieldName)) { - deserializedCalculateModelCapacityResultInner.skuName = reader.getString(); - } else if ("estimatedCapacity".equals(fieldName)) { - deserializedCalculateModelCapacityResultInner.estimatedCapacity - = CalculateModelCapacityResultEstimatedCapacity.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCalculateModelCapacityResultInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CapabilityHostInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CapabilityHostInner.java deleted file mode 100644 index 79f87625dd23..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CapabilityHostInner.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.CapabilityHostProperties; -import java.io.IOException; - -/** - * Azure Resource Manager resource envelope. - */ -@Fluent -public final class CapabilityHostInner extends ProxyResource { - /* - * [Required] Additional attributes of the entity. - */ - private CapabilityHostProperties 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 CapabilityHostInner class. - */ - public CapabilityHostInner() { - } - - /** - * Get the properties property: [Required] Additional attributes of the entity. - * - * @return the properties value. - */ - public CapabilityHostProperties properties() { - return this.properties; - } - - /** - * Set the properties property: [Required] Additional attributes of the entity. - * - * @param properties the properties value to set. - * @return the CapabilityHostInner object itself. - */ - public CapabilityHostInner withProperties(CapabilityHostProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CapabilityHostInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CapabilityHostInner 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 CapabilityHostInner. - */ - public static CapabilityHostInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CapabilityHostInner deserializedCapabilityHostInner = new CapabilityHostInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedCapabilityHostInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedCapabilityHostInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedCapabilityHostInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedCapabilityHostInner.properties = CapabilityHostProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedCapabilityHostInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCapabilityHostInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationInner.java deleted file mode 100644 index 4ad40dc4a856..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationInner.java +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 java.io.IOException; -import java.util.Map; - -/** - * The commitment plan association. - */ -@Fluent -public final class CommitmentPlanAccountAssociationInner extends ProxyResource { - /* - * Properties of Cognitive Services account commitment plan association. - */ - private CommitmentPlanAccountAssociationProperties innerProperties; - - /* - * Resource Etag. - */ - private String etag; - - /* - * Resource tags. - */ - private Map tags; - - /* - * 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 CommitmentPlanAccountAssociationInner class. - */ - public CommitmentPlanAccountAssociationInner() { - } - - /** - * Get the innerProperties property: Properties of Cognitive Services account commitment plan association. - * - * @return the innerProperties value. - */ - private CommitmentPlanAccountAssociationProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the CommitmentPlanAccountAssociationInner object itself. - */ - public CommitmentPlanAccountAssociationInner withTags(Map tags) { - this.tags = tags; - 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; - } - - /** - * Get the accountId property: The Azure resource id of the account. - * - * @return the accountId value. - */ - public String accountId() { - return this.innerProperties() == null ? null : this.innerProperties().accountId(); - } - - /** - * Set the accountId property: The Azure resource id of the account. - * - * @param accountId the accountId value to set. - * @return the CommitmentPlanAccountAssociationInner object itself. - */ - public CommitmentPlanAccountAssociationInner withAccountId(String accountId) { - if (this.innerProperties() == null) { - this.innerProperties = new CommitmentPlanAccountAssociationProperties(); - } - this.innerProperties().withAccountId(accountId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CommitmentPlanAccountAssociationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CommitmentPlanAccountAssociationInner 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 CommitmentPlanAccountAssociationInner. - */ - public static CommitmentPlanAccountAssociationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CommitmentPlanAccountAssociationInner deserializedCommitmentPlanAccountAssociationInner - = new CommitmentPlanAccountAssociationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedCommitmentPlanAccountAssociationInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedCommitmentPlanAccountAssociationInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedCommitmentPlanAccountAssociationInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedCommitmentPlanAccountAssociationInner.innerProperties - = CommitmentPlanAccountAssociationProperties.fromJson(reader); - } else if ("etag".equals(fieldName)) { - deserializedCommitmentPlanAccountAssociationInner.etag = reader.getString(); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedCommitmentPlanAccountAssociationInner.tags = tags; - } else if ("systemData".equals(fieldName)) { - deserializedCommitmentPlanAccountAssociationInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCommitmentPlanAccountAssociationInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationProperties.java deleted file mode 100644 index ea9bd4bdfadd..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationProperties.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 commitment plan account association properties. - */ -@Fluent -public final class CommitmentPlanAccountAssociationProperties - implements JsonSerializable { - /* - * The Azure resource id of the account. - */ - private String accountId; - - /** - * Creates an instance of CommitmentPlanAccountAssociationProperties class. - */ - public CommitmentPlanAccountAssociationProperties() { - } - - /** - * Get the accountId property: The Azure resource id of the account. - * - * @return the accountId value. - */ - public String accountId() { - return this.accountId; - } - - /** - * Set the accountId property: The Azure resource id of the account. - * - * @param accountId the accountId value to set. - * @return the CommitmentPlanAccountAssociationProperties object itself. - */ - public CommitmentPlanAccountAssociationProperties withAccountId(String accountId) { - this.accountId = accountId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("accountId", this.accountId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CommitmentPlanAccountAssociationProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CommitmentPlanAccountAssociationProperties 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 CommitmentPlanAccountAssociationProperties. - */ - public static CommitmentPlanAccountAssociationProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CommitmentPlanAccountAssociationProperties deserializedCommitmentPlanAccountAssociationProperties - = new CommitmentPlanAccountAssociationProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("accountId".equals(fieldName)) { - deserializedCommitmentPlanAccountAssociationProperties.accountId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCommitmentPlanAccountAssociationProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanInner.java deleted file mode 100644 index e69b3ab758cd..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanInner.java +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.CommitmentPlanProperties; -import com.azure.resourcemanager.cognitiveservices.models.Sku; -import java.io.IOException; -import java.util.Map; - -/** - * Cognitive Services account commitment plan. - */ -@Fluent -public final class CommitmentPlanInner extends ProxyResource { - /* - * Properties of Cognitive Services account commitment plan. - */ - private CommitmentPlanProperties properties; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The geo-location where the resource lives - */ - private String location; - - /* - * Resource Etag. - */ - private String etag; - - /* - * The kind (type) of cognitive service account. - */ - private String kind; - - /* - * The resource model definition representing SKU - */ - private Sku sku; - - /* - * 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 CommitmentPlanInner class. - */ - public CommitmentPlanInner() { - } - - /** - * Get the properties property: Properties of Cognitive Services account commitment plan. - * - * @return the properties value. - */ - public CommitmentPlanProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of Cognitive Services account commitment plan. - * - * @param properties the properties value to set. - * @return the CommitmentPlanInner object itself. - */ - public CommitmentPlanInner withProperties(CommitmentPlanProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the CommitmentPlanInner object itself. - */ - public CommitmentPlanInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The geo-location where the resource lives. - * - * @param location the location value to set. - * @return the CommitmentPlanInner object itself. - */ - public CommitmentPlanInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the kind property: The kind (type) of cognitive service account. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: The kind (type) of cognitive service account. - * - * @param kind the kind value to set. - * @return the CommitmentPlanInner object itself. - */ - public CommitmentPlanInner withKind(String kind) { - this.kind = kind; - return this; - } - - /** - * Get the sku property: The resource model definition representing SKU. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The resource model definition representing SKU. - * - * @param sku the sku value to set. - * @return the CommitmentPlanInner object itself. - */ - public CommitmentPlanInner withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeStringField("kind", this.kind); - jsonWriter.writeJsonField("sku", this.sku); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CommitmentPlanInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CommitmentPlanInner 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 CommitmentPlanInner. - */ - public static CommitmentPlanInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CommitmentPlanInner deserializedCommitmentPlanInner = new CommitmentPlanInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedCommitmentPlanInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedCommitmentPlanInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedCommitmentPlanInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedCommitmentPlanInner.properties = CommitmentPlanProperties.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedCommitmentPlanInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedCommitmentPlanInner.location = reader.getString(); - } else if ("etag".equals(fieldName)) { - deserializedCommitmentPlanInner.etag = reader.getString(); - } else if ("kind".equals(fieldName)) { - deserializedCommitmentPlanInner.kind = reader.getString(); - } else if ("sku".equals(fieldName)) { - deserializedCommitmentPlanInner.sku = Sku.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedCommitmentPlanInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCommitmentPlanInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentTierInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentTierInner.java deleted file mode 100644 index a1684b3ee5d3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentTierInner.java +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentCost; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentQuota; -import com.azure.resourcemanager.cognitiveservices.models.HostingModel; -import java.io.IOException; - -/** - * Cognitive Services account commitment tier. - */ -@Immutable -public final class CommitmentTierInner implements JsonSerializable { - /* - * The kind (type) of cognitive service account. - */ - private String kind; - - /* - * The name of the SKU. Ex - P3. It is typically a letter+number code - */ - private String skuName; - - /* - * Account hosting model. - */ - private HostingModel hostingModel; - - /* - * Commitment plan type. - */ - private String planType; - - /* - * Commitment period commitment tier. - */ - private String tier; - - /* - * Commitment period commitment max count. - */ - private Integer maxCount; - - /* - * Cognitive Services account commitment quota. - */ - private CommitmentQuota quota; - - /* - * Cognitive Services account commitment cost. - */ - private CommitmentCost cost; - - /** - * Creates an instance of CommitmentTierInner class. - */ - private CommitmentTierInner() { - } - - /** - * Get the kind property: The kind (type) of cognitive service account. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Get the skuName property: The name of the SKU. Ex - P3. It is typically a letter+number code. - * - * @return the skuName value. - */ - public String skuName() { - return this.skuName; - } - - /** - * Get the hostingModel property: Account hosting model. - * - * @return the hostingModel value. - */ - public HostingModel hostingModel() { - return this.hostingModel; - } - - /** - * Get the planType property: Commitment plan type. - * - * @return the planType value. - */ - public String planType() { - return this.planType; - } - - /** - * Get the tier property: Commitment period commitment tier. - * - * @return the tier value. - */ - public String tier() { - return this.tier; - } - - /** - * Get the maxCount property: Commitment period commitment max count. - * - * @return the maxCount value. - */ - public Integer maxCount() { - return this.maxCount; - } - - /** - * Get the quota property: Cognitive Services account commitment quota. - * - * @return the quota value. - */ - public CommitmentQuota quota() { - return this.quota; - } - - /** - * Get the cost property: Cognitive Services account commitment cost. - * - * @return the cost value. - */ - public CommitmentCost cost() { - return this.cost; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("kind", this.kind); - jsonWriter.writeStringField("skuName", this.skuName); - jsonWriter.writeStringField("hostingModel", this.hostingModel == null ? null : this.hostingModel.toString()); - jsonWriter.writeStringField("planType", this.planType); - jsonWriter.writeStringField("tier", this.tier); - jsonWriter.writeNumberField("maxCount", this.maxCount); - jsonWriter.writeJsonField("quota", this.quota); - jsonWriter.writeJsonField("cost", this.cost); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CommitmentTierInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CommitmentTierInner 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 CommitmentTierInner. - */ - public static CommitmentTierInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CommitmentTierInner deserializedCommitmentTierInner = new CommitmentTierInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("kind".equals(fieldName)) { - deserializedCommitmentTierInner.kind = reader.getString(); - } else if ("skuName".equals(fieldName)) { - deserializedCommitmentTierInner.skuName = reader.getString(); - } else if ("hostingModel".equals(fieldName)) { - deserializedCommitmentTierInner.hostingModel = HostingModel.fromString(reader.getString()); - } else if ("planType".equals(fieldName)) { - deserializedCommitmentTierInner.planType = reader.getString(); - } else if ("tier".equals(fieldName)) { - deserializedCommitmentTierInner.tier = reader.getString(); - } else if ("maxCount".equals(fieldName)) { - deserializedCommitmentTierInner.maxCount = reader.getNullable(JsonReader::getInt); - } else if ("quota".equals(fieldName)) { - deserializedCommitmentTierInner.quota = CommitmentQuota.fromJson(reader); - } else if ("cost".equals(fieldName)) { - deserializedCommitmentTierInner.cost = CommitmentCost.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCommitmentTierInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ComputeInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ComputeInner.java deleted file mode 100644 index 6bdd7649390d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ComputeInner.java +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.ComputeProperties; -import com.azure.resourcemanager.cognitiveservices.models.Identity; -import java.io.IOException; -import java.util.Map; - -/** - * Cognitive Services compute resource. Supports polymorphic compute types - * (Cluster, ContainerInstance) via the computeType discriminator in properties. - */ -@Fluent -public final class ComputeInner extends ProxyResource { - /* - * Polymorphic properties of the compute resource. Use computeType to select Cluster or ContainerInstance. - */ - private ComputeProperties properties; - - /* - * Resource Etag. - */ - private String etag; - - /* - * The location of the compute resource. - */ - private String location; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The kind (type) of compute resource. - */ - private String kind; - - /* - * Identity for the resource. - */ - private Identity identity; - - /* - * 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 ComputeInner class. - */ - public ComputeInner() { - } - - /** - * Get the properties property: Polymorphic properties of the compute resource. Use computeType to select Cluster or - * ContainerInstance. - * - * @return the properties value. - */ - public ComputeProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Polymorphic properties of the compute resource. Use computeType to select Cluster or - * ContainerInstance. - * - * @param properties the properties value to set. - * @return the ComputeInner object itself. - */ - public ComputeInner withProperties(ComputeProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the location property: The location of the compute resource. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The location of the compute resource. - * - * @param location the location value to set. - * @return the ComputeInner object itself. - */ - public ComputeInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the ComputeInner object itself. - */ - public ComputeInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the kind property: The kind (type) of compute resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: The kind (type) of compute resource. - * - * @param kind the kind value to set. - * @return the ComputeInner object itself. - */ - public ComputeInner withKind(String kind) { - this.kind = kind; - return this; - } - - /** - * Get the identity property: Identity for the resource. - * - * @return the identity value. - */ - public Identity identity() { - return this.identity; - } - - /** - * Set the identity property: Identity for the resource. - * - * @param identity the identity value to set. - * @return the ComputeInner object itself. - */ - public ComputeInner withIdentity(Identity identity) { - this.identity = identity; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("kind", this.kind); - jsonWriter.writeJsonField("identity", this.identity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ComputeInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComputeInner 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 ComputeInner. - */ - public static ComputeInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ComputeInner deserializedComputeInner = new ComputeInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedComputeInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedComputeInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedComputeInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedComputeInner.properties = ComputeProperties.fromJson(reader); - } else if ("etag".equals(fieldName)) { - deserializedComputeInner.etag = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedComputeInner.location = reader.getString(); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedComputeInner.tags = tags; - } else if ("kind".equals(fieldName)) { - deserializedComputeInner.kind = reader.getString(); - } else if ("identity".equals(fieldName)) { - deserializedComputeInner.identity = Identity.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedComputeInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedComputeInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ComputeOperationStatusInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ComputeOperationStatusInner.java deleted file mode 100644 index 259e9efef313..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ComputeOperationStatusInner.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.models.ComputeOperationStatusProperties; -import java.io.IOException; - -/** - * The status of an async compute operation. - */ -@Immutable -public final class ComputeOperationStatusInner extends ProxyResource { - /* - * The properties of the compute operation status. - */ - private ComputeOperationStatusProperties 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 ComputeOperationStatusInner class. - */ - private ComputeOperationStatusInner() { - } - - /** - * Get the properties property: The properties of the compute operation status. - * - * @return the properties value. - */ - public ComputeOperationStatusProperties properties() { - return this.properties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ComputeOperationStatusInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComputeOperationStatusInner 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 ComputeOperationStatusInner. - */ - public static ComputeOperationStatusInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ComputeOperationStatusInner deserializedComputeOperationStatusInner = new ComputeOperationStatusInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedComputeOperationStatusInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedComputeOperationStatusInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedComputeOperationStatusInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedComputeOperationStatusInner.properties - = ComputeOperationStatusProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedComputeOperationStatusInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedComputeOperationStatusInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ConnectionPropertiesV2BasicResourceInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ConnectionPropertiesV2BasicResourceInner.java deleted file mode 100644 index 62673b7c6fb6..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ConnectionPropertiesV2BasicResourceInner.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.ConnectionPropertiesV2; -import java.io.IOException; - -/** - * Connection base resource schema. - */ -@Fluent -public final class ConnectionPropertiesV2BasicResourceInner extends ProxyResource { - /* - * Connection property base schema. - */ - private ConnectionPropertiesV2 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 ConnectionPropertiesV2BasicResourceInner class. - */ - public ConnectionPropertiesV2BasicResourceInner() { - } - - /** - * Get the properties property: Connection property base schema. - * - * @return the properties value. - */ - public ConnectionPropertiesV2 properties() { - return this.properties; - } - - /** - * Set the properties property: Connection property base schema. - * - * @param properties the properties value to set. - * @return the ConnectionPropertiesV2BasicResourceInner object itself. - */ - public ConnectionPropertiesV2BasicResourceInner withProperties(ConnectionPropertiesV2 properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ConnectionPropertiesV2BasicResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ConnectionPropertiesV2BasicResourceInner 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 ConnectionPropertiesV2BasicResourceInner. - */ - public static ConnectionPropertiesV2BasicResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ConnectionPropertiesV2BasicResourceInner deserializedConnectionPropertiesV2BasicResourceInner - = new ConnectionPropertiesV2BasicResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedConnectionPropertiesV2BasicResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedConnectionPropertiesV2BasicResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedConnectionPropertiesV2BasicResourceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedConnectionPropertiesV2BasicResourceInner.properties - = ConnectionPropertiesV2.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedConnectionPropertiesV2BasicResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedConnectionPropertiesV2BasicResourceInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DefenderForAISettingInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DefenderForAISettingInner.java deleted file mode 100644 index a7ae1b622d74..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DefenderForAISettingInner.java +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.DefenderForAISettingState; -import java.io.IOException; -import java.util.Map; - -/** - * The Defender for AI resource. - */ -@Fluent -public final class DefenderForAISettingInner extends ProxyResource { - /* - * The Defender for AI resource properties. - */ - private DefenderForAISettingProperties innerProperties; - - /* - * Resource Etag. - */ - private String etag; - - /* - * Resource tags. - */ - private Map tags; - - /* - * 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 DefenderForAISettingInner class. - */ - public DefenderForAISettingInner() { - } - - /** - * Get the innerProperties property: The Defender for AI resource properties. - * - * @return the innerProperties value. - */ - private DefenderForAISettingProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the DefenderForAISettingInner object itself. - */ - public DefenderForAISettingInner withTags(Map tags) { - this.tags = tags; - 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; - } - - /** - * Get the state property: Defender for AI state on the AI resource. - * - * @return the state value. - */ - public DefenderForAISettingState state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Set the state property: Defender for AI state on the AI resource. - * - * @param state the state value to set. - * @return the DefenderForAISettingInner object itself. - */ - public DefenderForAISettingInner withState(DefenderForAISettingState state) { - if (this.innerProperties() == null) { - this.innerProperties = new DefenderForAISettingProperties(); - } - this.innerProperties().withState(state); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForAISettingInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForAISettingInner 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 DefenderForAISettingInner. - */ - public static DefenderForAISettingInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForAISettingInner deserializedDefenderForAISettingInner = new DefenderForAISettingInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedDefenderForAISettingInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedDefenderForAISettingInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedDefenderForAISettingInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedDefenderForAISettingInner.innerProperties - = DefenderForAISettingProperties.fromJson(reader); - } else if ("etag".equals(fieldName)) { - deserializedDefenderForAISettingInner.etag = reader.getString(); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedDefenderForAISettingInner.tags = tags; - } else if ("systemData".equals(fieldName)) { - deserializedDefenderForAISettingInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForAISettingInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DefenderForAISettingProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DefenderForAISettingProperties.java deleted file mode 100644 index 08a7ffc7c2db..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DefenderForAISettingProperties.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.DefenderForAISettingState; -import java.io.IOException; - -/** - * The Defender for AI resource properties. - */ -@Fluent -public final class DefenderForAISettingProperties implements JsonSerializable { - /* - * Defender for AI state on the AI resource. - */ - private DefenderForAISettingState state; - - /** - * Creates an instance of DefenderForAISettingProperties class. - */ - public DefenderForAISettingProperties() { - } - - /** - * Get the state property: Defender for AI state on the AI resource. - * - * @return the state value. - */ - public DefenderForAISettingState state() { - return this.state; - } - - /** - * Set the state property: Defender for AI state on the AI resource. - * - * @param state the state value to set. - * @return the DefenderForAISettingProperties object itself. - */ - public DefenderForAISettingProperties withState(DefenderForAISettingState state) { - this.state = state; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForAISettingProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForAISettingProperties 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 DefenderForAISettingProperties. - */ - public static DefenderForAISettingProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForAISettingProperties deserializedDefenderForAISettingProperties - = new DefenderForAISettingProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("state".equals(fieldName)) { - deserializedDefenderForAISettingProperties.state - = DefenderForAISettingState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForAISettingProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DeploymentInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DeploymentInner.java deleted file mode 100644 index 651a5a5a634d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DeploymentInner.java +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.DeploymentProperties; -import com.azure.resourcemanager.cognitiveservices.models.Sku; -import java.io.IOException; -import java.util.Map; - -/** - * Cognitive Services account deployment. - */ -@Fluent -public final class DeploymentInner extends ProxyResource { - /* - * Properties of Cognitive Services account deployment. - */ - private DeploymentProperties properties; - - /* - * The resource model definition representing SKU - */ - private Sku sku; - - /* - * Resource Etag. - */ - private String etag; - - /* - * Resource tags. - */ - private Map tags; - - /* - * 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 DeploymentInner class. - */ - public DeploymentInner() { - } - - /** - * Get the properties property: Properties of Cognitive Services account deployment. - * - * @return the properties value. - */ - public DeploymentProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of Cognitive Services account deployment. - * - * @param properties the properties value to set. - * @return the DeploymentInner object itself. - */ - public DeploymentInner withProperties(DeploymentProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the sku property: The resource model definition representing SKU. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The resource model definition representing SKU. - * - * @param sku the sku value to set. - * @return the DeploymentInner object itself. - */ - public DeploymentInner withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the DeploymentInner object itself. - */ - public DeploymentInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeJsonField("sku", this.sku); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeploymentInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeploymentInner 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 DeploymentInner. - */ - public static DeploymentInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DeploymentInner deserializedDeploymentInner = new DeploymentInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedDeploymentInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedDeploymentInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedDeploymentInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedDeploymentInner.properties = DeploymentProperties.fromJson(reader); - } else if ("sku".equals(fieldName)) { - deserializedDeploymentInner.sku = Sku.fromJson(reader); - } else if ("etag".equals(fieldName)) { - deserializedDeploymentInner.etag = reader.getString(); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedDeploymentInner.tags = tags; - } else if ("systemData".equals(fieldName)) { - deserializedDeploymentInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDeploymentInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DomainAvailabilityInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DomainAvailabilityInner.java deleted file mode 100644 index 3b87aa821c4a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DomainAvailabilityInner.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Domain availability. - */ -@Immutable -public final class DomainAvailabilityInner implements JsonSerializable { - /* - * Indicates the given SKU is available or not. - */ - private Boolean isSubdomainAvailable; - - /* - * Reason why the SKU is not available. - */ - private String reason; - - /* - * The subdomain name to use. - */ - private String subdomainName; - - /* - * The Type of the resource. - */ - private String type; - - /* - * The kind (type) of cognitive service account. - */ - private String kind; - - /** - * Creates an instance of DomainAvailabilityInner class. - */ - private DomainAvailabilityInner() { - } - - /** - * Get the isSubdomainAvailable property: Indicates the given SKU is available or not. - * - * @return the isSubdomainAvailable value. - */ - public Boolean isSubdomainAvailable() { - return this.isSubdomainAvailable; - } - - /** - * Get the reason property: Reason why the SKU is not available. - * - * @return the reason value. - */ - public String reason() { - return this.reason; - } - - /** - * Get the subdomainName property: The subdomain name to use. - * - * @return the subdomainName value. - */ - public String subdomainName() { - return this.subdomainName; - } - - /** - * Get the type property: The Type of the resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the kind property: The kind (type) of cognitive service account. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("isSubdomainAvailable", this.isSubdomainAvailable); - jsonWriter.writeStringField("reason", this.reason); - jsonWriter.writeStringField("subdomainName", this.subdomainName); - jsonWriter.writeStringField("type", this.type); - jsonWriter.writeStringField("kind", this.kind); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DomainAvailabilityInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DomainAvailabilityInner 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 DomainAvailabilityInner. - */ - public static DomainAvailabilityInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DomainAvailabilityInner deserializedDomainAvailabilityInner = new DomainAvailabilityInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("isSubdomainAvailable".equals(fieldName)) { - deserializedDomainAvailabilityInner.isSubdomainAvailable - = reader.getNullable(JsonReader::getBoolean); - } else if ("reason".equals(fieldName)) { - deserializedDomainAvailabilityInner.reason = reader.getString(); - } else if ("subdomainName".equals(fieldName)) { - deserializedDomainAvailabilityInner.subdomainName = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedDomainAvailabilityInner.type = reader.getString(); - } else if ("kind".equals(fieldName)) { - deserializedDomainAvailabilityInner.kind = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDomainAvailabilityInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/EncryptionScopeInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/EncryptionScopeInner.java deleted file mode 100644 index 94ea6f7041cc..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/EncryptionScopeInner.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.EncryptionScopeProperties; -import java.io.IOException; -import java.util.Map; - -/** - * Cognitive Services EncryptionScope. - */ -@Fluent -public final class EncryptionScopeInner extends ProxyResource { - /* - * Properties of Cognitive Services EncryptionScope. - */ - private EncryptionScopeProperties properties; - - /* - * Resource Etag. - */ - private String etag; - - /* - * Resource tags. - */ - private Map tags; - - /* - * 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 EncryptionScopeInner class. - */ - public EncryptionScopeInner() { - } - - /** - * Get the properties property: Properties of Cognitive Services EncryptionScope. - * - * @return the properties value. - */ - public EncryptionScopeProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of Cognitive Services EncryptionScope. - * - * @param properties the properties value to set. - * @return the EncryptionScopeInner object itself. - */ - public EncryptionScopeInner withProperties(EncryptionScopeProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the EncryptionScopeInner object itself. - */ - public EncryptionScopeInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EncryptionScopeInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EncryptionScopeInner 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 EncryptionScopeInner. - */ - public static EncryptionScopeInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EncryptionScopeInner deserializedEncryptionScopeInner = new EncryptionScopeInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedEncryptionScopeInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedEncryptionScopeInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedEncryptionScopeInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedEncryptionScopeInner.properties = EncryptionScopeProperties.fromJson(reader); - } else if ("etag".equals(fieldName)) { - deserializedEncryptionScopeInner.etag = reader.getString(); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedEncryptionScopeInner.tags = tags; - } else if ("systemData".equals(fieldName)) { - deserializedEncryptionScopeInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedEncryptionScopeInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/EvaluateDeploymentPoliciesResponseInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/EvaluateDeploymentPoliciesResponseInner.java deleted file mode 100644 index 3c4a513b409c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/EvaluateDeploymentPoliciesResponseInner.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentPolicyEvaluationResult; -import java.io.IOException; -import java.util.Map; - -/** - * Response body for the evaluateDeploymentPolicies action. - */ -@Immutable -public final class EvaluateDeploymentPoliciesResponseInner - implements JsonSerializable { - /* - * Per-deployment policy evaluation results, keyed by deployment name. - */ - private Map results; - - /** - * Creates an instance of EvaluateDeploymentPoliciesResponseInner class. - */ - private EvaluateDeploymentPoliciesResponseInner() { - } - - /** - * Get the results property: Per-deployment policy evaluation results, keyed by deployment name. - * - * @return the results value. - */ - public Map results() { - return this.results; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeMapField("results", this.results, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EvaluateDeploymentPoliciesResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EvaluateDeploymentPoliciesResponseInner 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 EvaluateDeploymentPoliciesResponseInner. - */ - public static EvaluateDeploymentPoliciesResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EvaluateDeploymentPoliciesResponseInner deserializedEvaluateDeploymentPoliciesResponseInner - = new EvaluateDeploymentPoliciesResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("results".equals(fieldName)) { - Map results - = reader.readMap(reader1 -> DeploymentPolicyEvaluationResult.fromJson(reader1)); - deserializedEvaluateDeploymentPoliciesResponseInner.results = results; - } else { - reader.skipChildren(); - } - } - - return deserializedEvaluateDeploymentPoliciesResponseInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedComputeCapacityInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedComputeCapacityInner.java deleted file mode 100644 index 8b3b052e9080..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedComputeCapacityInner.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.models.ManagedComputeCapacityProperties; -import java.io.IOException; - -/** - * Managed compute capacity information for Cognitive Services managed compute deployments. - * Provides available accelerator capacity per type and region at the subscription level. - */ -@Immutable -public final class ManagedComputeCapacityInner extends ProxyResource { - /* - * Properties of the managed compute capacity resource. - */ - private ManagedComputeCapacityProperties 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 ManagedComputeCapacityInner class. - */ - private ManagedComputeCapacityInner() { - } - - /** - * Get the properties property: Properties of the managed compute capacity resource. - * - * @return the properties value. - */ - public ManagedComputeCapacityProperties properties() { - return this.properties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ManagedComputeCapacityInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedComputeCapacityInner 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 ManagedComputeCapacityInner. - */ - public static ManagedComputeCapacityInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedComputeCapacityInner deserializedManagedComputeCapacityInner = new ManagedComputeCapacityInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedManagedComputeCapacityInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedManagedComputeCapacityInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedManagedComputeCapacityInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedManagedComputeCapacityInner.properties - = ManagedComputeCapacityProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedManagedComputeCapacityInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedManagedComputeCapacityInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedComputeDeploymentInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedComputeDeploymentInner.java deleted file mode 100644 index 7d4d1d866f78..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedComputeDeploymentInner.java +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.ManagedComputeDeploymentProperties; -import com.azure.resourcemanager.cognitiveservices.models.Sku; -import java.io.IOException; - -/** - * Cognitive Services account managed compute deployment, backed by managed compute (GPU) resources. - */ -@Fluent -public final class ManagedComputeDeploymentInner extends ProxyResource { - /* - * Properties of the Cognitive Services managed compute deployment. - */ - private ManagedComputeDeploymentProperties properties; - - /* - * The resource model definition representing SKU - */ - private Sku sku; - - /* - * Resource Etag. - */ - private String etag; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of ManagedComputeDeploymentInner class. - */ - public ManagedComputeDeploymentInner() { - } - - /** - * Get the properties property: Properties of the Cognitive Services managed compute deployment. - * - * @return the properties value. - */ - public ManagedComputeDeploymentProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of the Cognitive Services managed compute deployment. - * - * @param properties the properties value to set. - * @return the ManagedComputeDeploymentInner object itself. - */ - public ManagedComputeDeploymentInner withProperties(ManagedComputeDeploymentProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the sku property: The resource model definition representing SKU. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The resource model definition representing SKU. - * - * @param sku the sku value to set. - * @return the ManagedComputeDeploymentInner object itself. - */ - public ManagedComputeDeploymentInner withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeJsonField("sku", this.sku); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ManagedComputeDeploymentInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedComputeDeploymentInner 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 ManagedComputeDeploymentInner. - */ - public static ManagedComputeDeploymentInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedComputeDeploymentInner deserializedManagedComputeDeploymentInner - = new ManagedComputeDeploymentInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedManagedComputeDeploymentInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedManagedComputeDeploymentInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedManagedComputeDeploymentInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedManagedComputeDeploymentInner.properties - = ManagedComputeDeploymentProperties.fromJson(reader); - } else if ("sku".equals(fieldName)) { - deserializedManagedComputeDeploymentInner.sku = Sku.fromJson(reader); - } else if ("etag".equals(fieldName)) { - deserializedManagedComputeDeploymentInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedManagedComputeDeploymentInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedManagedComputeDeploymentInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedComputeUsageInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedComputeUsageInner.java deleted file mode 100644 index feadb95cca84..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedComputeUsageInner.java +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.models.ManagedComputeDeploymentInfo; -import com.azure.resourcemanager.cognitiveservices.models.MetricName; -import com.azure.resourcemanager.cognitiveservices.models.UnitType; -import java.io.IOException; -import java.util.List; - -/** - * Managed compute quota usage for a specific SKU. - */ -@Immutable -public final class ManagedComputeUsageInner implements JsonSerializable { - /* - * Fully qualified resource ID for the managed compute usage. - */ - private String id; - - /* - * The name information for the metric. - */ - private MetricName name; - - /* - * The resource type. - */ - private String type; - - /* - * The unit of the metric. - */ - private UnitType unit; - - /* - * Maximum value for this metric. - */ - private Double limit; - - /* - * Current value for this metric. - */ - private Double currentValue; - - /* - * Offer scope (e.g., 'Global', 'Datazone-US'). - */ - private String offerScope; - - /* - * Deployments consuming this managed compute quota. - */ - private List deployments; - - /** - * Creates an instance of ManagedComputeUsageInner class. - */ - private ManagedComputeUsageInner() { - } - - /** - * Get the id property: Fully qualified resource ID for the managed compute usage. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the name property: The name information for the metric. - * - * @return the name value. - */ - public MetricName name() { - return this.name; - } - - /** - * Get the type property: The resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the unit property: The unit of the metric. - * - * @return the unit value. - */ - public UnitType unit() { - return this.unit; - } - - /** - * Get the limit property: Maximum value for this metric. - * - * @return the limit value. - */ - public Double limit() { - return this.limit; - } - - /** - * Get the currentValue property: Current value for this metric. - * - * @return the currentValue value. - */ - public Double currentValue() { - return this.currentValue; - } - - /** - * Get the offerScope property: Offer scope (e.g., 'Global', 'Datazone-US'). - * - * @return the offerScope value. - */ - public String offerScope() { - return this.offerScope; - } - - /** - * Get the deployments property: Deployments consuming this managed compute quota. - * - * @return the deployments value. - */ - public List deployments() { - return this.deployments; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("unit", this.unit == null ? null : this.unit.toString()); - jsonWriter.writeNumberField("limit", this.limit); - jsonWriter.writeNumberField("currentValue", this.currentValue); - jsonWriter.writeStringField("offerScope", this.offerScope); - jsonWriter.writeArrayField("deployments", this.deployments, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ManagedComputeUsageInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedComputeUsageInner 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 ManagedComputeUsageInner. - */ - public static ManagedComputeUsageInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedComputeUsageInner deserializedManagedComputeUsageInner = new ManagedComputeUsageInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedManagedComputeUsageInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedManagedComputeUsageInner.name = MetricName.fromJson(reader); - } else if ("type".equals(fieldName)) { - deserializedManagedComputeUsageInner.type = reader.getString(); - } else if ("unit".equals(fieldName)) { - deserializedManagedComputeUsageInner.unit = UnitType.fromString(reader.getString()); - } else if ("limit".equals(fieldName)) { - deserializedManagedComputeUsageInner.limit = reader.getNullable(JsonReader::getDouble); - } else if ("currentValue".equals(fieldName)) { - deserializedManagedComputeUsageInner.currentValue = reader.getNullable(JsonReader::getDouble); - } else if ("offerScope".equals(fieldName)) { - deserializedManagedComputeUsageInner.offerScope = reader.getString(); - } else if ("deployments".equals(fieldName)) { - List deployments - = reader.readArray(reader1 -> ManagedComputeDeploymentInfo.fromJson(reader1)); - deserializedManagedComputeUsageInner.deployments = deployments; - } else { - reader.skipChildren(); - } - } - - return deserializedManagedComputeUsageInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkProvisionStatusInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkProvisionStatusInner.java deleted file mode 100644 index fc94b09913b5..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkProvisionStatusInner.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.ManagedNetworkStatus; -import java.io.IOException; - -/** - * Status of the Provisioning for the managed network of a cognitive services account. - */ -@Fluent -public final class ManagedNetworkProvisionStatusInner implements JsonSerializable { - /* - * Status for the managed network of a cognitive services account. - */ - private ManagedNetworkStatus status; - - /** - * Creates an instance of ManagedNetworkProvisionStatusInner class. - */ - public ManagedNetworkProvisionStatusInner() { - } - - /** - * Get the status property: Status for the managed network of a cognitive services account. - * - * @return the status value. - */ - public ManagedNetworkStatus status() { - return this.status; - } - - /** - * Set the status property: Status for the managed network of a cognitive services account. - * - * @param status the status value to set. - * @return the ManagedNetworkProvisionStatusInner object itself. - */ - public ManagedNetworkProvisionStatusInner withStatus(ManagedNetworkStatus status) { - this.status = status; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ManagedNetworkProvisionStatusInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedNetworkProvisionStatusInner 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 ManagedNetworkProvisionStatusInner. - */ - public static ManagedNetworkProvisionStatusInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedNetworkProvisionStatusInner deserializedManagedNetworkProvisionStatusInner - = new ManagedNetworkProvisionStatusInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedManagedNetworkProvisionStatusInner.status - = ManagedNetworkStatus.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedManagedNetworkProvisionStatusInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsBasicResourceInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsBasicResourceInner.java deleted file mode 100644 index 5467f8ef3ef3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsBasicResourceInner.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 java.io.IOException; - -/** - * The ManagedNetworkSettingsBasicResource model. - */ -@Fluent -public final class ManagedNetworkSettingsBasicResourceInner extends ProxyResource { - /* - * Managed Network settings for a cognitive services account. - */ - private ManagedNetworkSettingsInner 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 ManagedNetworkSettingsBasicResourceInner class. - */ - public ManagedNetworkSettingsBasicResourceInner() { - } - - /** - * Get the properties property: Managed Network settings for a cognitive services account. - * - * @return the properties value. - */ - public ManagedNetworkSettingsInner properties() { - return this.properties; - } - - /** - * Set the properties property: Managed Network settings for a cognitive services account. - * - * @param properties the properties value to set. - * @return the ManagedNetworkSettingsBasicResourceInner object itself. - */ - public ManagedNetworkSettingsBasicResourceInner withProperties(ManagedNetworkSettingsInner properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ManagedNetworkSettingsBasicResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedNetworkSettingsBasicResourceInner 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 ManagedNetworkSettingsBasicResourceInner. - */ - public static ManagedNetworkSettingsBasicResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedNetworkSettingsBasicResourceInner deserializedManagedNetworkSettingsBasicResourceInner - = new ManagedNetworkSettingsBasicResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedManagedNetworkSettingsBasicResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedManagedNetworkSettingsBasicResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedManagedNetworkSettingsBasicResourceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedManagedNetworkSettingsBasicResourceInner.properties - = ManagedNetworkSettingsInner.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedManagedNetworkSettingsBasicResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedManagedNetworkSettingsBasicResourceInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsInner.java deleted file mode 100644 index b030f2bdf17d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsInner.java +++ /dev/null @@ -1,293 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.FirewallSku; -import com.azure.resourcemanager.cognitiveservices.models.IsolationMode; -import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkKind; -import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisioningState; -import com.azure.resourcemanager.cognitiveservices.models.OutboundRule; -import java.io.IOException; -import java.util.Map; - -/** - * Managed Network settings for a cognitive services account. - */ -@Fluent -public class ManagedNetworkSettingsInner implements JsonSerializable { - /* - * Isolation mode for the managed network of a cognitive services account. - */ - private IsolationMode isolationMode; - - /* - * The networkId property. - */ - private String networkId; - - /* - * Dictionary of - */ - private Map outboundRules; - - /* - * Status of the Provisioning for the managed network of a cognitive services account. - */ - private ManagedNetworkProvisionStatusInner status; - - /* - * Firewall Sku used for FQDN Rules - */ - private FirewallSku firewallSku; - - /* - * The Kind of the managed network. Users can switch from V1 to V2 for granular access controls, but cannot switch - * back to V1 once V2 is enabled. - */ - private ManagedNetworkKind managedNetworkKind; - - /* - * Public IP address assigned to the Azure Firewall. - */ - private String firewallPublicIpAddress; - - /* - * The provisioning state of the managed network settings. - */ - private ManagedNetworkProvisioningState provisioningState; - - /** - * Creates an instance of ManagedNetworkSettingsInner class. - */ - public ManagedNetworkSettingsInner() { - } - - /** - * Get the isolationMode property: Isolation mode for the managed network of a cognitive services account. - * - * @return the isolationMode value. - */ - public IsolationMode isolationMode() { - return this.isolationMode; - } - - /** - * Set the isolationMode property: Isolation mode for the managed network of a cognitive services account. - * - * @param isolationMode the isolationMode value to set. - * @return the ManagedNetworkSettingsInner object itself. - */ - public ManagedNetworkSettingsInner withIsolationMode(IsolationMode isolationMode) { - this.isolationMode = isolationMode; - return this; - } - - /** - * Get the networkId property: The networkId property. - * - * @return the networkId value. - */ - public String networkId() { - return this.networkId; - } - - /** - * Set the networkId property: The networkId property. - * - * @param networkId the networkId value to set. - * @return the ManagedNetworkSettingsInner object itself. - */ - ManagedNetworkSettingsInner withNetworkId(String networkId) { - this.networkId = networkId; - return this; - } - - /** - * Get the outboundRules property: Dictionary of <OutboundRule>. - * - * @return the outboundRules value. - */ - public Map outboundRules() { - return this.outboundRules; - } - - /** - * Set the outboundRules property: Dictionary of <OutboundRule>. - * - * @param outboundRules the outboundRules value to set. - * @return the ManagedNetworkSettingsInner object itself. - */ - public ManagedNetworkSettingsInner withOutboundRules(Map outboundRules) { - this.outboundRules = outboundRules; - return this; - } - - /** - * Get the status property: Status of the Provisioning for the managed network of a cognitive services account. - * - * @return the status value. - */ - public ManagedNetworkProvisionStatusInner status() { - return this.status; - } - - /** - * Set the status property: Status of the Provisioning for the managed network of a cognitive services account. - * - * @param status the status value to set. - * @return the ManagedNetworkSettingsInner object itself. - */ - public ManagedNetworkSettingsInner withStatus(ManagedNetworkProvisionStatusInner status) { - this.status = status; - return this; - } - - /** - * Get the firewallSku property: Firewall Sku used for FQDN Rules. - * - * @return the firewallSku value. - */ - public FirewallSku firewallSku() { - return this.firewallSku; - } - - /** - * Set the firewallSku property: Firewall Sku used for FQDN Rules. - * - * @param firewallSku the firewallSku value to set. - * @return the ManagedNetworkSettingsInner object itself. - */ - public ManagedNetworkSettingsInner withFirewallSku(FirewallSku firewallSku) { - this.firewallSku = firewallSku; - return this; - } - - /** - * Get the managedNetworkKind property: The Kind of the managed network. Users can switch from V1 to V2 for granular - * access controls, but cannot switch back to V1 once V2 is enabled. - * - * @return the managedNetworkKind value. - */ - public ManagedNetworkKind managedNetworkKind() { - return this.managedNetworkKind; - } - - /** - * Set the managedNetworkKind property: The Kind of the managed network. Users can switch from V1 to V2 for granular - * access controls, but cannot switch back to V1 once V2 is enabled. - * - * @param managedNetworkKind the managedNetworkKind value to set. - * @return the ManagedNetworkSettingsInner object itself. - */ - public ManagedNetworkSettingsInner withManagedNetworkKind(ManagedNetworkKind managedNetworkKind) { - this.managedNetworkKind = managedNetworkKind; - return this; - } - - /** - * Get the firewallPublicIpAddress property: Public IP address assigned to the Azure Firewall. - * - * @return the firewallPublicIpAddress value. - */ - public String firewallPublicIpAddress() { - return this.firewallPublicIpAddress; - } - - /** - * Set the firewallPublicIpAddress property: Public IP address assigned to the Azure Firewall. - * - * @param firewallPublicIpAddress the firewallPublicIpAddress value to set. - * @return the ManagedNetworkSettingsInner object itself. - */ - ManagedNetworkSettingsInner withFirewallPublicIpAddress(String firewallPublicIpAddress) { - this.firewallPublicIpAddress = firewallPublicIpAddress; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the managed network settings. - * - * @return the provisioningState value. - */ - public ManagedNetworkProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the managed network settings. - * - * @param provisioningState the provisioningState value to set. - * @return the ManagedNetworkSettingsInner object itself. - */ - ManagedNetworkSettingsInner withProvisioningState(ManagedNetworkProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("isolationMode", this.isolationMode == null ? null : this.isolationMode.toString()); - jsonWriter.writeMapField("outboundRules", this.outboundRules, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("status", this.status); - jsonWriter.writeStringField("firewallSku", this.firewallSku == null ? null : this.firewallSku.toString()); - jsonWriter.writeStringField("managedNetworkKind", - this.managedNetworkKind == null ? null : this.managedNetworkKind.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ManagedNetworkSettingsInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedNetworkSettingsInner 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 ManagedNetworkSettingsInner. - */ - public static ManagedNetworkSettingsInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedNetworkSettingsInner deserializedManagedNetworkSettingsInner = new ManagedNetworkSettingsInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("isolationMode".equals(fieldName)) { - deserializedManagedNetworkSettingsInner.isolationMode - = IsolationMode.fromString(reader.getString()); - } else if ("networkId".equals(fieldName)) { - deserializedManagedNetworkSettingsInner.networkId = reader.getString(); - } else if ("outboundRules".equals(fieldName)) { - Map outboundRules = reader.readMap(reader1 -> OutboundRule.fromJson(reader1)); - deserializedManagedNetworkSettingsInner.outboundRules = outboundRules; - } else if ("status".equals(fieldName)) { - deserializedManagedNetworkSettingsInner.status - = ManagedNetworkProvisionStatusInner.fromJson(reader); - } else if ("firewallSku".equals(fieldName)) { - deserializedManagedNetworkSettingsInner.firewallSku = FirewallSku.fromString(reader.getString()); - } else if ("managedNetworkKind".equals(fieldName)) { - deserializedManagedNetworkSettingsInner.managedNetworkKind - = ManagedNetworkKind.fromString(reader.getString()); - } else if ("firewallPublicIpAddress".equals(fieldName)) { - deserializedManagedNetworkSettingsInner.firewallPublicIpAddress = reader.getString(); - } else if ("provisioningState".equals(fieldName)) { - deserializedManagedNetworkSettingsInner.provisioningState - = ManagedNetworkProvisioningState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedManagedNetworkSettingsInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsPropertiesBasicResourceInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsPropertiesBasicResourceInner.java deleted file mode 100644 index 1d309ef8a0ea..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsPropertiesBasicResourceInner.java +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.ManagedNetworkSettingsProperties; -import java.io.IOException; - -/** - * Concrete proxy resource types can be created by aliasing this type using a specific property type. - */ -@Fluent -public final class ManagedNetworkSettingsPropertiesBasicResourceInner extends ProxyResource { - /* - * The properties of the managed network settings of a cognitive services account. - */ - private ManagedNetworkSettingsProperties 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 ManagedNetworkSettingsPropertiesBasicResourceInner class. - */ - public ManagedNetworkSettingsPropertiesBasicResourceInner() { - } - - /** - * Get the properties property: The properties of the managed network settings of a cognitive services account. - * - * @return the properties value. - */ - public ManagedNetworkSettingsProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The properties of the managed network settings of a cognitive services account. - * - * @param properties the properties value to set. - * @return the ManagedNetworkSettingsPropertiesBasicResourceInner object itself. - */ - public ManagedNetworkSettingsPropertiesBasicResourceInner - withProperties(ManagedNetworkSettingsProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ManagedNetworkSettingsPropertiesBasicResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedNetworkSettingsPropertiesBasicResourceInner 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 ManagedNetworkSettingsPropertiesBasicResourceInner. - */ - public static ManagedNetworkSettingsPropertiesBasicResourceInner fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - ManagedNetworkSettingsPropertiesBasicResourceInner deserializedManagedNetworkSettingsPropertiesBasicResourceInner - = new ManagedNetworkSettingsPropertiesBasicResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedManagedNetworkSettingsPropertiesBasicResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedManagedNetworkSettingsPropertiesBasicResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedManagedNetworkSettingsPropertiesBasicResourceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedManagedNetworkSettingsPropertiesBasicResourceInner.properties - = ManagedNetworkSettingsProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedManagedNetworkSettingsPropertiesBasicResourceInner.systemData - = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedManagedNetworkSettingsPropertiesBasicResourceInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ModelCapacityListResultValueItemInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ModelCapacityListResultValueItemInner.java deleted file mode 100644 index dac42cd62078..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ModelCapacityListResultValueItemInner.java +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.models.ModelSkuCapacityProperties; -import java.io.IOException; - -/** - * The ModelCapacityListResultValueItem model. - */ -@Immutable -public final class ModelCapacityListResultValueItemInner extends ProxyResource { - /* - * The location of the Model Sku Capacity. - */ - private String location; - - /* - * Cognitive Services account ModelSkuCapacity. - */ - private ModelSkuCapacityProperties 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 ModelCapacityListResultValueItemInner class. - */ - private ModelCapacityListResultValueItemInner() { - } - - /** - * Get the location property: The location of the Model Sku Capacity. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the properties property: Cognitive Services account ModelSkuCapacity. - * - * @return the properties value. - */ - public ModelSkuCapacityProperties properties() { - return this.properties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ModelCapacityListResultValueItemInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ModelCapacityListResultValueItemInner 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 ModelCapacityListResultValueItemInner. - */ - public static ModelCapacityListResultValueItemInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ModelCapacityListResultValueItemInner deserializedModelCapacityListResultValueItemInner - = new ModelCapacityListResultValueItemInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedModelCapacityListResultValueItemInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedModelCapacityListResultValueItemInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedModelCapacityListResultValueItemInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedModelCapacityListResultValueItemInner.location = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedModelCapacityListResultValueItemInner.properties - = ModelSkuCapacityProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedModelCapacityListResultValueItemInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedModelCapacityListResultValueItemInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ModelInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ModelInner.java deleted file mode 100644 index 3aad74fea3ad..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ModelInner.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Cognitive Services Model. - */ -@Immutable -public final class ModelInner implements JsonSerializable { - /* - * Cognitive Services account Model. - */ - private AccountModelInner model; - - /* - * The kind (type) of cognitive service account. - */ - private String kind; - - /* - * The name of SKU. - */ - private String skuName; - - /* - * The description of the model. - */ - private String description; - - /** - * Creates an instance of ModelInner class. - */ - private ModelInner() { - } - - /** - * Get the model property: Cognitive Services account Model. - * - * @return the model value. - */ - public AccountModelInner model() { - return this.model; - } - - /** - * Get the kind property: The kind (type) of cognitive service account. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Get the skuName property: The name of SKU. - * - * @return the skuName value. - */ - public String skuName() { - return this.skuName; - } - - /** - * Get the description property: The description of the model. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("model", this.model); - jsonWriter.writeStringField("kind", this.kind); - jsonWriter.writeStringField("skuName", this.skuName); - jsonWriter.writeStringField("description", this.description); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ModelInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ModelInner 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 ModelInner. - */ - public static ModelInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ModelInner deserializedModelInner = new ModelInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("model".equals(fieldName)) { - deserializedModelInner.model = AccountModelInner.fromJson(reader); - } else if ("kind".equals(fieldName)) { - deserializedModelInner.kind = reader.getString(); - } else if ("skuName".equals(fieldName)) { - deserializedModelInner.skuName = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedModelInner.description = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedModelInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/NetworkSecurityPerimeterConfigurationInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/NetworkSecurityPerimeterConfigurationInner.java deleted file mode 100644 index 564005596d9a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/NetworkSecurityPerimeterConfigurationInner.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurationProperties; -import java.io.IOException; - -/** - * NSP Configuration for an Cognitive Services account. - */ -@Immutable -public final class NetworkSecurityPerimeterConfigurationInner extends ProxyResource { - /* - * NSP 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. - */ - private NetworkSecurityPerimeterConfigurationInner() { - } - - /** - * Get the properties property: NSP Configuration properties. - * - * @return the properties value. - */ - public NetworkSecurityPerimeterConfigurationProperties properties() { - return this.properties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of 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/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OperationInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OperationInner.java deleted file mode 100644 index ec5f8e471ce9..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OperationInner.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.models.ActionType; -import com.azure.resourcemanager.cognitiveservices.models.OperationDisplay; -import com.azure.resourcemanager.cognitiveservices.models.Origin; -import java.io.IOException; - -/** - * REST API Operation - * - * Details of a REST API operation, returned from the Resource Provider Operations API. - */ -@Immutable -public final class OperationInner implements JsonSerializable { - /* - * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" - */ - private String name; - - /* - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure - * Resource Manager/control-plane operations. - */ - private Boolean isDataAction; - - /* - * Localized display information for this particular operation. - */ - private OperationDisplay display; - - /* - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default - * value is "user,system" - */ - private Origin origin; - - /* - * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - */ - private ActionType actionType; - - /** - * Creates an instance of OperationInner class. - */ - private OperationInner() { - } - - /** - * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for Azure Resource Manager/control-plane operations. - * - * @return the isDataAction value. - */ - public Boolean isDataAction() { - return this.isDataAction; - } - - /** - * Get the display property: Localized display information for this particular operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and - * audit logs UX. Default value is "user,system". - * - * @return the origin value. - */ - public Origin origin() { - return this.origin; - } - - /** - * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are - * for internal only APIs. - * - * @return the actionType value. - */ - public ActionType actionType() { - return this.actionType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - 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 if ("origin".equals(fieldName)) { - deserializedOperationInner.origin = Origin.fromString(reader.getString()); - } else if ("actionType".equals(fieldName)) { - deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OutboundRuleBasicResourceInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OutboundRuleBasicResourceInner.java deleted file mode 100644 index e07183554069..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OutboundRuleBasicResourceInner.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.OutboundRule; -import java.io.IOException; - -/** - * Concrete proxy resource types can be created by aliasing this type using a specific property type. - */ -@Fluent -public final class OutboundRuleBasicResourceInner extends ProxyResource { - /* - * Outbound Rule for the managed network of a cognitive services account. - */ - private OutboundRule 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 OutboundRuleBasicResourceInner class. - */ - public OutboundRuleBasicResourceInner() { - } - - /** - * Get the properties property: Outbound Rule for the managed network of a cognitive services account. - * - * @return the properties value. - */ - public OutboundRule properties() { - return this.properties; - } - - /** - * Set the properties property: Outbound Rule for the managed network of a cognitive services account. - * - * @param properties the properties value to set. - * @return the OutboundRuleBasicResourceInner object itself. - */ - public OutboundRuleBasicResourceInner withProperties(OutboundRule properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OutboundRuleBasicResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OutboundRuleBasicResourceInner 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 OutboundRuleBasicResourceInner. - */ - public static OutboundRuleBasicResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OutboundRuleBasicResourceInner deserializedOutboundRuleBasicResourceInner - = new OutboundRuleBasicResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedOutboundRuleBasicResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedOutboundRuleBasicResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedOutboundRuleBasicResourceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedOutboundRuleBasicResourceInner.properties = OutboundRule.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedOutboundRuleBasicResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedOutboundRuleBasicResourceInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateEndpointConnectionInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateEndpointConnectionInner.java deleted file mode 100644 index 0d5e9c736088..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateEndpointConnectionInner.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.PrivateEndpointConnectionProperties; -import java.io.IOException; - -/** - * The Private Endpoint Connection resource. - */ -@Fluent -public final class PrivateEndpointConnectionInner extends ProxyResource { - /* - * Resource properties. - */ - private PrivateEndpointConnectionProperties properties; - - /* - * Resource Etag. - */ - private String etag; - - /* - * The location of the private endpoint connection - */ - private String location; - - /* - * 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 PrivateEndpointConnectionInner class. - */ - public PrivateEndpointConnectionInner() { - } - - /** - * Get the properties property: Resource properties. - * - * @return the properties value. - */ - public PrivateEndpointConnectionProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Resource properties. - * - * @param properties the properties value to set. - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner withProperties(PrivateEndpointConnectionProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the location property: The location of the private endpoint connection. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The location of the private endpoint connection. - * - * @param location the location value to set. - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeStringField("location", this.location); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateEndpointConnectionInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpointConnectionInner 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 PrivateEndpointConnectionInner. - */ - public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpointConnectionInner deserializedPrivateEndpointConnectionInner - = new PrivateEndpointConnectionInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.properties - = PrivateEndpointConnectionProperties.fromJson(reader); - } else if ("etag".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.etag = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.location = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpointConnectionInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateEndpointConnectionListResultInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateEndpointConnectionListResultInner.java deleted file mode 100644 index af06021b4115..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateEndpointConnectionListResultInner.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; -import java.util.List; - -/** - * A list of private endpoint connections. - */ -@Immutable -public final class PrivateEndpointConnectionListResultInner - implements JsonSerializable { - /* - * Array of private endpoint connections - */ - private List value; - - /** - * Creates an instance of PrivateEndpointConnectionListResultInner class. - */ - private PrivateEndpointConnectionListResultInner() { - } - - /** - * Get the value property: Array of private endpoint connections. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 PrivateEndpointConnectionListResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpointConnectionListResultInner 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 PrivateEndpointConnectionListResultInner. - */ - public static PrivateEndpointConnectionListResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpointConnectionListResultInner deserializedPrivateEndpointConnectionListResultInner - = new PrivateEndpointConnectionListResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); - deserializedPrivateEndpointConnectionListResultInner.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpointConnectionListResultInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateLinkResourceListResultInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateLinkResourceListResultInner.java deleted file mode 100644 index f65081bbbf27..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateLinkResourceListResultInner.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResource; -import java.io.IOException; -import java.util.List; - -/** - * A list of private link resources. - */ -@Immutable -public final class PrivateLinkResourceListResultInner implements JsonSerializable { - /* - * Array of private link resources - */ - private List value; - - /** - * Creates an instance of PrivateLinkResourceListResultInner class. - */ - private PrivateLinkResourceListResultInner() { - } - - /** - * Get the value property: Array of private link resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 PrivateLinkResourceListResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateLinkResourceListResultInner 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 PrivateLinkResourceListResultInner. - */ - public static PrivateLinkResourceListResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateLinkResourceListResultInner deserializedPrivateLinkResourceListResultInner - = new PrivateLinkResourceListResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> PrivateLinkResource.fromJson(reader1)); - deserializedPrivateLinkResourceListResultInner.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateLinkResourceListResultInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ProjectCapabilityHostInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ProjectCapabilityHostInner.java deleted file mode 100644 index e15587667c97..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ProjectCapabilityHostInner.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.ProjectCapabilityHostProperties; -import java.io.IOException; - -/** - * Azure Resource Manager resource envelope for Project CapabilityHost. - */ -@Fluent -public final class ProjectCapabilityHostInner extends ProxyResource { - /* - * [Required] Additional attributes of the entity. - */ - private ProjectCapabilityHostProperties 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 ProjectCapabilityHostInner class. - */ - public ProjectCapabilityHostInner() { - } - - /** - * Get the properties property: [Required] Additional attributes of the entity. - * - * @return the properties value. - */ - public ProjectCapabilityHostProperties properties() { - return this.properties; - } - - /** - * Set the properties property: [Required] Additional attributes of the entity. - * - * @param properties the properties value to set. - * @return the ProjectCapabilityHostInner object itself. - */ - public ProjectCapabilityHostInner withProperties(ProjectCapabilityHostProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ProjectCapabilityHostInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProjectCapabilityHostInner 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 ProjectCapabilityHostInner. - */ - public static ProjectCapabilityHostInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProjectCapabilityHostInner deserializedProjectCapabilityHostInner = new ProjectCapabilityHostInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedProjectCapabilityHostInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedProjectCapabilityHostInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedProjectCapabilityHostInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedProjectCapabilityHostInner.properties - = ProjectCapabilityHostProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedProjectCapabilityHostInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedProjectCapabilityHostInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ProjectInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ProjectInner.java deleted file mode 100644 index dd8f1230b06d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ProjectInner.java +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.Identity; -import com.azure.resourcemanager.cognitiveservices.models.ProjectProperties; -import java.io.IOException; -import java.util.Map; - -/** - * Cognitive Services project is an Azure resource representing the provisioned account's project, it's type, location - * and SKU. - */ -@Fluent -public final class ProjectInner extends ProxyResource { - /* - * Properties of Cognitive Services project. - */ - private ProjectProperties properties; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The geo-location where the resource lives - */ - private String location; - - /* - * Resource Etag. - */ - private String etag; - - /* - * Identity for the resource. - */ - private Identity identity; - - /* - * 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 ProjectInner class. - */ - public ProjectInner() { - } - - /** - * Get the properties property: Properties of Cognitive Services project. - * - * @return the properties value. - */ - public ProjectProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of Cognitive Services project. - * - * @param properties the properties value to set. - * @return the ProjectInner object itself. - */ - public ProjectInner withProperties(ProjectProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the ProjectInner object itself. - */ - public ProjectInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The geo-location where the resource lives. - * - * @param location the location value to set. - * @return the ProjectInner object itself. - */ - public ProjectInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the identity property: Identity for the resource. - * - * @return the identity value. - */ - public Identity identity() { - return this.identity; - } - - /** - * Set the identity property: Identity for the resource. - * - * @param identity the identity value to set. - * @return the ProjectInner object itself. - */ - public ProjectInner withIdentity(Identity identity) { - this.identity = identity; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeJsonField("identity", this.identity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ProjectInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProjectInner 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 ProjectInner. - */ - public static ProjectInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProjectInner deserializedProjectInner = new ProjectInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedProjectInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedProjectInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedProjectInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedProjectInner.properties = ProjectProperties.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedProjectInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedProjectInner.location = reader.getString(); - } else if ("etag".equals(fieldName)) { - deserializedProjectInner.etag = reader.getString(); - } else if ("identity".equals(fieldName)) { - deserializedProjectInner.identity = Identity.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedProjectInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedProjectInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/QuotaTierInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/QuotaTierInner.java deleted file mode 100644 index 10407bc5e199..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/QuotaTierInner.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.QuotaTierProperties; -import java.io.IOException; - -/** - * The quota tier information for the subscription. - */ -@Fluent -public final class QuotaTierInner extends ProxyResource { - /* - * Properties of quota tier resource. - */ - private QuotaTierProperties 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 QuotaTierInner class. - */ - public QuotaTierInner() { - } - - /** - * Get the properties property: Properties of quota tier resource. - * - * @return the properties value. - */ - public QuotaTierProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of quota tier resource. - * - * @param properties the properties value to set. - * @return the QuotaTierInner object itself. - */ - public QuotaTierInner withProperties(QuotaTierProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QuotaTierInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QuotaTierInner 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 QuotaTierInner. - */ - public static QuotaTierInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QuotaTierInner deserializedQuotaTierInner = new QuotaTierInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedQuotaTierInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedQuotaTierInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedQuotaTierInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedQuotaTierInner.properties = QuotaTierProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedQuotaTierInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedQuotaTierInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiBlocklistInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiBlocklistInner.java deleted file mode 100644 index 5bf5a5c9ffe1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiBlocklistInner.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.RaiBlocklistProperties; -import java.io.IOException; -import java.util.Map; - -/** - * Cognitive Services RaiBlocklist. - */ -@Fluent -public final class RaiBlocklistInner extends ProxyResource { - /* - * Properties of Cognitive Services RaiBlocklist. - */ - private RaiBlocklistProperties properties; - - /* - * Resource Etag. - */ - private String etag; - - /* - * Resource tags. - */ - private Map tags; - - /* - * 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 RaiBlocklistInner class. - */ - public RaiBlocklistInner() { - } - - /** - * Get the properties property: Properties of Cognitive Services RaiBlocklist. - * - * @return the properties value. - */ - public RaiBlocklistProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of Cognitive Services RaiBlocklist. - * - * @param properties the properties value to set. - * @return the RaiBlocklistInner object itself. - */ - public RaiBlocklistInner withProperties(RaiBlocklistProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the RaiBlocklistInner object itself. - */ - public RaiBlocklistInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiBlocklistInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiBlocklistInner 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 RaiBlocklistInner. - */ - public static RaiBlocklistInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiBlocklistInner deserializedRaiBlocklistInner = new RaiBlocklistInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedRaiBlocklistInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedRaiBlocklistInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedRaiBlocklistInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedRaiBlocklistInner.properties = RaiBlocklistProperties.fromJson(reader); - } else if ("etag".equals(fieldName)) { - deserializedRaiBlocklistInner.etag = reader.getString(); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedRaiBlocklistInner.tags = tags; - } else if ("systemData".equals(fieldName)) { - deserializedRaiBlocklistInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiBlocklistInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiBlocklistItemInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiBlocklistItemInner.java deleted file mode 100644 index 74191f3006cf..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiBlocklistItemInner.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.RaiBlocklistItemProperties; -import java.io.IOException; -import java.util.Map; - -/** - * Cognitive Services RaiBlocklist Item. - */ -@Fluent -public final class RaiBlocklistItemInner extends ProxyResource { - /* - * Properties of Cognitive Services RaiBlocklist Item. - */ - private RaiBlocklistItemProperties properties; - - /* - * Resource Etag. - */ - private String etag; - - /* - * Resource tags. - */ - private Map tags; - - /* - * 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 RaiBlocklistItemInner class. - */ - public RaiBlocklistItemInner() { - } - - /** - * Get the properties property: Properties of Cognitive Services RaiBlocklist Item. - * - * @return the properties value. - */ - public RaiBlocklistItemProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of Cognitive Services RaiBlocklist Item. - * - * @param properties the properties value to set. - * @return the RaiBlocklistItemInner object itself. - */ - public RaiBlocklistItemInner withProperties(RaiBlocklistItemProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the RaiBlocklistItemInner object itself. - */ - public RaiBlocklistItemInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiBlocklistItemInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiBlocklistItemInner 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 RaiBlocklistItemInner. - */ - public static RaiBlocklistItemInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiBlocklistItemInner deserializedRaiBlocklistItemInner = new RaiBlocklistItemInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedRaiBlocklistItemInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedRaiBlocklistItemInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedRaiBlocklistItemInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedRaiBlocklistItemInner.properties = RaiBlocklistItemProperties.fromJson(reader); - } else if ("etag".equals(fieldName)) { - deserializedRaiBlocklistItemInner.etag = reader.getString(); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedRaiBlocklistItemInner.tags = tags; - } else if ("systemData".equals(fieldName)) { - deserializedRaiBlocklistItemInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiBlocklistItemInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiContentFilterInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiContentFilterInner.java deleted file mode 100644 index cd081801120d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiContentFilterInner.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.models.RaiContentFilterProperties; -import java.io.IOException; - -/** - * Azure OpenAI Content Filter. - */ -@Immutable -public final class RaiContentFilterInner extends ProxyResource { - /* - * Azure OpenAI Content Filter Properties. - */ - private RaiContentFilterProperties 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 RaiContentFilterInner class. - */ - private RaiContentFilterInner() { - } - - /** - * Get the properties property: Azure OpenAI Content Filter Properties. - * - * @return the properties value. - */ - public RaiContentFilterProperties properties() { - return this.properties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiContentFilterInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiContentFilterInner 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 RaiContentFilterInner. - */ - public static RaiContentFilterInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiContentFilterInner deserializedRaiContentFilterInner = new RaiContentFilterInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedRaiContentFilterInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedRaiContentFilterInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedRaiContentFilterInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedRaiContentFilterInner.properties = RaiContentFilterProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedRaiContentFilterInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiContentFilterInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiExternalSafetyProviderSchemaInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiExternalSafetyProviderSchemaInner.java deleted file mode 100644 index b6c3755e6389..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiExternalSafetyProviderSchemaInner.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.RaiExternalSafetyProviderSchemaProperties; -import java.io.IOException; -import java.util.Map; - -/** - * Cognitive Services Rai External Safety provider Schema. - */ -@Fluent -public final class RaiExternalSafetyProviderSchemaInner extends ProxyResource { - /* - * Properties of Cognitive Services Rai External Safety provider. - */ - private RaiExternalSafetyProviderSchemaProperties properties; - - /* - * Resource Etag. - */ - private String etag; - - /* - * Resource tags. - */ - private Map tags; - - /* - * 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 RaiExternalSafetyProviderSchemaInner class. - */ - public RaiExternalSafetyProviderSchemaInner() { - } - - /** - * Get the properties property: Properties of Cognitive Services Rai External Safety provider. - * - * @return the properties value. - */ - public RaiExternalSafetyProviderSchemaProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of Cognitive Services Rai External Safety provider. - * - * @param properties the properties value to set. - * @return the RaiExternalSafetyProviderSchemaInner object itself. - */ - public RaiExternalSafetyProviderSchemaInner withProperties(RaiExternalSafetyProviderSchemaProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiExternalSafetyProviderSchemaInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiExternalSafetyProviderSchemaInner 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 RaiExternalSafetyProviderSchemaInner. - */ - public static RaiExternalSafetyProviderSchemaInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiExternalSafetyProviderSchemaInner deserializedRaiExternalSafetyProviderSchemaInner - = new RaiExternalSafetyProviderSchemaInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedRaiExternalSafetyProviderSchemaInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedRaiExternalSafetyProviderSchemaInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedRaiExternalSafetyProviderSchemaInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedRaiExternalSafetyProviderSchemaInner.properties - = RaiExternalSafetyProviderSchemaProperties.fromJson(reader); - } else if ("etag".equals(fieldName)) { - deserializedRaiExternalSafetyProviderSchemaInner.etag = reader.getString(); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedRaiExternalSafetyProviderSchemaInner.tags = tags; - } else if ("systemData".equals(fieldName)) { - deserializedRaiExternalSafetyProviderSchemaInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiExternalSafetyProviderSchemaInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiPolicyInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiPolicyInner.java deleted file mode 100644 index 644765d705a3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiPolicyInner.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.RaiPolicyProperties; -import java.io.IOException; -import java.util.Map; - -/** - * Cognitive Services RaiPolicy. - */ -@Fluent -public final class RaiPolicyInner extends ProxyResource { - /* - * Properties of Cognitive Services RaiPolicy. - */ - private RaiPolicyProperties properties; - - /* - * Resource Etag. - */ - private String etag; - - /* - * Resource tags. - */ - private Map tags; - - /* - * 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 RaiPolicyInner class. - */ - public RaiPolicyInner() { - } - - /** - * Get the properties property: Properties of Cognitive Services RaiPolicy. - * - * @return the properties value. - */ - public RaiPolicyProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of Cognitive Services RaiPolicy. - * - * @param properties the properties value to set. - * @return the RaiPolicyInner object itself. - */ - public RaiPolicyInner withProperties(RaiPolicyProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the RaiPolicyInner object itself. - */ - public RaiPolicyInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiPolicyInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiPolicyInner 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 RaiPolicyInner. - */ - public static RaiPolicyInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiPolicyInner deserializedRaiPolicyInner = new RaiPolicyInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedRaiPolicyInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedRaiPolicyInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedRaiPolicyInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedRaiPolicyInner.properties = RaiPolicyProperties.fromJson(reader); - } else if ("etag".equals(fieldName)) { - deserializedRaiPolicyInner.etag = reader.getString(); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedRaiPolicyInner.tags = tags; - } else if ("systemData".equals(fieldName)) { - deserializedRaiPolicyInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiPolicyInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiToolLabelInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiToolLabelInner.java deleted file mode 100644 index 367df659c6c3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiToolLabelInner.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.RaiToolLabelProperties; -import java.io.IOException; -import java.util.Map; - -/** - * Cognitive Services RAI Tool Label resource. - */ -@Fluent -public final class RaiToolLabelInner extends ProxyResource { - /* - * Properties of the RAI Tool Label. - */ - private RaiToolLabelProperties properties; - - /* - * Resource Etag. - */ - private String etag; - - /* - * Resource tags. - */ - private Map tags; - - /* - * 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 RaiToolLabelInner class. - */ - public RaiToolLabelInner() { - } - - /** - * Get the properties property: Properties of the RAI Tool Label. - * - * @return the properties value. - */ - public RaiToolLabelProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of the RAI Tool Label. - * - * @param properties the properties value to set. - * @return the RaiToolLabelInner object itself. - */ - public RaiToolLabelInner withProperties(RaiToolLabelProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the RaiToolLabelInner object itself. - */ - public RaiToolLabelInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiToolLabelInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiToolLabelInner 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 RaiToolLabelInner. - */ - public static RaiToolLabelInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiToolLabelInner deserializedRaiToolLabelInner = new RaiToolLabelInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedRaiToolLabelInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedRaiToolLabelInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedRaiToolLabelInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedRaiToolLabelInner.properties = RaiToolLabelProperties.fromJson(reader); - } else if ("etag".equals(fieldName)) { - deserializedRaiToolLabelInner.etag = reader.getString(); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedRaiToolLabelInner.tags = tags; - } else if ("systemData".equals(fieldName)) { - deserializedRaiToolLabelInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiToolLabelInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiTopicInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiTopicInner.java deleted file mode 100644 index bfe590a684cf..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiTopicInner.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.RaiTopicProperties; -import java.io.IOException; -import java.util.Map; - -/** - * Cognitive Services Rai Topic. - */ -@Fluent -public final class RaiTopicInner extends ProxyResource { - /* - * Properties of Cognitive Services Rai Topic. - */ - private RaiTopicProperties properties; - - /* - * Resource Etag. - */ - private String etag; - - /* - * Resource tags. - */ - private Map tags; - - /* - * 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 RaiTopicInner class. - */ - public RaiTopicInner() { - } - - /** - * Get the properties property: Properties of Cognitive Services Rai Topic. - * - * @return the properties value. - */ - public RaiTopicProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of Cognitive Services Rai Topic. - * - * @param properties the properties value to set. - * @return the RaiTopicInner object itself. - */ - public RaiTopicInner withProperties(RaiTopicProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the RaiTopicInner object itself. - */ - public RaiTopicInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiTopicInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiTopicInner 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 RaiTopicInner. - */ - public static RaiTopicInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiTopicInner deserializedRaiTopicInner = new RaiTopicInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedRaiTopicInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedRaiTopicInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedRaiTopicInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedRaiTopicInner.properties = RaiTopicProperties.fromJson(reader); - } else if ("etag".equals(fieldName)) { - deserializedRaiTopicInner.etag = reader.getString(); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedRaiTopicInner.tags = tags; - } else if ("systemData".equals(fieldName)) { - deserializedRaiTopicInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiTopicInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ResourceSkuInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ResourceSkuInner.java deleted file mode 100644 index 21b70f53c87e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ResourceSkuInner.java +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.models.ResourceSkuRestrictions; -import java.io.IOException; -import java.util.List; - -/** - * Describes an available Cognitive Services SKU. - */ -@Immutable -public final class ResourceSkuInner implements JsonSerializable { - /* - * The type of resource the SKU applies to. - */ - private String resourceType; - - /* - * The name of SKU. - */ - private String name; - - /* - * Specifies the tier of Cognitive Services account. - */ - private String tier; - - /* - * The Kind of resources that are supported in this SKU. - */ - private String kind; - - /* - * The set of locations that the SKU is available. - */ - private List locations; - - /* - * The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. - */ - private List restrictions; - - /** - * Creates an instance of ResourceSkuInner class. - */ - private ResourceSkuInner() { - } - - /** - * Get the resourceType property: The type of resource the SKU applies to. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Get the name property: The name of SKU. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the tier property: Specifies the tier of Cognitive Services account. - * - * @return the tier value. - */ - public String tier() { - return this.tier; - } - - /** - * Get the kind property: The Kind of resources that are supported in this SKU. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Get the locations property: The set of locations that the SKU is available. - * - * @return the locations value. - */ - public List locations() { - return this.locations; - } - - /** - * Get the restrictions property: The restrictions because of which SKU cannot be used. This is empty if there are - * no restrictions. - * - * @return the restrictions value. - */ - public List restrictions() { - return this.restrictions; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("resourceType", this.resourceType); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("tier", this.tier); - jsonWriter.writeStringField("kind", this.kind); - jsonWriter.writeArrayField("locations", this.locations, (writer, element) -> writer.writeString(element)); - jsonWriter.writeArrayField("restrictions", this.restrictions, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceSkuInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceSkuInner 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 ResourceSkuInner. - */ - public static ResourceSkuInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceSkuInner deserializedResourceSkuInner = new ResourceSkuInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceType".equals(fieldName)) { - deserializedResourceSkuInner.resourceType = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedResourceSkuInner.name = reader.getString(); - } else if ("tier".equals(fieldName)) { - deserializedResourceSkuInner.tier = reader.getString(); - } else if ("kind".equals(fieldName)) { - deserializedResourceSkuInner.kind = reader.getString(); - } else if ("locations".equals(fieldName)) { - List locations = reader.readArray(reader1 -> reader1.getString()); - deserializedResourceSkuInner.locations = locations; - } else if ("restrictions".equals(fieldName)) { - List restrictions - = reader.readArray(reader1 -> ResourceSkuRestrictions.fromJson(reader1)); - deserializedResourceSkuInner.restrictions = restrictions; - } else { - reader.skipChildren(); - } - } - - return deserializedResourceSkuInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/SkuAvailabilityListResultInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/SkuAvailabilityListResultInner.java deleted file mode 100644 index ae1d741c13c5..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/SkuAvailabilityListResultInner.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.models.SkuAvailability; -import java.io.IOException; -import java.util.List; - -/** - * Check SKU availability result list. - */ -@Immutable -public final class SkuAvailabilityListResultInner implements JsonSerializable { - /* - * Check SKU availability result list. - */ - private List value; - - /** - * Creates an instance of SkuAvailabilityListResultInner class. - */ - private SkuAvailabilityListResultInner() { - } - - /** - * Get the value property: Check SKU availability result list. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 SkuAvailabilityListResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SkuAvailabilityListResultInner 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 SkuAvailabilityListResultInner. - */ - public static SkuAvailabilityListResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SkuAvailabilityListResultInner deserializedSkuAvailabilityListResultInner - = new SkuAvailabilityListResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> SkuAvailability.fromJson(reader1)); - deserializedSkuAvailabilityListResultInner.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedSkuAvailabilityListResultInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/SkuResourceInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/SkuResourceInner.java deleted file mode 100644 index 4af8ab6da149..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/SkuResourceInner.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.models.CapacityConfig; -import com.azure.resourcemanager.cognitiveservices.models.Sku; -import java.io.IOException; - -/** - * Properties of Cognitive Services account resource sku resource properties. - */ -@Immutable -public final class SkuResourceInner implements JsonSerializable { - /* - * The resource type name. - */ - private String resourceType; - - /* - * The resource model definition representing SKU - */ - private Sku sku; - - /* - * The capacity configuration. - */ - private CapacityConfig capacity; - - /** - * Creates an instance of SkuResourceInner class. - */ - private SkuResourceInner() { - } - - /** - * Get the resourceType property: The resource type name. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Get the sku property: The resource model definition representing SKU. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Get the capacity property: The capacity configuration. - * - * @return the capacity value. - */ - public CapacityConfig capacity() { - return this.capacity; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("resourceType", this.resourceType); - jsonWriter.writeJsonField("sku", this.sku); - jsonWriter.writeJsonField("capacity", this.capacity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SkuResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SkuResourceInner 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 SkuResourceInner. - */ - public static SkuResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SkuResourceInner deserializedSkuResourceInner = new SkuResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceType".equals(fieldName)) { - deserializedSkuResourceInner.resourceType = reader.getString(); - } else if ("sku".equals(fieldName)) { - deserializedSkuResourceInner.sku = Sku.fromJson(reader); - } else if ("capacity".equals(fieldName)) { - deserializedSkuResourceInner.capacity = CapacityConfig.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSkuResourceInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageInner.java deleted file mode 100644 index ac3133cde24b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageInner.java +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.models.MetricName; -import com.azure.resourcemanager.cognitiveservices.models.QuotaScopeType; -import com.azure.resourcemanager.cognitiveservices.models.QuotaUsageStatus; -import com.azure.resourcemanager.cognitiveservices.models.UnitType; -import java.io.IOException; - -/** - * The usage data for a usage request. - */ -@Immutable -public final class UsageInner implements JsonSerializable { - /* - * The unit of the metric. - */ - private UnitType unit; - - /* - * The name information for the metric. - */ - private MetricName name; - - /* - * The quota period used to summarize the usage values. - */ - private String quotaPeriod; - - /* - * Maximum value for this metric. - */ - private Double limit; - - /* - * Current value for this metric. - */ - private Double currentValue; - - /* - * Next reset time for current quota. - */ - private String nextResetTime; - - /* - * Cognitive Services account quota usage status. - */ - private QuotaUsageStatus status; - - /* - * The scope type of the quota usage. - */ - private QuotaScopeType scopeType; - - /* - * The scope identifier of the quota usage. - */ - private String scopeId; - - /** - * Creates an instance of UsageInner class. - */ - private UsageInner() { - } - - /** - * Get the unit property: The unit of the metric. - * - * @return the unit value. - */ - public UnitType unit() { - return this.unit; - } - - /** - * Get the name property: The name information for the metric. - * - * @return the name value. - */ - public MetricName name() { - return this.name; - } - - /** - * Get the quotaPeriod property: The quota period used to summarize the usage values. - * - * @return the quotaPeriod value. - */ - public String quotaPeriod() { - return this.quotaPeriod; - } - - /** - * Get the limit property: Maximum value for this metric. - * - * @return the limit value. - */ - public Double limit() { - return this.limit; - } - - /** - * Get the currentValue property: Current value for this metric. - * - * @return the currentValue value. - */ - public Double currentValue() { - return this.currentValue; - } - - /** - * Get the nextResetTime property: Next reset time for current quota. - * - * @return the nextResetTime value. - */ - public String nextResetTime() { - return this.nextResetTime; - } - - /** - * Get the status property: Cognitive Services account quota usage status. - * - * @return the status value. - */ - public QuotaUsageStatus status() { - return this.status; - } - - /** - * Get the scopeType property: The scope type of the quota usage. - * - * @return the scopeType value. - */ - public QuotaScopeType scopeType() { - return this.scopeType; - } - - /** - * Get the scopeId property: The scope identifier of the quota usage. - * - * @return the scopeId value. - */ - public String scopeId() { - return this.scopeId; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("unit", this.unit == null ? null : this.unit.toString()); - jsonWriter.writeJsonField("name", this.name); - jsonWriter.writeStringField("quotaPeriod", this.quotaPeriod); - jsonWriter.writeNumberField("limit", this.limit); - jsonWriter.writeNumberField("currentValue", this.currentValue); - jsonWriter.writeStringField("nextResetTime", this.nextResetTime); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeStringField("scopeType", this.scopeType == null ? null : this.scopeType.toString()); - jsonWriter.writeStringField("scopeId", this.scopeId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of UsageInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of UsageInner 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 UsageInner. - */ - public static UsageInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - UsageInner deserializedUsageInner = new UsageInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("unit".equals(fieldName)) { - deserializedUsageInner.unit = UnitType.fromString(reader.getString()); - } else if ("name".equals(fieldName)) { - deserializedUsageInner.name = MetricName.fromJson(reader); - } else if ("quotaPeriod".equals(fieldName)) { - deserializedUsageInner.quotaPeriod = reader.getString(); - } else if ("limit".equals(fieldName)) { - deserializedUsageInner.limit = reader.getNullable(JsonReader::getDouble); - } else if ("currentValue".equals(fieldName)) { - deserializedUsageInner.currentValue = reader.getNullable(JsonReader::getDouble); - } else if ("nextResetTime".equals(fieldName)) { - deserializedUsageInner.nextResetTime = reader.getString(); - } else if ("status".equals(fieldName)) { - deserializedUsageInner.status = QuotaUsageStatus.fromString(reader.getString()); - } else if ("scopeType".equals(fieldName)) { - deserializedUsageInner.scopeType = QuotaScopeType.fromString(reader.getString()); - } else if ("scopeId".equals(fieldName)) { - deserializedUsageInner.scopeId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedUsageInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageListResultInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageListResultInner.java deleted file mode 100644 index fe922360633c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageListResultInner.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; -import java.util.List; - -/** - * The response to a list usage request. - */ -@Immutable -public final class UsageListResultInner implements JsonSerializable { - /* - * The link used to get the next page of Usages. - */ - private String nextLink; - - /* - * The list of usages for Cognitive Service account. - */ - private List value; - - /** - * Creates an instance of UsageListResultInner class. - */ - private UsageListResultInner() { - } - - /** - * Get the nextLink property: The link used to get the next page of Usages. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: The list of usages for Cognitive Service account. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 UsageListResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of UsageListResultInner 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 UsageListResultInner. - */ - public static UsageListResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - UsageListResultInner deserializedUsageListResultInner = new UsageListResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedUsageListResultInner.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> UsageInner.fromJson(reader1)); - deserializedUsageListResultInner.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedUsageListResultInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/WorkbenchInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/WorkbenchInner.java deleted file mode 100644 index 861a72603d33..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/WorkbenchInner.java +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.models.Identity; -import com.azure.resourcemanager.cognitiveservices.models.WorkbenchProperties; -import java.io.IOException; -import java.util.Map; - -/** - * Workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development. - */ -@Fluent -public final class WorkbenchInner extends ProxyResource { - /* - * Properties of the workbench resource. - */ - private WorkbenchProperties properties; - - /* - * Resource Etag. - */ - private String etag; - - /* - * The location of the workbench resource. - */ - private String location; - - /* - * Resource tags. - */ - private Map tags; - - /* - * Identity for the resource. - */ - private Identity identity; - - /* - * 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 WorkbenchInner class. - */ - public WorkbenchInner() { - } - - /** - * Get the properties property: Properties of the workbench resource. - * - * @return the properties value. - */ - public WorkbenchProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of the workbench resource. - * - * @param properties the properties value to set. - * @return the WorkbenchInner object itself. - */ - public WorkbenchInner withProperties(WorkbenchProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the location property: The location of the workbench resource. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The location of the workbench resource. - * - * @param location the location value to set. - * @return the WorkbenchInner object itself. - */ - public WorkbenchInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the WorkbenchInner object itself. - */ - public WorkbenchInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the identity property: Identity for the resource. - * - * @return the identity value. - */ - public Identity identity() { - return this.identity; - } - - /** - * Set the identity property: Identity for the resource. - * - * @param identity the identity value to set. - * @return the WorkbenchInner object itself. - */ - public WorkbenchInner withIdentity(Identity identity) { - this.identity = identity; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("identity", this.identity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WorkbenchInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WorkbenchInner 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 WorkbenchInner. - */ - public static WorkbenchInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WorkbenchInner deserializedWorkbenchInner = new WorkbenchInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedWorkbenchInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedWorkbenchInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedWorkbenchInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedWorkbenchInner.properties = WorkbenchProperties.fromJson(reader); - } else if ("etag".equals(fieldName)) { - deserializedWorkbenchInner.etag = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedWorkbenchInner.location = reader.getString(); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedWorkbenchInner.tags = tags; - } else if ("identity".equals(fieldName)) { - deserializedWorkbenchInner.identity = Identity.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedWorkbenchInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedWorkbenchInner; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/package-info.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/package-info.java deleted file mode 100644 index 73c9f706a1ba..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -/** - * Package containing the inner data models for CognitiveServices. - * Cognitive Services Management Client. - */ -package com.azure.resourcemanager.cognitiveservices.fluent.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/package-info.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/package-info.java deleted file mode 100644 index 2262c602d6ed..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -/** - * Package containing the service clients for CognitiveServices. - * Cognitive Services Management Client. - */ -package com.azure.resourcemanager.cognitiveservices.fluent; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsClientImpl.java deleted file mode 100644 index 2ace56548063..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsClientImpl.java +++ /dev/null @@ -1,770 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.AccountCapabilityHostsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.CapabilityHostResourceArmPaginatedResult; -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 AccountCapabilityHostsClient. - */ -public final class AccountCapabilityHostsClientImpl implements AccountCapabilityHostsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AccountCapabilityHostsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of AccountCapabilityHostsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AccountCapabilityHostsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(AccountCapabilityHostsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientAccountCapabilityHosts to be used by - * the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientAccountCapabilityHosts") - public interface AccountCapabilityHostsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("capabilityHostName") String capabilityHostName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("capabilityHostName") String capabilityHostName, @HeaderParam("Accept") String accept, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("capabilityHostName") String capabilityHostName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") CapabilityHostInner capabilityHost, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("capabilityHostName") String capabilityHostName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") CapabilityHostInner capabilityHost, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("capabilityHostName") String capabilityHostName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("capabilityHostName") String capabilityHostName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 account capabilityHost along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String accountName, - String capabilityHostName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, capabilityHostName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 account capabilityHost on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, - String capabilityHostName) { - return getWithResponseAsync(resourceGroupName, accountName, capabilityHostName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 account capabilityHost along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, - String capabilityHostName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, capabilityHostName, accept, context); - } - - /** - * Get account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 account capabilityHost. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CapabilityHostInner get(String resourceGroupName, String accountName, String capabilityHostName) { - return getWithResponse(resourceGroupName, accountName, capabilityHostName, Context.NONE).getValue(); - } - - /** - * Create or update account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String accountName, String capabilityHostName, CapabilityHostInner capabilityHost) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, capabilityHostName, contentType, - accept, capabilityHost, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String capabilityHostName, CapabilityHostInner capabilityHost) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, capabilityHostName, contentType, accept, - capabilityHost, Context.NONE); - } - - /** - * Create or update account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String capabilityHostName, CapabilityHostInner capabilityHost, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, capabilityHostName, contentType, accept, - capabilityHost, context); - } - - /** - * Create or update account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure Resource Manager resource envelope. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CapabilityHostInner> beginCreateOrUpdateAsync( - String resourceGroupName, String accountName, String capabilityHostName, CapabilityHostInner capabilityHost) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, accountName, capabilityHostName, capabilityHost); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - CapabilityHostInner.class, CapabilityHostInner.class, this.client.getContext()); - } - - /** - * Create or update account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure Resource Manager resource envelope. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CapabilityHostInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String capabilityHostName, CapabilityHostInner capabilityHost) { - Response response - = createOrUpdateWithResponse(resourceGroupName, accountName, capabilityHostName, capabilityHost); - return this.client.getLroResult(response, CapabilityHostInner.class, - CapabilityHostInner.class, Context.NONE); - } - - /** - * Create or update account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure Resource Manager resource envelope. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CapabilityHostInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String capabilityHostName, CapabilityHostInner capabilityHost, - Context context) { - Response response - = createOrUpdateWithResponse(resourceGroupName, accountName, capabilityHostName, capabilityHost, context); - return this.client.getLroResult(response, CapabilityHostInner.class, - CapabilityHostInner.class, context); - } - - /** - * Create or update account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, - String capabilityHostName, CapabilityHostInner capabilityHost) { - return beginCreateOrUpdateAsync(resourceGroupName, accountName, capabilityHostName, capabilityHost).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String capabilityHostName, - CapabilityHostInner capabilityHost) { - return beginCreateOrUpdate(resourceGroupName, accountName, capabilityHostName, capabilityHost).getFinalResult(); - } - - /** - * Create or update account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String capabilityHostName, - CapabilityHostInner capabilityHost, Context context) { - return beginCreateOrUpdate(resourceGroupName, accountName, capabilityHostName, capabilityHost, context) - .getFinalResult(); - } - - /** - * Delete account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, - String capabilityHostName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, capabilityHostName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String accountName, - String capabilityHostName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, capabilityHostName, Context.NONE); - } - - /** - * Delete account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String accountName, - String capabilityHostName, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, capabilityHostName, context); - } - - /** - * Delete account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, - String capabilityHostName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, accountName, capabilityHostName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Delete account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String capabilityHostName) { - Response response = deleteWithResponse(resourceGroupName, accountName, capabilityHostName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Delete account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String capabilityHostName, Context context) { - Response response = deleteWithResponse(resourceGroupName, accountName, capabilityHostName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Delete account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String accountName, String capabilityHostName) { - return beginDeleteAsync(resourceGroupName, accountName, capabilityHostName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String capabilityHostName) { - beginDelete(resourceGroupName, accountName, capabilityHostName).getFinalResult(); - } - - /** - * Delete account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String capabilityHostName, Context context) { - beginDelete(resourceGroupName, accountName, capabilityHostName, context).getFinalResult(); - } - - /** - * List capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Capability Host entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, 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 capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Capability Host entities as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Capability Host entities along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 a paginated list of Capability Host entities along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Capability Host entities as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * List capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 a paginated list of Capability Host entities as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * List capabilityHost. - * - * 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 paginated list of Capability Host entities along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List capabilityHost. - * - * 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 paginated list of Capability Host entities along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List capabilityHost. - * - * 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 paginated list of Capability Host entities along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsImpl.java deleted file mode 100644 index bef777151b77..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsImpl.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.AccountCapabilityHostsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; -import com.azure.resourcemanager.cognitiveservices.models.AccountCapabilityHosts; -import com.azure.resourcemanager.cognitiveservices.models.CapabilityHost; - -public final class AccountCapabilityHostsImpl implements AccountCapabilityHosts { - private static final ClientLogger LOGGER = new ClientLogger(AccountCapabilityHostsImpl.class); - - private final AccountCapabilityHostsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public AccountCapabilityHostsImpl(AccountCapabilityHostsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, - String capabilityHostName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, accountName, capabilityHostName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CapabilityHostImpl(inner.getValue(), this.manager())); - } - - public CapabilityHost get(String resourceGroupName, String accountName, String capabilityHostName) { - CapabilityHostInner inner = this.serviceClient().get(resourceGroupName, accountName, capabilityHostName); - if (inner != null) { - return new CapabilityHostImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String accountName, String capabilityHostName) { - this.serviceClient().delete(resourceGroupName, accountName, capabilityHostName); - } - - public void delete(String resourceGroupName, String accountName, String capabilityHostName, Context context) { - this.serviceClient().delete(resourceGroupName, accountName, capabilityHostName, context); - } - - public PagedIterable list(String resourceGroupName, String accountName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CapabilityHostImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CapabilityHostImpl(inner1, this.manager())); - } - - public CapabilityHost 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String capabilityHostName = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); - if (capabilityHostName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'capabilityHosts'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, capabilityHostName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String capabilityHostName = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); - if (capabilityHostName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'capabilityHosts'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, capabilityHostName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String capabilityHostName = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); - if (capabilityHostName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'capabilityHosts'.", id))); - } - this.delete(resourceGroupName, accountName, capabilityHostName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String capabilityHostName = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); - if (capabilityHostName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'capabilityHosts'.", id))); - } - this.delete(resourceGroupName, accountName, capabilityHostName, context); - } - - private AccountCapabilityHostsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public CapabilityHostImpl define(String name) { - return new CapabilityHostImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsClientImpl.java deleted file mode 100644 index a2c8f310fa6a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsClientImpl.java +++ /dev/null @@ -1,719 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.Patch; -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.resourcemanager.cognitiveservices.fluent.AccountConnectionsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.ConnectionPropertiesV2BasicResourceArmPaginatedResult; -import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AccountConnectionsClient. - */ -public final class AccountConnectionsClientImpl implements AccountConnectionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AccountConnectionsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of AccountConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AccountConnectionsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(AccountConnectionsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientAccountConnections to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientAccountConnections") - public interface AccountConnectionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ConnectionPropertiesV2BasicResourceInner connection, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ConnectionPropertiesV2BasicResourceInner connection, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ConnectionUpdateContent connection, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ConnectionUpdateContent connection, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("connectionName") String connectionName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("connectionName") String connectionName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("target") String target, @QueryParam("category") String category, - @QueryParam("includeAll") Boolean includeAll, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("target") String target, @QueryParam("category") String category, - @QueryParam("includeAll") Boolean includeAll, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists Cognitive Services account connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String accountName, String connectionName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, connectionName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists Cognitive Services account connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, - String connectionName) { - return getWithResponseAsync(resourceGroupName, accountName, connectionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Lists Cognitive Services account connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, - String accountName, String connectionName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, connectionName, accept, context); - } - - /** - * Lists Cognitive Services account connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionPropertiesV2BasicResourceInner get(String resourceGroupName, String accountName, - String connectionName) { - return getWithResponse(resourceGroupName, accountName, connectionName, Context.NONE).getValue(); - } - - /** - * Create or update Cognitive Services account connection under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @param connection The object for creating or updating a new account connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceGroupName, - String accountName, String connectionName, ConnectionPropertiesV2BasicResourceInner connection) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, connectionName, accept, connection, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update Cognitive Services account connection under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String accountName, - String connectionName) { - final ConnectionPropertiesV2BasicResourceInner connection = null; - return createWithResponseAsync(resourceGroupName, accountName, connectionName, connection) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create or update Cognitive Services account connection under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @param connection The object for creating or updating a new account connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String resourceGroupName, - String accountName, String connectionName, ConnectionPropertiesV2BasicResourceInner connection, - Context context) { - final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, connectionName, accept, connection, - context); - } - - /** - * Create or update Cognitive Services account connection under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionPropertiesV2BasicResourceInner create(String resourceGroupName, String accountName, - String connectionName) { - final ConnectionPropertiesV2BasicResourceInner connection = null; - return createWithResponse(resourceGroupName, accountName, connectionName, connection, Context.NONE).getValue(); - } - - /** - * Update Cognitive Services account connection under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @param connection Parameters for account connection update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String accountName, String connectionName, ConnectionUpdateContent connection) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, connectionName, accept, connection, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update Cognitive Services account connection under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String accountName, - String connectionName) { - final ConnectionUpdateContent connection = null; - return updateWithResponseAsync(resourceGroupName, accountName, connectionName, connection) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Update Cognitive Services account connection under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @param connection Parameters for account connection update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, - String accountName, String connectionName, ConnectionUpdateContent connection, Context context) { - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, connectionName, accept, connection, - context); - } - - /** - * Update Cognitive Services account connection under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionPropertiesV2BasicResourceInner update(String resourceGroupName, String accountName, - String connectionName) { - final ConnectionUpdateContent connection = null; - return updateWithResponse(resourceGroupName, accountName, connectionName, connection, Context.NONE).getValue(); - } - - /** - * Delete Cognitive Services account connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String connectionName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, connectionName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete Cognitive Services account connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String connectionName) { - return deleteWithResponseAsync(resourceGroupName, accountName, connectionName).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete Cognitive Services account connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String accountName, String connectionName, - Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, connectionName, context); - } - - /** - * Delete Cognitive Services account connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String connectionName) { - deleteWithResponse(resourceGroupName, accountName, connectionName, Context.NONE); - } - - /** - * Lists all the available Cognitive Services account connections under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param target Target of the connection. - * @param category Category of the connection. - * @param includeAll query parameter that indicates if get connection call should return both connections and - * datastores. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String accountName, String target, String category, Boolean includeAll) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, target, category, includeAll, 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 the available Cognitive Services account connections under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param target Target of the connection. - * @param category Category of the connection. - * @param includeAll query parameter that indicates if get connection call should return both connections and - * datastores. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName, - String target, String category, Boolean includeAll) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, target, category, includeAll), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the available Cognitive Services account connections under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, - String accountName) { - final String target = null; - final String category = null; - final Boolean includeAll = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, target, category, includeAll), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the available Cognitive Services account connections under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param target Target of the connection. - * @param category Category of the connection. - * @param includeAll query parameter that indicates if get connection call should return both connections and - * datastores. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, - String accountName, String target, String category, Boolean includeAll) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, target, category, includeAll, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists all the available Cognitive Services account connections under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param target Target of the connection. - * @param category Category of the connection. - * @param includeAll query parameter that indicates if get connection call should return both connections and - * datastores. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, - String accountName, String target, String category, Boolean includeAll, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, target, category, includeAll, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists all the available Cognitive Services account connections under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - final String target = null; - final String category = null; - final Boolean includeAll = null; - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, target, category, includeAll), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Lists all the available Cognitive Services account connections under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param target Target of the connection. - * @param category Category of the connection. - * @param includeAll query parameter that indicates if get connection call should return both connections and - * datastores. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, - String target, String category, Boolean includeAll, Context context) { - return new PagedIterable<>( - () -> listSinglePage(resourceGroupName, accountName, target, category, includeAll, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Lists all the available Cognitive Services account connections under the specified account. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the available Cognitive Services account connections under the specified account. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists all the available Cognitive Services account connections under the specified account. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, - Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsImpl.java deleted file mode 100644 index 1a0fdff296a1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsImpl.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.AccountConnectionsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; -import com.azure.resourcemanager.cognitiveservices.models.AccountConnections; -import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2BasicResource; -import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; - -public final class AccountConnectionsImpl implements AccountConnections { - private static final ClientLogger LOGGER = new ClientLogger(AccountConnectionsImpl.class); - - private final AccountConnectionsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public AccountConnectionsImpl(AccountConnectionsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, - String connectionName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, accountName, connectionName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ConnectionPropertiesV2BasicResourceImpl(inner.getValue(), this.manager())); - } - - public ConnectionPropertiesV2BasicResource get(String resourceGroupName, String accountName, - String connectionName) { - ConnectionPropertiesV2BasicResourceInner inner - = this.serviceClient().get(resourceGroupName, accountName, connectionName); - if (inner != null) { - return new ConnectionPropertiesV2BasicResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createWithResponse(String resourceGroupName, - String accountName, String connectionName, ConnectionPropertiesV2BasicResourceInner connection, - Context context) { - Response inner = this.serviceClient() - .createWithResponse(resourceGroupName, accountName, connectionName, connection, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ConnectionPropertiesV2BasicResourceImpl(inner.getValue(), this.manager())); - } - - public ConnectionPropertiesV2BasicResource create(String resourceGroupName, String accountName, - String connectionName) { - ConnectionPropertiesV2BasicResourceInner inner - = this.serviceClient().create(resourceGroupName, accountName, connectionName); - if (inner != null) { - return new ConnectionPropertiesV2BasicResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response updateWithResponse(String resourceGroupName, - String accountName, String connectionName, ConnectionUpdateContent connection, Context context) { - Response inner = this.serviceClient() - .updateWithResponse(resourceGroupName, accountName, connectionName, connection, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ConnectionPropertiesV2BasicResourceImpl(inner.getValue(), this.manager())); - } - - public ConnectionPropertiesV2BasicResource update(String resourceGroupName, String accountName, - String connectionName) { - ConnectionPropertiesV2BasicResourceInner inner - = this.serviceClient().update(resourceGroupName, accountName, connectionName); - if (inner != null) { - return new ConnectionPropertiesV2BasicResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String resourceGroupName, String accountName, String connectionName, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, connectionName, context); - } - - public void delete(String resourceGroupName, String accountName, String connectionName) { - this.serviceClient().delete(resourceGroupName, accountName, connectionName); - } - - public PagedIterable list(String resourceGroupName, String accountName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ConnectionPropertiesV2BasicResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, - String target, String category, Boolean includeAll, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName, target, category, includeAll, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ConnectionPropertiesV2BasicResourceImpl(inner1, this.manager())); - } - - private AccountConnectionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountImpl.java deleted file mode 100644 index de2703cce5b3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountImpl.java +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountInner; -import com.azure.resourcemanager.cognitiveservices.models.Account; -import com.azure.resourcemanager.cognitiveservices.models.AccountProperties; -import com.azure.resourcemanager.cognitiveservices.models.ApiKeys; -import com.azure.resourcemanager.cognitiveservices.models.EvaluateDeploymentPoliciesRequest; -import com.azure.resourcemanager.cognitiveservices.models.EvaluateDeploymentPoliciesResponse; -import com.azure.resourcemanager.cognitiveservices.models.Identity; -import com.azure.resourcemanager.cognitiveservices.models.RegenerateKeyParameters; -import com.azure.resourcemanager.cognitiveservices.models.Sku; -import java.util.Collections; -import java.util.Map; - -public final class AccountImpl implements Account, Account.Definition, Account.Update { - private AccountInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public AccountProperties properties() { - return this.innerModel().properties(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String location() { - return this.innerModel().location(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public String kind() { - return this.innerModel().kind(); - } - - public Sku sku() { - return this.innerModel().sku(); - } - - public Identity identity() { - return this.innerModel().identity(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public AccountInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - public AccountImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public Account create() { - this.innerObject = serviceManager.serviceClient() - .getAccounts() - .create(resourceGroupName, accountName, this.innerModel(), Context.NONE); - return this; - } - - public Account create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAccounts() - .create(resourceGroupName, accountName, this.innerModel(), context); - return this; - } - - AccountImpl(String name, com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new AccountInner(); - this.serviceManager = serviceManager; - this.accountName = name; - } - - public AccountImpl update() { - return this; - } - - public Account apply() { - this.innerObject = serviceManager.serviceClient() - .getAccounts() - .update(resourceGroupName, accountName, this.innerModel(), Context.NONE); - return this; - } - - public Account apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAccounts() - .update(resourceGroupName, accountName, this.innerModel(), context); - return this; - } - - AccountImpl(AccountInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - } - - public Account refresh() { - this.innerObject = serviceManager.serviceClient() - .getAccounts() - .getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE) - .getValue(); - return this; - } - - public Account refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAccounts() - .getByResourceGroupWithResponse(resourceGroupName, accountName, context) - .getValue(); - return this; - } - - public Response listKeysWithResponse(Context context) { - return serviceManager.accounts().listKeysWithResponse(resourceGroupName, accountName, context); - } - - public ApiKeys listKeys() { - return serviceManager.accounts().listKeys(resourceGroupName, accountName); - } - - public Response regenerateKeyWithResponse(RegenerateKeyParameters parameters, Context context) { - return serviceManager.accounts().regenerateKeyWithResponse(resourceGroupName, accountName, parameters, context); - } - - public ApiKeys regenerateKey(RegenerateKeyParameters parameters) { - return serviceManager.accounts().regenerateKey(resourceGroupName, accountName, parameters); - } - - public Response - evaluateDeploymentPoliciesWithResponse(EvaluateDeploymentPoliciesRequest body, Context context) { - return serviceManager.accounts() - .evaluateDeploymentPoliciesWithResponse(resourceGroupName, accountName, body, context); - } - - public EvaluateDeploymentPoliciesResponse evaluateDeploymentPolicies(EvaluateDeploymentPoliciesRequest body) { - return serviceManager.accounts().evaluateDeploymentPolicies(resourceGroupName, accountName, body); - } - - public AccountImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public AccountImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public AccountImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public AccountImpl withProperties(AccountProperties properties) { - this.innerModel().withProperties(properties); - return this; - } - - public AccountImpl withKind(String kind) { - this.innerModel().withKind(kind); - return this; - } - - public AccountImpl withSku(Sku sku) { - this.innerModel().withSku(sku); - return this; - } - - public AccountImpl withIdentity(Identity identity) { - this.innerModel().withIdentity(identity); - return this; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountModelImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountModelImpl.java deleted file mode 100644 index 67070fc41db6..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountModelImpl.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountModelInner; -import com.azure.resourcemanager.cognitiveservices.models.AccountModel; -import com.azure.resourcemanager.cognitiveservices.models.CallRateLimit; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentModel; -import com.azure.resourcemanager.cognitiveservices.models.ModelDeprecationInfo; -import com.azure.resourcemanager.cognitiveservices.models.ModelLifecycleStatus; -import com.azure.resourcemanager.cognitiveservices.models.ModelSku; -import com.azure.resourcemanager.cognitiveservices.models.ReplacementConfig; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class AccountModelImpl implements AccountModel { - private AccountModelInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - AccountModelImpl(AccountModelInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String publisher() { - return this.innerModel().publisher(); - } - - public String format() { - return this.innerModel().format(); - } - - public String name() { - return this.innerModel().name(); - } - - public String version() { - return this.innerModel().version(); - } - - public String source() { - return this.innerModel().source(); - } - - public String sourceAccount() { - return this.innerModel().sourceAccount(); - } - - public CallRateLimit callRateLimit() { - return this.innerModel().callRateLimit(); - } - - public DeploymentModel baseModel() { - return this.innerModel().baseModel(); - } - - public Boolean isDefaultVersion() { - return this.innerModel().isDefaultVersion(); - } - - public List skus() { - List inner = this.innerModel().skus(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Integer maxCapacity() { - return this.innerModel().maxCapacity(); - } - - public Map capabilities() { - Map inner = this.innerModel().capabilities(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public Map finetuneCapabilities() { - Map inner = this.innerModel().finetuneCapabilities(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public ModelDeprecationInfo deprecation() { - return this.innerModel().deprecation(); - } - - public ReplacementConfig replacementConfig() { - return this.innerModel().replacementConfig(); - } - - public String modelCatalogAssetId() { - return this.innerModel().modelCatalogAssetId(); - } - - public ModelLifecycleStatus lifecycleStatus() { - return this.innerModel().lifecycleStatus(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public AccountModelInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountSkuListResultImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountSkuListResultImpl.java deleted file mode 100644 index cd9cb4a5738c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountSkuListResultImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountSkuListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.AccountSku; -import com.azure.resourcemanager.cognitiveservices.models.AccountSkuListResult; -import java.util.Collections; -import java.util.List; - -public final class AccountSkuListResultImpl implements AccountSkuListResult { - private AccountSkuListResultInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - AccountSkuListResultImpl(AccountSkuListResultInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager 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 AccountSkuListResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsClientImpl.java deleted file mode 100644 index bd9096ebc0db..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsClientImpl.java +++ /dev/null @@ -1,1798 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.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; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountModelInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountSkuListResultInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ApiKeysInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.EvaluateDeploymentPoliciesResponseInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageListResultInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.AccountListResult; -import com.azure.resourcemanager.cognitiveservices.implementation.models.AccountModelListResult; -import com.azure.resourcemanager.cognitiveservices.models.EvaluateDeploymentPoliciesRequest; -import com.azure.resourcemanager.cognitiveservices.models.RegenerateKeyParameters; -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 AccountsClient. - */ -public final class AccountsClientImpl implements AccountsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AccountsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of AccountsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AccountsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(AccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientAccounts to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientAccounts") - public interface AccountsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") - @ExpectedResponses({ 200, 201, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") AccountInner account, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") - @ExpectedResponses({ 200, 201, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") AccountInner account, Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") AccountInner account, Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") AccountInner account, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - 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" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - 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" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/accounts") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/accounts") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - 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" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/listKeys") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/listKeys") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listKeysSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/regenerateKey") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regenerateKey(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") RegenerateKeyParameters parameters, Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/regenerateKey") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response regenerateKeySync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") RegenerateKeyParameters parameters, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/skus") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSkus(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/skus") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSkusSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/usages") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listUsages(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/usages") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listUsagesSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/models") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listModels(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/models") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listModelsSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/evaluateDeploymentPolicies") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> evaluateDeploymentPolicies( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") EvaluateDeploymentPoliciesRequest body, Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/evaluateDeploymentPolicies") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response evaluateDeploymentPoliciesSync( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") EvaluateDeploymentPoliciesRequest body, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listByResourceGroupNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listModelsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listModelsNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String accountName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String accountName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, accountName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, - Context context) { - final String accept = "application/json"; - return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); - } - - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccountInner getByResourceGroup(String resourceGroupName, String accountName) { - return getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); - } - - /** - * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for - * developer to access intelligent APIs. It's also the resource type for billing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String accountName, - AccountInner account) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, accept, account, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for - * developer to access intelligent APIs. It's also the resource type for billing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createWithResponse(String resourceGroupName, String accountName, - AccountInner account) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, accept, account, - Context.NONE); - } - - /** - * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for - * developer to access intelligent APIs. It's also the resource type for billing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created 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 cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createWithResponse(String resourceGroupName, String accountName, AccountInner account, - Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, accept, account, context); - } - - /** - * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for - * developer to access intelligent APIs. It's also the resource type for billing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive Services account is an Azure resource representing the - * provisioned account, it's type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AccountInner> beginCreateAsync(String resourceGroupName, - String accountName, AccountInner account) { - Mono>> mono = createWithResponseAsync(resourceGroupName, accountName, account); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - AccountInner.class, AccountInner.class, this.client.getContext()); - } - - /** - * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for - * developer to access intelligent APIs. It's also the resource type for billing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive Services account is an Azure resource representing the - * provisioned account, it's type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AccountInner> beginCreate(String resourceGroupName, String accountName, - AccountInner account) { - Response response = createWithResponse(resourceGroupName, accountName, account); - return this.client.getLroResult(response, AccountInner.class, AccountInner.class, - Context.NONE); - } - - /** - * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for - * developer to access intelligent APIs. It's also the resource type for billing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created 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 {@link SyncPoller} for polling of cognitive Services account is an Azure resource representing the - * provisioned account, it's type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AccountInner> beginCreate(String resourceGroupName, String accountName, - AccountInner account, Context context) { - Response response = createWithResponse(resourceGroupName, accountName, account, context); - return this.client.getLroResult(response, AccountInner.class, AccountInner.class, - context); - } - - /** - * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for - * developer to access intelligent APIs. It's also the resource type for billing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String accountName, AccountInner account) { - return beginCreateAsync(resourceGroupName, accountName, account).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for - * developer to access intelligent APIs. It's also the resource type for billing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccountInner create(String resourceGroupName, String accountName, AccountInner account) { - return beginCreate(resourceGroupName, accountName, account).getFinalResult(); - } - - /** - * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for - * developer to access intelligent APIs. It's also the resource type for billing. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created 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 cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccountInner create(String resourceGroupName, String accountName, AccountInner account, Context context) { - return beginCreate(resourceGroupName, accountName, account, context).getFinalResult(); - } - - /** - * Updates a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String accountName, - AccountInner account) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, accept, account, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String accountName, - AccountInner account) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, accept, account, - Context.NONE); - } - - /** - * Updates a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created 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 cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String accountName, AccountInner account, - Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, accept, account, context); - } - - /** - * Updates a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive Services account is an Azure resource representing the - * provisioned account, it's type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AccountInner> beginUpdateAsync(String resourceGroupName, - String accountName, AccountInner account) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, accountName, account); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - AccountInner.class, AccountInner.class, this.client.getContext()); - } - - /** - * Updates a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive Services account is an Azure resource representing the - * provisioned account, it's type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AccountInner> beginUpdate(String resourceGroupName, String accountName, - AccountInner account) { - Response response = updateWithResponse(resourceGroupName, accountName, account); - return this.client.getLroResult(response, AccountInner.class, AccountInner.class, - Context.NONE); - } - - /** - * Updates a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created 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 {@link SyncPoller} for polling of cognitive Services account is an Azure resource representing the - * provisioned account, it's type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AccountInner> beginUpdate(String resourceGroupName, String accountName, - AccountInner account, Context context) { - Response response = updateWithResponse(resourceGroupName, accountName, account, context); - return this.client.getLroResult(response, AccountInner.class, AccountInner.class, - context); - } - - /** - * Updates a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String accountName, AccountInner account) { - return beginUpdateAsync(resourceGroupName, accountName, account).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccountInner update(String resourceGroupName, String accountName, AccountInner account) { - return beginUpdate(resourceGroupName, accountName, account).getFinalResult(); - } - - /** - * Updates a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param account The parameters to provide for the created 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 cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccountInner update(String resourceGroupName, String accountName, AccountInner account, Context context) { - return beginUpdate(resourceGroupName, accountName, account, context).getFinalResult(); - } - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, Context.NONE); - } - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String accountName, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, context); - } - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName) { - Response response = deleteWithResponse(resourceGroupName, accountName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - Context context) { - Response response = deleteWithResponse(resourceGroupName, accountName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName) { - return beginDeleteAsync(resourceGroupName, accountName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName) { - beginDelete(resourceGroupName, accountName).getFinalResult(); - } - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, Context context) { - beginDelete(resourceGroupName, accountName, context).getFinalResult(); - } - - /** - * Returns all the resources of a particular type belonging to a resource group. - * - * @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 the list of cognitive services accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - final String accept = "application/json"; - return FluxUtil - .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())); - } - - /** - * Returns all the resources of a particular type belonging to a resource group. - * - * @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 the list of cognitive services accounts 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)); - } - - /** - * Returns all the resources of a particular type belonging to a resource group. - * - * @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 the list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { - final String accept = "application/json"; - 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); - } - - /** - * Returns all the resources of a particular type belonging to 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 the list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { - final String accept = "application/json"; - 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); - } - - /** - * Returns all the resources of a particular type belonging to a resource group. - * - * @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 the list of cognitive services accounts 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)); - } - - /** - * Returns all the resources of a particular type belonging to 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 the list of cognitive services accounts 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)); - } - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - final String accept = "application/json"; - return FluxUtil - .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 subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage() { - 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); - } - - /** - * Returns all the resources of a particular type belonging to 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 list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(Context context) { - 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); - } - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Returns all the resources of a particular type belonging to 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 list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Lists the account keys for the specified Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the access keys for the cognitive services account along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync(String resourceGroupName, String accountName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the account keys for the specified Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the access keys for the cognitive services account on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listKeysAsync(String resourceGroupName, String accountName) { - return listKeysWithResponseAsync(resourceGroupName, accountName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Lists the account keys for the specified Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 access keys for the cognitive services account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listKeysWithResponse(String resourceGroupName, String accountName, Context context) { - final String accept = "application/json"; - return service.listKeysSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); - } - - /** - * Lists the account keys for the specified Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the access keys for the cognitive services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApiKeysInner listKeys(String resourceGroupName, String accountName) { - return listKeysWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); - } - - /** - * Regenerates the specified account key for the specified Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param parameters regenerate key parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the access keys for the cognitive services account along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateKeyWithResponseAsync(String resourceGroupName, String accountName, - RegenerateKeyParameters parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.regenerateKey(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, accept, parameters, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Regenerates the specified account key for the specified Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param parameters regenerate key parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the access keys for the cognitive services account on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono regenerateKeyAsync(String resourceGroupName, String accountName, - RegenerateKeyParameters parameters) { - return regenerateKeyWithResponseAsync(resourceGroupName, accountName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Regenerates the specified account key for the specified Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param parameters regenerate key parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the access keys for the cognitive services account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response regenerateKeyWithResponse(String resourceGroupName, String accountName, - RegenerateKeyParameters parameters, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.regenerateKeySync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, accept, parameters, context); - } - - /** - * Regenerates the specified account key for the specified Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param parameters regenerate key parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the access keys for the cognitive services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApiKeysInner regenerateKey(String resourceGroupName, String accountName, - RegenerateKeyParameters parameters) { - return regenerateKeyWithResponse(resourceGroupName, accountName, parameters, Context.NONE).getValue(); - } - - /** - * List available SKUs for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSkusWithResponseAsync(String resourceGroupName, - String accountName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listSkus(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List available SKUs for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listSkusAsync(String resourceGroupName, String accountName) { - return listSkusWithResponseAsync(resourceGroupName, accountName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * List available SKUs for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 list of cognitive services accounts operation response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listSkusWithResponse(String resourceGroupName, String accountName, - Context context) { - final String accept = "application/json"; - return service.listSkusSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); - } - - /** - * List available SKUs for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccountSkuListResultInner listSkus(String resourceGroupName, String accountName) { - return listSkusWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); - } - - /** - * Get usages for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is - * name.value (name of the metric, can have an or of multiple names). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usages for the requested Cognitive Services account along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUsagesWithResponseAsync(String resourceGroupName, - String accountName, String filter) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listUsages(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, filter, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get usages for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usages for the requested Cognitive Services account on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listUsagesAsync(String resourceGroupName, String accountName) { - final String filter = null; - return listUsagesWithResponseAsync(resourceGroupName, accountName, filter) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get usages for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is - * name.value (name of the metric, can have an or of multiple names). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usages for the requested Cognitive Services account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listUsagesWithResponse(String resourceGroupName, String accountName, - String filter, Context context) { - final String accept = "application/json"; - return service.listUsagesSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, filter, accept, context); - } - - /** - * Get usages for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usages for the requested Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UsageListResultInner listUsages(String resourceGroupName, String accountName) { - final String filter = null; - return listUsagesWithResponse(resourceGroupName, accountName, filter, Context.NONE).getValue(); - } - - /** - * List available Models for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listModelsSinglePageAsync(String resourceGroupName, - String accountName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listModels(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, 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 available Models for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listModelsAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listModelsSinglePageAsync(resourceGroupName, accountName), - nextLink -> listModelsNextSinglePageAsync(nextLink)); - } - - /** - * List available Models for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listModelsSinglePage(String resourceGroupName, String accountName) { - final String accept = "application/json"; - Response res - = service.listModelsSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List available Models for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listModelsSinglePage(String resourceGroupName, String accountName, - Context context) { - final String accept = "application/json"; - Response res - = service.listModelsSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List available Models for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listModels(String resourceGroupName, String accountName) { - return new PagedIterable<>(() -> listModelsSinglePage(resourceGroupName, accountName), - nextLink -> listModelsNextSinglePage(nextLink)); - } - - /** - * List available Models for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listModels(String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(() -> listModelsSinglePage(resourceGroupName, accountName, context), - nextLink -> listModelsNextSinglePage(nextLink, context)); - } - - /** - * Evaluate Azure Policy compliance for a set of hypothetical deployments without creating them. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param body The content of the action request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response body for the evaluateDeploymentPolicies action along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> evaluateDeploymentPoliciesWithResponseAsync( - String resourceGroupName, String accountName, EvaluateDeploymentPoliciesRequest body) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.evaluateDeploymentPolicies(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, - contentType, accept, body, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Evaluate Azure Policy compliance for a set of hypothetical deployments without creating them. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param body The content of the action request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response body for the evaluateDeploymentPolicies action on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono evaluateDeploymentPoliciesAsync(String resourceGroupName, - String accountName, EvaluateDeploymentPoliciesRequest body) { - return evaluateDeploymentPoliciesWithResponseAsync(resourceGroupName, accountName, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Evaluate Azure Policy compliance for a set of hypothetical deployments without creating them. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param body The content of the action request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response body for the evaluateDeploymentPolicies action along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response evaluateDeploymentPoliciesWithResponse( - String resourceGroupName, String accountName, EvaluateDeploymentPoliciesRequest body, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.evaluateDeploymentPoliciesSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, accept, body, context); - } - - /** - * Evaluate Azure Policy compliance for a set of hypothetical deployments without creating them. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param body The content of the action request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response body for the evaluateDeploymentPolicies action. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EvaluateDeploymentPoliciesResponseInner evaluateDeploymentPolicies(String resourceGroupName, - String accountName, EvaluateDeploymentPoliciesRequest body) { - return evaluateDeploymentPoliciesWithResponse(resourceGroupName, accountName, body, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> 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)) - .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 of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { - 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. - * - * @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 list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - 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); - } - - /** - * 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 of cognitive services accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listModelsNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listModelsNext(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 list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listModelsNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listModelsNextSync(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 list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listModelsNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listModelsNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsImpl.java deleted file mode 100644 index 625765956fe8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsImpl.java +++ /dev/null @@ -1,251 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.AccountsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountModelInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountSkuListResultInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ApiKeysInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.EvaluateDeploymentPoliciesResponseInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.Account; -import com.azure.resourcemanager.cognitiveservices.models.AccountModel; -import com.azure.resourcemanager.cognitiveservices.models.AccountSkuListResult; -import com.azure.resourcemanager.cognitiveservices.models.Accounts; -import com.azure.resourcemanager.cognitiveservices.models.ApiKeys; -import com.azure.resourcemanager.cognitiveservices.models.EvaluateDeploymentPoliciesRequest; -import com.azure.resourcemanager.cognitiveservices.models.EvaluateDeploymentPoliciesResponse; -import com.azure.resourcemanager.cognitiveservices.models.RegenerateKeyParameters; -import com.azure.resourcemanager.cognitiveservices.models.UsageListResult; - -public final class AccountsImpl implements Accounts { - private static final ClientLogger LOGGER = new ClientLogger(AccountsImpl.class); - - private final AccountsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public AccountsImpl(AccountsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, - Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, accountName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AccountImpl(inner.getValue(), this.manager())); - } - - public Account getByResourceGroup(String resourceGroupName, String accountName) { - AccountInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, accountName); - if (inner != null) { - return new AccountImpl(inner, this.manager()); - } else { - return null; - } - } - - public void deleteByResourceGroup(String resourceGroupName, String accountName) { - this.serviceClient().delete(resourceGroupName, accountName); - } - - public void delete(String resourceGroupName, String accountName, Context context) { - this.serviceClient().delete(resourceGroupName, accountName, context); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); - } - - public Response listKeysWithResponse(String resourceGroupName, String accountName, Context context) { - Response inner - = this.serviceClient().listKeysWithResponse(resourceGroupName, accountName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApiKeysImpl(inner.getValue(), this.manager())); - } - - public ApiKeys listKeys(String resourceGroupName, String accountName) { - ApiKeysInner inner = this.serviceClient().listKeys(resourceGroupName, accountName); - if (inner != null) { - return new ApiKeysImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response regenerateKeyWithResponse(String resourceGroupName, String accountName, - RegenerateKeyParameters parameters, Context context) { - Response inner - = this.serviceClient().regenerateKeyWithResponse(resourceGroupName, accountName, parameters, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApiKeysImpl(inner.getValue(), this.manager())); - } - - public ApiKeys regenerateKey(String resourceGroupName, String accountName, RegenerateKeyParameters parameters) { - ApiKeysInner inner = this.serviceClient().regenerateKey(resourceGroupName, accountName, parameters); - if (inner != null) { - return new ApiKeysImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listSkusWithResponse(String resourceGroupName, String accountName, - Context context) { - Response inner - = this.serviceClient().listSkusWithResponse(resourceGroupName, accountName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AccountSkuListResultImpl(inner.getValue(), this.manager())); - } - - public AccountSkuListResult listSkus(String resourceGroupName, String accountName) { - AccountSkuListResultInner inner = this.serviceClient().listSkus(resourceGroupName, accountName); - if (inner != null) { - return new AccountSkuListResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listUsagesWithResponse(String resourceGroupName, String accountName, String filter, - Context context) { - Response inner - = this.serviceClient().listUsagesWithResponse(resourceGroupName, accountName, filter, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new UsageListResultImpl(inner.getValue(), this.manager())); - } - - public UsageListResult listUsages(String resourceGroupName, String accountName) { - UsageListResultInner inner = this.serviceClient().listUsages(resourceGroupName, accountName); - if (inner != null) { - return new UsageListResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listModels(String resourceGroupName, String accountName) { - PagedIterable inner = this.serviceClient().listModels(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountModelImpl(inner1, this.manager())); - } - - public PagedIterable listModels(String resourceGroupName, String accountName, Context context) { - PagedIterable inner - = this.serviceClient().listModels(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountModelImpl(inner1, this.manager())); - } - - public Response evaluateDeploymentPoliciesWithResponse(String resourceGroupName, - String accountName, EvaluateDeploymentPoliciesRequest body, Context context) { - Response inner = this.serviceClient() - .evaluateDeploymentPoliciesWithResponse(resourceGroupName, accountName, body, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new EvaluateDeploymentPoliciesResponseImpl(inner.getValue(), this.manager())); - } - - public EvaluateDeploymentPoliciesResponse evaluateDeploymentPolicies(String resourceGroupName, String accountName, - EvaluateDeploymentPoliciesRequest body) { - EvaluateDeploymentPoliciesResponseInner inner - = this.serviceClient().evaluateDeploymentPolicies(resourceGroupName, accountName, body); - if (inner != null) { - return new EvaluateDeploymentPoliciesResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Account 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, accountName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, accountName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - this.delete(resourceGroupName, accountName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - this.delete(resourceGroupName, accountName, context); - } - - private AccountsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public AccountImpl define(String name) { - return new AccountImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationImpl.java deleted file mode 100644 index 99d1901c3e98..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationImpl.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentApplicationInner; -import com.azure.resourcemanager.cognitiveservices.models.AgentApplication; -import com.azure.resourcemanager.cognitiveservices.models.AgentReferenceResourceArmPaginatedResult; -import com.azure.resourcemanager.cognitiveservices.models.AgenticApplicationProperties; - -public final class AgentApplicationImpl - implements AgentApplication, AgentApplication.Definition, AgentApplication.Update { - private AgentApplicationInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public AgenticApplicationProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public AgentApplicationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - private String projectName; - - private String name; - - public AgentApplicationImpl withExistingProject(String resourceGroupName, String accountName, String projectName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - this.projectName = projectName; - return this; - } - - public AgentApplication create() { - this.innerObject = serviceManager.serviceClient() - .getAgentApplications() - .createOrUpdate(resourceGroupName, accountName, projectName, name, this.innerModel(), Context.NONE); - return this; - } - - public AgentApplication create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAgentApplications() - .createOrUpdate(resourceGroupName, accountName, projectName, name, this.innerModel(), context); - return this; - } - - AgentApplicationImpl(String name, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new AgentApplicationInner(); - this.serviceManager = serviceManager; - this.name = name; - } - - public AgentApplicationImpl update() { - return this; - } - - public AgentApplication apply() { - this.innerObject = serviceManager.serviceClient() - .getAgentApplications() - .createOrUpdate(resourceGroupName, accountName, projectName, name, this.innerModel(), Context.NONE); - return this; - } - - public AgentApplication apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAgentApplications() - .createOrUpdate(resourceGroupName, accountName, projectName, name, this.innerModel(), context); - return this; - } - - AgentApplicationImpl(AgentApplicationInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.projectName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "projects"); - this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "applications"); - } - - public AgentApplication refresh() { - this.innerObject = serviceManager.serviceClient() - .getAgentApplications() - .getWithResponse(resourceGroupName, accountName, projectName, name, Context.NONE) - .getValue(); - return this; - } - - public AgentApplication refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAgentApplications() - .getWithResponse(resourceGroupName, accountName, projectName, name, context) - .getValue(); - return this; - } - - public Response listAgentsWithResponse(Context context) { - return serviceManager.agentApplications() - .listAgentsWithResponse(resourceGroupName, accountName, projectName, name, context); - } - - public AgentReferenceResourceArmPaginatedResult listAgents() { - return serviceManager.agentApplications().listAgents(resourceGroupName, accountName, projectName, name); - } - - public Response enableWithResponse(Context context) { - return serviceManager.agentApplications() - .enableWithResponse(resourceGroupName, accountName, projectName, name, context); - } - - public void enable() { - serviceManager.agentApplications().enable(resourceGroupName, accountName, projectName, name); - } - - public Response disableWithResponse(Context context) { - return serviceManager.agentApplications() - .disableWithResponse(resourceGroupName, accountName, projectName, name, context); - } - - public void disable() { - serviceManager.agentApplications().disable(resourceGroupName, accountName, projectName, name); - } - - public AgentApplicationImpl withProperties(AgenticApplicationProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationsClientImpl.java deleted file mode 100644 index a77b0a6deb44..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationsClientImpl.java +++ /dev/null @@ -1,1185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.AgentApplicationsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentApplicationInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentReferenceResourceArmPaginatedResultInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.AgentApplicationResourceArmPaginatedResult; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AgentApplicationsClient. - */ -public final class AgentApplicationsClientImpl implements AgentApplicationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AgentApplicationsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of AgentApplicationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AgentApplicationsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service - = RestProxy.create(AgentApplicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientAgentApplications to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientAgentApplications") - public interface AgentApplicationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("name") String name, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("name") String name, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") AgentApplicationInner body, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") AgentApplicationInner body, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("name") String name, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("name") String name, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @QueryParam("count") Integer count, - @QueryParam("$skip") Integer skip, @QueryParam("$skipToken") String skipToken, - @QueryParam(value = "names", multipleQueryParams = true) List names, - @QueryParam("searchText") String searchText, @QueryParam("orderBy") String orderBy, - @QueryParam("orderByAsc") Boolean orderByAsc, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @QueryParam("count") Integer count, - @QueryParam("$skip") Integer skip, @QueryParam("$skipToken") String skipToken, - @QueryParam(value = "names", multipleQueryParams = true) List names, - @QueryParam("searchText") String searchText, @QueryParam("orderBy") String orderBy, - @QueryParam("orderByAsc") Boolean orderByAsc, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}/listAgents") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAgents(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("name") String name, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}/listAgents") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listAgentsSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("name") String name, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}/enable") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> enable(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("name") String name, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}/enable") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response enableSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("name") String name, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}/disable") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> disable(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("name") String name, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}/disable") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response disableSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("name") String name, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets an Agent Application by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Agent Application by name along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String accountName, - String projectName, String name) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an Agent Application by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Agent Application by name on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, String projectName, - String name) { - return getWithResponseAsync(resourceGroupName, accountName, projectName, name) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets an Agent Application by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Agent Application by name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, - String projectName, String name, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, projectName, name, accept, context); - } - - /** - * Gets an Agent Application by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Agent Application by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AgentApplicationInner get(String resourceGroupName, String accountName, String projectName, String name) { - return getWithResponse(resourceGroupName, accountName, projectName, name, Context.NONE).getValue(); - } - - /** - * Creates or updates an Agent Application (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @param body Agent Application definition object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Application resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String accountName, String projectName, String name, AgentApplicationInner body) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, contentType, accept, - body, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an Agent Application (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @param body Agent Application definition object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Application resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String projectName, String name, AgentApplicationInner body) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, contentType, accept, - body, Context.NONE); - } - - /** - * Creates or updates an Agent Application (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @param body Agent Application definition object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Application resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String projectName, String name, AgentApplicationInner body, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, contentType, accept, - body, context); - } - - /** - * Creates or updates an Agent Application (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @param body Agent Application definition object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 agent Application resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AgentApplicationInner> beginCreateOrUpdateAsync( - String resourceGroupName, String accountName, String projectName, String name, AgentApplicationInner body) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, accountName, projectName, name, body); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AgentApplicationInner.class, AgentApplicationInner.class, - this.client.getContext()); - } - - /** - * Creates or updates an Agent Application (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @param body Agent Application definition object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 agent Application resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AgentApplicationInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String projectName, String name, AgentApplicationInner body) { - Response response - = createOrUpdateWithResponse(resourceGroupName, accountName, projectName, name, body); - return this.client.getLroResult(response, - AgentApplicationInner.class, AgentApplicationInner.class, Context.NONE); - } - - /** - * Creates or updates an Agent Application (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @param body Agent Application definition object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 agent Application resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AgentApplicationInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String projectName, String name, AgentApplicationInner body, - Context context) { - Response response - = createOrUpdateWithResponse(resourceGroupName, accountName, projectName, name, body, context); - return this.client.getLroResult(response, - AgentApplicationInner.class, AgentApplicationInner.class, context); - } - - /** - * Creates or updates an Agent Application (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @param body Agent Application definition object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Application resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, - String projectName, String name, AgentApplicationInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, accountName, projectName, name, body).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an Agent Application (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @param body Agent Application definition object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Application resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AgentApplicationInner createOrUpdate(String resourceGroupName, String accountName, String projectName, - String name, AgentApplicationInner body) { - return beginCreateOrUpdate(resourceGroupName, accountName, projectName, name, body).getFinalResult(); - } - - /** - * Creates or updates an Agent Application (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @param body Agent Application definition object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Application resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AgentApplicationInner createOrUpdate(String resourceGroupName, String accountName, String projectName, - String name, AgentApplicationInner body, Context context) { - return beginCreateOrUpdate(resourceGroupName, accountName, projectName, name, body, context).getFinalResult(); - } - - /** - * Delete Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName, String name) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, String projectName, - String name) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, Context.NONE); - } - - /** - * Delete Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, String projectName, - String name, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, context); - } - - /** - * Delete Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName, String name) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, accountName, projectName, name); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Delete Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName, String name) { - Response response = deleteWithResponse(resourceGroupName, accountName, projectName, name); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Delete Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName, String name, Context context) { - Response response = deleteWithResponse(resourceGroupName, accountName, projectName, name, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Delete Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String projectName, String name) { - return beginDeleteAsync(resourceGroupName, accountName, projectName, name).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String projectName, String name) { - beginDelete(resourceGroupName, accountName, projectName, name).getFinalResult(); - } - - /** - * Delete Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String projectName, String name, Context context) { - beginDelete(resourceGroupName, accountName, projectName, name, context).getFinalResult(); - } - - /** - * Lists Agent Applications in the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param count Number of agent applications to be retrieved in a page of results. - * @param skip Number of agent applications to skip. - * @param skipToken Continuation token for pagination. - * @param names Names of agent applications to retrieve. - * @param searchText Search text for filtering agent applications. - * @param orderBy Field to order by. - * @param orderByAsc Whether to order in ascending order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Agent Application entities along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String accountName, - String projectName, Integer count, Integer skip, String skipToken, List names, String searchText, - String orderBy, Boolean orderByAsc) { - final String accept = "application/json"; - List namesConverted = (names == null) - ? new ArrayList<>() - : names.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, count, skip, skipToken, - namesConverted, searchText, orderBy, orderByAsc, 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 Agent Applications in the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param count Number of agent applications to be retrieved in a page of results. - * @param skip Number of agent applications to skip. - * @param skipToken Continuation token for pagination. - * @param names Names of agent applications to retrieve. - * @param searchText Search text for filtering agent applications. - * @param orderBy Field to order by. - * @param orderByAsc Whether to order in ascending order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Agent Application entities as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName, String projectName, - Integer count, Integer skip, String skipToken, List names, String searchText, String orderBy, - Boolean orderByAsc) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, projectName, count, skip, - skipToken, names, searchText, orderBy, orderByAsc), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists Agent Applications in the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Agent Application entities as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName, - String projectName) { - final Integer count = null; - final Integer skip = null; - final String skipToken = null; - final List names = null; - final String searchText = null; - final String orderBy = null; - final Boolean orderByAsc = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, projectName, count, skip, - skipToken, names, searchText, orderBy, orderByAsc), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists Agent Applications in the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param count Number of agent applications to be retrieved in a page of results. - * @param skip Number of agent applications to skip. - * @param skipToken Continuation token for pagination. - * @param names Names of agent applications to retrieve. - * @param searchText Search text for filtering agent applications. - * @param orderBy Field to order by. - * @param orderByAsc Whether to order in ascending order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Agent Application entities along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - String projectName, Integer count, Integer skip, String skipToken, List names, String searchText, - String orderBy, Boolean orderByAsc) { - final String accept = "application/json"; - List namesConverted = (names == null) - ? new ArrayList<>() - : names.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - Response res = service.listSync(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, - count, skip, skipToken, namesConverted, searchText, orderBy, orderByAsc, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists Agent Applications in the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param count Number of agent applications to be retrieved in a page of results. - * @param skip Number of agent applications to skip. - * @param skipToken Continuation token for pagination. - * @param names Names of agent applications to retrieve. - * @param searchText Search text for filtering agent applications. - * @param orderBy Field to order by. - * @param orderByAsc Whether to order in ascending order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Agent Application entities along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - String projectName, Integer count, Integer skip, String skipToken, List names, String searchText, - String orderBy, Boolean orderByAsc, Context context) { - final String accept = "application/json"; - List namesConverted = (names == null) - ? new ArrayList<>() - : names.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - Response res = service.listSync(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, - count, skip, skipToken, namesConverted, searchText, orderBy, orderByAsc, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists Agent Applications in the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Agent Application entities as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, String projectName) { - final Integer count = null; - final Integer skip = null; - final String skipToken = null; - final List names = null; - final String searchText = null; - final String orderBy = null; - final Boolean orderByAsc = null; - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, projectName, count, skip, - skipToken, names, searchText, orderBy, orderByAsc), nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Lists Agent Applications in the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param count Number of agent applications to be retrieved in a page of results. - * @param skip Number of agent applications to skip. - * @param skipToken Continuation token for pagination. - * @param names Names of agent applications to retrieve. - * @param searchText Search text for filtering agent applications. - * @param orderBy Field to order by. - * @param orderByAsc Whether to order in ascending order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Agent Application entities as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, String projectName, - Integer count, Integer skip, String skipToken, List names, String searchText, String orderBy, - Boolean orderByAsc, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, projectName, count, skip, - skipToken, names, searchText, orderBy, orderByAsc, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Lists agents for an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Agent Reference entities along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAgentsWithResponseAsync(String resourceGroupName, String accountName, String projectName, String name) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAgents(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists agents for an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Agent Reference entities on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAgentsAsync(String resourceGroupName, - String accountName, String projectName, String name) { - return listAgentsWithResponseAsync(resourceGroupName, accountName, projectName, name) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Lists agents for an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Agent Reference entities along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAgentsWithResponse(String resourceGroupName, - String accountName, String projectName, String name, Context context) { - final String accept = "application/json"; - return service.listAgentsSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, accept, context); - } - - /** - * Lists agents for an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Agent Reference entities. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AgentReferenceResourceArmPaginatedResultInner listAgents(String resourceGroupName, String accountName, - String projectName, String name) { - return listAgentsWithResponse(resourceGroupName, accountName, projectName, name, Context.NONE).getValue(); - } - - /** - * Enables an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName, String name) { - return FluxUtil - .withContext(context -> service.enable(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Enables an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 enableAsync(String resourceGroupName, String accountName, String projectName, String name) { - return enableWithResponseAsync(resourceGroupName, accountName, projectName, name) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Enables an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 enableWithResponse(String resourceGroupName, String accountName, String projectName, - String name, Context context) { - return service.enableSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, context); - } - - /** - * Enables an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 enable(String resourceGroupName, String accountName, String projectName, String name) { - enableWithResponse(resourceGroupName, accountName, projectName, name, Context.NONE); - } - - /** - * Disables an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName, String name) { - return FluxUtil - .withContext(context -> service.disable(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Disables an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 disableAsync(String resourceGroupName, String accountName, String projectName, String name) { - return disableWithResponseAsync(resourceGroupName, accountName, projectName, name) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Disables an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 disableWithResponse(String resourceGroupName, String accountName, String projectName, - String name, Context context) { - return service.disableSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, context); - } - - /** - * Disables an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 disable(String resourceGroupName, String accountName, String projectName, String name) { - disableWithResponse(resourceGroupName, accountName, projectName, name, Context.NONE); - } - - /** - * Lists Agent Applications in the project. - * - * 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 paginated list of Agent Application entities along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists Agent Applications in the project. - * - * 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 paginated list of Agent Application entities along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists Agent Applications in the project. - * - * 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 paginated list of Agent Application entities along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationsImpl.java deleted file mode 100644 index 30d27328f362..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationsImpl.java +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.AgentApplicationsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentApplicationInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentReferenceResourceArmPaginatedResultInner; -import com.azure.resourcemanager.cognitiveservices.models.AgentApplication; -import com.azure.resourcemanager.cognitiveservices.models.AgentApplications; -import com.azure.resourcemanager.cognitiveservices.models.AgentReferenceResourceArmPaginatedResult; -import java.util.List; - -public final class AgentApplicationsImpl implements AgentApplications { - private static final ClientLogger LOGGER = new ClientLogger(AgentApplicationsImpl.class); - - private final AgentApplicationsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public AgentApplicationsImpl(AgentApplicationsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, String projectName, - String name, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, accountName, projectName, name, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AgentApplicationImpl(inner.getValue(), this.manager())); - } - - public AgentApplication get(String resourceGroupName, String accountName, String projectName, String name) { - AgentApplicationInner inner = this.serviceClient().get(resourceGroupName, accountName, projectName, name); - if (inner != null) { - return new AgentApplicationImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String accountName, String projectName, String name) { - this.serviceClient().delete(resourceGroupName, accountName, projectName, name); - } - - public void delete(String resourceGroupName, String accountName, String projectName, String name, Context context) { - this.serviceClient().delete(resourceGroupName, accountName, projectName, name, context); - } - - public PagedIterable list(String resourceGroupName, String accountName, String projectName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName, projectName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AgentApplicationImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, String projectName, - Integer count, Integer skip, String skipToken, List names, String searchText, String orderBy, - Boolean orderByAsc, Context context) { - PagedIterable inner = this.serviceClient() - .list(resourceGroupName, accountName, projectName, count, skip, skipToken, names, searchText, orderBy, - orderByAsc, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AgentApplicationImpl(inner1, this.manager())); - } - - public Response listAgentsWithResponse(String resourceGroupName, - String accountName, String projectName, String name, Context context) { - Response inner - = this.serviceClient().listAgentsWithResponse(resourceGroupName, accountName, projectName, name, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AgentReferenceResourceArmPaginatedResultImpl(inner.getValue(), this.manager())); - } - - public AgentReferenceResourceArmPaginatedResult listAgents(String resourceGroupName, String accountName, - String projectName, String name) { - AgentReferenceResourceArmPaginatedResultInner inner - = this.serviceClient().listAgents(resourceGroupName, accountName, projectName, name); - if (inner != null) { - return new AgentReferenceResourceArmPaginatedResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response enableWithResponse(String resourceGroupName, String accountName, String projectName, - String name, Context context) { - return this.serviceClient().enableWithResponse(resourceGroupName, accountName, projectName, name, context); - } - - public void enable(String resourceGroupName, String accountName, String projectName, String name) { - this.serviceClient().enable(resourceGroupName, accountName, projectName, name); - } - - public Response disableWithResponse(String resourceGroupName, String accountName, String projectName, - String name, Context context) { - return this.serviceClient().disableWithResponse(resourceGroupName, accountName, projectName, name, context); - } - - public void disable(String resourceGroupName, String accountName, String projectName, String name) { - this.serviceClient().disable(resourceGroupName, accountName, projectName, name); - } - - public AgentApplication 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String name = ResourceManagerUtils.getValueFromIdByName(id, "applications"); - if (name == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, projectName, name, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String name = ResourceManagerUtils.getValueFromIdByName(id, "applications"); - if (name == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, projectName, name, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String name = ResourceManagerUtils.getValueFromIdByName(id, "applications"); - if (name == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); - } - this.delete(resourceGroupName, accountName, projectName, name, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String name = ResourceManagerUtils.getValueFromIdByName(id, "applications"); - if (name == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); - } - this.delete(resourceGroupName, accountName, projectName, name, context); - } - - private AgentApplicationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public AgentApplicationImpl define(String name) { - return new AgentApplicationImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentImpl.java deleted file mode 100644 index acc2215db8e0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentImpl.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentDeploymentInner; -import com.azure.resourcemanager.cognitiveservices.models.AgentDeployment; -import com.azure.resourcemanager.cognitiveservices.models.AgentDeploymentProperties; - -public final class AgentDeploymentImpl implements AgentDeployment, AgentDeployment.Definition, AgentDeployment.Update { - private AgentDeploymentInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public AgentDeploymentProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public AgentDeploymentInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - private String projectName; - - private String appName; - - private String deploymentName; - - public AgentDeploymentImpl withExistingApplication(String resourceGroupName, String accountName, String projectName, - String appName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - this.projectName = projectName; - this.appName = appName; - return this; - } - - public AgentDeployment create() { - this.innerObject = serviceManager.serviceClient() - .getAgentDeployments() - .createOrUpdate(resourceGroupName, accountName, projectName, appName, deploymentName, this.innerModel(), - Context.NONE); - return this; - } - - public AgentDeployment create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAgentDeployments() - .createOrUpdate(resourceGroupName, accountName, projectName, appName, deploymentName, this.innerModel(), - context); - return this; - } - - AgentDeploymentImpl(String name, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new AgentDeploymentInner(); - this.serviceManager = serviceManager; - this.deploymentName = name; - } - - public AgentDeploymentImpl update() { - return this; - } - - public AgentDeployment apply() { - this.innerObject = serviceManager.serviceClient() - .getAgentDeployments() - .createOrUpdate(resourceGroupName, accountName, projectName, appName, deploymentName, this.innerModel(), - Context.NONE); - return this; - } - - public AgentDeployment apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAgentDeployments() - .createOrUpdate(resourceGroupName, accountName, projectName, appName, deploymentName, this.innerModel(), - context); - return this; - } - - AgentDeploymentImpl(AgentDeploymentInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.projectName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "projects"); - this.appName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "applications"); - this.deploymentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "agentDeployments"); - } - - public AgentDeployment refresh() { - this.innerObject = serviceManager.serviceClient() - .getAgentDeployments() - .getWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, Context.NONE) - .getValue(); - return this; - } - - public AgentDeployment refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAgentDeployments() - .getWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, context) - .getValue(); - return this; - } - - public Response startWithResponse(Context context) { - return serviceManager.agentDeployments() - .startWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, context); - } - - public void start() { - serviceManager.agentDeployments().start(resourceGroupName, accountName, projectName, appName, deploymentName); - } - - public Response stopWithResponse(Context context) { - return serviceManager.agentDeployments() - .stopWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, context); - } - - public void stop() { - serviceManager.agentDeployments().stop(resourceGroupName, accountName, projectName, appName, deploymentName); - } - - public AgentDeploymentImpl withProperties(AgentDeploymentProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentsClientImpl.java deleted file mode 100644 index 1a38bd3fa2c8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentsClientImpl.java +++ /dev/null @@ -1,1135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.AgentDeploymentsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentDeploymentInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.AgentDeploymentResourceArmPaginatedResult; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AgentDeploymentsClient. - */ -public final class AgentDeploymentsClientImpl implements AgentDeploymentsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AgentDeploymentsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of AgentDeploymentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AgentDeploymentsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service - = RestProxy.create(AgentDeploymentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientAgentDeployments to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientAgentDeployments") - public interface AgentDeploymentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("appName") String appName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("appName") String appName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("appName") String appName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") AgentDeploymentInner body, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("appName") String appName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") AgentDeploymentInner body, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("appName") String appName, - @PathParam("deploymentName") String deploymentName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("appName") String appName, - @PathParam("deploymentName") String deploymentName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("appName") String appName, - @QueryParam("count") Integer count, @QueryParam("$skipToken") String skipToken, - @QueryParam(value = "names", multipleQueryParams = true) List names, - @QueryParam("orderBy") String orderBy, @QueryParam("orderByAsc") Boolean orderByAsc, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("appName") String appName, - @QueryParam("count") Integer count, @QueryParam("$skipToken") String skipToken, - @QueryParam(value = "names", multipleQueryParams = true) List names, - @QueryParam("orderBy") String orderBy, @QueryParam("orderByAsc") Boolean orderByAsc, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}/start") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> start(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("appName") String appName, - @PathParam("deploymentName") String deploymentName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}/start") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response startSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("appName") String appName, - @PathParam("deploymentName") String deploymentName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}/stop") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> stop(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("appName") String appName, - @PathParam("deploymentName") String deploymentName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}/stop") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response stopSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("appName") String appName, - @PathParam("deploymentName") String deploymentName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets an Agent Deployment by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Agent Deployment by name along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String accountName, - String projectName, String appName, String deploymentName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, deploymentName, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an Agent Deployment by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Agent Deployment by name on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, String projectName, - String appName, String deploymentName) { - return getWithResponseAsync(resourceGroupName, accountName, projectName, appName, deploymentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets an Agent Deployment by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services 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 an Agent Deployment by name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, - String projectName, String appName, String deploymentName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, projectName, appName, deploymentName, accept, context); - } - - /** - * Gets an Agent Deployment by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Agent Deployment by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AgentDeploymentInner get(String resourceGroupName, String accountName, String projectName, String appName, - String deploymentName) { - return getWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, Context.NONE) - .getValue(); - } - - /** - * Creates or updates an Agent Deployment (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param body Agent Deployment definition object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Deployment resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String accountName, String projectName, String appName, String deploymentName, AgentDeploymentInner body) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, deploymentName, - contentType, accept, body, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates an Agent Deployment (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param body Agent Deployment definition object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Deployment resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String projectName, String appName, String deploymentName, AgentDeploymentInner body) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, deploymentName, - contentType, accept, body, Context.NONE); - } - - /** - * Creates or updates an Agent Deployment (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param body Agent Deployment definition object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Deployment resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String projectName, String appName, String deploymentName, AgentDeploymentInner body, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, deploymentName, - contentType, accept, body, context); - } - - /** - * Creates or updates an Agent Deployment (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param body Agent Deployment definition object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 agent Deployment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AgentDeploymentInner> beginCreateOrUpdateAsync( - String resourceGroupName, String accountName, String projectName, String appName, String deploymentName, - AgentDeploymentInner body) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, accountName, - projectName, appName, deploymentName, body); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - AgentDeploymentInner.class, AgentDeploymentInner.class, this.client.getContext()); - } - - /** - * Creates or updates an Agent Deployment (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param body Agent Deployment definition object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 agent Deployment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AgentDeploymentInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String projectName, String appName, String deploymentName, - AgentDeploymentInner body) { - Response response - = createOrUpdateWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, body); - return this.client.getLroResult(response, - AgentDeploymentInner.class, AgentDeploymentInner.class, Context.NONE); - } - - /** - * Creates or updates an Agent Deployment (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param body Agent Deployment definition object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 agent Deployment resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AgentDeploymentInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String projectName, String appName, String deploymentName, - AgentDeploymentInner body, Context context) { - Response response = createOrUpdateWithResponse(resourceGroupName, accountName, projectName, appName, - deploymentName, body, context); - return this.client.getLroResult(response, - AgentDeploymentInner.class, AgentDeploymentInner.class, context); - } - - /** - * Creates or updates an Agent Deployment (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param body Agent Deployment definition object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Deployment resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, - String projectName, String appName, String deploymentName, AgentDeploymentInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, accountName, projectName, appName, deploymentName, body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates an Agent Deployment (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param body Agent Deployment definition object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Deployment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AgentDeploymentInner createOrUpdate(String resourceGroupName, String accountName, String projectName, - String appName, String deploymentName, AgentDeploymentInner body) { - return beginCreateOrUpdate(resourceGroupName, accountName, projectName, appName, deploymentName, body) - .getFinalResult(); - } - - /** - * Creates or updates an Agent Deployment (asynchronous). - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param body Agent Deployment definition object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return agent Deployment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AgentDeploymentInner createOrUpdate(String resourceGroupName, String accountName, String projectName, - String appName, String deploymentName, AgentDeploymentInner body, Context context) { - return beginCreateOrUpdate(resourceGroupName, accountName, projectName, appName, deploymentName, body, context) - .getFinalResult(); - } - - /** - * Delete Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName, String appName, String deploymentName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, deploymentName, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, String projectName, - String appName, String deploymentName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, deploymentName, - Context.NONE); - } - - /** - * Delete Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, - String appName, String deploymentName, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, deploymentName, - context); - } - - /** - * Delete Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName, String appName, String deploymentName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, accountName, projectName, appName, deploymentName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Delete Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName, String appName, String deploymentName) { - Response response - = deleteWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Delete Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String projectName, String appName, String deploymentName, Context context) { - Response response - = deleteWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Delete Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String projectName, String appName, - String deploymentName) { - return beginDeleteAsync(resourceGroupName, accountName, projectName, appName, deploymentName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String projectName, String appName, - String deploymentName) { - beginDelete(resourceGroupName, accountName, projectName, appName, deploymentName).getFinalResult(); - } - - /** - * Delete Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String projectName, String appName, - String deploymentName, Context context) { - beginDelete(resourceGroupName, accountName, projectName, appName, deploymentName, context).getFinalResult(); - } - - /** - * Lists Agent Deployments in the application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param count Number of agent deployments to be retrieved in a page of results. - * @param skipToken Continuation token for pagination. - * @param names Names of agent deployments to retrieve. - * @param orderBy Field to order by. - * @param orderByAsc Whether to order in ascending order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Agent Deployment entities along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String accountName, - String projectName, String appName, Integer count, String skipToken, List names, String orderBy, - Boolean orderByAsc) { - final String accept = "application/json"; - List namesConverted = (names == null) - ? new ArrayList<>() - : names.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, count, skipToken, - namesConverted, orderBy, orderByAsc, 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 Agent Deployments in the application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param count Number of agent deployments to be retrieved in a page of results. - * @param skipToken Continuation token for pagination. - * @param names Names of agent deployments to retrieve. - * @param orderBy Field to order by. - * @param orderByAsc Whether to order in ascending order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Agent Deployment entities as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName, String projectName, - String appName, Integer count, String skipToken, List names, String orderBy, Boolean orderByAsc) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, projectName, appName, count, - skipToken, names, orderBy, orderByAsc), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists Agent Deployments in the application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Agent Deployment entities as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName, String projectName, - String appName) { - final Integer count = null; - final String skipToken = null; - final List names = null; - final String orderBy = null; - final Boolean orderByAsc = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, projectName, appName, count, - skipToken, names, orderBy, orderByAsc), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists Agent Deployments in the application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param count Number of agent deployments to be retrieved in a page of results. - * @param skipToken Continuation token for pagination. - * @param names Names of agent deployments to retrieve. - * @param orderBy Field to order by. - * @param orderByAsc Whether to order in ascending order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Agent Deployment entities along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - String projectName, String appName, Integer count, String skipToken, List names, String orderBy, - Boolean orderByAsc) { - final String accept = "application/json"; - List namesConverted = (names == null) - ? new ArrayList<>() - : names.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - Response res = service.listSync(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, - appName, count, skipToken, namesConverted, orderBy, orderByAsc, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists Agent Deployments in the application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param count Number of agent deployments to be retrieved in a page of results. - * @param skipToken Continuation token for pagination. - * @param names Names of agent deployments to retrieve. - * @param orderBy Field to order by. - * @param orderByAsc Whether to order in ascending order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Agent Deployment entities along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - String projectName, String appName, Integer count, String skipToken, List names, String orderBy, - Boolean orderByAsc, Context context) { - final String accept = "application/json"; - List namesConverted = (names == null) - ? new ArrayList<>() - : names.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - Response res = service.listSync(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, - appName, count, skipToken, namesConverted, orderBy, orderByAsc, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists Agent Deployments in the application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Agent Deployment entities as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, String projectName, - String appName) { - final Integer count = null; - final String skipToken = null; - final List names = null; - final String orderBy = null; - final Boolean orderByAsc = null; - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, projectName, appName, count, - skipToken, names, orderBy, orderByAsc), nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Lists Agent Deployments in the application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param count Number of agent deployments to be retrieved in a page of results. - * @param skipToken Continuation token for pagination. - * @param names Names of agent deployments to retrieve. - * @param orderBy Field to order by. - * @param orderByAsc Whether to order in ascending order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Agent Deployment entities as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, String projectName, - String appName, Integer count, String skipToken, List names, String orderBy, Boolean orderByAsc, - Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, projectName, appName, count, - skipToken, names, orderBy, orderByAsc, context), nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Starts an Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName, String appName, String deploymentName) { - return FluxUtil - .withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, deploymentName, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Starts an Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String projectName, String appName, - String deploymentName) { - return startWithResponseAsync(resourceGroupName, accountName, projectName, appName, deploymentName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Starts an Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response startWithResponse(String resourceGroupName, String accountName, String projectName, - String appName, String deploymentName, Context context) { - return service.startSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, deploymentName, - context); - } - - /** - * Starts an Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String projectName, String appName, - String deploymentName) { - startWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, Context.NONE); - } - - /** - * Stops an Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, String projectName, - String appName, String deploymentName) { - return FluxUtil - .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, deploymentName, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Stops an Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String projectName, String appName, - String deploymentName) { - return stopWithResponseAsync(resourceGroupName, accountName, projectName, appName, deploymentName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Stops an Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopWithResponse(String resourceGroupName, String accountName, String projectName, - String appName, String deploymentName, Context context) { - return service.stopSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, projectName, appName, deploymentName, context); - } - - /** - * Stops an Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String projectName, String appName, - String deploymentName) { - stopWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, Context.NONE); - } - - /** - * Lists Agent Deployments in the application. - * - * 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 paginated list of Agent Deployment entities along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists Agent Deployments in the application. - * - * 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 paginated list of Agent Deployment entities along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists Agent Deployments in the application. - * - * 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 paginated list of Agent Deployment entities along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentsImpl.java deleted file mode 100644 index 595f1df8a293..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentsImpl.java +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.AgentDeploymentsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentDeploymentInner; -import com.azure.resourcemanager.cognitiveservices.models.AgentDeployment; -import com.azure.resourcemanager.cognitiveservices.models.AgentDeployments; -import java.util.List; - -public final class AgentDeploymentsImpl implements AgentDeployments { - private static final ClientLogger LOGGER = new ClientLogger(AgentDeploymentsImpl.class); - - private final AgentDeploymentsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public AgentDeploymentsImpl(AgentDeploymentsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, String projectName, - String appName, String deploymentName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AgentDeploymentImpl(inner.getValue(), this.manager())); - } - - public AgentDeployment get(String resourceGroupName, String accountName, String projectName, String appName, - String deploymentName) { - AgentDeploymentInner inner - = this.serviceClient().get(resourceGroupName, accountName, projectName, appName, deploymentName); - if (inner != null) { - return new AgentDeploymentImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String accountName, String projectName, String appName, - String deploymentName) { - this.serviceClient().delete(resourceGroupName, accountName, projectName, appName, deploymentName); - } - - public void delete(String resourceGroupName, String accountName, String projectName, String appName, - String deploymentName, Context context) { - this.serviceClient().delete(resourceGroupName, accountName, projectName, appName, deploymentName, context); - } - - public PagedIterable list(String resourceGroupName, String accountName, String projectName, - String appName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName, projectName, appName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AgentDeploymentImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, String projectName, - String appName, Integer count, String skipToken, List names, String orderBy, Boolean orderByAsc, - Context context) { - PagedIterable inner = this.serviceClient() - .list(resourceGroupName, accountName, projectName, appName, count, skipToken, names, orderBy, orderByAsc, - context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AgentDeploymentImpl(inner1, this.manager())); - } - - public Response startWithResponse(String resourceGroupName, String accountName, String projectName, - String appName, String deploymentName, Context context) { - return this.serviceClient() - .startWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, context); - } - - public void start(String resourceGroupName, String accountName, String projectName, String appName, - String deploymentName) { - this.serviceClient().start(resourceGroupName, accountName, projectName, appName, deploymentName); - } - - public Response stopWithResponse(String resourceGroupName, String accountName, String projectName, - String appName, String deploymentName, Context context) { - return this.serviceClient() - .stopWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, context); - } - - public void stop(String resourceGroupName, String accountName, String projectName, String appName, - String deploymentName) { - this.serviceClient().stop(resourceGroupName, accountName, projectName, appName, deploymentName); - } - - public AgentDeployment 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String appName = ResourceManagerUtils.getValueFromIdByName(id, "applications"); - if (appName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); - } - String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "agentDeployments"); - if (deploymentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'agentDeployments'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String appName = ResourceManagerUtils.getValueFromIdByName(id, "applications"); - if (appName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); - } - String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "agentDeployments"); - if (deploymentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'agentDeployments'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String appName = ResourceManagerUtils.getValueFromIdByName(id, "applications"); - if (appName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); - } - String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "agentDeployments"); - if (deploymentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'agentDeployments'.", id))); - } - this.delete(resourceGroupName, accountName, projectName, appName, deploymentName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String appName = ResourceManagerUtils.getValueFromIdByName(id, "applications"); - if (appName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); - } - String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "agentDeployments"); - if (deploymentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'agentDeployments'.", id))); - } - this.delete(resourceGroupName, accountName, projectName, appName, deploymentName, context); - } - - private AgentDeploymentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public AgentDeploymentImpl define(String name) { - return new AgentDeploymentImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentReferenceResourceArmPaginatedResultImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentReferenceResourceArmPaginatedResultImpl.java deleted file mode 100644 index 0d50f9e15b49..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentReferenceResourceArmPaginatedResultImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentReferenceResourceArmPaginatedResultInner; -import com.azure.resourcemanager.cognitiveservices.models.AgentReference; -import com.azure.resourcemanager.cognitiveservices.models.AgentReferenceResourceArmPaginatedResult; -import java.util.Collections; -import java.util.List; - -public final class AgentReferenceResourceArmPaginatedResultImpl implements AgentReferenceResourceArmPaginatedResult { - private AgentReferenceResourceArmPaginatedResultInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - AgentReferenceResourceArmPaginatedResultImpl(AgentReferenceResourceArmPaginatedResultInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String nextLink() { - return this.innerModel().nextLink(); - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public AgentReferenceResourceArmPaginatedResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ApiKeysImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ApiKeysImpl.java deleted file mode 100644 index 6b9b6c2563c8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ApiKeysImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.ApiKeysInner; -import com.azure.resourcemanager.cognitiveservices.models.ApiKeys; - -public final class ApiKeysImpl implements ApiKeys { - private ApiKeysInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - ApiKeysImpl(ApiKeysInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String key1() { - return this.innerModel().key1(); - } - - public String key2() { - return this.innerModel().key2(); - } - - public ApiKeysInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CalculateModelCapacityResultImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CalculateModelCapacityResultImpl.java deleted file mode 100644 index cf00eb713d00..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CalculateModelCapacityResultImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.CalculateModelCapacityResultInner; -import com.azure.resourcemanager.cognitiveservices.models.CalculateModelCapacityResult; -import com.azure.resourcemanager.cognitiveservices.models.CalculateModelCapacityResultEstimatedCapacity; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentModel; - -public final class CalculateModelCapacityResultImpl implements CalculateModelCapacityResult { - private CalculateModelCapacityResultInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - CalculateModelCapacityResultImpl(CalculateModelCapacityResultInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public DeploymentModel model() { - return this.innerModel().model(); - } - - public String skuName() { - return this.innerModel().skuName(); - } - - public CalculateModelCapacityResultEstimatedCapacity estimatedCapacity() { - return this.innerModel().estimatedCapacity(); - } - - public CalculateModelCapacityResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CapabilityHostImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CapabilityHostImpl.java deleted file mode 100644 index 0a6e59233ec0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CapabilityHostImpl.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; -import com.azure.resourcemanager.cognitiveservices.models.CapabilityHost; -import com.azure.resourcemanager.cognitiveservices.models.CapabilityHostProperties; - -public final class CapabilityHostImpl implements CapabilityHost, CapabilityHost.Definition, CapabilityHost.Update { - private CapabilityHostInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public CapabilityHostProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public CapabilityHostInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - private String capabilityHostName; - - public CapabilityHostImpl withExistingAccount(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - public CapabilityHost create() { - this.innerObject = serviceManager.serviceClient() - .getAccountCapabilityHosts() - .createOrUpdate(resourceGroupName, accountName, capabilityHostName, this.innerModel(), Context.NONE); - return this; - } - - public CapabilityHost create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAccountCapabilityHosts() - .createOrUpdate(resourceGroupName, accountName, capabilityHostName, this.innerModel(), context); - return this; - } - - CapabilityHostImpl(String name, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new CapabilityHostInner(); - this.serviceManager = serviceManager; - this.capabilityHostName = name; - } - - public CapabilityHostImpl update() { - return this; - } - - public CapabilityHost apply() { - this.innerObject = serviceManager.serviceClient() - .getAccountCapabilityHosts() - .createOrUpdate(resourceGroupName, accountName, capabilityHostName, this.innerModel(), Context.NONE); - return this; - } - - public CapabilityHost apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAccountCapabilityHosts() - .createOrUpdate(resourceGroupName, accountName, capabilityHostName, this.innerModel(), context); - return this; - } - - CapabilityHostImpl(CapabilityHostInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.capabilityHostName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "capabilityHosts"); - } - - public CapabilityHost refresh() { - this.innerObject = serviceManager.serviceClient() - .getAccountCapabilityHosts() - .getWithResponse(resourceGroupName, accountName, capabilityHostName, Context.NONE) - .getValue(); - return this; - } - - public CapabilityHost refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAccountCapabilityHosts() - .getWithResponse(resourceGroupName, accountName, capabilityHostName, context) - .getValue(); - return this; - } - - public CapabilityHostImpl withProperties(CapabilityHostProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientBuilder.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientBuilder.java deleted file mode 100644 index 647cb160abe7..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientBuilder.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 CognitiveServicesManagementClientImpl type. - */ -@ServiceClientBuilder(serviceClients = { CognitiveServicesManagementClientImpl.class }) -public final class CognitiveServicesManagementClientBuilder { - /* - * Service host - */ - private String endpoint; - - /** - * Sets Service host. - * - * @param endpoint the endpoint value. - * @return the CognitiveServicesManagementClientBuilder. - */ - public CognitiveServicesManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The ID of the target subscription. The value must be an UUID. - */ - private String subscriptionId; - - /** - * Sets The ID of the target subscription. The value must be an UUID. - * - * @param subscriptionId the subscriptionId value. - * @return the CognitiveServicesManagementClientBuilder. - */ - public CognitiveServicesManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the CognitiveServicesManagementClientBuilder. - */ - public CognitiveServicesManagementClientBuilder 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 CognitiveServicesManagementClientBuilder. - */ - public CognitiveServicesManagementClientBuilder 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 CognitiveServicesManagementClientBuilder. - */ - public CognitiveServicesManagementClientBuilder 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 CognitiveServicesManagementClientBuilder. - */ - public CognitiveServicesManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of CognitiveServicesManagementClientImpl with the provided parameters. - * - * @return an instance of CognitiveServicesManagementClientImpl. - */ - public CognitiveServicesManagementClientImpl 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(); - CognitiveServicesManagementClientImpl client = new CognitiveServicesManagementClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); - return client; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientImpl.java deleted file mode 100644 index 600916975fca..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientImpl.java +++ /dev/null @@ -1,1012 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.Response; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.exception.ManagementError; -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.cognitiveservices.fluent.AccountCapabilityHostsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.AccountConnectionsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.AgentApplicationsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.AgentDeploymentsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.CognitiveServicesManagementClient; -import com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient; -import com.azure.resourcemanager.cognitiveservices.fluent.CommitmentTiersClient; -import com.azure.resourcemanager.cognitiveservices.fluent.ComputeOperationsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.ComputesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.DefenderForAISettingsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.DeletedAccountsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.DeploymentsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.EncryptionScopesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.LocationBasedModelCapacitiesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.ManagedComputeCapacitiesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.ManagedComputeDeploymentsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.ManagedComputeUsagesOperationGroupsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkProvisionsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkSettingsOperationsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.ModelCapacitiesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.ModelsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.NetworkSecurityPerimeterConfigurationsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.OperationsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.OutboundRulesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.OutboundRulesOperationsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.ProjectCapabilityHostsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.ProjectConnectionsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.ProjectsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.QuotaTiersClient; -import com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistItemsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.RaiContentFiltersClient; -import com.azure.resourcemanager.cognitiveservices.fluent.RaiExternalSafetyProvidersClient; -import com.azure.resourcemanager.cognitiveservices.fluent.RaiExternalSafetyProvidersOperationsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.RaiPoliciesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.RaiToolLabelsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.RaiTopicsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.ResourceProvidersClient; -import com.azure.resourcemanager.cognitiveservices.fluent.ResourceSkusClient; -import com.azure.resourcemanager.cognitiveservices.fluent.SubscriptionRaiPoliciesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.TestRaiExternalSafetyProvidersClient; -import com.azure.resourcemanager.cognitiveservices.fluent.UsagesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.WorkbenchesClient; -import java.io.IOException; -import java.lang.reflect.Type; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the CognitiveServicesManagementClientImpl type. - */ -@ServiceClient(builder = CognitiveServicesManagementClientBuilder.class) -public final class CognitiveServicesManagementClientImpl implements CognitiveServicesManagementClient { - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - * Version parameter. - */ - private final String apiVersion; - - /** - * Gets Version parameter. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** - * The ID of the target subscription. The value must be an UUID. - */ - 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. - */ - 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 ResourceProvidersClient object to access its operations. - */ - private final ResourceProvidersClient resourceProviders; - - /** - * Gets the ResourceProvidersClient object to access its operations. - * - * @return the ResourceProvidersClient object. - */ - public ResourceProvidersClient getResourceProviders() { - return this.resourceProviders; - } - - /** - * The OperationsClient object to access its operations. - */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** - * The AccountsClient object to access its operations. - */ - private final AccountsClient accounts; - - /** - * Gets the AccountsClient object to access its operations. - * - * @return the AccountsClient object. - */ - public AccountsClient getAccounts() { - return this.accounts; - } - - /** - * The DeletedAccountsClient object to access its operations. - */ - private final DeletedAccountsClient deletedAccounts; - - /** - * Gets the DeletedAccountsClient object to access its operations. - * - * @return the DeletedAccountsClient object. - */ - public DeletedAccountsClient getDeletedAccounts() { - return this.deletedAccounts; - } - - /** - * The PrivateEndpointConnectionsClient object to access its operations. - */ - private final PrivateEndpointConnectionsClient privateEndpointConnections; - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** - * The DeploymentsClient object to access its operations. - */ - private final DeploymentsClient deployments; - - /** - * Gets the DeploymentsClient object to access its operations. - * - * @return the DeploymentsClient object. - */ - public DeploymentsClient getDeployments() { - return this.deployments; - } - - /** - * The CommitmentPlansClient object to access its operations. - */ - private final CommitmentPlansClient commitmentPlans; - - /** - * Gets the CommitmentPlansClient object to access its operations. - * - * @return the CommitmentPlansClient object. - */ - public CommitmentPlansClient getCommitmentPlans() { - return this.commitmentPlans; - } - - /** - * The EncryptionScopesClient object to access its operations. - */ - private final EncryptionScopesClient encryptionScopes; - - /** - * Gets the EncryptionScopesClient object to access its operations. - * - * @return the EncryptionScopesClient object. - */ - public EncryptionScopesClient getEncryptionScopes() { - return this.encryptionScopes; - } - - /** - * The RaiPoliciesClient object to access its operations. - */ - private final RaiPoliciesClient raiPolicies; - - /** - * Gets the RaiPoliciesClient object to access its operations. - * - * @return the RaiPoliciesClient object. - */ - public RaiPoliciesClient getRaiPolicies() { - return this.raiPolicies; - } - - /** - * The SubscriptionRaiPoliciesClient object to access its operations. - */ - private final SubscriptionRaiPoliciesClient subscriptionRaiPolicies; - - /** - * Gets the SubscriptionRaiPoliciesClient object to access its operations. - * - * @return the SubscriptionRaiPoliciesClient object. - */ - public SubscriptionRaiPoliciesClient getSubscriptionRaiPolicies() { - return this.subscriptionRaiPolicies; - } - - /** - * The RaiBlocklistItemsClient object to access its operations. - */ - private final RaiBlocklistItemsClient raiBlocklistItems; - - /** - * Gets the RaiBlocklistItemsClient object to access its operations. - * - * @return the RaiBlocklistItemsClient object. - */ - public RaiBlocklistItemsClient getRaiBlocklistItems() { - return this.raiBlocklistItems; - } - - /** - * The RaiBlocklistsClient object to access its operations. - */ - private final RaiBlocklistsClient raiBlocklists; - - /** - * Gets the RaiBlocklistsClient object to access its operations. - * - * @return the RaiBlocklistsClient object. - */ - public RaiBlocklistsClient getRaiBlocklists() { - return this.raiBlocklists; - } - - /** - * The RaiTopicsClient object to access its operations. - */ - private final RaiTopicsClient raiTopics; - - /** - * Gets the RaiTopicsClient object to access its operations. - * - * @return the RaiTopicsClient object. - */ - public RaiTopicsClient getRaiTopics() { - return this.raiTopics; - } - - /** - * The RaiToolLabelsClient object to access its operations. - */ - private final RaiToolLabelsClient raiToolLabels; - - /** - * Gets the RaiToolLabelsClient object to access its operations. - * - * @return the RaiToolLabelsClient object. - */ - public RaiToolLabelsClient getRaiToolLabels() { - return this.raiToolLabels; - } - - /** - * The RaiContentFiltersClient object to access its operations. - */ - private final RaiContentFiltersClient raiContentFilters; - - /** - * Gets the RaiContentFiltersClient object to access its operations. - * - * @return the RaiContentFiltersClient object. - */ - public RaiContentFiltersClient getRaiContentFilters() { - return this.raiContentFilters; - } - - /** - * The NetworkSecurityPerimeterConfigurationsClient object to access its operations. - */ - private final NetworkSecurityPerimeterConfigurationsClient networkSecurityPerimeterConfigurations; - - /** - * Gets the NetworkSecurityPerimeterConfigurationsClient object to access its operations. - * - * @return the NetworkSecurityPerimeterConfigurationsClient object. - */ - public NetworkSecurityPerimeterConfigurationsClient getNetworkSecurityPerimeterConfigurations() { - return this.networkSecurityPerimeterConfigurations; - } - - /** - * The DefenderForAISettingsClient object to access its operations. - */ - private final DefenderForAISettingsClient defenderForAISettings; - - /** - * Gets the DefenderForAISettingsClient object to access its operations. - * - * @return the DefenderForAISettingsClient object. - */ - public DefenderForAISettingsClient getDefenderForAISettings() { - return this.defenderForAISettings; - } - - /** - * The ProjectsClient object to access its operations. - */ - private final ProjectsClient projects; - - /** - * Gets the ProjectsClient object to access its operations. - * - * @return the ProjectsClient object. - */ - public ProjectsClient getProjects() { - return this.projects; - } - - /** - * The ProjectConnectionsClient object to access its operations. - */ - private final ProjectConnectionsClient projectConnections; - - /** - * Gets the ProjectConnectionsClient object to access its operations. - * - * @return the ProjectConnectionsClient object. - */ - public ProjectConnectionsClient getProjectConnections() { - return this.projectConnections; - } - - /** - * The ProjectCapabilityHostsClient object to access its operations. - */ - private final ProjectCapabilityHostsClient projectCapabilityHosts; - - /** - * Gets the ProjectCapabilityHostsClient object to access its operations. - * - * @return the ProjectCapabilityHostsClient object. - */ - public ProjectCapabilityHostsClient getProjectCapabilityHosts() { - return this.projectCapabilityHosts; - } - - /** - * The QuotaTiersClient object to access its operations. - */ - private final QuotaTiersClient quotaTiers; - - /** - * Gets the QuotaTiersClient object to access its operations. - * - * @return the QuotaTiersClient object. - */ - public QuotaTiersClient getQuotaTiers() { - return this.quotaTiers; - } - - /** - * The AgentApplicationsClient object to access its operations. - */ - private final AgentApplicationsClient agentApplications; - - /** - * Gets the AgentApplicationsClient object to access its operations. - * - * @return the AgentApplicationsClient object. - */ - public AgentApplicationsClient getAgentApplications() { - return this.agentApplications; - } - - /** - * The ManagedComputeDeploymentsClient object to access its operations. - */ - private final ManagedComputeDeploymentsClient managedComputeDeployments; - - /** - * Gets the ManagedComputeDeploymentsClient object to access its operations. - * - * @return the ManagedComputeDeploymentsClient object. - */ - public ManagedComputeDeploymentsClient getManagedComputeDeployments() { - return this.managedComputeDeployments; - } - - /** - * The ComputeOperationsClient object to access its operations. - */ - private final ComputeOperationsClient computeOperations; - - /** - * Gets the ComputeOperationsClient object to access its operations. - * - * @return the ComputeOperationsClient object. - */ - public ComputeOperationsClient getComputeOperations() { - return this.computeOperations; - } - - /** - * The ManagedComputeUsagesOperationGroupsClient object to access its operations. - */ - private final ManagedComputeUsagesOperationGroupsClient managedComputeUsagesOperationGroups; - - /** - * Gets the ManagedComputeUsagesOperationGroupsClient object to access its operations. - * - * @return the ManagedComputeUsagesOperationGroupsClient object. - */ - public ManagedComputeUsagesOperationGroupsClient getManagedComputeUsagesOperationGroups() { - return this.managedComputeUsagesOperationGroups; - } - - /** - * The ComputesClient object to access its operations. - */ - private final ComputesClient computes; - - /** - * Gets the ComputesClient object to access its operations. - * - * @return the ComputesClient object. - */ - public ComputesClient getComputes() { - return this.computes; - } - - /** - * The WorkbenchesClient object to access its operations. - */ - private final WorkbenchesClient workbenches; - - /** - * Gets the WorkbenchesClient object to access its operations. - * - * @return the WorkbenchesClient object. - */ - public WorkbenchesClient getWorkbenches() { - return this.workbenches; - } - - /** - * The ManagedComputeCapacitiesClient object to access its operations. - */ - private final ManagedComputeCapacitiesClient managedComputeCapacities; - - /** - * Gets the ManagedComputeCapacitiesClient object to access its operations. - * - * @return the ManagedComputeCapacitiesClient object. - */ - public ManagedComputeCapacitiesClient getManagedComputeCapacities() { - return this.managedComputeCapacities; - } - - /** - * The PrivateLinkResourcesClient object to access its operations. - */ - private final PrivateLinkResourcesClient privateLinkResources; - - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - public PrivateLinkResourcesClient getPrivateLinkResources() { - return this.privateLinkResources; - } - - /** - * The TestRaiExternalSafetyProvidersClient object to access its operations. - */ - private final TestRaiExternalSafetyProvidersClient testRaiExternalSafetyProviders; - - /** - * Gets the TestRaiExternalSafetyProvidersClient object to access its operations. - * - * @return the TestRaiExternalSafetyProvidersClient object. - */ - public TestRaiExternalSafetyProvidersClient getTestRaiExternalSafetyProviders() { - return this.testRaiExternalSafetyProviders; - } - - /** - * The RaiExternalSafetyProvidersClient object to access its operations. - */ - private final RaiExternalSafetyProvidersClient raiExternalSafetyProviders; - - /** - * Gets the RaiExternalSafetyProvidersClient object to access its operations. - * - * @return the RaiExternalSafetyProvidersClient object. - */ - public RaiExternalSafetyProvidersClient getRaiExternalSafetyProviders() { - return this.raiExternalSafetyProviders; - } - - /** - * The RaiExternalSafetyProvidersOperationsClient object to access its operations. - */ - private final RaiExternalSafetyProvidersOperationsClient raiExternalSafetyProvidersOperations; - - /** - * Gets the RaiExternalSafetyProvidersOperationsClient object to access its operations. - * - * @return the RaiExternalSafetyProvidersOperationsClient object. - */ - public RaiExternalSafetyProvidersOperationsClient getRaiExternalSafetyProvidersOperations() { - return this.raiExternalSafetyProvidersOperations; - } - - /** - * The AccountConnectionsClient object to access its operations. - */ - private final AccountConnectionsClient accountConnections; - - /** - * Gets the AccountConnectionsClient object to access its operations. - * - * @return the AccountConnectionsClient object. - */ - public AccountConnectionsClient getAccountConnections() { - return this.accountConnections; - } - - /** - * The AccountCapabilityHostsClient object to access its operations. - */ - private final AccountCapabilityHostsClient accountCapabilityHosts; - - /** - * Gets the AccountCapabilityHostsClient object to access its operations. - * - * @return the AccountCapabilityHostsClient object. - */ - public AccountCapabilityHostsClient getAccountCapabilityHosts() { - return this.accountCapabilityHosts; - } - - /** - * The OutboundRulesClient object to access its operations. - */ - private final OutboundRulesClient outboundRules; - - /** - * Gets the OutboundRulesClient object to access its operations. - * - * @return the OutboundRulesClient object. - */ - public OutboundRulesClient getOutboundRules() { - return this.outboundRules; - } - - /** - * The ManagedNetworkSettingsOperationsClient object to access its operations. - */ - private final ManagedNetworkSettingsOperationsClient managedNetworkSettingsOperations; - - /** - * Gets the ManagedNetworkSettingsOperationsClient object to access its operations. - * - * @return the ManagedNetworkSettingsOperationsClient object. - */ - public ManagedNetworkSettingsOperationsClient getManagedNetworkSettingsOperations() { - return this.managedNetworkSettingsOperations; - } - - /** - * The OutboundRulesOperationsClient object to access its operations. - */ - private final OutboundRulesOperationsClient outboundRulesOperations; - - /** - * Gets the OutboundRulesOperationsClient object to access its operations. - * - * @return the OutboundRulesOperationsClient object. - */ - public OutboundRulesOperationsClient getOutboundRulesOperations() { - return this.outboundRulesOperations; - } - - /** - * The ManagedNetworkProvisionsClient object to access its operations. - */ - private final ManagedNetworkProvisionsClient managedNetworkProvisions; - - /** - * Gets the ManagedNetworkProvisionsClient object to access its operations. - * - * @return the ManagedNetworkProvisionsClient object. - */ - public ManagedNetworkProvisionsClient getManagedNetworkProvisions() { - return this.managedNetworkProvisions; - } - - /** - * The AgentDeploymentsClient object to access its operations. - */ - private final AgentDeploymentsClient agentDeployments; - - /** - * Gets the AgentDeploymentsClient object to access its operations. - * - * @return the AgentDeploymentsClient object. - */ - public AgentDeploymentsClient getAgentDeployments() { - return this.agentDeployments; - } - - /** - * The ResourceSkusClient object to access its operations. - */ - private final ResourceSkusClient resourceSkus; - - /** - * Gets the ResourceSkusClient object to access its operations. - * - * @return the ResourceSkusClient object. - */ - public ResourceSkusClient getResourceSkus() { - return this.resourceSkus; - } - - /** - * The UsagesClient object to access its operations. - */ - private final UsagesClient usages; - - /** - * Gets the UsagesClient object to access its operations. - * - * @return the UsagesClient object. - */ - public UsagesClient getUsages() { - return this.usages; - } - - /** - * The CommitmentTiersClient object to access its operations. - */ - private final CommitmentTiersClient commitmentTiers; - - /** - * Gets the CommitmentTiersClient object to access its operations. - * - * @return the CommitmentTiersClient object. - */ - public CommitmentTiersClient getCommitmentTiers() { - return this.commitmentTiers; - } - - /** - * The ModelsClient object to access its operations. - */ - private final ModelsClient models; - - /** - * Gets the ModelsClient object to access its operations. - * - * @return the ModelsClient object. - */ - public ModelsClient getModels() { - return this.models; - } - - /** - * The LocationBasedModelCapacitiesClient object to access its operations. - */ - private final LocationBasedModelCapacitiesClient locationBasedModelCapacities; - - /** - * Gets the LocationBasedModelCapacitiesClient object to access its operations. - * - * @return the LocationBasedModelCapacitiesClient object. - */ - public LocationBasedModelCapacitiesClient getLocationBasedModelCapacities() { - return this.locationBasedModelCapacities; - } - - /** - * The ModelCapacitiesClient object to access its operations. - */ - private final ModelCapacitiesClient modelCapacities; - - /** - * Gets the ModelCapacitiesClient object to access its operations. - * - * @return the ModelCapacitiesClient object. - */ - public ModelCapacitiesClient getModelCapacities() { - return this.modelCapacities; - } - - /** - * Initializes an instance of CognitiveServicesManagementClient 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 endpoint Service host. - * @param subscriptionId The ID of the target subscription. The value must be an UUID. - */ - CognitiveServicesManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.endpoint = endpoint; - this.subscriptionId = subscriptionId; - this.apiVersion = "2026-05-15-preview"; - this.resourceProviders = new ResourceProvidersClientImpl(this); - this.operations = new OperationsClientImpl(this); - this.accounts = new AccountsClientImpl(this); - this.deletedAccounts = new DeletedAccountsClientImpl(this); - this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); - this.deployments = new DeploymentsClientImpl(this); - this.commitmentPlans = new CommitmentPlansClientImpl(this); - this.encryptionScopes = new EncryptionScopesClientImpl(this); - this.raiPolicies = new RaiPoliciesClientImpl(this); - this.subscriptionRaiPolicies = new SubscriptionRaiPoliciesClientImpl(this); - this.raiBlocklistItems = new RaiBlocklistItemsClientImpl(this); - this.raiBlocklists = new RaiBlocklistsClientImpl(this); - this.raiTopics = new RaiTopicsClientImpl(this); - this.raiToolLabels = new RaiToolLabelsClientImpl(this); - this.raiContentFilters = new RaiContentFiltersClientImpl(this); - this.networkSecurityPerimeterConfigurations = new NetworkSecurityPerimeterConfigurationsClientImpl(this); - this.defenderForAISettings = new DefenderForAISettingsClientImpl(this); - this.projects = new ProjectsClientImpl(this); - this.projectConnections = new ProjectConnectionsClientImpl(this); - this.projectCapabilityHosts = new ProjectCapabilityHostsClientImpl(this); - this.quotaTiers = new QuotaTiersClientImpl(this); - this.agentApplications = new AgentApplicationsClientImpl(this); - this.managedComputeDeployments = new ManagedComputeDeploymentsClientImpl(this); - this.computeOperations = new ComputeOperationsClientImpl(this); - this.managedComputeUsagesOperationGroups = new ManagedComputeUsagesOperationGroupsClientImpl(this); - this.computes = new ComputesClientImpl(this); - this.workbenches = new WorkbenchesClientImpl(this); - this.managedComputeCapacities = new ManagedComputeCapacitiesClientImpl(this); - this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); - this.testRaiExternalSafetyProviders = new TestRaiExternalSafetyProvidersClientImpl(this); - this.raiExternalSafetyProviders = new RaiExternalSafetyProvidersClientImpl(this); - this.raiExternalSafetyProvidersOperations = new RaiExternalSafetyProvidersOperationsClientImpl(this); - this.accountConnections = new AccountConnectionsClientImpl(this); - this.accountCapabilityHosts = new AccountCapabilityHostsClientImpl(this); - this.outboundRules = new OutboundRulesClientImpl(this); - this.managedNetworkSettingsOperations = new ManagedNetworkSettingsOperationsClientImpl(this); - this.outboundRulesOperations = new OutboundRulesOperationsClientImpl(this); - this.managedNetworkProvisions = new ManagedNetworkProvisionsClientImpl(this); - this.agentDeployments = new AgentDeploymentsClientImpl(this); - this.resourceSkus = new ResourceSkusClientImpl(this); - this.usages = new UsagesClientImpl(this); - this.commitmentTiers = new CommitmentTiersClientImpl(this); - this.models = new ModelsClientImpl(this); - this.locationBasedModelCapacities = new LocationBasedModelCapacitiesClientImpl(this); - this.modelCapacities = new ModelCapacitiesClientImpl(this); - } - - /** - * Gets default client context. - * - * @return the default client context. - */ - public Context getContext() { - return Context.NONE; - } - - /** - * Merges default client context with provided context. - * - * @param context the context to be merged with default client context. - * @return the merged context. - */ - public Context mergeContext(Context context) { - return CoreUtils.mergeContexts(this.getContext(), context); - } - - /** - * Gets long running operation result. - * - * @param activationResponse the response of activation operation. - * @param httpPipeline the http pipeline. - * @param pollResultType type of poll result. - * @param finalResultType type of final result. - * @param context the context shared by all requests. - * @param type of poll result. - * @param type of final result. - * @return poller flux for poll result and final result. - */ - public PollerFlux, U> getLroResult(Mono>> activationResponse, - HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { - return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, - defaultPollInterval, activationResponse, context); - } - - /** - * Gets long running operation result. - * - * @param activationResponse the response of activation operation. - * @param pollResultType type of poll result. - * @param finalResultType type of final result. - * @param context the context shared by all requests. - * @param 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. - * - * @param response the last async poll response. - * @param type of poll result. - * @param type of final result. - * @return the final result, or an error. - */ - public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { - if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { - String errorMessage; - ManagementError managementError = null; - HttpResponse errorResponse = null; - PollResult.Error lroError = response.getValue().getError(); - if (lroError != null) { - errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), - lroError.getResponseBody()); - - errorMessage = response.getValue().getError().getMessage(); - String errorBody = response.getValue().getError().getResponseBody(); - if (errorBody != null) { - // try to deserialize error body to ManagementError - try { - managementError = this.getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); - if (managementError.getCode() == null || managementError.getMessage() == null) { - managementError = null; - } - } catch (IOException | RuntimeException ioe) { - LOGGER.logThrowableAsWarning(ioe); - } - } - } else { - // fallback to default error message - errorMessage = "Long running operation failed."; - } - if (managementError == null) { - // fallback to default ManagementError - managementError = new ManagementError(response.getStatus().toString(), errorMessage); - } - return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); - } else { - return response.getFinalResult(); - } - } - - private static final class HttpResponseImpl extends HttpResponse { - private final int statusCode; - - private final byte[] responseBody; - - private final HttpHeaders httpHeaders; - - HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { - super(null); - this.statusCode = statusCode; - this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? new byte[0] : responseBody.getBytes(StandardCharsets.UTF_8); - } - - public int getStatusCode() { - return statusCode; - } - - public String getHeaderValue(String s) { - return httpHeaders.getValue(HttpHeaderName.fromString(s)); - } - - public HttpHeaders getHeaders() { - return httpHeaders; - } - - public Flux getBody() { - return Flux.just(ByteBuffer.wrap(responseBody)); - } - - public Mono getBodyAsByteArray() { - return Mono.just(responseBody); - } - - public Mono getBodyAsString() { - return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); - } - - public Mono getBodyAsString(Charset charset) { - return Mono.just(new String(responseBody, charset)); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CognitiveServicesManagementClientImpl.class); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanAccountAssociationImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanAccountAssociationImpl.java deleted file mode 100644 index bce660372f43..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanAccountAssociationImpl.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanAccountAssociationInner; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanAccountAssociation; -import java.util.Collections; -import java.util.Map; - -public final class CommitmentPlanAccountAssociationImpl implements CommitmentPlanAccountAssociation, - CommitmentPlanAccountAssociation.Definition, CommitmentPlanAccountAssociation.Update { - private CommitmentPlanAccountAssociationInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String accountId() { - return this.innerModel().accountId(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public CommitmentPlanAccountAssociationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String commitmentPlanName; - - private String commitmentPlanAssociationName; - - public CommitmentPlanAccountAssociationImpl withExistingCommitmentPlan(String resourceGroupName, - String commitmentPlanName) { - this.resourceGroupName = resourceGroupName; - this.commitmentPlanName = commitmentPlanName; - return this; - } - - public CommitmentPlanAccountAssociation create() { - this.innerObject = serviceManager.serviceClient() - .getCommitmentPlans() - .createOrUpdateAssociation(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, - this.innerModel(), Context.NONE); - return this; - } - - public CommitmentPlanAccountAssociation create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getCommitmentPlans() - .createOrUpdateAssociation(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, - this.innerModel(), context); - return this; - } - - CommitmentPlanAccountAssociationImpl(String name, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new CommitmentPlanAccountAssociationInner(); - this.serviceManager = serviceManager; - this.commitmentPlanAssociationName = name; - } - - public CommitmentPlanAccountAssociationImpl update() { - return this; - } - - public CommitmentPlanAccountAssociation apply() { - this.innerObject = serviceManager.serviceClient() - .getCommitmentPlans() - .createOrUpdateAssociation(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, - this.innerModel(), Context.NONE); - return this; - } - - public CommitmentPlanAccountAssociation apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getCommitmentPlans() - .createOrUpdateAssociation(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, - this.innerModel(), context); - return this; - } - - CommitmentPlanAccountAssociationImpl(CommitmentPlanAccountAssociationInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.commitmentPlanName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "commitmentPlans"); - this.commitmentPlanAssociationName - = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accountAssociations"); - } - - public CommitmentPlanAccountAssociation refresh() { - this.innerObject = serviceManager.serviceClient() - .getCommitmentPlans() - .getAssociationWithResponse(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, - Context.NONE) - .getValue(); - return this; - } - - public CommitmentPlanAccountAssociation refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getCommitmentPlans() - .getAssociationWithResponse(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, context) - .getValue(); - return this; - } - - public CommitmentPlanAccountAssociationImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public CommitmentPlanAccountAssociationImpl withAccountId(String accountId) { - this.innerModel().withAccountId(accountId); - return this; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanImpl.java deleted file mode 100644 index 24ac924cf6f6..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanImpl.java +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlan; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanProperties; -import com.azure.resourcemanager.cognitiveservices.models.PatchResourceTagsAndSku; -import com.azure.resourcemanager.cognitiveservices.models.Sku; -import java.util.Collections; -import java.util.Map; - -public final class CommitmentPlanImpl implements CommitmentPlan, CommitmentPlan.Definition, CommitmentPlan.Update { - private CommitmentPlanInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public CommitmentPlanProperties properties() { - return this.innerModel().properties(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String location() { - return this.innerModel().location(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public String kind() { - return this.innerModel().kind(); - } - - public Sku sku() { - return this.innerModel().sku(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public CommitmentPlanInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String commitmentPlanName; - - private PatchResourceTagsAndSku updateCommitmentPlan; - - public CommitmentPlanImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public CommitmentPlan create() { - this.innerObject = serviceManager.serviceClient() - .getCommitmentPlans() - .createOrUpdatePlan(resourceGroupName, commitmentPlanName, this.innerModel(), Context.NONE); - return this; - } - - public CommitmentPlan create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getCommitmentPlans() - .createOrUpdatePlan(resourceGroupName, commitmentPlanName, this.innerModel(), context); - return this; - } - - CommitmentPlanImpl(String name, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new CommitmentPlanInner(); - this.serviceManager = serviceManager; - this.commitmentPlanName = name; - } - - public CommitmentPlanImpl update() { - this.updateCommitmentPlan = new PatchResourceTagsAndSku(); - return this; - } - - public CommitmentPlan apply() { - this.innerObject = serviceManager.serviceClient() - .getCommitmentPlans() - .updatePlan(resourceGroupName, commitmentPlanName, updateCommitmentPlan, Context.NONE); - return this; - } - - public CommitmentPlan apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getCommitmentPlans() - .updatePlan(resourceGroupName, commitmentPlanName, updateCommitmentPlan, context); - return this; - } - - CommitmentPlanImpl(CommitmentPlanInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.commitmentPlanName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "commitmentPlans"); - } - - public CommitmentPlan refresh() { - this.innerObject = serviceManager.serviceClient() - .getCommitmentPlans() - .getByResourceGroupWithResponse(resourceGroupName, commitmentPlanName, Context.NONE) - .getValue(); - return this; - } - - public CommitmentPlan refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getCommitmentPlans() - .getByResourceGroupWithResponse(resourceGroupName, commitmentPlanName, context) - .getValue(); - return this; - } - - public CommitmentPlanImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public CommitmentPlanImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public CommitmentPlanImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateCommitmentPlan.withTags(tags); - return this; - } - } - - public CommitmentPlanImpl withProperties(CommitmentPlanProperties properties) { - this.innerModel().withProperties(properties); - return this; - } - - public CommitmentPlanImpl withKind(String kind) { - this.innerModel().withKind(kind); - return this; - } - - public CommitmentPlanImpl withSku(Sku sku) { - if (isInCreateMode()) { - this.innerModel().withSku(sku); - return this; - } else { - this.updateCommitmentPlan.withSku(sku); - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel() == null || this.innerModel().id() == null; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansClientImpl.java deleted file mode 100644 index c6b352c9e4c1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansClientImpl.java +++ /dev/null @@ -1,2469 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.Patch; -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.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanAccountAssociationInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.CommitmentPlanAccountAssociationListResult; -import com.azure.resourcemanager.cognitiveservices.implementation.models.CommitmentPlanListResult; -import com.azure.resourcemanager.cognitiveservices.models.PatchResourceTagsAndSku; -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 CommitmentPlansClient. - */ -public final class CommitmentPlansClientImpl implements CommitmentPlansClient { - /** - * The proxy service used to perform REST calls. - */ - private final CommitmentPlansService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of CommitmentPlansClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CommitmentPlansClientImpl(CognitiveServicesManagementClientImpl client) { - this.service - = RestProxy.create(CommitmentPlansService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientCommitmentPlans to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientCommitmentPlans") - public interface CommitmentPlansService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Accept") String accept, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") CommitmentPlanInner commitmentPlan, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") CommitmentPlanInner commitmentPlan, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("commitmentPlanName") String commitmentPlanName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("commitmentPlanName") String commitmentPlanName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Accept") String accept, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdatePlan(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") CommitmentPlanInner commitmentPlan, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdatePlanSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") CommitmentPlanInner commitmentPlan, - Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updatePlan(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") PatchResourceTagsAndSku commitmentPlan, - Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updatePlanSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") PatchResourceTagsAndSku commitmentPlan, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deletePlan(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deletePlanSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - 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" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - 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" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/commitmentPlans") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listPlansBySubscription(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/commitmentPlans") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listPlansBySubscriptionSync(@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.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAssociation(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, - @PathParam("commitmentPlanAssociationName") String commitmentPlanAssociationName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getAssociationSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, - @PathParam("commitmentPlanAssociationName") String commitmentPlanAssociationName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdateAssociation(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, - @PathParam("commitmentPlanAssociationName") String commitmentPlanAssociationName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") CommitmentPlanAccountAssociationInner association, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateAssociationSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, - @PathParam("commitmentPlanAssociationName") String commitmentPlanAssociationName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") CommitmentPlanAccountAssociationInner association, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteAssociation(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, - @PathParam("commitmentPlanAssociationName") String commitmentPlanAssociationName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteAssociationSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, - @PathParam("commitmentPlanAssociationName") String commitmentPlanAssociationName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAssociations( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listAssociationsSync( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listPlansByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listPlansByResourceGroupNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listPlansBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listPlansBySubscriptionNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAssociationsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listAssociationsNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the specified commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 commitmentPlans associated with the Cognitive Services account along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String accountName, - String commitmentPlanName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, commitmentPlanName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 commitmentPlans associated with the Cognitive Services account on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, - String commitmentPlanName) { - return getWithResponseAsync(resourceGroupName, accountName, commitmentPlanName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the specified commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services 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 specified commitmentPlans associated with the Cognitive Services account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, - String commitmentPlanName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, commitmentPlanName, accept, context); - } - - /** - * Gets the specified commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 commitmentPlans associated with the Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CommitmentPlanInner get(String resourceGroupName, String accountName, String commitmentPlanName) { - return getWithResponse(resourceGroupName, accountName, commitmentPlanName, Context.NONE).getValue(); - } - - /** - * Update the state of specified commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The commitmentPlan 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 cognitive Services account commitment plan along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String accountName, String commitmentPlanName, CommitmentPlanInner commitmentPlan) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, commitmentPlanName, contentType, - accept, commitmentPlan, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the state of specified commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The commitmentPlan 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 cognitive Services account commitment plan on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, - String commitmentPlanName, CommitmentPlanInner commitmentPlan) { - return createOrUpdateWithResponseAsync(resourceGroupName, accountName, commitmentPlanName, commitmentPlan) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Update the state of specified commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The commitmentPlan 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 cognitive Services account commitment plan along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String commitmentPlanName, CommitmentPlanInner commitmentPlan, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, commitmentPlanName, contentType, accept, - commitmentPlan, context); - } - - /** - * Update the state of specified commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The commitmentPlan 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 cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CommitmentPlanInner createOrUpdate(String resourceGroupName, String accountName, String commitmentPlanName, - CommitmentPlanInner commitmentPlan) { - return createOrUpdateWithResponse(resourceGroupName, accountName, commitmentPlanName, commitmentPlan, - Context.NONE).getValue(); - } - - /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String commitmentPlanName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, commitmentPlanName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String commitmentPlanName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, commitmentPlanName, Context.NONE); - } - - /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String accountName, - String commitmentPlanName, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, commitmentPlanName, context); - } - - /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String commitmentPlanName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, accountName, commitmentPlanName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String commitmentPlanName) { - Response response = deleteWithResponse(resourceGroupName, accountName, commitmentPlanName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String commitmentPlanName, Context context) { - Response response = deleteWithResponse(resourceGroupName, accountName, commitmentPlanName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String commitmentPlanName) { - return beginDeleteAsync(resourceGroupName, accountName, commitmentPlanName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String commitmentPlanName) { - beginDelete(resourceGroupName, accountName, commitmentPlanName).getFinalResult(); - } - - /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String commitmentPlanName, Context context) { - beginDelete(resourceGroupName, accountName, commitmentPlanName, context).getFinalResult(); - } - - /** - * Gets the commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the commitmentPlans associated with the Cognitive Services account along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, 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 commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the commitmentPlans associated with the Cognitive Services account as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the commitmentPlans associated with the Cognitive Services account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 commitmentPlans associated with the Cognitive Services account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the commitmentPlans associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Gets the commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 commitmentPlans associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Returns a Cognitive Services commitment plan specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String commitmentPlanName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a Cognitive Services commitment plan specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String commitmentPlanName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, commitmentPlanName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a Cognitive Services commitment plan specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services 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 cognitive Services account commitment plan along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String commitmentPlanName, Context context) { - final String accept = "application/json"; - return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, accept, context); - } - - /** - * Returns a Cognitive Services commitment plan specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CommitmentPlanInner getByResourceGroup(String resourceGroupName, String commitmentPlanName) { - return getByResourceGroupWithResponse(resourceGroupName, commitmentPlanName, Context.NONE).getValue(); - } - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdatePlanWithResponseAsync(String resourceGroupName, - String commitmentPlanName, CommitmentPlanInner commitmentPlan) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdatePlan(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, contentType, accept, - commitmentPlan, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdatePlanWithResponse(String resourceGroupName, String commitmentPlanName, - CommitmentPlanInner commitmentPlan) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdatePlanSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, contentType, accept, commitmentPlan, - Context.NONE); - } - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdatePlanWithResponse(String resourceGroupName, String commitmentPlanName, - CommitmentPlanInner commitmentPlan, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdatePlanSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, contentType, accept, commitmentPlan, - context); - } - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CommitmentPlanInner> beginCreateOrUpdatePlanAsync( - String resourceGroupName, String commitmentPlanName, CommitmentPlanInner commitmentPlan) { - Mono>> mono - = createOrUpdatePlanWithResponseAsync(resourceGroupName, commitmentPlanName, commitmentPlan); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - CommitmentPlanInner.class, CommitmentPlanInner.class, this.client.getContext()); - } - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CommitmentPlanInner> beginCreateOrUpdatePlan( - String resourceGroupName, String commitmentPlanName, CommitmentPlanInner commitmentPlan) { - Response response - = createOrUpdatePlanWithResponse(resourceGroupName, commitmentPlanName, commitmentPlan); - return this.client.getLroResult(response, CommitmentPlanInner.class, - CommitmentPlanInner.class, Context.NONE); - } - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CommitmentPlanInner> beginCreateOrUpdatePlan( - String resourceGroupName, String commitmentPlanName, CommitmentPlanInner commitmentPlan, Context context) { - Response response - = createOrUpdatePlanWithResponse(resourceGroupName, commitmentPlanName, commitmentPlan, context); - return this.client.getLroResult(response, CommitmentPlanInner.class, - CommitmentPlanInner.class, context); - } - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdatePlanAsync(String resourceGroupName, String commitmentPlanName, - CommitmentPlanInner commitmentPlan) { - return beginCreateOrUpdatePlanAsync(resourceGroupName, commitmentPlanName, commitmentPlan).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CommitmentPlanInner createOrUpdatePlan(String resourceGroupName, String commitmentPlanName, - CommitmentPlanInner commitmentPlan) { - return beginCreateOrUpdatePlan(resourceGroupName, commitmentPlanName, commitmentPlan).getFinalResult(); - } - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CommitmentPlanInner createOrUpdatePlan(String resourceGroupName, String commitmentPlanName, - CommitmentPlanInner commitmentPlan, Context context) { - return beginCreateOrUpdatePlan(resourceGroupName, commitmentPlanName, commitmentPlan, context).getFinalResult(); - } - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updatePlanWithResponseAsync(String resourceGroupName, - String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.updatePlan(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, contentType, accept, - commitmentPlan, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updatePlanWithResponse(String resourceGroupName, String commitmentPlanName, - PatchResourceTagsAndSku commitmentPlan) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updatePlanSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, contentType, accept, commitmentPlan, - Context.NONE); - } - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updatePlanWithResponse(String resourceGroupName, String commitmentPlanName, - PatchResourceTagsAndSku commitmentPlan, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updatePlanSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, contentType, accept, commitmentPlan, - context); - } - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CommitmentPlanInner> beginUpdatePlanAsync( - String resourceGroupName, String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan) { - Mono>> mono - = updatePlanWithResponseAsync(resourceGroupName, commitmentPlanName, commitmentPlan); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - CommitmentPlanInner.class, CommitmentPlanInner.class, this.client.getContext()); - } - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CommitmentPlanInner> beginUpdatePlan(String resourceGroupName, - String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan) { - Response response = updatePlanWithResponse(resourceGroupName, commitmentPlanName, commitmentPlan); - return this.client.getLroResult(response, CommitmentPlanInner.class, - CommitmentPlanInner.class, Context.NONE); - } - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CommitmentPlanInner> beginUpdatePlan(String resourceGroupName, - String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan, Context context) { - Response response - = updatePlanWithResponse(resourceGroupName, commitmentPlanName, commitmentPlan, context); - return this.client.getLroResult(response, CommitmentPlanInner.class, - CommitmentPlanInner.class, context); - } - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updatePlanAsync(String resourceGroupName, String commitmentPlanName, - PatchResourceTagsAndSku commitmentPlan) { - return beginUpdatePlanAsync(resourceGroupName, commitmentPlanName, commitmentPlan).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CommitmentPlanInner updatePlan(String resourceGroupName, String commitmentPlanName, - PatchResourceTagsAndSku commitmentPlan) { - return beginUpdatePlan(resourceGroupName, commitmentPlanName, commitmentPlan).getFinalResult(); - } - - /** - * Create Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The parameters to provide for the created commitment plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CommitmentPlanInner updatePlan(String resourceGroupName, String commitmentPlanName, - PatchResourceTagsAndSku commitmentPlan, Context context) { - return beginUpdatePlan(resourceGroupName, commitmentPlanName, commitmentPlan, context).getFinalResult(); - } - - /** - * Deletes a Cognitive Services commitment plan from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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>> deletePlanWithResponseAsync(String resourceGroupName, - String commitmentPlanName) { - return FluxUtil - .withContext(context -> service.deletePlan(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a Cognitive Services commitment plan from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 deletePlanWithResponse(String resourceGroupName, String commitmentPlanName) { - return service.deletePlanSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, Context.NONE); - } - - /** - * Deletes a Cognitive Services commitment plan from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deletePlanWithResponse(String resourceGroupName, String commitmentPlanName, - Context context) { - return service.deletePlanSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, context); - } - - /** - * Deletes a Cognitive Services commitment plan from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginDeletePlanAsync(String resourceGroupName, - String commitmentPlanName) { - Mono>> mono = deletePlanWithResponseAsync(resourceGroupName, commitmentPlanName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes a Cognitive Services commitment plan from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginDeletePlan(String resourceGroupName, String commitmentPlanName) { - Response response = deletePlanWithResponse(resourceGroupName, commitmentPlanName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Deletes a Cognitive Services commitment plan from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeletePlan(String resourceGroupName, String commitmentPlanName, - Context context) { - Response response = deletePlanWithResponse(resourceGroupName, commitmentPlanName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Deletes a Cognitive Services commitment plan from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 deletePlanAsync(String resourceGroupName, String commitmentPlanName) { - return beginDeletePlanAsync(resourceGroupName, commitmentPlanName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a Cognitive Services commitment plan from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 deletePlan(String resourceGroupName, String commitmentPlanName) { - beginDeletePlan(resourceGroupName, commitmentPlanName).getFinalResult(); - } - - /** - * Deletes a Cognitive Services commitment plan from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deletePlan(String resourceGroupName, String commitmentPlanName, Context context) { - beginDeletePlan(resourceGroupName, commitmentPlanName, context).getFinalResult(); - } - - /** - * Returns all the resources of a particular type belonging to a resource group. - * - * @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 the list of cognitive services accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - final String accept = "application/json"; - return FluxUtil - .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())); - } - - /** - * Returns all the resources of a particular type belonging to a resource group. - * - * @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 the list of cognitive services accounts operation response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listPlansByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Returns all the resources of a particular type belonging to a resource group. - * - * @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 the list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { - final String accept = "application/json"; - 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); - } - - /** - * Returns all the resources of a particular type belonging to 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 the list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, - Context context) { - final String accept = "application/json"; - 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); - } - - /** - * Returns all the resources of a particular type belonging to a resource group. - * - * @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 the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), - nextLink -> listPlansByResourceGroupNextSinglePage(nextLink)); - } - - /** - * Returns all the resources of a particular type belonging to 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 the list of cognitive services accounts 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 -> listPlansByResourceGroupNextSinglePage(nextLink, context)); - } - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPlansBySubscriptionSinglePageAsync() { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listPlansBySubscription(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 subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listPlansBySubscriptionAsync() { - return new PagedFlux<>(() -> listPlansBySubscriptionSinglePageAsync(), - nextLink -> listPlansBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listPlansBySubscriptionSinglePage() { - final String accept = "application/json"; - Response res = service.listPlansBySubscriptionSync(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 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 list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listPlansBySubscriptionSinglePage(Context context) { - final String accept = "application/json"; - Response res = service.listPlansBySubscriptionSync(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 subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPlansBySubscription() { - return new PagedIterable<>(() -> listPlansBySubscriptionSinglePage(), - nextLink -> listPlansBySubscriptionNextSinglePage(nextLink)); - } - - /** - * Returns all the resources of a particular type belonging to 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 list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listPlansBySubscription(Context context) { - return new PagedIterable<>(() -> listPlansBySubscriptionSinglePage(context), - nextLink -> listPlansBySubscriptionNextSinglePage(nextLink, context)); - } - - /** - * Gets the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the association of the Cognitive Services commitment plan along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAssociationWithResponseAsync( - String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getAssociation(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the association of the Cognitive Services commitment plan on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAssociationAsync(String resourceGroupName, - String commitmentPlanName, String commitmentPlanAssociationName) { - return getAssociationWithResponseAsync(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * 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 association of the Cognitive Services commitment plan along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAssociationWithResponse(String resourceGroupName, - String commitmentPlanName, String commitmentPlanAssociationName, Context context) { - final String accept = "application/json"; - return service.getAssociationSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, - accept, context); - } - - /** - * Gets the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the association of the Cognitive Services commitment plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CommitmentPlanAccountAssociationInner getAssociation(String resourceGroupName, String commitmentPlanName, - String commitmentPlanAssociationName) { - return getAssociationWithResponse(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, - Context.NONE).getValue(); - } - - /** - * Create or update the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @param association The commitmentPlan 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 commitment plan association along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateAssociationWithResponseAsync(String resourceGroupName, - String commitmentPlanName, String commitmentPlanAssociationName, - CommitmentPlanAccountAssociationInner association) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdateAssociation(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, - commitmentPlanAssociationName, contentType, accept, association, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @param association The commitmentPlan 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 commitment plan association along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateAssociationWithResponse(String resourceGroupName, - String commitmentPlanName, String commitmentPlanAssociationName, - CommitmentPlanAccountAssociationInner association) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateAssociationSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, - contentType, accept, association, Context.NONE); - } - - /** - * Create or update the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @param association The commitmentPlan 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 commitment plan association along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateAssociationWithResponse(String resourceGroupName, - String commitmentPlanName, String commitmentPlanAssociationName, - CommitmentPlanAccountAssociationInner association, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateAssociationSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, - contentType, accept, association, context); - } - - /** - * Create or update the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @param association The commitmentPlan 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 the commitment plan association. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CommitmentPlanAccountAssociationInner> - beginCreateOrUpdateAssociationAsync(String resourceGroupName, String commitmentPlanName, - String commitmentPlanAssociationName, CommitmentPlanAccountAssociationInner association) { - Mono>> mono = createOrUpdateAssociationWithResponseAsync(resourceGroupName, - commitmentPlanName, commitmentPlanAssociationName, association); - return this.client.getLroResult( - mono, this.client.getHttpPipeline(), CommitmentPlanAccountAssociationInner.class, - CommitmentPlanAccountAssociationInner.class, this.client.getContext()); - } - - /** - * Create or update the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @param association The commitmentPlan 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 the commitment plan association. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CommitmentPlanAccountAssociationInner> - beginCreateOrUpdateAssociation(String resourceGroupName, String commitmentPlanName, - String commitmentPlanAssociationName, CommitmentPlanAccountAssociationInner association) { - Response response = createOrUpdateAssociationWithResponse(resourceGroupName, commitmentPlanName, - commitmentPlanAssociationName, association); - return this.client.getLroResult( - response, CommitmentPlanAccountAssociationInner.class, CommitmentPlanAccountAssociationInner.class, - Context.NONE); - } - - /** - * Create or update the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @param association The commitmentPlan 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 the commitment plan association. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CommitmentPlanAccountAssociationInner> - beginCreateOrUpdateAssociation(String resourceGroupName, String commitmentPlanName, - String commitmentPlanAssociationName, CommitmentPlanAccountAssociationInner association, Context context) { - Response response = createOrUpdateAssociationWithResponse(resourceGroupName, commitmentPlanName, - commitmentPlanAssociationName, association, context); - return this.client.getLroResult( - response, CommitmentPlanAccountAssociationInner.class, CommitmentPlanAccountAssociationInner.class, - context); - } - - /** - * Create or update the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @param association The commitmentPlan 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 commitment plan association on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAssociationAsync(String resourceGroupName, - String commitmentPlanName, String commitmentPlanAssociationName, - CommitmentPlanAccountAssociationInner association) { - return beginCreateOrUpdateAssociationAsync(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, - association).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @param association The commitmentPlan 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 commitment plan association. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CommitmentPlanAccountAssociationInner createOrUpdateAssociation(String resourceGroupName, - String commitmentPlanName, String commitmentPlanAssociationName, - CommitmentPlanAccountAssociationInner association) { - return beginCreateOrUpdateAssociation(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, - association).getFinalResult(); - } - - /** - * Create or update the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @param association The commitmentPlan 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 commitment plan association. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CommitmentPlanAccountAssociationInner createOrUpdateAssociation(String resourceGroupName, - String commitmentPlanName, String commitmentPlanAssociationName, - CommitmentPlanAccountAssociationInner association, Context context) { - return beginCreateOrUpdateAssociation(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, - association, context).getFinalResult(); - } - - /** - * Deletes the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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>> deleteAssociationWithResponseAsync(String resourceGroupName, - String commitmentPlanName, String commitmentPlanAssociationName) { - return FluxUtil - .withContext(context -> service.deleteAssociation(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 deleteAssociationWithResponse(String resourceGroupName, String commitmentPlanName, - String commitmentPlanAssociationName) { - return service.deleteAssociationSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, - Context.NONE); - } - - /** - * Deletes the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteAssociationWithResponse(String resourceGroupName, String commitmentPlanName, - String commitmentPlanAssociationName, Context context) { - return service.deleteAssociationSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, - context); - } - - /** - * Deletes the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginDeleteAssociationAsync(String resourceGroupName, - String commitmentPlanName, String commitmentPlanAssociationName) { - Mono>> mono - = deleteAssociationWithResponseAsync(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginDeleteAssociation(String resourceGroupName, - String commitmentPlanName, String commitmentPlanAssociationName) { - Response response - = deleteAssociationWithResponse(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Deletes the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteAssociation(String resourceGroupName, - String commitmentPlanName, String commitmentPlanAssociationName, Context context) { - Response response = deleteAssociationWithResponse(resourceGroupName, commitmentPlanName, - commitmentPlanAssociationName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Deletes the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 deleteAssociationAsync(String resourceGroupName, String commitmentPlanName, - String commitmentPlanAssociationName) { - return beginDeleteAssociationAsync(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 deleteAssociation(String resourceGroupName, String commitmentPlanName, - String commitmentPlanAssociationName) { - beginDeleteAssociation(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName).getFinalResult(); - } - - /** - * Deletes the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAssociation(String resourceGroupName, String commitmentPlanName, - String commitmentPlanAssociationName, Context context) { - beginDeleteAssociation(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, context) - .getFinalResult(); - } - - /** - * Gets the associations of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the associations of the Cognitive Services commitment plan along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAssociationsSinglePageAsync(String resourceGroupName, String commitmentPlanName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAssociations(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, 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 associations of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the associations of the Cognitive Services commitment plan as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAssociationsAsync(String resourceGroupName, - String commitmentPlanName) { - return new PagedFlux<>(() -> listAssociationsSinglePageAsync(resourceGroupName, commitmentPlanName), - nextLink -> listAssociationsNextSinglePageAsync(nextLink)); - } - - /** - * Gets the associations of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the associations of the Cognitive Services commitment plan along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listAssociationsSinglePage(String resourceGroupName, - String commitmentPlanName) { - final String accept = "application/json"; - Response res - = service.listAssociationsSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the associations of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services 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 associations of the Cognitive Services commitment plan along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listAssociationsSinglePage(String resourceGroupName, - String commitmentPlanName, Context context) { - final String accept = "application/json"; - Response res - = service.listAssociationsSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the associations of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the associations of the Cognitive Services commitment plan as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAssociations(String resourceGroupName, - String commitmentPlanName) { - return new PagedIterable<>(() -> listAssociationsSinglePage(resourceGroupName, commitmentPlanName), - nextLink -> listAssociationsNextSinglePage(nextLink)); - } - - /** - * Gets the associations of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services 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 associations of the Cognitive Services commitment plan as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAssociations(String resourceGroupName, - String commitmentPlanName, Context context) { - return new PagedIterable<>(() -> listAssociationsSinglePage(resourceGroupName, commitmentPlanName, context), - nextLink -> listAssociationsNextSinglePage(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 commitmentPlans associated with the Cognitive Services account along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the commitmentPlans associated with the Cognitive Services account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the commitmentPlans associated with the Cognitive Services account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPlansByResourceGroupNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listPlansByResourceGroupNext(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 list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listPlansByResourceGroupNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listPlansByResourceGroupNextSync(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 list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listPlansByResourceGroupNextSinglePage(String nextLink, - Context context) { - final String accept = "application/json"; - Response res - = service.listPlansByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listPlansBySubscriptionNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listPlansBySubscriptionNext(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 list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listPlansBySubscriptionNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listPlansBySubscriptionNextSync(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 list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listPlansBySubscriptionNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listPlansBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the associations of the Cognitive Services commitment plan along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAssociationsNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAssociationsNext(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 associations of the Cognitive Services commitment plan along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listAssociationsNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listAssociationsNextSync(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 associations of the Cognitive Services commitment plan along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listAssociationsNextSinglePage(String nextLink, - Context context) { - final String accept = "application/json"; - Response res - = service.listAssociationsNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansImpl.java deleted file mode 100644 index e962b77ee0ae..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansImpl.java +++ /dev/null @@ -1,328 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.CommitmentPlansClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanAccountAssociationInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlan; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanAccountAssociation; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlans; - -public final class CommitmentPlansImpl implements CommitmentPlans { - private static final ClientLogger LOGGER = new ClientLogger(CommitmentPlansImpl.class); - - private final CommitmentPlansClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public CommitmentPlansImpl(CommitmentPlansClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, - String commitmentPlanName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, accountName, commitmentPlanName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CommitmentPlanImpl(inner.getValue(), this.manager())); - } - - public CommitmentPlan get(String resourceGroupName, String accountName, String commitmentPlanName) { - CommitmentPlanInner inner = this.serviceClient().get(resourceGroupName, accountName, commitmentPlanName); - if (inner != null) { - return new CommitmentPlanImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String commitmentPlanName, CommitmentPlanInner commitmentPlan, Context context) { - Response inner = this.serviceClient() - .createOrUpdateWithResponse(resourceGroupName, accountName, commitmentPlanName, commitmentPlan, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CommitmentPlanImpl(inner.getValue(), this.manager())); - } - - public CommitmentPlan createOrUpdate(String resourceGroupName, String accountName, String commitmentPlanName, - CommitmentPlanInner commitmentPlan) { - CommitmentPlanInner inner - = this.serviceClient().createOrUpdate(resourceGroupName, accountName, commitmentPlanName, commitmentPlan); - if (inner != null) { - return new CommitmentPlanImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String accountName, String commitmentPlanName) { - this.serviceClient().delete(resourceGroupName, accountName, commitmentPlanName); - } - - public void delete(String resourceGroupName, String accountName, String commitmentPlanName, Context context) { - this.serviceClient().delete(resourceGroupName, accountName, commitmentPlanName, context); - } - - public PagedIterable list(String resourceGroupName, String accountName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CommitmentPlanImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CommitmentPlanImpl(inner1, this.manager())); - } - - public Response getByResourceGroupWithResponse(String resourceGroupName, String commitmentPlanName, - Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, commitmentPlanName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CommitmentPlanImpl(inner.getValue(), this.manager())); - } - - public CommitmentPlan getByResourceGroup(String resourceGroupName, String commitmentPlanName) { - CommitmentPlanInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, commitmentPlanName); - if (inner != null) { - return new CommitmentPlanImpl(inner, this.manager()); - } else { - return null; - } - } - - public void deletePlan(String resourceGroupName, String commitmentPlanName) { - this.serviceClient().deletePlan(resourceGroupName, commitmentPlanName); - } - - public void deletePlan(String resourceGroupName, String commitmentPlanName, Context context) { - this.serviceClient().deletePlan(resourceGroupName, commitmentPlanName, context); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CommitmentPlanImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CommitmentPlanImpl(inner1, this.manager())); - } - - public PagedIterable listPlansBySubscription() { - PagedIterable inner = this.serviceClient().listPlansBySubscription(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CommitmentPlanImpl(inner1, this.manager())); - } - - public PagedIterable listPlansBySubscription(Context context) { - PagedIterable inner = this.serviceClient().listPlansBySubscription(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CommitmentPlanImpl(inner1, this.manager())); - } - - public Response getAssociationWithResponse(String resourceGroupName, - String commitmentPlanName, String commitmentPlanAssociationName, Context context) { - Response inner = this.serviceClient() - .getAssociationWithResponse(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CommitmentPlanAccountAssociationImpl(inner.getValue(), this.manager())); - } - - public CommitmentPlanAccountAssociation getAssociation(String resourceGroupName, String commitmentPlanName, - String commitmentPlanAssociationName) { - CommitmentPlanAccountAssociationInner inner - = this.serviceClient().getAssociation(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName); - if (inner != null) { - return new CommitmentPlanAccountAssociationImpl(inner, this.manager()); - } else { - return null; - } - } - - public void deleteAssociation(String resourceGroupName, String commitmentPlanName, - String commitmentPlanAssociationName) { - this.serviceClient().deleteAssociation(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName); - } - - public void deleteAssociation(String resourceGroupName, String commitmentPlanName, - String commitmentPlanAssociationName, Context context) { - this.serviceClient() - .deleteAssociation(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, context); - } - - public PagedIterable listAssociations(String resourceGroupName, - String commitmentPlanName) { - PagedIterable inner - = this.serviceClient().listAssociations(resourceGroupName, commitmentPlanName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new CommitmentPlanAccountAssociationImpl(inner1, this.manager())); - } - - public PagedIterable listAssociations(String resourceGroupName, - String commitmentPlanName, Context context) { - PagedIterable inner - = this.serviceClient().listAssociations(resourceGroupName, commitmentPlanName, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new CommitmentPlanAccountAssociationImpl(inner1, this.manager())); - } - - public CommitmentPlan 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 commitmentPlanName = ResourceManagerUtils.getValueFromIdByName(id, "commitmentPlans"); - if (commitmentPlanName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'commitmentPlans'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, commitmentPlanName, 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 commitmentPlanName = ResourceManagerUtils.getValueFromIdByName(id, "commitmentPlans"); - if (commitmentPlanName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'commitmentPlans'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, commitmentPlanName, context); - } - - public CommitmentPlanAccountAssociation getAssociationById(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 commitmentPlanName = ResourceManagerUtils.getValueFromIdByName(id, "commitmentPlans"); - if (commitmentPlanName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'commitmentPlans'.", id))); - } - String commitmentPlanAssociationName = ResourceManagerUtils.getValueFromIdByName(id, "accountAssociations"); - if (commitmentPlanAssociationName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accountAssociations'.", id))); - } - return this - .getAssociationWithResponse(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, - Context.NONE) - .getValue(); - } - - public Response getAssociationByIdWithResponse(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 commitmentPlanName = ResourceManagerUtils.getValueFromIdByName(id, "commitmentPlans"); - if (commitmentPlanName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'commitmentPlans'.", id))); - } - String commitmentPlanAssociationName = ResourceManagerUtils.getValueFromIdByName(id, "accountAssociations"); - if (commitmentPlanAssociationName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accountAssociations'.", id))); - } - return this.getAssociationWithResponse(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, - context); - } - - public void deletePlanById(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 commitmentPlanName = ResourceManagerUtils.getValueFromIdByName(id, "commitmentPlans"); - if (commitmentPlanName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'commitmentPlans'.", id))); - } - this.deletePlan(resourceGroupName, commitmentPlanName, Context.NONE); - } - - public void deletePlanByIdWithResponse(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 commitmentPlanName = ResourceManagerUtils.getValueFromIdByName(id, "commitmentPlans"); - if (commitmentPlanName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'commitmentPlans'.", id))); - } - this.deletePlan(resourceGroupName, commitmentPlanName, context); - } - - public void deleteAssociationById(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 commitmentPlanName = ResourceManagerUtils.getValueFromIdByName(id, "commitmentPlans"); - if (commitmentPlanName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'commitmentPlans'.", id))); - } - String commitmentPlanAssociationName = ResourceManagerUtils.getValueFromIdByName(id, "accountAssociations"); - if (commitmentPlanAssociationName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accountAssociations'.", id))); - } - this.deleteAssociation(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, Context.NONE); - } - - public void deleteAssociationByIdWithResponse(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 commitmentPlanName = ResourceManagerUtils.getValueFromIdByName(id, "commitmentPlans"); - if (commitmentPlanName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'commitmentPlans'.", id))); - } - String commitmentPlanAssociationName = ResourceManagerUtils.getValueFromIdByName(id, "accountAssociations"); - if (commitmentPlanAssociationName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accountAssociations'.", id))); - } - this.deleteAssociation(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, context); - } - - private CommitmentPlansClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public CommitmentPlanImpl definePlan(String name) { - return new CommitmentPlanImpl(name, this.manager()); - } - - public CommitmentPlanAccountAssociationImpl defineAssociation(String name) { - return new CommitmentPlanAccountAssociationImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTierImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTierImpl.java deleted file mode 100644 index 5268797cded1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTierImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentTierInner; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentCost; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentQuota; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentTier; -import com.azure.resourcemanager.cognitiveservices.models.HostingModel; - -public final class CommitmentTierImpl implements CommitmentTier { - private CommitmentTierInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - CommitmentTierImpl(CommitmentTierInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String kind() { - return this.innerModel().kind(); - } - - public String skuName() { - return this.innerModel().skuName(); - } - - public HostingModel hostingModel() { - return this.innerModel().hostingModel(); - } - - public String planType() { - return this.innerModel().planType(); - } - - public String tier() { - return this.innerModel().tier(); - } - - public Integer maxCount() { - return this.innerModel().maxCount(); - } - - public CommitmentQuota quota() { - return this.innerModel().quota(); - } - - public CommitmentCost cost() { - return this.innerModel().cost(); - } - - public CommitmentTierInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersClientImpl.java deleted file mode 100644 index 6cff370a257f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersClientImpl.java +++ /dev/null @@ -1,256 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.CommitmentTiersClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentTierInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.CommitmentTierListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in CommitmentTiersClient. - */ -public final class CommitmentTiersClientImpl implements CommitmentTiersClient { - /** - * The proxy service used to perform REST calls. - */ - private final CommitmentTiersService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of CommitmentTiersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CommitmentTiersClientImpl(CognitiveServicesManagementClientImpl client) { - this.service - = RestProxy.create(CommitmentTiersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientCommitmentTiers to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientCommitmentTiers") - public interface CommitmentTiersService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/commitmentTiers") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/commitmentTiers") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List Commitment Tiers. - * - * @param location The location 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 list of cognitive services accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, 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 Commitment Tiers. - * - * @param location The location 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 list of cognitive services accounts operation response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location) { - return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List Commitment Tiers. - * - * @param location The location 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 list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String location) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List Commitment Tiers. - * - * @param location The location 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 list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String location, Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List Commitment Tiers. - * - * @param location The location 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 list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location) { - return new PagedIterable<>(() -> listSinglePage(location), nextLink -> listNextSinglePage(nextLink)); - } - - /** - * List Commitment Tiers. - * - * @param location The location 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 list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location, Context context) { - return new PagedIterable<>(() -> listSinglePage(location, 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 the list of cognitive services accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersImpl.java deleted file mode 100644 index b249bb1dadaf..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.CommitmentTiersClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentTierInner; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentTier; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentTiers; - -public final class CommitmentTiersImpl implements CommitmentTiers { - private static final ClientLogger LOGGER = new ClientLogger(CommitmentTiersImpl.class); - - private final CommitmentTiersClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public CommitmentTiersImpl(CommitmentTiersClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String location) { - PagedIterable inner = this.serviceClient().list(location); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CommitmentTierImpl(inner1, this.manager())); - } - - public PagedIterable list(String location, Context context) { - PagedIterable inner = this.serviceClient().list(location, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CommitmentTierImpl(inner1, this.manager())); - } - - private CommitmentTiersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeImpl.java deleted file mode 100644 index 61838cb3cfe8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeImpl.java +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ComputeInner; -import com.azure.resourcemanager.cognitiveservices.models.Compute; -import com.azure.resourcemanager.cognitiveservices.models.ComputeProperties; -import com.azure.resourcemanager.cognitiveservices.models.Identity; -import java.util.Collections; -import java.util.Map; - -public final class ComputeImpl implements Compute, Compute.Definition, Compute.Update { - private ComputeInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public ComputeProperties properties() { - return this.innerModel().properties(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String kind() { - return this.innerModel().kind(); - } - - public Identity identity() { - return this.innerModel().identity(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public ComputeInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - private String computeName; - - public ComputeImpl withExistingAccount(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - public Compute create() { - this.innerObject = serviceManager.serviceClient() - .getComputes() - .createOrUpdate(resourceGroupName, accountName, computeName, this.innerModel(), Context.NONE); - return this; - } - - public Compute create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getComputes() - .createOrUpdate(resourceGroupName, accountName, computeName, this.innerModel(), context); - return this; - } - - ComputeImpl(String name, com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new ComputeInner(); - this.serviceManager = serviceManager; - this.computeName = name; - } - - public ComputeImpl update() { - return this; - } - - public Compute apply() { - this.innerObject = serviceManager.serviceClient() - .getComputes() - .update(resourceGroupName, accountName, computeName, this.innerModel(), Context.NONE); - return this; - } - - public Compute apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getComputes() - .update(resourceGroupName, accountName, computeName, this.innerModel(), context); - return this; - } - - ComputeImpl(ComputeInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.computeName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "computes"); - } - - public Compute refresh() { - this.innerObject = serviceManager.serviceClient() - .getComputes() - .getWithResponse(resourceGroupName, accountName, computeName, Context.NONE) - .getValue(); - return this; - } - - public Compute refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getComputes() - .getWithResponse(resourceGroupName, accountName, computeName, context) - .getValue(); - return this; - } - - public void start() { - serviceManager.computes().start(resourceGroupName, accountName, computeName); - } - - public void start(Context context) { - serviceManager.computes().start(resourceGroupName, accountName, computeName, context); - } - - public void stop() { - serviceManager.computes().stop(resourceGroupName, accountName, computeName); - } - - public void stop(Context context) { - serviceManager.computes().stop(resourceGroupName, accountName, computeName, context); - } - - public void restart() { - serviceManager.computes().restart(resourceGroupName, accountName, computeName); - } - - public void restart(Context context) { - serviceManager.computes().restart(resourceGroupName, accountName, computeName, context); - } - - public ComputeImpl withProperties(ComputeProperties properties) { - this.innerModel().withProperties(properties); - return this; - } - - public ComputeImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public ComputeImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public ComputeImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public ComputeImpl withKind(String kind) { - this.innerModel().withKind(kind); - return this; - } - - public ComputeImpl withIdentity(Identity identity) { - this.innerModel().withIdentity(identity); - return this; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationStatusImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationStatusImpl.java deleted file mode 100644 index 55cabf001380..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationStatusImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ComputeOperationStatusInner; -import com.azure.resourcemanager.cognitiveservices.models.ComputeOperationStatus; -import com.azure.resourcemanager.cognitiveservices.models.ComputeOperationStatusProperties; - -public final class ComputeOperationStatusImpl implements ComputeOperationStatus { - private ComputeOperationStatusInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - ComputeOperationStatusImpl(ComputeOperationStatusInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager 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 ComputeOperationStatusProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ComputeOperationStatusInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationsClientImpl.java deleted file mode 100644 index c388974c8207..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationsClientImpl.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.cognitiveservices.fluent.ComputeOperationsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ComputeOperationStatusInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ComputeOperationsClient. - */ -public final class ComputeOperationsClientImpl implements ComputeOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ComputeOperationsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of ComputeOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ComputeOperationsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service - = RestProxy.create(ComputeOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientComputeOperations to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientComputeOperations") - public interface ComputeOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/computeOperations/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/computeOperations/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the status of a compute operation. - * - * @param location The name of the Azure region. - * @param operationId The ID of the compute operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 compute operation along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String location, String operationId) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, operationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the status of a compute operation. - * - * @param location The name of the Azure region. - * @param operationId The ID of the compute operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 compute operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String location, String operationId) { - return getWithResponseAsync(location, operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the status of a compute operation. - * - * @param location The name of the Azure region. - * @param operationId The ID of the compute operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a compute operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String location, String operationId, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - location, operationId, accept, context); - } - - /** - * Gets the status of a compute operation. - * - * @param location The name of the Azure region. - * @param operationId The ID of the compute operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 compute operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ComputeOperationStatusInner get(String location, String operationId) { - return getWithResponse(location, operationId, Context.NONE).getValue(); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationsImpl.java deleted file mode 100644 index 8904257ecda3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationsImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.ComputeOperationsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ComputeOperationStatusInner; -import com.azure.resourcemanager.cognitiveservices.models.ComputeOperationStatus; -import com.azure.resourcemanager.cognitiveservices.models.ComputeOperations; - -public final class ComputeOperationsImpl implements ComputeOperations { - private static final ClientLogger LOGGER = new ClientLogger(ComputeOperationsImpl.class); - - private final ComputeOperationsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public ComputeOperationsImpl(ComputeOperationsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String location, String operationId, Context context) { - Response inner - = this.serviceClient().getWithResponse(location, operationId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ComputeOperationStatusImpl(inner.getValue(), this.manager())); - } - - public ComputeOperationStatus get(String location, String operationId) { - ComputeOperationStatusInner inner = this.serviceClient().get(location, operationId); - if (inner != null) { - return new ComputeOperationStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - private ComputeOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputesClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputesClientImpl.java deleted file mode 100644 index 7561c16b0aaf..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputesClientImpl.java +++ /dev/null @@ -1,1551 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.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; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.ComputesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ComputeInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.ComputeListResult; -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 ComputesClient. - */ -public final class ComputesClientImpl implements ComputesClient { - /** - * The proxy service used to perform REST calls. - */ - private final ComputesService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of ComputesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ComputesClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(ComputesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientComputes to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientComputes") - public interface ComputesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes/{computeName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("computeName") String computeName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes/{computeName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("computeName") String computeName, @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes/{computeName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("computeName") String computeName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") ComputeInner resource, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes/{computeName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("computeName") String computeName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") ComputeInner resource, - Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes/{computeName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("computeName") String computeName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") ComputeInner properties, - Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes/{computeName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("computeName") String computeName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") ComputeInner properties, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes/{computeName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("computeName") String computeName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes/{computeName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("computeName") String computeName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes/{computeName}/start") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("computeName") String computeName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes/{computeName}/start") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response startSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("computeName") String computeName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes/{computeName}/stop") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stop(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("computeName") String computeName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes/{computeName}/stop") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response stopSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("computeName") String computeName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes/{computeName}/restart") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restart(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("computeName") String computeName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/computes/{computeName}/restart") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response restartSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("computeName") String computeName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 compute associated with the Cognitive Services account along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String accountName, - String computeName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, computeName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 compute associated with the Cognitive Services account on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, String computeName) { - return getWithResponseAsync(resourceGroupName, accountName, computeName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services 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 specified compute associated with the Cognitive Services account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, String computeName, - Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, computeName, accept, context); - } - - /** - * Gets the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 compute associated with the Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ComputeInner get(String resourceGroupName, String accountName, String computeName) { - return getWithResponse(resourceGroupName, accountName, computeName, Context.NONE).getValue(); - } - - /** - * Creates or updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param resource The compute 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 cognitive Services compute resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String accountName, String computeName, ComputeInner resource) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, computeName, contentType, accept, - resource, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param resource The compute 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 cognitive Services compute resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String computeName, ComputeInner resource) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, computeName, contentType, accept, resource, - Context.NONE); - } - - /** - * Creates or updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param resource The compute 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 cognitive Services compute resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String computeName, ComputeInner resource, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, computeName, contentType, accept, resource, - context); - } - - /** - * Creates or updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param resource The compute 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 cognitive Services compute resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ComputeInner> beginCreateOrUpdateAsync(String resourceGroupName, - String accountName, String computeName, ComputeInner resource) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, accountName, computeName, resource); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ComputeInner.class, ComputeInner.class, this.client.getContext()); - } - - /** - * Creates or updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param resource The compute 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 cognitive Services compute resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ComputeInner> beginCreateOrUpdate(String resourceGroupName, - String accountName, String computeName, ComputeInner resource) { - Response response - = createOrUpdateWithResponse(resourceGroupName, accountName, computeName, resource); - return this.client.getLroResult(response, ComputeInner.class, ComputeInner.class, - Context.NONE); - } - - /** - * Creates or updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param resource The compute 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 cognitive Services compute resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ComputeInner> beginCreateOrUpdate(String resourceGroupName, - String accountName, String computeName, ComputeInner resource, Context context) { - Response response - = createOrUpdateWithResponse(resourceGroupName, accountName, computeName, resource, context); - return this.client.getLroResult(response, ComputeInner.class, ComputeInner.class, - context); - } - - /** - * Creates or updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param resource The compute 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 cognitive Services compute resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, String computeName, - ComputeInner resource) { - return beginCreateOrUpdateAsync(resourceGroupName, accountName, computeName, resource).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param resource The compute 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 cognitive Services compute resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ComputeInner createOrUpdate(String resourceGroupName, String accountName, String computeName, - ComputeInner resource) { - return beginCreateOrUpdate(resourceGroupName, accountName, computeName, resource).getFinalResult(); - } - - /** - * Creates or updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param resource The compute 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 cognitive Services compute resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ComputeInner createOrUpdate(String resourceGroupName, String accountName, String computeName, - ComputeInner resource, Context context) { - return beginCreateOrUpdate(resourceGroupName, accountName, computeName, resource, context).getFinalResult(); - } - - /** - * Updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param properties The compute properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services compute resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String accountName, - String computeName, ComputeInner properties) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, computeName, contentType, accept, - properties, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param properties The compute properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services compute resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String accountName, String computeName, - ComputeInner properties) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, computeName, contentType, accept, - properties, Context.NONE); - } - - /** - * Updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param properties The compute properties to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services compute resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String accountName, String computeName, - ComputeInner properties, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, computeName, contentType, accept, - properties, context); - } - - /** - * Updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param properties The compute properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive Services compute resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ComputeInner> beginUpdateAsync(String resourceGroupName, - String accountName, String computeName, ComputeInner properties) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, accountName, computeName, properties); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ComputeInner.class, ComputeInner.class, this.client.getContext()); - } - - /** - * Updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param properties The compute properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive Services compute resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ComputeInner> beginUpdate(String resourceGroupName, String accountName, - String computeName, ComputeInner properties) { - Response response = updateWithResponse(resourceGroupName, accountName, computeName, properties); - return this.client.getLroResult(response, ComputeInner.class, ComputeInner.class, - Context.NONE); - } - - /** - * Updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param properties The compute properties to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive Services compute resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ComputeInner> beginUpdate(String resourceGroupName, String accountName, - String computeName, ComputeInner properties, Context context) { - Response response - = updateWithResponse(resourceGroupName, accountName, computeName, properties, context); - return this.client.getLroResult(response, ComputeInner.class, ComputeInner.class, - context); - } - - /** - * Updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param properties The compute properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services compute resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String accountName, String computeName, - ComputeInner properties) { - return beginUpdateAsync(resourceGroupName, accountName, computeName, properties).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param properties The compute properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services compute resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ComputeInner update(String resourceGroupName, String accountName, String computeName, - ComputeInner properties) { - return beginUpdate(resourceGroupName, accountName, computeName, properties).getFinalResult(); - } - - /** - * Updates a compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @param properties The compute properties to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services compute resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ComputeInner update(String resourceGroupName, String accountName, String computeName, - ComputeInner properties, Context context) { - return beginUpdate(resourceGroupName, accountName, computeName, properties, context).getFinalResult(); - } - - /** - * Deletes the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String computeName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, computeName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, String computeName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, computeName, Context.NONE); - } - - /** - * Deletes the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String accountName, String computeName, - Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, computeName, context); - } - - /** - * Deletes the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String computeName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName, computeName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String computeName) { - Response response = deleteWithResponse(resourceGroupName, accountName, computeName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Deletes the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String computeName, Context context) { - Response response = deleteWithResponse(resourceGroupName, accountName, computeName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Deletes the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String computeName) { - return beginDeleteAsync(resourceGroupName, accountName, computeName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String computeName) { - beginDelete(resourceGroupName, accountName, computeName).getFinalResult(); - } - - /** - * Deletes the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String computeName, Context context) { - beginDelete(resourceGroupName, accountName, computeName, context).getFinalResult(); - } - - /** - * Gets the computes associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the computes associated with the Cognitive Services account along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, 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 computes associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the computes associated with the Cognitive Services account as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the computes associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the computes associated with the Cognitive Services account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the computes associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 computes associated with the Cognitive Services account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the computes associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the computes associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Gets the computes associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 computes associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Starts a stopped ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String computeName) { - return FluxUtil - .withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, computeName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Starts a stopped ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, String computeName) { - return service.startSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, computeName, Context.NONE); - } - - /** - * Starts a stopped ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response startWithResponse(String resourceGroupName, String accountName, String computeName, - Context context) { - return service.startSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, computeName, context); - } - - /** - * Starts a stopped ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String computeName) { - Mono>> mono = startWithResponseAsync(resourceGroupName, accountName, computeName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Starts a stopped ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String computeName) { - Response response = startWithResponse(resourceGroupName, accountName, computeName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Starts a stopped ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStart(String resourceGroupName, String accountName, - String computeName, Context context) { - Response response = startWithResponse(resourceGroupName, accountName, computeName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Starts a stopped ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String computeName) { - return beginStartAsync(resourceGroupName, accountName, computeName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts a stopped ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String computeName) { - beginStart(resourceGroupName, accountName, computeName).getFinalResult(); - } - - /** - * Starts a stopped ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String accountName, String computeName, Context context) { - beginStart(resourceGroupName, accountName, computeName, context).getFinalResult(); - } - - /** - * Stops a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String computeName) { - return FluxUtil - .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, computeName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Stops a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 stopWithResponse(String resourceGroupName, String accountName, String computeName) { - return service.stopSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, computeName, Context.NONE); - } - - /** - * Stops a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response stopWithResponse(String resourceGroupName, String accountName, String computeName, - Context context) { - return service.stopSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, computeName, context); - } - - /** - * Stops a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginStopAsync(String resourceGroupName, String accountName, - String computeName) { - Mono>> mono = stopWithResponseAsync(resourceGroupName, accountName, computeName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Stops a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginStop(String resourceGroupName, String accountName, - String computeName) { - Response response = stopWithResponse(resourceGroupName, accountName, computeName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Stops a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStop(String resourceGroupName, String accountName, - String computeName, Context context) { - Response response = stopWithResponse(resourceGroupName, accountName, computeName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Stops a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String computeName) { - return beginStopAsync(resourceGroupName, accountName, computeName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stops a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String computeName) { - beginStop(resourceGroupName, accountName, computeName).getFinalResult(); - } - - /** - * Stops a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void stop(String resourceGroupName, String accountName, String computeName, Context context) { - beginStop(resourceGroupName, accountName, computeName, context).getFinalResult(); - } - - /** - * Restarts a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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>> restartWithResponseAsync(String resourceGroupName, String accountName, - String computeName) { - return FluxUtil - .withContext(context -> service.restart(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, computeName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restarts a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 restartWithResponse(String resourceGroupName, String accountName, String computeName) { - return service.restartSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, computeName, Context.NONE); - } - - /** - * Restarts a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response restartWithResponse(String resourceGroupName, String accountName, String computeName, - Context context) { - return service.restartSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, computeName, context); - } - - /** - * Restarts a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginRestartAsync(String resourceGroupName, String accountName, - String computeName) { - Mono>> mono = restartWithResponseAsync(resourceGroupName, accountName, computeName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Restarts a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginRestart(String resourceGroupName, String accountName, - String computeName) { - Response response = restartWithResponse(resourceGroupName, accountName, computeName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Restarts a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginRestart(String resourceGroupName, String accountName, - String computeName, Context context) { - Response response = restartWithResponse(resourceGroupName, accountName, computeName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Restarts a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 restartAsync(String resourceGroupName, String accountName, String computeName) { - return beginRestartAsync(resourceGroupName, accountName, computeName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restarts a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 restart(String resourceGroupName, String accountName, String computeName) { - beginRestart(resourceGroupName, accountName, computeName).getFinalResult(); - } - - /** - * Restarts a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void restart(String resourceGroupName, String accountName, String computeName, Context context) { - beginRestart(resourceGroupName, accountName, computeName, context).getFinalResult(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the computes associated with the Cognitive Services account along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the computes associated with the Cognitive Services account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the computes associated with the Cognitive Services account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputesImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputesImpl.java deleted file mode 100644 index 4ba56e8e424e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputesImpl.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.ComputesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ComputeInner; -import com.azure.resourcemanager.cognitiveservices.models.Compute; -import com.azure.resourcemanager.cognitiveservices.models.Computes; - -public final class ComputesImpl implements Computes { - private static final ClientLogger LOGGER = new ClientLogger(ComputesImpl.class); - - private final ComputesClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public ComputesImpl(ComputesClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, String computeName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, accountName, computeName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ComputeImpl(inner.getValue(), this.manager())); - } - - public Compute get(String resourceGroupName, String accountName, String computeName) { - ComputeInner inner = this.serviceClient().get(resourceGroupName, accountName, computeName); - if (inner != null) { - return new ComputeImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String accountName, String computeName) { - this.serviceClient().delete(resourceGroupName, accountName, computeName); - } - - public void delete(String resourceGroupName, String accountName, String computeName, Context context) { - this.serviceClient().delete(resourceGroupName, accountName, computeName, context); - } - - public PagedIterable list(String resourceGroupName, String accountName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ComputeImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ComputeImpl(inner1, this.manager())); - } - - public void start(String resourceGroupName, String accountName, String computeName) { - this.serviceClient().start(resourceGroupName, accountName, computeName); - } - - public void start(String resourceGroupName, String accountName, String computeName, Context context) { - this.serviceClient().start(resourceGroupName, accountName, computeName, context); - } - - public void stop(String resourceGroupName, String accountName, String computeName) { - this.serviceClient().stop(resourceGroupName, accountName, computeName); - } - - public void stop(String resourceGroupName, String accountName, String computeName, Context context) { - this.serviceClient().stop(resourceGroupName, accountName, computeName, context); - } - - public void restart(String resourceGroupName, String accountName, String computeName) { - this.serviceClient().restart(resourceGroupName, accountName, computeName); - } - - public void restart(String resourceGroupName, String accountName, String computeName, Context context) { - this.serviceClient().restart(resourceGroupName, accountName, computeName, context); - } - - public Compute 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String computeName = ResourceManagerUtils.getValueFromIdByName(id, "computes"); - if (computeName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'computes'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, computeName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String computeName = ResourceManagerUtils.getValueFromIdByName(id, "computes"); - if (computeName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'computes'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, computeName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String computeName = ResourceManagerUtils.getValueFromIdByName(id, "computes"); - if (computeName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'computes'.", id))); - } - this.delete(resourceGroupName, accountName, computeName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String computeName = ResourceManagerUtils.getValueFromIdByName(id, "computes"); - if (computeName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'computes'.", id))); - } - this.delete(resourceGroupName, accountName, computeName, context); - } - - private ComputesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public ComputeImpl define(String name) { - return new ComputeImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ConnectionPropertiesV2BasicResourceImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ConnectionPropertiesV2BasicResourceImpl.java deleted file mode 100644 index 36a4ebeea258..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ConnectionPropertiesV2BasicResourceImpl.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; -import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2; -import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2BasicResource; -import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; - -public final class ConnectionPropertiesV2BasicResourceImpl implements ConnectionPropertiesV2BasicResource, - ConnectionPropertiesV2BasicResource.Definition, ConnectionPropertiesV2BasicResource.Update { - private ConnectionPropertiesV2BasicResourceInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public ConnectionPropertiesV2 properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public ConnectionPropertiesV2BasicResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - private String projectName; - - private String connectionName; - - private ConnectionUpdateContent updateConnection; - - public ConnectionPropertiesV2BasicResourceImpl withExistingProject(String resourceGroupName, String accountName, - String projectName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - this.projectName = projectName; - return this; - } - - public ConnectionPropertiesV2BasicResource create() { - this.innerObject = serviceManager.serviceClient() - .getProjectConnections() - .createWithResponse(resourceGroupName, accountName, projectName, connectionName, this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public ConnectionPropertiesV2BasicResource create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getProjectConnections() - .createWithResponse(resourceGroupName, accountName, projectName, connectionName, this.innerModel(), context) - .getValue(); - return this; - } - - ConnectionPropertiesV2BasicResourceImpl(String name, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new ConnectionPropertiesV2BasicResourceInner(); - this.serviceManager = serviceManager; - this.connectionName = name; - } - - public ConnectionPropertiesV2BasicResourceImpl update() { - this.updateConnection = new ConnectionUpdateContent(); - return this; - } - - public ConnectionPropertiesV2BasicResource apply() { - this.innerObject = serviceManager.serviceClient() - .getProjectConnections() - .updateWithResponse(resourceGroupName, accountName, projectName, connectionName, updateConnection, - Context.NONE) - .getValue(); - return this; - } - - public ConnectionPropertiesV2BasicResource apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getProjectConnections() - .updateWithResponse(resourceGroupName, accountName, projectName, connectionName, updateConnection, context) - .getValue(); - return this; - } - - ConnectionPropertiesV2BasicResourceImpl(ConnectionPropertiesV2BasicResourceInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.projectName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "projects"); - this.connectionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "connections"); - } - - public ConnectionPropertiesV2BasicResource refresh() { - this.innerObject = serviceManager.serviceClient() - .getProjectConnections() - .getWithResponse(resourceGroupName, accountName, projectName, connectionName, Context.NONE) - .getValue(); - return this; - } - - public ConnectionPropertiesV2BasicResource refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getProjectConnections() - .getWithResponse(resourceGroupName, accountName, projectName, connectionName, context) - .getValue(); - return this; - } - - public ConnectionPropertiesV2BasicResourceImpl withProperties(ConnectionPropertiesV2 properties) { - if (isInCreateMode()) { - this.innerModel().withProperties(properties); - return this; - } else { - this.updateConnection.withProperties(properties); - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel() == null || this.innerModel().id() == null; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingImpl.java deleted file mode 100644 index 6387bba7a4ca..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingImpl.java +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.DefenderForAISettingInner; -import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISetting; -import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISettingState; -import java.util.Collections; -import java.util.Map; - -public final class DefenderForAISettingImpl - implements DefenderForAISetting, DefenderForAISetting.Definition, DefenderForAISetting.Update { - private DefenderForAISettingInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public DefenderForAISettingState state() { - return this.innerModel().state(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public DefenderForAISettingInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - private String defenderForAISettingName; - - public DefenderForAISettingImpl withExistingAccount(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - public DefenderForAISetting create() { - this.innerObject = serviceManager.serviceClient() - .getDefenderForAISettings() - .createOrUpdateWithResponse(resourceGroupName, accountName, defenderForAISettingName, this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public DefenderForAISetting create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDefenderForAISettings() - .createOrUpdateWithResponse(resourceGroupName, accountName, defenderForAISettingName, this.innerModel(), - context) - .getValue(); - return this; - } - - DefenderForAISettingImpl(String name, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new DefenderForAISettingInner(); - this.serviceManager = serviceManager; - this.defenderForAISettingName = name; - } - - public DefenderForAISettingImpl update() { - return this; - } - - public DefenderForAISetting apply() { - this.innerObject = serviceManager.serviceClient() - .getDefenderForAISettings() - .updateWithResponse(resourceGroupName, accountName, defenderForAISettingName, this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public DefenderForAISetting apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDefenderForAISettings() - .updateWithResponse(resourceGroupName, accountName, defenderForAISettingName, this.innerModel(), context) - .getValue(); - return this; - } - - DefenderForAISettingImpl(DefenderForAISettingInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.defenderForAISettingName - = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "defenderForAISettings"); - } - - public DefenderForAISetting refresh() { - this.innerObject = serviceManager.serviceClient() - .getDefenderForAISettings() - .getWithResponse(resourceGroupName, accountName, defenderForAISettingName, Context.NONE) - .getValue(); - return this; - } - - public DefenderForAISetting refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDefenderForAISettings() - .getWithResponse(resourceGroupName, accountName, defenderForAISettingName, context) - .getValue(); - return this; - } - - public DefenderForAISettingImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public DefenderForAISettingImpl withState(DefenderForAISettingState state) { - this.innerModel().withState(state); - return this; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingsClientImpl.java deleted file mode 100644 index 9a5ad5a0f76d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingsClientImpl.java +++ /dev/null @@ -1,579 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.Patch; -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.resourcemanager.cognitiveservices.fluent.DefenderForAISettingsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.DefenderForAISettingInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.DefenderForAISettingResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in DefenderForAISettingsClient. - */ -public final class DefenderForAISettingsClientImpl implements DefenderForAISettingsClient { - /** - * The proxy service used to perform REST calls. - */ - private final DefenderForAISettingsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of DefenderForAISettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DefenderForAISettingsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(DefenderForAISettingsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientDefenderForAISettings to be used by - * the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientDefenderForAISettings") - public interface DefenderForAISettingsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings/{defenderForAISettingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("defenderForAISettingName") String defenderForAISettingName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings/{defenderForAISettingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("defenderForAISettingName") String defenderForAISettingName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings/{defenderForAISettingName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("defenderForAISettingName") String defenderForAISettingName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") DefenderForAISettingInner defenderForAISettings, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings/{defenderForAISettingName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("defenderForAISettingName") String defenderForAISettingName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") DefenderForAISettingInner defenderForAISettings, Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings/{defenderForAISettingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("defenderForAISettingName") String defenderForAISettingName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") DefenderForAISettingInner defenderForAISettings, Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings/{defenderForAISettingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("defenderForAISettingName") String defenderForAISettingName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") DefenderForAISettingInner defenderForAISettings, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the specified Defender for AI setting by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Defender for AI setting by name along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String accountName, - String defenderForAISettingName) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, defenderForAISettingName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified Defender for AI setting by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Defender for AI setting by name on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, - String defenderForAISettingName) { - return getWithResponseAsync(resourceGroupName, accountName, defenderForAISettingName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the specified Defender for AI setting by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Defender for AI setting by name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, - String defenderForAISettingName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, defenderForAISettingName, accept, context); - } - - /** - * Gets the specified Defender for AI setting by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Defender for AI setting by name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DefenderForAISettingInner get(String resourceGroupName, String accountName, - String defenderForAISettingName) { - return getWithResponse(resourceGroupName, accountName, defenderForAISettingName, Context.NONE).getValue(); - } - - /** - * Creates or Updates the specified Defender for AI setting. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. - * @param defenderForAISettings Properties describing the Defender for AI setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for AI resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String accountName, String defenderForAISettingName, DefenderForAISettingInner defenderForAISettings) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, defenderForAISettingName, contentType, - accept, defenderForAISettings, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or Updates the specified Defender for AI setting. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. - * @param defenderForAISettings Properties describing the Defender for AI setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for AI resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, - String defenderForAISettingName, DefenderForAISettingInner defenderForAISettings) { - return createOrUpdateWithResponseAsync(resourceGroupName, accountName, defenderForAISettingName, - defenderForAISettings).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or Updates the specified Defender for AI setting. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. - * @param defenderForAISettings Properties describing the Defender for AI setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for AI resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String defenderForAISettingName, DefenderForAISettingInner defenderForAISettings, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, defenderForAISettingName, contentType, - accept, defenderForAISettings, context); - } - - /** - * Creates or Updates the specified Defender for AI setting. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. - * @param defenderForAISettings Properties describing the Defender for AI setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for AI resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DefenderForAISettingInner createOrUpdate(String resourceGroupName, String accountName, - String defenderForAISettingName, DefenderForAISettingInner defenderForAISettings) { - return createOrUpdateWithResponse(resourceGroupName, accountName, defenderForAISettingName, - defenderForAISettings, Context.NONE).getValue(); - } - - /** - * Updates the specified Defender for AI setting. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. - * @param defenderForAISettings Properties describing the Defender for AI setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for AI resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String accountName, String defenderForAISettingName, DefenderForAISettingInner defenderForAISettings) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, defenderForAISettingName, contentType, - accept, defenderForAISettings, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the specified Defender for AI setting. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. - * @param defenderForAISettings Properties describing the Defender for AI setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for AI resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String accountName, - String defenderForAISettingName, DefenderForAISettingInner defenderForAISettings) { - return updateWithResponseAsync(resourceGroupName, accountName, defenderForAISettingName, defenderForAISettings) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Updates the specified Defender for AI setting. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. - * @param defenderForAISettings Properties describing the Defender for AI setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for AI resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String accountName, - String defenderForAISettingName, DefenderForAISettingInner defenderForAISettings, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, defenderForAISettingName, contentType, - accept, defenderForAISettings, context); - } - - /** - * Updates the specified Defender for AI setting. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. - * @param defenderForAISettings Properties describing the Defender for AI setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for AI resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DefenderForAISettingInner update(String resourceGroupName, String accountName, - String defenderForAISettingName, DefenderForAISettingInner defenderForAISettings) { - return updateWithResponse(resourceGroupName, accountName, defenderForAISettingName, defenderForAISettings, - Context.NONE).getValue(); - } - - /** - * Lists the Defender for AI settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services Defender for AI Settings along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String accountName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the Defender for AI settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services Defender for AI Settings as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the Defender for AI settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services Defender for AI Settings along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists the Defender for AI settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 list of cognitive services Defender for AI Settings along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists the Defender for AI settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services Defender for AI Settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Lists the Defender for AI settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 list of cognitive services Defender for AI Settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, - Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, 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 the list of cognitive services Defender for AI Settings along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services Defender for AI Settings along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services Defender for AI Settings along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingsImpl.java deleted file mode 100644 index 378f70301c7b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingsImpl.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.DefenderForAISettingsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.DefenderForAISettingInner; -import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISetting; -import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISettings; - -public final class DefenderForAISettingsImpl implements DefenderForAISettings { - private static final ClientLogger LOGGER = new ClientLogger(DefenderForAISettingsImpl.class); - - private final DefenderForAISettingsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public DefenderForAISettingsImpl(DefenderForAISettingsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, - String defenderForAISettingName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, accountName, defenderForAISettingName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DefenderForAISettingImpl(inner.getValue(), this.manager())); - } - - public DefenderForAISetting get(String resourceGroupName, String accountName, String defenderForAISettingName) { - DefenderForAISettingInner inner - = this.serviceClient().get(resourceGroupName, accountName, defenderForAISettingName); - if (inner != null) { - return new DefenderForAISettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String accountName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DefenderForAISettingImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DefenderForAISettingImpl(inner1, this.manager())); - } - - public DefenderForAISetting 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String defenderForAISettingName = ResourceManagerUtils.getValueFromIdByName(id, "defenderForAISettings"); - if (defenderForAISettingName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'defenderForAISettings'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, defenderForAISettingName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String defenderForAISettingName = ResourceManagerUtils.getValueFromIdByName(id, "defenderForAISettings"); - if (defenderForAISettingName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'defenderForAISettings'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, defenderForAISettingName, context); - } - - private DefenderForAISettingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public DefenderForAISettingImpl define(String name) { - return new DefenderForAISettingImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsClientImpl.java deleted file mode 100644 index c5924024e4ba..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsClientImpl.java +++ /dev/null @@ -1,524 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -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.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.DeletedAccountsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.AccountListResult; -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 DeletedAccountsClient. - */ -public final class DeletedAccountsClientImpl implements DeletedAccountsClient { - /** - * The proxy service used to perform REST calls. - */ - private final DeletedAccountsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of DeletedAccountsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DeletedAccountsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service - = RestProxy.create(DeletedAccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientDeletedAccounts to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientDeletedAccounts") - public interface DeletedAccountsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/deletedAccounts") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/deletedAccounts") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - 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}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> purge(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response purgeSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - final String accept = "application/json"; - return FluxUtil - .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 subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage() { - 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); - } - - /** - * Returns all the resources of a particular type belonging to 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 list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(Context context) { - 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); - } - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Returns all the resources of a particular type belonging to 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 list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String location, String resourceGroupName, - String accountName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, resourceGroupName, accountName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String location, String resourceGroupName, String accountName) { - return getWithResponseAsync(location, resourceGroupName, accountName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String location, String resourceGroupName, String accountName, - Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - location, resourceGroupName, accountName, accept, context); - } - - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccountInner get(String location, String resourceGroupName, String accountName) { - return getWithResponse(location, resourceGroupName, accountName, Context.NONE).getValue(); - } - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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>> purgeWithResponseAsync(String location, String resourceGroupName, - String accountName) { - return FluxUtil - .withContext(context -> service.purge(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, resourceGroupName, accountName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 purgeWithResponse(String location, String resourceGroupName, String accountName) { - return service.purgeSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, resourceGroupName, accountName, Context.NONE); - } - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response purgeWithResponse(String location, String resourceGroupName, String accountName, - Context context) { - return service.purgeSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, resourceGroupName, accountName, context); - } - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginPurgeAsync(String location, String resourceGroupName, - String accountName) { - Mono>> mono = purgeWithResponseAsync(location, resourceGroupName, accountName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginPurge(String location, String resourceGroupName, - String accountName) { - Response response = purgeWithResponse(location, resourceGroupName, accountName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginPurge(String location, String resourceGroupName, String accountName, - Context context) { - Response response = purgeWithResponse(location, resourceGroupName, accountName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 purgeAsync(String location, String resourceGroupName, String accountName) { - return beginPurgeAsync(location, resourceGroupName, accountName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 purge(String location, String resourceGroupName, String accountName) { - beginPurge(location, resourceGroupName, accountName).getFinalResult(); - } - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void purge(String location, String resourceGroupName, String accountName, Context context) { - beginPurge(location, resourceGroupName, accountName, context).getFinalResult(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsImpl.java deleted file mode 100644 index 3a3bdaa0947b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.DeletedAccountsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountInner; -import com.azure.resourcemanager.cognitiveservices.models.Account; -import com.azure.resourcemanager.cognitiveservices.models.DeletedAccounts; - -public final class DeletedAccountsImpl implements DeletedAccounts { - private static final ClientLogger LOGGER = new ClientLogger(DeletedAccountsImpl.class); - - private final DeletedAccountsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public DeletedAccountsImpl(DeletedAccountsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); - } - - public Response getWithResponse(String location, String resourceGroupName, String accountName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(location, resourceGroupName, accountName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AccountImpl(inner.getValue(), this.manager())); - } - - public Account get(String location, String resourceGroupName, String accountName) { - AccountInner inner = this.serviceClient().get(location, resourceGroupName, accountName); - if (inner != null) { - return new AccountImpl(inner, this.manager()); - } else { - return null; - } - } - - public void purge(String location, String resourceGroupName, String accountName) { - this.serviceClient().purge(location, resourceGroupName, accountName); - } - - public void purge(String location, String resourceGroupName, String accountName, Context context) { - this.serviceClient().purge(location, resourceGroupName, accountName, context); - } - - private DeletedAccountsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentImpl.java deleted file mode 100644 index 931f0b169710..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentImpl.java +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.DeploymentInner; -import com.azure.resourcemanager.cognitiveservices.models.Deployment; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentProperties; -import com.azure.resourcemanager.cognitiveservices.models.PatchResourceTagsAndSku; -import com.azure.resourcemanager.cognitiveservices.models.Sku; -import java.util.Collections; -import java.util.Map; - -public final class DeploymentImpl implements Deployment, Deployment.Definition, Deployment.Update { - private DeploymentInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public DeploymentProperties properties() { - return this.innerModel().properties(); - } - - public Sku sku() { - return this.innerModel().sku(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public DeploymentInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - private String deploymentName; - - private PatchResourceTagsAndSku updateDeployment; - - public DeploymentImpl withExistingAccount(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - public Deployment create() { - this.innerObject = serviceManager.serviceClient() - .getDeployments() - .createOrUpdate(resourceGroupName, accountName, deploymentName, this.innerModel(), Context.NONE); - return this; - } - - public Deployment create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDeployments() - .createOrUpdate(resourceGroupName, accountName, deploymentName, this.innerModel(), context); - return this; - } - - DeploymentImpl(String name, com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new DeploymentInner(); - this.serviceManager = serviceManager; - this.deploymentName = name; - } - - public DeploymentImpl update() { - this.updateDeployment = new PatchResourceTagsAndSku(); - return this; - } - - public Deployment apply() { - this.innerObject = serviceManager.serviceClient() - .getDeployments() - .update(resourceGroupName, accountName, deploymentName, updateDeployment, Context.NONE); - return this; - } - - public Deployment apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDeployments() - .update(resourceGroupName, accountName, deploymentName, updateDeployment, context); - return this; - } - - DeploymentImpl(DeploymentInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.deploymentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "deployments"); - } - - public Deployment refresh() { - this.innerObject = serviceManager.serviceClient() - .getDeployments() - .getWithResponse(resourceGroupName, accountName, deploymentName, Context.NONE) - .getValue(); - return this; - } - - public Deployment refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDeployments() - .getWithResponse(resourceGroupName, accountName, deploymentName, context) - .getValue(); - return this; - } - - public Response pauseWithResponse(Context context) { - return serviceManager.deployments().pauseWithResponse(resourceGroupName, accountName, deploymentName, context); - } - - public Deployment pause() { - return serviceManager.deployments().pause(resourceGroupName, accountName, deploymentName); - } - - public Response resumeWithResponse(Context context) { - return serviceManager.deployments().resumeWithResponse(resourceGroupName, accountName, deploymentName, context); - } - - public Deployment resume() { - return serviceManager.deployments().resume(resourceGroupName, accountName, deploymentName); - } - - public DeploymentImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateDeployment.withTags(tags); - return this; - } - } - - public DeploymentImpl withProperties(DeploymentProperties properties) { - this.innerModel().withProperties(properties); - return this; - } - - public DeploymentImpl withSku(Sku sku) { - if (isInCreateMode()) { - this.innerModel().withSku(sku); - return this; - } else { - this.updateDeployment.withSku(sku); - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel() == null || this.innerModel().id() == null; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsClientImpl.java deleted file mode 100644 index e6b6349eebaf..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsClientImpl.java +++ /dev/null @@ -1,1412 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.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; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.DeploymentsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.DeploymentInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.SkuResourceInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.DeploymentListResult; -import com.azure.resourcemanager.cognitiveservices.implementation.models.DeploymentSkuListResult; -import com.azure.resourcemanager.cognitiveservices.models.PatchResourceTagsAndSku; -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 DeploymentsClient. - */ -public final class DeploymentsClientImpl implements DeploymentsClient { - /** - * The proxy service used to perform REST calls. - */ - private final DeploymentsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of DeploymentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DeploymentsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service - = RestProxy.create(DeploymentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientDeployments to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientDeployments") - public interface DeploymentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") DeploymentInner deployment, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") DeploymentInner deployment, - Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") PatchResourceTagsAndSku deployment, - Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") PatchResourceTagsAndSku deployment, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}/skus") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSkus(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}/skus") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSkusSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}/pause") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> pause(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}/pause") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response pauseSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}/resume") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> resume(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}/resume") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response resumeSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSkusNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSkusNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 deployments associated with the Cognitive Services account along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String accountName, - String deploymentName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 deployments associated with the Cognitive Services account on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, String deploymentName) { - return getWithResponseAsync(resourceGroupName, accountName, deploymentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services 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 specified deployments associated with the Cognitive Services account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, - String deploymentName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, deploymentName, accept, context); - } - - /** - * Gets the specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 deployments associated with the Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentInner get(String resourceGroupName, String accountName, String deploymentName) { - return getWithResponse(resourceGroupName, accountName, deploymentName, Context.NONE).getValue(); - } - - /** - * Update the state of specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String accountName, String deploymentName, DeploymentInner deployment) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, contentType, accept, - deployment, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the state of specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String deploymentName, DeploymentInner deployment) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, contentType, accept, - deployment, Context.NONE); - } - - /** - * Update the state of specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String deploymentName, DeploymentInner deployment, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, contentType, accept, - deployment, context); - } - - /** - * Update the state of specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeploymentInner> beginCreateOrUpdateAsync(String resourceGroupName, - String accountName, String deploymentName, DeploymentInner deployment) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, accountName, deploymentName, deployment); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DeploymentInner.class, DeploymentInner.class, this.client.getContext()); - } - - /** - * Update the state of specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentInner> beginCreateOrUpdate(String resourceGroupName, - String accountName, String deploymentName, DeploymentInner deployment) { - Response response - = createOrUpdateWithResponse(resourceGroupName, accountName, deploymentName, deployment); - return this.client.getLroResult(response, DeploymentInner.class, - DeploymentInner.class, Context.NONE); - } - - /** - * Update the state of specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentInner> beginCreateOrUpdate(String resourceGroupName, - String accountName, String deploymentName, DeploymentInner deployment, Context context) { - Response response - = createOrUpdateWithResponse(resourceGroupName, accountName, deploymentName, deployment, context); - return this.client.getLroResult(response, DeploymentInner.class, - DeploymentInner.class, context); - } - - /** - * Update the state of specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, - String deploymentName, DeploymentInner deployment) { - return beginCreateOrUpdateAsync(resourceGroupName, accountName, deploymentName, deployment).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update the state of specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentInner createOrUpdate(String resourceGroupName, String accountName, String deploymentName, - DeploymentInner deployment) { - return beginCreateOrUpdate(resourceGroupName, accountName, deploymentName, deployment).getFinalResult(); - } - - /** - * Update the state of specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentInner createOrUpdate(String resourceGroupName, String accountName, String deploymentName, - DeploymentInner deployment, Context context) { - return beginCreateOrUpdate(resourceGroupName, accountName, deploymentName, deployment, context) - .getFinalResult(); - } - - /** - * Update specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String accountName, - String deploymentName, PatchResourceTagsAndSku deployment) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, contentType, accept, - deployment, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String accountName, String deploymentName, - PatchResourceTagsAndSku deployment) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, contentType, accept, - deployment, Context.NONE); - } - - /** - * Update specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String accountName, String deploymentName, - PatchResourceTagsAndSku deployment, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, contentType, accept, - deployment, context); - } - - /** - * Update specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeploymentInner> beginUpdateAsync(String resourceGroupName, - String accountName, String deploymentName, PatchResourceTagsAndSku deployment) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, accountName, deploymentName, deployment); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DeploymentInner.class, DeploymentInner.class, this.client.getContext()); - } - - /** - * Update specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentInner> beginUpdate(String resourceGroupName, - String accountName, String deploymentName, PatchResourceTagsAndSku deployment) { - Response response = updateWithResponse(resourceGroupName, accountName, deploymentName, deployment); - return this.client.getLroResult(response, DeploymentInner.class, - DeploymentInner.class, Context.NONE); - } - - /** - * Update specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentInner> beginUpdate(String resourceGroupName, - String accountName, String deploymentName, PatchResourceTagsAndSku deployment, Context context) { - Response response - = updateWithResponse(resourceGroupName, accountName, deploymentName, deployment, context); - return this.client.getLroResult(response, DeploymentInner.class, - DeploymentInner.class, context); - } - - /** - * Update specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String accountName, String deploymentName, - PatchResourceTagsAndSku deployment) { - return beginUpdateAsync(resourceGroupName, accountName, deploymentName, deployment).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentInner update(String resourceGroupName, String accountName, String deploymentName, - PatchResourceTagsAndSku deployment) { - return beginUpdate(resourceGroupName, accountName, deploymentName, deployment).getFinalResult(); - } - - /** - * Update specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param deployment The deployment 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 cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentInner update(String resourceGroupName, String accountName, String deploymentName, - PatchResourceTagsAndSku deployment, Context context) { - return beginUpdate(resourceGroupName, accountName, deploymentName, deployment, context).getFinalResult(); - } - - /** - * Deletes the specified deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String deploymentName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String deploymentName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, Context.NONE); - } - - /** - * Deletes the specified deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String accountName, String deploymentName, - Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, context); - } - - /** - * Deletes the specified deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String deploymentName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName, deploymentName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes the specified deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String deploymentName) { - Response response = deleteWithResponse(resourceGroupName, accountName, deploymentName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Deletes the specified deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String deploymentName, Context context) { - Response response = deleteWithResponse(resourceGroupName, accountName, deploymentName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Deletes the specified deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String deploymentName) { - return beginDeleteAsync(resourceGroupName, accountName, deploymentName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String deploymentName) { - beginDelete(resourceGroupName, accountName, deploymentName).getFinalResult(); - } - - /** - * Deletes the specified deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String deploymentName, Context context) { - beginDelete(resourceGroupName, accountName, deploymentName, context).getFinalResult(); - } - - /** - * Gets the deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployments associated with the Cognitive Services account along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, 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 deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployments associated with the Cognitive Services account as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployments associated with the Cognitive Services account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 deployments associated with the Cognitive Services account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployments associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Gets the deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 deployments associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Lists the specified deployments skus associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSkusSinglePageAsync(String resourceGroupName, String accountName, - String deploymentName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listSkus(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the specified deployments skus associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSkusAsync(String resourceGroupName, String accountName, - String deploymentName) { - return new PagedFlux<>(() -> listSkusSinglePageAsync(resourceGroupName, accountName, deploymentName), - nextLink -> listSkusNextSinglePageAsync(nextLink)); - } - - /** - * Lists the specified deployments skus associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSkusSinglePage(String resourceGroupName, String accountName, - String deploymentName) { - final String accept = "application/json"; - Response res - = service.listSkusSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists the specified deployments skus associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services 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 list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSkusSinglePage(String resourceGroupName, String accountName, - String deploymentName, Context context) { - final String accept = "application/json"; - Response res - = service.listSkusSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists the specified deployments skus associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSkus(String resourceGroupName, String accountName, - String deploymentName) { - return new PagedIterable<>(() -> listSkusSinglePage(resourceGroupName, accountName, deploymentName), - nextLink -> listSkusNextSinglePage(nextLink)); - } - - /** - * Lists the specified deployments skus associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services 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 list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSkus(String resourceGroupName, String accountName, String deploymentName, - Context context) { - return new PagedIterable<>(() -> listSkusSinglePage(resourceGroupName, accountName, deploymentName, context), - nextLink -> listSkusNextSinglePage(nextLink, context)); - } - - /** - * Pause a deployment - * - * Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see - * #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, DataZoneStandard, and - * GlobalStandard SKUs support this operation. Inference requests to the paused deployment endpoint will receive - * HTTP 423 (Locked). This operation is idempotent. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account deployment along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> pauseWithResponseAsync(String resourceGroupName, String accountName, - String deploymentName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.pause(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Pause a deployment - * - * Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see - * #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, DataZoneStandard, and - * GlobalStandard SKUs support this operation. Inference requests to the paused deployment endpoint will receive - * HTTP 423 (Locked). This operation is idempotent. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account deployment on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono pauseAsync(String resourceGroupName, String accountName, String deploymentName) { - return pauseWithResponseAsync(resourceGroupName, accountName, deploymentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Pause a deployment - * - * Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see - * #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, DataZoneStandard, and - * GlobalStandard SKUs support this operation. Inference requests to the paused deployment endpoint will receive - * HTTP 423 (Locked). This operation is idempotent. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services 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 cognitive Services account deployment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response pauseWithResponse(String resourceGroupName, String accountName, - String deploymentName, Context context) { - final String accept = "application/json"; - return service.pauseSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, accept, context); - } - - /** - * Pause a deployment - * - * Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see - * #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, DataZoneStandard, and - * GlobalStandard SKUs support this operation. Inference requests to the paused deployment endpoint will receive - * HTTP 423 (Locked). This operation is idempotent. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentInner pause(String resourceGroupName, String accountName, String deploymentName) { - return pauseWithResponse(resourceGroupName, accountName, deploymentName, Context.NONE).getValue(); - } - - /** - * Resume a deployment - * - * Resumes inferencing on a previously paused deployment by setting the deploymentState to 'Running' (see - * #/definitions/DeploymentProperties/properties/deploymentState). This operation is idempotent and can be safely - * called on already running deployments. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account deployment along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> resumeWithResponseAsync(String resourceGroupName, String accountName, - String deploymentName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.resume(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Resume a deployment - * - * Resumes inferencing on a previously paused deployment by setting the deploymentState to 'Running' (see - * #/definitions/DeploymentProperties/properties/deploymentState). This operation is idempotent and can be safely - * called on already running deployments. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account deployment on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono resumeAsync(String resourceGroupName, String accountName, String deploymentName) { - return resumeWithResponseAsync(resourceGroupName, accountName, deploymentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Resume a deployment - * - * Resumes inferencing on a previously paused deployment by setting the deploymentState to 'Running' (see - * #/definitions/DeploymentProperties/properties/deploymentState). This operation is idempotent and can be safely - * called on already running deployments. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services 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 cognitive Services account deployment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response resumeWithResponse(String resourceGroupName, String accountName, - String deploymentName, Context context) { - final String accept = "application/json"; - return service.resumeSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, accept, context); - } - - /** - * Resume a deployment - * - * Resumes inferencing on a previously paused deployment by setting the deploymentState to 'Running' (see - * #/definitions/DeploymentProperties/properties/deploymentState). This operation is idempotent and can be safely - * called on already running deployments. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account deployment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentInner resume(String resourceGroupName, String accountName, String deploymentName) { - return resumeWithResponse(resourceGroupName, accountName, deploymentName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployments associated with the Cognitive Services account along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployments associated with the Cognitive Services account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployments associated with the Cognitive Services account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSkusNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listSkusNext(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 list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSkusNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listSkusNextSync(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 list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSkusNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listSkusNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsImpl.java deleted file mode 100644 index 37796cdad1da..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsImpl.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.DeploymentsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.DeploymentInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.SkuResourceInner; -import com.azure.resourcemanager.cognitiveservices.models.Deployment; -import com.azure.resourcemanager.cognitiveservices.models.Deployments; -import com.azure.resourcemanager.cognitiveservices.models.SkuResource; - -public final class DeploymentsImpl implements Deployments { - private static final ClientLogger LOGGER = new ClientLogger(DeploymentsImpl.class); - - private final DeploymentsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public DeploymentsImpl(DeploymentsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, String deploymentName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, accountName, deploymentName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DeploymentImpl(inner.getValue(), this.manager())); - } - - public Deployment get(String resourceGroupName, String accountName, String deploymentName) { - DeploymentInner inner = this.serviceClient().get(resourceGroupName, accountName, deploymentName); - if (inner != null) { - return new DeploymentImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String accountName, String deploymentName) { - this.serviceClient().delete(resourceGroupName, accountName, deploymentName); - } - - public void delete(String resourceGroupName, String accountName, String deploymentName, Context context) { - this.serviceClient().delete(resourceGroupName, accountName, deploymentName, context); - } - - public PagedIterable list(String resourceGroupName, String accountName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DeploymentImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DeploymentImpl(inner1, this.manager())); - } - - public PagedIterable listSkus(String resourceGroupName, String accountName, String deploymentName) { - PagedIterable inner - = this.serviceClient().listSkus(resourceGroupName, accountName, deploymentName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SkuResourceImpl(inner1, this.manager())); - } - - public PagedIterable listSkus(String resourceGroupName, String accountName, String deploymentName, - Context context) { - PagedIterable inner - = this.serviceClient().listSkus(resourceGroupName, accountName, deploymentName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SkuResourceImpl(inner1, this.manager())); - } - - public Response pauseWithResponse(String resourceGroupName, String accountName, String deploymentName, - Context context) { - Response inner - = this.serviceClient().pauseWithResponse(resourceGroupName, accountName, deploymentName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DeploymentImpl(inner.getValue(), this.manager())); - } - - public Deployment pause(String resourceGroupName, String accountName, String deploymentName) { - DeploymentInner inner = this.serviceClient().pause(resourceGroupName, accountName, deploymentName); - if (inner != null) { - return new DeploymentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response resumeWithResponse(String resourceGroupName, String accountName, String deploymentName, - Context context) { - Response inner - = this.serviceClient().resumeWithResponse(resourceGroupName, accountName, deploymentName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DeploymentImpl(inner.getValue(), this.manager())); - } - - public Deployment resume(String resourceGroupName, String accountName, String deploymentName) { - DeploymentInner inner = this.serviceClient().resume(resourceGroupName, accountName, deploymentName); - if (inner != null) { - return new DeploymentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Deployment 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "deployments"); - if (deploymentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, deploymentName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "deployments"); - if (deploymentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, deploymentName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "deployments"); - if (deploymentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); - } - this.delete(resourceGroupName, accountName, deploymentName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "deployments"); - if (deploymentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); - } - this.delete(resourceGroupName, accountName, deploymentName, context); - } - - private DeploymentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public DeploymentImpl define(String name) { - return new DeploymentImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DomainAvailabilityImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DomainAvailabilityImpl.java deleted file mode 100644 index 68f36850c095..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DomainAvailabilityImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.DomainAvailabilityInner; -import com.azure.resourcemanager.cognitiveservices.models.DomainAvailability; - -public final class DomainAvailabilityImpl implements DomainAvailability { - private DomainAvailabilityInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - DomainAvailabilityImpl(DomainAvailabilityInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public Boolean isSubdomainAvailable() { - return this.innerModel().isSubdomainAvailable(); - } - - public String reason() { - return this.innerModel().reason(); - } - - public String subdomainName() { - return this.innerModel().subdomainName(); - } - - public String type() { - return this.innerModel().type(); - } - - public String kind() { - return this.innerModel().kind(); - } - - public DomainAvailabilityInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopeImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopeImpl.java deleted file mode 100644 index 34268e74ddac..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopeImpl.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.EncryptionScopeInner; -import com.azure.resourcemanager.cognitiveservices.models.EncryptionScope; -import com.azure.resourcemanager.cognitiveservices.models.EncryptionScopeProperties; -import java.util.Collections; -import java.util.Map; - -public final class EncryptionScopeImpl implements EncryptionScope, EncryptionScope.Definition, EncryptionScope.Update { - private EncryptionScopeInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public EncryptionScopeProperties properties() { - return this.innerModel().properties(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public EncryptionScopeInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - private String encryptionScopeName; - - public EncryptionScopeImpl withExistingAccount(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - public EncryptionScope create() { - this.innerObject = serviceManager.serviceClient() - .getEncryptionScopes() - .createOrUpdateWithResponse(resourceGroupName, accountName, encryptionScopeName, this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public EncryptionScope create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getEncryptionScopes() - .createOrUpdateWithResponse(resourceGroupName, accountName, encryptionScopeName, this.innerModel(), context) - .getValue(); - return this; - } - - EncryptionScopeImpl(String name, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new EncryptionScopeInner(); - this.serviceManager = serviceManager; - this.encryptionScopeName = name; - } - - public EncryptionScopeImpl update() { - return this; - } - - public EncryptionScope apply() { - this.innerObject = serviceManager.serviceClient() - .getEncryptionScopes() - .createOrUpdateWithResponse(resourceGroupName, accountName, encryptionScopeName, this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public EncryptionScope apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getEncryptionScopes() - .createOrUpdateWithResponse(resourceGroupName, accountName, encryptionScopeName, this.innerModel(), context) - .getValue(); - return this; - } - - EncryptionScopeImpl(EncryptionScopeInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.encryptionScopeName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "encryptionScopes"); - } - - public EncryptionScope refresh() { - this.innerObject = serviceManager.serviceClient() - .getEncryptionScopes() - .getWithResponse(resourceGroupName, accountName, encryptionScopeName, Context.NONE) - .getValue(); - return this; - } - - public EncryptionScope refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getEncryptionScopes() - .getWithResponse(resourceGroupName, accountName, encryptionScopeName, context) - .getValue(); - return this; - } - - public EncryptionScopeImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public EncryptionScopeImpl withProperties(EncryptionScopeProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopesClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopesClientImpl.java deleted file mode 100644 index dcb8494ef6c6..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopesClientImpl.java +++ /dev/null @@ -1,663 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.EncryptionScopesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.EncryptionScopeInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.EncryptionScopeListResult; -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 EncryptionScopesClient. - */ -public final class EncryptionScopesClientImpl implements EncryptionScopesClient { - /** - * The proxy service used to perform REST calls. - */ - private final EncryptionScopesService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of EncryptionScopesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - EncryptionScopesClientImpl(CognitiveServicesManagementClientImpl client) { - this.service - = RestProxy.create(EncryptionScopesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientEncryptionScopes to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientEncryptionScopes") - public interface EncryptionScopesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes/{encryptionScopeName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("encryptionScopeName") String encryptionScopeName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes/{encryptionScopeName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("encryptionScopeName") String encryptionScopeName, @HeaderParam("Accept") String accept, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes/{encryptionScopeName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("encryptionScopeName") String encryptionScopeName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") EncryptionScopeInner encryptionScope, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes/{encryptionScopeName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("encryptionScopeName") String encryptionScopeName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") EncryptionScopeInner encryptionScope, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes/{encryptionScopeName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("encryptionScopeName") String encryptionScopeName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes/{encryptionScopeName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("encryptionScopeName") String encryptionScopeName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the specified EncryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 EncryptionScope associated with the Cognitive Services account along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String accountName, - String encryptionScopeName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, encryptionScopeName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified EncryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 EncryptionScope associated with the Cognitive Services account on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, - String encryptionScopeName) { - return getWithResponseAsync(resourceGroupName, accountName, encryptionScopeName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the specified EncryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services 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 specified EncryptionScope associated with the Cognitive Services account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, - String encryptionScopeName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, encryptionScopeName, accept, context); - } - - /** - * Gets the specified EncryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 EncryptionScope associated with the Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EncryptionScopeInner get(String resourceGroupName, String accountName, String encryptionScopeName) { - return getWithResponse(resourceGroupName, accountName, encryptionScopeName, Context.NONE).getValue(); - } - - /** - * Update the state of specified encryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @param encryptionScope The encryptionScope 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 cognitive Services EncryptionScope along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String accountName, String encryptionScopeName, EncryptionScopeInner encryptionScope) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, encryptionScopeName, contentType, - accept, encryptionScope, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the state of specified encryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @param encryptionScope The encryptionScope 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 cognitive Services EncryptionScope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, - String encryptionScopeName, EncryptionScopeInner encryptionScope) { - return createOrUpdateWithResponseAsync(resourceGroupName, accountName, encryptionScopeName, encryptionScope) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Update the state of specified encryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @param encryptionScope The encryptionScope 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 cognitive Services EncryptionScope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String encryptionScopeName, EncryptionScopeInner encryptionScope, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, encryptionScopeName, contentType, accept, - encryptionScope, context); - } - - /** - * Update the state of specified encryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @param encryptionScope The encryptionScope 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 cognitive Services EncryptionScope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EncryptionScopeInner createOrUpdate(String resourceGroupName, String accountName, String encryptionScopeName, - EncryptionScopeInner encryptionScope) { - return createOrUpdateWithResponse(resourceGroupName, accountName, encryptionScopeName, encryptionScope, - Context.NONE).getValue(); - } - - /** - * Deletes the specified encryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String encryptionScopeName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, encryptionScopeName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified encryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String encryptionScopeName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, encryptionScopeName, Context.NONE); - } - - /** - * Deletes the specified encryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String accountName, - String encryptionScopeName, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, encryptionScopeName, context); - } - - /** - * Deletes the specified encryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String encryptionScopeName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, accountName, encryptionScopeName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes the specified encryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String encryptionScopeName) { - Response response = deleteWithResponse(resourceGroupName, accountName, encryptionScopeName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Deletes the specified encryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String encryptionScopeName, Context context) { - Response response - = deleteWithResponse(resourceGroupName, accountName, encryptionScopeName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Deletes the specified encryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String encryptionScopeName) { - return beginDeleteAsync(resourceGroupName, accountName, encryptionScopeName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified encryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String encryptionScopeName) { - beginDelete(resourceGroupName, accountName, encryptionScopeName).getFinalResult(); - } - - /** - * Deletes the specified encryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String encryptionScopeName, Context context) { - beginDelete(resourceGroupName, accountName, encryptionScopeName, context).getFinalResult(); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String accountName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, 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 content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 content filters associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, 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 the content filters associated with the Azure OpenAI account along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopesImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopesImpl.java deleted file mode 100644 index 5ce31381d037..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopesImpl.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.EncryptionScopesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.EncryptionScopeInner; -import com.azure.resourcemanager.cognitiveservices.models.EncryptionScope; -import com.azure.resourcemanager.cognitiveservices.models.EncryptionScopes; - -public final class EncryptionScopesImpl implements EncryptionScopes { - private static final ClientLogger LOGGER = new ClientLogger(EncryptionScopesImpl.class); - - private final EncryptionScopesClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public EncryptionScopesImpl(EncryptionScopesClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, - String encryptionScopeName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, accountName, encryptionScopeName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new EncryptionScopeImpl(inner.getValue(), this.manager())); - } - - public EncryptionScope get(String resourceGroupName, String accountName, String encryptionScopeName) { - EncryptionScopeInner inner = this.serviceClient().get(resourceGroupName, accountName, encryptionScopeName); - if (inner != null) { - return new EncryptionScopeImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String accountName, String encryptionScopeName) { - this.serviceClient().delete(resourceGroupName, accountName, encryptionScopeName); - } - - public void delete(String resourceGroupName, String accountName, String encryptionScopeName, Context context) { - this.serviceClient().delete(resourceGroupName, accountName, encryptionScopeName, context); - } - - public PagedIterable list(String resourceGroupName, String accountName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new EncryptionScopeImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new EncryptionScopeImpl(inner1, this.manager())); - } - - public EncryptionScope 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String encryptionScopeName = ResourceManagerUtils.getValueFromIdByName(id, "encryptionScopes"); - if (encryptionScopeName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'encryptionScopes'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, encryptionScopeName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String encryptionScopeName = ResourceManagerUtils.getValueFromIdByName(id, "encryptionScopes"); - if (encryptionScopeName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'encryptionScopes'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, encryptionScopeName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String encryptionScopeName = ResourceManagerUtils.getValueFromIdByName(id, "encryptionScopes"); - if (encryptionScopeName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'encryptionScopes'.", id))); - } - this.delete(resourceGroupName, accountName, encryptionScopeName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String encryptionScopeName = ResourceManagerUtils.getValueFromIdByName(id, "encryptionScopes"); - if (encryptionScopeName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'encryptionScopes'.", id))); - } - this.delete(resourceGroupName, accountName, encryptionScopeName, context); - } - - private EncryptionScopesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public EncryptionScopeImpl define(String name) { - return new EncryptionScopeImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EvaluateDeploymentPoliciesResponseImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EvaluateDeploymentPoliciesResponseImpl.java deleted file mode 100644 index 7e0fd4377f0e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EvaluateDeploymentPoliciesResponseImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.EvaluateDeploymentPoliciesResponseInner; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentPolicyEvaluationResult; -import com.azure.resourcemanager.cognitiveservices.models.EvaluateDeploymentPoliciesResponse; -import java.util.Collections; -import java.util.Map; - -public final class EvaluateDeploymentPoliciesResponseImpl implements EvaluateDeploymentPoliciesResponse { - private EvaluateDeploymentPoliciesResponseInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - EvaluateDeploymentPoliciesResponseImpl(EvaluateDeploymentPoliciesResponseInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public Map results() { - Map inner = this.innerModel().results(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public EvaluateDeploymentPoliciesResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/LocationBasedModelCapacitiesClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/LocationBasedModelCapacitiesClientImpl.java deleted file mode 100644 index e60b2ecb3d74..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/LocationBasedModelCapacitiesClientImpl.java +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.LocationBasedModelCapacitiesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelCapacityListResultValueItemInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.ModelCapacityListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in LocationBasedModelCapacitiesClient. - */ -public final class LocationBasedModelCapacitiesClientImpl implements LocationBasedModelCapacitiesClient { - /** - * The proxy service used to perform REST calls. - */ - private final LocationBasedModelCapacitiesService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of LocationBasedModelCapacitiesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LocationBasedModelCapacitiesClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(LocationBasedModelCapacitiesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientLocationBasedModelCapacities to be - * used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientLocationBasedModelCapacities") - public interface LocationBasedModelCapacitiesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/modelCapacities") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @QueryParam("modelFormat") String modelFormat, - @QueryParam("modelName") String modelName, @QueryParam("modelVersion") String modelVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/modelCapacities") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @QueryParam("modelFormat") String modelFormat, - @QueryParam("modelName") String modelName, @QueryParam("modelVersion") String modelVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List Location Based ModelCapacities. - * - * @param location The location name. - * @param modelFormat The format of the Model. - * @param modelName The name of the Model. - * @param modelVersion The version of the Model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location, - String modelFormat, String modelName, String modelVersion) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, modelFormat, modelName, modelVersion, 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 Location Based ModelCapacities. - * - * @param location The location name. - * @param modelFormat The format of the Model. - * @param modelName The name of the Model. - * @param modelVersion The version of the Model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location, String modelFormat, - String modelName, String modelVersion) { - return new PagedFlux<>(() -> listSinglePageAsync(location, modelFormat, modelName, modelVersion), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List Location Based ModelCapacities. - * - * @param location The location name. - * @param modelFormat The format of the Model. - * @param modelName The name of the Model. - * @param modelVersion The version of the Model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String location, String modelFormat, - String modelName, String modelVersion) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, modelFormat, modelName, modelVersion, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List Location Based ModelCapacities. - * - * @param location The location name. - * @param modelFormat The format of the Model. - * @param modelName The name of the Model. - * @param modelVersion The version of the Model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String location, String modelFormat, - String modelName, String modelVersion, Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, modelFormat, modelName, modelVersion, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List Location Based ModelCapacities. - * - * @param location The location name. - * @param modelFormat The format of the Model. - * @param modelName The name of the Model. - * @param modelVersion The version of the Model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location, String modelFormat, - String modelName, String modelVersion) { - return new PagedIterable<>(() -> listSinglePage(location, modelFormat, modelName, modelVersion), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * List Location Based ModelCapacities. - * - * @param location The location name. - * @param modelFormat The format of the Model. - * @param modelName The name of the Model. - * @param modelVersion The version of the Model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location, String modelFormat, - String modelName, String modelVersion, Context context) { - return new PagedIterable<>(() -> listSinglePage(location, modelFormat, modelName, modelVersion, 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 the list of cognitive services accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/LocationBasedModelCapacitiesImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/LocationBasedModelCapacitiesImpl.java deleted file mode 100644 index 51722dae4d82..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/LocationBasedModelCapacitiesImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.LocationBasedModelCapacitiesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelCapacityListResultValueItemInner; -import com.azure.resourcemanager.cognitiveservices.models.LocationBasedModelCapacities; -import com.azure.resourcemanager.cognitiveservices.models.ModelCapacityListResultValueItem; - -public final class LocationBasedModelCapacitiesImpl implements LocationBasedModelCapacities { - private static final ClientLogger LOGGER = new ClientLogger(LocationBasedModelCapacitiesImpl.class); - - private final LocationBasedModelCapacitiesClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public LocationBasedModelCapacitiesImpl(LocationBasedModelCapacitiesClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String location, String modelFormat, String modelName, - String modelVersion) { - PagedIterable inner - = this.serviceClient().list(location, modelFormat, modelName, modelVersion); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ModelCapacityListResultValueItemImpl(inner1, this.manager())); - } - - public PagedIterable list(String location, String modelFormat, String modelName, - String modelVersion, Context context) { - PagedIterable inner - = this.serviceClient().list(location, modelFormat, modelName, modelVersion, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ModelCapacityListResultValueItemImpl(inner1, this.manager())); - } - - private LocationBasedModelCapacitiesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeCapacitiesClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeCapacitiesClientImpl.java deleted file mode 100644 index c27e8b813013..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeCapacitiesClientImpl.java +++ /dev/null @@ -1,307 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.ManagedComputeCapacitiesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedComputeCapacityInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.ManagedComputeCapacityListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ManagedComputeCapacitiesClient. - */ -public final class ManagedComputeCapacitiesClientImpl implements ManagedComputeCapacitiesClient { - /** - * The proxy service used to perform REST calls. - */ - private final ManagedComputeCapacitiesService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of ManagedComputeCapacitiesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ManagedComputeCapacitiesClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(ManagedComputeCapacitiesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientManagedComputeCapacities to be used - * by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientManagedComputeCapacities") - public interface ManagedComputeCapacitiesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/managedComputeCapacities") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("offer") String offer, @QueryParam("acceleratorType") String acceleratorType, - @QueryParam("deploymentId") String deploymentId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/managedComputeCapacities") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("offer") String offer, @QueryParam("acceleratorType") String acceleratorType, - @QueryParam("deploymentId") String deploymentId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the managed compute capacities for a subscription. Returns available capacity - * per accelerator type, including deployment size information. - * - * @param offer The offer name to query capacity for (required). - * @param acceleratorType Optional accelerator type filter to narrow results to a specific accelerator type. - * @param deploymentId Optional deployment resource ID. When provided, returns capacity for the specific region - * where the deployment is hosted rather than the best available region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managed compute capacities for a subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String offer, String acceleratorType, - String deploymentId) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), offer, acceleratorType, deploymentId, 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 managed compute capacities for a subscription. Returns available capacity - * per accelerator type, including deployment size information. - * - * @param offer The offer name to query capacity for (required). - * @param acceleratorType Optional accelerator type filter to narrow results to a specific accelerator type. - * @param deploymentId Optional deployment resource ID. When provided, returns capacity for the specific region - * where the deployment is hosted rather than the best available region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managed compute capacities for a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String offer, String acceleratorType, - String deploymentId) { - return new PagedFlux<>(() -> listSinglePageAsync(offer, acceleratorType, deploymentId), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the managed compute capacities for a subscription. Returns available capacity - * per accelerator type, including deployment size information. - * - * @param offer The offer name to query capacity for (required). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managed compute capacities for a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String offer) { - final String acceleratorType = null; - final String deploymentId = null; - return new PagedFlux<>(() -> listSinglePageAsync(offer, acceleratorType, deploymentId), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the managed compute capacities for a subscription. Returns available capacity - * per accelerator type, including deployment size information. - * - * @param offer The offer name to query capacity for (required). - * @param acceleratorType Optional accelerator type filter to narrow results to a specific accelerator type. - * @param deploymentId Optional deployment resource ID. When provided, returns capacity for the specific region - * where the deployment is hosted rather than the best available region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managed compute capacities for a subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String offer, String acceleratorType, - String deploymentId) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - offer, acceleratorType, deploymentId, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the managed compute capacities for a subscription. Returns available capacity - * per accelerator type, including deployment size information. - * - * @param offer The offer name to query capacity for (required). - * @param acceleratorType Optional accelerator type filter to narrow results to a specific accelerator type. - * @param deploymentId Optional deployment resource ID. When provided, returns capacity for the specific region - * where the deployment is hosted rather than the best available region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managed compute capacities for a subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String offer, String acceleratorType, - String deploymentId, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - offer, acceleratorType, deploymentId, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the managed compute capacities for a subscription. Returns available capacity - * per accelerator type, including deployment size information. - * - * @param offer The offer name to query capacity for (required). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managed compute capacities for a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String offer) { - final String acceleratorType = null; - final String deploymentId = null; - return new PagedIterable<>(() -> listSinglePage(offer, acceleratorType, deploymentId), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Gets the managed compute capacities for a subscription. Returns available capacity - * per accelerator type, including deployment size information. - * - * @param offer The offer name to query capacity for (required). - * @param acceleratorType Optional accelerator type filter to narrow results to a specific accelerator type. - * @param deploymentId Optional deployment resource ID. When provided, returns capacity for the specific region - * where the deployment is hosted rather than the best available region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managed compute capacities for a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String offer, String acceleratorType, String deploymentId, - Context context) { - return new PagedIterable<>(() -> listSinglePage(offer, acceleratorType, deploymentId, 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 the managed compute capacities for a subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managed compute capacities for a subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managed compute capacities for a subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeCapacitiesImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeCapacitiesImpl.java deleted file mode 100644 index 30fb72330d9e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeCapacitiesImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.ManagedComputeCapacitiesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedComputeCapacityInner; -import com.azure.resourcemanager.cognitiveservices.models.ManagedComputeCapacities; -import com.azure.resourcemanager.cognitiveservices.models.ManagedComputeCapacity; - -public final class ManagedComputeCapacitiesImpl implements ManagedComputeCapacities { - private static final ClientLogger LOGGER = new ClientLogger(ManagedComputeCapacitiesImpl.class); - - private final ManagedComputeCapacitiesClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public ManagedComputeCapacitiesImpl(ManagedComputeCapacitiesClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String offer) { - PagedIterable inner = this.serviceClient().list(offer); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedComputeCapacityImpl(inner1, this.manager())); - } - - public PagedIterable list(String offer, String acceleratorType, String deploymentId, - Context context) { - PagedIterable inner - = this.serviceClient().list(offer, acceleratorType, deploymentId, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedComputeCapacityImpl(inner1, this.manager())); - } - - private ManagedComputeCapacitiesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeCapacityImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeCapacityImpl.java deleted file mode 100644 index 55f46e65428e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeCapacityImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedComputeCapacityInner; -import com.azure.resourcemanager.cognitiveservices.models.ManagedComputeCapacity; -import com.azure.resourcemanager.cognitiveservices.models.ManagedComputeCapacityProperties; - -public final class ManagedComputeCapacityImpl implements ManagedComputeCapacity { - private ManagedComputeCapacityInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - ManagedComputeCapacityImpl(ManagedComputeCapacityInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager 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 ManagedComputeCapacityProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ManagedComputeCapacityInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeDeploymentImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeDeploymentImpl.java deleted file mode 100644 index f144373f890e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeDeploymentImpl.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedComputeDeploymentInner; -import com.azure.resourcemanager.cognitiveservices.models.ManagedComputeDeployment; -import com.azure.resourcemanager.cognitiveservices.models.ManagedComputeDeploymentProperties; -import com.azure.resourcemanager.cognitiveservices.models.PatchResourceSku; -import com.azure.resourcemanager.cognitiveservices.models.Sku; - -public final class ManagedComputeDeploymentImpl - implements ManagedComputeDeployment, ManagedComputeDeployment.Definition, ManagedComputeDeployment.Update { - private ManagedComputeDeploymentInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public ManagedComputeDeploymentProperties properties() { - return this.innerModel().properties(); - } - - public Sku sku() { - return this.innerModel().sku(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public ManagedComputeDeploymentInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - private String deploymentName; - - private PatchResourceSku updateProperties; - - public ManagedComputeDeploymentImpl withExistingAccount(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - public ManagedComputeDeployment create() { - this.innerObject = serviceManager.serviceClient() - .getManagedComputeDeployments() - .createOrUpdate(resourceGroupName, accountName, deploymentName, this.innerModel(), Context.NONE); - return this; - } - - public ManagedComputeDeployment create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getManagedComputeDeployments() - .createOrUpdate(resourceGroupName, accountName, deploymentName, this.innerModel(), context); - return this; - } - - ManagedComputeDeploymentImpl(String name, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new ManagedComputeDeploymentInner(); - this.serviceManager = serviceManager; - this.deploymentName = name; - } - - public ManagedComputeDeploymentImpl update() { - this.updateProperties = new PatchResourceSku(); - return this; - } - - public ManagedComputeDeployment apply() { - this.innerObject = serviceManager.serviceClient() - .getManagedComputeDeployments() - .update(resourceGroupName, accountName, deploymentName, updateProperties, Context.NONE); - return this; - } - - public ManagedComputeDeployment apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getManagedComputeDeployments() - .update(resourceGroupName, accountName, deploymentName, updateProperties, context); - return this; - } - - ManagedComputeDeploymentImpl(ManagedComputeDeploymentInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.deploymentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "managedComputeDeployments"); - } - - public ManagedComputeDeployment refresh() { - this.innerObject = serviceManager.serviceClient() - .getManagedComputeDeployments() - .getWithResponse(resourceGroupName, accountName, deploymentName, Context.NONE) - .getValue(); - return this; - } - - public ManagedComputeDeployment refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getManagedComputeDeployments() - .getWithResponse(resourceGroupName, accountName, deploymentName, context) - .getValue(); - return this; - } - - public ManagedComputeDeploymentImpl withProperties(ManagedComputeDeploymentProperties properties) { - this.innerModel().withProperties(properties); - return this; - } - - public ManagedComputeDeploymentImpl withSku(Sku sku) { - if (isInCreateMode()) { - this.innerModel().withSku(sku); - return this; - } else { - this.updateProperties.withSku(sku); - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel() == null || this.innerModel().id() == null; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeDeploymentsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeDeploymentsClientImpl.java deleted file mode 100644 index e62a84240b77..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeDeploymentsClientImpl.java +++ /dev/null @@ -1,999 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.Patch; -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.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.ManagedComputeDeploymentsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedComputeDeploymentInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.ManagedComputeDeploymentListResult; -import com.azure.resourcemanager.cognitiveservices.models.PatchResourceSku; -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 ManagedComputeDeploymentsClient. - */ -public final class ManagedComputeDeploymentsClientImpl implements ManagedComputeDeploymentsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ManagedComputeDeploymentsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of ManagedComputeDeploymentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ManagedComputeDeploymentsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(ManagedComputeDeploymentsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientManagedComputeDeployments to be used - * by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientManagedComputeDeployments") - public interface ManagedComputeDeploymentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedComputeDeployments/{deploymentName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedComputeDeployments/{deploymentName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedComputeDeployments/{deploymentName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") ManagedComputeDeploymentInner resource, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedComputeDeployments/{deploymentName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") ManagedComputeDeploymentInner resource, - Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedComputeDeployments/{deploymentName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") PatchResourceSku properties, - Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedComputeDeployments/{deploymentName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") PatchResourceSku properties, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedComputeDeployments/{deploymentName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedComputeDeployments/{deploymentName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("deploymentName") String deploymentName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedComputeDeployments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedComputeDeployments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 managed compute deployment associated with the Cognitive Services account along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String accountName, String deploymentName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 managed compute deployment associated with the Cognitive Services account on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, - String deploymentName) { - return getWithResponseAsync(resourceGroupName, accountName, deploymentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services 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 specified managed compute deployment associated with the Cognitive Services account along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, - String deploymentName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, deploymentName, accept, context); - } - - /** - * Gets the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 managed compute deployment associated with the Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedComputeDeploymentInner get(String resourceGroupName, String accountName, String deploymentName) { - return getWithResponse(resourceGroupName, accountName, deploymentName, Context.NONE).getValue(); - } - - /** - * Creates or updates a managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param resource The managed compute deployment 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 cognitive Services account managed compute deployment, backed by managed compute (GPU) resources along - * with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String accountName, String deploymentName, ManagedComputeDeploymentInner resource) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, contentType, accept, - resource, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param resource The managed compute deployment 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 cognitive Services account managed compute deployment, backed by managed compute (GPU) resources along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String deploymentName, ManagedComputeDeploymentInner resource) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, contentType, accept, - resource, Context.NONE); - } - - /** - * Creates or updates a managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param resource The managed compute deployment 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 cognitive Services account managed compute deployment, backed by managed compute (GPU) resources along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String deploymentName, ManagedComputeDeploymentInner resource, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, contentType, accept, - resource, context); - } - - /** - * Creates or updates a managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param resource The managed compute deployment 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 cognitive Services account managed compute deployment, backed by - * managed compute (GPU) resources. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ManagedComputeDeploymentInner> - beginCreateOrUpdateAsync(String resourceGroupName, String accountName, String deploymentName, - ManagedComputeDeploymentInner resource) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, accountName, deploymentName, resource); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ManagedComputeDeploymentInner.class, ManagedComputeDeploymentInner.class, - this.client.getContext()); - } - - /** - * Creates or updates a managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param resource The managed compute deployment 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 cognitive Services account managed compute deployment, backed by - * managed compute (GPU) resources. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ManagedComputeDeploymentInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String deploymentName, ManagedComputeDeploymentInner resource) { - Response response - = createOrUpdateWithResponse(resourceGroupName, accountName, deploymentName, resource); - return this.client.getLroResult(response, - ManagedComputeDeploymentInner.class, ManagedComputeDeploymentInner.class, Context.NONE); - } - - /** - * Creates or updates a managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param resource The managed compute deployment 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 cognitive Services account managed compute deployment, backed by - * managed compute (GPU) resources. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ManagedComputeDeploymentInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String deploymentName, ManagedComputeDeploymentInner resource, - Context context) { - Response response - = createOrUpdateWithResponse(resourceGroupName, accountName, deploymentName, resource, context); - return this.client.getLroResult(response, - ManagedComputeDeploymentInner.class, ManagedComputeDeploymentInner.class, context); - } - - /** - * Creates or updates a managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param resource The managed compute deployment 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 cognitive Services account managed compute deployment, backed by managed compute (GPU) resources on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, - String deploymentName, ManagedComputeDeploymentInner resource) { - return beginCreateOrUpdateAsync(resourceGroupName, accountName, deploymentName, resource).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param resource The managed compute deployment 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 cognitive Services account managed compute deployment, backed by managed compute (GPU) resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedComputeDeploymentInner createOrUpdate(String resourceGroupName, String accountName, - String deploymentName, ManagedComputeDeploymentInner resource) { - return beginCreateOrUpdate(resourceGroupName, accountName, deploymentName, resource).getFinalResult(); - } - - /** - * Creates or updates a managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param resource The managed compute deployment 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 cognitive Services account managed compute deployment, backed by managed compute (GPU) resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedComputeDeploymentInner createOrUpdate(String resourceGroupName, String accountName, - String deploymentName, ManagedComputeDeploymentInner resource, Context context) { - return beginCreateOrUpdate(resourceGroupName, accountName, deploymentName, resource, context).getFinalResult(); - } - - /** - * Updates the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param properties The managed compute deployment patch 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 cognitive Services account managed compute deployment, backed by managed compute (GPU) resources along - * with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String accountName, - String deploymentName, PatchResourceSku properties) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, contentType, accept, - properties, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param properties The managed compute deployment patch 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 cognitive Services account managed compute deployment, backed by managed compute (GPU) resources along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String accountName, String deploymentName, - PatchResourceSku properties) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, contentType, accept, - properties, Context.NONE); - } - - /** - * Updates the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param properties The managed compute deployment patch 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 cognitive Services account managed compute deployment, backed by managed compute (GPU) resources along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String accountName, String deploymentName, - PatchResourceSku properties, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, contentType, accept, - properties, context); - } - - /** - * Updates the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param properties The managed compute deployment patch 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 cognitive Services account managed compute deployment, backed by - * managed compute (GPU) resources. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ManagedComputeDeploymentInner> beginUpdateAsync( - String resourceGroupName, String accountName, String deploymentName, PatchResourceSku properties) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, accountName, deploymentName, properties); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ManagedComputeDeploymentInner.class, ManagedComputeDeploymentInner.class, - this.client.getContext()); - } - - /** - * Updates the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param properties The managed compute deployment patch 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 cognitive Services account managed compute deployment, backed by - * managed compute (GPU) resources. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ManagedComputeDeploymentInner> - beginUpdate(String resourceGroupName, String accountName, String deploymentName, PatchResourceSku properties) { - Response response = updateWithResponse(resourceGroupName, accountName, deploymentName, properties); - return this.client.getLroResult(response, - ManagedComputeDeploymentInner.class, ManagedComputeDeploymentInner.class, Context.NONE); - } - - /** - * Updates the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param properties The managed compute deployment patch 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 cognitive Services account managed compute deployment, backed by - * managed compute (GPU) resources. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ManagedComputeDeploymentInner> beginUpdate( - String resourceGroupName, String accountName, String deploymentName, PatchResourceSku properties, - Context context) { - Response response - = updateWithResponse(resourceGroupName, accountName, deploymentName, properties, context); - return this.client.getLroResult(response, - ManagedComputeDeploymentInner.class, ManagedComputeDeploymentInner.class, context); - } - - /** - * Updates the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param properties The managed compute deployment patch 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 cognitive Services account managed compute deployment, backed by managed compute (GPU) resources on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String accountName, - String deploymentName, PatchResourceSku properties) { - return beginUpdateAsync(resourceGroupName, accountName, deploymentName, properties).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param properties The managed compute deployment patch 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 cognitive Services account managed compute deployment, backed by managed compute (GPU) resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedComputeDeploymentInner update(String resourceGroupName, String accountName, String deploymentName, - PatchResourceSku properties) { - return beginUpdate(resourceGroupName, accountName, deploymentName, properties).getFinalResult(); - } - - /** - * Updates the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @param properties The managed compute deployment patch 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 cognitive Services account managed compute deployment, backed by managed compute (GPU) resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedComputeDeploymentInner update(String resourceGroupName, String accountName, String deploymentName, - PatchResourceSku properties, Context context) { - return beginUpdate(resourceGroupName, accountName, deploymentName, properties, context).getFinalResult(); - } - - /** - * Deletes the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String deploymentName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String deploymentName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, Context.NONE); - } - - /** - * Deletes the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String accountName, String deploymentName, - Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, context); - } - - /** - * Deletes the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String deploymentName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName, deploymentName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String deploymentName) { - Response response = deleteWithResponse(resourceGroupName, accountName, deploymentName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Deletes the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String deploymentName, Context context) { - Response response = deleteWithResponse(resourceGroupName, accountName, deploymentName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Deletes the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String deploymentName) { - return beginDeleteAsync(resourceGroupName, accountName, deploymentName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String deploymentName) { - beginDelete(resourceGroupName, accountName, deploymentName).getFinalResult(); - } - - /** - * Deletes the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String deploymentName, Context context) { - beginDelete(resourceGroupName, accountName, deploymentName, context).getFinalResult(); - } - - /** - * Gets the managed compute deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managed compute deployments associated with the Cognitive Services account along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String accountName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, 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 managed compute deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managed compute deployments associated with the Cognitive Services account as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the managed compute deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managed compute deployments associated with the Cognitive Services account along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the managed compute deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 managed compute deployments associated with the Cognitive Services account along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the managed compute deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managed compute deployments associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Gets the managed compute deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 managed compute deployments associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, - Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, 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 the managed compute deployments associated with the Cognitive Services account along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managed compute deployments associated with the Cognitive Services account along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managed compute deployments associated with the Cognitive Services account along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeDeploymentsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeDeploymentsImpl.java deleted file mode 100644 index abad03806b74..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeDeploymentsImpl.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.ManagedComputeDeploymentsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedComputeDeploymentInner; -import com.azure.resourcemanager.cognitiveservices.models.ManagedComputeDeployment; -import com.azure.resourcemanager.cognitiveservices.models.ManagedComputeDeployments; - -public final class ManagedComputeDeploymentsImpl implements ManagedComputeDeployments { - private static final ClientLogger LOGGER = new ClientLogger(ManagedComputeDeploymentsImpl.class); - - private final ManagedComputeDeploymentsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public ManagedComputeDeploymentsImpl(ManagedComputeDeploymentsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, - String deploymentName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, accountName, deploymentName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ManagedComputeDeploymentImpl(inner.getValue(), this.manager())); - } - - public ManagedComputeDeployment get(String resourceGroupName, String accountName, String deploymentName) { - ManagedComputeDeploymentInner inner = this.serviceClient().get(resourceGroupName, accountName, deploymentName); - if (inner != null) { - return new ManagedComputeDeploymentImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String accountName, String deploymentName) { - this.serviceClient().delete(resourceGroupName, accountName, deploymentName); - } - - public void delete(String resourceGroupName, String accountName, String deploymentName, Context context) { - this.serviceClient().delete(resourceGroupName, accountName, deploymentName, context); - } - - public PagedIterable list(String resourceGroupName, String accountName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedComputeDeploymentImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedComputeDeploymentImpl(inner1, this.manager())); - } - - public ManagedComputeDeployment 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "managedComputeDeployments"); - if (deploymentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'managedComputeDeployments'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, deploymentName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "managedComputeDeployments"); - if (deploymentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'managedComputeDeployments'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, deploymentName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "managedComputeDeployments"); - if (deploymentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'managedComputeDeployments'.", id))); - } - this.delete(resourceGroupName, accountName, deploymentName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "managedComputeDeployments"); - if (deploymentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'managedComputeDeployments'.", id))); - } - this.delete(resourceGroupName, accountName, deploymentName, context); - } - - private ManagedComputeDeploymentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public ManagedComputeDeploymentImpl define(String name) { - return new ManagedComputeDeploymentImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeUsageImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeUsageImpl.java deleted file mode 100644 index 66a017172610..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeUsageImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedComputeUsageInner; -import com.azure.resourcemanager.cognitiveservices.models.ManagedComputeDeploymentInfo; -import com.azure.resourcemanager.cognitiveservices.models.ManagedComputeUsage; -import com.azure.resourcemanager.cognitiveservices.models.MetricName; -import com.azure.resourcemanager.cognitiveservices.models.UnitType; -import java.util.Collections; -import java.util.List; - -public final class ManagedComputeUsageImpl implements ManagedComputeUsage { - private ManagedComputeUsageInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - ManagedComputeUsageImpl(ManagedComputeUsageInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public MetricName name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public UnitType unit() { - return this.innerModel().unit(); - } - - public Double limit() { - return this.innerModel().limit(); - } - - public Double currentValue() { - return this.innerModel().currentValue(); - } - - public String offerScope() { - return this.innerModel().offerScope(); - } - - public List deployments() { - List inner = this.innerModel().deployments(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public ManagedComputeUsageInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeUsagesOperationGroupsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeUsagesOperationGroupsClientImpl.java deleted file mode 100644 index 4fc86e1b0f42..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeUsagesOperationGroupsClientImpl.java +++ /dev/null @@ -1,255 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.ManagedComputeUsagesOperationGroupsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedComputeUsageInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.ManagedComputeUsageListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ManagedComputeUsagesOperationGroupsClient. - */ -public final class ManagedComputeUsagesOperationGroupsClientImpl implements ManagedComputeUsagesOperationGroupsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ManagedComputeUsagesOperationGroupsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of ManagedComputeUsagesOperationGroupsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ManagedComputeUsagesOperationGroupsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(ManagedComputeUsagesOperationGroupsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientManagedComputeUsagesOperationGroups - * to be used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientManagedComputeUsagesOperationGroups") - public interface ManagedComputeUsagesOperationGroupsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/managedComputeUsages") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/managedComputeUsages") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * List managed compute quota usages for a subscription and location. - * - * @param location The location name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed compute quota entries along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, 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 managed compute quota usages for a subscription and location. - * - * @param location The location name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed compute quota entries as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location) { - return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List managed compute quota usages for a subscription and location. - * - * @param location The location name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed compute quota entries along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String location) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List managed compute quota usages for a subscription and location. - * - * @param location The location 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 list of managed compute quota entries along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String location, Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List managed compute quota usages for a subscription and location. - * - * @param location The location name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed compute quota entries as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location) { - return new PagedIterable<>(() -> listSinglePage(location), nextLink -> listNextSinglePage(nextLink)); - } - - /** - * List managed compute quota usages for a subscription and location. - * - * @param location The location 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 list of managed compute quota entries as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location, Context context) { - return new PagedIterable<>(() -> listSinglePage(location, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed compute quota entries along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed compute quota entries along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed compute quota entries along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeUsagesOperationGroupsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeUsagesOperationGroupsImpl.java deleted file mode 100644 index 3d567db02332..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedComputeUsagesOperationGroupsImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.ManagedComputeUsagesOperationGroupsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedComputeUsageInner; -import com.azure.resourcemanager.cognitiveservices.models.ManagedComputeUsage; -import com.azure.resourcemanager.cognitiveservices.models.ManagedComputeUsagesOperationGroups; - -public final class ManagedComputeUsagesOperationGroupsImpl implements ManagedComputeUsagesOperationGroups { - private static final ClientLogger LOGGER = new ClientLogger(ManagedComputeUsagesOperationGroupsImpl.class); - - private final ManagedComputeUsagesOperationGroupsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public ManagedComputeUsagesOperationGroupsImpl(ManagedComputeUsagesOperationGroupsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String location) { - PagedIterable inner = this.serviceClient().list(location); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedComputeUsageImpl(inner1, this.manager())); - } - - public PagedIterable list(String location, Context context) { - PagedIterable inner = this.serviceClient().list(location, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ManagedComputeUsageImpl(inner1, this.manager())); - } - - private ManagedComputeUsagesOperationGroupsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionStatusImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionStatusImpl.java deleted file mode 100644 index fb2da22bf3e6..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionStatusImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; -import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisionStatus; -import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkStatus; - -public final class ManagedNetworkProvisionStatusImpl implements ManagedNetworkProvisionStatus { - private ManagedNetworkProvisionStatusInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - ManagedNetworkProvisionStatusImpl(ManagedNetworkProvisionStatusInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public ManagedNetworkStatus status() { - return this.innerModel().status(); - } - - public ManagedNetworkProvisionStatusInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionsClientImpl.java deleted file mode 100644 index 430d3c3154cb..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionsClientImpl.java +++ /dev/null @@ -1,352 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkProvisionsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; -import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisionOptions; -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 ManagedNetworkProvisionsClient. - */ -public final class ManagedNetworkProvisionsClientImpl implements ManagedNetworkProvisionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ManagedNetworkProvisionsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of ManagedNetworkProvisionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ManagedNetworkProvisionsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(ManagedNetworkProvisionsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientManagedNetworkProvisions to be used - * by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientManagedNetworkProvisions") - public interface ManagedNetworkProvisionsService { - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/provision") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> provisionManagedNetwork(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ManagedNetworkProvisionOptions body, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/provision") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response provisionManagedNetworkSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ManagedNetworkProvisionOptions body, Context context); - } - - /** - * Provisions the managed network of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body Managed Network Provisioning Options for a cognitive services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> provisionManagedNetworkWithResponseAsync(String resourceGroupName, - String accountName, String managedNetworkName, ManagedNetworkProvisionOptions body) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.provisionManagedNetwork(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, - managedNetworkName, accept, body, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Provisions the managed network of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body Managed Network Provisioning Options for a cognitive services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 provisionManagedNetworkWithResponse(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkProvisionOptions body) { - final String accept = "application/json"; - return service.provisionManagedNetworkSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, accept, body, - Context.NONE); - } - - /** - * Provisions the managed network of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body Managed Network Provisioning Options for a cognitive services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response provisionManagedNetworkWithResponse(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkProvisionOptions body, Context context) { - final String accept = "application/json"; - return service.provisionManagedNetworkSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, accept, body, context); - } - - /** - * Provisions the managed network of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body Managed Network Provisioning Options for a cognitive services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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, ManagedNetworkProvisionStatusInner> - beginProvisionManagedNetworkAsync(String resourceGroupName, String accountName, String managedNetworkName, - ManagedNetworkProvisionOptions body) { - Mono>> mono - = provisionManagedNetworkWithResponseAsync(resourceGroupName, accountName, managedNetworkName, body); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ManagedNetworkProvisionStatusInner.class, - ManagedNetworkProvisionStatusInner.class, this.client.getContext()); - } - - /** - * Provisions the managed network of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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, ManagedNetworkProvisionStatusInner> - beginProvisionManagedNetworkAsync(String resourceGroupName, String accountName, String managedNetworkName) { - final ManagedNetworkProvisionOptions body = null; - Mono>> mono - = provisionManagedNetworkWithResponseAsync(resourceGroupName, accountName, managedNetworkName, body); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ManagedNetworkProvisionStatusInner.class, - ManagedNetworkProvisionStatusInner.class, this.client.getContext()); - } - - /** - * Provisions the managed network of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body Managed Network Provisioning Options for a cognitive services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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, ManagedNetworkProvisionStatusInner> - beginProvisionManagedNetwork(String resourceGroupName, String accountName, String managedNetworkName, - ManagedNetworkProvisionOptions body) { - Response response - = provisionManagedNetworkWithResponse(resourceGroupName, accountName, managedNetworkName, body); - return this.client.getLroResult( - response, ManagedNetworkProvisionStatusInner.class, ManagedNetworkProvisionStatusInner.class, Context.NONE); - } - - /** - * Provisions the managed network of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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, ManagedNetworkProvisionStatusInner> - beginProvisionManagedNetwork(String resourceGroupName, String accountName, String managedNetworkName) { - final ManagedNetworkProvisionOptions body = null; - Response response - = provisionManagedNetworkWithResponse(resourceGroupName, accountName, managedNetworkName, body); - return this.client.getLroResult( - response, ManagedNetworkProvisionStatusInner.class, ManagedNetworkProvisionStatusInner.class, Context.NONE); - } - - /** - * Provisions the managed network of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body Managed Network Provisioning Options for a cognitive services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ManagedNetworkProvisionStatusInner> - beginProvisionManagedNetwork(String resourceGroupName, String accountName, String managedNetworkName, - ManagedNetworkProvisionOptions body, Context context) { - Response response - = provisionManagedNetworkWithResponse(resourceGroupName, accountName, managedNetworkName, body, context); - return this.client.getLroResult( - response, ManagedNetworkProvisionStatusInner.class, ManagedNetworkProvisionStatusInner.class, context); - } - - /** - * Provisions the managed network of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body Managed Network Provisioning Options for a cognitive services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono provisionManagedNetworkAsync(String resourceGroupName, - String accountName, String managedNetworkName, ManagedNetworkProvisionOptions body) { - return beginProvisionManagedNetworkAsync(resourceGroupName, accountName, managedNetworkName, body).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Provisions the managed network of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono provisionManagedNetworkAsync(String resourceGroupName, - String accountName, String managedNetworkName) { - final ManagedNetworkProvisionOptions body = null; - return beginProvisionManagedNetworkAsync(resourceGroupName, accountName, managedNetworkName, body).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Provisions the managed network of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedNetworkProvisionStatusInner provisionManagedNetwork(String resourceGroupName, String accountName, - String managedNetworkName) { - final ManagedNetworkProvisionOptions body = null; - return beginProvisionManagedNetwork(resourceGroupName, accountName, managedNetworkName, body).getFinalResult(); - } - - /** - * Provisions the managed network of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body Managed Network Provisioning Options for a cognitive services 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 response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedNetworkProvisionStatusInner provisionManagedNetwork(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkProvisionOptions body, Context context) { - return beginProvisionManagedNetwork(resourceGroupName, accountName, managedNetworkName, body, context) - .getFinalResult(); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionsImpl.java deleted file mode 100644 index 201f5483579b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionsImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkProvisionsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; -import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisionOptions; -import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisionStatus; -import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisions; - -public final class ManagedNetworkProvisionsImpl implements ManagedNetworkProvisions { - private static final ClientLogger LOGGER = new ClientLogger(ManagedNetworkProvisionsImpl.class); - - private final ManagedNetworkProvisionsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public ManagedNetworkProvisionsImpl(ManagedNetworkProvisionsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public ManagedNetworkProvisionStatus provisionManagedNetwork(String resourceGroupName, String accountName, - String managedNetworkName) { - ManagedNetworkProvisionStatusInner inner - = this.serviceClient().provisionManagedNetwork(resourceGroupName, accountName, managedNetworkName); - if (inner != null) { - return new ManagedNetworkProvisionStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - public ManagedNetworkProvisionStatus provisionManagedNetwork(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkProvisionOptions body, Context context) { - ManagedNetworkProvisionStatusInner inner = this.serviceClient() - .provisionManagedNetwork(resourceGroupName, accountName, managedNetworkName, body, context); - if (inner != null) { - return new ManagedNetworkProvisionStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - private ManagedNetworkProvisionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsBasicResourceImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsBasicResourceImpl.java deleted file mode 100644 index 17d13e943228..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsBasicResourceImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsBasicResourceInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsInner; -import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettings; -import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsBasicResource; - -public final class ManagedNetworkSettingsBasicResourceImpl implements ManagedNetworkSettingsBasicResource { - private ManagedNetworkSettingsBasicResourceInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - ManagedNetworkSettingsBasicResourceImpl(ManagedNetworkSettingsBasicResourceInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager 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 ManagedNetworkSettings properties() { - ManagedNetworkSettingsInner inner = this.innerModel().properties(); - if (inner != null) { - return new ManagedNetworkSettingsImpl(inner, this.manager()); - } else { - return null; - } - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ManagedNetworkSettingsBasicResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsImpl.java deleted file mode 100644 index 58675f5f1f30..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsInner; -import com.azure.resourcemanager.cognitiveservices.models.FirewallSku; -import com.azure.resourcemanager.cognitiveservices.models.IsolationMode; -import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkKind; -import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisionStatus; -import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisioningState; -import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettings; -import com.azure.resourcemanager.cognitiveservices.models.OutboundRule; -import java.util.Collections; -import java.util.Map; - -public final class ManagedNetworkSettingsImpl implements ManagedNetworkSettings { - private ManagedNetworkSettingsInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - ManagedNetworkSettingsImpl(ManagedNetworkSettingsInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public IsolationMode isolationMode() { - return this.innerModel().isolationMode(); - } - - public String networkId() { - return this.innerModel().networkId(); - } - - public Map outboundRules() { - Map inner = this.innerModel().outboundRules(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public ManagedNetworkProvisionStatus status() { - ManagedNetworkProvisionStatusInner inner = this.innerModel().status(); - if (inner != null) { - return new ManagedNetworkProvisionStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - public FirewallSku firewallSku() { - return this.innerModel().firewallSku(); - } - - public ManagedNetworkKind managedNetworkKind() { - return this.innerModel().managedNetworkKind(); - } - - public String firewallPublicIpAddress() { - return this.innerModel().firewallPublicIpAddress(); - } - - public ManagedNetworkProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public ManagedNetworkSettingsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsOperationsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsOperationsClientImpl.java deleted file mode 100644 index efc7a6f4e984..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsOperationsClientImpl.java +++ /dev/null @@ -1,1121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.Patch; -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.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkSettingsOperationsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsPropertiesBasicResourceInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.ManagedNetworkListResult; -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 ManagedNetworkSettingsOperationsClient. - */ -public final class ManagedNetworkSettingsOperationsClientImpl implements ManagedNetworkSettingsOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ManagedNetworkSettingsOperationsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of ManagedNetworkSettingsOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ManagedNetworkSettingsOperationsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(ManagedNetworkSettingsOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientManagedNetworkSettingsOperations to - * be used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientManagedNetworkSettingsOperations") - public interface ManagedNetworkSettingsOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Accept") String accept, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> put(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response putSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> patch(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response patchSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("managedNetworkName") String managedNetworkName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("managedNetworkName") String managedNetworkName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return aPI for managed network settings of a cognitive services account along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getWithResponseAsync(String resourceGroupName, String accountName, String managedNetworkName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return aPI for managed network settings of a cognitive services account on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, - String accountName, String managedNetworkName) { - return getWithResponseAsync(resourceGroupName, accountName, managedNetworkName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return aPI for managed network settings of a cognitive services account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, - String accountName, String managedNetworkName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, managedNetworkName, accept, context); - } - - /** - * Get API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return aPI for managed network settings of a cognitive services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedNetworkSettingsPropertiesBasicResourceInner get(String resourceGroupName, String accountName, - String managedNetworkName) { - return getWithResponse(resourceGroupName, accountName, managedNetworkName, Context.NONE).getValue(); - } - - /** - * PUT API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> putWithResponseAsync(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.put(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, contentType, - accept, body, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * PUT API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response putWithResponse(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.putSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, managedNetworkName, contentType, accept, body, Context.NONE); - } - - /** - * PUT API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the 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 concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response putWithResponse(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.putSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, managedNetworkName, contentType, accept, body, context); - } - - /** - * PUT API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 concrete proxy resource types can be created by aliasing this type - * using a specific property type. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private - PollerFlux, ManagedNetworkSettingsPropertiesBasicResourceInner> - beginPutAsync(String resourceGroupName, String accountName, String managedNetworkName, - ManagedNetworkSettingsPropertiesBasicResourceInner body) { - Mono>> mono - = putWithResponseAsync(resourceGroupName, accountName, managedNetworkName, body); - return this.client - .getLroResult( - mono, this.client.getHttpPipeline(), ManagedNetworkSettingsPropertiesBasicResourceInner.class, - ManagedNetworkSettingsPropertiesBasicResourceInner.class, this.client.getContext()); - } - - /** - * PUT API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 concrete proxy resource types can be created by aliasing this type - * using a specific property type. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public - SyncPoller, ManagedNetworkSettingsPropertiesBasicResourceInner> - beginPut(String resourceGroupName, String accountName, String managedNetworkName, - ManagedNetworkSettingsPropertiesBasicResourceInner body) { - Response response = putWithResponse(resourceGroupName, accountName, managedNetworkName, body); - return this.client - .getLroResult( - response, ManagedNetworkSettingsPropertiesBasicResourceInner.class, - ManagedNetworkSettingsPropertiesBasicResourceInner.class, Context.NONE); - } - - /** - * PUT API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the 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 {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type - * using a specific property type. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public - SyncPoller, ManagedNetworkSettingsPropertiesBasicResourceInner> - beginPut(String resourceGroupName, String accountName, String managedNetworkName, - ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context) { - Response response - = putWithResponse(resourceGroupName, accountName, managedNetworkName, body, context); - return this.client - .getLroResult( - response, ManagedNetworkSettingsPropertiesBasicResourceInner.class, - ManagedNetworkSettingsPropertiesBasicResourceInner.class, context); - } - - /** - * PUT API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono putAsync(String resourceGroupName, - String accountName, String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body) { - return beginPutAsync(resourceGroupName, accountName, managedNetworkName, body).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * PUT API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedNetworkSettingsPropertiesBasicResourceInner put(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body) { - return beginPut(resourceGroupName, accountName, managedNetworkName, body).getFinalResult(); - } - - /** - * PUT API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the 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 concrete proxy resource types can be created by aliasing this type using a specific property type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedNetworkSettingsPropertiesBasicResourceInner put(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context) { - return beginPut(resourceGroupName, accountName, managedNetworkName, body, context).getFinalResult(); - } - - /** - * Patch API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> patchWithResponseAsync(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.patch(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, accept, body, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Patch API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response patchWithResponse(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body) { - final String accept = "application/json"; - return service.patchSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, accept, body, - Context.NONE); - } - - /** - * Patch API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the 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 concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response patchWithResponse(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context) { - final String accept = "application/json"; - return service.patchSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, accept, body, context); - } - - /** - * Patch API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 concrete proxy resource types can be created by aliasing this type - * using a specific property type. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private - PollerFlux, ManagedNetworkSettingsPropertiesBasicResourceInner> - beginPatchAsync(String resourceGroupName, String accountName, String managedNetworkName, - ManagedNetworkSettingsPropertiesBasicResourceInner body) { - Mono>> mono - = patchWithResponseAsync(resourceGroupName, accountName, managedNetworkName, body); - return this.client - .getLroResult( - mono, this.client.getHttpPipeline(), ManagedNetworkSettingsPropertiesBasicResourceInner.class, - ManagedNetworkSettingsPropertiesBasicResourceInner.class, this.client.getContext()); - } - - /** - * Patch API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 concrete proxy resource types can be created by aliasing this type - * using a specific property type. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private - PollerFlux, ManagedNetworkSettingsPropertiesBasicResourceInner> - beginPatchAsync(String resourceGroupName, String accountName, String managedNetworkName) { - final ManagedNetworkSettingsPropertiesBasicResourceInner body = null; - Mono>> mono - = patchWithResponseAsync(resourceGroupName, accountName, managedNetworkName, body); - return this.client - .getLroResult( - mono, this.client.getHttpPipeline(), ManagedNetworkSettingsPropertiesBasicResourceInner.class, - ManagedNetworkSettingsPropertiesBasicResourceInner.class, this.client.getContext()); - } - - /** - * Patch API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 concrete proxy resource types can be created by aliasing this type - * using a specific property type. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public - SyncPoller, ManagedNetworkSettingsPropertiesBasicResourceInner> - beginPatch(String resourceGroupName, String accountName, String managedNetworkName, - ManagedNetworkSettingsPropertiesBasicResourceInner body) { - Response response = patchWithResponse(resourceGroupName, accountName, managedNetworkName, body); - return this.client - .getLroResult( - response, ManagedNetworkSettingsPropertiesBasicResourceInner.class, - ManagedNetworkSettingsPropertiesBasicResourceInner.class, Context.NONE); - } - - /** - * Patch API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 concrete proxy resource types can be created by aliasing this type - * using a specific property type. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public - SyncPoller, ManagedNetworkSettingsPropertiesBasicResourceInner> - beginPatch(String resourceGroupName, String accountName, String managedNetworkName) { - final ManagedNetworkSettingsPropertiesBasicResourceInner body = null; - Response response = patchWithResponse(resourceGroupName, accountName, managedNetworkName, body); - return this.client - .getLroResult( - response, ManagedNetworkSettingsPropertiesBasicResourceInner.class, - ManagedNetworkSettingsPropertiesBasicResourceInner.class, Context.NONE); - } - - /** - * Patch API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the 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 {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type - * using a specific property type. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public - SyncPoller, ManagedNetworkSettingsPropertiesBasicResourceInner> - beginPatch(String resourceGroupName, String accountName, String managedNetworkName, - ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context) { - Response response - = patchWithResponse(resourceGroupName, accountName, managedNetworkName, body, context); - return this.client - .getLroResult( - response, ManagedNetworkSettingsPropertiesBasicResourceInner.class, - ManagedNetworkSettingsPropertiesBasicResourceInner.class, context); - } - - /** - * Patch API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono patchAsync(String resourceGroupName, - String accountName, String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body) { - return beginPatchAsync(resourceGroupName, accountName, managedNetworkName, body).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Patch API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono patchAsync(String resourceGroupName, - String accountName, String managedNetworkName) { - final ManagedNetworkSettingsPropertiesBasicResourceInner body = null; - return beginPatchAsync(resourceGroupName, accountName, managedNetworkName, body).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Patch API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedNetworkSettingsPropertiesBasicResourceInner patch(String resourceGroupName, String accountName, - String managedNetworkName) { - final ManagedNetworkSettingsPropertiesBasicResourceInner body = null; - return beginPatch(resourceGroupName, accountName, managedNetworkName, body).getFinalResult(); - } - - /** - * Patch API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the 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 concrete proxy resource types can be created by aliasing this type using a specific property type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedNetworkSettingsPropertiesBasicResourceInner patch(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context) { - return beginPatch(resourceGroupName, accountName, managedNetworkName, body, context).getFinalResult(); - } - - /** - * Delete API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String managedNetworkName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String managedNetworkName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, Context.NONE); - } - - /** - * Delete API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String managedNetworkName, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, context); - } - - /** - * Delete API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String managedNetworkName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, accountName, managedNetworkName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Delete API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String managedNetworkName) { - Response response = deleteWithResponse(resourceGroupName, accountName, managedNetworkName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Delete API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String managedNetworkName, Context context) { - Response response = deleteWithResponse(resourceGroupName, accountName, managedNetworkName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Delete API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String managedNetworkName) { - return beginDeleteAsync(resourceGroupName, accountName, managedNetworkName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String managedNetworkName) { - beginDelete(resourceGroupName, accountName, managedNetworkName).getFinalResult(); - } - - /** - * Delete API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String managedNetworkName, Context context) { - beginDelete(resourceGroupName, accountName, managedNetworkName, context).getFinalResult(); - } - - /** - * List API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed networks of a cognitive services account along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listSinglePageAsync(String resourceGroupName, String accountName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, 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 API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed networks of a cognitive services account as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, - String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed networks of a cognitive services account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, - String accountName) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 list of managed networks of a cognitive services account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, - String accountName, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed networks of a cognitive services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, - String accountName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * List API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 list of managed networks of a cognitive services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, - String accountName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * List API for managed network settings of a cognitive services account. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed networks of a cognitive services account along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List API for managed network settings of a cognitive services account. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed networks of a cognitive services account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List API for managed network settings of a cognitive services account. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed networks of a cognitive services account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, - Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsOperationsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsOperationsImpl.java deleted file mode 100644 index fe0e5b047e73..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsOperationsImpl.java +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.ManagedNetworkSettingsOperationsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsPropertiesBasicResourceInner; -import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsOperations; -import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsPropertiesBasicResource; - -public final class ManagedNetworkSettingsOperationsImpl implements ManagedNetworkSettingsOperations { - private static final ClientLogger LOGGER = new ClientLogger(ManagedNetworkSettingsOperationsImpl.class); - - private final ManagedNetworkSettingsOperationsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public ManagedNetworkSettingsOperationsImpl(ManagedNetworkSettingsOperationsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, - String accountName, String managedNetworkName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, accountName, managedNetworkName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ManagedNetworkSettingsPropertiesBasicResourceImpl(inner.getValue(), this.manager())); - } - - public ManagedNetworkSettingsPropertiesBasicResource get(String resourceGroupName, String accountName, - String managedNetworkName) { - ManagedNetworkSettingsPropertiesBasicResourceInner inner - = this.serviceClient().get(resourceGroupName, accountName, managedNetworkName); - if (inner != null) { - return new ManagedNetworkSettingsPropertiesBasicResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String accountName, String managedNetworkName) { - this.serviceClient().delete(resourceGroupName, accountName, managedNetworkName); - } - - public void delete(String resourceGroupName, String accountName, String managedNetworkName, Context context) { - this.serviceClient().delete(resourceGroupName, accountName, managedNetworkName, context); - } - - public PagedIterable list(String resourceGroupName, - String accountName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ManagedNetworkSettingsPropertiesBasicResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, - String accountName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ManagedNetworkSettingsPropertiesBasicResourceImpl(inner1, this.manager())); - } - - public ManagedNetworkSettingsPropertiesBasicResource 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String managedNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "managedNetworks"); - if (managedNetworkName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'managedNetworks'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, managedNetworkName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String managedNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "managedNetworks"); - if (managedNetworkName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'managedNetworks'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, managedNetworkName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String managedNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "managedNetworks"); - if (managedNetworkName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'managedNetworks'.", id))); - } - this.delete(resourceGroupName, accountName, managedNetworkName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String managedNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "managedNetworks"); - if (managedNetworkName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'managedNetworks'.", id))); - } - this.delete(resourceGroupName, accountName, managedNetworkName, context); - } - - private ManagedNetworkSettingsOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public ManagedNetworkSettingsPropertiesBasicResourceImpl define(String name) { - return new ManagedNetworkSettingsPropertiesBasicResourceImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsPropertiesBasicResourceImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsPropertiesBasicResourceImpl.java deleted file mode 100644 index 7996ac363589..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsPropertiesBasicResourceImpl.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsPropertiesBasicResourceInner; -import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsProperties; -import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsPropertiesBasicResource; - -public final class ManagedNetworkSettingsPropertiesBasicResourceImpl - implements ManagedNetworkSettingsPropertiesBasicResource, ManagedNetworkSettingsPropertiesBasicResource.Definition, - ManagedNetworkSettingsPropertiesBasicResource.Update { - private ManagedNetworkSettingsPropertiesBasicResourceInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public ManagedNetworkSettingsProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public ManagedNetworkSettingsPropertiesBasicResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - private String managedNetworkName; - - public ManagedNetworkSettingsPropertiesBasicResourceImpl withExistingAccount(String resourceGroupName, - String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - public ManagedNetworkSettingsPropertiesBasicResource create() { - this.innerObject = serviceManager.serviceClient() - .getManagedNetworkSettingsOperations() - .put(resourceGroupName, accountName, managedNetworkName, this.innerModel(), Context.NONE); - return this; - } - - public ManagedNetworkSettingsPropertiesBasicResource create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getManagedNetworkSettingsOperations() - .put(resourceGroupName, accountName, managedNetworkName, this.innerModel(), context); - return this; - } - - ManagedNetworkSettingsPropertiesBasicResourceImpl(String name, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new ManagedNetworkSettingsPropertiesBasicResourceInner(); - this.serviceManager = serviceManager; - this.managedNetworkName = name; - } - - public ManagedNetworkSettingsPropertiesBasicResourceImpl update() { - return this; - } - - public ManagedNetworkSettingsPropertiesBasicResource apply() { - this.innerObject = serviceManager.serviceClient() - .getManagedNetworkSettingsOperations() - .patch(resourceGroupName, accountName, managedNetworkName, this.innerModel(), Context.NONE); - return this; - } - - public ManagedNetworkSettingsPropertiesBasicResource apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getManagedNetworkSettingsOperations() - .patch(resourceGroupName, accountName, managedNetworkName, this.innerModel(), context); - return this; - } - - ManagedNetworkSettingsPropertiesBasicResourceImpl(ManagedNetworkSettingsPropertiesBasicResourceInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.managedNetworkName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "managedNetworks"); - } - - public ManagedNetworkSettingsPropertiesBasicResource refresh() { - this.innerObject = serviceManager.serviceClient() - .getManagedNetworkSettingsOperations() - .getWithResponse(resourceGroupName, accountName, managedNetworkName, Context.NONE) - .getValue(); - return this; - } - - public ManagedNetworkSettingsPropertiesBasicResource refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getManagedNetworkSettingsOperations() - .getWithResponse(resourceGroupName, accountName, managedNetworkName, context) - .getValue(); - return this; - } - - public ManagedNetworkSettingsPropertiesBasicResourceImpl - withProperties(ManagedNetworkSettingsProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacitiesClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacitiesClientImpl.java deleted file mode 100644 index 1cfc0c8a702a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacitiesClientImpl.java +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.ModelCapacitiesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelCapacityListResultValueItemInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.ModelCapacityListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ModelCapacitiesClient. - */ -public final class ModelCapacitiesClientImpl implements ModelCapacitiesClient { - /** - * The proxy service used to perform REST calls. - */ - private final ModelCapacitiesService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of ModelCapacitiesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ModelCapacitiesClientImpl(CognitiveServicesManagementClientImpl client) { - this.service - = RestProxy.create(ModelCapacitiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientModelCapacities to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientModelCapacities") - public interface ModelCapacitiesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/modelCapacities") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("modelFormat") String modelFormat, @QueryParam("modelName") String modelName, - @QueryParam("modelVersion") String modelVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/modelCapacities") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("modelFormat") String modelFormat, @QueryParam("modelName") String modelName, - @QueryParam("modelVersion") String modelVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List ModelCapacities. - * - * @param modelFormat The format of the Model. - * @param modelName The name of the Model. - * @param modelVersion The version of the Model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String modelFormat, - String modelName, String modelVersion) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), modelFormat, modelName, modelVersion, 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 ModelCapacities. - * - * @param modelFormat The format of the Model. - * @param modelName The name of the Model. - * @param modelVersion The version of the Model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String modelFormat, String modelName, - String modelVersion) { - return new PagedFlux<>(() -> listSinglePageAsync(modelFormat, modelName, modelVersion), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List ModelCapacities. - * - * @param modelFormat The format of the Model. - * @param modelName The name of the Model. - * @param modelVersion The version of the Model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String modelFormat, String modelName, - String modelVersion) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), modelFormat, modelName, modelVersion, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List ModelCapacities. - * - * @param modelFormat The format of the Model. - * @param modelName The name of the Model. - * @param modelVersion The version of the Model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String modelFormat, String modelName, - String modelVersion, Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), modelFormat, modelName, modelVersion, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List ModelCapacities. - * - * @param modelFormat The format of the Model. - * @param modelName The name of the Model. - * @param modelVersion The version of the Model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String modelFormat, String modelName, - String modelVersion) { - return new PagedIterable<>(() -> listSinglePage(modelFormat, modelName, modelVersion), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * List ModelCapacities. - * - * @param modelFormat The format of the Model. - * @param modelName The name of the Model. - * @param modelVersion The version of the Model. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String modelFormat, String modelName, - String modelVersion, Context context) { - return new PagedIterable<>(() -> listSinglePage(modelFormat, modelName, modelVersion, 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 the list of cognitive services accounts operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacitiesImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacitiesImpl.java deleted file mode 100644 index 80e5388399df..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacitiesImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.ModelCapacitiesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelCapacityListResultValueItemInner; -import com.azure.resourcemanager.cognitiveservices.models.ModelCapacities; -import com.azure.resourcemanager.cognitiveservices.models.ModelCapacityListResultValueItem; - -public final class ModelCapacitiesImpl implements ModelCapacities { - private static final ClientLogger LOGGER = new ClientLogger(ModelCapacitiesImpl.class); - - private final ModelCapacitiesClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public ModelCapacitiesImpl(ModelCapacitiesClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String modelFormat, String modelName, - String modelVersion) { - PagedIterable inner - = this.serviceClient().list(modelFormat, modelName, modelVersion); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ModelCapacityListResultValueItemImpl(inner1, this.manager())); - } - - public PagedIterable list(String modelFormat, String modelName, - String modelVersion, Context context) { - PagedIterable inner - = this.serviceClient().list(modelFormat, modelName, modelVersion, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ModelCapacityListResultValueItemImpl(inner1, this.manager())); - } - - private ModelCapacitiesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacityListResultValueItemImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacityListResultValueItemImpl.java deleted file mode 100644 index ba5d2a3f5cd6..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacityListResultValueItemImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelCapacityListResultValueItemInner; -import com.azure.resourcemanager.cognitiveservices.models.ModelCapacityListResultValueItem; -import com.azure.resourcemanager.cognitiveservices.models.ModelSkuCapacityProperties; - -public final class ModelCapacityListResultValueItemImpl implements ModelCapacityListResultValueItem { - private ModelCapacityListResultValueItemInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - ModelCapacityListResultValueItemImpl(ModelCapacityListResultValueItemInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager 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 String location() { - return this.innerModel().location(); - } - - public ModelSkuCapacityProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ModelCapacityListResultValueItemInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelImpl.java deleted file mode 100644 index 2d950954b86b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountModelInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelInner; -import com.azure.resourcemanager.cognitiveservices.models.AccountModel; -import com.azure.resourcemanager.cognitiveservices.models.Model; - -public final class ModelImpl implements Model { - private ModelInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - ModelImpl(ModelInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public AccountModel model() { - AccountModelInner inner = this.innerModel().model(); - if (inner != null) { - return new AccountModelImpl(inner, this.manager()); - } else { - return null; - } - } - - public String kind() { - return this.innerModel().kind(); - } - - public String skuName() { - return this.innerModel().skuName(); - } - - public String description() { - return this.innerModel().description(); - } - - public ModelInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsClientImpl.java deleted file mode 100644 index 2066e626f528..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsClientImpl.java +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.ModelsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.ModelListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ModelsClient. - */ -public final class ModelsClientImpl implements ModelsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ModelsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of ModelsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ModelsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(ModelsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientModels to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientModels") - public interface ModelsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/models") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/models") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List Models. - * - * @param location The location 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 list of cognitive services models along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, 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 Models. - * - * @param location The location 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 list of cognitive services models as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location) { - return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List Models. - * - * @param location The location 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 list of cognitive services models along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String location) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List Models. - * - * @param location The location 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 list of cognitive services models along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String location, Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List Models. - * - * @param location The location 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 list of cognitive services models as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location) { - return new PagedIterable<>(() -> listSinglePage(location), nextLink -> listNextSinglePage(nextLink)); - } - - /** - * List Models. - * - * @param location The location 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 list of cognitive services models as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location, Context context) { - return new PagedIterable<>(() -> listSinglePage(location, 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 the list of cognitive services models along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services models along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services models along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsImpl.java deleted file mode 100644 index 1a7268ae782a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.ModelsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelInner; -import com.azure.resourcemanager.cognitiveservices.models.Model; -import com.azure.resourcemanager.cognitiveservices.models.Models; - -public final class ModelsImpl implements Models { - private static final ClientLogger LOGGER = new ClientLogger(ModelsImpl.class); - - private final ModelsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public ModelsImpl(ModelsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String location) { - PagedIterable inner = this.serviceClient().list(location); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ModelImpl(inner1, this.manager())); - } - - public PagedIterable list(String location, Context context) { - PagedIterable inner = this.serviceClient().list(location, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ModelImpl(inner1, this.manager())); - } - - private ModelsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationImpl.java deleted file mode 100644 index 98847a63c14c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.NetworkSecurityPerimeterConfigurationInner; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfiguration; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurationProperties; - -public final class NetworkSecurityPerimeterConfigurationImpl implements NetworkSecurityPerimeterConfiguration { - private NetworkSecurityPerimeterConfigurationInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - NetworkSecurityPerimeterConfigurationImpl(NetworkSecurityPerimeterConfigurationInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager 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.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java deleted file mode 100644 index 8e5a952668ec..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java +++ /dev/null @@ -1,587 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.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.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.NetworkSecurityPerimeterConfigurationsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.NetworkSecurityPerimeterConfigurationInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.NetworkSecurityPerimeterConfigurationList; -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 - * NetworkSecurityPerimeterConfigurationsClient. - */ -public final class NetworkSecurityPerimeterConfigurationsClientImpl - implements NetworkSecurityPerimeterConfigurationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final NetworkSecurityPerimeterConfigurationsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of NetworkSecurityPerimeterConfigurationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - NetworkSecurityPerimeterConfigurationsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(NetworkSecurityPerimeterConfigurationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for - * CognitiveServicesManagementClientNetworkSecurityPerimeterConfigurations to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientNetworkSecurityPerimeterConfigurations") - public interface NetworkSecurityPerimeterConfigurationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/networkSecurityPerimeterConfigurations/{nspConfigurationName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("nspConfigurationName") String nspConfigurationName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/networkSecurityPerimeterConfigurations/{nspConfigurationName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("nspConfigurationName") String nspConfigurationName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/networkSecurityPerimeterConfigurations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/networkSecurityPerimeterConfigurations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/networkSecurityPerimeterConfigurations/{nspConfigurationName}/reconcile") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> reconcile(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("nspConfigurationName") String nspConfigurationName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/networkSecurityPerimeterConfigurations/{nspConfigurationName}/reconcile") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response reconcileSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("nspConfigurationName") String nspConfigurationName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the specified NSP configurations for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 specified NSP configurations for an account along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String accountName, String nspConfigurationName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, nspConfigurationName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified NSP configurations for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 specified NSP configurations for an account on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, - String nspConfigurationName) { - return getWithResponseAsync(resourceGroupName, accountName, nspConfigurationName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the specified NSP configurations for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 specified NSP configurations for an account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, - String accountName, String nspConfigurationName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, nspConfigurationName, accept, context); - } - - /** - * Gets the specified NSP configurations for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 specified NSP configurations for an account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkSecurityPerimeterConfigurationInner get(String resourceGroupName, String accountName, - String nspConfigurationName) { - return getWithResponse(resourceGroupName, accountName, nspConfigurationName, Context.NONE).getValue(); - } - - /** - * Gets a list of NSP configurations for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 an account along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listSinglePageAsync(String resourceGroupName, String accountName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, 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 an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 an account as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, - String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of NSP configurations for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 an account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, - String accountName) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, 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 an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 a list of NSP configurations for an account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, - String accountName, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, 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 an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 an account as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, - String accountName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Gets a list of NSP configurations for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 a list of NSP configurations for an account as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, - Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Reconcile the NSP configuration for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 nSP Configuration for an Cognitive Services account along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> reconcileWithResponseAsync(String resourceGroupName, String accountName, - String nspConfigurationName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.reconcile(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, nspConfigurationName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Reconcile the NSP configuration for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 nSP Configuration for an Cognitive Services account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response reconcileWithResponse(String resourceGroupName, String accountName, - String nspConfigurationName) { - final String accept = "application/json"; - return service.reconcileSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, nspConfigurationName, accept, - Context.NONE); - } - - /** - * Reconcile the NSP configuration for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 nSP Configuration for an Cognitive Services account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response reconcileWithResponse(String resourceGroupName, String accountName, - String nspConfigurationName, Context context) { - final String accept = "application/json"; - return service.reconcileSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, nspConfigurationName, accept, context); - } - - /** - * Reconcile the NSP configuration for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 nSP Configuration for an Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private - PollerFlux, NetworkSecurityPerimeterConfigurationInner> - beginReconcileAsync(String resourceGroupName, String accountName, String nspConfigurationName) { - Mono>> mono - = reconcileWithResponseAsync(resourceGroupName, accountName, nspConfigurationName); - return this.client - .getLroResult(mono, - this.client.getHttpPipeline(), NetworkSecurityPerimeterConfigurationInner.class, - NetworkSecurityPerimeterConfigurationInner.class, this.client.getContext()); - } - - /** - * Reconcile the NSP configuration for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 nSP Configuration for an Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public - SyncPoller, NetworkSecurityPerimeterConfigurationInner> - beginReconcile(String resourceGroupName, String accountName, String nspConfigurationName) { - Response response = reconcileWithResponse(resourceGroupName, accountName, nspConfigurationName); - return this.client - .getLroResult( - response, NetworkSecurityPerimeterConfigurationInner.class, - NetworkSecurityPerimeterConfigurationInner.class, Context.NONE); - } - - /** - * Reconcile the NSP configuration for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 nSP Configuration for an Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public - SyncPoller, NetworkSecurityPerimeterConfigurationInner> - beginReconcile(String resourceGroupName, String accountName, String nspConfigurationName, Context context) { - Response response - = reconcileWithResponse(resourceGroupName, accountName, nspConfigurationName, context); - return this.client - .getLroResult( - response, NetworkSecurityPerimeterConfigurationInner.class, - NetworkSecurityPerimeterConfigurationInner.class, context); - } - - /** - * Reconcile the NSP configuration for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 nSP Configuration for an Cognitive Services account on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono reconcileAsync(String resourceGroupName, - String accountName, String nspConfigurationName) { - return beginReconcileAsync(resourceGroupName, accountName, nspConfigurationName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Reconcile the NSP configuration for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 nSP Configuration for an Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkSecurityPerimeterConfigurationInner reconcile(String resourceGroupName, String accountName, - String nspConfigurationName) { - return beginReconcile(resourceGroupName, accountName, nspConfigurationName).getFinalResult(); - } - - /** - * Reconcile the NSP configuration for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 nSP Configuration for an Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkSecurityPerimeterConfigurationInner reconcile(String resourceGroupName, String accountName, - String nspConfigurationName, Context context) { - return beginReconcile(resourceGroupName, accountName, nspConfigurationName, 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 an account along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of NSP configurations for an account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of NSP configurations for an account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, - Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationsImpl.java deleted file mode 100644 index 5f0783275caa..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationsImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.NetworkSecurityPerimeterConfigurationsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.NetworkSecurityPerimeterConfigurationInner; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfiguration; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurations; - -public final class NetworkSecurityPerimeterConfigurationsImpl implements NetworkSecurityPerimeterConfigurations { - private static final ClientLogger LOGGER = new ClientLogger(NetworkSecurityPerimeterConfigurationsImpl.class); - - private final NetworkSecurityPerimeterConfigurationsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public NetworkSecurityPerimeterConfigurationsImpl(NetworkSecurityPerimeterConfigurationsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, - String nspConfigurationName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, accountName, nspConfigurationName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new NetworkSecurityPerimeterConfigurationImpl(inner.getValue(), this.manager())); - } - - public NetworkSecurityPerimeterConfiguration get(String resourceGroupName, String accountName, - String nspConfigurationName) { - NetworkSecurityPerimeterConfigurationInner inner - = this.serviceClient().get(resourceGroupName, accountName, nspConfigurationName); - if (inner != null) { - return new NetworkSecurityPerimeterConfigurationImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String accountName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new NetworkSecurityPerimeterConfigurationImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, - Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new NetworkSecurityPerimeterConfigurationImpl(inner1, this.manager())); - } - - public NetworkSecurityPerimeterConfiguration reconcile(String resourceGroupName, String accountName, - String nspConfigurationName) { - NetworkSecurityPerimeterConfigurationInner inner - = this.serviceClient().reconcile(resourceGroupName, accountName, nspConfigurationName); - if (inner != null) { - return new NetworkSecurityPerimeterConfigurationImpl(inner, this.manager()); - } else { - return null; - } - } - - public NetworkSecurityPerimeterConfiguration reconcile(String resourceGroupName, String accountName, - String nspConfigurationName, Context context) { - NetworkSecurityPerimeterConfigurationInner inner - = this.serviceClient().reconcile(resourceGroupName, accountName, nspConfigurationName, context); - if (inner != null) { - return new NetworkSecurityPerimeterConfigurationImpl(inner, this.manager()); - } else { - return null; - } - } - - private NetworkSecurityPerimeterConfigurationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationImpl.java deleted file mode 100644 index 7abc5b4e76a4..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.OperationInner; -import com.azure.resourcemanager.cognitiveservices.models.ActionType; -import com.azure.resourcemanager.cognitiveservices.models.Operation; -import com.azure.resourcemanager.cognitiveservices.models.OperationDisplay; -import com.azure.resourcemanager.cognitiveservices.models.Origin; - -public final class OperationImpl implements Operation { - private OperationInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - OperationImpl(OperationInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public Boolean isDataAction() { - return this.innerModel().isDataAction(); - } - - public OperationDisplay display() { - return this.innerModel().display(); - } - - public Origin origin() { - return this.innerModel().origin(); - } - - public ActionType actionType() { - return this.innerModel().actionType(); - } - - public OperationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationsClientImpl.java deleted file mode 100644 index 28ed42b4e2fa..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.OperationsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.OperationInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.OperationListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in OperationsClient. - */ -public final class OperationsClientImpl implements OperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final OperationsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service - = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientOperations to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientOperations") - public interface OperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.CognitiveServices/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - 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.CognitiveServices/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists all the available Cognitive Services account 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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - final String accept = "application/json"; - 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 the available Cognitive Services account 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the available Cognitive Services account 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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage() { - 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 the available Cognitive Services account 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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(Context context) { - 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); - } - - /** - * Lists all the available Cognitive Services account 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Lists all the available Cognitive Services account 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 a list of REST API operations supported by an Azure Resource Provider 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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationsImpl.java deleted file mode 100644 index 3c77b71ea853..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationsImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.OperationsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.OperationInner; -import com.azure.resourcemanager.cognitiveservices.models.Operation; -import com.azure.resourcemanager.cognitiveservices.models.Operations; - -public final class OperationsImpl implements Operations { - private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); - - private final OperationsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public OperationsImpl(OperationsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - private OperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRuleBasicResourceImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRuleBasicResourceImpl.java deleted file mode 100644 index ffd97a5cf909..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRuleBasicResourceImpl.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleBasicResourceInner; -import com.azure.resourcemanager.cognitiveservices.models.OutboundRule; -import com.azure.resourcemanager.cognitiveservices.models.OutboundRuleBasicResource; - -public final class OutboundRuleBasicResourceImpl - implements OutboundRuleBasicResource, OutboundRuleBasicResource.Definition, OutboundRuleBasicResource.Update { - private OutboundRuleBasicResourceInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public OutboundRule properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public OutboundRuleBasicResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - private String managedNetworkName; - - private String ruleName; - - public OutboundRuleBasicResourceImpl withExistingManagedNetwork(String resourceGroupName, String accountName, - String managedNetworkName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - this.managedNetworkName = managedNetworkName; - return this; - } - - public OutboundRuleBasicResource create() { - this.innerObject = serviceManager.serviceClient() - .getOutboundRules() - .createOrUpdate(resourceGroupName, accountName, managedNetworkName, ruleName, this.innerModel(), - Context.NONE); - return this; - } - - public OutboundRuleBasicResource create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getOutboundRules() - .createOrUpdate(resourceGroupName, accountName, managedNetworkName, ruleName, this.innerModel(), context); - return this; - } - - OutboundRuleBasicResourceImpl(String name, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new OutboundRuleBasicResourceInner(); - this.serviceManager = serviceManager; - this.ruleName = name; - } - - public OutboundRuleBasicResourceImpl update() { - return this; - } - - public OutboundRuleBasicResource apply() { - this.innerObject = serviceManager.serviceClient() - .getOutboundRules() - .createOrUpdate(resourceGroupName, accountName, managedNetworkName, ruleName, this.innerModel(), - Context.NONE); - return this; - } - - public OutboundRuleBasicResource apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getOutboundRules() - .createOrUpdate(resourceGroupName, accountName, managedNetworkName, ruleName, this.innerModel(), context); - return this; - } - - OutboundRuleBasicResourceImpl(OutboundRuleBasicResourceInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.managedNetworkName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "managedNetworks"); - this.ruleName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "outboundRules"); - } - - public OutboundRuleBasicResource refresh() { - this.innerObject = serviceManager.serviceClient() - .getOutboundRules() - .getWithResponse(resourceGroupName, accountName, managedNetworkName, ruleName, Context.NONE) - .getValue(); - return this; - } - - public OutboundRuleBasicResource refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getOutboundRules() - .getWithResponse(resourceGroupName, accountName, managedNetworkName, ruleName, context) - .getValue(); - return this; - } - - public OutboundRuleBasicResourceImpl withProperties(OutboundRule properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesClientImpl.java deleted file mode 100644 index 40b2bb436200..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesClientImpl.java +++ /dev/null @@ -1,888 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.OutboundRulesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleBasicResourceInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.OutboundRuleListResult; -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 OutboundRulesClient. - */ -public final class OutboundRulesClientImpl implements OutboundRulesClient { - /** - * The proxy service used to perform REST calls. - */ - private final OutboundRulesService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of OutboundRulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OutboundRulesClientImpl(CognitiveServicesManagementClientImpl client) { - this.service - = RestProxy.create(OutboundRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientOutboundRules to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientOutboundRules") - public interface OutboundRulesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules/{ruleName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("managedNetworkName") String managedNetworkName, @PathParam("ruleName") String ruleName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules/{ruleName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("managedNetworkName") String managedNetworkName, @PathParam("ruleName") String ruleName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules/{ruleName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("managedNetworkName") String managedNetworkName, @PathParam("ruleName") String ruleName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") OutboundRuleBasicResourceInner body, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules/{ruleName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("managedNetworkName") String managedNetworkName, @PathParam("ruleName") String ruleName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") OutboundRuleBasicResourceInner body, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules/{ruleName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("managedNetworkName") String managedNetworkName, @PathParam("ruleName") String ruleName, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules/{ruleName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("managedNetworkName") String managedNetworkName, @PathParam("ruleName") String ruleName, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * The GET API for retrieving a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String accountName, String managedNetworkName, String ruleName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, ruleName, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The GET API for retrieving a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, - String managedNetworkName, String ruleName) { - return getWithResponseAsync(resourceGroupName, accountName, managedNetworkName, ruleName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * The GET API for retrieving a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, - String managedNetworkName, String ruleName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, managedNetworkName, ruleName, accept, context); - } - - /** - * The GET API for retrieving a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OutboundRuleBasicResourceInner get(String resourceGroupName, String accountName, String managedNetworkName, - String ruleName) { - return getWithResponse(resourceGroupName, accountName, managedNetworkName, ruleName, Context.NONE).getValue(); - } - - /** - * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @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 concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String accountName, String managedNetworkName, String ruleName, OutboundRuleBasicResourceInner body) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, ruleName, - contentType, accept, body, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @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 concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String managedNetworkName, String ruleName, OutboundRuleBasicResourceInner body) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, ruleName, contentType, - accept, body, Context.NONE); - } - - /** - * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @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 concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String managedNetworkName, String ruleName, OutboundRuleBasicResourceInner body, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, ruleName, contentType, - accept, body, context); - } - - /** - * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @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 concrete proxy resource types can be created by aliasing this type - * using a specific property type. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, OutboundRuleBasicResourceInner> - beginCreateOrUpdateAsync(String resourceGroupName, String accountName, String managedNetworkName, - String ruleName, OutboundRuleBasicResourceInner body) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, accountName, managedNetworkName, ruleName, body); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), OutboundRuleBasicResourceInner.class, OutboundRuleBasicResourceInner.class, - this.client.getContext()); - } - - /** - * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @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 SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type - * using a specific property type. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OutboundRuleBasicResourceInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String managedNetworkName, String ruleName, - OutboundRuleBasicResourceInner body) { - Response response - = createOrUpdateWithResponse(resourceGroupName, accountName, managedNetworkName, ruleName, body); - return this.client.getLroResult(response, - OutboundRuleBasicResourceInner.class, OutboundRuleBasicResourceInner.class, Context.NONE); - } - - /** - * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @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 SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type - * using a specific property type. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, OutboundRuleBasicResourceInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String managedNetworkName, String ruleName, - OutboundRuleBasicResourceInner body, Context context) { - Response response - = createOrUpdateWithResponse(resourceGroupName, accountName, managedNetworkName, ruleName, body, context); - return this.client.getLroResult(response, - OutboundRuleBasicResourceInner.class, OutboundRuleBasicResourceInner.class, context); - } - - /** - * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @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 concrete proxy resource types can be created by aliasing this type using a specific property type on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, - String managedNetworkName, String ruleName, OutboundRuleBasicResourceInner body) { - return beginCreateOrUpdateAsync(resourceGroupName, accountName, managedNetworkName, ruleName, body).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @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 concrete proxy resource types can be created by aliasing this type using a specific property type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OutboundRuleBasicResourceInner createOrUpdate(String resourceGroupName, String accountName, - String managedNetworkName, String ruleName, OutboundRuleBasicResourceInner body) { - return beginCreateOrUpdate(resourceGroupName, accountName, managedNetworkName, ruleName, body).getFinalResult(); - } - - /** - * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @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 concrete proxy resource types can be created by aliasing this type using a specific property type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OutboundRuleBasicResourceInner createOrUpdate(String resourceGroupName, String accountName, - String managedNetworkName, String ruleName, OutboundRuleBasicResourceInner body, Context context) { - return beginCreateOrUpdate(resourceGroupName, accountName, managedNetworkName, ruleName, body, context) - .getFinalResult(); - } - - /** - * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String managedNetworkName, String ruleName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, ruleName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String managedNetworkName, String ruleName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, ruleName, - Context.NONE); - } - - /** - * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String managedNetworkName, String ruleName, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, ruleName, context); - } - - /** - * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String managedNetworkName, String ruleName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, accountName, managedNetworkName, ruleName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String managedNetworkName, String ruleName) { - Response response - = deleteWithResponse(resourceGroupName, accountName, managedNetworkName, ruleName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String managedNetworkName, String ruleName, Context context) { - Response response - = deleteWithResponse(resourceGroupName, accountName, managedNetworkName, ruleName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String managedNetworkName, - String ruleName) { - return beginDeleteAsync(resourceGroupName, accountName, managedNetworkName, ruleName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String managedNetworkName, String ruleName) { - beginDelete(resourceGroupName, accountName, managedNetworkName, ruleName).getFinalResult(); - } - - /** - * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String managedNetworkName, String ruleName, - Context context) { - beginDelete(resourceGroupName, accountName, managedNetworkName, ruleName, context).getFinalResult(); - } - - /** - * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String accountName, String managedNetworkName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, 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())); - } - - /** - * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName, - String managedNetworkName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, managedNetworkName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - String managedNetworkName) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - String managedNetworkName, Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, - String managedNetworkName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, managedNetworkName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, - String managedNetworkName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, managedNetworkName, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive - * services account. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive - * services account. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive - * services account. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesImpl.java deleted file mode 100644 index 93aa90cf6aa8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesImpl.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.OutboundRulesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleBasicResourceInner; -import com.azure.resourcemanager.cognitiveservices.models.OutboundRuleBasicResource; -import com.azure.resourcemanager.cognitiveservices.models.OutboundRules; - -public final class OutboundRulesImpl implements OutboundRules { - private static final ClientLogger LOGGER = new ClientLogger(OutboundRulesImpl.class); - - private final OutboundRulesClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public OutboundRulesImpl(OutboundRulesClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, - String managedNetworkName, String ruleName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, accountName, managedNetworkName, ruleName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OutboundRuleBasicResourceImpl(inner.getValue(), this.manager())); - } - - public OutboundRuleBasicResource get(String resourceGroupName, String accountName, String managedNetworkName, - String ruleName) { - OutboundRuleBasicResourceInner inner - = this.serviceClient().get(resourceGroupName, accountName, managedNetworkName, ruleName); - if (inner != null) { - return new OutboundRuleBasicResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String accountName, String managedNetworkName, String ruleName) { - this.serviceClient().delete(resourceGroupName, accountName, managedNetworkName, ruleName); - } - - public void delete(String resourceGroupName, String accountName, String managedNetworkName, String ruleName, - Context context) { - this.serviceClient().delete(resourceGroupName, accountName, managedNetworkName, ruleName, context); - } - - public PagedIterable list(String resourceGroupName, String accountName, - String managedNetworkName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName, managedNetworkName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OutboundRuleBasicResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, - String managedNetworkName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName, managedNetworkName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OutboundRuleBasicResourceImpl(inner1, this.manager())); - } - - public OutboundRuleBasicResource 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String managedNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "managedNetworks"); - if (managedNetworkName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'managedNetworks'.", id))); - } - String ruleName = ResourceManagerUtils.getValueFromIdByName(id, "outboundRules"); - if (ruleName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'outboundRules'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, managedNetworkName, ruleName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String managedNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "managedNetworks"); - if (managedNetworkName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'managedNetworks'.", id))); - } - String ruleName = ResourceManagerUtils.getValueFromIdByName(id, "outboundRules"); - if (ruleName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'outboundRules'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, managedNetworkName, ruleName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String managedNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "managedNetworks"); - if (managedNetworkName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'managedNetworks'.", id))); - } - String ruleName = ResourceManagerUtils.getValueFromIdByName(id, "outboundRules"); - if (ruleName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'outboundRules'.", id))); - } - this.delete(resourceGroupName, accountName, managedNetworkName, ruleName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String managedNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "managedNetworks"); - if (managedNetworkName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'managedNetworks'.", id))); - } - String ruleName = ResourceManagerUtils.getValueFromIdByName(id, "outboundRules"); - if (ruleName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'outboundRules'.", id))); - } - this.delete(resourceGroupName, accountName, managedNetworkName, ruleName, context); - } - - private OutboundRulesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public OutboundRuleBasicResourceImpl define(String name) { - return new OutboundRuleBasicResourceImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesOperationsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesOperationsClientImpl.java deleted file mode 100644 index d71b1f16d77a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesOperationsClientImpl.java +++ /dev/null @@ -1,338 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.cognitiveservices.fluent.OutboundRulesOperationsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsBasicResourceInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleBasicResourceInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.OutboundRuleListResult; -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 OutboundRulesOperationsClient. - */ -public final class OutboundRulesOperationsClientImpl implements OutboundRulesOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final OutboundRulesOperationsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of OutboundRulesOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OutboundRulesOperationsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(OutboundRulesOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientOutboundRulesOperations to be used - * by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientOutboundRulesOperations") - public interface OutboundRulesOperationsService { - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/batchOutboundRules") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> post(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ManagedNetworkSettingsBasicResourceInner body, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/batchOutboundRules") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response postSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ManagedNetworkSettingsBasicResourceInner body, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> postNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response postNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * The POST API for updating the outbound rules of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> postSinglePageAsync(String resourceGroupName, - String accountName, String managedNetworkName, ManagedNetworkSettingsBasicResourceInner body) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> { - Mono>> mono - = service - .post(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, managedNetworkName, accept, body, context) - .cache(); - return Mono.zip(mono, - this.client - .getLroResult(mono, this.client.getHttpPipeline(), - OutboundRuleListResult.class, OutboundRuleListResult.class, this.client.getContext()) - .last() - .flatMap(this.client::getLroFinalResultOrError)); - }) - .>map( - res -> new PagedResponseBase<>(res.getT1().getRequest(), res.getT1().getStatusCode(), - res.getT1().getHeaders(), res.getT2().value(), res.getT2().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The POST API for updating the outbound rules of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux postAsync(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsBasicResourceInner body) { - return new PagedFlux<>(() -> postSinglePageAsync(resourceGroupName, accountName, managedNetworkName, body), - nextLink -> postNextSinglePageAsync(nextLink)); - } - - /** - * The POST API for updating the outbound rules of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse postSinglePage(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsBasicResourceInner body) { - final String accept = "application/json"; - Response res - = service.postSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, managedNetworkName, accept, body, Context.NONE); - OutboundRuleListResult lroPageableResult = this.client - .getLroResult(res, OutboundRuleListResult.class, - OutboundRuleListResult.class, Context.NONE) - .getFinalResult(); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - lroPageableResult.value(), lroPageableResult.nextLink(), null); - } - - /** - * The POST API for updating the outbound rules of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the 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 list of outbound rules for the managed network of a cognitive services account along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse postSinglePage(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsBasicResourceInner body, Context context) { - final String accept = "application/json"; - Response res = service.postSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, accept, body, context); - OutboundRuleListResult lroPageableResult = this.client - .getLroResult(res, OutboundRuleListResult.class, - OutboundRuleListResult.class, context) - .getFinalResult(); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - lroPageableResult.value(), lroPageableResult.nextLink(), null); - } - - /** - * The POST API for updating the outbound rules of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable post(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsBasicResourceInner body) { - return new PagedIterable<>(() -> postSinglePage(resourceGroupName, accountName, managedNetworkName, body), - nextLink -> postNextSinglePage(nextLink)); - } - - /** - * The POST API for updating the outbound rules of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the 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 list of outbound rules for the managed network of a cognitive services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable post(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsBasicResourceInner body, Context context) { - return new PagedIterable<>( - () -> postSinglePage(resourceGroupName, accountName, managedNetworkName, body, context), - nextLink -> postNextSinglePage(nextLink, context)); - } - - /** - * The POST API for updating the outbound rules of the managed network associated with the cognitive services - * account. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> postNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.postNext(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())); - } - - /** - * The POST API for updating the outbound rules of the managed network associated with the cognitive services - * account. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse postNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.postNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * The POST API for updating the outbound rules of the managed network associated with the cognitive services - * account. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse postNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.postNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesOperationsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesOperationsImpl.java deleted file mode 100644 index dbbb880b08e3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesOperationsImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.OutboundRulesOperationsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsBasicResourceInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleBasicResourceInner; -import com.azure.resourcemanager.cognitiveservices.models.OutboundRuleBasicResource; -import com.azure.resourcemanager.cognitiveservices.models.OutboundRulesOperations; - -public final class OutboundRulesOperationsImpl implements OutboundRulesOperations { - private static final ClientLogger LOGGER = new ClientLogger(OutboundRulesOperationsImpl.class); - - private final OutboundRulesOperationsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public OutboundRulesOperationsImpl(OutboundRulesOperationsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable post(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsBasicResourceInner body) { - PagedIterable inner - = this.serviceClient().post(resourceGroupName, accountName, managedNetworkName, body); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OutboundRuleBasicResourceImpl(inner1, this.manager())); - } - - public PagedIterable post(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsBasicResourceInner body, Context context) { - PagedIterable inner - = this.serviceClient().post(resourceGroupName, accountName, managedNetworkName, body, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OutboundRuleBasicResourceImpl(inner1, this.manager())); - } - - private OutboundRulesOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionImpl.java deleted file mode 100644 index 43259508565d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionImpl.java +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnection; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnectionProperties; - -public final class PrivateEndpointConnectionImpl - implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { - private PrivateEndpointConnectionInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public PrivateEndpointConnectionProperties properties() { - return this.innerModel().properties(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public String location() { - return this.innerModel().location(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public PrivateEndpointConnectionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - private String privateEndpointConnectionName; - - public PrivateEndpointConnectionImpl withExistingAccount(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - public PrivateEndpointConnection create() { - this.innerObject = serviceManager.serviceClient() - .getPrivateEndpointConnections() - .createOrUpdate(resourceGroupName, accountName, privateEndpointConnectionName, this.innerModel(), - Context.NONE); - return this; - } - - public PrivateEndpointConnection create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getPrivateEndpointConnections() - .createOrUpdate(resourceGroupName, accountName, privateEndpointConnectionName, this.innerModel(), context); - return this; - } - - PrivateEndpointConnectionImpl(String name, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new PrivateEndpointConnectionInner(); - this.serviceManager = serviceManager; - this.privateEndpointConnectionName = name; - } - - public PrivateEndpointConnectionImpl update() { - return this; - } - - public PrivateEndpointConnection apply() { - this.innerObject = serviceManager.serviceClient() - .getPrivateEndpointConnections() - .createOrUpdate(resourceGroupName, accountName, privateEndpointConnectionName, this.innerModel(), - Context.NONE); - return this; - } - - public PrivateEndpointConnection apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getPrivateEndpointConnections() - .createOrUpdate(resourceGroupName, accountName, privateEndpointConnectionName, this.innerModel(), context); - return this; - } - - PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.privateEndpointConnectionName - = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); - } - - public PrivateEndpointConnection refresh() { - this.innerObject = serviceManager.serviceClient() - .getPrivateEndpointConnections() - .getWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, Context.NONE) - .getValue(); - return this; - } - - public PrivateEndpointConnection refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getPrivateEndpointConnections() - .getWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, context) - .getValue(); - return this; - } - - public PrivateEndpointConnectionImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public PrivateEndpointConnectionImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public PrivateEndpointConnectionImpl withProperties(PrivateEndpointConnectionProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionListResultImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionListResultImpl.java deleted file mode 100644 index 4da6492dd1db..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionListResultImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnection; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnectionListResult; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class PrivateEndpointConnectionListResultImpl implements PrivateEndpointConnectionListResult { - private PrivateEndpointConnectionListResultInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - PrivateEndpointConnectionListResultImpl(PrivateEndpointConnectionListResultInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public PrivateEndpointConnectionListResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionsClientImpl.java deleted file mode 100644 index 07ad54f76ce1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionsClientImpl.java +++ /dev/null @@ -1,682 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.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.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionListResultInner; -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 PrivateEndpointConnectionsClient. - */ -public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final PrivateEndpointConnectionsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of PrivateEndpointConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateEndpointConnectionsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientPrivateEndpointConnections to be - * used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientPrivateEndpointConnections") - public interface PrivateEndpointConnectionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") PrivateEndpointConnectionInner properties, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") PrivateEndpointConnectionInner properties, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 private endpoint connection associated with the Cognitive Services account along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String accountName, String privateEndpointConnectionName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, privateEndpointConnectionName, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 private endpoint connection associated with the Cognitive Services account on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, - String privateEndpointConnectionName) { - return getWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services 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 specified private endpoint connection associated with the Cognitive Services account along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, - String privateEndpointConnectionName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, privateEndpointConnectionName, accept, context); - } - - /** - * Gets the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 private endpoint connection associated with the Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner get(String resourceGroupName, String accountName, - String privateEndpointConnectionName) { - return getWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, Context.NONE).getValue(); - } - - /** - * Update the state of specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @param properties The private endpoint connection 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 Private Endpoint Connection resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String accountName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, privateEndpointConnectionName, - contentType, accept, properties, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the state of specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @param properties The private endpoint connection 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 Private Endpoint Connection resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, privateEndpointConnectionName, contentType, - accept, properties, Context.NONE); - } - - /** - * Update the state of specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @param properties The private endpoint connection 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 Private Endpoint Connection resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner properties, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, privateEndpointConnectionName, contentType, - accept, properties, context); - } - - /** - * Update the state of specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @param properties The private endpoint connection 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 the Private Endpoint Connection resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, PrivateEndpointConnectionInner> - beginCreateOrUpdateAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, accountName, - privateEndpointConnectionName, properties); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, - this.client.getContext()); - } - - /** - * Update the state of specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @param properties The private endpoint connection 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 the Private Endpoint Connection resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties) { - Response response - = createOrUpdateWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, properties); - return this.client.getLroResult(response, - PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, Context.NONE); - } - - /** - * Update the state of specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @param properties The private endpoint connection 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 the Private Endpoint Connection resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String privateEndpointConnectionName, - PrivateEndpointConnectionInner properties, Context context) { - Response response = createOrUpdateWithResponse(resourceGroupName, accountName, - privateEndpointConnectionName, properties, context); - return this.client.getLroResult(response, - PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, context); - } - - /** - * Update the state of specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @param properties The private endpoint connection 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 Private Endpoint Connection resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { - return beginCreateOrUpdateAsync(resourceGroupName, accountName, privateEndpointConnectionName, properties) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update the state of specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @param properties The private endpoint connection 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 Private Endpoint Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String accountName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { - return beginCreateOrUpdate(resourceGroupName, accountName, privateEndpointConnectionName, properties) - .getFinalResult(); - } - - /** - * Update the state of specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @param properties The private endpoint connection 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 Private Endpoint Connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String accountName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner properties, Context context) { - return beginCreateOrUpdate(resourceGroupName, accountName, privateEndpointConnectionName, properties, context) - .getFinalResult(); - } - - /** - * Deletes the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String privateEndpointConnectionName) { - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, privateEndpointConnectionName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String privateEndpointConnectionName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, privateEndpointConnectionName, - Context.NONE); - } - - /** - * Deletes the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String accountName, - String privateEndpointConnectionName, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, privateEndpointConnectionName, context); - } - - /** - * Deletes the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String privateEndpointConnectionName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, accountName, privateEndpointConnectionName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String privateEndpointConnectionName) { - Response response - = deleteWithResponse(resourceGroupName, accountName, privateEndpointConnectionName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Deletes the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String privateEndpointConnectionName, Context context) { - Response response - = deleteWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Deletes the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String privateEndpointConnectionName) { - return beginDeleteAsync(resourceGroupName, accountName, privateEndpointConnectionName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String privateEndpointConnectionName) { - beginDelete(resourceGroupName, accountName, privateEndpointConnectionName).getFinalResult(); - } - - /** - * Deletes the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName, - Context context) { - beginDelete(resourceGroupName, accountName, privateEndpointConnectionName, context).getFinalResult(); - } - - /** - * Gets the private endpoint connections associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connections associated with the Cognitive Services account along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String resourceGroupName, - String accountName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the private endpoint connections associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connections associated with the Cognitive Services account on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String resourceGroupName, String accountName) { - return listWithResponseAsync(resourceGroupName, accountName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the private endpoint connections associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 private endpoint connections associated with the Cognitive Services account along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String resourceGroupName, - String accountName, Context context) { - final String accept = "application/json"; - return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, accept, context); - } - - /** - * Gets the private endpoint connections associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connections associated with the Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionListResultInner list(String resourceGroupName, String accountName) { - return listWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionsImpl.java deleted file mode 100644 index c141f110c4fa..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionsImpl.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnection; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnectionListResult; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnections; - -public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { - private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); - - private final PrivateEndpointConnectionsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, - String privateEndpointConnectionName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); - } - - public PrivateEndpointConnection get(String resourceGroupName, String accountName, - String privateEndpointConnectionName) { - PrivateEndpointConnectionInner inner - = this.serviceClient().get(resourceGroupName, accountName, privateEndpointConnectionName); - if (inner != null) { - return new PrivateEndpointConnectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName) { - this.serviceClient().delete(resourceGroupName, accountName, privateEndpointConnectionName); - } - - public void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName, - Context context) { - this.serviceClient().delete(resourceGroupName, accountName, privateEndpointConnectionName, context); - } - - public Response listWithResponse(String resourceGroupName, String accountName, - Context context) { - Response inner - = this.serviceClient().listWithResponse(resourceGroupName, accountName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PrivateEndpointConnectionListResultImpl(inner.getValue(), this.manager())); - } - - public PrivateEndpointConnectionListResult list(String resourceGroupName, String accountName) { - PrivateEndpointConnectionListResultInner inner = this.serviceClient().list(resourceGroupName, accountName); - if (inner != null) { - return new PrivateEndpointConnectionListResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public PrivateEndpointConnection 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String privateEndpointConnectionName - = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); - if (privateEndpointConnectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String privateEndpointConnectionName - = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); - if (privateEndpointConnectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String privateEndpointConnectionName - = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); - if (privateEndpointConnectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); - } - this.delete(resourceGroupName, accountName, privateEndpointConnectionName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String privateEndpointConnectionName - = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); - if (privateEndpointConnectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); - } - this.delete(resourceGroupName, accountName, privateEndpointConnectionName, context); - } - - private PrivateEndpointConnectionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public PrivateEndpointConnectionImpl define(String name) { - return new PrivateEndpointConnectionImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourceListResultImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourceListResultImpl.java deleted file mode 100644 index 516eaf7a79fa..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourceListResultImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateLinkResourceListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResource; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResourceListResult; -import java.util.Collections; -import java.util.List; - -public final class PrivateLinkResourceListResultImpl implements PrivateLinkResourceListResult { - private PrivateLinkResourceListResultInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - PrivateLinkResourceListResultImpl(PrivateLinkResourceListResultInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager 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 PrivateLinkResourceListResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesClientImpl.java deleted file mode 100644 index cb4c5d16ebb8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesClientImpl.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.cognitiveservices.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateLinkResourceListResultInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. - */ -public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { - /** - * The proxy service used to perform REST calls. - */ - private final PrivateLinkResourcesService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of PrivateLinkResourcesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateLinkResourcesClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(PrivateLinkResourcesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientPrivateLinkResources to be used by - * the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientPrivateLinkResources") - public interface PrivateLinkResourcesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateLinkResources") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateLinkResources") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the private link resources that need to be created for a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Cognitive Services account along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String resourceGroupName, - String accountName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the private link resources that need to be created for a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Cognitive Services account on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String resourceGroupName, String accountName) { - return listWithResponseAsync(resourceGroupName, accountName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the private link resources that need to be created for a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 private link resources that need to be created for a Cognitive Services account along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String resourceGroupName, String accountName, - Context context) { - final String accept = "application/json"; - return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, accept, context); - } - - /** - * Gets the private link resources that need to be created for a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkResourceListResultInner list(String resourceGroupName, String accountName) { - return listWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesImpl.java deleted file mode 100644 index 36bd7470b0b0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateLinkResourceListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResourceListResult; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResources; - -public final class PrivateLinkResourcesImpl implements PrivateLinkResources { - private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesImpl.class); - - private final PrivateLinkResourcesClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response listWithResponse(String resourceGroupName, String accountName, - Context context) { - Response inner - = this.serviceClient().listWithResponse(resourceGroupName, accountName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PrivateLinkResourceListResultImpl(inner.getValue(), this.manager())); - } - - public PrivateLinkResourceListResult list(String resourceGroupName, String accountName) { - PrivateLinkResourceListResultInner inner = this.serviceClient().list(resourceGroupName, accountName); - if (inner != null) { - return new PrivateLinkResourceListResultImpl(inner, this.manager()); - } else { - return null; - } - } - - private PrivateLinkResourcesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostImpl.java deleted file mode 100644 index d4047ec032f2..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostImpl.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectCapabilityHostInner; -import com.azure.resourcemanager.cognitiveservices.models.ProjectCapabilityHost; -import com.azure.resourcemanager.cognitiveservices.models.ProjectCapabilityHostProperties; - -public final class ProjectCapabilityHostImpl - implements ProjectCapabilityHost, ProjectCapabilityHost.Definition, ProjectCapabilityHost.Update { - private ProjectCapabilityHostInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public ProjectCapabilityHostProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public ProjectCapabilityHostInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - private String projectName; - - private String capabilityHostName; - - public ProjectCapabilityHostImpl withExistingProject(String resourceGroupName, String accountName, - String projectName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - this.projectName = projectName; - return this; - } - - public ProjectCapabilityHost create() { - this.innerObject = serviceManager.serviceClient() - .getProjectCapabilityHosts() - .createOrUpdate(resourceGroupName, accountName, projectName, capabilityHostName, this.innerModel(), - Context.NONE); - return this; - } - - public ProjectCapabilityHost create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getProjectCapabilityHosts() - .createOrUpdate(resourceGroupName, accountName, projectName, capabilityHostName, this.innerModel(), - context); - return this; - } - - ProjectCapabilityHostImpl(String name, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new ProjectCapabilityHostInner(); - this.serviceManager = serviceManager; - this.capabilityHostName = name; - } - - public ProjectCapabilityHostImpl update() { - return this; - } - - public ProjectCapabilityHost apply() { - this.innerObject = serviceManager.serviceClient() - .getProjectCapabilityHosts() - .createOrUpdate(resourceGroupName, accountName, projectName, capabilityHostName, this.innerModel(), - Context.NONE); - return this; - } - - public ProjectCapabilityHost apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getProjectCapabilityHosts() - .createOrUpdate(resourceGroupName, accountName, projectName, capabilityHostName, this.innerModel(), - context); - return this; - } - - ProjectCapabilityHostImpl(ProjectCapabilityHostInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.projectName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "projects"); - this.capabilityHostName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "capabilityHosts"); - } - - public ProjectCapabilityHost refresh() { - this.innerObject = serviceManager.serviceClient() - .getProjectCapabilityHosts() - .getWithResponse(resourceGroupName, accountName, projectName, capabilityHostName, Context.NONE) - .getValue(); - return this; - } - - public ProjectCapabilityHost refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getProjectCapabilityHosts() - .getWithResponse(resourceGroupName, accountName, projectName, capabilityHostName, context) - .getValue(); - return this; - } - - public ProjectCapabilityHostImpl withProperties(ProjectCapabilityHostProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsClientImpl.java deleted file mode 100644 index 904e2c86148c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsClientImpl.java +++ /dev/null @@ -1,821 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.ProjectCapabilityHostsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectCapabilityHostInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.ProjectCapabilityHostResourceArmPaginatedResult; -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 ProjectCapabilityHostsClient. - */ -public final class ProjectCapabilityHostsClientImpl implements ProjectCapabilityHostsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ProjectCapabilityHostsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of ProjectCapabilityHostsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ProjectCapabilityHostsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(ProjectCapabilityHostsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientProjectCapabilityHosts to be used by - * the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientProjectCapabilityHosts") - public interface ProjectCapabilityHostsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("capabilityHostName") String capabilityHostName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("capabilityHostName") String capabilityHostName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("capabilityHostName") String capabilityHostName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ProjectCapabilityHostInner capabilityHost, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("capabilityHostName") String capabilityHostName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ProjectCapabilityHostInner capabilityHost, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("capabilityHostName") String capabilityHostName, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("capabilityHostName") String capabilityHostName, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 project capabilityHost along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String accountName, String projectName, String capabilityHostName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, capabilityHostName, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 project capabilityHost on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, String projectName, - String capabilityHostName) { - return getWithResponseAsync(resourceGroupName, accountName, projectName, capabilityHostName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 project capabilityHost along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, - String projectName, String capabilityHostName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, projectName, capabilityHostName, accept, context); - } - - /** - * Get project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 project capabilityHost. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProjectCapabilityHostInner get(String resourceGroupName, String accountName, String projectName, - String capabilityHostName) { - return getWithResponse(resourceGroupName, accountName, projectName, capabilityHostName, Context.NONE) - .getValue(); - } - - /** - * Create or update project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope for Project CapabilityHost along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String accountName, String projectName, String capabilityHostName, ProjectCapabilityHostInner capabilityHost) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, capabilityHostName, - contentType, accept, capabilityHost, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope for Project CapabilityHost along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String projectName, String capabilityHostName, ProjectCapabilityHostInner capabilityHost) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, capabilityHostName, - contentType, accept, capabilityHost, Context.NONE); - } - - /** - * Create or update project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope for Project CapabilityHost along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String projectName, String capabilityHostName, ProjectCapabilityHostInner capabilityHost, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, capabilityHostName, - contentType, accept, capabilityHost, context); - } - - /** - * Create or update project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure Resource Manager resource envelope for Project - * CapabilityHost. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProjectCapabilityHostInner> beginCreateOrUpdateAsync( - String resourceGroupName, String accountName, String projectName, String capabilityHostName, - ProjectCapabilityHostInner capabilityHost) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, accountName, - projectName, capabilityHostName, capabilityHost); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ProjectCapabilityHostInner.class, ProjectCapabilityHostInner.class, - this.client.getContext()); - } - - /** - * Create or update project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure Resource Manager resource envelope for Project - * CapabilityHost. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProjectCapabilityHostInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String projectName, String capabilityHostName, - ProjectCapabilityHostInner capabilityHost) { - Response response = createOrUpdateWithResponse(resourceGroupName, accountName, projectName, - capabilityHostName, capabilityHost); - return this.client.getLroResult(response, - ProjectCapabilityHostInner.class, ProjectCapabilityHostInner.class, Context.NONE); - } - - /** - * Create or update project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure Resource Manager resource envelope for Project - * CapabilityHost. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProjectCapabilityHostInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String projectName, String capabilityHostName, - ProjectCapabilityHostInner capabilityHost, Context context) { - Response response = createOrUpdateWithResponse(resourceGroupName, accountName, projectName, - capabilityHostName, capabilityHost, context); - return this.client.getLroResult(response, - ProjectCapabilityHostInner.class, ProjectCapabilityHostInner.class, context); - } - - /** - * Create or update project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope for Project CapabilityHost on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, - String projectName, String capabilityHostName, ProjectCapabilityHostInner capabilityHost) { - return beginCreateOrUpdateAsync(resourceGroupName, accountName, projectName, capabilityHostName, capabilityHost) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope for Project CapabilityHost. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProjectCapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String projectName, - String capabilityHostName, ProjectCapabilityHostInner capabilityHost) { - return beginCreateOrUpdate(resourceGroupName, accountName, projectName, capabilityHostName, capabilityHost) - .getFinalResult(); - } - - /** - * Create or update project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope for Project CapabilityHost. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProjectCapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String projectName, - String capabilityHostName, ProjectCapabilityHostInner capabilityHost, Context context) { - return beginCreateOrUpdate(resourceGroupName, accountName, projectName, capabilityHostName, capabilityHost, - context).getFinalResult(); - } - - /** - * Delete project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, - String projectName, String capabilityHostName) { - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, capabilityHostName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, - String capabilityHostName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, capabilityHostName, - Context.NONE); - } - - /** - * Delete project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, - String capabilityHostName, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, capabilityHostName, context); - } - - /** - * Delete project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, - String projectName, String capabilityHostName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, accountName, projectName, capabilityHostName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Delete project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String projectName, String capabilityHostName) { - Response response - = deleteWithResponse(resourceGroupName, accountName, projectName, capabilityHostName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Delete project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String projectName, String capabilityHostName, Context context) { - Response response - = deleteWithResponse(resourceGroupName, accountName, projectName, capabilityHostName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Delete project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String accountName, String projectName, - String capabilityHostName) { - return beginDeleteAsync(resourceGroupName, accountName, projectName, capabilityHostName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostName) { - beginDelete(resourceGroupName, accountName, projectName, capabilityHostName).getFinalResult(); - } - - /** - * Delete project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostName, - Context context) { - beginDelete(resourceGroupName, accountName, projectName, capabilityHostName, context).getFinalResult(); - } - - /** - * List capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Project Capability Host entities along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String accountName, String projectName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, 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 capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Project Capability Host entities as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName, - String projectName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, projectName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Project Capability Host entities along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - String projectName) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, projectName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Project Capability Host entities along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - String projectName, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, projectName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Project Capability Host entities as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, - String projectName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, projectName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * List capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 paginated list of Project Capability Host entities as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, - String projectName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, projectName, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * List capabilityHost. - * - * 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 paginated list of Project Capability Host entities along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List capabilityHost. - * - * 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 paginated list of Project Capability Host entities along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List capabilityHost. - * - * 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 paginated list of Project Capability Host entities along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsImpl.java deleted file mode 100644 index eff88a7668a4..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsImpl.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.ProjectCapabilityHostsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectCapabilityHostInner; -import com.azure.resourcemanager.cognitiveservices.models.ProjectCapabilityHost; -import com.azure.resourcemanager.cognitiveservices.models.ProjectCapabilityHosts; - -public final class ProjectCapabilityHostsImpl implements ProjectCapabilityHosts { - private static final ClientLogger LOGGER = new ClientLogger(ProjectCapabilityHostsImpl.class); - - private final ProjectCapabilityHostsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public ProjectCapabilityHostsImpl(ProjectCapabilityHostsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, - String projectName, String capabilityHostName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, accountName, projectName, capabilityHostName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ProjectCapabilityHostImpl(inner.getValue(), this.manager())); - } - - public ProjectCapabilityHost get(String resourceGroupName, String accountName, String projectName, - String capabilityHostName) { - ProjectCapabilityHostInner inner - = this.serviceClient().get(resourceGroupName, accountName, projectName, capabilityHostName); - if (inner != null) { - return new ProjectCapabilityHostImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostName) { - this.serviceClient().delete(resourceGroupName, accountName, projectName, capabilityHostName); - } - - public void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostName, - Context context) { - this.serviceClient().delete(resourceGroupName, accountName, projectName, capabilityHostName, context); - } - - public PagedIterable list(String resourceGroupName, String accountName, String projectName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName, projectName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ProjectCapabilityHostImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, String projectName, - Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName, projectName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ProjectCapabilityHostImpl(inner1, this.manager())); - } - - public ProjectCapabilityHost 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String capabilityHostName = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); - if (capabilityHostName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'capabilityHosts'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, projectName, capabilityHostName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String capabilityHostName = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); - if (capabilityHostName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'capabilityHosts'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, projectName, capabilityHostName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String capabilityHostName = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); - if (capabilityHostName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'capabilityHosts'.", id))); - } - this.delete(resourceGroupName, accountName, projectName, capabilityHostName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String capabilityHostName = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); - if (capabilityHostName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'capabilityHosts'.", id))); - } - this.delete(resourceGroupName, accountName, projectName, capabilityHostName, context); - } - - private ProjectCapabilityHostsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public ProjectCapabilityHostImpl define(String name) { - return new ProjectCapabilityHostImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsClientImpl.java deleted file mode 100644 index 62452d95bdb3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsClientImpl.java +++ /dev/null @@ -1,763 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.Patch; -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.resourcemanager.cognitiveservices.fluent.ProjectConnectionsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.ConnectionPropertiesV2BasicResourceArmPaginatedResult; -import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ProjectConnectionsClient. - */ -public final class ProjectConnectionsClientImpl implements ProjectConnectionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ProjectConnectionsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of ProjectConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ProjectConnectionsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(ProjectConnectionsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientProjectConnections to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientProjectConnections") - public interface ProjectConnectionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("connectionName") String connectionName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("connectionName") String connectionName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("connectionName") String connectionName, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") ConnectionPropertiesV2BasicResourceInner connection, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("connectionName") String connectionName, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") ConnectionPropertiesV2BasicResourceInner connection, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("connectionName") String connectionName, - @HeaderParam("Accept") String accept, @BodyParam("application/json") ConnectionUpdateContent connection, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("connectionName") String connectionName, - @HeaderParam("Accept") String accept, @BodyParam("application/json") ConnectionUpdateContent connection, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("connectionName") String connectionName, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("connectionName") String connectionName, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @QueryParam("target") String target, - @QueryParam("category") String category, @QueryParam("includeAll") Boolean includeAll, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @QueryParam("target") String target, - @QueryParam("category") String category, @QueryParam("includeAll") Boolean includeAll, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists Cognitive Services project connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String accountName, String projectName, String connectionName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, connectionName, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists Cognitive Services project connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, - String projectName, String connectionName) { - return getWithResponseAsync(resourceGroupName, accountName, projectName, connectionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Lists Cognitive Services project connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, - String accountName, String projectName, String connectionName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, projectName, connectionName, accept, context); - } - - /** - * Lists Cognitive Services project connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionPropertiesV2BasicResourceInner get(String resourceGroupName, String accountName, - String projectName, String connectionName) { - return getWithResponse(resourceGroupName, accountName, projectName, connectionName, Context.NONE).getValue(); - } - - /** - * Create or update Cognitive Services project connection under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @param connection The object for creating or updating a new account connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceGroupName, - String accountName, String projectName, String connectionName, - ConnectionPropertiesV2BasicResourceInner connection) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, connectionName, accept, - connection, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update Cognitive Services project connection under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String accountName, - String projectName, String connectionName) { - final ConnectionPropertiesV2BasicResourceInner connection = null; - return createWithResponseAsync(resourceGroupName, accountName, projectName, connectionName, connection) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create or update Cognitive Services project connection under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @param connection The object for creating or updating a new account connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String resourceGroupName, - String accountName, String projectName, String connectionName, - ConnectionPropertiesV2BasicResourceInner connection, Context context) { - final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, connectionName, accept, - connection, context); - } - - /** - * Create or update Cognitive Services project connection under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionPropertiesV2BasicResourceInner create(String resourceGroupName, String accountName, - String projectName, String connectionName) { - final ConnectionPropertiesV2BasicResourceInner connection = null; - return createWithResponse(resourceGroupName, accountName, projectName, connectionName, connection, Context.NONE) - .getValue(); - } - - /** - * Update Cognitive Services project connection under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @param connection Parameters for account connection update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String accountName, String projectName, String connectionName, ConnectionUpdateContent connection) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, connectionName, accept, - connection, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update Cognitive Services project connection under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String accountName, - String projectName, String connectionName) { - final ConnectionUpdateContent connection = null; - return updateWithResponseAsync(resourceGroupName, accountName, projectName, connectionName, connection) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Update Cognitive Services project connection under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @param connection Parameters for account connection update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, - String accountName, String projectName, String connectionName, ConnectionUpdateContent connection, - Context context) { - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, connectionName, accept, - connection, context); - } - - /** - * Update Cognitive Services project connection under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionPropertiesV2BasicResourceInner update(String resourceGroupName, String accountName, - String projectName, String connectionName) { - final ConnectionUpdateContent connection = null; - return updateWithResponse(resourceGroupName, accountName, projectName, connectionName, connection, Context.NONE) - .getValue(); - } - - /** - * Delete Cognitive Services project connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName, String connectionName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, connectionName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete Cognitive Services project connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String projectName, - String connectionName) { - return deleteWithResponseAsync(resourceGroupName, accountName, projectName, connectionName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Delete Cognitive Services project connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, - String connectionName, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, connectionName, context); - } - - /** - * Delete Cognitive Services project connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String projectName, String connectionName) { - deleteWithResponse(resourceGroupName, accountName, projectName, connectionName, Context.NONE); - } - - /** - * Lists all the available Cognitive Services project connections under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param target Target of the connection. - * @param category Category of the connection. - * @param includeAll query parameter that indicates if get connection call should return both connections and - * datastores. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String accountName, String projectName, String target, String category, Boolean includeAll) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, target, category, - includeAll, 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 the available Cognitive Services project connections under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param target Target of the connection. - * @param category Category of the connection. - * @param includeAll query parameter that indicates if get connection call should return both connections and - * datastores. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName, - String projectName, String target, String category, Boolean includeAll) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, accountName, projectName, target, category, includeAll), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the available Cognitive Services project connections under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName, - String projectName) { - final String target = null; - final String category = null; - final Boolean includeAll = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, accountName, projectName, target, category, includeAll), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the available Cognitive Services project connections under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param target Target of the connection. - * @param category Category of the connection. - * @param includeAll query parameter that indicates if get connection call should return both connections and - * datastores. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, - String accountName, String projectName, String target, String category, Boolean includeAll) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, projectName, target, category, includeAll, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists all the available Cognitive Services project connections under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param target Target of the connection. - * @param category Category of the connection. - * @param includeAll query parameter that indicates if get connection call should return both connections and - * datastores. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, - String accountName, String projectName, String target, String category, Boolean includeAll, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, projectName, target, category, includeAll, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists all the available Cognitive Services project connections under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, - String projectName) { - final String target = null; - final String category = null; - final Boolean includeAll = null; - return new PagedIterable<>( - () -> listSinglePage(resourceGroupName, accountName, projectName, target, category, includeAll), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Lists all the available Cognitive Services project connections under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param target Target of the connection. - * @param category Category of the connection. - * @param includeAll query parameter that indicates if get connection call should return both connections and - * datastores. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, - String projectName, String target, String category, Boolean includeAll, Context context) { - return new PagedIterable<>( - () -> listSinglePage(resourceGroupName, accountName, projectName, target, category, includeAll, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Lists all the available Cognitive Services project connections under the specified project. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the available Cognitive Services project connections under the specified project. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists all the available Cognitive Services project connections under the specified project. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, - Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsImpl.java deleted file mode 100644 index f86d10aa2c49..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsImpl.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.ProjectConnectionsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; -import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2BasicResource; -import com.azure.resourcemanager.cognitiveservices.models.ProjectConnections; - -public final class ProjectConnectionsImpl implements ProjectConnections { - private static final ClientLogger LOGGER = new ClientLogger(ProjectConnectionsImpl.class); - - private final ProjectConnectionsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public ProjectConnectionsImpl(ProjectConnectionsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, - String projectName, String connectionName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, accountName, projectName, connectionName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ConnectionPropertiesV2BasicResourceImpl(inner.getValue(), this.manager())); - } - - public ConnectionPropertiesV2BasicResource get(String resourceGroupName, String accountName, String projectName, - String connectionName) { - ConnectionPropertiesV2BasicResourceInner inner - = this.serviceClient().get(resourceGroupName, accountName, projectName, connectionName); - if (inner != null) { - return new ConnectionPropertiesV2BasicResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, - String connectionName, Context context) { - return this.serviceClient() - .deleteWithResponse(resourceGroupName, accountName, projectName, connectionName, context); - } - - public void delete(String resourceGroupName, String accountName, String projectName, String connectionName) { - this.serviceClient().delete(resourceGroupName, accountName, projectName, connectionName); - } - - public PagedIterable list(String resourceGroupName, String accountName, - String projectName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName, projectName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ConnectionPropertiesV2BasicResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, - String projectName, String target, String category, Boolean includeAll, Context context) { - PagedIterable inner = this.serviceClient() - .list(resourceGroupName, accountName, projectName, target, category, includeAll, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ConnectionPropertiesV2BasicResourceImpl(inner1, this.manager())); - } - - public ConnectionPropertiesV2BasicResource 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); - if (connectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, projectName, connectionName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); - if (connectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, projectName, connectionName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); - if (connectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); - } - this.deleteWithResponse(resourceGroupName, accountName, projectName, connectionName, Context.NONE); - } - - public Response 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); - if (connectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); - } - return this.deleteWithResponse(resourceGroupName, accountName, projectName, connectionName, context); - } - - private ProjectConnectionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public ConnectionPropertiesV2BasicResourceImpl define(String name) { - return new ConnectionPropertiesV2BasicResourceImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectImpl.java deleted file mode 100644 index 73a4261def04..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectImpl.java +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectInner; -import com.azure.resourcemanager.cognitiveservices.models.Identity; -import com.azure.resourcemanager.cognitiveservices.models.Project; -import com.azure.resourcemanager.cognitiveservices.models.ProjectProperties; -import java.util.Collections; -import java.util.Map; - -public final class ProjectImpl implements Project, Project.Definition, Project.Update { - private ProjectInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public ProjectProperties properties() { - return this.innerModel().properties(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String location() { - return this.innerModel().location(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public Identity identity() { - return this.innerModel().identity(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public ProjectInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - private String projectName; - - public ProjectImpl withExistingAccount(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - public Project create() { - this.innerObject = serviceManager.serviceClient() - .getProjects() - .create(resourceGroupName, accountName, projectName, this.innerModel(), Context.NONE); - return this; - } - - public Project create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getProjects() - .create(resourceGroupName, accountName, projectName, this.innerModel(), context); - return this; - } - - ProjectImpl(String name, com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new ProjectInner(); - this.serviceManager = serviceManager; - this.projectName = name; - } - - public ProjectImpl update() { - return this; - } - - public Project apply() { - this.innerObject = serviceManager.serviceClient() - .getProjects() - .update(resourceGroupName, accountName, projectName, this.innerModel(), Context.NONE); - return this; - } - - public Project apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getProjects() - .update(resourceGroupName, accountName, projectName, this.innerModel(), context); - return this; - } - - ProjectImpl(ProjectInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.projectName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "projects"); - } - - public Project refresh() { - this.innerObject = serviceManager.serviceClient() - .getProjects() - .getWithResponse(resourceGroupName, accountName, projectName, Context.NONE) - .getValue(); - return this; - } - - public Project refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getProjects() - .getWithResponse(resourceGroupName, accountName, projectName, context) - .getValue(); - return this; - } - - public ProjectImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public ProjectImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public ProjectImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public ProjectImpl withProperties(ProjectProperties properties) { - this.innerModel().withProperties(properties); - return this; - } - - public ProjectImpl withIdentity(Identity identity) { - this.innerModel().withIdentity(identity); - return this; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsClientImpl.java deleted file mode 100644 index 621f5be6bd1c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsClientImpl.java +++ /dev/null @@ -1,984 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.Patch; -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.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.ProjectsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.ProjectListResult; -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 ProjectsClient. - */ -public final class ProjectsClientImpl implements ProjectsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ProjectsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of ProjectsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ProjectsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(ProjectsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientProjects to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientProjects") - public interface ProjectsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") - @ExpectedResponses({ 200, 201, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") ProjectInner project, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") - @ExpectedResponses({ 200, 201, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") ProjectInner project, Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") ProjectInner project, Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") ProjectInner project, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Returns a Cognitive Services project specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String accountName, - String projectName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a Cognitive Services project specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, String projectName) { - return getWithResponseAsync(resourceGroupName, accountName, projectName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a Cognitive Services project specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, String projectName, - Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, projectName, accept, context); - } - - /** - * Returns a Cognitive Services project specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProjectInner get(String resourceGroupName, String accountName, String projectName) { - return getWithResponse(resourceGroupName, accountName, projectName, Context.NONE).getValue(); - } - - /** - * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's - * individual container to work on. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String accountName, - String projectName, ProjectInner project) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, contentType, accept, - project, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's - * individual container to work on. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createWithResponse(String resourceGroupName, String accountName, String projectName, - ProjectInner project) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, contentType, accept, project, - Context.NONE); - } - - /** - * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's - * individual container to work on. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createWithResponse(String resourceGroupName, String accountName, String projectName, - ProjectInner project, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, contentType, accept, project, - context); - } - - /** - * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's - * individual container to work on. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive Services project is an Azure resource representing the - * provisioned account's project, it's type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProjectInner> beginCreateAsync(String resourceGroupName, - String accountName, String projectName, ProjectInner project) { - Mono>> mono - = createWithResponseAsync(resourceGroupName, accountName, projectName, project); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ProjectInner.class, ProjectInner.class, this.client.getContext()); - } - - /** - * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's - * individual container to work on. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive Services project is an Azure resource representing the - * provisioned account's project, it's type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProjectInner> beginCreate(String resourceGroupName, String accountName, - String projectName, ProjectInner project) { - Response response = createWithResponse(resourceGroupName, accountName, projectName, project); - return this.client.getLroResult(response, ProjectInner.class, ProjectInner.class, - Context.NONE); - } - - /** - * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's - * individual container to work on. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive Services project is an Azure resource representing the - * provisioned account's project, it's type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProjectInner> beginCreate(String resourceGroupName, String accountName, - String projectName, ProjectInner project, Context context) { - Response response - = createWithResponse(resourceGroupName, accountName, projectName, project, context); - return this.client.getLroResult(response, ProjectInner.class, ProjectInner.class, - context); - } - - /** - * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's - * individual container to work on. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String accountName, String projectName, - ProjectInner project) { - return beginCreateAsync(resourceGroupName, accountName, projectName, project).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's - * individual container to work on. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProjectInner create(String resourceGroupName, String accountName, String projectName, ProjectInner project) { - return beginCreate(resourceGroupName, accountName, projectName, project).getFinalResult(); - } - - /** - * Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's - * individual container to work on. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProjectInner create(String resourceGroupName, String accountName, String projectName, ProjectInner project, - Context context) { - return beginCreate(resourceGroupName, accountName, projectName, project, context).getFinalResult(); - } - - /** - * Updates a Cognitive Services Project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String accountName, - String projectName, ProjectInner project) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, contentType, accept, - project, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a Cognitive Services Project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String accountName, String projectName, - ProjectInner project) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, contentType, accept, project, - Context.NONE); - } - - /** - * Updates a Cognitive Services Project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String accountName, String projectName, - ProjectInner project, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, contentType, accept, project, - context); - } - - /** - * Updates a Cognitive Services Project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive Services project is an Azure resource representing the - * provisioned account's project, it's type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProjectInner> beginUpdateAsync(String resourceGroupName, - String accountName, String projectName, ProjectInner project) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, accountName, projectName, project); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ProjectInner.class, ProjectInner.class, this.client.getContext()); - } - - /** - * Updates a Cognitive Services Project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive Services project is an Azure resource representing the - * provisioned account's project, it's type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProjectInner> beginUpdate(String resourceGroupName, String accountName, - String projectName, ProjectInner project) { - Response response = updateWithResponse(resourceGroupName, accountName, projectName, project); - return this.client.getLroResult(response, ProjectInner.class, ProjectInner.class, - Context.NONE); - } - - /** - * Updates a Cognitive Services Project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive Services project is an Azure resource representing the - * provisioned account's project, it's type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProjectInner> beginUpdate(String resourceGroupName, String accountName, - String projectName, ProjectInner project, Context context) { - Response response - = updateWithResponse(resourceGroupName, accountName, projectName, project, context); - return this.client.getLroResult(response, ProjectInner.class, ProjectInner.class, - context); - } - - /** - * Updates a Cognitive Services Project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String accountName, String projectName, - ProjectInner project) { - return beginUpdateAsync(resourceGroupName, accountName, projectName, project).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a Cognitive Services Project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProjectInner update(String resourceGroupName, String accountName, String projectName, ProjectInner project) { - return beginUpdate(resourceGroupName, accountName, projectName, project).getFinalResult(); - } - - /** - * Updates a Cognitive Services Project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param project The parameters to provide for the created project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProjectInner update(String resourceGroupName, String accountName, String projectName, ProjectInner project, - Context context) { - return beginUpdate(resourceGroupName, accountName, projectName, project, context).getFinalResult(); - } - - /** - * Deletes a Cognitive Services project from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a Cognitive Services project from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, String projectName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, Context.NONE); - } - - /** - * Deletes a Cognitive Services project from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, String projectName, - Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, context); - } - - /** - * Deletes a Cognitive Services project from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName, projectName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes a Cognitive Services project from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName) { - Response response = deleteWithResponse(resourceGroupName, accountName, projectName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Deletes a Cognitive Services project from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName, Context context) { - Response response = deleteWithResponse(resourceGroupName, accountName, projectName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Deletes a Cognitive Services project from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String projectName) { - return beginDeleteAsync(resourceGroupName, accountName, projectName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a Cognitive Services project from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String projectName) { - beginDelete(resourceGroupName, accountName, projectName).getFinalResult(); - } - - /** - * Deletes a Cognitive Services project from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String projectName, Context context) { - beginDelete(resourceGroupName, accountName, projectName, context).getFinalResult(); - } - - /** - * Returns all the projects in a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services projects operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, 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 projects in a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services projects operation response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns all the projects in a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services projects operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Returns all the projects in a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 list of cognitive services projects operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Returns all the projects in a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 cognitive services projects operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Returns all the projects in a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 list of cognitive services projects operation response as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, 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 the list of cognitive services projects operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services projects operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services projects operation response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsImpl.java deleted file mode 100644 index 2ac60b86f85b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsImpl.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.ProjectsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectInner; -import com.azure.resourcemanager.cognitiveservices.models.Project; -import com.azure.resourcemanager.cognitiveservices.models.Projects; - -public final class ProjectsImpl implements Projects { - private static final ClientLogger LOGGER = new ClientLogger(ProjectsImpl.class); - - private final ProjectsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public ProjectsImpl(ProjectsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, String projectName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, accountName, projectName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ProjectImpl(inner.getValue(), this.manager())); - } - - public Project get(String resourceGroupName, String accountName, String projectName) { - ProjectInner inner = this.serviceClient().get(resourceGroupName, accountName, projectName); - if (inner != null) { - return new ProjectImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String accountName, String projectName) { - this.serviceClient().delete(resourceGroupName, accountName, projectName); - } - - public void delete(String resourceGroupName, String accountName, String projectName, Context context) { - this.serviceClient().delete(resourceGroupName, accountName, projectName, context); - } - - public PagedIterable list(String resourceGroupName, String accountName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ProjectImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ProjectImpl(inner1, this.manager())); - } - - public Project 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, projectName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, projectName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - this.delete(resourceGroupName, accountName, projectName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - this.delete(resourceGroupName, accountName, projectName, context); - } - - private ProjectsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public ProjectImpl define(String name) { - return new ProjectImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTierImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTierImpl.java deleted file mode 100644 index 08065d5eee23..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTierImpl.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.QuotaTierInner; -import com.azure.resourcemanager.cognitiveservices.models.QuotaTier; -import com.azure.resourcemanager.cognitiveservices.models.QuotaTierProperties; - -public final class QuotaTierImpl implements QuotaTier, QuotaTier.Definition, QuotaTier.Update { - private QuotaTierInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public QuotaTierProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public QuotaTierInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String defaultParameter; - - public QuotaTier create() { - this.innerObject = serviceManager.serviceClient() - .getQuotaTiers() - .createOrUpdateWithResponse(defaultParameter, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public QuotaTier create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getQuotaTiers() - .createOrUpdateWithResponse(defaultParameter, this.innerModel(), context) - .getValue(); - return this; - } - - QuotaTierImpl(String name, com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new QuotaTierInner(); - this.serviceManager = serviceManager; - this.defaultParameter = name; - } - - public QuotaTierImpl update() { - return this; - } - - public QuotaTier apply() { - this.innerObject = serviceManager.serviceClient() - .getQuotaTiers() - .updateWithResponse(defaultParameter, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public QuotaTier apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getQuotaTiers() - .updateWithResponse(defaultParameter, this.innerModel(), context) - .getValue(); - return this; - } - - QuotaTierImpl(QuotaTierInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.defaultParameter = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "quotaTiers"); - } - - public QuotaTier refresh() { - this.innerObject - = serviceManager.serviceClient().getQuotaTiers().getWithResponse(defaultParameter, Context.NONE).getValue(); - return this; - } - - public QuotaTier refresh(Context context) { - this.innerObject - = serviceManager.serviceClient().getQuotaTiers().getWithResponse(defaultParameter, context).getValue(); - return this; - } - - public QuotaTierImpl withProperties(QuotaTierProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTiersClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTiersClientImpl.java deleted file mode 100644 index 65bf8084a262..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTiersClientImpl.java +++ /dev/null @@ -1,553 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.Patch; -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.resourcemanager.cognitiveservices.fluent.QuotaTiersClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.QuotaTierInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.QuotaTierListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in QuotaTiersClient. - */ -public final class QuotaTiersClientImpl implements QuotaTiersClient { - /** - * The proxy service used to perform REST calls. - */ - private final QuotaTiersService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of QuotaTiersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - QuotaTiersClientImpl(CognitiveServicesManagementClientImpl client) { - this.service - = RestProxy.create(QuotaTiersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientQuotaTiers to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientQuotaTiers") - public interface QuotaTiersService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers/{default}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("default") String defaultParameter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers/{default}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("default") String defaultParameter, @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers/{default}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("default") String defaultParameter, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") QuotaTierInner tier, Context context); - - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers/{default}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("default") String defaultParameter, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") QuotaTierInner tier, Context context); - - @Patch("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers/{default}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("default") String defaultParameter, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") QuotaTierInner tier, Context context); - - @Patch("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers/{default}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("default") String defaultParameter, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") QuotaTierInner tier, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - 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("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listBySubscriptionNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the Quota Tier for a subscription - * - * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param defaultParameter Default parameter. Leave the value as default. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Quota Tier for a subscription - * - * Gets the Quota Tier information for the given subscription along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String defaultParameter) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), defaultParameter, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the Quota Tier for a subscription - * - * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param defaultParameter Default parameter. Leave the value as default. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Quota Tier for a subscription - * - * Gets the Quota Tier information for the given subscription on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String defaultParameter) { - return getWithResponseAsync(defaultParameter).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the Quota Tier for a subscription - * - * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param defaultParameter Default parameter. Leave the value as default. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Quota Tier for a subscription - * - * Gets the Quota Tier information for the given subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String defaultParameter, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - defaultParameter, accept, context); - } - - /** - * Gets the Quota Tier for a subscription - * - * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param defaultParameter Default parameter. Leave the value as default. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Quota Tier for a subscription - * - * Gets the Quota Tier information for the given subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public QuotaTierInner get(String defaultParameter) { - return getWithResponse(defaultParameter, Context.NONE).getValue(); - } - - /** - * Updates the Quota Tier resource for a subscription. - * - * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param defaultParameter Default parameter. Leave the value as default. - * @param tier The parameters to provide for the quota tier 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 quota tier information for the subscription along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String defaultParameter, - QuotaTierInner tier) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), defaultParameter, contentType, accept, tier, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the Quota Tier resource for a subscription. - * - * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param defaultParameter Default parameter. Leave the value as default. - * @param tier The parameters to provide for the quota tier 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 quota tier information for the subscription on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String defaultParameter, QuotaTierInner tier) { - return createOrUpdateWithResponseAsync(defaultParameter, tier).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Updates the Quota Tier resource for a subscription. - * - * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param defaultParameter Default parameter. Leave the value as default. - * @param tier The parameters to provide for the quota tier 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 quota tier information for the subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String defaultParameter, QuotaTierInner tier, - Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), defaultParameter, contentType, accept, tier, context); - } - - /** - * Updates the Quota Tier resource for a subscription. - * - * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param defaultParameter Default parameter. Leave the value as default. - * @param tier The parameters to provide for the quota tier 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 quota tier information for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public QuotaTierInner createOrUpdate(String defaultParameter, QuotaTierInner tier) { - return createOrUpdateWithResponse(defaultParameter, tier, Context.NONE).getValue(); - } - - /** - * Updates the Quota Tier resource for a subscription. The only properties that can be updated are - * "tierUpgradePolicy" - * - * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param defaultParameter Default parameter. Leave the value as default. - * @param tier The parameters to provide for the quota tier 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 quota tier information for the subscription along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String defaultParameter, QuotaTierInner tier) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), defaultParameter, contentType, accept, tier, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the Quota Tier resource for a subscription. The only properties that can be updated are - * "tierUpgradePolicy" - * - * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param defaultParameter Default parameter. Leave the value as default. - * @param tier The parameters to provide for the quota tier 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 quota tier information for the subscription on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String defaultParameter, QuotaTierInner tier) { - return updateWithResponseAsync(defaultParameter, tier).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Updates the Quota Tier resource for a subscription. The only properties that can be updated are - * "tierUpgradePolicy" - * - * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param defaultParameter Default parameter. Leave the value as default. - * @param tier The parameters to provide for the quota tier 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 quota tier information for the subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String defaultParameter, QuotaTierInner tier, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), defaultParameter, contentType, accept, tier, context); - } - - /** - * Updates the Quota Tier resource for a subscription. The only properties that can be updated are - * "tierUpgradePolicy" - * - * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param defaultParameter Default parameter. Leave the value as default. - * @param tier The parameters to provide for the quota tier 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 quota tier information for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public QuotaTierInner update(String defaultParameter, QuotaTierInner tier) { - return updateWithResponse(defaultParameter, tier, Context.NONE).getValue(); - } - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Quota Tiers response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - final String accept = "application/json"; - return FluxUtil - .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 subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Quota Tiers response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Quota Tiers response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage() { - 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); - } - - /** - * Returns all the resources of a particular type belonging to 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 list of Quota Tiers response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(Context context) { - 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); - } - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Quota Tiers response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); - } - - /** - * Returns all the resources of a particular type belonging to 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 list of Quota Tiers response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(() -> listSinglePage(context), - nextLink -> listBySubscriptionNextSinglePage(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 list of Quota Tiers response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Quota Tiers response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Quota Tiers response along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTiersImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTiersImpl.java deleted file mode 100644 index 1a2b2ddc30bf..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTiersImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.QuotaTiersClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.QuotaTierInner; -import com.azure.resourcemanager.cognitiveservices.models.QuotaTier; -import com.azure.resourcemanager.cognitiveservices.models.QuotaTiers; - -public final class QuotaTiersImpl implements QuotaTiers { - private static final ClientLogger LOGGER = new ClientLogger(QuotaTiersImpl.class); - - private final QuotaTiersClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public QuotaTiersImpl(QuotaTiersClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String defaultParameter, Context context) { - Response inner = this.serviceClient().getWithResponse(defaultParameter, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new QuotaTierImpl(inner.getValue(), this.manager())); - } - - public QuotaTier get(String defaultParameter) { - QuotaTierInner inner = this.serviceClient().get(defaultParameter); - if (inner != null) { - return new QuotaTierImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new QuotaTierImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new QuotaTierImpl(inner1, this.manager())); - } - - public QuotaTier getById(String id) { - String defaultParameter = ResourceManagerUtils.getValueFromIdByName(id, "quotaTiers"); - if (defaultParameter == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'quotaTiers'.", id))); - } - return this.getWithResponse(defaultParameter, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String defaultParameter = ResourceManagerUtils.getValueFromIdByName(id, "quotaTiers"); - if (defaultParameter == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'quotaTiers'.", id))); - } - return this.getWithResponse(defaultParameter, context); - } - - private QuotaTiersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public QuotaTierImpl define(String name) { - return new QuotaTierImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistImpl.java deleted file mode 100644 index 7a74ba5142de..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistImpl.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklist; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistProperties; -import java.util.Collections; -import java.util.Map; - -public final class RaiBlocklistImpl implements RaiBlocklist, RaiBlocklist.Definition, RaiBlocklist.Update { - private RaiBlocklistInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public RaiBlocklistProperties properties() { - return this.innerModel().properties(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public RaiBlocklistInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - private String raiBlocklistName; - - public RaiBlocklistImpl withExistingAccount(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - public RaiBlocklist create() { - this.innerObject = serviceManager.serviceClient() - .getRaiBlocklists() - .createOrUpdateWithResponse(resourceGroupName, accountName, raiBlocklistName, this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public RaiBlocklist create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getRaiBlocklists() - .createOrUpdateWithResponse(resourceGroupName, accountName, raiBlocklistName, this.innerModel(), context) - .getValue(); - return this; - } - - RaiBlocklistImpl(String name, com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new RaiBlocklistInner(); - this.serviceManager = serviceManager; - this.raiBlocklistName = name; - } - - public RaiBlocklistImpl update() { - return this; - } - - public RaiBlocklist apply() { - this.innerObject = serviceManager.serviceClient() - .getRaiBlocklists() - .createOrUpdateWithResponse(resourceGroupName, accountName, raiBlocklistName, this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public RaiBlocklist apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getRaiBlocklists() - .createOrUpdateWithResponse(resourceGroupName, accountName, raiBlocklistName, this.innerModel(), context) - .getValue(); - return this; - } - - RaiBlocklistImpl(RaiBlocklistInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.raiBlocklistName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "raiBlocklists"); - } - - public RaiBlocklist refresh() { - this.innerObject = serviceManager.serviceClient() - .getRaiBlocklists() - .getWithResponse(resourceGroupName, accountName, raiBlocklistName, Context.NONE) - .getValue(); - return this; - } - - public RaiBlocklist refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getRaiBlocklists() - .getWithResponse(resourceGroupName, accountName, raiBlocklistName, context) - .getValue(); - return this; - } - - public RaiBlocklistImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public RaiBlocklistImpl withProperties(RaiBlocklistProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemImpl.java deleted file mode 100644 index 28b9be1990d5..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemImpl.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistItemInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItem; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemProperties; -import java.util.Collections; -import java.util.Map; - -public final class RaiBlocklistItemImpl - implements RaiBlocklistItem, RaiBlocklistItem.Definition, RaiBlocklistItem.Update { - private RaiBlocklistItemInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public RaiBlocklistItemProperties properties() { - return this.innerModel().properties(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public RaiBlocklistItemInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - private String raiBlocklistName; - - private String raiBlocklistItemName; - - public RaiBlocklistItemImpl withExistingRaiBlocklist(String resourceGroupName, String accountName, - String raiBlocklistName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - this.raiBlocklistName = raiBlocklistName; - return this; - } - - public RaiBlocklistItem create() { - this.innerObject = serviceManager.serviceClient() - .getRaiBlocklistItems() - .createOrUpdateWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, - this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public RaiBlocklistItem create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getRaiBlocklistItems() - .createOrUpdateWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, - this.innerModel(), context) - .getValue(); - return this; - } - - RaiBlocklistItemImpl(String name, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new RaiBlocklistItemInner(); - this.serviceManager = serviceManager; - this.raiBlocklistItemName = name; - } - - public RaiBlocklistItemImpl update() { - return this; - } - - public RaiBlocklistItem apply() { - this.innerObject = serviceManager.serviceClient() - .getRaiBlocklistItems() - .createOrUpdateWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, - this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public RaiBlocklistItem apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getRaiBlocklistItems() - .createOrUpdateWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, - this.innerModel(), context) - .getValue(); - return this; - } - - RaiBlocklistItemImpl(RaiBlocklistItemInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.raiBlocklistName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "raiBlocklists"); - this.raiBlocklistItemName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "raiBlocklistItems"); - } - - public RaiBlocklistItem refresh() { - this.innerObject = serviceManager.serviceClient() - .getRaiBlocklistItems() - .getWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, Context.NONE) - .getValue(); - return this; - } - - public RaiBlocklistItem refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getRaiBlocklistItems() - .getWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, context) - .getValue(); - return this; - } - - public RaiBlocklistItemImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public RaiBlocklistItemImpl withProperties(RaiBlocklistItemProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemsClientImpl.java deleted file mode 100644 index b24c692a733d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemsClientImpl.java +++ /dev/null @@ -1,916 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistItemsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistItemInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.RaiBlockListItemsResult; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemBulkRequest; -import java.nio.ByteBuffer; -import java.util.List; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in RaiBlocklistItemsClient. - */ -public final class RaiBlocklistItemsClientImpl implements RaiBlocklistItemsClient { - /** - * The proxy service used to perform REST calls. - */ - private final RaiBlocklistItemsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of RaiBlocklistItemsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RaiBlocklistItemsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service - = RestProxy.create(RaiBlocklistItemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientRaiBlocklistItems to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientRaiBlocklistItems") - public interface RaiBlocklistItemsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiBlocklistName") String raiBlocklistName, - @PathParam("raiBlocklistItemName") String raiBlocklistItemName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiBlocklistName") String raiBlocklistName, - @PathParam("raiBlocklistItemName") String raiBlocklistItemName, @HeaderParam("Accept") String accept, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiBlocklistName") String raiBlocklistName, - @PathParam("raiBlocklistItemName") String raiBlocklistItemName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") RaiBlocklistItemInner raiBlocklistItem, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiBlocklistName") String raiBlocklistName, - @PathParam("raiBlocklistItemName") String raiBlocklistItemName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") RaiBlocklistItemInner raiBlocklistItem, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiBlocklistName") String raiBlocklistName, - @PathParam("raiBlocklistItemName") String raiBlocklistItemName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiBlocklistName") String raiBlocklistName, - @PathParam("raiBlocklistItemName") String raiBlocklistItemName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Accept") String accept, - Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> batchAdd(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") List raiBlocklistItems, Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response batchAddSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") List raiBlocklistItems, Context context); - - @Headers({ "Accept: application/json;q=0.9" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> batchDelete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") List raiBlocklistItemsNames, Context context); - - @Headers({ "Accept: application/json;q=0.9" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response batchDeleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") List raiBlocklistItemsNames, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the specified custom blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 custom blocklist Item associated with the custom blocklist along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String accountName, - String raiBlocklistName, String raiBlocklistItemName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified custom blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 custom blocklist Item associated with the custom blocklist on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, String raiBlocklistName, - String raiBlocklistItemName) { - return getWithResponseAsync(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the specified custom blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 custom blocklist Item associated with the custom blocklist along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, - String raiBlocklistName, String raiBlocklistItemName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, accept, context); - } - - /** - * Gets the specified custom blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 custom blocklist Item associated with the custom blocklist. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RaiBlocklistItemInner get(String resourceGroupName, String accountName, String raiBlocklistName, - String raiBlocklistItemName) { - return getWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, Context.NONE) - .getValue(); - } - - /** - * Update the state of specified blocklist item associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @param raiBlocklistItem Properties describing the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiBlocklist Item along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String accountName, String raiBlocklistName, String raiBlocklistItemName, - RaiBlocklistItemInner raiBlocklistItem) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, - contentType, accept, raiBlocklistItem, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the state of specified blocklist item associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @param raiBlocklistItem Properties describing the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiBlocklist Item on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, - String raiBlocklistName, String raiBlocklistItemName, RaiBlocklistItemInner raiBlocklistItem) { - return createOrUpdateWithResponseAsync(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, - raiBlocklistItem).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Update the state of specified blocklist item associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @param raiBlocklistItem Properties describing the custom blocklist. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiBlocklist Item along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String raiBlocklistName, String raiBlocklistItemName, RaiBlocklistItemInner raiBlocklistItem, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, - contentType, accept, raiBlocklistItem, context); - } - - /** - * Update the state of specified blocklist item associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @param raiBlocklistItem Properties describing the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiBlocklist Item. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RaiBlocklistItemInner createOrUpdate(String resourceGroupName, String accountName, String raiBlocklistName, - String raiBlocklistItemName, RaiBlocklistItemInner raiBlocklistItem) { - return createOrUpdateWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, - raiBlocklistItem, Context.NONE).getValue(); - } - - /** - * Deletes the specified blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiBlocklistName, String raiBlocklistItemName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiBlocklistName, String raiBlocklistItemName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, - Context.NONE); - } - - /** - * Deletes the specified blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiBlocklistName, String raiBlocklistItemName, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, - context); - } - - /** - * Deletes the specified blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiBlocklistName, String raiBlocklistItemName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes the specified blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiBlocklistName, String raiBlocklistItemName) { - Response response - = deleteWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Deletes the specified blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiBlocklistName, String raiBlocklistItemName, Context context) { - Response response - = deleteWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Deletes the specified blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String raiBlocklistName, - String raiBlocklistItemName) { - return beginDeleteAsync(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String raiBlocklistName, - String raiBlocklistItemName) { - beginDelete(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName).getFinalResult(); - } - - /** - * Deletes the specified blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String raiBlocklistName, - String raiBlocklistItemName, Context context) { - beginDelete(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, context).getFinalResult(); - } - - /** - * Gets the blocklist items associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blocklist items associated with the custom blocklist along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String accountName, - String raiBlocklistName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, 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 blocklist items associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blocklist items associated with the custom blocklist as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName, - String raiBlocklistName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, raiBlocklistName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the blocklist items associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blocklist items associated with the custom blocklist along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - String raiBlocklistName) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the blocklist items associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services 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 blocklist items associated with the custom blocklist along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - String raiBlocklistName, Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the blocklist items associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blocklist items associated with the custom blocklist as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, - String raiBlocklistName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, raiBlocklistName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Gets the blocklist items associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services 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 blocklist items associated with the custom blocklist as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, - String raiBlocklistName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, raiBlocklistName, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Batch operation to add blocklist items. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItems Properties describing the custom blocklist 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 cognitive Services RaiBlocklist along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> batchAddWithResponseAsync(String resourceGroupName, String accountName, - String raiBlocklistName, List raiBlocklistItems) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.batchAdd(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, contentType, accept, - raiBlocklistItems, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Batch operation to add blocklist items. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItems Properties describing the custom blocklist 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 cognitive Services RaiBlocklist on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono batchAddAsync(String resourceGroupName, String accountName, String raiBlocklistName, - List raiBlocklistItems) { - return batchAddWithResponseAsync(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItems) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Batch operation to add blocklist items. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItems Properties describing the custom blocklist 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 cognitive Services RaiBlocklist along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response batchAddWithResponse(String resourceGroupName, String accountName, - String raiBlocklistName, List raiBlocklistItems, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.batchAddSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, contentType, accept, - raiBlocklistItems, context); - } - - /** - * Batch operation to add blocklist items. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItems Properties describing the custom blocklist 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 cognitive Services RaiBlocklist. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RaiBlocklistInner batchAdd(String resourceGroupName, String accountName, String raiBlocklistName, - List raiBlocklistItems) { - return batchAddWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItems, Context.NONE) - .getValue(); - } - - /** - * Batch operation to delete blocklist items. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemsNames List of RAI Blocklist Items Names. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> batchDeleteWithResponseAsync(String resourceGroupName, String accountName, - String raiBlocklistName, List raiBlocklistItemsNames) { - final String contentType = "application/json"; - return FluxUtil - .withContext(context -> service.batchDelete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, contentType, - raiBlocklistItemsNames, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Batch operation to delete blocklist items. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemsNames List of RAI Blocklist Items Names. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 batchDeleteAsync(String resourceGroupName, String accountName, String raiBlocklistName, - List raiBlocklistItemsNames) { - return batchDeleteWithResponseAsync(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemsNames) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Batch operation to delete blocklist items. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemsNames List of RAI Blocklist Items Names. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 batchDeleteWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, - List raiBlocklistItemsNames, Context context) { - final String contentType = "application/json"; - return service.batchDeleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, contentType, - raiBlocklistItemsNames, context); - } - - /** - * Batch operation to delete blocklist items. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemsNames List of RAI Blocklist Items Names. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 batchDelete(String resourceGroupName, String accountName, String raiBlocklistName, - List raiBlocklistItemsNames) { - batchDeleteWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemsNames, Context.NONE); - } - - /** - * 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 blocklist items associated with the custom blocklist along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blocklist items associated with the custom blocklist along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blocklist items associated with the custom blocklist along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemsImpl.java deleted file mode 100644 index c2c9ef0aa5c8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemsImpl.java +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.RaiBlocklistItemsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistItemInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklist; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItem; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemBulkRequest; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItems; -import java.util.List; - -public final class RaiBlocklistItemsImpl implements RaiBlocklistItems { - private static final ClientLogger LOGGER = new ClientLogger(RaiBlocklistItemsImpl.class); - - private final RaiBlocklistItemsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public RaiBlocklistItemsImpl(RaiBlocklistItemsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, - String raiBlocklistName, String raiBlocklistItemName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RaiBlocklistItemImpl(inner.getValue(), this.manager())); - } - - public RaiBlocklistItem get(String resourceGroupName, String accountName, String raiBlocklistName, - String raiBlocklistItemName) { - RaiBlocklistItemInner inner - = this.serviceClient().get(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName); - if (inner != null) { - return new RaiBlocklistItemImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String accountName, String raiBlocklistName, - String raiBlocklistItemName) { - this.serviceClient().delete(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName); - } - - public void delete(String resourceGroupName, String accountName, String raiBlocklistName, - String raiBlocklistItemName, Context context) { - this.serviceClient().delete(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, context); - } - - public PagedIterable list(String resourceGroupName, String accountName, String raiBlocklistName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName, raiBlocklistName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiBlocklistItemImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, String raiBlocklistName, - Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName, raiBlocklistName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiBlocklistItemImpl(inner1, this.manager())); - } - - public Response batchAddWithResponse(String resourceGroupName, String accountName, - String raiBlocklistName, List raiBlocklistItems, Context context) { - Response inner = this.serviceClient() - .batchAddWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItems, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RaiBlocklistImpl(inner.getValue(), this.manager())); - } - - public RaiBlocklist batchAdd(String resourceGroupName, String accountName, String raiBlocklistName, - List raiBlocklistItems) { - RaiBlocklistInner inner - = this.serviceClient().batchAdd(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItems); - if (inner != null) { - return new RaiBlocklistImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response batchDeleteWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, - List raiBlocklistItemsNames, Context context) { - return this.serviceClient() - .batchDeleteWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemsNames, context); - } - - public void batchDelete(String resourceGroupName, String accountName, String raiBlocklistName, - List raiBlocklistItemsNames) { - this.serviceClient().batchDelete(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemsNames); - } - - public RaiBlocklistItem 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String raiBlocklistName = ResourceManagerUtils.getValueFromIdByName(id, "raiBlocklists"); - if (raiBlocklistName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raiBlocklists'.", id))); - } - String raiBlocklistItemName = ResourceManagerUtils.getValueFromIdByName(id, "raiBlocklistItems"); - if (raiBlocklistItemName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raiBlocklistItems'.", id))); - } - return this - .getWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String raiBlocklistName = ResourceManagerUtils.getValueFromIdByName(id, "raiBlocklists"); - if (raiBlocklistName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raiBlocklists'.", id))); - } - String raiBlocklistItemName = ResourceManagerUtils.getValueFromIdByName(id, "raiBlocklistItems"); - if (raiBlocklistItemName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raiBlocklistItems'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String raiBlocklistName = ResourceManagerUtils.getValueFromIdByName(id, "raiBlocklists"); - if (raiBlocklistName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raiBlocklists'.", id))); - } - String raiBlocklistItemName = ResourceManagerUtils.getValueFromIdByName(id, "raiBlocklistItems"); - if (raiBlocklistItemName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raiBlocklistItems'.", id))); - } - this.delete(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String raiBlocklistName = ResourceManagerUtils.getValueFromIdByName(id, "raiBlocklists"); - if (raiBlocklistName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raiBlocklists'.", id))); - } - String raiBlocklistItemName = ResourceManagerUtils.getValueFromIdByName(id, "raiBlocklistItems"); - if (raiBlocklistItemName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raiBlocklistItems'.", id))); - } - this.delete(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, context); - } - - private RaiBlocklistItemsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public RaiBlocklistItemImpl define(String name) { - return new RaiBlocklistItemImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistsClientImpl.java deleted file mode 100644 index 6e2b6d9aac8a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistsClientImpl.java +++ /dev/null @@ -1,656 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.RaiBlockListResult; -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 RaiBlocklistsClient. - */ -public final class RaiBlocklistsClientImpl implements RaiBlocklistsClient { - /** - * The proxy service used to perform REST calls. - */ - private final RaiBlocklistsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of RaiBlocklistsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RaiBlocklistsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service - = RestProxy.create(RaiBlocklistsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientRaiBlocklists to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientRaiBlocklists") - public interface RaiBlocklistsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Accept") String accept, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") RaiBlocklistInner raiBlocklist, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") RaiBlocklistInner raiBlocklist, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiBlocklistName") String raiBlocklistName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiBlocklistName") String raiBlocklistName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 custom blocklist associated with the Azure OpenAI account along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String accountName, - String raiBlocklistName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 custom blocklist associated with the Azure OpenAI account on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, String raiBlocklistName) { - return getWithResponseAsync(resourceGroupName, accountName, raiBlocklistName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services 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 specified custom blocklist associated with the Azure OpenAI account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, - String raiBlocklistName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, raiBlocklistName, accept, context); - } - - /** - * Gets the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 custom blocklist associated with the Azure OpenAI account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RaiBlocklistInner get(String resourceGroupName, String accountName, String raiBlocklistName) { - return getWithResponse(resourceGroupName, accountName, raiBlocklistName, Context.NONE).getValue(); - } - - /** - * Update the state of specified blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklist Properties describing the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiBlocklist along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String accountName, String raiBlocklistName, RaiBlocklistInner raiBlocklist) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, contentType, accept, - raiBlocklist, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the state of specified blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklist Properties describing the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiBlocklist on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, - String raiBlocklistName, RaiBlocklistInner raiBlocklist) { - return createOrUpdateWithResponseAsync(resourceGroupName, accountName, raiBlocklistName, raiBlocklist) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Update the state of specified blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklist Properties describing the custom blocklist. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiBlocklist along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String raiBlocklistName, RaiBlocklistInner raiBlocklist, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, contentType, accept, - raiBlocklist, context); - } - - /** - * Update the state of specified blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklist Properties describing the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiBlocklist. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RaiBlocklistInner createOrUpdate(String resourceGroupName, String accountName, String raiBlocklistName, - RaiBlocklistInner raiBlocklist) { - return createOrUpdateWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklist, Context.NONE) - .getValue(); - } - - /** - * Deletes the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiBlocklistName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiBlocklistName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, Context.NONE); - } - - /** - * Deletes the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String accountName, - String raiBlocklistName, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, context); - } - - /** - * Deletes the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiBlocklistName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, accountName, raiBlocklistName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiBlocklistName) { - Response response = deleteWithResponse(resourceGroupName, accountName, raiBlocklistName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Deletes the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String raiBlocklistName, Context context) { - Response response = deleteWithResponse(resourceGroupName, accountName, raiBlocklistName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Deletes the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String raiBlocklistName) { - return beginDeleteAsync(resourceGroupName, accountName, raiBlocklistName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String raiBlocklistName) { - beginDelete(resourceGroupName, accountName, raiBlocklistName).getFinalResult(); - } - - /** - * Deletes the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String raiBlocklistName, Context context) { - beginDelete(resourceGroupName, accountName, raiBlocklistName, context).getFinalResult(); - } - - /** - * Gets the custom blocklists associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom blocklists associated with the Azure OpenAI account along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, 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 custom blocklists associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom blocklists associated with the Azure OpenAI account as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the custom blocklists associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom blocklists associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the custom blocklists associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 custom blocklists associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the custom blocklists associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom blocklists associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Gets the custom blocklists associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 custom blocklists associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, 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 the custom blocklists associated with the Azure OpenAI account along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom blocklists associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom blocklists associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistsImpl.java deleted file mode 100644 index 082fd7247c82..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistsImpl.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.RaiBlocklistsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklist; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklists; - -public final class RaiBlocklistsImpl implements RaiBlocklists { - private static final ClientLogger LOGGER = new ClientLogger(RaiBlocklistsImpl.class); - - private final RaiBlocklistsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public RaiBlocklistsImpl(RaiBlocklistsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, accountName, raiBlocklistName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RaiBlocklistImpl(inner.getValue(), this.manager())); - } - - public RaiBlocklist get(String resourceGroupName, String accountName, String raiBlocklistName) { - RaiBlocklistInner inner = this.serviceClient().get(resourceGroupName, accountName, raiBlocklistName); - if (inner != null) { - return new RaiBlocklistImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String accountName, String raiBlocklistName) { - this.serviceClient().delete(resourceGroupName, accountName, raiBlocklistName); - } - - public void delete(String resourceGroupName, String accountName, String raiBlocklistName, Context context) { - this.serviceClient().delete(resourceGroupName, accountName, raiBlocklistName, context); - } - - public PagedIterable list(String resourceGroupName, String accountName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiBlocklistImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiBlocklistImpl(inner1, this.manager())); - } - - public RaiBlocklist 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String raiBlocklistName = ResourceManagerUtils.getValueFromIdByName(id, "raiBlocklists"); - if (raiBlocklistName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raiBlocklists'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, raiBlocklistName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String raiBlocklistName = ResourceManagerUtils.getValueFromIdByName(id, "raiBlocklists"); - if (raiBlocklistName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raiBlocklists'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, raiBlocklistName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String raiBlocklistName = ResourceManagerUtils.getValueFromIdByName(id, "raiBlocklists"); - if (raiBlocklistName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raiBlocklists'.", id))); - } - this.delete(resourceGroupName, accountName, raiBlocklistName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String raiBlocklistName = ResourceManagerUtils.getValueFromIdByName(id, "raiBlocklists"); - if (raiBlocklistName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raiBlocklists'.", id))); - } - this.delete(resourceGroupName, accountName, raiBlocklistName, context); - } - - private RaiBlocklistsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public RaiBlocklistImpl define(String name) { - return new RaiBlocklistImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFilterImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFilterImpl.java deleted file mode 100644 index 59cac3c032fc..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFilterImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiContentFilterInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiContentFilter; -import com.azure.resourcemanager.cognitiveservices.models.RaiContentFilterProperties; - -public final class RaiContentFilterImpl implements RaiContentFilter { - private RaiContentFilterInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - RaiContentFilterImpl(RaiContentFilterInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager 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 RaiContentFilterProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public RaiContentFilterInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFiltersClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFiltersClientImpl.java deleted file mode 100644 index 12cb6c4d4727..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFiltersClientImpl.java +++ /dev/null @@ -1,338 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.RaiContentFiltersClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiContentFilterInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.RaiContentFilterListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in RaiContentFiltersClient. - */ -public final class RaiContentFiltersClientImpl implements RaiContentFiltersClient { - /** - * The proxy service used to perform REST calls. - */ - private final RaiContentFiltersService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of RaiContentFiltersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RaiContentFiltersClientImpl(CognitiveServicesManagementClientImpl client) { - this.service - = RestProxy.create(RaiContentFiltersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientRaiContentFilters to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientRaiContentFilters") - public interface RaiContentFiltersService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/raiContentFilters/{filterName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @PathParam("filterName") String filterName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/raiContentFilters/{filterName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @PathParam("filterName") String filterName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/raiContentFilters") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/raiContentFilters") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get Content Filters by Name. - * - * @param location The name of the Azure region. - * @param filterName The name of the RAI Content Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return content Filters by Name along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String location, String filterName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, filterName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Content Filters by Name. - * - * @param location The name of the Azure region. - * @param filterName The name of the RAI Content Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return content Filters by Name on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String location, String filterName) { - return getWithResponseAsync(location, filterName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get Content Filters by Name. - * - * @param location The name of the Azure region. - * @param filterName The name of the RAI Content Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return content Filters by Name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String location, String filterName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - location, filterName, accept, context); - } - - /** - * Get Content Filters by Name. - * - * @param location The name of the Azure region. - * @param filterName The name of the RAI Content Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return content Filters by Name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RaiContentFilterInner get(String location, String filterName) { - return getWithResponse(location, filterName, Context.NONE).getValue(); - } - - /** - * List Content Filters types. - * - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Content Filters along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, 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 Content Filters types. - * - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Content Filters as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location) { - return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List Content Filters types. - * - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Content Filters along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String location) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List Content Filters types. - * - * @param location The name of the Azure region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Content Filters along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String location, Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List Content Filters types. - * - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Content Filters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location) { - return new PagedIterable<>(() -> listSinglePage(location), nextLink -> listNextSinglePage(nextLink)); - } - - /** - * List Content Filters types. - * - * @param location The name of the Azure region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Content Filters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location, Context context) { - return new PagedIterable<>(() -> listSinglePage(location, 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 the list of Content Filters along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Content Filters along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Content Filters along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFiltersImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFiltersImpl.java deleted file mode 100644 index f810818d8633..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFiltersImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.RaiContentFiltersClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiContentFilterInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiContentFilter; -import com.azure.resourcemanager.cognitiveservices.models.RaiContentFilters; - -public final class RaiContentFiltersImpl implements RaiContentFilters { - private static final ClientLogger LOGGER = new ClientLogger(RaiContentFiltersImpl.class); - - private final RaiContentFiltersClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public RaiContentFiltersImpl(RaiContentFiltersClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String location, String filterName, Context context) { - Response inner = this.serviceClient().getWithResponse(location, filterName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RaiContentFilterImpl(inner.getValue(), this.manager())); - } - - public RaiContentFilter get(String location, String filterName) { - RaiContentFilterInner inner = this.serviceClient().get(location, filterName); - if (inner != null) { - return new RaiContentFilterImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String location) { - PagedIterable inner = this.serviceClient().list(location); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiContentFilterImpl(inner1, this.manager())); - } - - public PagedIterable list(String location, Context context) { - PagedIterable inner = this.serviceClient().list(location, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiContentFilterImpl(inner1, this.manager())); - } - - private RaiContentFiltersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProviderSchemaImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProviderSchemaImpl.java deleted file mode 100644 index 14303c3cbe47..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProviderSchemaImpl.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProviderSchema; -import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProviderSchemaProperties; -import java.util.Collections; -import java.util.Map; - -public final class RaiExternalSafetyProviderSchemaImpl implements RaiExternalSafetyProviderSchema, - RaiExternalSafetyProviderSchema.Definition, RaiExternalSafetyProviderSchema.Update { - private RaiExternalSafetyProviderSchemaInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public RaiExternalSafetyProviderSchemaProperties properties() { - return this.innerModel().properties(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public RaiExternalSafetyProviderSchemaInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - private String safetyProviderName; - - public RaiExternalSafetyProviderSchemaImpl withExistingAccount(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - public RaiExternalSafetyProviderSchema create() { - this.innerObject = serviceManager.serviceClient() - .getTestRaiExternalSafetyProviders() - .createOrUpdateWithResponse(resourceGroupName, accountName, safetyProviderName, this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public RaiExternalSafetyProviderSchema create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getTestRaiExternalSafetyProviders() - .createOrUpdateWithResponse(resourceGroupName, accountName, safetyProviderName, this.innerModel(), context) - .getValue(); - return this; - } - - RaiExternalSafetyProviderSchemaImpl(String name, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new RaiExternalSafetyProviderSchemaInner(); - this.serviceManager = serviceManager; - this.safetyProviderName = name; - } - - public RaiExternalSafetyProviderSchemaImpl update() { - return this; - } - - public RaiExternalSafetyProviderSchema apply() { - this.innerObject = serviceManager.serviceClient() - .getTestRaiExternalSafetyProviders() - .createOrUpdateWithResponse(resourceGroupName, accountName, safetyProviderName, this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public RaiExternalSafetyProviderSchema apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getTestRaiExternalSafetyProviders() - .createOrUpdateWithResponse(resourceGroupName, accountName, safetyProviderName, this.innerModel(), context) - .getValue(); - return this; - } - - RaiExternalSafetyProviderSchemaImpl(RaiExternalSafetyProviderSchemaInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.safetyProviderName - = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "testRaiExternalSafetyProvider"); - } - - public RaiExternalSafetyProviderSchemaImpl withProperties(RaiExternalSafetyProviderSchemaProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersClientImpl.java deleted file mode 100644 index 159bc3c72de7..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersClientImpl.java +++ /dev/null @@ -1,414 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.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.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.RaiExternalSafetyProvidersClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; -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 RaiExternalSafetyProvidersClient. - */ -public final class RaiExternalSafetyProvidersClientImpl implements RaiExternalSafetyProvidersClient { - /** - * The proxy service used to perform REST calls. - */ - private final RaiExternalSafetyProvidersService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of RaiExternalSafetyProvidersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RaiExternalSafetyProvidersClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(RaiExternalSafetyProvidersService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientRaiExternalSafetyProviders to be - * used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientRaiExternalSafetyProviders") - public interface RaiExternalSafetyProvidersService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders/{safetyProviderName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("safetyProviderName") String safetyProviderName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders/{safetyProviderName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("safetyProviderName") String safetyProviderName, @HeaderParam("Accept") String accept, - Context context); - - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders/{safetyProviderName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("safetyProviderName") String safetyProviderName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") RaiExternalSafetyProviderSchemaInner safetyProvider, Context context); - - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders/{safetyProviderName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("safetyProviderName") String safetyProviderName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") RaiExternalSafetyProviderSchemaInner safetyProvider, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders/{safetyProviderName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("safetyProviderName") String safetyProviderName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders/{safetyProviderName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("safetyProviderName") String safetyProviderName, Context context); - } - - /** - * Gets the specified external safety provider associated with the Subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 external safety provider associated with the Subscription along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String safetyProviderName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), safetyProviderName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified external safety provider associated with the Subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 external safety provider associated with the Subscription on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String safetyProviderName) { - return getWithResponseAsync(safetyProviderName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the specified external safety provider associated with the Subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * 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 specified external safety provider associated with the Subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String safetyProviderName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - safetyProviderName, accept, context); - } - - /** - * Gets the specified external safety provider associated with the Subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 external safety provider associated with the Subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RaiExternalSafetyProviderSchemaInner get(String safetyProviderName) { - return getWithResponse(safetyProviderName, Context.NONE).getValue(); - } - - /** - * Create the rai safety provider associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @param safetyProvider Properties describing the rai external safety provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services Rai External Safety provider Schema along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String safetyProviderName, RaiExternalSafetyProviderSchemaInner safetyProvider) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), safetyProviderName, contentType, accept, safetyProvider, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create the rai safety provider associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @param safetyProvider Properties describing the rai external safety provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services Rai External Safety provider Schema on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String safetyProviderName, - RaiExternalSafetyProviderSchemaInner safetyProvider) { - return createOrUpdateWithResponseAsync(safetyProviderName, safetyProvider) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create the rai safety provider associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @param safetyProvider Properties describing the rai external safety provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services Rai External Safety provider Schema along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String safetyProviderName, - RaiExternalSafetyProviderSchemaInner safetyProvider, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), safetyProviderName, contentType, accept, safetyProvider, context); - } - - /** - * Create the rai safety provider associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @param safetyProvider Properties describing the rai external safety provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services Rai External Safety provider Schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RaiExternalSafetyProviderSchemaInner createOrUpdate(String safetyProviderName, - RaiExternalSafetyProviderSchemaInner safetyProvider) { - return createOrUpdateWithResponse(safetyProviderName, safetyProvider, Context.NONE).getValue(); - } - - /** - * Deletes the specified custom topic associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 safetyProviderName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), safetyProviderName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified custom topic associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 safetyProviderName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), safetyProviderName, Context.NONE); - } - - /** - * Deletes the specified custom topic associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String safetyProviderName, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), safetyProviderName, context); - } - - /** - * Deletes the specified custom topic associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 safetyProviderName) { - Mono>> mono = deleteWithResponseAsync(safetyProviderName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes the specified custom topic associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 safetyProviderName) { - Response response = deleteWithResponse(safetyProviderName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Deletes the specified custom topic associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String safetyProviderName, Context context) { - Response response = deleteWithResponse(safetyProviderName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Deletes the specified custom topic associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 safetyProviderName) { - return beginDeleteAsync(safetyProviderName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified custom topic associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 safetyProviderName) { - beginDelete(safetyProviderName).getFinalResult(); - } - - /** - * Deletes the specified custom topic associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String safetyProviderName, Context context) { - beginDelete(safetyProviderName, context).getFinalResult(); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersImpl.java deleted file mode 100644 index 16205738c016..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.RaiExternalSafetyProvidersClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProviderSchema; -import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProviders; - -public final class RaiExternalSafetyProvidersImpl implements RaiExternalSafetyProviders { - private static final ClientLogger LOGGER = new ClientLogger(RaiExternalSafetyProvidersImpl.class); - - private final RaiExternalSafetyProvidersClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public RaiExternalSafetyProvidersImpl(RaiExternalSafetyProvidersClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String safetyProviderName, Context context) { - Response inner - = this.serviceClient().getWithResponse(safetyProviderName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RaiExternalSafetyProviderSchemaImpl(inner.getValue(), this.manager())); - } - - public RaiExternalSafetyProviderSchema get(String safetyProviderName) { - RaiExternalSafetyProviderSchemaInner inner = this.serviceClient().get(safetyProviderName); - if (inner != null) { - return new RaiExternalSafetyProviderSchemaImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse(String safetyProviderName, - RaiExternalSafetyProviderSchemaInner safetyProvider, Context context) { - Response inner - = this.serviceClient().createOrUpdateWithResponse(safetyProviderName, safetyProvider, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RaiExternalSafetyProviderSchemaImpl(inner.getValue(), this.manager())); - } - - public RaiExternalSafetyProviderSchema createOrUpdate(String safetyProviderName, - RaiExternalSafetyProviderSchemaInner safetyProvider) { - RaiExternalSafetyProviderSchemaInner inner - = this.serviceClient().createOrUpdate(safetyProviderName, safetyProvider); - if (inner != null) { - return new RaiExternalSafetyProviderSchemaImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String safetyProviderName) { - this.serviceClient().delete(safetyProviderName); - } - - public void delete(String safetyProviderName, Context context) { - this.serviceClient().delete(safetyProviderName, context); - } - - private RaiExternalSafetyProvidersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersOperationsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersOperationsClientImpl.java deleted file mode 100644 index e4d4461efd16..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersOperationsClientImpl.java +++ /dev/null @@ -1,246 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.RaiExternalSafetyProvidersOperationsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.RaiExternalSafetyProviderResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * RaiExternalSafetyProvidersOperationsClient. - */ -public final class RaiExternalSafetyProvidersOperationsClientImpl - implements RaiExternalSafetyProvidersOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final RaiExternalSafetyProvidersOperationsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of RaiExternalSafetyProvidersOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RaiExternalSafetyProvidersOperationsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(RaiExternalSafetyProvidersOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientRaiExternalSafetyProvidersOperations - * to be used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientRaiExternalSafetyProvidersOperations") - public interface RaiExternalSafetyProvidersOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - 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("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the safety providers associated with the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the safety providers associated with the subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - final String accept = "application/json"; - return FluxUtil - .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())); - } - - /** - * Gets the safety providers associated with the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the safety providers associated with the subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the safety providers associated with the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the safety providers associated with the subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage() { - 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); - } - - /** - * Gets the safety providers associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the safety providers associated with the subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(Context context) { - 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); - } - - /** - * Gets the safety providers associated with the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the safety providers associated with the subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Gets the safety providers associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the safety providers associated with the subscription 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 the safety providers associated with the subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the safety providers associated with the subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the safety providers associated with the subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersOperationsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersOperationsImpl.java deleted file mode 100644 index cc1ec85b92c7..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersOperationsImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.RaiExternalSafetyProvidersOperationsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProviderSchema; -import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProvidersOperations; - -public final class RaiExternalSafetyProvidersOperationsImpl implements RaiExternalSafetyProvidersOperations { - private static final ClientLogger LOGGER = new ClientLogger(RaiExternalSafetyProvidersOperationsImpl.class); - - private final RaiExternalSafetyProvidersOperationsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public RaiExternalSafetyProvidersOperationsImpl(RaiExternalSafetyProvidersOperationsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new RaiExternalSafetyProviderSchemaImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new RaiExternalSafetyProviderSchemaImpl(inner1, this.manager())); - } - - private RaiExternalSafetyProvidersOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPoliciesClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPoliciesClientImpl.java deleted file mode 100644 index 18707212ee39..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPoliciesClientImpl.java +++ /dev/null @@ -1,653 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.RaiPoliciesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.RaiPolicyListResult; -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 RaiPoliciesClient. - */ -public final class RaiPoliciesClientImpl implements RaiPoliciesClient { - /** - * The proxy service used to perform REST calls. - */ - private final RaiPoliciesService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of RaiPoliciesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RaiPoliciesClientImpl(CognitiveServicesManagementClientImpl client) { - this.service - = RestProxy.create(RaiPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientRaiPolicies to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientRaiPolicies") - public interface RaiPoliciesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies/{raiPolicyName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiPolicyName") String raiPolicyName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies/{raiPolicyName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiPolicyName") String raiPolicyName, @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies/{raiPolicyName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiPolicyName") String raiPolicyName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") RaiPolicyInner raiPolicy, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies/{raiPolicyName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiPolicyName") String raiPolicyName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") RaiPolicyInner raiPolicy, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies/{raiPolicyName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiPolicyName") String raiPolicyName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies/{raiPolicyName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiPolicyName") String raiPolicyName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Content Filters associated with the Azure OpenAI account along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String accountName, - String raiPolicyName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiPolicyName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Content Filters associated with the Azure OpenAI account on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, String raiPolicyName) { - return getWithResponseAsync(resourceGroupName, accountName, raiPolicyName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services 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 specified Content Filters associated with the Azure OpenAI account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, String raiPolicyName, - Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, raiPolicyName, accept, context); - } - - /** - * Gets the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Content Filters associated with the Azure OpenAI account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RaiPolicyInner get(String resourceGroupName, String accountName, String raiPolicyName) { - return getWithResponse(resourceGroupName, accountName, raiPolicyName, Context.NONE).getValue(); - } - - /** - * Update the state of specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @param raiPolicy Properties describing the Content Filters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiPolicy along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String accountName, - String raiPolicyName, RaiPolicyInner raiPolicy) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiPolicyName, contentType, accept, - raiPolicy, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the state of specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @param raiPolicy Properties describing the Content Filters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiPolicy on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, String raiPolicyName, - RaiPolicyInner raiPolicy) { - return createOrUpdateWithResponseAsync(resourceGroupName, accountName, raiPolicyName, raiPolicy) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Update the state of specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @param raiPolicy Properties describing the Content Filters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiPolicy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String raiPolicyName, RaiPolicyInner raiPolicy, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiPolicyName, contentType, accept, - raiPolicy, context); - } - - /** - * Update the state of specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @param raiPolicy Properties describing the Content Filters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiPolicy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RaiPolicyInner createOrUpdate(String resourceGroupName, String accountName, String raiPolicyName, - RaiPolicyInner raiPolicy) { - return createOrUpdateWithResponse(resourceGroupName, accountName, raiPolicyName, raiPolicy, Context.NONE) - .getValue(); - } - - /** - * Deletes the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiPolicyName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiPolicyName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiPolicyName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiPolicyName, Context.NONE); - } - - /** - * Deletes the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String accountName, String raiPolicyName, - Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiPolicyName, context); - } - - /** - * Deletes the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiPolicyName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName, raiPolicyName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiPolicyName) { - Response response = deleteWithResponse(resourceGroupName, accountName, raiPolicyName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Deletes the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String raiPolicyName, Context context) { - Response response = deleteWithResponse(resourceGroupName, accountName, raiPolicyName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Deletes the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String raiPolicyName) { - return beginDeleteAsync(resourceGroupName, accountName, raiPolicyName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String raiPolicyName) { - beginDelete(resourceGroupName, accountName, raiPolicyName).getFinalResult(); - } - - /** - * Deletes the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String raiPolicyName, Context context) { - beginDelete(resourceGroupName, accountName, raiPolicyName, context).getFinalResult(); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, 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 content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 content filters associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, 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 the content filters associated with the Azure OpenAI account along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPoliciesImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPoliciesImpl.java deleted file mode 100644 index 4dc60d07cbe5..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPoliciesImpl.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.RaiPoliciesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicies; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicy; - -public final class RaiPoliciesImpl implements RaiPolicies { - private static final ClientLogger LOGGER = new ClientLogger(RaiPoliciesImpl.class); - - private final RaiPoliciesClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public RaiPoliciesImpl(RaiPoliciesClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, String raiPolicyName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, accountName, raiPolicyName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RaiPolicyImpl(inner.getValue(), this.manager())); - } - - public RaiPolicy get(String resourceGroupName, String accountName, String raiPolicyName) { - RaiPolicyInner inner = this.serviceClient().get(resourceGroupName, accountName, raiPolicyName); - if (inner != null) { - return new RaiPolicyImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String accountName, String raiPolicyName) { - this.serviceClient().delete(resourceGroupName, accountName, raiPolicyName); - } - - public void delete(String resourceGroupName, String accountName, String raiPolicyName, Context context) { - this.serviceClient().delete(resourceGroupName, accountName, raiPolicyName, context); - } - - public PagedIterable list(String resourceGroupName, String accountName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiPolicyImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiPolicyImpl(inner1, this.manager())); - } - - public RaiPolicy 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String raiPolicyName = ResourceManagerUtils.getValueFromIdByName(id, "raiPolicies"); - if (raiPolicyName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raiPolicies'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, raiPolicyName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String raiPolicyName = ResourceManagerUtils.getValueFromIdByName(id, "raiPolicies"); - if (raiPolicyName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raiPolicies'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, raiPolicyName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String raiPolicyName = ResourceManagerUtils.getValueFromIdByName(id, "raiPolicies"); - if (raiPolicyName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raiPolicies'.", id))); - } - this.delete(resourceGroupName, accountName, raiPolicyName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String raiPolicyName = ResourceManagerUtils.getValueFromIdByName(id, "raiPolicies"); - if (raiPolicyName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raiPolicies'.", id))); - } - this.delete(resourceGroupName, accountName, raiPolicyName, context); - } - - private RaiPoliciesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public RaiPolicyImpl define(String name) { - return new RaiPolicyImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPolicyImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPolicyImpl.java deleted file mode 100644 index c25bc5dc0472..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPolicyImpl.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicy; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyProperties; -import java.util.Collections; -import java.util.Map; - -public final class RaiPolicyImpl implements RaiPolicy, RaiPolicy.Definition, RaiPolicy.Update { - private RaiPolicyInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public RaiPolicyProperties properties() { - return this.innerModel().properties(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public RaiPolicyInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - private String raiPolicyName; - - public RaiPolicyImpl withExistingAccount(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - public RaiPolicy create() { - this.innerObject = serviceManager.serviceClient() - .getRaiPolicies() - .createOrUpdateWithResponse(resourceGroupName, accountName, raiPolicyName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public RaiPolicy create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getRaiPolicies() - .createOrUpdateWithResponse(resourceGroupName, accountName, raiPolicyName, this.innerModel(), context) - .getValue(); - return this; - } - - RaiPolicyImpl(String name, com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new RaiPolicyInner(); - this.serviceManager = serviceManager; - this.raiPolicyName = name; - } - - public RaiPolicyImpl update() { - return this; - } - - public RaiPolicy apply() { - this.innerObject = serviceManager.serviceClient() - .getRaiPolicies() - .createOrUpdateWithResponse(resourceGroupName, accountName, raiPolicyName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public RaiPolicy apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getRaiPolicies() - .createOrUpdateWithResponse(resourceGroupName, accountName, raiPolicyName, this.innerModel(), context) - .getValue(); - return this; - } - - RaiPolicyImpl(RaiPolicyInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.raiPolicyName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "raiPolicies"); - } - - public RaiPolicy refresh() { - this.innerObject = serviceManager.serviceClient() - .getRaiPolicies() - .getWithResponse(resourceGroupName, accountName, raiPolicyName, Context.NONE) - .getValue(); - return this; - } - - public RaiPolicy refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getRaiPolicies() - .getWithResponse(resourceGroupName, accountName, raiPolicyName, context) - .getValue(); - return this; - } - - public RaiPolicyImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public RaiPolicyImpl withProperties(RaiPolicyProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelImpl.java deleted file mode 100644 index 6dd847083356..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelImpl.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiToolLabelInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabel; -import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelProperties; -import java.util.Collections; -import java.util.Map; - -public final class RaiToolLabelImpl implements RaiToolLabel, RaiToolLabel.Definition, RaiToolLabel.Update { - private RaiToolLabelInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public RaiToolLabelProperties properties() { - return this.innerModel().properties(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public RaiToolLabelInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - private String raiToolConnectionName; - - public RaiToolLabelImpl withExistingAccount(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - public RaiToolLabel create() { - this.innerObject = serviceManager.serviceClient() - .getRaiToolLabels() - .createOrUpdateWithResponse(resourceGroupName, accountName, raiToolConnectionName, this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public RaiToolLabel create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getRaiToolLabels() - .createOrUpdateWithResponse(resourceGroupName, accountName, raiToolConnectionName, this.innerModel(), - context) - .getValue(); - return this; - } - - RaiToolLabelImpl(String name, com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new RaiToolLabelInner(); - this.serviceManager = serviceManager; - this.raiToolConnectionName = name; - } - - public RaiToolLabelImpl update() { - return this; - } - - public RaiToolLabel apply() { - this.innerObject = serviceManager.serviceClient() - .getRaiToolLabels() - .createOrUpdateWithResponse(resourceGroupName, accountName, raiToolConnectionName, this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public RaiToolLabel apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getRaiToolLabels() - .createOrUpdateWithResponse(resourceGroupName, accountName, raiToolConnectionName, this.innerModel(), - context) - .getValue(); - return this; - } - - RaiToolLabelImpl(RaiToolLabelInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.raiToolConnectionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "raiToolLabels"); - } - - public RaiToolLabel refresh() { - this.innerObject = serviceManager.serviceClient() - .getRaiToolLabels() - .getWithResponse(resourceGroupName, accountName, raiToolConnectionName, Context.NONE) - .getValue(); - return this; - } - - public RaiToolLabel refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getRaiToolLabels() - .getWithResponse(resourceGroupName, accountName, raiToolConnectionName, context) - .getValue(); - return this; - } - - public RaiToolLabelImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public RaiToolLabelImpl withProperties(RaiToolLabelProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelsClientImpl.java deleted file mode 100644 index 95b7fbc69d4d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelsClientImpl.java +++ /dev/null @@ -1,655 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.RaiToolLabelsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiToolLabelInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.RaiToolLabelResult; -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 RaiToolLabelsClient. - */ -public final class RaiToolLabelsClientImpl implements RaiToolLabelsClient { - /** - * The proxy service used to perform REST calls. - */ - private final RaiToolLabelsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of RaiToolLabelsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RaiToolLabelsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service - = RestProxy.create(RaiToolLabelsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientRaiToolLabels to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientRaiToolLabels") - public interface RaiToolLabelsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiToolLabels/{raiToolConnectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiToolConnectionName") String raiToolConnectionName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiToolLabels/{raiToolConnectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiToolConnectionName") String raiToolConnectionName, @HeaderParam("Accept") String accept, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiToolLabels/{raiToolConnectionName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiToolConnectionName") String raiToolConnectionName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") RaiToolLabelInner raiToolLabel, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiToolLabels/{raiToolConnectionName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiToolConnectionName") String raiToolConnectionName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") RaiToolLabelInner raiToolLabel, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiToolLabels/{raiToolConnectionName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiToolConnectionName") String raiToolConnectionName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiToolLabels/{raiToolConnectionName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiToolConnectionName") String raiToolConnectionName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiToolLabels") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiToolLabels") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 RAI Tool Label associated with the Azure OpenAI account along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String accountName, - String raiToolConnectionName) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiToolConnectionName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 RAI Tool Label associated with the Azure OpenAI account on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, - String raiToolConnectionName) { - return getWithResponseAsync(resourceGroupName, accountName, raiToolConnectionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 RAI Tool Label associated with the Azure OpenAI account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, - String raiToolConnectionName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, raiToolConnectionName, accept, context); - } - - /** - * Gets the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 RAI Tool Label associated with the Azure OpenAI account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RaiToolLabelInner get(String resourceGroupName, String accountName, String raiToolConnectionName) { - return getWithResponse(resourceGroupName, accountName, raiToolConnectionName, Context.NONE).getValue(); - } - - /** - * Creates the RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @param raiToolLabel Properties describing the RAI Tool Label. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RAI Tool Label resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String accountName, String raiToolConnectionName, RaiToolLabelInner raiToolLabel) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiToolConnectionName, contentType, - accept, raiToolLabel, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates the RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @param raiToolLabel Properties describing the RAI Tool Label. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RAI Tool Label resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, - String raiToolConnectionName, RaiToolLabelInner raiToolLabel) { - return createOrUpdateWithResponseAsync(resourceGroupName, accountName, raiToolConnectionName, raiToolLabel) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates the RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @param raiToolLabel Properties describing the RAI Tool Label. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RAI Tool Label resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String raiToolConnectionName, RaiToolLabelInner raiToolLabel, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiToolConnectionName, contentType, accept, - raiToolLabel, context); - } - - /** - * Creates the RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @param raiToolLabel Properties describing the RAI Tool Label. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RAI Tool Label resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RaiToolLabelInner createOrUpdate(String resourceGroupName, String accountName, String raiToolConnectionName, - RaiToolLabelInner raiToolLabel) { - return createOrUpdateWithResponse(resourceGroupName, accountName, raiToolConnectionName, raiToolLabel, - Context.NONE).getValue(); - } - - /** - * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiToolConnectionName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiToolConnectionName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiToolConnectionName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiToolConnectionName, Context.NONE); - } - - /** - * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiToolConnectionName, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiToolConnectionName, context); - } - - /** - * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiToolConnectionName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, accountName, raiToolConnectionName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiToolConnectionName) { - Response response = deleteWithResponse(resourceGroupName, accountName, raiToolConnectionName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiToolConnectionName, Context context) { - Response response - = deleteWithResponse(resourceGroupName, accountName, raiToolConnectionName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String raiToolConnectionName) { - return beginDeleteAsync(resourceGroupName, accountName, raiToolConnectionName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String raiToolConnectionName) { - beginDelete(resourceGroupName, accountName, raiToolConnectionName).getFinalResult(); - } - - /** - * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String raiToolConnectionName, Context context) { - beginDelete(resourceGroupName, accountName, raiToolConnectionName, context).getFinalResult(); - } - - /** - * Lists all RAI Tool Labels associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Cognitive Services RAI Tool Labels along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, 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 RAI Tool Labels associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Cognitive Services RAI Tool Labels as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all RAI Tool Labels associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Cognitive Services RAI Tool Labels along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists all RAI Tool Labels associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 list of Cognitive Services RAI Tool Labels along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists all RAI Tool Labels associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Cognitive Services RAI Tool Labels as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Lists all RAI Tool Labels associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 list of Cognitive Services RAI Tool Labels as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, 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 the list of Cognitive Services RAI Tool Labels along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Cognitive Services RAI Tool Labels along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Cognitive Services RAI Tool Labels along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelsImpl.java deleted file mode 100644 index ca64c4366790..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelsImpl.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.RaiToolLabelsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiToolLabelInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabel; -import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabels; - -public final class RaiToolLabelsImpl implements RaiToolLabels { - private static final ClientLogger LOGGER = new ClientLogger(RaiToolLabelsImpl.class); - - private final RaiToolLabelsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public RaiToolLabelsImpl(RaiToolLabelsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, - String raiToolConnectionName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, accountName, raiToolConnectionName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RaiToolLabelImpl(inner.getValue(), this.manager())); - } - - public RaiToolLabel get(String resourceGroupName, String accountName, String raiToolConnectionName) { - RaiToolLabelInner inner = this.serviceClient().get(resourceGroupName, accountName, raiToolConnectionName); - if (inner != null) { - return new RaiToolLabelImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String accountName, String raiToolConnectionName) { - this.serviceClient().delete(resourceGroupName, accountName, raiToolConnectionName); - } - - public void delete(String resourceGroupName, String accountName, String raiToolConnectionName, Context context) { - this.serviceClient().delete(resourceGroupName, accountName, raiToolConnectionName, context); - } - - public PagedIterable list(String resourceGroupName, String accountName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiToolLabelImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiToolLabelImpl(inner1, this.manager())); - } - - public RaiToolLabel 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String raiToolConnectionName = ResourceManagerUtils.getValueFromIdByName(id, "raiToolLabels"); - if (raiToolConnectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raiToolLabels'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, raiToolConnectionName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String raiToolConnectionName = ResourceManagerUtils.getValueFromIdByName(id, "raiToolLabels"); - if (raiToolConnectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raiToolLabels'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, raiToolConnectionName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String raiToolConnectionName = ResourceManagerUtils.getValueFromIdByName(id, "raiToolLabels"); - if (raiToolConnectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raiToolLabels'.", id))); - } - this.delete(resourceGroupName, accountName, raiToolConnectionName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String raiToolConnectionName = ResourceManagerUtils.getValueFromIdByName(id, "raiToolLabels"); - if (raiToolConnectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raiToolLabels'.", id))); - } - this.delete(resourceGroupName, accountName, raiToolConnectionName, context); - } - - private RaiToolLabelsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public RaiToolLabelImpl define(String name) { - return new RaiToolLabelImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicImpl.java deleted file mode 100644 index 7edc4492b49d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicImpl.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiTopicInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiTopic; -import com.azure.resourcemanager.cognitiveservices.models.RaiTopicProperties; -import java.util.Collections; -import java.util.Map; - -public final class RaiTopicImpl implements RaiTopic, RaiTopic.Definition, RaiTopic.Update { - private RaiTopicInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public RaiTopicProperties properties() { - return this.innerModel().properties(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public RaiTopicInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - private String raiTopicName; - - public RaiTopicImpl withExistingAccount(String resourceGroupName, String accountName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - return this; - } - - public RaiTopic create() { - this.innerObject = serviceManager.serviceClient() - .getRaiTopics() - .createOrUpdateWithResponse(resourceGroupName, accountName, raiTopicName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public RaiTopic create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getRaiTopics() - .createOrUpdateWithResponse(resourceGroupName, accountName, raiTopicName, this.innerModel(), context) - .getValue(); - return this; - } - - RaiTopicImpl(String name, com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new RaiTopicInner(); - this.serviceManager = serviceManager; - this.raiTopicName = name; - } - - public RaiTopicImpl update() { - return this; - } - - public RaiTopic apply() { - this.innerObject = serviceManager.serviceClient() - .getRaiTopics() - .createOrUpdateWithResponse(resourceGroupName, accountName, raiTopicName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public RaiTopic apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getRaiTopics() - .createOrUpdateWithResponse(resourceGroupName, accountName, raiTopicName, this.innerModel(), context) - .getValue(); - return this; - } - - RaiTopicImpl(RaiTopicInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.raiTopicName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "raitopics"); - } - - public RaiTopic refresh() { - this.innerObject = serviceManager.serviceClient() - .getRaiTopics() - .getWithResponse(resourceGroupName, accountName, raiTopicName, Context.NONE) - .getValue(); - return this; - } - - public RaiTopic refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getRaiTopics() - .getWithResponse(resourceGroupName, accountName, raiTopicName, context) - .getValue(); - return this; - } - - public RaiTopicImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public RaiTopicImpl withProperties(RaiTopicProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicsClientImpl.java deleted file mode 100644 index 4d6e4fb3f5fa..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicsClientImpl.java +++ /dev/null @@ -1,649 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.RaiTopicsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiTopicInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.RaiTopicResult; -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 RaiTopicsClient. - */ -public final class RaiTopicsClientImpl implements RaiTopicsClient { - /** - * The proxy service used to perform REST calls. - */ - private final RaiTopicsService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of RaiTopicsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RaiTopicsClientImpl(CognitiveServicesManagementClientImpl client) { - this.service - = RestProxy.create(RaiTopicsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientRaiTopics to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientRaiTopics") - public interface RaiTopicsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raitopics/{raiTopicName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiTopicName") String raiTopicName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raitopics/{raiTopicName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiTopicName") String raiTopicName, @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raitopics/{raiTopicName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiTopicName") String raiTopicName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") RaiTopicInner raiTopic, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raitopics/{raiTopicName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiTopicName") String raiTopicName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") RaiTopicInner raiTopic, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raitopics/{raiTopicName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiTopicName") String raiTopicName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raitopics/{raiTopicName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("raiTopicName") String raiTopicName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raitopics") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raitopics") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 custom topic associated with the Azure OpenAI account along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String accountName, - String raiTopicName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiTopicName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 custom topic associated with the Azure OpenAI account on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, String raiTopicName) { - return getWithResponseAsync(resourceGroupName, accountName, raiTopicName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services 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 specified custom topic associated with the Azure OpenAI account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, String raiTopicName, - Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, raiTopicName, accept, context); - } - - /** - * Gets the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 custom topic associated with the Azure OpenAI account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RaiTopicInner get(String resourceGroupName, String accountName, String raiTopicName) { - return getWithResponse(resourceGroupName, accountName, raiTopicName, Context.NONE).getValue(); - } - - /** - * Create the rai topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @param raiTopic Properties describing the rai topic. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services Rai Topic along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String accountName, - String raiTopicName, RaiTopicInner raiTopic) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiTopicName, contentType, accept, - raiTopic, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create the rai topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @param raiTopic Properties describing the rai topic. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services Rai Topic on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, String raiTopicName, - RaiTopicInner raiTopic) { - return createOrUpdateWithResponseAsync(resourceGroupName, accountName, raiTopicName, raiTopic) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create the rai topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @param raiTopic Properties describing the rai topic. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services Rai Topic along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String raiTopicName, RaiTopicInner raiTopic, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiTopicName, contentType, accept, - raiTopic, context); - } - - /** - * Create the rai topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @param raiTopic Properties describing the rai topic. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services Rai Topic. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RaiTopicInner createOrUpdate(String resourceGroupName, String accountName, String raiTopicName, - RaiTopicInner raiTopic) { - return createOrUpdateWithResponse(resourceGroupName, accountName, raiTopicName, raiTopic, Context.NONE) - .getValue(); - } - - /** - * Deletes the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiTopicName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiTopicName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, String raiTopicName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiTopicName, Context.NONE); - } - - /** - * Deletes the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String accountName, String raiTopicName, - Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, raiTopicName, context); - } - - /** - * Deletes the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiTopicName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName, raiTopicName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String raiTopicName) { - Response response = deleteWithResponse(resourceGroupName, accountName, raiTopicName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Deletes the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String raiTopicName, Context context) { - Response response = deleteWithResponse(resourceGroupName, accountName, raiTopicName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Deletes the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String raiTopicName) { - return beginDeleteAsync(resourceGroupName, accountName, raiTopicName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String raiTopicName) { - beginDelete(resourceGroupName, accountName, raiTopicName).getFinalResult(); - } - - /** - * Deletes the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String raiTopicName, Context context) { - beginDelete(resourceGroupName, accountName, raiTopicName, context).getFinalResult(); - } - - /** - * Gets the custom topics associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom topics associated with the Azure OpenAI account along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, 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 custom topics associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom topics associated with the Azure OpenAI account as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the custom topics associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom topics associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the custom topics associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 custom topics associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the custom topics associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom topics associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Gets the custom topics associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services 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 custom topics associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, 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 the custom topics associated with the Azure OpenAI account along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom topics associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom topics associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicsImpl.java deleted file mode 100644 index d364798a5675..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicsImpl.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.RaiTopicsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiTopicInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiTopic; -import com.azure.resourcemanager.cognitiveservices.models.RaiTopics; - -public final class RaiTopicsImpl implements RaiTopics { - private static final ClientLogger LOGGER = new ClientLogger(RaiTopicsImpl.class); - - private final RaiTopicsClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public RaiTopicsImpl(RaiTopicsClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, String raiTopicName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, accountName, raiTopicName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RaiTopicImpl(inner.getValue(), this.manager())); - } - - public RaiTopic get(String resourceGroupName, String accountName, String raiTopicName) { - RaiTopicInner inner = this.serviceClient().get(resourceGroupName, accountName, raiTopicName); - if (inner != null) { - return new RaiTopicImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String accountName, String raiTopicName) { - this.serviceClient().delete(resourceGroupName, accountName, raiTopicName); - } - - public void delete(String resourceGroupName, String accountName, String raiTopicName, Context context) { - this.serviceClient().delete(resourceGroupName, accountName, raiTopicName, context); - } - - public PagedIterable list(String resourceGroupName, String accountName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiTopicImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiTopicImpl(inner1, this.manager())); - } - - public RaiTopic 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String raiTopicName = ResourceManagerUtils.getValueFromIdByName(id, "raitopics"); - if (raiTopicName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raitopics'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, raiTopicName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String raiTopicName = ResourceManagerUtils.getValueFromIdByName(id, "raitopics"); - if (raiTopicName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raitopics'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, raiTopicName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String raiTopicName = ResourceManagerUtils.getValueFromIdByName(id, "raitopics"); - if (raiTopicName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raitopics'.", id))); - } - this.delete(resourceGroupName, accountName, raiTopicName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String raiTopicName = ResourceManagerUtils.getValueFromIdByName(id, "raitopics"); - if (raiTopicName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'raitopics'.", id))); - } - this.delete(resourceGroupName, accountName, raiTopicName, context); - } - - private RaiTopicsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public RaiTopicImpl define(String name) { - return new RaiTopicImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceManagerUtils.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceManagerUtils.java deleted file mode 100644 index 0cb33dfe025e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceManagerUtils.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -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.util.CoreUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import reactor.core.publisher.Flux; - -final class ResourceManagerUtils { - private ResourceManagerUtils() { - } - - static String getValueFromIdByName(String id, String name) { - if (id == null) { - return null; - } - Iterator itr = Arrays.stream(id.split("/")).iterator(); - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && !part.trim().isEmpty()) { - if (part.equalsIgnoreCase(name)) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } - } - } - } - return null; - } - - static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { - if (id == null || pathTemplate == null) { - return null; - } - String parameterNameParentheses = "{" + parameterName + "}"; - List idSegmentsReverted = Arrays.asList(id.split("/")); - List pathSegments = Arrays.asList(pathTemplate.split("/")); - Collections.reverse(idSegmentsReverted); - Iterator idItrReverted = idSegmentsReverted.iterator(); - int pathIndex = pathSegments.size(); - while (idItrReverted.hasNext() && pathIndex > 0) { - String idSegment = idItrReverted.next(); - String pathSegment = pathSegments.get(--pathIndex); - if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { - if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { - if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { - List segments = new ArrayList<>(); - segments.add(idSegment); - idItrReverted.forEachRemaining(segments::add); - Collections.reverse(segments); - if (!segments.isEmpty() && segments.get(0).isEmpty()) { - segments.remove(0); - } - return String.join("/", segments); - } else { - return idSegment; - } - } - } - } - return null; - } - - static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl<>(pageIterable, mapper); - } - - private static final class PagedIterableImpl extends PagedIterable { - - private final PagedIterable pagedIterable; - private final Function mapper; - private final Function, PagedResponse> pageMapper; - - private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux - .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); - this.pagedIterable = pagedIterable; - this.mapper = mapper; - this.pageMapper = getPageMapper(mapper); - } - - private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), - null); - } - - @Override - public Stream stream() { - return pagedIterable.stream().map(mapper); - } - - @Override - public Stream> streamByPage() { - return pagedIterable.streamByPage().map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken) { - return pagedIterable.streamByPage(continuationToken).map(pageMapper); - } - - @Override - public Stream> streamByPage(int preferredPageSize) { - return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken, int preferredPageSize) { - return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); - } - - @Override - public Iterator iterator() { - return new IteratorImpl<>(pagedIterable.iterator(), mapper); - } - - @Override - public Iterable> iterableByPage() { - return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); - } - - @Override - public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); - } - } - - private static final class IteratorImpl implements Iterator { - - private final Iterator iterator; - private final Function mapper; - - private IteratorImpl(Iterator iterator, Function mapper) { - this.iterator = iterator; - this.mapper = mapper; - } - - @Override - public boolean hasNext() { - return iterator.hasNext(); - } - - @Override - public S next() { - return mapper.apply(iterator.next()); - } - - @Override - public void remove() { - iterator.remove(); - } - } - - private static final class IterableImpl implements Iterable { - - private final Iterable iterable; - private final Function mapper; - - private IterableImpl(Iterable iterable, Function mapper) { - this.iterable = iterable; - this.mapper = mapper; - } - - @Override - public Iterator iterator() { - return new IteratorImpl<>(iterable.iterator(), mapper); - } - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersClientImpl.java deleted file mode 100644 index 9f2b60d0aabe..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersClientImpl.java +++ /dev/null @@ -1,324 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.cognitiveservices.fluent.ResourceProvidersClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CalculateModelCapacityResultInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.DomainAvailabilityInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.SkuAvailabilityListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.CalculateModelCapacityParameter; -import com.azure.resourcemanager.cognitiveservices.models.CheckDomainAvailabilityParameter; -import com.azure.resourcemanager.cognitiveservices.models.CheckSkuAvailabilityParameter; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ResourceProvidersClient. - */ -public final class ResourceProvidersClientImpl implements ResourceProvidersClient { - /** - * The proxy service used to perform REST calls. - */ - private final ResourceProvidersService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of ResourceProvidersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ResourceProvidersClientImpl(CognitiveServicesManagementClientImpl client) { - this.service - = RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientResourceProviders to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientResourceProviders") - public interface ResourceProvidersService { - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkSkuAvailability(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") CheckSkuAvailabilityParameter parameters, Context context); - - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response checkSkuAvailabilitySync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") CheckSkuAvailabilityParameter parameters, Context context); - - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/checkDomainAvailability") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkDomainAvailability(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") CheckDomainAvailabilityParameter parameters, Context context); - - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/checkDomainAvailability") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response checkDomainAvailabilitySync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") CheckDomainAvailabilityParameter parameters, Context context); - - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/calculateModelCapacity") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> calculateModelCapacity(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") CalculateModelCapacityParameter parameters, Context context); - - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/calculateModelCapacity") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response calculateModelCapacitySync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") CalculateModelCapacityParameter parameters, Context context); - } - - /** - * Check available SKUs. - * - * @param location The location name. - * @param parameters The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return check SKU availability result list along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkSkuAvailabilityWithResponseAsync(String location, - CheckSkuAvailabilityParameter parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.checkSkuAvailability(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, contentType, accept, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Check available SKUs. - * - * @param location The location name. - * @param parameters The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return check SKU availability result list on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono checkSkuAvailabilityAsync(String location, - CheckSkuAvailabilityParameter parameters) { - return checkSkuAvailabilityWithResponseAsync(location, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Check available SKUs. - * - * @param location The location name. - * @param parameters The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return check SKU availability result list along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkSkuAvailabilityWithResponse(String location, - CheckSkuAvailabilityParameter parameters, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.checkSkuAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, contentType, accept, parameters, context); - } - - /** - * Check available SKUs. - * - * @param location The location name. - * @param parameters The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return check SKU availability result list. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SkuAvailabilityListResultInner checkSkuAvailability(String location, - CheckSkuAvailabilityParameter parameters) { - return checkSkuAvailabilityWithResponse(location, parameters, Context.NONE).getValue(); - } - - /** - * Check whether a domain is available. - * - * @param parameters The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain availability along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - checkDomainAvailabilityWithResponseAsync(CheckDomainAvailabilityParameter parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.checkDomainAvailability(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), contentType, accept, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Check whether a domain is available. - * - * @param parameters The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain availability on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono checkDomainAvailabilityAsync(CheckDomainAvailabilityParameter parameters) { - return checkDomainAvailabilityWithResponseAsync(parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Check whether a domain is available. - * - * @param parameters The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain availability along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response - checkDomainAvailabilityWithResponse(CheckDomainAvailabilityParameter parameters, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.checkDomainAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), contentType, accept, parameters, context); - } - - /** - * Check whether a domain is available. - * - * @param parameters The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain availability. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DomainAvailabilityInner checkDomainAvailability(CheckDomainAvailabilityParameter parameters) { - return checkDomainAvailabilityWithResponse(parameters, Context.NONE).getValue(); - } - - /** - * Model capacity calculator. - * - * @param parameters The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return calculate Model Capacity result along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - calculateModelCapacityWithResponseAsync(CalculateModelCapacityParameter parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.calculateModelCapacity(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), contentType, accept, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Model capacity calculator. - * - * @param parameters The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return calculate Model Capacity result on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono - calculateModelCapacityAsync(CalculateModelCapacityParameter parameters) { - return calculateModelCapacityWithResponseAsync(parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Model capacity calculator. - * - * @param parameters The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return calculate Model Capacity result along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response - calculateModelCapacityWithResponse(CalculateModelCapacityParameter parameters, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.calculateModelCapacitySync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), contentType, accept, parameters, context); - } - - /** - * Model capacity calculator. - * - * @param parameters The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return calculate Model Capacity result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CalculateModelCapacityResultInner calculateModelCapacity(CalculateModelCapacityParameter parameters) { - return calculateModelCapacityWithResponse(parameters, Context.NONE).getValue(); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersImpl.java deleted file mode 100644 index d065c2050af4..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.ResourceProvidersClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CalculateModelCapacityResultInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.DomainAvailabilityInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.SkuAvailabilityListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.CalculateModelCapacityParameter; -import com.azure.resourcemanager.cognitiveservices.models.CalculateModelCapacityResult; -import com.azure.resourcemanager.cognitiveservices.models.CheckDomainAvailabilityParameter; -import com.azure.resourcemanager.cognitiveservices.models.CheckSkuAvailabilityParameter; -import com.azure.resourcemanager.cognitiveservices.models.DomainAvailability; -import com.azure.resourcemanager.cognitiveservices.models.ResourceProviders; -import com.azure.resourcemanager.cognitiveservices.models.SkuAvailabilityListResult; - -public final class ResourceProvidersImpl implements ResourceProviders { - private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); - - private final ResourceProvidersClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public ResourceProvidersImpl(ResourceProvidersClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response checkSkuAvailabilityWithResponse(String location, - CheckSkuAvailabilityParameter parameters, Context context) { - Response inner - = this.serviceClient().checkSkuAvailabilityWithResponse(location, parameters, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SkuAvailabilityListResultImpl(inner.getValue(), this.manager())); - } - - public SkuAvailabilityListResult checkSkuAvailability(String location, CheckSkuAvailabilityParameter parameters) { - SkuAvailabilityListResultInner inner = this.serviceClient().checkSkuAvailability(location, parameters); - if (inner != null) { - return new SkuAvailabilityListResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response checkDomainAvailabilityWithResponse(CheckDomainAvailabilityParameter parameters, - Context context) { - Response inner - = this.serviceClient().checkDomainAvailabilityWithResponse(parameters, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DomainAvailabilityImpl(inner.getValue(), this.manager())); - } - - public DomainAvailability checkDomainAvailability(CheckDomainAvailabilityParameter parameters) { - DomainAvailabilityInner inner = this.serviceClient().checkDomainAvailability(parameters); - if (inner != null) { - return new DomainAvailabilityImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response - calculateModelCapacityWithResponse(CalculateModelCapacityParameter parameters, Context context) { - Response inner - = this.serviceClient().calculateModelCapacityWithResponse(parameters, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CalculateModelCapacityResultImpl(inner.getValue(), this.manager())); - } - - public CalculateModelCapacityResult calculateModelCapacity(CalculateModelCapacityParameter parameters) { - CalculateModelCapacityResultInner inner = this.serviceClient().calculateModelCapacity(parameters); - if (inner != null) { - return new CalculateModelCapacityResultImpl(inner, this.manager()); - } else { - return null; - } - } - - private ResourceProvidersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkuImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkuImpl.java deleted file mode 100644 index bb46ee9da354..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkuImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.ResourceSkuInner; -import com.azure.resourcemanager.cognitiveservices.models.ResourceSku; -import com.azure.resourcemanager.cognitiveservices.models.ResourceSkuRestrictions; -import java.util.Collections; -import java.util.List; - -public final class ResourceSkuImpl implements ResourceSku { - private ResourceSkuInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - ResourceSkuImpl(ResourceSkuInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String resourceType() { - return this.innerModel().resourceType(); - } - - public String name() { - return this.innerModel().name(); - } - - public String tier() { - return this.innerModel().tier(); - } - - public String kind() { - return this.innerModel().kind(); - } - - public List locations() { - List inner = this.innerModel().locations(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List restrictions() { - List inner = this.innerModel().restrictions(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public ResourceSkuInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkusClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkusClientImpl.java deleted file mode 100644 index daacb385389d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkusClientImpl.java +++ /dev/null @@ -1,249 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.ResourceSkusClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ResourceSkuInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.ResourceSkuListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ResourceSkusClient. - */ -public final class ResourceSkusClientImpl implements ResourceSkusClient { - /** - * The proxy service used to perform REST calls. - */ - private final ResourceSkusService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of ResourceSkusClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ResourceSkusClientImpl(CognitiveServicesManagementClientImpl client) { - this.service - = RestProxy.create(ResourceSkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientResourceSkus to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientResourceSkus") - public interface ResourceSkusService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/skus") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/skus") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - 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("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the list of Microsoft.CognitiveServices SKUs available for your Subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Microsoft.CognitiveServices SKUs available for your Subscription along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - final String accept = "application/json"; - return FluxUtil - .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())); - } - - /** - * Gets the list of Microsoft.CognitiveServices SKUs available for your Subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Microsoft.CognitiveServices SKUs available for your Subscription as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the list of Microsoft.CognitiveServices SKUs available for your Subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Microsoft.CognitiveServices SKUs available for your Subscription along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage() { - 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); - } - - /** - * Gets the list of Microsoft.CognitiveServices SKUs available for your 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 list of Microsoft.CognitiveServices SKUs available for your Subscription along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(Context context) { - 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); - } - - /** - * Gets the list of Microsoft.CognitiveServices SKUs available for your Subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Microsoft.CognitiveServices SKUs available for your Subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Gets the list of Microsoft.CognitiveServices SKUs available for your 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 list of Microsoft.CognitiveServices SKUs available for your Subscription 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 the list of Microsoft.CognitiveServices SKUs available for your Subscription along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Microsoft.CognitiveServices SKUs available for your Subscription along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Microsoft.CognitiveServices SKUs available for your Subscription along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkusImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkusImpl.java deleted file mode 100644 index 74758bcb90e6..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkusImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.ResourceSkusClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ResourceSkuInner; -import com.azure.resourcemanager.cognitiveservices.models.ResourceSku; -import com.azure.resourcemanager.cognitiveservices.models.ResourceSkus; - -public final class ResourceSkusImpl implements ResourceSkus { - private static final ClientLogger LOGGER = new ClientLogger(ResourceSkusImpl.class); - - private final ResourceSkusClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public ResourceSkusImpl(ResourceSkusClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceSkuImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceSkuImpl(inner1, this.manager())); - } - - private ResourceSkusClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SkuAvailabilityListResultImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SkuAvailabilityListResultImpl.java deleted file mode 100644 index 0514e9c825b3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SkuAvailabilityListResultImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.SkuAvailabilityListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.SkuAvailability; -import com.azure.resourcemanager.cognitiveservices.models.SkuAvailabilityListResult; -import java.util.Collections; -import java.util.List; - -public final class SkuAvailabilityListResultImpl implements SkuAvailabilityListResult { - private SkuAvailabilityListResultInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - SkuAvailabilityListResultImpl(SkuAvailabilityListResultInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager 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 SkuAvailabilityListResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SkuResourceImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SkuResourceImpl.java deleted file mode 100644 index 0ed50f6d0b94..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SkuResourceImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.SkuResourceInner; -import com.azure.resourcemanager.cognitiveservices.models.CapacityConfig; -import com.azure.resourcemanager.cognitiveservices.models.Sku; -import com.azure.resourcemanager.cognitiveservices.models.SkuResource; - -public final class SkuResourceImpl implements SkuResource { - private SkuResourceInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - SkuResourceImpl(SkuResourceInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String resourceType() { - return this.innerModel().resourceType(); - } - - public Sku sku() { - return this.innerModel().sku(); - } - - public CapacityConfig capacity() { - return this.innerModel().capacity(); - } - - public SkuResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SubscriptionRaiPoliciesClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SubscriptionRaiPoliciesClientImpl.java deleted file mode 100644 index 5f4f8f46f350..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SubscriptionRaiPoliciesClientImpl.java +++ /dev/null @@ -1,391 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.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.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.SubscriptionRaiPoliciesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner; -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 SubscriptionRaiPoliciesClient. - */ -public final class SubscriptionRaiPoliciesClientImpl implements SubscriptionRaiPoliciesClient { - /** - * The proxy service used to perform REST calls. - */ - private final SubscriptionRaiPoliciesService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of SubscriptionRaiPoliciesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SubscriptionRaiPoliciesClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(SubscriptionRaiPoliciesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientSubscriptionRaiPolicies to be used - * by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientSubscriptionRaiPolicies") - public interface SubscriptionRaiPoliciesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiPolicy/{raiPolicyName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiPolicyName") String raiPolicyName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiPolicy/{raiPolicyName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiPolicyName") String raiPolicyName, @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiPolicy/{raiPolicyName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiPolicyName") String raiPolicyName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") RaiPolicyInner raiPolicy, - Context context); - - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiPolicy/{raiPolicyName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiPolicyName") String raiPolicyName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") RaiPolicyInner raiPolicy, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiPolicy/{raiPolicyName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiPolicyName") String raiPolicyName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiPolicy/{raiPolicyName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiPolicyName") String raiPolicyName, Context context); - } - - /** - * Gets the specified Content Filters associated with the Subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Content Filters associated with the Subscription along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String raiPolicyName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), raiPolicyName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified Content Filters associated with the Subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Content Filters associated with the Subscription on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String raiPolicyName) { - return getWithResponseAsync(raiPolicyName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the specified Content Filters associated with the Subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services 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 specified Content Filters associated with the Subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String raiPolicyName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - raiPolicyName, accept, context); - } - - /** - * Gets the specified Content Filters associated with the Subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 Content Filters associated with the Subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RaiPolicyInner get(String raiPolicyName) { - return getWithResponse(raiPolicyName, Context.NONE).getValue(); - } - - /** - * Update the state of specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @param raiPolicy Properties describing the Content Filters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiPolicy along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String raiPolicyName, - RaiPolicyInner raiPolicy) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), raiPolicyName, contentType, accept, raiPolicy, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the state of specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @param raiPolicy Properties describing the Content Filters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiPolicy on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String raiPolicyName, RaiPolicyInner raiPolicy) { - return createOrUpdateWithResponseAsync(raiPolicyName, raiPolicy) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Update the state of specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @param raiPolicy Properties describing the Content Filters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiPolicy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String raiPolicyName, RaiPolicyInner raiPolicy, - Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), raiPolicyName, contentType, accept, raiPolicy, context); - } - - /** - * Update the state of specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @param raiPolicy Properties describing the Content Filters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiPolicy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RaiPolicyInner createOrUpdate(String raiPolicyName, RaiPolicyInner raiPolicy) { - return createOrUpdateWithResponse(raiPolicyName, raiPolicy, Context.NONE).getValue(); - } - - /** - * Deletes the specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 raiPolicyName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), raiPolicyName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 raiPolicyName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), raiPolicyName, Context.NONE); - } - - /** - * Deletes the specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String raiPolicyName, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), raiPolicyName, context); - } - - /** - * Deletes the specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 raiPolicyName) { - Mono>> mono = deleteWithResponseAsync(raiPolicyName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes the specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 raiPolicyName) { - Response response = deleteWithResponse(raiPolicyName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Deletes the specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String raiPolicyName, Context context) { - Response response = deleteWithResponse(raiPolicyName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Deletes the specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 raiPolicyName) { - return beginDeleteAsync(raiPolicyName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 raiPolicyName) { - beginDelete(raiPolicyName).getFinalResult(); - } - - /** - * Deletes the specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String raiPolicyName, Context context) { - beginDelete(raiPolicyName, context).getFinalResult(); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SubscriptionRaiPoliciesImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SubscriptionRaiPoliciesImpl.java deleted file mode 100644 index 22d3047be865..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SubscriptionRaiPoliciesImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.SubscriptionRaiPoliciesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicy; -import com.azure.resourcemanager.cognitiveservices.models.SubscriptionRaiPolicies; - -public final class SubscriptionRaiPoliciesImpl implements SubscriptionRaiPolicies { - private static final ClientLogger LOGGER = new ClientLogger(SubscriptionRaiPoliciesImpl.class); - - private final SubscriptionRaiPoliciesClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public SubscriptionRaiPoliciesImpl(SubscriptionRaiPoliciesClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String raiPolicyName, Context context) { - Response inner = this.serviceClient().getWithResponse(raiPolicyName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RaiPolicyImpl(inner.getValue(), this.manager())); - } - - public RaiPolicy get(String raiPolicyName) { - RaiPolicyInner inner = this.serviceClient().get(raiPolicyName); - if (inner != null) { - return new RaiPolicyImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse(String raiPolicyName, RaiPolicyInner raiPolicy, - Context context) { - Response inner - = this.serviceClient().createOrUpdateWithResponse(raiPolicyName, raiPolicy, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RaiPolicyImpl(inner.getValue(), this.manager())); - } - - public RaiPolicy createOrUpdate(String raiPolicyName, RaiPolicyInner raiPolicy) { - RaiPolicyInner inner = this.serviceClient().createOrUpdate(raiPolicyName, raiPolicy); - if (inner != null) { - return new RaiPolicyImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String raiPolicyName) { - this.serviceClient().delete(raiPolicyName); - } - - public void delete(String raiPolicyName, Context context) { - this.serviceClient().delete(raiPolicyName, context); - } - - private SubscriptionRaiPoliciesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/TestRaiExternalSafetyProvidersClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/TestRaiExternalSafetyProvidersClientImpl.java deleted file mode 100644 index 817d3551fadf..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/TestRaiExternalSafetyProvidersClientImpl.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.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.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.cognitiveservices.fluent.TestRaiExternalSafetyProvidersClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in TestRaiExternalSafetyProvidersClient. - */ -public final class TestRaiExternalSafetyProvidersClientImpl implements TestRaiExternalSafetyProvidersClient { - /** - * The proxy service used to perform REST calls. - */ - private final TestRaiExternalSafetyProvidersService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of TestRaiExternalSafetyProvidersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - TestRaiExternalSafetyProvidersClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(TestRaiExternalSafetyProvidersService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientTestRaiExternalSafetyProviders to be - * used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientTestRaiExternalSafetyProviders") - public interface TestRaiExternalSafetyProvidersService { - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/testRaiExternalSafetyProvider/{safetyProviderName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("safetyProviderName") String safetyProviderName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") RaiExternalSafetyProviderSchemaInner safetyProvider, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/testRaiExternalSafetyProvider/{safetyProviderName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("safetyProviderName") String safetyProviderName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") RaiExternalSafetyProviderSchemaInner safetyProvider, Context context); - } - - /** - * Test the rai safety provider associated with the subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @param safetyProvider Properties describing the rai external safety provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services Rai External Safety provider Schema along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String accountName, String safetyProviderName, - RaiExternalSafetyProviderSchemaInner safetyProvider) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, safetyProviderName, contentType, - accept, safetyProvider, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Test the rai safety provider associated with the subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @param safetyProvider Properties describing the rai external safety provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services Rai External Safety provider Schema on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, - String safetyProviderName, RaiExternalSafetyProviderSchemaInner safetyProvider) { - return createOrUpdateWithResponseAsync(resourceGroupName, accountName, safetyProviderName, safetyProvider) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Test the rai safety provider associated with the subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @param safetyProvider Properties describing the rai external safety provider. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services Rai External Safety provider Schema along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, - String accountName, String safetyProviderName, RaiExternalSafetyProviderSchemaInner safetyProvider, - Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, safetyProviderName, contentType, accept, - safetyProvider, context); - } - - /** - * Test the rai safety provider associated with the subscription. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @param safetyProvider Properties describing the rai external safety provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services Rai External Safety provider Schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RaiExternalSafetyProviderSchemaInner createOrUpdate(String resourceGroupName, String accountName, - String safetyProviderName, RaiExternalSafetyProviderSchemaInner safetyProvider) { - return createOrUpdateWithResponse(resourceGroupName, accountName, safetyProviderName, safetyProvider, - Context.NONE).getValue(); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/TestRaiExternalSafetyProvidersImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/TestRaiExternalSafetyProvidersImpl.java deleted file mode 100644 index ea551e3cf9f1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/TestRaiExternalSafetyProvidersImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.cognitiveservices.fluent.TestRaiExternalSafetyProvidersClient; -import com.azure.resourcemanager.cognitiveservices.models.TestRaiExternalSafetyProviders; - -public final class TestRaiExternalSafetyProvidersImpl implements TestRaiExternalSafetyProviders { - private static final ClientLogger LOGGER = new ClientLogger(TestRaiExternalSafetyProvidersImpl.class); - - private final TestRaiExternalSafetyProvidersClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public TestRaiExternalSafetyProvidersImpl(TestRaiExternalSafetyProvidersClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - private TestRaiExternalSafetyProvidersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public RaiExternalSafetyProviderSchemaImpl define(String name) { - return new RaiExternalSafetyProviderSchemaImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageImpl.java deleted file mode 100644 index 02b9771cb138..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner; -import com.azure.resourcemanager.cognitiveservices.models.MetricName; -import com.azure.resourcemanager.cognitiveservices.models.QuotaScopeType; -import com.azure.resourcemanager.cognitiveservices.models.QuotaUsageStatus; -import com.azure.resourcemanager.cognitiveservices.models.UnitType; -import com.azure.resourcemanager.cognitiveservices.models.Usage; - -public final class UsageImpl implements Usage { - private UsageInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - UsageImpl(UsageInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public UnitType unit() { - return this.innerModel().unit(); - } - - public MetricName name() { - return this.innerModel().name(); - } - - public String quotaPeriod() { - return this.innerModel().quotaPeriod(); - } - - public Double limit() { - return this.innerModel().limit(); - } - - public Double currentValue() { - return this.innerModel().currentValue(); - } - - public String nextResetTime() { - return this.innerModel().nextResetTime(); - } - - public QuotaUsageStatus status() { - return this.innerModel().status(); - } - - public QuotaScopeType scopeType() { - return this.innerModel().scopeType(); - } - - public String scopeId() { - return this.innerModel().scopeId(); - } - - public UsageInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageListResultImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageListResultImpl.java deleted file mode 100644 index 9a654d9cbb77..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageListResultImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.Usage; -import com.azure.resourcemanager.cognitiveservices.models.UsageListResult; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class UsageListResultImpl implements UsageListResult { - private UsageListResultInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - UsageListResultImpl(UsageListResultInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String nextLink() { - return this.innerModel().nextLink(); - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList( - inner.stream().map(inner1 -> new UsageImpl(inner1, this.manager())).collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public UsageListResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesClientImpl.java deleted file mode 100644 index e7ea4716e18d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesClientImpl.java +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.UsagesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageListResultInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in UsagesClient. - */ -public final class UsagesClientImpl implements UsagesClient { - /** - * The proxy service used to perform REST calls. - */ - private final UsagesService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of UsagesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - UsagesClientImpl(CognitiveServicesManagementClientImpl client) { - this.service = RestProxy.create(UsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientUsages to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientUsages") - public interface UsagesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/usages") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/usages") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get usages for the requested subscription. - * - * @param location The location name. - * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is - * name.value (name of the metric, can have an or of multiple names). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usages for the requested subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location, String filter) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, 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())); - } - - /** - * Get usages for the requested subscription. - * - * @param location The location name. - * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is - * name.value (name of the metric, can have an or of multiple names). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usages for the requested subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location, String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(location, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get usages for the requested subscription. - * - * @param location The location 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 usages for the requested subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location) { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(location, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get usages for the requested subscription. - * - * @param location The location name. - * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is - * name.value (name of the metric, can have an or of multiple names). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usages for the requested subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String location, String filter) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, filter, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get usages for the requested subscription. - * - * @param location The location name. - * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is - * name.value (name of the metric, can have an or of multiple names). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usages for the requested subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String location, String filter, Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, filter, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get usages for the requested subscription. - * - * @param location The location 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 usages for the requested subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location) { - final String filter = null; - return new PagedIterable<>(() -> listSinglePage(location, filter), nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Get usages for the requested subscription. - * - * @param location The location name. - * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is - * name.value (name of the metric, can have an or of multiple names). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usages for the requested subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location, String filter, Context context) { - return new PagedIterable<>(() -> listSinglePage(location, filter, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usages for the requested subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usages for the requested subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usages for the requested subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesImpl.java deleted file mode 100644 index 39f8f45aebe9..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.UsagesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner; -import com.azure.resourcemanager.cognitiveservices.models.Usage; -import com.azure.resourcemanager.cognitiveservices.models.Usages; - -public final class UsagesImpl implements Usages { - private static final ClientLogger LOGGER = new ClientLogger(UsagesImpl.class); - - private final UsagesClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public UsagesImpl(UsagesClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String location) { - PagedIterable inner = this.serviceClient().list(location); - return ResourceManagerUtils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); - } - - public PagedIterable list(String location, String filter, Context context) { - PagedIterable inner = this.serviceClient().list(location, filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); - } - - private UsagesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/WorkbenchImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/WorkbenchImpl.java deleted file mode 100644 index 3763baf1c763..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/WorkbenchImpl.java +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.WorkbenchInner; -import com.azure.resourcemanager.cognitiveservices.models.Identity; -import com.azure.resourcemanager.cognitiveservices.models.Workbench; -import com.azure.resourcemanager.cognitiveservices.models.WorkbenchProperties; -import java.util.Collections; -import java.util.Map; - -public final class WorkbenchImpl implements Workbench, Workbench.Definition, Workbench.Update { - private WorkbenchInner innerObject; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public WorkbenchProperties properties() { - return this.innerModel().properties(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public Identity identity() { - return this.innerModel().identity(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public WorkbenchInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String accountName; - - private String projectName; - - private String workbenchName; - - public WorkbenchImpl withExistingProject(String resourceGroupName, String accountName, String projectName) { - this.resourceGroupName = resourceGroupName; - this.accountName = accountName; - this.projectName = projectName; - return this; - } - - public Workbench create() { - this.innerObject = serviceManager.serviceClient() - .getWorkbenches() - .createOrUpdate(resourceGroupName, accountName, projectName, workbenchName, this.innerModel(), - Context.NONE); - return this; - } - - public Workbench create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getWorkbenches() - .createOrUpdate(resourceGroupName, accountName, projectName, workbenchName, this.innerModel(), context); - return this; - } - - WorkbenchImpl(String name, com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = new WorkbenchInner(); - this.serviceManager = serviceManager; - this.workbenchName = name; - } - - public WorkbenchImpl update() { - return this; - } - - public Workbench apply() { - this.innerObject = serviceManager.serviceClient() - .getWorkbenches() - .update(resourceGroupName, accountName, projectName, workbenchName, this.innerModel(), Context.NONE); - return this; - } - - public Workbench apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getWorkbenches() - .update(resourceGroupName, accountName, projectName, workbenchName, this.innerModel(), context); - return this; - } - - WorkbenchImpl(WorkbenchInner innerObject, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.projectName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "projects"); - this.workbenchName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workbenches"); - } - - public Workbench refresh() { - this.innerObject = serviceManager.serviceClient() - .getWorkbenches() - .getWithResponse(resourceGroupName, accountName, projectName, workbenchName, Context.NONE) - .getValue(); - return this; - } - - public Workbench refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getWorkbenches() - .getWithResponse(resourceGroupName, accountName, projectName, workbenchName, context) - .getValue(); - return this; - } - - public void start() { - serviceManager.workbenches().start(resourceGroupName, accountName, projectName, workbenchName); - } - - public void start(Context context) { - serviceManager.workbenches().start(resourceGroupName, accountName, projectName, workbenchName, context); - } - - public void stop() { - serviceManager.workbenches().stop(resourceGroupName, accountName, projectName, workbenchName); - } - - public void stop(Context context) { - serviceManager.workbenches().stop(resourceGroupName, accountName, projectName, workbenchName, context); - } - - public void restart() { - serviceManager.workbenches().restart(resourceGroupName, accountName, projectName, workbenchName); - } - - public void restart(Context context) { - serviceManager.workbenches().restart(resourceGroupName, accountName, projectName, workbenchName, context); - } - - public WorkbenchImpl withProperties(WorkbenchProperties properties) { - this.innerModel().withProperties(properties); - return this; - } - - public WorkbenchImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public WorkbenchImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public WorkbenchImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public WorkbenchImpl withIdentity(Identity identity) { - this.innerModel().withIdentity(identity); - return this; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/WorkbenchesClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/WorkbenchesClientImpl.java deleted file mode 100644 index 8f7f63f65fd4..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/WorkbenchesClientImpl.java +++ /dev/null @@ -1,1673 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.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; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.WorkbenchesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.WorkbenchInner; -import com.azure.resourcemanager.cognitiveservices.implementation.models.WorkbenchListResult; -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 WorkbenchesClient. - */ -public final class WorkbenchesClientImpl implements WorkbenchesClient { - /** - * The proxy service used to perform REST calls. - */ - private final WorkbenchesService service; - - /** - * The service client containing this operation class. - */ - private final CognitiveServicesManagementClientImpl client; - - /** - * Initializes an instance of WorkbenchesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - WorkbenchesClientImpl(CognitiveServicesManagementClientImpl client) { - this.service - = RestProxy.create(WorkbenchesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for CognitiveServicesManagementClientWorkbenches to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "CognitiveServicesManagementClientWorkbenches") - public interface WorkbenchesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches/{workbenchName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("workbenchName") String workbenchName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches/{workbenchName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("workbenchName") String workbenchName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches/{workbenchName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("workbenchName") String workbenchName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") WorkbenchInner resource, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches/{workbenchName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("workbenchName") String workbenchName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") WorkbenchInner resource, Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches/{workbenchName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("workbenchName") String workbenchName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") WorkbenchInner properties, Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches/{workbenchName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("workbenchName") String workbenchName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") WorkbenchInner properties, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches/{workbenchName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("workbenchName") String workbenchName, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches/{workbenchName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("workbenchName") String workbenchName, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches/{workbenchName}/start") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("workbenchName") String workbenchName, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches/{workbenchName}/start") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response startSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("workbenchName") String workbenchName, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches/{workbenchName}/stop") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> stop(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("workbenchName") String workbenchName, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches/{workbenchName}/stop") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response stopSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("workbenchName") String workbenchName, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches/{workbenchName}/restart") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> restart(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("workbenchName") String workbenchName, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/workbenches/{workbenchName}/restart") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response restartSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("workbenchName") String workbenchName, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 workbench associated with the project along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String accountName, - String projectName, String workbenchName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, workbenchName, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 workbench associated with the project on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, String projectName, - String workbenchName) { - return getWithResponseAsync(resourceGroupName, accountName, projectName, workbenchName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 workbench associated with the project along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, String projectName, - String workbenchName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, projectName, workbenchName, accept, context); - } - - /** - * Gets the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 workbench associated with the project. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkbenchInner get(String resourceGroupName, String accountName, String projectName, String workbenchName) { - return getWithResponse(resourceGroupName, accountName, projectName, workbenchName, Context.NONE).getValue(); - } - - /** - * Creates or updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param resource The workbench 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 workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String accountName, String projectName, String workbenchName, WorkbenchInner resource) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, workbenchName, - contentType, accept, resource, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param resource The workbench 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 workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String projectName, String workbenchName, WorkbenchInner resource) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, workbenchName, contentType, - accept, resource, Context.NONE); - } - - /** - * Creates or updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param resource The workbench 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 workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String projectName, String workbenchName, WorkbenchInner resource, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, workbenchName, contentType, - accept, resource, context); - } - - /** - * Creates or updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param resource The workbench 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 workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkbenchInner> beginCreateOrUpdateAsync(String resourceGroupName, - String accountName, String projectName, String workbenchName, WorkbenchInner resource) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, accountName, projectName, workbenchName, resource); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - WorkbenchInner.class, WorkbenchInner.class, this.client.getContext()); - } - - /** - * Creates or updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param resource The workbench 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 workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WorkbenchInner> beginCreateOrUpdate(String resourceGroupName, - String accountName, String projectName, String workbenchName, WorkbenchInner resource) { - Response response - = createOrUpdateWithResponse(resourceGroupName, accountName, projectName, workbenchName, resource); - return this.client.getLroResult(response, WorkbenchInner.class, - WorkbenchInner.class, Context.NONE); - } - - /** - * Creates or updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param resource The workbench 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 workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WorkbenchInner> beginCreateOrUpdate(String resourceGroupName, - String accountName, String projectName, String workbenchName, WorkbenchInner resource, Context context) { - Response response - = createOrUpdateWithResponse(resourceGroupName, accountName, projectName, workbenchName, resource, context); - return this.client.getLroResult(response, WorkbenchInner.class, - WorkbenchInner.class, context); - } - - /** - * Creates or updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param resource The workbench 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 workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, String projectName, - String workbenchName, WorkbenchInner resource) { - return beginCreateOrUpdateAsync(resourceGroupName, accountName, projectName, workbenchName, resource).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param resource The workbench 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 workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkbenchInner createOrUpdate(String resourceGroupName, String accountName, String projectName, - String workbenchName, WorkbenchInner resource) { - return beginCreateOrUpdate(resourceGroupName, accountName, projectName, workbenchName, resource) - .getFinalResult(); - } - - /** - * Creates or updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param resource The workbench 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 workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkbenchInner createOrUpdate(String resourceGroupName, String accountName, String projectName, - String workbenchName, WorkbenchInner resource, Context context) { - return beginCreateOrUpdate(resourceGroupName, accountName, projectName, workbenchName, resource, context) - .getFinalResult(); - } - - /** - * Updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param properties The workbench properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String accountName, - String projectName, String workbenchName, WorkbenchInner properties) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, workbenchName, - contentType, accept, properties, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param properties The workbench properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String accountName, String projectName, - String workbenchName, WorkbenchInner properties) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, workbenchName, contentType, - accept, properties, Context.NONE); - } - - /** - * Updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param properties The workbench properties to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String accountName, String projectName, - String workbenchName, WorkbenchInner properties, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, workbenchName, contentType, - accept, properties, context); - } - - /** - * Updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param properties The workbench properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkbenchInner> beginUpdateAsync(String resourceGroupName, - String accountName, String projectName, String workbenchName, WorkbenchInner properties) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, accountName, projectName, workbenchName, properties); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - WorkbenchInner.class, WorkbenchInner.class, this.client.getContext()); - } - - /** - * Updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param properties The workbench properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WorkbenchInner> beginUpdate(String resourceGroupName, - String accountName, String projectName, String workbenchName, WorkbenchInner properties) { - Response response - = updateWithResponse(resourceGroupName, accountName, projectName, workbenchName, properties); - return this.client.getLroResult(response, WorkbenchInner.class, - WorkbenchInner.class, Context.NONE); - } - - /** - * Updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param properties The workbench properties to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, WorkbenchInner> beginUpdate(String resourceGroupName, - String accountName, String projectName, String workbenchName, WorkbenchInner properties, Context context) { - Response response - = updateWithResponse(resourceGroupName, accountName, projectName, workbenchName, properties, context); - return this.client.getLroResult(response, WorkbenchInner.class, - WorkbenchInner.class, context); - } - - /** - * Updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param properties The workbench properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String accountName, String projectName, - String workbenchName, WorkbenchInner properties) { - return beginUpdateAsync(resourceGroupName, accountName, projectName, workbenchName, properties).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param properties The workbench properties to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkbenchInner update(String resourceGroupName, String accountName, String projectName, String workbenchName, - WorkbenchInner properties) { - return beginUpdate(resourceGroupName, accountName, projectName, workbenchName, properties).getFinalResult(); - } - - /** - * Updates a workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param properties The workbench properties to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workbench resource under a Cognitive Services project. - * Provides interactive compute with data access for AI development. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkbenchInner update(String resourceGroupName, String accountName, String projectName, String workbenchName, - WorkbenchInner properties, Context context) { - return beginUpdate(resourceGroupName, accountName, projectName, workbenchName, properties, context) - .getFinalResult(); - } - - /** - * Deletes the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName, String workbenchName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, workbenchName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, String projectName, - String workbenchName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, workbenchName, Context.NONE); - } - - /** - * Deletes the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, String projectName, - String workbenchName, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, workbenchName, context); - } - - /** - * Deletes the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName, String workbenchName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, accountName, projectName, workbenchName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName, String workbenchName) { - Response response = deleteWithResponse(resourceGroupName, accountName, projectName, workbenchName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Deletes the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName, String workbenchName, Context context) { - Response response - = deleteWithResponse(resourceGroupName, accountName, projectName, workbenchName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Deletes the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String projectName, - String workbenchName) { - return beginDeleteAsync(resourceGroupName, accountName, projectName, workbenchName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String projectName, String workbenchName) { - beginDelete(resourceGroupName, accountName, projectName, workbenchName).getFinalResult(); - } - - /** - * Deletes the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String projectName, String workbenchName, - Context context) { - beginDelete(resourceGroupName, accountName, projectName, workbenchName, context).getFinalResult(); - } - - /** - * Gets the workbenches associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the workbenches associated with the project along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String accountName, - String projectName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, 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 workbenches associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the workbenches associated with the project as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName, String projectName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, projectName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the workbenches associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the workbenches associated with the project along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - String projectName) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the workbenches associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the workbenches associated with the project along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - String projectName, Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the workbenches associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the workbenches associated with the project as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, String projectName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, projectName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Gets the workbenches associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the workbenches associated with the project as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, String projectName, - Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, projectName, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Starts a stopped workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName, String workbenchName) { - return FluxUtil - .withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, workbenchName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Starts a stopped workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, String projectName, - String workbenchName) { - return service.startSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, workbenchName, Context.NONE); - } - - /** - * Starts a stopped workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, String projectName, - String workbenchName, Context context) { - return service.startSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, workbenchName, context); - } - - /** - * Starts a stopped workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName, String workbenchName) { - Mono>> mono - = startWithResponseAsync(resourceGroupName, accountName, projectName, workbenchName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Starts a stopped workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName, String workbenchName) { - Response response = startWithResponse(resourceGroupName, accountName, projectName, workbenchName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Starts a stopped workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName, String workbenchName, Context context) { - Response response - = startWithResponse(resourceGroupName, accountName, projectName, workbenchName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Starts a stopped workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String projectName, - String workbenchName) { - return beginStartAsync(resourceGroupName, accountName, projectName, workbenchName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Starts a stopped workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String projectName, String workbenchName) { - beginStart(resourceGroupName, accountName, projectName, workbenchName).getFinalResult(); - } - - /** - * Starts a stopped workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String projectName, String workbenchName, - Context context) { - beginStart(resourceGroupName, accountName, projectName, workbenchName, context).getFinalResult(); - } - - /** - * Stops a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 accountName, - String projectName, String workbenchName) { - return FluxUtil - .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, workbenchName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Stops a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 stopWithResponse(String resourceGroupName, String accountName, String projectName, - String workbenchName) { - return service.stopSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, projectName, workbenchName, Context.NONE); - } - - /** - * Stops a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 stopWithResponse(String resourceGroupName, String accountName, String projectName, - String workbenchName, Context context) { - return service.stopSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, accountName, projectName, workbenchName, context); - } - - /** - * Stops a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginStopAsync(String resourceGroupName, String accountName, - String projectName, String workbenchName) { - Mono>> mono - = stopWithResponseAsync(resourceGroupName, accountName, projectName, workbenchName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Stops a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginStop(String resourceGroupName, String accountName, - String projectName, String workbenchName) { - Response response = stopWithResponse(resourceGroupName, accountName, projectName, workbenchName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Stops a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginStop(String resourceGroupName, String accountName, - String projectName, String workbenchName, Context context) { - Response response - = stopWithResponse(resourceGroupName, accountName, projectName, workbenchName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Stops a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 accountName, String projectName, - String workbenchName) { - return beginStopAsync(resourceGroupName, accountName, projectName, workbenchName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Stops a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String projectName, String workbenchName) { - beginStop(resourceGroupName, accountName, projectName, workbenchName).getFinalResult(); - } - - /** - * Stops a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 accountName, String projectName, String workbenchName, - Context context) { - beginStop(resourceGroupName, accountName, projectName, workbenchName, context).getFinalResult(); - } - - /** - * Restarts a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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>> restartWithResponseAsync(String resourceGroupName, String accountName, - String projectName, String workbenchName) { - return FluxUtil - .withContext(context -> service.restart(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, workbenchName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restarts a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 restartWithResponse(String resourceGroupName, String accountName, String projectName, - String workbenchName) { - return service.restartSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, workbenchName, Context.NONE); - } - - /** - * Restarts a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 restartWithResponse(String resourceGroupName, String accountName, String projectName, - String workbenchName, Context context) { - return service.restartSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, workbenchName, context); - } - - /** - * Restarts a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginRestartAsync(String resourceGroupName, String accountName, - String projectName, String workbenchName) { - Mono>> mono - = restartWithResponseAsync(resourceGroupName, accountName, projectName, workbenchName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Restarts a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginRestart(String resourceGroupName, String accountName, - String projectName, String workbenchName) { - Response response = restartWithResponse(resourceGroupName, accountName, projectName, workbenchName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Restarts a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginRestart(String resourceGroupName, String accountName, - String projectName, String workbenchName, Context context) { - Response response - = restartWithResponse(resourceGroupName, accountName, projectName, workbenchName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Restarts a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 restartAsync(String resourceGroupName, String accountName, String projectName, - String workbenchName) { - return beginRestartAsync(resourceGroupName, accountName, projectName, workbenchName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restarts a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 restart(String resourceGroupName, String accountName, String projectName, String workbenchName) { - beginRestart(resourceGroupName, accountName, projectName, workbenchName).getFinalResult(); - } - - /** - * Restarts a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 restart(String resourceGroupName, String accountName, String projectName, String workbenchName, - Context context) { - beginRestart(resourceGroupName, accountName, projectName, workbenchName, context).getFinalResult(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the workbenches associated with the project along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the workbenches associated with the project along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the workbenches associated with the project along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/WorkbenchesImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/WorkbenchesImpl.java deleted file mode 100644 index c82440a60924..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/WorkbenchesImpl.java +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.WorkbenchesClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.WorkbenchInner; -import com.azure.resourcemanager.cognitiveservices.models.Workbench; -import com.azure.resourcemanager.cognitiveservices.models.Workbenches; - -public final class WorkbenchesImpl implements Workbenches { - private static final ClientLogger LOGGER = new ClientLogger(WorkbenchesImpl.class); - - private final WorkbenchesClient innerClient; - - private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; - - public WorkbenchesImpl(WorkbenchesClient innerClient, - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String accountName, String projectName, - String workbenchName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, accountName, projectName, workbenchName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new WorkbenchImpl(inner.getValue(), this.manager())); - } - - public Workbench get(String resourceGroupName, String accountName, String projectName, String workbenchName) { - WorkbenchInner inner = this.serviceClient().get(resourceGroupName, accountName, projectName, workbenchName); - if (inner != null) { - return new WorkbenchImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String accountName, String projectName, String workbenchName) { - this.serviceClient().delete(resourceGroupName, accountName, projectName, workbenchName); - } - - public void delete(String resourceGroupName, String accountName, String projectName, String workbenchName, - Context context) { - this.serviceClient().delete(resourceGroupName, accountName, projectName, workbenchName, context); - } - - public PagedIterable list(String resourceGroupName, String accountName, String projectName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, projectName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkbenchImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, String projectName, - Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName, projectName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkbenchImpl(inner1, this.manager())); - } - - public void start(String resourceGroupName, String accountName, String projectName, String workbenchName) { - this.serviceClient().start(resourceGroupName, accountName, projectName, workbenchName); - } - - public void start(String resourceGroupName, String accountName, String projectName, String workbenchName, - Context context) { - this.serviceClient().start(resourceGroupName, accountName, projectName, workbenchName, context); - } - - public void stop(String resourceGroupName, String accountName, String projectName, String workbenchName) { - this.serviceClient().stop(resourceGroupName, accountName, projectName, workbenchName); - } - - public void stop(String resourceGroupName, String accountName, String projectName, String workbenchName, - Context context) { - this.serviceClient().stop(resourceGroupName, accountName, projectName, workbenchName, context); - } - - public void restart(String resourceGroupName, String accountName, String projectName, String workbenchName) { - this.serviceClient().restart(resourceGroupName, accountName, projectName, workbenchName); - } - - public void restart(String resourceGroupName, String accountName, String projectName, String workbenchName, - Context context) { - this.serviceClient().restart(resourceGroupName, accountName, projectName, workbenchName, context); - } - - public Workbench 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String workbenchName = ResourceManagerUtils.getValueFromIdByName(id, "workbenches"); - if (workbenchName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workbenches'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, projectName, workbenchName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String workbenchName = ResourceManagerUtils.getValueFromIdByName(id, "workbenches"); - if (workbenchName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workbenches'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, projectName, workbenchName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String workbenchName = ResourceManagerUtils.getValueFromIdByName(id, "workbenches"); - if (workbenchName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workbenches'.", id))); - } - this.delete(resourceGroupName, accountName, projectName, workbenchName, 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 accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String workbenchName = ResourceManagerUtils.getValueFromIdByName(id, "workbenches"); - if (workbenchName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workbenches'.", id))); - } - this.delete(resourceGroupName, accountName, projectName, workbenchName, context); - } - - private WorkbenchesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { - return this.serviceManager; - } - - public WorkbenchImpl define(String name) { - return new WorkbenchImpl(name, this.manager()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AccountListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AccountListResult.java deleted file mode 100644 index 41db2ed3901b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AccountListResult.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of cognitive services accounts operation response. - */ -@Immutable -public final class AccountListResult implements JsonSerializable { - /* - * The link used to get the next page of accounts. - */ - private String nextLink; - - /* - * Gets the list of Cognitive Services accounts and their properties. - */ - private List value; - - /** - * Creates an instance of AccountListResult class. - */ - private AccountListResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of accounts. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: Gets the list of Cognitive Services accounts and their properties. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AccountListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AccountListResult 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 AccountListResult. - */ - public static AccountListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AccountListResult deserializedAccountListResult = new AccountListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedAccountListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> AccountInner.fromJson(reader1)); - deserializedAccountListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedAccountListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AccountModelListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AccountModelListResult.java deleted file mode 100644 index cc521dd4c996..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AccountModelListResult.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountModelInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of cognitive services accounts operation response. - */ -@Immutable -public final class AccountModelListResult implements JsonSerializable { - /* - * The link used to get the next page of Model. - */ - private String nextLink; - - /* - * Gets the list of Cognitive Services accounts Model and their properties. - */ - private List value; - - /** - * Creates an instance of AccountModelListResult class. - */ - private AccountModelListResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of Model. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: Gets the list of Cognitive Services accounts Model and their properties. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 AccountModelListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AccountModelListResult 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 AccountModelListResult. - */ - public static AccountModelListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AccountModelListResult deserializedAccountModelListResult = new AccountModelListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedAccountModelListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> AccountModelInner.fromJson(reader1)); - deserializedAccountModelListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedAccountModelListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AgentApplicationResourceArmPaginatedResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AgentApplicationResourceArmPaginatedResult.java deleted file mode 100644 index 503281bcbecb..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AgentApplicationResourceArmPaginatedResult.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentApplicationInner; -import java.io.IOException; -import java.util.List; - -/** - * A paginated list of Agent Application entities. - */ -@Immutable -public final class AgentApplicationResourceArmPaginatedResult - implements JsonSerializable { - /* - * The link to the next page of Agent Application objects. If null, there are no additional pages. - */ - private String nextLink; - - /* - * An array of objects of type Agent Application. - */ - private List value; - - /** - * Creates an instance of AgentApplicationResourceArmPaginatedResult class. - */ - private AgentApplicationResourceArmPaginatedResult() { - } - - /** - * Get the nextLink property: The link to the next page of Agent Application objects. If null, there are no - * additional pages. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: An array of objects of type Agent Application. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 AgentApplicationResourceArmPaginatedResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AgentApplicationResourceArmPaginatedResult 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 AgentApplicationResourceArmPaginatedResult. - */ - public static AgentApplicationResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AgentApplicationResourceArmPaginatedResult deserializedAgentApplicationResourceArmPaginatedResult - = new AgentApplicationResourceArmPaginatedResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedAgentApplicationResourceArmPaginatedResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AgentApplicationInner.fromJson(reader1)); - deserializedAgentApplicationResourceArmPaginatedResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedAgentApplicationResourceArmPaginatedResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AgentDeploymentResourceArmPaginatedResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AgentDeploymentResourceArmPaginatedResult.java deleted file mode 100644 index 2b4a37e77f15..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AgentDeploymentResourceArmPaginatedResult.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentDeploymentInner; -import java.io.IOException; -import java.util.List; - -/** - * A paginated list of Agent Deployment entities. - */ -@Immutable -public final class AgentDeploymentResourceArmPaginatedResult - implements JsonSerializable { - /* - * The link to the next page of Agent Deployment objects. If null, there are no additional pages. - */ - private String nextLink; - - /* - * An array of objects of type Agent Deployment. - */ - private List value; - - /** - * Creates an instance of AgentDeploymentResourceArmPaginatedResult class. - */ - private AgentDeploymentResourceArmPaginatedResult() { - } - - /** - * Get the nextLink property: The link to the next page of Agent Deployment objects. If null, there are no - * additional pages. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: An array of objects of type Agent Deployment. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 AgentDeploymentResourceArmPaginatedResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AgentDeploymentResourceArmPaginatedResult 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 AgentDeploymentResourceArmPaginatedResult. - */ - public static AgentDeploymentResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AgentDeploymentResourceArmPaginatedResult deserializedAgentDeploymentResourceArmPaginatedResult - = new AgentDeploymentResourceArmPaginatedResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedAgentDeploymentResourceArmPaginatedResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AgentDeploymentInner.fromJson(reader1)); - deserializedAgentDeploymentResourceArmPaginatedResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedAgentDeploymentResourceArmPaginatedResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CapabilityHostResourceArmPaginatedResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CapabilityHostResourceArmPaginatedResult.java deleted file mode 100644 index 1785ef48bfb0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CapabilityHostResourceArmPaginatedResult.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; -import java.io.IOException; -import java.util.List; - -/** - * A paginated list of Capability Host entities. - */ -@Immutable -public final class CapabilityHostResourceArmPaginatedResult - implements JsonSerializable { - /* - * The link to the next page of Capability Host objects. If null, there are no additional pages. - */ - private String nextLink; - - /* - * An array of objects of type Capability Host. - */ - private List value; - - /** - * Creates an instance of CapabilityHostResourceArmPaginatedResult class. - */ - private CapabilityHostResourceArmPaginatedResult() { - } - - /** - * Get the nextLink property: The link to the next page of Capability Host objects. If null, there are no additional - * pages. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: An array of objects of type Capability Host. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 CapabilityHostResourceArmPaginatedResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CapabilityHostResourceArmPaginatedResult 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 CapabilityHostResourceArmPaginatedResult. - */ - public static CapabilityHostResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CapabilityHostResourceArmPaginatedResult deserializedCapabilityHostResourceArmPaginatedResult - = new CapabilityHostResourceArmPaginatedResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedCapabilityHostResourceArmPaginatedResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> CapabilityHostInner.fromJson(reader1)); - deserializedCapabilityHostResourceArmPaginatedResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedCapabilityHostResourceArmPaginatedResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentPlanAccountAssociationListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentPlanAccountAssociationListResult.java deleted file mode 100644 index 176626298852..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentPlanAccountAssociationListResult.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanAccountAssociationInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of cognitive services Commitment Plan Account Association operation response. - */ -@Immutable -public final class CommitmentPlanAccountAssociationListResult - implements JsonSerializable { - /* - * The link used to get the next page of Commitment Plan Account Association. - */ - private String nextLink; - - /* - * Gets the list of Cognitive Services Commitment Plan Account Association and their properties. - */ - private List value; - - /** - * Creates an instance of CommitmentPlanAccountAssociationListResult class. - */ - private CommitmentPlanAccountAssociationListResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of Commitment Plan Account Association. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: Gets the list of Cognitive Services Commitment Plan Account Association and their - * properties. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CommitmentPlanAccountAssociationListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CommitmentPlanAccountAssociationListResult 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 CommitmentPlanAccountAssociationListResult. - */ - public static CommitmentPlanAccountAssociationListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CommitmentPlanAccountAssociationListResult deserializedCommitmentPlanAccountAssociationListResult - = new CommitmentPlanAccountAssociationListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedCommitmentPlanAccountAssociationListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> CommitmentPlanAccountAssociationInner.fromJson(reader1)); - deserializedCommitmentPlanAccountAssociationListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedCommitmentPlanAccountAssociationListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentPlanListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentPlanListResult.java deleted file mode 100644 index 75aa9a0de0fe..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentPlanListResult.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of cognitive services accounts operation response. - */ -@Immutable -public final class CommitmentPlanListResult implements JsonSerializable { - /* - * The link used to get the next page of CommitmentPlan. - */ - private String nextLink; - - /* - * Gets the list of Cognitive Services accounts CommitmentPlan and their properties. - */ - private List value; - - /** - * Creates an instance of CommitmentPlanListResult class. - */ - private CommitmentPlanListResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of CommitmentPlan. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: Gets the list of Cognitive Services accounts CommitmentPlan and their properties. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CommitmentPlanListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CommitmentPlanListResult 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 CommitmentPlanListResult. - */ - public static CommitmentPlanListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CommitmentPlanListResult deserializedCommitmentPlanListResult = new CommitmentPlanListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedCommitmentPlanListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> CommitmentPlanInner.fromJson(reader1)); - deserializedCommitmentPlanListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedCommitmentPlanListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentTierListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentTierListResult.java deleted file mode 100644 index 2d096dcf00a6..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentTierListResult.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentTierInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of cognitive services accounts operation response. - */ -@Immutable -public final class CommitmentTierListResult implements JsonSerializable { - /* - * The link used to get the next page of CommitmentTier. - */ - private String nextLink; - - /* - * Gets the list of Cognitive Services accounts CommitmentTier and their properties. - */ - private List value; - - /** - * Creates an instance of CommitmentTierListResult class. - */ - private CommitmentTierListResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of CommitmentTier. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: Gets the list of Cognitive Services accounts CommitmentTier and their properties. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CommitmentTierListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CommitmentTierListResult 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 CommitmentTierListResult. - */ - public static CommitmentTierListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CommitmentTierListResult deserializedCommitmentTierListResult = new CommitmentTierListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedCommitmentTierListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> CommitmentTierInner.fromJson(reader1)); - deserializedCommitmentTierListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedCommitmentTierListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ComputeListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ComputeListResult.java deleted file mode 100644 index e4769b66cda0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ComputeListResult.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ComputeInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of cognitive services computes operation response. - */ -@Immutable -public final class ComputeListResult implements JsonSerializable { - /* - * The link used to get the next page of compute list. - */ - private String nextLink; - - /* - * Gets the list of computes. - */ - private List value; - - /** - * Creates an instance of ComputeListResult class. - */ - private ComputeListResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of compute list. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: Gets the list of computes. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 ComputeListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComputeListResult 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 ComputeListResult. - */ - public static ComputeListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ComputeListResult deserializedComputeListResult = new ComputeListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedComputeListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> ComputeInner.fromJson(reader1)); - deserializedComputeListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedComputeListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.java deleted file mode 100644 index 22b8b0c1b881..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; -import java.io.IOException; -import java.util.List; - -/** - * The ConnectionPropertiesV2BasicResourceArmPaginatedResult model. - */ -@Immutable -public final class ConnectionPropertiesV2BasicResourceArmPaginatedResult - implements JsonSerializable { - /* - * The nextLink property. - */ - private String nextLink; - - /* - * The value property. - */ - private List value; - - /** - * Creates an instance of ConnectionPropertiesV2BasicResourceArmPaginatedResult class. - */ - private ConnectionPropertiesV2BasicResourceArmPaginatedResult() { - } - - /** - * Get the nextLink property: The nextLink property. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 ConnectionPropertiesV2BasicResourceArmPaginatedResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ConnectionPropertiesV2BasicResourceArmPaginatedResult 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 ConnectionPropertiesV2BasicResourceArmPaginatedResult. - */ - public static ConnectionPropertiesV2BasicResourceArmPaginatedResult fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - ConnectionPropertiesV2BasicResourceArmPaginatedResult deserializedConnectionPropertiesV2BasicResourceArmPaginatedResult - = new ConnectionPropertiesV2BasicResourceArmPaginatedResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedConnectionPropertiesV2BasicResourceArmPaginatedResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ConnectionPropertiesV2BasicResourceInner.fromJson(reader1)); - deserializedConnectionPropertiesV2BasicResourceArmPaginatedResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedConnectionPropertiesV2BasicResourceArmPaginatedResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DefenderForAISettingResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DefenderForAISettingResult.java deleted file mode 100644 index 21db5061a8e5..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DefenderForAISettingResult.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.DefenderForAISettingInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of cognitive services Defender for AI Settings. - */ -@Immutable -public final class DefenderForAISettingResult implements JsonSerializable { - /* - * The link used to get the next page of Defender for AI Settings. - */ - private String nextLink; - - /* - * The list of Defender for AI Settings. - */ - private List value; - - /** - * Creates an instance of DefenderForAISettingResult class. - */ - private DefenderForAISettingResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of Defender for AI Settings. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: The list of Defender for AI Settings. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 DefenderForAISettingResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForAISettingResult 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 DefenderForAISettingResult. - */ - public static DefenderForAISettingResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForAISettingResult deserializedDefenderForAISettingResult = new DefenderForAISettingResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedDefenderForAISettingResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> DefenderForAISettingInner.fromJson(reader1)); - deserializedDefenderForAISettingResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForAISettingResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DeploymentListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DeploymentListResult.java deleted file mode 100644 index c8f28df07878..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DeploymentListResult.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.DeploymentInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of cognitive services accounts operation response. - */ -@Immutable -public final class DeploymentListResult implements JsonSerializable { - /* - * The link used to get the next page of Deployment. - */ - private String nextLink; - - /* - * Gets the list of Cognitive Services accounts Deployment and their properties. - */ - private List value; - - /** - * Creates an instance of DeploymentListResult class. - */ - private DeploymentListResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of Deployment. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: Gets the list of Cognitive Services accounts Deployment and their properties. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeploymentListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeploymentListResult 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 DeploymentListResult. - */ - public static DeploymentListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DeploymentListResult deserializedDeploymentListResult = new DeploymentListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedDeploymentListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> DeploymentInner.fromJson(reader1)); - deserializedDeploymentListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedDeploymentListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DeploymentSkuListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DeploymentSkuListResult.java deleted file mode 100644 index 7accd24ad96f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DeploymentSkuListResult.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.SkuResourceInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of cognitive services accounts operation response. - */ -@Immutable -public final class DeploymentSkuListResult implements JsonSerializable { - /* - * The link used to get the next page of deployment skus. - */ - private String nextLink; - - /* - * Gets the list of Cognitive Services accounts deployment skus. - */ - private List value; - - /** - * Creates an instance of DeploymentSkuListResult class. - */ - private DeploymentSkuListResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of deployment skus. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: Gets the list of Cognitive Services accounts deployment skus. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeploymentSkuListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeploymentSkuListResult 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 DeploymentSkuListResult. - */ - public static DeploymentSkuListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DeploymentSkuListResult deserializedDeploymentSkuListResult = new DeploymentSkuListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedDeploymentSkuListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> SkuResourceInner.fromJson(reader1)); - deserializedDeploymentSkuListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedDeploymentSkuListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/EncryptionScopeListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/EncryptionScopeListResult.java deleted file mode 100644 index d64a6628df59..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/EncryptionScopeListResult.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.EncryptionScopeInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of cognitive services EncryptionScopes. - */ -@Immutable -public final class EncryptionScopeListResult implements JsonSerializable { - /* - * The link used to get the next page of EncryptionScope. - */ - private String nextLink; - - /* - * The list of EncryptionScope. - */ - private List value; - - /** - * Creates an instance of EncryptionScopeListResult class. - */ - private EncryptionScopeListResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of EncryptionScope. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: The list of EncryptionScope. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 EncryptionScopeListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EncryptionScopeListResult 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 EncryptionScopeListResult. - */ - public static EncryptionScopeListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EncryptionScopeListResult deserializedEncryptionScopeListResult = new EncryptionScopeListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedEncryptionScopeListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> EncryptionScopeInner.fromJson(reader1)); - deserializedEncryptionScopeListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedEncryptionScopeListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ManagedComputeCapacityListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ManagedComputeCapacityListResult.java deleted file mode 100644 index 5bcd04585019..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ManagedComputeCapacityListResult.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedComputeCapacityInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of managed compute capacities response. - */ -@Immutable -public final class ManagedComputeCapacityListResult implements JsonSerializable { - /* - * The link used to get the next page of managed compute capacities. - */ - private String nextLink; - - /* - * Gets the list of managed compute capacities. - */ - private List value; - - /** - * Creates an instance of ManagedComputeCapacityListResult class. - */ - private ManagedComputeCapacityListResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of managed compute capacities. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: Gets the list of managed compute capacities. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ManagedComputeCapacityListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedComputeCapacityListResult 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 ManagedComputeCapacityListResult. - */ - public static ManagedComputeCapacityListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedComputeCapacityListResult deserializedManagedComputeCapacityListResult - = new ManagedComputeCapacityListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedManagedComputeCapacityListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ManagedComputeCapacityInner.fromJson(reader1)); - deserializedManagedComputeCapacityListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedManagedComputeCapacityListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ManagedComputeDeploymentListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ManagedComputeDeploymentListResult.java deleted file mode 100644 index c073cd2ee830..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ManagedComputeDeploymentListResult.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedComputeDeploymentInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of managed compute deployments. - */ -@Immutable -public final class ManagedComputeDeploymentListResult implements JsonSerializable { - /* - * The link used to get the next page of managed compute deployments. - */ - private String nextLink; - - /* - * Gets the list of managed compute deployments and their properties. - */ - private List value; - - /** - * Creates an instance of ManagedComputeDeploymentListResult class. - */ - private ManagedComputeDeploymentListResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of managed compute deployments. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: Gets the list of managed compute deployments and their properties. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ManagedComputeDeploymentListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedComputeDeploymentListResult 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 ManagedComputeDeploymentListResult. - */ - public static ManagedComputeDeploymentListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedComputeDeploymentListResult deserializedManagedComputeDeploymentListResult - = new ManagedComputeDeploymentListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedManagedComputeDeploymentListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ManagedComputeDeploymentInner.fromJson(reader1)); - deserializedManagedComputeDeploymentListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedManagedComputeDeploymentListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ManagedComputeUsageListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ManagedComputeUsageListResult.java deleted file mode 100644 index d560e9ecbeee..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ManagedComputeUsageListResult.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedComputeUsageInner; -import java.io.IOException; -import java.util.List; - -/** - * List of managed compute quota entries. - */ -@Immutable -public final class ManagedComputeUsageListResult implements JsonSerializable { - /* - * The link used to get the next page of managed compute usages. - */ - private String nextLink; - - /* - * Per-SKU managed compute quota usage entries. - */ - private List value; - - /** - * Creates an instance of ManagedComputeUsageListResult class. - */ - private ManagedComputeUsageListResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of managed compute usages. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: Per-SKU managed compute quota usage entries. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 ManagedComputeUsageListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedComputeUsageListResult 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 ManagedComputeUsageListResult. - */ - public static ManagedComputeUsageListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedComputeUsageListResult deserializedManagedComputeUsageListResult - = new ManagedComputeUsageListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedManagedComputeUsageListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ManagedComputeUsageInner.fromJson(reader1)); - deserializedManagedComputeUsageListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedManagedComputeUsageListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ManagedNetworkListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ManagedNetworkListResult.java deleted file mode 100644 index 2104721588bc..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ManagedNetworkListResult.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsPropertiesBasicResourceInner; -import java.io.IOException; -import java.util.List; - -/** - * List of managed networks of a cognitive services account. - */ -@Immutable -public final class ManagedNetworkListResult implements JsonSerializable { - /* - * The link to the next page constructed using the continuationToken. If null, there are no additional pages. - */ - private String nextLink; - - /* - * The list of managed network settings of an account. Since this list may be incomplete, the nextLink field should - * be used to request the next list of cognitive services accounts. - */ - private List value; - - /** - * Creates an instance of ManagedNetworkListResult class. - */ - private ManagedNetworkListResult() { - } - - /** - * Get the nextLink property: The link to the next page constructed using the continuationToken. If null, there are - * no additional pages. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: The list of managed network settings of an account. Since this list may be incomplete, - * the nextLink field should be used to request the next list of cognitive services accounts. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 ManagedNetworkListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedNetworkListResult 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 ManagedNetworkListResult. - */ - public static ManagedNetworkListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedNetworkListResult deserializedManagedNetworkListResult = new ManagedNetworkListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedManagedNetworkListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value = reader - .readArray(reader1 -> ManagedNetworkSettingsPropertiesBasicResourceInner.fromJson(reader1)); - deserializedManagedNetworkListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedManagedNetworkListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ModelCapacityListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ModelCapacityListResult.java deleted file mode 100644 index 95099bd29e25..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ModelCapacityListResult.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelCapacityListResultValueItemInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of cognitive services accounts operation response. - */ -@Immutable -public final class ModelCapacityListResult implements JsonSerializable { - /* - * The link used to get the next page of ModelSkuCapacity. - */ - private String nextLink; - - /* - * Gets the list of Cognitive Services accounts ModelSkuCapacity. - */ - private List value; - - /** - * Creates an instance of ModelCapacityListResult class. - */ - private ModelCapacityListResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of ModelSkuCapacity. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: Gets the list of Cognitive Services accounts ModelSkuCapacity. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ModelCapacityListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ModelCapacityListResult 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 ModelCapacityListResult. - */ - public static ModelCapacityListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ModelCapacityListResult deserializedModelCapacityListResult = new ModelCapacityListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedModelCapacityListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ModelCapacityListResultValueItemInner.fromJson(reader1)); - deserializedModelCapacityListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedModelCapacityListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ModelListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ModelListResult.java deleted file mode 100644 index 9ae851778d2d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ModelListResult.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of cognitive services models. - */ -@Immutable -public final class ModelListResult implements JsonSerializable { - /* - * The link used to get the next page of Model. - */ - private String nextLink; - - /* - * Gets the list of Cognitive Services accounts Model and their properties. - */ - private List value; - - /** - * Creates an instance of ModelListResult class. - */ - private ModelListResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of Model. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: Gets the list of Cognitive Services accounts Model and their properties. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 ModelListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ModelListResult 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 ModelListResult. - */ - public static ModelListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ModelListResult deserializedModelListResult = new ModelListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedModelListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> ModelInner.fromJson(reader1)); - deserializedModelListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedModelListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/NetworkSecurityPerimeterConfigurationList.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/NetworkSecurityPerimeterConfigurationList.java deleted file mode 100644 index 3ee4b2415ed7..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/NetworkSecurityPerimeterConfigurationList.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.NetworkSecurityPerimeterConfigurationInner; -import java.io.IOException; -import java.util.List; - -/** - * A list of NSP configurations for an Cognitive Services account. - */ -@Immutable -public final class NetworkSecurityPerimeterConfigurationList - implements JsonSerializable { - /* - * Array of NSP configurations List Result for an Cognitive Services account. - */ - private List value; - - /* - * Link to retrieve next page of results. - */ - private String nextLink; - - /** - * Creates an instance of NetworkSecurityPerimeterConfigurationList class. - */ - private NetworkSecurityPerimeterConfigurationList() { - } - - /** - * Get the value property: Array of NSP configurations List Result for an Cognitive Services account. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Link to retrieve next page of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of NetworkSecurityPerimeterConfigurationList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of NetworkSecurityPerimeterConfigurationList 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 NetworkSecurityPerimeterConfigurationList. - */ - public static NetworkSecurityPerimeterConfigurationList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - NetworkSecurityPerimeterConfigurationList deserializedNetworkSecurityPerimeterConfigurationList - = new NetworkSecurityPerimeterConfigurationList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> NetworkSecurityPerimeterConfigurationInner.fromJson(reader1)); - deserializedNetworkSecurityPerimeterConfigurationList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedNetworkSecurityPerimeterConfigurationList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedNetworkSecurityPerimeterConfigurationList; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/OperationListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/OperationListResult.java deleted file mode 100644 index 744930ac9286..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/OperationListResult.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.OperationInner; -import java.io.IOException; -import java.util.List; - -/** - * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of - * results. - */ -@Immutable -public final class OperationListResult implements JsonSerializable { - /* - * The Operation items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of OperationListResult class. - */ - private OperationListResult() { - } - - /** - * Get the value property: The Operation items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationListResult from the JsonReader. - * - * @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 IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the OperationListResult. - */ - 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/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/OutboundRuleListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/OutboundRuleListResult.java deleted file mode 100644 index 09c4c7697ec3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/OutboundRuleListResult.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleBasicResourceInner; -import java.io.IOException; -import java.util.List; - -/** - * List of outbound rules for the managed network of a cognitive services account. - */ -@Immutable -public final class OutboundRuleListResult implements JsonSerializable { - /* - * The link to the next page constructed using the continuationToken. If null, there are no additional pages. - */ - private String nextLink; - - /* - * The list of cognitive services accounts. Since this list may be incomplete, the nextLink field should be used to - * request the next list of cognitive services accounts. - */ - private List value; - - /** - * Creates an instance of OutboundRuleListResult class. - */ - private OutboundRuleListResult() { - } - - /** - * Get the nextLink property: The link to the next page constructed using the continuationToken. If null, there are - * no additional pages. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: The list of cognitive services accounts. Since this list may be incomplete, the nextLink - * field should be used to request the next list of cognitive services accounts. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 OutboundRuleListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OutboundRuleListResult 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 OutboundRuleListResult. - */ - public static OutboundRuleListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OutboundRuleListResult deserializedOutboundRuleListResult = new OutboundRuleListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedOutboundRuleListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> OutboundRuleBasicResourceInner.fromJson(reader1)); - deserializedOutboundRuleListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedOutboundRuleListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ProjectCapabilityHostResourceArmPaginatedResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ProjectCapabilityHostResourceArmPaginatedResult.java deleted file mode 100644 index 2deb4aa5be23..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ProjectCapabilityHostResourceArmPaginatedResult.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectCapabilityHostInner; -import java.io.IOException; -import java.util.List; - -/** - * A paginated list of Project Capability Host entities. - */ -@Immutable -public final class ProjectCapabilityHostResourceArmPaginatedResult - implements JsonSerializable { - /* - * The link to the next page of Project Capability Host objects. If null, there are no additional pages. - */ - private String nextLink; - - /* - * An array of objects of type Project Capability Host. - */ - private List value; - - /** - * Creates an instance of ProjectCapabilityHostResourceArmPaginatedResult class. - */ - private ProjectCapabilityHostResourceArmPaginatedResult() { - } - - /** - * Get the nextLink property: The link to the next page of Project Capability Host objects. If null, there are no - * additional pages. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: An array of objects of type Project Capability Host. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 ProjectCapabilityHostResourceArmPaginatedResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProjectCapabilityHostResourceArmPaginatedResult 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 ProjectCapabilityHostResourceArmPaginatedResult. - */ - public static ProjectCapabilityHostResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProjectCapabilityHostResourceArmPaginatedResult deserializedProjectCapabilityHostResourceArmPaginatedResult - = new ProjectCapabilityHostResourceArmPaginatedResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedProjectCapabilityHostResourceArmPaginatedResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ProjectCapabilityHostInner.fromJson(reader1)); - deserializedProjectCapabilityHostResourceArmPaginatedResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedProjectCapabilityHostResourceArmPaginatedResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ProjectListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ProjectListResult.java deleted file mode 100644 index 8fa73da3b16d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ProjectListResult.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of cognitive services projects operation response. - */ -@Immutable -public final class ProjectListResult implements JsonSerializable { - /* - * The link used to get the next page of projects. - */ - private String nextLink; - - /* - * Gets the list of Cognitive Services projects and their properties. - */ - private List value; - - /** - * Creates an instance of ProjectListResult class. - */ - private ProjectListResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of projects. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: Gets the list of Cognitive Services projects and their properties. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ProjectListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProjectListResult 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 ProjectListResult. - */ - public static ProjectListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProjectListResult deserializedProjectListResult = new ProjectListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedProjectListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> ProjectInner.fromJson(reader1)); - deserializedProjectListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedProjectListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/QuotaTierListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/QuotaTierListResult.java deleted file mode 100644 index 3c71bd64db4a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/QuotaTierListResult.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.QuotaTierInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of Quota Tiers response. - */ -@Immutable -public final class QuotaTierListResult implements JsonSerializable { - /* - * The link used to get the next page of quota tiers. - */ - private String nextLink; - - /* - * Gets the list of Quota Tiers and their properties. - */ - private List value; - - /** - * Creates an instance of QuotaTierListResult class. - */ - private QuotaTierListResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of quota tiers. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: Gets the list of Quota Tiers and their properties. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QuotaTierListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QuotaTierListResult 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 QuotaTierListResult. - */ - public static QuotaTierListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QuotaTierListResult deserializedQuotaTierListResult = new QuotaTierListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedQuotaTierListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> QuotaTierInner.fromJson(reader1)); - deserializedQuotaTierListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedQuotaTierListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiBlockListItemsResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiBlockListItemsResult.java deleted file mode 100644 index 3296b8dab6ae..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiBlockListItemsResult.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistItemInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of cognitive services RAI Blocklist Items. - */ -@Immutable -public final class RaiBlockListItemsResult implements JsonSerializable { - /* - * The link used to get the next page of RaiBlocklistItems. - */ - private String nextLink; - - /* - * The list of RaiBlocklistItems. - */ - private List value; - - /** - * Creates an instance of RaiBlockListItemsResult class. - */ - private RaiBlockListItemsResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of RaiBlocklistItems. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: The list of RaiBlocklistItems. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 RaiBlockListItemsResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiBlockListItemsResult 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 RaiBlockListItemsResult. - */ - public static RaiBlockListItemsResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiBlockListItemsResult deserializedRaiBlockListItemsResult = new RaiBlockListItemsResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedRaiBlockListItemsResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> RaiBlocklistItemInner.fromJson(reader1)); - deserializedRaiBlockListItemsResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedRaiBlockListItemsResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiBlockListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiBlockListResult.java deleted file mode 100644 index 4417bcae152b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiBlockListResult.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of cognitive services RAI Blocklists. - */ -@Immutable -public final class RaiBlockListResult implements JsonSerializable { - /* - * The link used to get the next page of RaiBlocklists. - */ - private String nextLink; - - /* - * The list of RaiBlocklist. - */ - private List value; - - /** - * Creates an instance of RaiBlockListResult class. - */ - private RaiBlockListResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of RaiBlocklists. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: The list of RaiBlocklist. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 RaiBlockListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiBlockListResult 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 RaiBlockListResult. - */ - public static RaiBlockListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiBlockListResult deserializedRaiBlockListResult = new RaiBlockListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedRaiBlockListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> RaiBlocklistInner.fromJson(reader1)); - deserializedRaiBlockListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedRaiBlockListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiContentFilterListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiContentFilterListResult.java deleted file mode 100644 index 95da9f767e37..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiContentFilterListResult.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiContentFilterInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of Content Filters. - */ -@Immutable -public final class RaiContentFilterListResult implements JsonSerializable { - /* - * The link used to get the next page of Content Filters. - */ - private String nextLink; - - /* - * The list of RaiContentFilter. - */ - private List value; - - /** - * Creates an instance of RaiContentFilterListResult class. - */ - private RaiContentFilterListResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of Content Filters. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: The list of RaiContentFilter. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 RaiContentFilterListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiContentFilterListResult 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 RaiContentFilterListResult. - */ - public static RaiContentFilterListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiContentFilterListResult deserializedRaiContentFilterListResult = new RaiContentFilterListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedRaiContentFilterListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> RaiContentFilterInner.fromJson(reader1)); - deserializedRaiContentFilterListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedRaiContentFilterListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiExternalSafetyProviderResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiExternalSafetyProviderResult.java deleted file mode 100644 index 969d09513577..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiExternalSafetyProviderResult.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of cognitive services RAI External Safety Providers. - */ -@Immutable -public final class RaiExternalSafetyProviderResult implements JsonSerializable { - /* - * The link used to get the next page of Rai External Safety Provider. - */ - private String nextLink; - - /* - * The list of RaiExternalSafetyProvider. - */ - private List value; - - /** - * Creates an instance of RaiExternalSafetyProviderResult class. - */ - private RaiExternalSafetyProviderResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of Rai External Safety Provider. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: The list of RaiExternalSafetyProvider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 RaiExternalSafetyProviderResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiExternalSafetyProviderResult 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 RaiExternalSafetyProviderResult. - */ - public static RaiExternalSafetyProviderResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiExternalSafetyProviderResult deserializedRaiExternalSafetyProviderResult - = new RaiExternalSafetyProviderResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedRaiExternalSafetyProviderResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> RaiExternalSafetyProviderSchemaInner.fromJson(reader1)); - deserializedRaiExternalSafetyProviderResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedRaiExternalSafetyProviderResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiPolicyListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiPolicyListResult.java deleted file mode 100644 index 20a88ba7c86c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiPolicyListResult.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of cognitive services RaiPolicies. - */ -@Immutable -public final class RaiPolicyListResult implements JsonSerializable { - /* - * The link used to get the next page of RaiPolicy. - */ - private String nextLink; - - /* - * The list of RaiPolicy. - */ - private List value; - - /** - * Creates an instance of RaiPolicyListResult class. - */ - private RaiPolicyListResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of RaiPolicy. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: The list of RaiPolicy. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 RaiPolicyListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiPolicyListResult 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 RaiPolicyListResult. - */ - public static RaiPolicyListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiPolicyListResult deserializedRaiPolicyListResult = new RaiPolicyListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedRaiPolicyListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> RaiPolicyInner.fromJson(reader1)); - deserializedRaiPolicyListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedRaiPolicyListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiToolLabelResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiToolLabelResult.java deleted file mode 100644 index c5a00f7cedb8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiToolLabelResult.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiToolLabelInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of Cognitive Services RAI Tool Labels. - */ -@Immutable -public final class RaiToolLabelResult implements JsonSerializable { - /* - * The link used to get the next page of RaiToolLabels. - */ - private String nextLink; - - /* - * The list of RAI Tool Labels. - */ - private List value; - - /** - * Creates an instance of RaiToolLabelResult class. - */ - private RaiToolLabelResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of RaiToolLabels. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: The list of RAI Tool Labels. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 RaiToolLabelResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiToolLabelResult 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 RaiToolLabelResult. - */ - public static RaiToolLabelResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiToolLabelResult deserializedRaiToolLabelResult = new RaiToolLabelResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedRaiToolLabelResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> RaiToolLabelInner.fromJson(reader1)); - deserializedRaiToolLabelResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedRaiToolLabelResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiTopicResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiTopicResult.java deleted file mode 100644 index 1c94afb8e5de..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiTopicResult.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiTopicInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of cognitive services RAI Topics. - */ -@Immutable -public final class RaiTopicResult implements JsonSerializable { - /* - * The link used to get the next page of RaiTopics. - */ - private String nextLink; - - /* - * The list of RaiTopic. - */ - private List value; - - /** - * Creates an instance of RaiTopicResult class. - */ - private RaiTopicResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of RaiTopics. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: The list of RaiTopic. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 RaiTopicResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiTopicResult 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 RaiTopicResult. - */ - public static RaiTopicResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiTopicResult deserializedRaiTopicResult = new RaiTopicResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedRaiTopicResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> RaiTopicInner.fromJson(reader1)); - deserializedRaiTopicResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedRaiTopicResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ResourceSkuListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ResourceSkuListResult.java deleted file mode 100644 index 9eff59dc3d0d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ResourceSkuListResult.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ResourceSkuInner; -import java.io.IOException; -import java.util.List; - -/** - * The Get Skus operation response. - */ -@Immutable -public final class ResourceSkuListResult implements JsonSerializable { - /* - * The ResourceSku items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of ResourceSkuListResult class. - */ - private ResourceSkuListResult() { - } - - /** - * Get the value property: The ResourceSku items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceSkuListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceSkuListResult 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 ResourceSkuListResult. - */ - public static ResourceSkuListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceSkuListResult deserializedResourceSkuListResult = new ResourceSkuListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> ResourceSkuInner.fromJson(reader1)); - deserializedResourceSkuListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedResourceSkuListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedResourceSkuListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/WorkbenchListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/WorkbenchListResult.java deleted file mode 100644 index 036412151742..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/WorkbenchListResult.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.WorkbenchInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of workbenches operation response. - */ -@Immutable -public final class WorkbenchListResult implements JsonSerializable { - /* - * The link used to get the next page of workbench list. - */ - private String nextLink; - - /* - * Gets the list of workbenches. - */ - private List value; - - /** - * Creates an instance of WorkbenchListResult class. - */ - private WorkbenchListResult() { - } - - /** - * Get the nextLink property: The link used to get the next page of workbench list. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: Gets the list of workbenches. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 WorkbenchListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WorkbenchListResult 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 WorkbenchListResult. - */ - public static WorkbenchListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WorkbenchListResult deserializedWorkbenchListResult = new WorkbenchListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedWorkbenchListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> WorkbenchInner.fromJson(reader1)); - deserializedWorkbenchListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedWorkbenchListResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/package-info.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/package-info.java deleted file mode 100644 index d3d3cdded82c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// 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 CognitiveServices. - * Cognitive Services Management Client. - */ -package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AadAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AadAuthTypeConnectionProperties.java deleted file mode 100644 index a20be5287163..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AadAuthTypeConnectionProperties.java +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * This connection type covers the AAD auth for any applicable Azure service. - */ -@Fluent -public final class AadAuthTypeConnectionProperties extends ConnectionPropertiesV2 { - /* - * Authentication type of the connection target - */ - private ConnectionAuthType authType = ConnectionAuthType.AAD; - - /** - * Creates an instance of AadAuthTypeConnectionProperties class. - */ - public AadAuthTypeConnectionProperties() { - } - - /** - * Get the authType property: Authentication type of the connection target. - * - * @return the authType value. - */ - @Override - public ConnectionAuthType authType() { - return this.authType; - } - - /** - * {@inheritDoc} - */ - @Override - public AadAuthTypeConnectionProperties withCategory(ConnectionCategory category) { - super.withCategory(category); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AadAuthTypeConnectionProperties withError(String error) { - super.withError(error); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AadAuthTypeConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { - super.withExpiryTime(expiryTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AadAuthTypeConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { - super.withIsSharedToAll(isSharedToAll); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AadAuthTypeConnectionProperties withMetadata(Map metadata) { - super.withMetadata(metadata); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AadAuthTypeConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { - super.withPeRequirement(peRequirement); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AadAuthTypeConnectionProperties withPeStatus(ManagedPEStatus peStatus) { - super.withPeStatus(peStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AadAuthTypeConnectionProperties withSharedUserList(List sharedUserList) { - super.withSharedUserList(sharedUserList); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AadAuthTypeConnectionProperties withTarget(String target) { - super.withTarget(target); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AadAuthTypeConnectionProperties withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { - super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("category", category() == null ? null : category().toString()); - jsonWriter.writeStringField("error", error()); - jsonWriter.writeStringField("expiryTime", - expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); - jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); - jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); - jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); - jsonWriter.writeArrayField("sharedUserList", sharedUserList(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("target", target()); - jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); - jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AadAuthTypeConnectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AadAuthTypeConnectionProperties 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 AadAuthTypeConnectionProperties. - */ - public static AadAuthTypeConnectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AadAuthTypeConnectionProperties deserializedAadAuthTypeConnectionProperties - = new AadAuthTypeConnectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("category".equals(fieldName)) { - deserializedAadAuthTypeConnectionProperties - .withCategory(ConnectionCategory.fromString(reader.getString())); - } else if ("createdByWorkspaceArmId".equals(fieldName)) { - deserializedAadAuthTypeConnectionProperties.withCreatedByWorkspaceArmId(reader.getString()); - } else if ("error".equals(fieldName)) { - deserializedAadAuthTypeConnectionProperties.withError(reader.getString()); - } else if ("expiryTime".equals(fieldName)) { - deserializedAadAuthTypeConnectionProperties.withExpiryTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("group".equals(fieldName)) { - deserializedAadAuthTypeConnectionProperties - .withGroup(ConnectionGroup.fromString(reader.getString())); - } else if ("isSharedToAll".equals(fieldName)) { - deserializedAadAuthTypeConnectionProperties - .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); - } else if ("metadata".equals(fieldName)) { - Map metadata = reader.readMap(reader1 -> reader1.getString()); - deserializedAadAuthTypeConnectionProperties.withMetadata(metadata); - } else if ("peRequirement".equals(fieldName)) { - deserializedAadAuthTypeConnectionProperties - .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); - } else if ("peStatus".equals(fieldName)) { - deserializedAadAuthTypeConnectionProperties - .withPeStatus(ManagedPEStatus.fromString(reader.getString())); - } else if ("sharedUserList".equals(fieldName)) { - List sharedUserList = reader.readArray(reader1 -> reader1.getString()); - deserializedAadAuthTypeConnectionProperties.withSharedUserList(sharedUserList); - } else if ("target".equals(fieldName)) { - deserializedAadAuthTypeConnectionProperties.withTarget(reader.getString()); - } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { - deserializedAadAuthTypeConnectionProperties - .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); - } else if ("authType".equals(fieldName)) { - deserializedAadAuthTypeConnectionProperties.authType - = ConnectionAuthType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAadAuthTypeConnectionProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenalty.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenalty.java deleted file mode 100644 index d14625be0407..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenalty.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * The abuse penalty. - */ -@Immutable -public final class AbusePenalty implements JsonSerializable { - /* - * The action of AbusePenalty. - */ - private AbusePenaltyAction action; - - /* - * The percentage of rate limit. - */ - private Float rateLimitPercentage; - - /* - * The datetime of expiration of the AbusePenalty. - */ - private OffsetDateTime expiration; - - /** - * Creates an instance of AbusePenalty class. - */ - private AbusePenalty() { - } - - /** - * Get the action property: The action of AbusePenalty. - * - * @return the action value. - */ - public AbusePenaltyAction action() { - return this.action; - } - - /** - * Get the rateLimitPercentage property: The percentage of rate limit. - * - * @return the rateLimitPercentage value. - */ - public Float rateLimitPercentage() { - return this.rateLimitPercentage; - } - - /** - * Get the expiration property: The datetime of expiration of the AbusePenalty. - * - * @return the expiration value. - */ - public OffsetDateTime expiration() { - return this.expiration; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); - jsonWriter.writeNumberField("rateLimitPercentage", this.rateLimitPercentage); - jsonWriter.writeStringField("expiration", - this.expiration == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiration)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AbusePenalty from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AbusePenalty 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 AbusePenalty. - */ - public static AbusePenalty fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AbusePenalty deserializedAbusePenalty = new AbusePenalty(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("action".equals(fieldName)) { - deserializedAbusePenalty.action = AbusePenaltyAction.fromString(reader.getString()); - } else if ("rateLimitPercentage".equals(fieldName)) { - deserializedAbusePenalty.rateLimitPercentage = reader.getNullable(JsonReader::getFloat); - } else if ("expiration".equals(fieldName)) { - deserializedAbusePenalty.expiration = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedAbusePenalty; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenaltyAction.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenaltyAction.java deleted file mode 100644 index b469f4f45628..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenaltyAction.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The action of AbusePenalty. - */ -public final class AbusePenaltyAction extends ExpandableStringEnum { - /** - * Static value Throttle for AbusePenaltyAction. - */ - public static final AbusePenaltyAction THROTTLE = fromString("Throttle"); - - /** - * Static value Block for AbusePenaltyAction. - */ - public static final AbusePenaltyAction BLOCK = fromString("Block"); - - /** - * Creates a new instance of AbusePenaltyAction value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AbusePenaltyAction() { - } - - /** - * Creates or finds a AbusePenaltyAction from its string representation. - * - * @param name a name to look for. - * @return the corresponding AbusePenaltyAction. - */ - public static AbusePenaltyAction fromString(String name) { - return fromString(name, AbusePenaltyAction.class); - } - - /** - * Gets known AbusePenaltyAction values. - * - * @return known AbusePenaltyAction values. - */ - public static Collection values() { - return values(AbusePenaltyAction.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccessKeyAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccessKeyAuthTypeConnectionProperties.java deleted file mode 100644 index c9c7787471f1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccessKeyAuthTypeConnectionProperties.java +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * The AccessKeyAuthTypeConnectionProperties model. - */ -@Fluent -public final class AccessKeyAuthTypeConnectionProperties extends ConnectionPropertiesV2 { - /* - * Authentication type of the connection target - */ - private ConnectionAuthType authType = ConnectionAuthType.ACCESS_KEY; - - /* - * The credentials property. - */ - private ConnectionAccessKey credentials; - - /** - * Creates an instance of AccessKeyAuthTypeConnectionProperties class. - */ - public AccessKeyAuthTypeConnectionProperties() { - } - - /** - * Get the authType property: Authentication type of the connection target. - * - * @return the authType value. - */ - @Override - public ConnectionAuthType authType() { - return this.authType; - } - - /** - * Get the credentials property: The credentials property. - * - * @return the credentials value. - */ - public ConnectionAccessKey credentials() { - return this.credentials; - } - - /** - * Set the credentials property: The credentials property. - * - * @param credentials the credentials value to set. - * @return the AccessKeyAuthTypeConnectionProperties object itself. - */ - public AccessKeyAuthTypeConnectionProperties withCredentials(ConnectionAccessKey credentials) { - this.credentials = credentials; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccessKeyAuthTypeConnectionProperties withCategory(ConnectionCategory category) { - super.withCategory(category); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccessKeyAuthTypeConnectionProperties withError(String error) { - super.withError(error); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccessKeyAuthTypeConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { - super.withExpiryTime(expiryTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccessKeyAuthTypeConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { - super.withIsSharedToAll(isSharedToAll); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccessKeyAuthTypeConnectionProperties withMetadata(Map metadata) { - super.withMetadata(metadata); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccessKeyAuthTypeConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { - super.withPeRequirement(peRequirement); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccessKeyAuthTypeConnectionProperties withPeStatus(ManagedPEStatus peStatus) { - super.withPeStatus(peStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccessKeyAuthTypeConnectionProperties withSharedUserList(List sharedUserList) { - super.withSharedUserList(sharedUserList); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccessKeyAuthTypeConnectionProperties withTarget(String target) { - super.withTarget(target); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccessKeyAuthTypeConnectionProperties withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { - super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("category", category() == null ? null : category().toString()); - jsonWriter.writeStringField("error", error()); - jsonWriter.writeStringField("expiryTime", - expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); - jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); - jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); - jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); - jsonWriter.writeArrayField("sharedUserList", sharedUserList(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("target", target()); - jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); - jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); - jsonWriter.writeJsonField("credentials", this.credentials); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AccessKeyAuthTypeConnectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AccessKeyAuthTypeConnectionProperties 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 AccessKeyAuthTypeConnectionProperties. - */ - public static AccessKeyAuthTypeConnectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AccessKeyAuthTypeConnectionProperties deserializedAccessKeyAuthTypeConnectionProperties - = new AccessKeyAuthTypeConnectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("category".equals(fieldName)) { - deserializedAccessKeyAuthTypeConnectionProperties - .withCategory(ConnectionCategory.fromString(reader.getString())); - } else if ("createdByWorkspaceArmId".equals(fieldName)) { - deserializedAccessKeyAuthTypeConnectionProperties.withCreatedByWorkspaceArmId(reader.getString()); - } else if ("error".equals(fieldName)) { - deserializedAccessKeyAuthTypeConnectionProperties.withError(reader.getString()); - } else if ("expiryTime".equals(fieldName)) { - deserializedAccessKeyAuthTypeConnectionProperties.withExpiryTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("group".equals(fieldName)) { - deserializedAccessKeyAuthTypeConnectionProperties - .withGroup(ConnectionGroup.fromString(reader.getString())); - } else if ("isSharedToAll".equals(fieldName)) { - deserializedAccessKeyAuthTypeConnectionProperties - .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); - } else if ("metadata".equals(fieldName)) { - Map metadata = reader.readMap(reader1 -> reader1.getString()); - deserializedAccessKeyAuthTypeConnectionProperties.withMetadata(metadata); - } else if ("peRequirement".equals(fieldName)) { - deserializedAccessKeyAuthTypeConnectionProperties - .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); - } else if ("peStatus".equals(fieldName)) { - deserializedAccessKeyAuthTypeConnectionProperties - .withPeStatus(ManagedPEStatus.fromString(reader.getString())); - } else if ("sharedUserList".equals(fieldName)) { - List sharedUserList = reader.readArray(reader1 -> reader1.getString()); - deserializedAccessKeyAuthTypeConnectionProperties.withSharedUserList(sharedUserList); - } else if ("target".equals(fieldName)) { - deserializedAccessKeyAuthTypeConnectionProperties.withTarget(reader.getString()); - } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { - deserializedAccessKeyAuthTypeConnectionProperties - .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); - } else if ("authType".equals(fieldName)) { - deserializedAccessKeyAuthTypeConnectionProperties.authType - = ConnectionAuthType.fromString(reader.getString()); - } else if ("credentials".equals(fieldName)) { - deserializedAccessKeyAuthTypeConnectionProperties.credentials - = ConnectionAccessKey.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAccessKeyAuthTypeConnectionProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Account.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Account.java deleted file mode 100644 index 3cbde0e79e98..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Account.java +++ /dev/null @@ -1,442 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountInner; -import java.util.Map; - -/** - * An immutable client-side representation of Account. - */ -public interface Account { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Properties of Cognitive Services account. - * - * @return the properties value. - */ - AccountProperties properties(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the etag property: Resource Etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the kind property: The kind (type) of cognitive service account. - * - * @return the kind value. - */ - String kind(); - - /** - * Gets the sku property: The resource model definition representing SKU. - * - * @return the sku value. - */ - Sku sku(); - - /** - * Gets the identity property: Identity for the resource. - * - * @return the identity value. - */ - Identity identity(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.AccountInner object. - * - * @return the inner object. - */ - AccountInner innerModel(); - - /** - * The entirety of the Account definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { - } - - /** - * The Account definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the Account definition. - */ - interface Blank extends WithResourceGroup { - } - - /** - * The stage of the Account definition allowing to specify parent resource. - */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @return the next definition stage. - */ - WithCreate withExistingResourceGroup(String resourceGroupName); - } - - /** - * The stage of the Account 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.WithLocation, DefinitionStages.WithTags, DefinitionStages.WithProperties, - DefinitionStages.WithKind, DefinitionStages.WithSku, DefinitionStages.WithIdentity { - /** - * Executes the create request. - * - * @return the created resource. - */ - Account create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Account create(Context context); - } - - /** - * The stage of the Account definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(String location); - } - - /** - * The stage of the Account definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the Account definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of Cognitive Services account.. - * - * @param properties Properties of Cognitive Services account. - * @return the next definition stage. - */ - WithCreate withProperties(AccountProperties properties); - } - - /** - * The stage of the Account definition allowing to specify kind. - */ - interface WithKind { - /** - * Specifies the kind property: The kind (type) of cognitive service account.. - * - * @param kind The kind (type) of cognitive service account. - * @return the next definition stage. - */ - WithCreate withKind(String kind); - } - - /** - * The stage of the Account definition allowing to specify sku. - */ - interface WithSku { - /** - * Specifies the sku property: The resource model definition representing SKU. - * - * @param sku The resource model definition representing SKU. - * @return the next definition stage. - */ - WithCreate withSku(Sku sku); - } - - /** - * The stage of the Account definition allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: Identity for the resource.. - * - * @param identity Identity for the resource. - * @return the next definition stage. - */ - WithCreate withIdentity(Identity identity); - } - } - - /** - * Begins update for the Account resource. - * - * @return the stage of resource update. - */ - Account.Update update(); - - /** - * The template for Account update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithKind, - UpdateStages.WithSku, UpdateStages.WithIdentity { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Account apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Account apply(Context context); - } - - /** - * The Account update stages. - */ - interface UpdateStages { - /** - * The stage of the Account update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the Account update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of Cognitive Services account.. - * - * @param properties Properties of Cognitive Services account. - * @return the next definition stage. - */ - Update withProperties(AccountProperties properties); - } - - /** - * The stage of the Account update allowing to specify kind. - */ - interface WithKind { - /** - * Specifies the kind property: The kind (type) of cognitive service account.. - * - * @param kind The kind (type) of cognitive service account. - * @return the next definition stage. - */ - Update withKind(String kind); - } - - /** - * The stage of the Account update allowing to specify sku. - */ - interface WithSku { - /** - * Specifies the sku property: The resource model definition representing SKU. - * - * @param sku The resource model definition representing SKU. - * @return the next definition stage. - */ - Update withSku(Sku sku); - } - - /** - * The stage of the Account update allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: Identity for the resource.. - * - * @param identity Identity for the resource. - * @return the next definition stage. - */ - Update withIdentity(Identity identity); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Account refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Account refresh(Context context); - - /** - * Lists the account keys for the specified Cognitive Services account. - * - * @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 access keys for the cognitive services account along with {@link Response}. - */ - Response listKeysWithResponse(Context context); - - /** - * Lists the account keys for the specified Cognitive Services account. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the access keys for the cognitive services account. - */ - ApiKeys listKeys(); - - /** - * Regenerates the specified account key for the specified Cognitive Services account. - * - * @param parameters regenerate key parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the access keys for the cognitive services account along with {@link Response}. - */ - Response regenerateKeyWithResponse(RegenerateKeyParameters parameters, Context context); - - /** - * Regenerates the specified account key for the specified Cognitive Services account. - * - * @param parameters regenerate key parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the access keys for the cognitive services account. - */ - ApiKeys regenerateKey(RegenerateKeyParameters parameters); - - /** - * Evaluate Azure Policy compliance for a set of hypothetical deployments without creating them. - * - * @param body The content of the action request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response body for the evaluateDeploymentPolicies action along with {@link Response}. - */ - Response - evaluateDeploymentPoliciesWithResponse(EvaluateDeploymentPoliciesRequest body, Context context); - - /** - * Evaluate Azure Policy compliance for a set of hypothetical deployments without creating them. - * - * @param body The content of the action request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response body for the evaluateDeploymentPolicies action. - */ - EvaluateDeploymentPoliciesResponse evaluateDeploymentPolicies(EvaluateDeploymentPoliciesRequest body); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountCapabilityHosts.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountCapabilityHosts.java deleted file mode 100644 index edf68eb2a3c2..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountCapabilityHosts.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 AccountCapabilityHosts. - */ -public interface AccountCapabilityHosts { - /** - * Get account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 account capabilityHost along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, String capabilityHostName, - Context context); - - /** - * Get account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 account capabilityHost. - */ - CapabilityHost get(String resourceGroupName, String accountName, String capabilityHostName); - - /** - * Delete account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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. - */ - void delete(String resourceGroupName, String accountName, String capabilityHostName); - - /** - * Delete account capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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. - */ - void delete(String resourceGroupName, String accountName, String capabilityHostName, Context context); - - /** - * List capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 paginated list of Capability Host entities as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName); - - /** - * List capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 paginated list of Capability Host entities as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, Context context); - - /** - * Get account capabilityHost. - * - * @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 account capabilityHost along with {@link Response}. - */ - CapabilityHost getById(String id); - - /** - * Get account capabilityHost. - * - * @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 account capabilityHost along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete account capabilityHost. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete account capabilityHost. - * - * @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 CapabilityHost resource. - * - * @param name resource name. - * @return the first stage of the new CapabilityHost definition. - */ - CapabilityHost.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountConnections.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountConnections.java deleted file mode 100644 index 44119d8900fd..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountConnections.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; - -/** - * Resource collection API of AccountConnections. - */ -public interface AccountConnections { - /** - * Lists Cognitive Services account connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @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 connection base resource schema along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, - String connectionName, Context context); - - /** - * Lists Cognitive Services account connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. - */ - ConnectionPropertiesV2BasicResource get(String resourceGroupName, String accountName, String connectionName); - - /** - * Create or update Cognitive Services account connection under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @param connection The object for creating or updating a new account connection. - * @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 connection base resource schema along with {@link Response}. - */ - Response createWithResponse(String resourceGroupName, String accountName, - String connectionName, ConnectionPropertiesV2BasicResourceInner connection, Context context); - - /** - * Create or update Cognitive Services account connection under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. - */ - ConnectionPropertiesV2BasicResource create(String resourceGroupName, String accountName, String connectionName); - - /** - * Update Cognitive Services account connection under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @param connection Parameters for account connection update. - * @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 connection base resource schema along with {@link Response}. - */ - Response updateWithResponse(String resourceGroupName, String accountName, - String connectionName, ConnectionUpdateContent connection, Context context); - - /** - * Update Cognitive Services account connection under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. - */ - ConnectionPropertiesV2BasicResource update(String resourceGroupName, String accountName, String connectionName); - - /** - * Delete Cognitive Services account connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String resourceGroupName, String accountName, String connectionName, - Context context); - - /** - * Delete Cognitive Services account connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String connectionName); - - /** - * Lists all the available Cognitive Services account connections under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Lists all the available Cognitive Services account connections under the specified account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param target Target of the connection. - * @param category Category of the connection. - * @param includeAll query parameter that indicates if get connection call should return both connections and - * datastores. - * @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 paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, String target, - String category, Boolean includeAll, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountKeyAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountKeyAuthTypeConnectionProperties.java deleted file mode 100644 index 714640224a1d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountKeyAuthTypeConnectionProperties.java +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * This connection type covers the account key connection for Azure storage. - */ -@Fluent -public final class AccountKeyAuthTypeConnectionProperties extends ConnectionPropertiesV2 { - /* - * Authentication type of the connection target - */ - private ConnectionAuthType authType = ConnectionAuthType.ACCOUNT_KEY; - - /* - * Account key object for connection credential. - */ - private ConnectionAccountKey credentials; - - /** - * Creates an instance of AccountKeyAuthTypeConnectionProperties class. - */ - public AccountKeyAuthTypeConnectionProperties() { - } - - /** - * Get the authType property: Authentication type of the connection target. - * - * @return the authType value. - */ - @Override - public ConnectionAuthType authType() { - return this.authType; - } - - /** - * Get the credentials property: Account key object for connection credential. - * - * @return the credentials value. - */ - public ConnectionAccountKey credentials() { - return this.credentials; - } - - /** - * Set the credentials property: Account key object for connection credential. - * - * @param credentials the credentials value to set. - * @return the AccountKeyAuthTypeConnectionProperties object itself. - */ - public AccountKeyAuthTypeConnectionProperties withCredentials(ConnectionAccountKey credentials) { - this.credentials = credentials; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccountKeyAuthTypeConnectionProperties withCategory(ConnectionCategory category) { - super.withCategory(category); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccountKeyAuthTypeConnectionProperties withError(String error) { - super.withError(error); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccountKeyAuthTypeConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { - super.withExpiryTime(expiryTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccountKeyAuthTypeConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { - super.withIsSharedToAll(isSharedToAll); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccountKeyAuthTypeConnectionProperties withMetadata(Map metadata) { - super.withMetadata(metadata); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccountKeyAuthTypeConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { - super.withPeRequirement(peRequirement); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccountKeyAuthTypeConnectionProperties withPeStatus(ManagedPEStatus peStatus) { - super.withPeStatus(peStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccountKeyAuthTypeConnectionProperties withSharedUserList(List sharedUserList) { - super.withSharedUserList(sharedUserList); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccountKeyAuthTypeConnectionProperties withTarget(String target) { - super.withTarget(target); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccountKeyAuthTypeConnectionProperties withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { - super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("category", category() == null ? null : category().toString()); - jsonWriter.writeStringField("error", error()); - jsonWriter.writeStringField("expiryTime", - expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); - jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); - jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); - jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); - jsonWriter.writeArrayField("sharedUserList", sharedUserList(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("target", target()); - jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); - jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); - jsonWriter.writeJsonField("credentials", this.credentials); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AccountKeyAuthTypeConnectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AccountKeyAuthTypeConnectionProperties 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 AccountKeyAuthTypeConnectionProperties. - */ - public static AccountKeyAuthTypeConnectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AccountKeyAuthTypeConnectionProperties deserializedAccountKeyAuthTypeConnectionProperties - = new AccountKeyAuthTypeConnectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("category".equals(fieldName)) { - deserializedAccountKeyAuthTypeConnectionProperties - .withCategory(ConnectionCategory.fromString(reader.getString())); - } else if ("createdByWorkspaceArmId".equals(fieldName)) { - deserializedAccountKeyAuthTypeConnectionProperties.withCreatedByWorkspaceArmId(reader.getString()); - } else if ("error".equals(fieldName)) { - deserializedAccountKeyAuthTypeConnectionProperties.withError(reader.getString()); - } else if ("expiryTime".equals(fieldName)) { - deserializedAccountKeyAuthTypeConnectionProperties.withExpiryTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("group".equals(fieldName)) { - deserializedAccountKeyAuthTypeConnectionProperties - .withGroup(ConnectionGroup.fromString(reader.getString())); - } else if ("isSharedToAll".equals(fieldName)) { - deserializedAccountKeyAuthTypeConnectionProperties - .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); - } else if ("metadata".equals(fieldName)) { - Map metadata = reader.readMap(reader1 -> reader1.getString()); - deserializedAccountKeyAuthTypeConnectionProperties.withMetadata(metadata); - } else if ("peRequirement".equals(fieldName)) { - deserializedAccountKeyAuthTypeConnectionProperties - .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); - } else if ("peStatus".equals(fieldName)) { - deserializedAccountKeyAuthTypeConnectionProperties - .withPeStatus(ManagedPEStatus.fromString(reader.getString())); - } else if ("sharedUserList".equals(fieldName)) { - List sharedUserList = reader.readArray(reader1 -> reader1.getString()); - deserializedAccountKeyAuthTypeConnectionProperties.withSharedUserList(sharedUserList); - } else if ("target".equals(fieldName)) { - deserializedAccountKeyAuthTypeConnectionProperties.withTarget(reader.getString()); - } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { - deserializedAccountKeyAuthTypeConnectionProperties - .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); - } else if ("authType".equals(fieldName)) { - deserializedAccountKeyAuthTypeConnectionProperties.authType - = ConnectionAuthType.fromString(reader.getString()); - } else if ("credentials".equals(fieldName)) { - deserializedAccountKeyAuthTypeConnectionProperties.credentials - = ConnectionAccountKey.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAccountKeyAuthTypeConnectionProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountModel.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountModel.java deleted file mode 100644 index 18adddf7e032..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountModel.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountModelInner; -import java.util.List; -import java.util.Map; - -/** - * An immutable client-side representation of AccountModel. - */ -public interface AccountModel { - /** - * Gets the publisher property: Deployment model publisher. - * - * @return the publisher value. - */ - String publisher(); - - /** - * Gets the format property: Deployment model format. - * - * @return the format value. - */ - String format(); - - /** - * Gets the name property: Deployment model name. - * - * @return the name value. - */ - String name(); - - /** - * Gets the version property: Optional. Deployment model version. If version is not specified, a default version - * will be assigned. The default version is different for different models and might change when there is new - * version available for a model. Default version for a model could be found from list models API. - * - * @return the version value. - */ - String version(); - - /** - * Gets the source property: Optional. Deployment model source ARM resource ID. - * - * @return the source value. - */ - String source(); - - /** - * Gets the sourceAccount property: Optional. Source of the model, another Microsoft.CognitiveServices accounts ARM - * resource ID. - * - * @return the sourceAccount value. - */ - String sourceAccount(); - - /** - * Gets the callRateLimit property: The call rate limit Cognitive Services account. - * - * @return the callRateLimit value. - */ - CallRateLimit callRateLimit(); - - /** - * Gets the baseModel property: Properties of Cognitive Services account deployment model. - * - * @return the baseModel value. - */ - DeploymentModel baseModel(); - - /** - * Gets the isDefaultVersion property: If the model is default version. - * - * @return the isDefaultVersion value. - */ - Boolean isDefaultVersion(); - - /** - * Gets the skus property: The list of Model Sku. - * - * @return the skus value. - */ - List skus(); - - /** - * Gets the maxCapacity property: The max capacity. - * - * @return the maxCapacity value. - */ - Integer maxCapacity(); - - /** - * Gets the capabilities property: The capabilities. - * - * @return the capabilities value. - */ - Map capabilities(); - - /** - * Gets the finetuneCapabilities property: The capabilities for finetune models. - * - * @return the finetuneCapabilities value. - */ - Map finetuneCapabilities(); - - /** - * Gets the deprecation property: Cognitive Services account ModelDeprecationInfo. - * - * @return the deprecation value. - */ - ModelDeprecationInfo deprecation(); - - /** - * Gets the replacementConfig property: Configuration for model replacement. - * - * @return the replacementConfig value. - */ - ReplacementConfig replacementConfig(); - - /** - * Gets the modelCatalogAssetId property: Asset identifier for the model in the model catalog. - * - * @return the modelCatalogAssetId value. - */ - String modelCatalogAssetId(); - - /** - * Gets the lifecycleStatus property: Model lifecycle status. - * - * @return the lifecycleStatus value. - */ - ModelLifecycleStatus lifecycleStatus(); - - /** - * 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.cognitiveservices.fluent.models.AccountModelInner object. - * - * @return the inner object. - */ - AccountModelInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountProperties.java deleted file mode 100644 index 70800672ab5f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountProperties.java +++ /dev/null @@ -1,922 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.models.PrivateEndpointConnectionInner; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * Properties of Cognitive Services account. - */ -@Fluent -public final class AccountProperties implements JsonSerializable { - /* - * Gets the status of the cognitive services account at the time the operation was called. - */ - private ProvisioningState provisioningState; - - /* - * Endpoint of the created account. - */ - private String endpoint; - - /* - * The internal identifier (deprecated, do not use this property). - */ - private String internalId; - - /* - * Gets the capabilities of the cognitive services account. Each item indicates the capability of a specific - * feature. The values are read-only and for reference only. - */ - private List capabilities; - - /* - * If the resource is migrated from an existing key. - */ - private Boolean isMigrated; - - /* - * Resource migration token. - */ - private String migrationToken; - - /* - * Sku change info of account. - */ - private SkuChangeInfo skuChangeInfo; - - /* - * Optional subdomain name used for token-based authentication. - */ - private String customSubDomainName; - - /* - * A collection of rules governing the accessibility from specific network locations. - */ - private NetworkRuleSet networkAcls; - - /* - * The encryption properties for this resource. - */ - private Encryption encryption; - - /* - * The storage accounts for this resource. - */ - private List userOwnedStorage; - - /* - * The user owned AML account properties. - */ - private UserOwnedAmlWorkspace amlWorkspace; - - /* - * The private endpoint connection associated with the Cognitive Services account. - */ - private List privateEndpointConnections; - - /* - * Whether or not public endpoint access is allowed for this account. - */ - private PublicNetworkAccess publicNetworkAccess; - - /* - * The api properties for special APIs. - */ - private ApiProperties apiProperties; - - /* - * Gets the date of cognitive services account creation. - */ - private String dateCreated; - - /* - * The call rate limit Cognitive Services account. - */ - private CallRateLimit callRateLimit; - - /* - * The flag to enable dynamic throttling. - */ - private Boolean dynamicThrottlingEnabled; - - /* - * The flag to disable stored completions. - */ - private Boolean storedCompletionsDisabled; - - /* - * The quotaLimit property. - */ - private QuotaLimit quotaLimit; - - /* - * The restrictOutboundNetworkAccess property. - */ - private Boolean restrictOutboundNetworkAccess; - - /* - * The allowedFqdnList property. - */ - private List allowedFqdnList; - - /* - * The disableLocalAuth property. - */ - private Boolean disableLocalAuth; - - /* - * Dictionary of - */ - private Map endpoints; - - /* - * The restore property. - */ - private Boolean restore; - - /* - * The deletion date, only available for deleted account. - */ - private String deletionDate; - - /* - * The scheduled purge date, only available for deleted account. - */ - private String scheduledPurgeDate; - - /* - * The multiregion settings of Cognitive Services account. - */ - private MultiRegionSettings locations; - - /* - * The commitment plan associations of Cognitive Services account. - */ - private List commitmentPlanAssociations; - - /* - * The abuse penalty. - */ - private AbusePenalty abusePenalty; - - /* - * Cognitive Services Rai Monitor Config. - */ - private RaiMonitorConfig raiMonitorConfig; - - /* - * The networkInjections property. - */ - private List networkInjections; - - /* - * Represents the foundry auto-upgrade configuration for a Cognitive Services account. - */ - private FoundryAutoUpgrade foundryAutoUpgrade; - - /* - * Specifies whether this resource support project management as child resources, used as containers for access - * management, data isolation and cost in AI Foundry. - */ - private Boolean allowProjectManagement; - - /* - * Specifies the project, by project name, that is targeted when data plane endpoints are called without a project - * parameter. - */ - private String defaultProject; - - /* - * Specifies the projects, by project name, that are associated with this resource. - */ - private List associatedProjects; - - /** - * Creates an instance of AccountProperties class. - */ - public AccountProperties() { - } - - /** - * Get the provisioningState property: Gets the status of the cognitive services account at the time the operation - * was called. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the endpoint property: Endpoint of the created account. - * - * @return the endpoint value. - */ - public String endpoint() { - return this.endpoint; - } - - /** - * Get the internalId property: The internal identifier (deprecated, do not use this property). - * - * @return the internalId value. - */ - public String internalId() { - return this.internalId; - } - - /** - * Get the capabilities property: Gets the capabilities of the cognitive services account. Each item indicates the - * capability of a specific feature. The values are read-only and for reference only. - * - * @return the capabilities value. - */ - public List capabilities() { - return this.capabilities; - } - - /** - * Get the isMigrated property: If the resource is migrated from an existing key. - * - * @return the isMigrated value. - */ - public Boolean isMigrated() { - return this.isMigrated; - } - - /** - * Get the migrationToken property: Resource migration token. - * - * @return the migrationToken value. - */ - public String migrationToken() { - return this.migrationToken; - } - - /** - * Set the migrationToken property: Resource migration token. - * - * @param migrationToken the migrationToken value to set. - * @return the AccountProperties object itself. - */ - public AccountProperties withMigrationToken(String migrationToken) { - this.migrationToken = migrationToken; - return this; - } - - /** - * Get the skuChangeInfo property: Sku change info of account. - * - * @return the skuChangeInfo value. - */ - public SkuChangeInfo skuChangeInfo() { - return this.skuChangeInfo; - } - - /** - * Get the customSubDomainName property: Optional subdomain name used for token-based authentication. - * - * @return the customSubDomainName value. - */ - public String customSubDomainName() { - return this.customSubDomainName; - } - - /** - * Set the customSubDomainName property: Optional subdomain name used for token-based authentication. - * - * @param customSubDomainName the customSubDomainName value to set. - * @return the AccountProperties object itself. - */ - public AccountProperties withCustomSubDomainName(String customSubDomainName) { - this.customSubDomainName = customSubDomainName; - return this; - } - - /** - * Get the networkAcls property: A collection of rules governing the accessibility from specific network locations. - * - * @return the networkAcls value. - */ - public NetworkRuleSet networkAcls() { - return this.networkAcls; - } - - /** - * Set the networkAcls property: A collection of rules governing the accessibility from specific network locations. - * - * @param networkAcls the networkAcls value to set. - * @return the AccountProperties object itself. - */ - public AccountProperties withNetworkAcls(NetworkRuleSet networkAcls) { - this.networkAcls = networkAcls; - return this; - } - - /** - * Get the encryption property: The encryption properties for this resource. - * - * @return the encryption value. - */ - public Encryption encryption() { - return this.encryption; - } - - /** - * Set the encryption property: The encryption properties for this resource. - * - * @param encryption the encryption value to set. - * @return the AccountProperties object itself. - */ - public AccountProperties withEncryption(Encryption encryption) { - this.encryption = encryption; - return this; - } - - /** - * Get the userOwnedStorage property: The storage accounts for this resource. - * - * @return the userOwnedStorage value. - */ - public List userOwnedStorage() { - return this.userOwnedStorage; - } - - /** - * Set the userOwnedStorage property: The storage accounts for this resource. - * - * @param userOwnedStorage the userOwnedStorage value to set. - * @return the AccountProperties object itself. - */ - public AccountProperties withUserOwnedStorage(List userOwnedStorage) { - this.userOwnedStorage = userOwnedStorage; - return this; - } - - /** - * Get the amlWorkspace property: The user owned AML account properties. - * - * @return the amlWorkspace value. - */ - public UserOwnedAmlWorkspace amlWorkspace() { - return this.amlWorkspace; - } - - /** - * Set the amlWorkspace property: The user owned AML account properties. - * - * @param amlWorkspace the amlWorkspace value to set. - * @return the AccountProperties object itself. - */ - public AccountProperties withAmlWorkspace(UserOwnedAmlWorkspace amlWorkspace) { - this.amlWorkspace = amlWorkspace; - return this; - } - - /** - * Get the privateEndpointConnections property: The private endpoint connection associated with the Cognitive - * Services account. - * - * @return the privateEndpointConnections value. - */ - public List privateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** - * Get the publicNetworkAccess property: Whether or not public endpoint access is allowed for this account. - * - * @return the publicNetworkAccess value. - */ - public PublicNetworkAccess publicNetworkAccess() { - return this.publicNetworkAccess; - } - - /** - * Set the publicNetworkAccess property: Whether or not public endpoint access is allowed for this account. - * - * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the AccountProperties object itself. - */ - public AccountProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { - this.publicNetworkAccess = publicNetworkAccess; - return this; - } - - /** - * Get the apiProperties property: The api properties for special APIs. - * - * @return the apiProperties value. - */ - public ApiProperties apiProperties() { - return this.apiProperties; - } - - /** - * Set the apiProperties property: The api properties for special APIs. - * - * @param apiProperties the apiProperties value to set. - * @return the AccountProperties object itself. - */ - public AccountProperties withApiProperties(ApiProperties apiProperties) { - this.apiProperties = apiProperties; - return this; - } - - /** - * Get the dateCreated property: Gets the date of cognitive services account creation. - * - * @return the dateCreated value. - */ - public String dateCreated() { - return this.dateCreated; - } - - /** - * Get the callRateLimit property: The call rate limit Cognitive Services account. - * - * @return the callRateLimit value. - */ - public CallRateLimit callRateLimit() { - return this.callRateLimit; - } - - /** - * Get the dynamicThrottlingEnabled property: The flag to enable dynamic throttling. - * - * @return the dynamicThrottlingEnabled value. - */ - public Boolean dynamicThrottlingEnabled() { - return this.dynamicThrottlingEnabled; - } - - /** - * Set the dynamicThrottlingEnabled property: The flag to enable dynamic throttling. - * - * @param dynamicThrottlingEnabled the dynamicThrottlingEnabled value to set. - * @return the AccountProperties object itself. - */ - public AccountProperties withDynamicThrottlingEnabled(Boolean dynamicThrottlingEnabled) { - this.dynamicThrottlingEnabled = dynamicThrottlingEnabled; - return this; - } - - /** - * Get the storedCompletionsDisabled property: The flag to disable stored completions. - * - * @return the storedCompletionsDisabled value. - */ - public Boolean storedCompletionsDisabled() { - return this.storedCompletionsDisabled; - } - - /** - * Set the storedCompletionsDisabled property: The flag to disable stored completions. - * - * @param storedCompletionsDisabled the storedCompletionsDisabled value to set. - * @return the AccountProperties object itself. - */ - public AccountProperties withStoredCompletionsDisabled(Boolean storedCompletionsDisabled) { - this.storedCompletionsDisabled = storedCompletionsDisabled; - return this; - } - - /** - * Get the quotaLimit property: The quotaLimit property. - * - * @return the quotaLimit value. - */ - public QuotaLimit quotaLimit() { - return this.quotaLimit; - } - - /** - * Get the restrictOutboundNetworkAccess property: The restrictOutboundNetworkAccess property. - * - * @return the restrictOutboundNetworkAccess value. - */ - public Boolean restrictOutboundNetworkAccess() { - return this.restrictOutboundNetworkAccess; - } - - /** - * Set the restrictOutboundNetworkAccess property: The restrictOutboundNetworkAccess property. - * - * @param restrictOutboundNetworkAccess the restrictOutboundNetworkAccess value to set. - * @return the AccountProperties object itself. - */ - public AccountProperties withRestrictOutboundNetworkAccess(Boolean restrictOutboundNetworkAccess) { - this.restrictOutboundNetworkAccess = restrictOutboundNetworkAccess; - return this; - } - - /** - * Get the allowedFqdnList property: The allowedFqdnList property. - * - * @return the allowedFqdnList value. - */ - public List allowedFqdnList() { - return this.allowedFqdnList; - } - - /** - * Set the allowedFqdnList property: The allowedFqdnList property. - * - * @param allowedFqdnList the allowedFqdnList value to set. - * @return the AccountProperties object itself. - */ - public AccountProperties withAllowedFqdnList(List allowedFqdnList) { - this.allowedFqdnList = allowedFqdnList; - return this; - } - - /** - * Get the disableLocalAuth property: The disableLocalAuth property. - * - * @return the disableLocalAuth value. - */ - public Boolean disableLocalAuth() { - return this.disableLocalAuth; - } - - /** - * Set the disableLocalAuth property: The disableLocalAuth property. - * - * @param disableLocalAuth the disableLocalAuth value to set. - * @return the AccountProperties object itself. - */ - public AccountProperties withDisableLocalAuth(Boolean disableLocalAuth) { - this.disableLocalAuth = disableLocalAuth; - return this; - } - - /** - * Get the endpoints property: Dictionary of <string>. - * - * @return the endpoints value. - */ - public Map endpoints() { - return this.endpoints; - } - - /** - * Get the restore property: The restore property. - * - * @return the restore value. - */ - public Boolean restore() { - return this.restore; - } - - /** - * Set the restore property: The restore property. - * - * @param restore the restore value to set. - * @return the AccountProperties object itself. - */ - public AccountProperties withRestore(Boolean restore) { - this.restore = restore; - return this; - } - - /** - * Get the deletionDate property: The deletion date, only available for deleted account. - * - * @return the deletionDate value. - */ - public String deletionDate() { - return this.deletionDate; - } - - /** - * Get the scheduledPurgeDate property: The scheduled purge date, only available for deleted account. - * - * @return the scheduledPurgeDate value. - */ - public String scheduledPurgeDate() { - return this.scheduledPurgeDate; - } - - /** - * Get the locations property: The multiregion settings of Cognitive Services account. - * - * @return the locations value. - */ - public MultiRegionSettings locations() { - return this.locations; - } - - /** - * Set the locations property: The multiregion settings of Cognitive Services account. - * - * @param locations the locations value to set. - * @return the AccountProperties object itself. - */ - public AccountProperties withLocations(MultiRegionSettings locations) { - this.locations = locations; - return this; - } - - /** - * Get the commitmentPlanAssociations property: The commitment plan associations of Cognitive Services account. - * - * @return the commitmentPlanAssociations value. - */ - public List commitmentPlanAssociations() { - return this.commitmentPlanAssociations; - } - - /** - * Get the abusePenalty property: The abuse penalty. - * - * @return the abusePenalty value. - */ - public AbusePenalty abusePenalty() { - return this.abusePenalty; - } - - /** - * Get the raiMonitorConfig property: Cognitive Services Rai Monitor Config. - * - * @return the raiMonitorConfig value. - */ - public RaiMonitorConfig raiMonitorConfig() { - return this.raiMonitorConfig; - } - - /** - * Set the raiMonitorConfig property: Cognitive Services Rai Monitor Config. - * - * @param raiMonitorConfig the raiMonitorConfig value to set. - * @return the AccountProperties object itself. - */ - public AccountProperties withRaiMonitorConfig(RaiMonitorConfig raiMonitorConfig) { - this.raiMonitorConfig = raiMonitorConfig; - return this; - } - - /** - * Get the networkInjections property: The networkInjections property. - * - * @return the networkInjections value. - */ - public List networkInjections() { - return this.networkInjections; - } - - /** - * Set the networkInjections property: The networkInjections property. - * - * @param networkInjections the networkInjections value to set. - * @return the AccountProperties object itself. - */ - public AccountProperties withNetworkInjections(List networkInjections) { - this.networkInjections = networkInjections; - return this; - } - - /** - * Get the foundryAutoUpgrade property: Represents the foundry auto-upgrade configuration for a Cognitive Services - * account. - * - * @return the foundryAutoUpgrade value. - */ - public FoundryAutoUpgrade foundryAutoUpgrade() { - return this.foundryAutoUpgrade; - } - - /** - * Set the foundryAutoUpgrade property: Represents the foundry auto-upgrade configuration for a Cognitive Services - * account. - * - * @param foundryAutoUpgrade the foundryAutoUpgrade value to set. - * @return the AccountProperties object itself. - */ - public AccountProperties withFoundryAutoUpgrade(FoundryAutoUpgrade foundryAutoUpgrade) { - this.foundryAutoUpgrade = foundryAutoUpgrade; - return this; - } - - /** - * Get the allowProjectManagement property: Specifies whether this resource support project management as child - * resources, used as containers for access management, data isolation and cost in AI Foundry. - * - * @return the allowProjectManagement value. - */ - public Boolean allowProjectManagement() { - return this.allowProjectManagement; - } - - /** - * Set the allowProjectManagement property: Specifies whether this resource support project management as child - * resources, used as containers for access management, data isolation and cost in AI Foundry. - * - * @param allowProjectManagement the allowProjectManagement value to set. - * @return the AccountProperties object itself. - */ - public AccountProperties withAllowProjectManagement(Boolean allowProjectManagement) { - this.allowProjectManagement = allowProjectManagement; - return this; - } - - /** - * Get the defaultProject property: Specifies the project, by project name, that is targeted when data plane - * endpoints are called without a project parameter. - * - * @return the defaultProject value. - */ - public String defaultProject() { - return this.defaultProject; - } - - /** - * Set the defaultProject property: Specifies the project, by project name, that is targeted when data plane - * endpoints are called without a project parameter. - * - * @param defaultProject the defaultProject value to set. - * @return the AccountProperties object itself. - */ - public AccountProperties withDefaultProject(String defaultProject) { - this.defaultProject = defaultProject; - return this; - } - - /** - * Get the associatedProjects property: Specifies the projects, by project name, that are associated with this - * resource. - * - * @return the associatedProjects value. - */ - public List associatedProjects() { - return this.associatedProjects; - } - - /** - * Set the associatedProjects property: Specifies the projects, by project name, that are associated with this - * resource. - * - * @param associatedProjects the associatedProjects value to set. - * @return the AccountProperties object itself. - */ - public AccountProperties withAssociatedProjects(List associatedProjects) { - this.associatedProjects = associatedProjects; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("migrationToken", this.migrationToken); - jsonWriter.writeStringField("customSubDomainName", this.customSubDomainName); - jsonWriter.writeJsonField("networkAcls", this.networkAcls); - jsonWriter.writeJsonField("encryption", this.encryption); - jsonWriter.writeArrayField("userOwnedStorage", this.userOwnedStorage, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("amlWorkspace", this.amlWorkspace); - jsonWriter.writeStringField("publicNetworkAccess", - this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); - jsonWriter.writeJsonField("apiProperties", this.apiProperties); - jsonWriter.writeBooleanField("dynamicThrottlingEnabled", this.dynamicThrottlingEnabled); - jsonWriter.writeBooleanField("storedCompletionsDisabled", this.storedCompletionsDisabled); - jsonWriter.writeBooleanField("restrictOutboundNetworkAccess", this.restrictOutboundNetworkAccess); - jsonWriter.writeArrayField("allowedFqdnList", this.allowedFqdnList, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("disableLocalAuth", this.disableLocalAuth); - jsonWriter.writeBooleanField("restore", this.restore); - jsonWriter.writeJsonField("locations", this.locations); - jsonWriter.writeJsonField("raiMonitorConfig", this.raiMonitorConfig); - jsonWriter.writeArrayField("networkInjections", this.networkInjections, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("foundryAutoUpgrade", this.foundryAutoUpgrade); - jsonWriter.writeBooleanField("allowProjectManagement", this.allowProjectManagement); - jsonWriter.writeStringField("defaultProject", this.defaultProject); - jsonWriter.writeArrayField("associatedProjects", this.associatedProjects, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AccountProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AccountProperties 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 AccountProperties. - */ - public static AccountProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AccountProperties deserializedAccountProperties = new AccountProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningState".equals(fieldName)) { - deserializedAccountProperties.provisioningState = ProvisioningState.fromString(reader.getString()); - } else if ("endpoint".equals(fieldName)) { - deserializedAccountProperties.endpoint = reader.getString(); - } else if ("internalId".equals(fieldName)) { - deserializedAccountProperties.internalId = reader.getString(); - } else if ("capabilities".equals(fieldName)) { - List capabilities = reader.readArray(reader1 -> SkuCapability.fromJson(reader1)); - deserializedAccountProperties.capabilities = capabilities; - } else if ("isMigrated".equals(fieldName)) { - deserializedAccountProperties.isMigrated = reader.getNullable(JsonReader::getBoolean); - } else if ("migrationToken".equals(fieldName)) { - deserializedAccountProperties.migrationToken = reader.getString(); - } else if ("skuChangeInfo".equals(fieldName)) { - deserializedAccountProperties.skuChangeInfo = SkuChangeInfo.fromJson(reader); - } else if ("customSubDomainName".equals(fieldName)) { - deserializedAccountProperties.customSubDomainName = reader.getString(); - } else if ("networkAcls".equals(fieldName)) { - deserializedAccountProperties.networkAcls = NetworkRuleSet.fromJson(reader); - } else if ("encryption".equals(fieldName)) { - deserializedAccountProperties.encryption = Encryption.fromJson(reader); - } else if ("userOwnedStorage".equals(fieldName)) { - List userOwnedStorage - = reader.readArray(reader1 -> UserOwnedStorage.fromJson(reader1)); - deserializedAccountProperties.userOwnedStorage = userOwnedStorage; - } else if ("amlWorkspace".equals(fieldName)) { - deserializedAccountProperties.amlWorkspace = UserOwnedAmlWorkspace.fromJson(reader); - } else if ("privateEndpointConnections".equals(fieldName)) { - List privateEndpointConnections - = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); - deserializedAccountProperties.privateEndpointConnections = privateEndpointConnections; - } else if ("publicNetworkAccess".equals(fieldName)) { - deserializedAccountProperties.publicNetworkAccess - = PublicNetworkAccess.fromString(reader.getString()); - } else if ("apiProperties".equals(fieldName)) { - deserializedAccountProperties.apiProperties = ApiProperties.fromJson(reader); - } else if ("dateCreated".equals(fieldName)) { - deserializedAccountProperties.dateCreated = reader.getString(); - } else if ("callRateLimit".equals(fieldName)) { - deserializedAccountProperties.callRateLimit = CallRateLimit.fromJson(reader); - } else if ("dynamicThrottlingEnabled".equals(fieldName)) { - deserializedAccountProperties.dynamicThrottlingEnabled = reader.getNullable(JsonReader::getBoolean); - } else if ("storedCompletionsDisabled".equals(fieldName)) { - deserializedAccountProperties.storedCompletionsDisabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("quotaLimit".equals(fieldName)) { - deserializedAccountProperties.quotaLimit = QuotaLimit.fromJson(reader); - } else if ("restrictOutboundNetworkAccess".equals(fieldName)) { - deserializedAccountProperties.restrictOutboundNetworkAccess - = reader.getNullable(JsonReader::getBoolean); - } else if ("allowedFqdnList".equals(fieldName)) { - List allowedFqdnList = reader.readArray(reader1 -> reader1.getString()); - deserializedAccountProperties.allowedFqdnList = allowedFqdnList; - } else if ("disableLocalAuth".equals(fieldName)) { - deserializedAccountProperties.disableLocalAuth = reader.getNullable(JsonReader::getBoolean); - } else if ("endpoints".equals(fieldName)) { - Map endpoints = reader.readMap(reader1 -> reader1.getString()); - deserializedAccountProperties.endpoints = endpoints; - } else if ("restore".equals(fieldName)) { - deserializedAccountProperties.restore = reader.getNullable(JsonReader::getBoolean); - } else if ("deletionDate".equals(fieldName)) { - deserializedAccountProperties.deletionDate = reader.getString(); - } else if ("scheduledPurgeDate".equals(fieldName)) { - deserializedAccountProperties.scheduledPurgeDate = reader.getString(); - } else if ("locations".equals(fieldName)) { - deserializedAccountProperties.locations = MultiRegionSettings.fromJson(reader); - } else if ("commitmentPlanAssociations".equals(fieldName)) { - List commitmentPlanAssociations - = reader.readArray(reader1 -> CommitmentPlanAssociation.fromJson(reader1)); - deserializedAccountProperties.commitmentPlanAssociations = commitmentPlanAssociations; - } else if ("abusePenalty".equals(fieldName)) { - deserializedAccountProperties.abusePenalty = AbusePenalty.fromJson(reader); - } else if ("raiMonitorConfig".equals(fieldName)) { - deserializedAccountProperties.raiMonitorConfig = RaiMonitorConfig.fromJson(reader); - } else if ("networkInjections".equals(fieldName)) { - List networkInjections - = reader.readArray(reader1 -> NetworkInjection.fromJson(reader1)); - deserializedAccountProperties.networkInjections = networkInjections; - } else if ("foundryAutoUpgrade".equals(fieldName)) { - deserializedAccountProperties.foundryAutoUpgrade = FoundryAutoUpgrade.fromJson(reader); - } else if ("allowProjectManagement".equals(fieldName)) { - deserializedAccountProperties.allowProjectManagement = reader.getNullable(JsonReader::getBoolean); - } else if ("defaultProject".equals(fieldName)) { - deserializedAccountProperties.defaultProject = reader.getString(); - } else if ("associatedProjects".equals(fieldName)) { - List associatedProjects = reader.readArray(reader1 -> reader1.getString()); - deserializedAccountProperties.associatedProjects = associatedProjects; - } else { - reader.skipChildren(); - } - } - - return deserializedAccountProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountSku.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountSku.java deleted file mode 100644 index 539fdd4a90aa..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountSku.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Cognitive Services resource type and SKU. - */ -@Immutable -public final class AccountSku implements JsonSerializable { - /* - * Resource Namespace and Type - */ - private String resourceType; - - /* - * The SKU of Cognitive Services account. - */ - private Sku sku; - - /** - * Creates an instance of AccountSku class. - */ - private AccountSku() { - } - - /** - * Get the resourceType property: Resource Namespace and Type. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Get the sku property: The SKU of Cognitive Services account. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("resourceType", this.resourceType); - jsonWriter.writeJsonField("sku", this.sku); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AccountSku from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AccountSku 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 AccountSku. - */ - public static AccountSku fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AccountSku deserializedAccountSku = new AccountSku(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceType".equals(fieldName)) { - deserializedAccountSku.resourceType = reader.getString(); - } else if ("sku".equals(fieldName)) { - deserializedAccountSku.sku = Sku.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAccountSku; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountSkuListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountSkuListResult.java deleted file mode 100644 index 08a5aa96c08f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountSkuListResult.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountSkuListResultInner; -import java.util.List; - -/** - * An immutable client-side representation of AccountSkuListResult. - */ -public interface AccountSkuListResult { - /** - * Gets the value property: Gets the list of Cognitive Services accounts and their properties. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.AccountSkuListResultInner object. - * - * @return the inner object. - */ - AccountSkuListResultInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Accounts.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Accounts.java deleted file mode 100644 index 1952da4b0fd3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Accounts.java +++ /dev/null @@ -1,327 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 Accounts. - */ -public interface Accounts { - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU along with {@link Response}. - */ - Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, Context context); - - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU. - */ - Account getByResourceGroup(String resourceGroupName, String accountName); - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 deleteByResourceGroup(String resourceGroupName, String accountName); - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 accountName, Context context); - - /** - * Returns all the resources of a particular type belonging to a resource group. - * - * @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 the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Returns all the resources of a particular type belonging to 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 com.azure.core.management.exception.ManagementException 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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Lists the account keys for the specified Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 access keys for the cognitive services account along with {@link Response}. - */ - Response listKeysWithResponse(String resourceGroupName, String accountName, Context context); - - /** - * Lists the account keys for the specified Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the access keys for the cognitive services account. - */ - ApiKeys listKeys(String resourceGroupName, String accountName); - - /** - * Regenerates the specified account key for the specified Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param parameters regenerate key parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the access keys for the cognitive services account along with {@link Response}. - */ - Response regenerateKeyWithResponse(String resourceGroupName, String accountName, - RegenerateKeyParameters parameters, Context context); - - /** - * Regenerates the specified account key for the specified Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param parameters regenerate key parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the access keys for the cognitive services account. - */ - ApiKeys regenerateKey(String resourceGroupName, String accountName, RegenerateKeyParameters parameters); - - /** - * List available SKUs for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 cognitive services accounts operation response along with {@link Response}. - */ - Response listSkusWithResponse(String resourceGroupName, String accountName, Context context); - - /** - * List available SKUs for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 cognitive services accounts operation response. - */ - AccountSkuListResult listSkus(String resourceGroupName, String accountName); - - /** - * Get usages for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is - * name.value (name of the metric, can have an or of multiple names). - * @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 usages for the requested Cognitive Services account along with {@link Response}. - */ - Response listUsagesWithResponse(String resourceGroupName, String accountName, String filter, - Context context); - - /** - * Get usages for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return usages for the requested Cognitive Services account. - */ - UsageListResult listUsages(String resourceGroupName, String accountName); - - /** - * List available Models for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listModels(String resourceGroupName, String accountName); - - /** - * List available Models for the requested Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listModels(String resourceGroupName, String accountName, Context context); - - /** - * Evaluate Azure Policy compliance for a set of hypothetical deployments without creating them. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param body The content of the action request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response body for the evaluateDeploymentPolicies action along with {@link Response}. - */ - Response evaluateDeploymentPoliciesWithResponse(String resourceGroupName, - String accountName, EvaluateDeploymentPoliciesRequest body, Context context); - - /** - * Evaluate Azure Policy compliance for a set of hypothetical deployments without creating them. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param body The content of the action request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response body for the evaluateDeploymentPolicies action. - */ - EvaluateDeploymentPoliciesResponse evaluateDeploymentPolicies(String resourceGroupName, String accountName, - EvaluateDeploymentPoliciesRequest body); - - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @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 cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU along with {@link Response}. - */ - Account getById(String id); - - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @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 cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @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 a Cognitive Services account from the resource group. - * - * @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 Account resource. - * - * @param name resource name. - * @return the first stage of the new Account definition. - */ - Account.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ActionType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ActionType.java deleted file mode 100644 index 86a39a8fb893..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ActionType.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - */ -public final class ActionType extends ExpandableStringEnum { - /** - * Actions are for internal-only APIs. - */ - public static final ActionType INTERNAL = fromString("Internal"); - - /** - * Creates a new instance of ActionType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ActionType() { - } - - /** - * Creates or finds a ActionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ActionType. - */ - public static ActionType fromString(String name) { - return fromString(name, ActionType.class); - } - - /** - * Gets known ActionType values. - * - * @return known ActionType values. - */ - public static Collection values() { - return values(ActionType.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentApplication.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentApplication.java deleted file mode 100644 index e54bdd12f814..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentApplication.java +++ /dev/null @@ -1,249 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentApplicationInner; - -/** - * An immutable client-side representation of AgentApplication. - */ -public interface AgentApplication { - /** - * 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: [Required] Additional attributes of the entity. - * - * @return the properties value. - */ - AgenticApplicationProperties properties(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.AgentApplicationInner object. - * - * @return the inner object. - */ - AgentApplicationInner innerModel(); - - /** - * The entirety of the AgentApplication definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, DefinitionStages.WithCreate { - } - - /** - * The AgentApplication definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the AgentApplication definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the AgentApplication definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, accountName, projectName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @return the next definition stage. - */ - WithProperties withExistingProject(String resourceGroupName, String accountName, String projectName); - } - - /** - * The stage of the AgentApplication definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: [Required] Additional attributes of the entity.. - * - * @param properties [Required] Additional attributes of the entity. - * @return the next definition stage. - */ - WithCreate withProperties(AgenticApplicationProperties properties); - } - - /** - * The stage of the AgentApplication 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 { - /** - * Executes the create request. - * - * @return the created resource. - */ - AgentApplication create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - AgentApplication create(Context context); - } - } - - /** - * Begins update for the AgentApplication resource. - * - * @return the stage of resource update. - */ - AgentApplication.Update update(); - - /** - * The template for AgentApplication update. - */ - interface Update extends UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - AgentApplication apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - AgentApplication apply(Context context); - } - - /** - * The AgentApplication update stages. - */ - interface UpdateStages { - /** - * The stage of the AgentApplication update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: [Required] Additional attributes of the entity.. - * - * @param properties [Required] Additional attributes of the entity. - * @return the next definition stage. - */ - Update withProperties(AgenticApplicationProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - AgentApplication refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - AgentApplication refresh(Context context); - - /** - * Lists agents for an Agent Application. - * - * @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 paginated list of Agent Reference entities along with {@link Response}. - */ - Response listAgentsWithResponse(Context context); - - /** - * Lists agents for an Agent Application. - * - * @throws com.azure.core.management.exception.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 paginated list of Agent Reference entities. - */ - AgentReferenceResourceArmPaginatedResult listAgents(); - - /** - * Enables an Agent Application. - * - * @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 enableWithResponse(Context context); - - /** - * Enables an Agent Application. - * - * @throws com.azure.core.management.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 enable(); - - /** - * Disables an Agent Application. - * - * @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 disableWithResponse(Context context); - - /** - * Disables an Agent Application. - * - * @throws com.azure.core.management.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 disable(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentApplications.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentApplications.java deleted file mode 100644 index 3218d122e81c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentApplications.java +++ /dev/null @@ -1,249 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import java.util.List; - -/** - * Resource collection API of AgentApplications. - */ -public interface AgentApplications { - /** - * Gets an Agent Application by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @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 Agent Application by name along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, String projectName, - String name, Context context); - - /** - * Gets an Agent Application by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Agent Application by name. - */ - AgentApplication get(String resourceGroupName, String accountName, String projectName, String name); - - /** - * Delete Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String projectName, String name); - - /** - * Delete Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @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 accountName, String projectName, String name, Context context); - - /** - * Lists Agent Applications in the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 paginated list of Agent Application entities as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, String projectName); - - /** - * Lists Agent Applications in the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param count Number of agent applications to be retrieved in a page of results. - * @param skip Number of agent applications to skip. - * @param skipToken Continuation token for pagination. - * @param names Names of agent applications to retrieve. - * @param searchText Search text for filtering agent applications. - * @param orderBy Field to order by. - * @param orderByAsc Whether to order in ascending order. - * @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 paginated list of Agent Application entities as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, String projectName, - Integer count, Integer skip, String skipToken, List names, String searchText, String orderBy, - Boolean orderByAsc, Context context); - - /** - * Lists agents for an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @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 paginated list of Agent Reference entities along with {@link Response}. - */ - Response listAgentsWithResponse(String resourceGroupName, - String accountName, String projectName, String name, Context context); - - /** - * Lists agents for an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 paginated list of Agent Reference entities. - */ - AgentReferenceResourceArmPaginatedResult listAgents(String resourceGroupName, String accountName, - String projectName, String name); - - /** - * Enables an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @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 enableWithResponse(String resourceGroupName, String accountName, String projectName, String name, - Context context); - - /** - * Enables an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 enable(String resourceGroupName, String accountName, String projectName, String name); - - /** - * Disables an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @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 disableWithResponse(String resourceGroupName, String accountName, String projectName, String name, - Context context); - - /** - * Disables an Agent Application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param name Name for the Agent Application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 disable(String resourceGroupName, String accountName, String projectName, String name); - - /** - * Gets an Agent Application by name. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Agent Application by name along with {@link Response}. - */ - AgentApplication getById(String id); - - /** - * Gets an Agent Application by name. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Agent Application by name along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete Agent Application. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete Agent Application. - * - * @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 AgentApplication resource. - * - * @param name resource name. - * @return the first stage of the new AgentApplication definition. - */ - AgentApplication.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeployment.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeployment.java deleted file mode 100644 index 4c2453c11fe1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeployment.java +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentDeploymentInner; - -/** - * An immutable client-side representation of AgentDeployment. - */ -public interface AgentDeployment { - /** - * 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: [Required] Additional attributes of the entity. - * - * @return the properties value. - */ - AgentDeploymentProperties properties(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.AgentDeploymentInner object. - * - * @return the inner object. - */ - AgentDeploymentInner innerModel(); - - /** - * The entirety of the AgentDeployment definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, DefinitionStages.WithCreate { - } - - /** - * The AgentDeployment definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the AgentDeployment definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the AgentDeployment definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, accountName, projectName, appName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @return the next definition stage. - */ - WithProperties withExistingApplication(String resourceGroupName, String accountName, String projectName, - String appName); - } - - /** - * The stage of the AgentDeployment definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: [Required] Additional attributes of the entity.. - * - * @param properties [Required] Additional attributes of the entity. - * @return the next definition stage. - */ - WithCreate withProperties(AgentDeploymentProperties properties); - } - - /** - * The stage of the AgentDeployment 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 { - /** - * Executes the create request. - * - * @return the created resource. - */ - AgentDeployment create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - AgentDeployment create(Context context); - } - } - - /** - * Begins update for the AgentDeployment resource. - * - * @return the stage of resource update. - */ - AgentDeployment.Update update(); - - /** - * The template for AgentDeployment update. - */ - interface Update extends UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - AgentDeployment apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - AgentDeployment apply(Context context); - } - - /** - * The AgentDeployment update stages. - */ - interface UpdateStages { - /** - * The stage of the AgentDeployment update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: [Required] Additional attributes of the entity.. - * - * @param properties [Required] Additional attributes of the entity. - * @return the next definition stage. - */ - Update withProperties(AgentDeploymentProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - AgentDeployment refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - AgentDeployment refresh(Context context); - - /** - * Starts an Agent Deployment. - * - * @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 startWithResponse(Context context); - - /** - * Starts an Agent Deployment. - * - * @throws com.azure.core.management.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(); - - /** - * Stops an Agent Deployment. - * - * @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 Agent Deployment. - * - * @throws com.azure.core.management.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(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentProperties.java deleted file mode 100644 index e57413f5687f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentProperties.java +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * Type representing an agent deployment as a management construct. - */ -@Fluent -public class AgentDeploymentProperties extends ResourceBase { - /* - * Gets or sets the type of deployment for the agent. - */ - private AgentDeploymentType deploymentType = AgentDeploymentType.fromString("AgentDeploymentProperties"); - - /* - * Gets or sets the display name of the deployment. - */ - private String displayName; - - /* - * Gets or sets the unique identifier of the deployment. - */ - private String deploymentId; - - /* - * Gets or sets the current operational state of the deployment (and, intrinsically, of the comprising agents). - */ - private AgentDeploymentState state; - - /* - * Gets or sets the supported protocol types and versions exposed by this deployment. - */ - private List protocols; - - /* - * Returns a flat list of agent:version deployed in this deployment. - */ - private List agents; - - /* - * Gets or sets the provisioning state of the agent deployment. - */ - private AgentDeploymentProvisioningState provisioningState; - - /** - * Creates an instance of AgentDeploymentProperties class. - */ - public AgentDeploymentProperties() { - } - - /** - * Get the deploymentType property: Gets or sets the type of deployment for the agent. - * - * @return the deploymentType value. - */ - public AgentDeploymentType deploymentType() { - return this.deploymentType; - } - - /** - * Get the displayName property: Gets or sets the display name of the deployment. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Gets or sets the display name of the deployment. - * - * @param displayName the displayName value to set. - * @return the AgentDeploymentProperties object itself. - */ - public AgentDeploymentProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the deploymentId property: Gets or sets the unique identifier of the deployment. - * - * @return the deploymentId value. - */ - public String deploymentId() { - return this.deploymentId; - } - - /** - * Set the deploymentId property: Gets or sets the unique identifier of the deployment. - * - * @param deploymentId the deploymentId value to set. - * @return the AgentDeploymentProperties object itself. - */ - public AgentDeploymentProperties withDeploymentId(String deploymentId) { - this.deploymentId = deploymentId; - return this; - } - - /** - * Get the state property: Gets or sets the current operational state of the deployment (and, intrinsically, of the - * comprising agents). - * - * @return the state value. - */ - public AgentDeploymentState state() { - return this.state; - } - - /** - * Set the state property: Gets or sets the current operational state of the deployment (and, intrinsically, of the - * comprising agents). - * - * @param state the state value to set. - * @return the AgentDeploymentProperties object itself. - */ - public AgentDeploymentProperties withState(AgentDeploymentState state) { - this.state = state; - return this; - } - - /** - * Get the protocols property: Gets or sets the supported protocol types and versions exposed by this deployment. - * - * @return the protocols value. - */ - public List protocols() { - return this.protocols; - } - - /** - * Set the protocols property: Gets or sets the supported protocol types and versions exposed by this deployment. - * - * @param protocols the protocols value to set. - * @return the AgentDeploymentProperties object itself. - */ - public AgentDeploymentProperties withProtocols(List protocols) { - this.protocols = protocols; - return this; - } - - /** - * Get the agents property: Returns a flat list of agent:version deployed in this deployment. - * - * @return the agents value. - */ - public List agents() { - return this.agents; - } - - /** - * Set the agents property: Returns a flat list of agent:version deployed in this deployment. - * - * @param agents the agents value to set. - * @return the AgentDeploymentProperties object itself. - */ - public AgentDeploymentProperties withAgents(List agents) { - this.agents = agents; - return this; - } - - /** - * Get the provisioningState property: Gets or sets the provisioning state of the agent deployment. - * - * @return the provisioningState value. - */ - public AgentDeploymentProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Gets or sets the provisioning state of the agent deployment. - * - * @param provisioningState the provisioningState value to set. - * @return the AgentDeploymentProperties object itself. - */ - AgentDeploymentProperties withProvisioningState(AgentDeploymentProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AgentDeploymentProperties withDescription(String description) { - super.withDescription(description); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AgentDeploymentProperties withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("description", description()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("deploymentType", - this.deploymentType == null ? null : this.deploymentType.toString()); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeStringField("deploymentId", this.deploymentId); - jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); - jsonWriter.writeArrayField("protocols", this.protocols, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("agents", this.agents, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AgentDeploymentProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AgentDeploymentProperties 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 AgentDeploymentProperties. - */ - public static AgentDeploymentProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("deploymentType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("Managed".equals(discriminatorValue)) { - return ManagedAgentDeployment.fromJson(readerToUse.reset()); - } else if ("Hosted".equals(discriminatorValue)) { - return HostedAgentDeployment.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AgentDeploymentProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AgentDeploymentProperties deserializedAgentDeploymentProperties = new AgentDeploymentProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedAgentDeploymentProperties.withDescription(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedAgentDeploymentProperties.withTags(tags); - } else if ("deploymentType".equals(fieldName)) { - deserializedAgentDeploymentProperties.deploymentType - = AgentDeploymentType.fromString(reader.getString()); - } else if ("displayName".equals(fieldName)) { - deserializedAgentDeploymentProperties.displayName = reader.getString(); - } else if ("deploymentId".equals(fieldName)) { - deserializedAgentDeploymentProperties.deploymentId = reader.getString(); - } else if ("state".equals(fieldName)) { - deserializedAgentDeploymentProperties.state = AgentDeploymentState.fromString(reader.getString()); - } else if ("protocols".equals(fieldName)) { - List protocols - = reader.readArray(reader1 -> AgentProtocolVersion.fromJson(reader1)); - deserializedAgentDeploymentProperties.protocols = protocols; - } else if ("agents".equals(fieldName)) { - List agents - = reader.readArray(reader1 -> VersionedAgentReference.fromJson(reader1)); - deserializedAgentDeploymentProperties.agents = agents; - } else if ("provisioningState".equals(fieldName)) { - deserializedAgentDeploymentProperties.provisioningState - = AgentDeploymentProvisioningState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAgentDeploymentProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentProvisioningState.java deleted file mode 100644 index aad3f1ba8de8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentProvisioningState.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Provisioning state of an agentic deployment, as an Azure resource. - */ -public final class AgentDeploymentProvisioningState extends ExpandableStringEnum { - /** - * The deployment was successfully completed. - */ - public static final AgentDeploymentProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * The deployment failed. - */ - public static final AgentDeploymentProvisioningState FAILED = fromString("Failed"); - - /** - * The deployment was canceled. - */ - public static final AgentDeploymentProvisioningState CANCELED = fromString("Canceled"); - - /** - * The deployment is being created. - */ - public static final AgentDeploymentProvisioningState CREATING = fromString("Creating"); - - /** - * The deployment is being updated. - */ - public static final AgentDeploymentProvisioningState UPDATING = fromString("Updating"); - - /** - * The deployment is being deleted. - */ - public static final AgentDeploymentProvisioningState DELETING = fromString("Deleting"); - - /** - * Creates a new instance of AgentDeploymentProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AgentDeploymentProvisioningState() { - } - - /** - * Creates or finds a AgentDeploymentProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding AgentDeploymentProvisioningState. - */ - public static AgentDeploymentProvisioningState fromString(String name) { - return fromString(name, AgentDeploymentProvisioningState.class); - } - - /** - * Gets known AgentDeploymentProvisioningState values. - * - * @return known AgentDeploymentProvisioningState values. - */ - public static Collection values() { - return values(AgentDeploymentProvisioningState.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentState.java deleted file mode 100644 index a0ac8336cdc7..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentState.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Current operational state of the agentic functionality represented by this deployment. - */ -public final class AgentDeploymentState extends ExpandableStringEnum { - /** - * The deployment is starting. - */ - public static final AgentDeploymentState STARTING = fromString("Starting"); - - /** - * The deployment started/is operational. - */ - public static final AgentDeploymentState RUNNING = fromString("Running"); - - /** - * The deployment is being stopped. - */ - public static final AgentDeploymentState STOPPING = fromString("Stopping"); - - /** - * The deployment was stopped. - */ - public static final AgentDeploymentState STOPPED = fromString("Stopped"); - - /** - * The deployment failed. - */ - public static final AgentDeploymentState FAILED = fromString("Failed"); - - /** - * The deployment is being deleted. - */ - public static final AgentDeploymentState DELETING = fromString("Deleting"); - - /** - * The deployment was deleted. - */ - public static final AgentDeploymentState DELETED = fromString("Deleted"); - - /** - * The deployment is being updated. - */ - public static final AgentDeploymentState UPDATING = fromString("Updating"); - - /** - * Creates a new instance of AgentDeploymentState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AgentDeploymentState() { - } - - /** - * Creates or finds a AgentDeploymentState from its string representation. - * - * @param name a name to look for. - * @return the corresponding AgentDeploymentState. - */ - public static AgentDeploymentState fromString(String name) { - return fromString(name, AgentDeploymentState.class); - } - - /** - * Gets known AgentDeploymentState values. - * - * @return known AgentDeploymentState values. - */ - public static Collection values() { - return values(AgentDeploymentState.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentType.java deleted file mode 100644 index 56e85ba56b6f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentType.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Specifies the type of deployment for an agent, indicating how the underlying compute and network infrastructure is - * managed. - */ -public final class AgentDeploymentType extends ExpandableStringEnum { - /** - * The underlying infra is managed by the platform in the deployer's subscription. - */ - public static final AgentDeploymentType MANAGED = fromString("Managed"); - - /** - * The underlying infra is owned by the platform. - */ - public static final AgentDeploymentType HOSTED = fromString("Hosted"); - - /** - * The underlying infra is provisioned by the deployer (BYO). - */ - public static final AgentDeploymentType CUSTOM = fromString("Custom"); - - /** - * Creates a new instance of AgentDeploymentType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AgentDeploymentType() { - } - - /** - * Creates or finds a AgentDeploymentType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AgentDeploymentType. - */ - public static AgentDeploymentType fromString(String name) { - return fromString(name, AgentDeploymentType.class); - } - - /** - * Gets known AgentDeploymentType values. - * - * @return known AgentDeploymentType values. - */ - public static Collection values() { - return values(AgentDeploymentType.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeployments.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeployments.java deleted file mode 100644 index a0a2f65bf081..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeployments.java +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import java.util.List; - -/** - * Resource collection API of AgentDeployments. - */ -public interface AgentDeployments { - /** - * Gets an Agent Deployment by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @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 Agent Deployment by name along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, String projectName, - String appName, String deploymentName, Context context); - - /** - * Gets an Agent Deployment by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Agent Deployment by name. - */ - AgentDeployment get(String resourceGroupName, String accountName, String projectName, String appName, - String deploymentName); - - /** - * Delete Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String projectName, String appName, - String deploymentName); - - /** - * Delete Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @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 accountName, String projectName, String appName, String deploymentName, - Context context); - - /** - * Lists Agent Deployments in the application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 paginated list of Agent Deployment entities as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, String projectName, - String appName); - - /** - * Lists Agent Deployments in the application. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param count Number of agent deployments to be retrieved in a page of results. - * @param skipToken Continuation token for pagination. - * @param names Names of agent deployments to retrieve. - * @param orderBy Field to order by. - * @param orderByAsc Whether to order in ascending order. - * @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 paginated list of Agent Deployment entities as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, String projectName, - String appName, Integer count, String skipToken, List names, String orderBy, Boolean orderByAsc, - Context context); - - /** - * Starts an Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @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 startWithResponse(String resourceGroupName, String accountName, String projectName, String appName, - String deploymentName, Context context); - - /** - * Starts an Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String projectName, String appName, String deploymentName); - - /** - * Stops an Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @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 accountName, String projectName, String appName, - String deploymentName, Context context); - - /** - * Stops an Agent Deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param appName The name of the application associated with the Cognitive Services Account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String projectName, String appName, String deploymentName); - - /** - * Gets an Agent Deployment by name. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Agent Deployment by name along with {@link Response}. - */ - AgentDeployment getById(String id); - - /** - * Gets an Agent Deployment by name. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Agent Deployment by name along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete Agent Deployment. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete Agent Deployment. - * - * @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 AgentDeployment resource. - * - * @param name resource name. - * @return the first stage of the new AgentDeployment definition. - */ - AgentDeployment.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentProtocol.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentProtocol.java deleted file mode 100644 index 766d381b81f5..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentProtocol.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Protocol used by the agent/exposed by a deployment. - */ -public final class AgentProtocol extends ExpandableStringEnum { - /** - * Agent protocol (aka Active). - */ - public static final AgentProtocol AGENT = fromString("Agent"); - - /** - * Agent2Agent standard. - */ - public static final AgentProtocol A2A = fromString("A2A"); - - /** - * OpenAI-compatible. - */ - public static final AgentProtocol RESPONSES = fromString("Responses"); - - /** - * Creates a new instance of AgentProtocol value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AgentProtocol() { - } - - /** - * Creates or finds a AgentProtocol from its string representation. - * - * @param name a name to look for. - * @return the corresponding AgentProtocol. - */ - public static AgentProtocol fromString(String name) { - return fromString(name, AgentProtocol.class); - } - - /** - * Gets known AgentProtocol values. - * - * @return known AgentProtocol values. - */ - public static Collection values() { - return values(AgentProtocol.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentProtocolVersion.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentProtocolVersion.java deleted file mode 100644 index 10df402394d8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentProtocolVersion.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Type modeling the protocol and version used by an agent/exposed by a deployment. - */ -@Fluent -public final class AgentProtocolVersion implements JsonSerializable { - /* - * The protocol used by the agent/exposed by a deployment. - */ - private AgentProtocol protocol; - - /* - * The version of the protocol. - */ - private String version; - - /** - * Creates an instance of AgentProtocolVersion class. - */ - public AgentProtocolVersion() { - } - - /** - * Get the protocol property: The protocol used by the agent/exposed by a deployment. - * - * @return the protocol value. - */ - public AgentProtocol protocol() { - return this.protocol; - } - - /** - * Set the protocol property: The protocol used by the agent/exposed by a deployment. - * - * @param protocol the protocol value to set. - * @return the AgentProtocolVersion object itself. - */ - public AgentProtocolVersion withProtocol(AgentProtocol protocol) { - this.protocol = protocol; - return this; - } - - /** - * Get the version property: The version of the protocol. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Set the version property: The version of the protocol. - * - * @param version the version value to set. - * @return the AgentProtocolVersion object itself. - */ - public AgentProtocolVersion withVersion(String version) { - this.version = version; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); - jsonWriter.writeStringField("version", this.version); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AgentProtocolVersion from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AgentProtocolVersion 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 AgentProtocolVersion. - */ - public static AgentProtocolVersion fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AgentProtocolVersion deserializedAgentProtocolVersion = new AgentProtocolVersion(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("protocol".equals(fieldName)) { - deserializedAgentProtocolVersion.protocol = AgentProtocol.fromString(reader.getString()); - } else if ("version".equals(fieldName)) { - deserializedAgentProtocolVersion.version = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAgentProtocolVersion; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReference.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReference.java deleted file mode 100644 index 29eb931c1341..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReference.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Agent Reference resource. - */ -@Immutable -public final class AgentReference extends ProxyResource { - /* - * [Required] Additional attributes of the entity. - */ - private AgentReferenceProperties 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 AgentReference class. - */ - private AgentReference() { - } - - /** - * Get the properties property: [Required] Additional attributes of the entity. - * - * @return the properties value. - */ - public AgentReferenceProperties properties() { - return this.properties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AgentReference from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AgentReference 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 AgentReference. - */ - public static AgentReference fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AgentReference deserializedAgentReference = new AgentReference(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAgentReference.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAgentReference.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAgentReference.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAgentReference.properties = AgentReferenceProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAgentReference.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAgentReference; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReferenceProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReferenceProperties.java deleted file mode 100644 index f1ecd79b282d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReferenceProperties.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Type modeling a reference to a version of an agent definition. - */ -@Fluent -public class AgentReferenceProperties implements JsonSerializable { - /* - * Gets the agent's unique identifier within the organization (subscription). - */ - private String agentId; - - /* - * Gets the agent's name (unique within the project/app). - */ - private String agentName; - - /** - * Creates an instance of AgentReferenceProperties class. - */ - public AgentReferenceProperties() { - } - - /** - * Get the agentId property: Gets the agent's unique identifier within the organization (subscription). - * - * @return the agentId value. - */ - public String agentId() { - return this.agentId; - } - - /** - * Set the agentId property: Gets the agent's unique identifier within the organization (subscription). - * - * @param agentId the agentId value to set. - * @return the AgentReferenceProperties object itself. - */ - public AgentReferenceProperties withAgentId(String agentId) { - this.agentId = agentId; - return this; - } - - /** - * Get the agentName property: Gets the agent's name (unique within the project/app). - * - * @return the agentName value. - */ - public String agentName() { - return this.agentName; - } - - /** - * Set the agentName property: Gets the agent's name (unique within the project/app). - * - * @param agentName the agentName value to set. - * @return the AgentReferenceProperties object itself. - */ - public AgentReferenceProperties withAgentName(String agentName) { - this.agentName = agentName; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("agentId", this.agentId); - jsonWriter.writeStringField("agentName", this.agentName); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AgentReferenceProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AgentReferenceProperties 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 AgentReferenceProperties. - */ - public static AgentReferenceProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AgentReferenceProperties deserializedAgentReferenceProperties = new AgentReferenceProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("agentId".equals(fieldName)) { - deserializedAgentReferenceProperties.agentId = reader.getString(); - } else if ("agentName".equals(fieldName)) { - deserializedAgentReferenceProperties.agentName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAgentReferenceProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReferenceResourceArmPaginatedResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReferenceResourceArmPaginatedResult.java deleted file mode 100644 index 38252f34decd..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReferenceResourceArmPaginatedResult.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentReferenceResourceArmPaginatedResultInner; -import java.util.List; - -/** - * An immutable client-side representation of AgentReferenceResourceArmPaginatedResult. - */ -public interface AgentReferenceResourceArmPaginatedResult { - /** - * Gets the nextLink property: The link to the next page of Agent Reference objects. If null, there are no - * additional pages. - * - * @return the nextLink value. - */ - String nextLink(); - - /** - * Gets the value property: An array of objects of type Agent Reference. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner - * com.azure.resourcemanager.cognitiveservices.fluent.models.AgentReferenceResourceArmPaginatedResultInner object. - * - * @return the inner object. - */ - AgentReferenceResourceArmPaginatedResultInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgenticApplicationProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgenticApplicationProperties.java deleted file mode 100644 index 3dde964e4cf9..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgenticApplicationProperties.java +++ /dev/null @@ -1,324 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * Resource type representing an agentic application as a management construct. - */ -@Fluent -public final class AgenticApplicationProperties extends ResourceBase { - /* - * The display name of the application. - */ - private String displayName; - - /* - * The application's dedicated invocation endpoint. - */ - private String baseUrl; - - /* - * The list of agent definitions comprising this application, returned as references to the objects under the parent - * project; use this to obtain a flat list of all agent-version pairs represented by this application. - */ - private List agents; - - /* - * The EntraId Agentic Blueprint of the application. - */ - private AssignedIdentity agentIdentityBlueprint; - - /* - * The (default) agent instance identity of the application. - */ - private AssignedIdentity defaultInstanceIdentity; - - /* - * Gets or sets the authorization policy associated with this agentic application instance. - */ - private ApplicationAuthorizationPolicy authorizationPolicy; - - /* - * Gets or sets the traffic routing policy for the application's deployments. - */ - private ApplicationTrafficRoutingPolicy trafficRoutingPolicy; - - /* - * Provisioning state of the application. - */ - private AgenticApplicationProvisioningState provisioningState; - - /* - * Enabledstate of the application. - */ - private Boolean isEnabled; - - /** - * Creates an instance of AgenticApplicationProperties class. - */ - public AgenticApplicationProperties() { - } - - /** - * Get the displayName property: The display name of the application. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the application. - * - * @param displayName the displayName value to set. - * @return the AgenticApplicationProperties object itself. - */ - public AgenticApplicationProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the baseUrl property: The application's dedicated invocation endpoint. - * - * @return the baseUrl value. - */ - public String baseUrl() { - return this.baseUrl; - } - - /** - * Set the baseUrl property: The application's dedicated invocation endpoint. - * - * @param baseUrl the baseUrl value to set. - * @return the AgenticApplicationProperties object itself. - */ - public AgenticApplicationProperties withBaseUrl(String baseUrl) { - this.baseUrl = baseUrl; - return this; - } - - /** - * Get the agents property: The list of agent definitions comprising this application, returned as references to the - * objects under the parent project; use this to obtain a flat list of all agent-version pairs represented by this - * application. - * - * @return the agents value. - */ - public List agents() { - return this.agents; - } - - /** - * Set the agents property: The list of agent definitions comprising this application, returned as references to the - * objects under the parent project; use this to obtain a flat list of all agent-version pairs represented by this - * application. - * - * @param agents the agents value to set. - * @return the AgenticApplicationProperties object itself. - */ - public AgenticApplicationProperties withAgents(List agents) { - this.agents = agents; - return this; - } - - /** - * Get the agentIdentityBlueprint property: The EntraId Agentic Blueprint of the application. - * - * @return the agentIdentityBlueprint value. - */ - public AssignedIdentity agentIdentityBlueprint() { - return this.agentIdentityBlueprint; - } - - /** - * Set the agentIdentityBlueprint property: The EntraId Agentic Blueprint of the application. - * - * @param agentIdentityBlueprint the agentIdentityBlueprint value to set. - * @return the AgenticApplicationProperties object itself. - */ - public AgenticApplicationProperties withAgentIdentityBlueprint(AssignedIdentity agentIdentityBlueprint) { - this.agentIdentityBlueprint = agentIdentityBlueprint; - return this; - } - - /** - * Get the defaultInstanceIdentity property: The (default) agent instance identity of the application. - * - * @return the defaultInstanceIdentity value. - */ - public AssignedIdentity defaultInstanceIdentity() { - return this.defaultInstanceIdentity; - } - - /** - * Set the defaultInstanceIdentity property: The (default) agent instance identity of the application. - * - * @param defaultInstanceIdentity the defaultInstanceIdentity value to set. - * @return the AgenticApplicationProperties object itself. - */ - public AgenticApplicationProperties withDefaultInstanceIdentity(AssignedIdentity defaultInstanceIdentity) { - this.defaultInstanceIdentity = defaultInstanceIdentity; - return this; - } - - /** - * Get the authorizationPolicy property: Gets or sets the authorization policy associated with this agentic - * application instance. - * - * @return the authorizationPolicy value. - */ - public ApplicationAuthorizationPolicy authorizationPolicy() { - return this.authorizationPolicy; - } - - /** - * Set the authorizationPolicy property: Gets or sets the authorization policy associated with this agentic - * application instance. - * - * @param authorizationPolicy the authorizationPolicy value to set. - * @return the AgenticApplicationProperties object itself. - */ - public AgenticApplicationProperties withAuthorizationPolicy(ApplicationAuthorizationPolicy authorizationPolicy) { - this.authorizationPolicy = authorizationPolicy; - return this; - } - - /** - * Get the trafficRoutingPolicy property: Gets or sets the traffic routing policy for the application's deployments. - * - * @return the trafficRoutingPolicy value. - */ - public ApplicationTrafficRoutingPolicy trafficRoutingPolicy() { - return this.trafficRoutingPolicy; - } - - /** - * Set the trafficRoutingPolicy property: Gets or sets the traffic routing policy for the application's deployments. - * - * @param trafficRoutingPolicy the trafficRoutingPolicy value to set. - * @return the AgenticApplicationProperties object itself. - */ - public AgenticApplicationProperties withTrafficRoutingPolicy(ApplicationTrafficRoutingPolicy trafficRoutingPolicy) { - this.trafficRoutingPolicy = trafficRoutingPolicy; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the application. - * - * @return the provisioningState value. - */ - public AgenticApplicationProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the isEnabled property: Enabledstate of the application. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.isEnabled; - } - - /** - * {@inheritDoc} - */ - @Override - public AgenticApplicationProperties withDescription(String description) { - super.withDescription(description); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AgenticApplicationProperties withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("description", description()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeStringField("baseUrl", this.baseUrl); - jsonWriter.writeArrayField("agents", this.agents, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("agentIdentityBlueprint", this.agentIdentityBlueprint); - jsonWriter.writeJsonField("defaultInstanceIdentity", this.defaultInstanceIdentity); - jsonWriter.writeJsonField("authorizationPolicy", this.authorizationPolicy); - jsonWriter.writeJsonField("trafficRoutingPolicy", this.trafficRoutingPolicy); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AgenticApplicationProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AgenticApplicationProperties 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 AgenticApplicationProperties. - */ - public static AgenticApplicationProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AgenticApplicationProperties deserializedAgenticApplicationProperties = new AgenticApplicationProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedAgenticApplicationProperties.withDescription(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedAgenticApplicationProperties.withTags(tags); - } else if ("displayName".equals(fieldName)) { - deserializedAgenticApplicationProperties.displayName = reader.getString(); - } else if ("baseUrl".equals(fieldName)) { - deserializedAgenticApplicationProperties.baseUrl = reader.getString(); - } else if ("agents".equals(fieldName)) { - List agents - = reader.readArray(reader1 -> AgentReferenceProperties.fromJson(reader1)); - deserializedAgenticApplicationProperties.agents = agents; - } else if ("agentIdentityBlueprint".equals(fieldName)) { - deserializedAgenticApplicationProperties.agentIdentityBlueprint = AssignedIdentity.fromJson(reader); - } else if ("defaultInstanceIdentity".equals(fieldName)) { - deserializedAgenticApplicationProperties.defaultInstanceIdentity - = AssignedIdentity.fromJson(reader); - } else if ("authorizationPolicy".equals(fieldName)) { - deserializedAgenticApplicationProperties.authorizationPolicy - = ApplicationAuthorizationPolicy.fromJson(reader); - } else if ("trafficRoutingPolicy".equals(fieldName)) { - deserializedAgenticApplicationProperties.trafficRoutingPolicy - = ApplicationTrafficRoutingPolicy.fromJson(reader); - } else if ("provisioningState".equals(fieldName)) { - deserializedAgenticApplicationProperties.provisioningState - = AgenticApplicationProvisioningState.fromString(reader.getString()); - } else if ("isEnabled".equals(fieldName)) { - deserializedAgenticApplicationProperties.isEnabled = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedAgenticApplicationProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgenticApplicationProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgenticApplicationProvisioningState.java deleted file mode 100644 index 3298d06c1777..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgenticApplicationProvisioningState.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Provisioning state of an agentic application. - */ -public final class AgenticApplicationProvisioningState - extends ExpandableStringEnum { - /** - * The application was successfully provisioned. - */ - public static final AgenticApplicationProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * The application provisioning failed. - */ - public static final AgenticApplicationProvisioningState FAILED = fromString("Failed"); - - /** - * The application provisioning was canceled. - */ - public static final AgenticApplicationProvisioningState CANCELED = fromString("Canceled"); - - /** - * The application is being created. - */ - public static final AgenticApplicationProvisioningState CREATING = fromString("Creating"); - - /** - * The application is being updated. - */ - public static final AgenticApplicationProvisioningState UPDATING = fromString("Updating"); - - /** - * The application is being deleted. - */ - public static final AgenticApplicationProvisioningState DELETING = fromString("Deleting"); - - /** - * Creates a new instance of AgenticApplicationProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AgenticApplicationProvisioningState() { - } - - /** - * Creates or finds a AgenticApplicationProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding AgenticApplicationProvisioningState. - */ - public static AgenticApplicationProvisioningState fromString(String name) { - return fromString(name, AgenticApplicationProvisioningState.class); - } - - /** - * Gets known AgenticApplicationProvisioningState values. - * - * @return known AgenticApplicationProvisioningState values. - */ - public static Collection values() { - return values(AgenticApplicationProvisioningState.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiKeyAuthConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiKeyAuthConnectionProperties.java deleted file mode 100644 index a9e566c5049b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiKeyAuthConnectionProperties.java +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * This connection type covers the generic ApiKey auth connection categories, for examples: - * AzureOpenAI: - * Category:= AzureOpenAI - * AuthType:= ApiKey (as type discriminator) - * Credentials:= {ApiKey} as .ApiKey - * Target:= {ApiBase} - * - * CognitiveService: - * Category:= CognitiveService - * AuthType:= ApiKey (as type discriminator) - * Credentials:= {SubscriptionKey} as ApiKey - * Target:= ServiceRegion={serviceRegion} - * - * CognitiveSearch: - * Category:= CognitiveSearch - * AuthType:= ApiKey (as type discriminator) - * Credentials:= {Key} as ApiKey - * Target:= {Endpoint} - * - * Use Metadata property bag for ApiType, ApiVersion, Kind and other metadata fields. - */ -@Fluent -public final class ApiKeyAuthConnectionProperties extends ConnectionPropertiesV2 { - /* - * Authentication type of the connection target - */ - private ConnectionAuthType authType = ConnectionAuthType.API_KEY; - - /* - * Api key object for connection credential. - */ - private ConnectionApiKey credentials; - - /** - * Creates an instance of ApiKeyAuthConnectionProperties class. - */ - public ApiKeyAuthConnectionProperties() { - } - - /** - * Get the authType property: Authentication type of the connection target. - * - * @return the authType value. - */ - @Override - public ConnectionAuthType authType() { - return this.authType; - } - - /** - * Get the credentials property: Api key object for connection credential. - * - * @return the credentials value. - */ - public ConnectionApiKey credentials() { - return this.credentials; - } - - /** - * Set the credentials property: Api key object for connection credential. - * - * @param credentials the credentials value to set. - * @return the ApiKeyAuthConnectionProperties object itself. - */ - public ApiKeyAuthConnectionProperties withCredentials(ConnectionApiKey credentials) { - this.credentials = credentials; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ApiKeyAuthConnectionProperties withCategory(ConnectionCategory category) { - super.withCategory(category); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ApiKeyAuthConnectionProperties withError(String error) { - super.withError(error); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ApiKeyAuthConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { - super.withExpiryTime(expiryTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ApiKeyAuthConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { - super.withIsSharedToAll(isSharedToAll); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ApiKeyAuthConnectionProperties withMetadata(Map metadata) { - super.withMetadata(metadata); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ApiKeyAuthConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { - super.withPeRequirement(peRequirement); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ApiKeyAuthConnectionProperties withPeStatus(ManagedPEStatus peStatus) { - super.withPeStatus(peStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ApiKeyAuthConnectionProperties withSharedUserList(List sharedUserList) { - super.withSharedUserList(sharedUserList); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ApiKeyAuthConnectionProperties withTarget(String target) { - super.withTarget(target); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ApiKeyAuthConnectionProperties withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { - super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("category", category() == null ? null : category().toString()); - jsonWriter.writeStringField("error", error()); - jsonWriter.writeStringField("expiryTime", - expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); - jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); - jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); - jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); - jsonWriter.writeArrayField("sharedUserList", sharedUserList(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("target", target()); - jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); - jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); - jsonWriter.writeJsonField("credentials", this.credentials); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ApiKeyAuthConnectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ApiKeyAuthConnectionProperties 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 ApiKeyAuthConnectionProperties. - */ - public static ApiKeyAuthConnectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ApiKeyAuthConnectionProperties deserializedApiKeyAuthConnectionProperties - = new ApiKeyAuthConnectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("category".equals(fieldName)) { - deserializedApiKeyAuthConnectionProperties - .withCategory(ConnectionCategory.fromString(reader.getString())); - } else if ("createdByWorkspaceArmId".equals(fieldName)) { - deserializedApiKeyAuthConnectionProperties.withCreatedByWorkspaceArmId(reader.getString()); - } else if ("error".equals(fieldName)) { - deserializedApiKeyAuthConnectionProperties.withError(reader.getString()); - } else if ("expiryTime".equals(fieldName)) { - deserializedApiKeyAuthConnectionProperties.withExpiryTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("group".equals(fieldName)) { - deserializedApiKeyAuthConnectionProperties - .withGroup(ConnectionGroup.fromString(reader.getString())); - } else if ("isSharedToAll".equals(fieldName)) { - deserializedApiKeyAuthConnectionProperties - .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); - } else if ("metadata".equals(fieldName)) { - Map metadata = reader.readMap(reader1 -> reader1.getString()); - deserializedApiKeyAuthConnectionProperties.withMetadata(metadata); - } else if ("peRequirement".equals(fieldName)) { - deserializedApiKeyAuthConnectionProperties - .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); - } else if ("peStatus".equals(fieldName)) { - deserializedApiKeyAuthConnectionProperties - .withPeStatus(ManagedPEStatus.fromString(reader.getString())); - } else if ("sharedUserList".equals(fieldName)) { - List sharedUserList = reader.readArray(reader1 -> reader1.getString()); - deserializedApiKeyAuthConnectionProperties.withSharedUserList(sharedUserList); - } else if ("target".equals(fieldName)) { - deserializedApiKeyAuthConnectionProperties.withTarget(reader.getString()); - } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { - deserializedApiKeyAuthConnectionProperties - .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); - } else if ("authType".equals(fieldName)) { - deserializedApiKeyAuthConnectionProperties.authType - = ConnectionAuthType.fromString(reader.getString()); - } else if ("credentials".equals(fieldName)) { - deserializedApiKeyAuthConnectionProperties.credentials = ConnectionApiKey.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedApiKeyAuthConnectionProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiKeys.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiKeys.java deleted file mode 100644 index e6ebe7fa42eb..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiKeys.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.ApiKeysInner; - -/** - * An immutable client-side representation of ApiKeys. - */ -public interface ApiKeys { - /** - * Gets the key1 property: Gets the value of key 1. - * - * @return the key1 value. - */ - String key1(); - - /** - * Gets the key2 property: Gets the value of key 2. - * - * @return the key2 value. - */ - String key2(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.ApiKeysInner object. - * - * @return the inner object. - */ - ApiKeysInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiProperties.java deleted file mode 100644 index 8bc699315777..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiProperties.java +++ /dev/null @@ -1,375 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.LinkedHashMap; -import java.util.Map; - -/** - * The api properties for special APIs. - */ -@Fluent -public final class ApiProperties implements JsonSerializable { - /* - * (QnAMaker Only) The runtime endpoint of QnAMaker. - */ - private String qnaRuntimeEndpoint; - - /* - * (QnAMaker Only) The Azure Search endpoint key of QnAMaker. - */ - private String qnaAzureSearchEndpointKey; - - /* - * (QnAMaker Only) The Azure Search endpoint id of QnAMaker. - */ - private String qnaAzureSearchEndpointId; - - /* - * (Bing Search Only) The flag to enable statistics of Bing Search. - */ - private Boolean statisticsEnabled; - - /* - * (Personalization Only) The flag to enable statistics of Bing Search. - */ - private String eventHubConnectionString; - - /* - * (Personalization Only) The storage account connection string. - */ - private String storageAccountConnectionString; - - /* - * (Metrics Advisor Only) The Azure AD Client Id (Application Id). - */ - private String aadClientId; - - /* - * (Metrics Advisor Only) The Azure AD Tenant Id. - */ - private String aadTenantId; - - /* - * (Metrics Advisor Only) The super user of Metrics Advisor. - */ - private String superUser; - - /* - * (Metrics Advisor Only) The website name of Metrics Advisor. - */ - private String websiteName; - - /* - * The api properties for special APIs. - */ - private Map additionalProperties; - - /** - * Creates an instance of ApiProperties class. - */ - public ApiProperties() { - } - - /** - * Get the qnaRuntimeEndpoint property: (QnAMaker Only) The runtime endpoint of QnAMaker. - * - * @return the qnaRuntimeEndpoint value. - */ - public String qnaRuntimeEndpoint() { - return this.qnaRuntimeEndpoint; - } - - /** - * Set the qnaRuntimeEndpoint property: (QnAMaker Only) The runtime endpoint of QnAMaker. - * - * @param qnaRuntimeEndpoint the qnaRuntimeEndpoint value to set. - * @return the ApiProperties object itself. - */ - public ApiProperties withQnaRuntimeEndpoint(String qnaRuntimeEndpoint) { - this.qnaRuntimeEndpoint = qnaRuntimeEndpoint; - return this; - } - - /** - * Get the qnaAzureSearchEndpointKey property: (QnAMaker Only) The Azure Search endpoint key of QnAMaker. - * - * @return the qnaAzureSearchEndpointKey value. - */ - public String qnaAzureSearchEndpointKey() { - return this.qnaAzureSearchEndpointKey; - } - - /** - * Set the qnaAzureSearchEndpointKey property: (QnAMaker Only) The Azure Search endpoint key of QnAMaker. - * - * @param qnaAzureSearchEndpointKey the qnaAzureSearchEndpointKey value to set. - * @return the ApiProperties object itself. - */ - public ApiProperties withQnaAzureSearchEndpointKey(String qnaAzureSearchEndpointKey) { - this.qnaAzureSearchEndpointKey = qnaAzureSearchEndpointKey; - return this; - } - - /** - * Get the qnaAzureSearchEndpointId property: (QnAMaker Only) The Azure Search endpoint id of QnAMaker. - * - * @return the qnaAzureSearchEndpointId value. - */ - public String qnaAzureSearchEndpointId() { - return this.qnaAzureSearchEndpointId; - } - - /** - * Set the qnaAzureSearchEndpointId property: (QnAMaker Only) The Azure Search endpoint id of QnAMaker. - * - * @param qnaAzureSearchEndpointId the qnaAzureSearchEndpointId value to set. - * @return the ApiProperties object itself. - */ - public ApiProperties withQnaAzureSearchEndpointId(String qnaAzureSearchEndpointId) { - this.qnaAzureSearchEndpointId = qnaAzureSearchEndpointId; - return this; - } - - /** - * Get the statisticsEnabled property: (Bing Search Only) The flag to enable statistics of Bing Search. - * - * @return the statisticsEnabled value. - */ - public Boolean statisticsEnabled() { - return this.statisticsEnabled; - } - - /** - * Set the statisticsEnabled property: (Bing Search Only) The flag to enable statistics of Bing Search. - * - * @param statisticsEnabled the statisticsEnabled value to set. - * @return the ApiProperties object itself. - */ - public ApiProperties withStatisticsEnabled(Boolean statisticsEnabled) { - this.statisticsEnabled = statisticsEnabled; - return this; - } - - /** - * Get the eventHubConnectionString property: (Personalization Only) The flag to enable statistics of Bing Search. - * - * @return the eventHubConnectionString value. - */ - public String eventHubConnectionString() { - return this.eventHubConnectionString; - } - - /** - * Set the eventHubConnectionString property: (Personalization Only) The flag to enable statistics of Bing Search. - * - * @param eventHubConnectionString the eventHubConnectionString value to set. - * @return the ApiProperties object itself. - */ - public ApiProperties withEventHubConnectionString(String eventHubConnectionString) { - this.eventHubConnectionString = eventHubConnectionString; - return this; - } - - /** - * Get the storageAccountConnectionString property: (Personalization Only) The storage account connection string. - * - * @return the storageAccountConnectionString value. - */ - public String storageAccountConnectionString() { - return this.storageAccountConnectionString; - } - - /** - * Set the storageAccountConnectionString property: (Personalization Only) The storage account connection string. - * - * @param storageAccountConnectionString the storageAccountConnectionString value to set. - * @return the ApiProperties object itself. - */ - public ApiProperties withStorageAccountConnectionString(String storageAccountConnectionString) { - this.storageAccountConnectionString = storageAccountConnectionString; - return this; - } - - /** - * Get the aadClientId property: (Metrics Advisor Only) The Azure AD Client Id (Application Id). - * - * @return the aadClientId value. - */ - public String aadClientId() { - return this.aadClientId; - } - - /** - * Set the aadClientId property: (Metrics Advisor Only) The Azure AD Client Id (Application Id). - * - * @param aadClientId the aadClientId value to set. - * @return the ApiProperties object itself. - */ - public ApiProperties withAadClientId(String aadClientId) { - this.aadClientId = aadClientId; - return this; - } - - /** - * Get the aadTenantId property: (Metrics Advisor Only) The Azure AD Tenant Id. - * - * @return the aadTenantId value. - */ - public String aadTenantId() { - return this.aadTenantId; - } - - /** - * Set the aadTenantId property: (Metrics Advisor Only) The Azure AD Tenant Id. - * - * @param aadTenantId the aadTenantId value to set. - * @return the ApiProperties object itself. - */ - public ApiProperties withAadTenantId(String aadTenantId) { - this.aadTenantId = aadTenantId; - return this; - } - - /** - * Get the superUser property: (Metrics Advisor Only) The super user of Metrics Advisor. - * - * @return the superUser value. - */ - public String superUser() { - return this.superUser; - } - - /** - * Set the superUser property: (Metrics Advisor Only) The super user of Metrics Advisor. - * - * @param superUser the superUser value to set. - * @return the ApiProperties object itself. - */ - public ApiProperties withSuperUser(String superUser) { - this.superUser = superUser; - return this; - } - - /** - * Get the websiteName property: (Metrics Advisor Only) The website name of Metrics Advisor. - * - * @return the websiteName value. - */ - public String websiteName() { - return this.websiteName; - } - - /** - * Set the websiteName property: (Metrics Advisor Only) The website name of Metrics Advisor. - * - * @param websiteName the websiteName value to set. - * @return the ApiProperties object itself. - */ - public ApiProperties withWebsiteName(String websiteName) { - this.websiteName = websiteName; - return this; - } - - /** - * Get the additionalProperties property: The api properties for special APIs. - * - * @return the additionalProperties value. - */ - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: The api properties for special APIs. - * - * @param additionalProperties the additionalProperties value to set. - * @return the ApiProperties object itself. - */ - public ApiProperties withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("qnaRuntimeEndpoint", this.qnaRuntimeEndpoint); - jsonWriter.writeStringField("qnaAzureSearchEndpointKey", this.qnaAzureSearchEndpointKey); - jsonWriter.writeStringField("qnaAzureSearchEndpointId", this.qnaAzureSearchEndpointId); - jsonWriter.writeBooleanField("statisticsEnabled", this.statisticsEnabled); - jsonWriter.writeStringField("eventHubConnectionString", this.eventHubConnectionString); - jsonWriter.writeStringField("storageAccountConnectionString", this.storageAccountConnectionString); - jsonWriter.writeStringField("aadClientId", this.aadClientId); - jsonWriter.writeStringField("aadTenantId", this.aadTenantId); - jsonWriter.writeStringField("superUser", this.superUser); - jsonWriter.writeStringField("websiteName", this.websiteName); - if (additionalProperties != null) { - for (Map.Entry additionalProperty : additionalProperties.entrySet()) { - jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); - } - } - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ApiProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ApiProperties 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 ApiProperties. - */ - public static ApiProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ApiProperties deserializedApiProperties = new ApiProperties(); - Map additionalProperties = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("qnaRuntimeEndpoint".equals(fieldName)) { - deserializedApiProperties.qnaRuntimeEndpoint = reader.getString(); - } else if ("qnaAzureSearchEndpointKey".equals(fieldName)) { - deserializedApiProperties.qnaAzureSearchEndpointKey = reader.getString(); - } else if ("qnaAzureSearchEndpointId".equals(fieldName)) { - deserializedApiProperties.qnaAzureSearchEndpointId = reader.getString(); - } else if ("statisticsEnabled".equals(fieldName)) { - deserializedApiProperties.statisticsEnabled = reader.getNullable(JsonReader::getBoolean); - } else if ("eventHubConnectionString".equals(fieldName)) { - deserializedApiProperties.eventHubConnectionString = reader.getString(); - } else if ("storageAccountConnectionString".equals(fieldName)) { - deserializedApiProperties.storageAccountConnectionString = reader.getString(); - } else if ("aadClientId".equals(fieldName)) { - deserializedApiProperties.aadClientId = reader.getString(); - } else if ("aadTenantId".equals(fieldName)) { - deserializedApiProperties.aadTenantId = reader.getString(); - } else if ("superUser".equals(fieldName)) { - deserializedApiProperties.superUser = reader.getString(); - } else if ("websiteName".equals(fieldName)) { - deserializedApiProperties.websiteName = reader.getString(); - } else { - if (additionalProperties == null) { - additionalProperties = new LinkedHashMap<>(); - } - - additionalProperties.put(fieldName, reader.readUntyped()); - } - } - deserializedApiProperties.additionalProperties = additionalProperties; - - return deserializedApiProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApplicationAuthorizationPolicy.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApplicationAuthorizationPolicy.java deleted file mode 100644 index 70999b3d83da..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApplicationAuthorizationPolicy.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Represents a policy for authorizing applications based on specified authentication and authorization schemes. - */ -@Immutable -public class ApplicationAuthorizationPolicy implements JsonSerializable { - /* - * Authorization scheme type. - */ - private BuiltInAuthorizationScheme type = BuiltInAuthorizationScheme.fromString("ApplicationAuthorizationPolicy"); - - /** - * Creates an instance of ApplicationAuthorizationPolicy class. - */ - public ApplicationAuthorizationPolicy() { - } - - /** - * Get the type property: Authorization scheme type. - * - * @return the type value. - */ - public BuiltInAuthorizationScheme type() { - return this.type; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ApplicationAuthorizationPolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ApplicationAuthorizationPolicy 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 ApplicationAuthorizationPolicy. - */ - public static ApplicationAuthorizationPolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("type".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("Default".equals(discriminatorValue)) { - return RoleBasedBuiltInAuthorizationPolicy.fromJson(readerToUse.reset()); - } else if ("OrganizationScope".equals(discriminatorValue)) { - return OrganizationSharedBuiltInAuthorizationPolicy.fromJson(readerToUse.reset()); - } else if ("Channels".equals(discriminatorValue)) { - return ChannelsBuiltInAuthorizationPolicy.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static ApplicationAuthorizationPolicy fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ApplicationAuthorizationPolicy deserializedApplicationAuthorizationPolicy - = new ApplicationAuthorizationPolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedApplicationAuthorizationPolicy.type - = BuiltInAuthorizationScheme.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedApplicationAuthorizationPolicy; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApplicationTrafficRoutingPolicy.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApplicationTrafficRoutingPolicy.java deleted file mode 100644 index d84e2612604a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApplicationTrafficRoutingPolicy.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Type representing an application traffic policy as a property of an agentic application. - */ -@Fluent -public final class ApplicationTrafficRoutingPolicy implements JsonSerializable { - /* - * Methodology used to route traffic to the application's deployments. - */ - private TrafficRoutingProtocol protocol; - - /* - * Gets or sets the collection of traffic routing rules. - */ - private List rules; - - /** - * Creates an instance of ApplicationTrafficRoutingPolicy class. - */ - public ApplicationTrafficRoutingPolicy() { - } - - /** - * Get the protocol property: Methodology used to route traffic to the application's deployments. - * - * @return the protocol value. - */ - public TrafficRoutingProtocol protocol() { - return this.protocol; - } - - /** - * Set the protocol property: Methodology used to route traffic to the application's deployments. - * - * @param protocol the protocol value to set. - * @return the ApplicationTrafficRoutingPolicy object itself. - */ - public ApplicationTrafficRoutingPolicy withProtocol(TrafficRoutingProtocol protocol) { - this.protocol = protocol; - return this; - } - - /** - * Get the rules property: Gets or sets the collection of traffic routing rules. - * - * @return the rules value. - */ - public List rules() { - return this.rules; - } - - /** - * Set the rules property: Gets or sets the collection of traffic routing rules. - * - * @param rules the rules value to set. - * @return the ApplicationTrafficRoutingPolicy object itself. - */ - public ApplicationTrafficRoutingPolicy withRules(List rules) { - this.rules = rules; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); - jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ApplicationTrafficRoutingPolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ApplicationTrafficRoutingPolicy 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 ApplicationTrafficRoutingPolicy. - */ - public static ApplicationTrafficRoutingPolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ApplicationTrafficRoutingPolicy deserializedApplicationTrafficRoutingPolicy - = new ApplicationTrafficRoutingPolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("protocol".equals(fieldName)) { - deserializedApplicationTrafficRoutingPolicy.protocol - = TrafficRoutingProtocol.fromString(reader.getString()); - } else if ("rules".equals(fieldName)) { - List rules = reader.readArray(reader1 -> TrafficRoutingRule.fromJson(reader1)); - deserializedApplicationTrafficRoutingPolicy.rules = rules; - } else { - reader.skipChildren(); - } - } - - return deserializedApplicationTrafficRoutingPolicy; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AssignedIdentity.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AssignedIdentity.java deleted file mode 100644 index 32660c23138a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AssignedIdentity.java +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Type representing an identity assignment. - */ -@Fluent -public final class AssignedIdentity implements JsonSerializable { - /* - * Specifies the kind of Entra identity described by this object. - */ - private IdentityKind kind; - - /* - * Enumeration of identity types, from the perspective of management. - */ - private IdentityManagementType type; - - /* - * The client ID of the identity. - */ - private String clientId; - - /* - * The principal ID of the identity. - */ - private String principalId; - - /* - * The tenant ID of the identity. - */ - private String tenantId; - - /* - * The subject of this identity assignment. - */ - private String subject; - - /* - * Represents the provisioning state of an identity resource. - */ - private IdentityProvisioningState provisioningState; - - /** - * Creates an instance of AssignedIdentity class. - */ - public AssignedIdentity() { - } - - /** - * Get the kind property: Specifies the kind of Entra identity described by this object. - * - * @return the kind value. - */ - public IdentityKind kind() { - return this.kind; - } - - /** - * Set the kind property: Specifies the kind of Entra identity described by this object. - * - * @param kind the kind value to set. - * @return the AssignedIdentity object itself. - */ - public AssignedIdentity withKind(IdentityKind kind) { - this.kind = kind; - return this; - } - - /** - * Get the type property: Enumeration of identity types, from the perspective of management. - * - * @return the type value. - */ - public IdentityManagementType type() { - return this.type; - } - - /** - * Set the type property: Enumeration of identity types, from the perspective of management. - * - * @param type the type value to set. - * @return the AssignedIdentity object itself. - */ - public AssignedIdentity withType(IdentityManagementType type) { - this.type = type; - return this; - } - - /** - * Get the clientId property: The client ID of the identity. - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * Set the clientId property: The client ID of the identity. - * - * @param clientId the clientId value to set. - * @return the AssignedIdentity object itself. - */ - public AssignedIdentity withClientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Get the principalId property: The principal ID of the identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Set the principalId property: The principal ID of the identity. - * - * @param principalId the principalId value to set. - * @return the AssignedIdentity object itself. - */ - public AssignedIdentity withPrincipalId(String principalId) { - this.principalId = principalId; - return this; - } - - /** - * Get the tenantId property: The tenant ID of the identity. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Set the tenantId property: The tenant ID of the identity. - * - * @param tenantId the tenantId value to set. - * @return the AssignedIdentity object itself. - */ - public AssignedIdentity withTenantId(String tenantId) { - this.tenantId = tenantId; - return this; - } - - /** - * Get the subject property: The subject of this identity assignment. - * - * @return the subject value. - */ - public String subject() { - return this.subject; - } - - /** - * Set the subject property: The subject of this identity assignment. - * - * @param subject the subject value to set. - * @return the AssignedIdentity object itself. - */ - public AssignedIdentity withSubject(String subject) { - this.subject = subject; - return this; - } - - /** - * Get the provisioningState property: Represents the provisioning state of an identity resource. - * - * @return the provisioningState value. - */ - public IdentityProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("clientId", this.clientId); - jsonWriter.writeStringField("principalId", this.principalId); - jsonWriter.writeStringField("tenantId", this.tenantId); - jsonWriter.writeStringField("subject", this.subject); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AssignedIdentity from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssignedIdentity 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 AssignedIdentity. - */ - public static AssignedIdentity fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssignedIdentity deserializedAssignedIdentity = new AssignedIdentity(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("kind".equals(fieldName)) { - deserializedAssignedIdentity.kind = IdentityKind.fromString(reader.getString()); - } else if ("type".equals(fieldName)) { - deserializedAssignedIdentity.type = IdentityManagementType.fromString(reader.getString()); - } else if ("clientId".equals(fieldName)) { - deserializedAssignedIdentity.clientId = reader.getString(); - } else if ("principalId".equals(fieldName)) { - deserializedAssignedIdentity.principalId = reader.getString(); - } else if ("tenantId".equals(fieldName)) { - deserializedAssignedIdentity.tenantId = reader.getString(); - } else if ("subject".equals(fieldName)) { - deserializedAssignedIdentity.subject = reader.getString(); - } else if ("provisioningState".equals(fieldName)) { - deserializedAssignedIdentity.provisioningState - = IdentityProvisioningState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAssignedIdentity; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/BillingMeterInfo.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/BillingMeterInfo.java deleted file mode 100644 index 84ac27ed78cd..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/BillingMeterInfo.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The BillingMeterInfo model. - */ -@Immutable -public final class BillingMeterInfo implements JsonSerializable { - /* - * The name property. - */ - private String name; - - /* - * The meterId property. - */ - private String meterId; - - /* - * The unit property. - */ - private String unit; - - /** - * Creates an instance of BillingMeterInfo class. - */ - private BillingMeterInfo() { - } - - /** - * Get the name property: The name property. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the meterId property: The meterId property. - * - * @return the meterId value. - */ - public String meterId() { - return this.meterId; - } - - /** - * Get the unit property: The unit property. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("meterId", this.meterId); - jsonWriter.writeStringField("unit", this.unit); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BillingMeterInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BillingMeterInfo 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 BillingMeterInfo. - */ - public static BillingMeterInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BillingMeterInfo deserializedBillingMeterInfo = new BillingMeterInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedBillingMeterInfo.name = reader.getString(); - } else if ("meterId".equals(fieldName)) { - deserializedBillingMeterInfo.meterId = reader.getString(); - } else if ("unit".equals(fieldName)) { - deserializedBillingMeterInfo.unit = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedBillingMeterInfo; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/BuiltInAuthorizationScheme.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/BuiltInAuthorizationScheme.java deleted file mode 100644 index a112108d2e69..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/BuiltInAuthorizationScheme.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Authorization scheme type. - */ -public final class BuiltInAuthorizationScheme extends ExpandableStringEnum { - /** - * Standard AzureML RBAC. - */ - public static final BuiltInAuthorizationScheme DEFAULT = fromString("Default"); - - /** - * Claim-based, requires membership in the tenant. - */ - public static final BuiltInAuthorizationScheme ORGANIZATION_SCOPE = fromString("OrganizationScope"); - - /** - * Channels-specific (AzureBotService) authorization. - */ - public static final BuiltInAuthorizationScheme CHANNELS = fromString("Channels"); - - /** - * Custom scheme defined by the application author. - */ - public static final BuiltInAuthorizationScheme CUSTOM = fromString("Custom"); - - /** - * Creates a new instance of BuiltInAuthorizationScheme value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public BuiltInAuthorizationScheme() { - } - - /** - * Creates or finds a BuiltInAuthorizationScheme from its string representation. - * - * @param name a name to look for. - * @return the corresponding BuiltInAuthorizationScheme. - */ - public static BuiltInAuthorizationScheme fromString(String name) { - return fromString(name, BuiltInAuthorizationScheme.class); - } - - /** - * Gets known BuiltInAuthorizationScheme values. - * - * @return known BuiltInAuthorizationScheme values. - */ - public static Collection values() { - return values(BuiltInAuthorizationScheme.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ByPassSelection.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ByPassSelection.java deleted file mode 100644 index 6125ba994344..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ByPassSelection.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Setting for trusted services. - */ -public final class ByPassSelection extends ExpandableStringEnum { - /** - * Static value None for ByPassSelection. - */ - public static final ByPassSelection NONE = fromString("None"); - - /** - * Static value AzureServices for ByPassSelection. - */ - public static final ByPassSelection AZURE_SERVICES = fromString("AzureServices"); - - /** - * Creates a new instance of ByPassSelection value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ByPassSelection() { - } - - /** - * Creates or finds a ByPassSelection from its string representation. - * - * @param name a name to look for. - * @return the corresponding ByPassSelection. - */ - public static ByPassSelection fromString(String name) { - return fromString(name, ByPassSelection.class); - } - - /** - * Gets known ByPassSelection values. - * - * @return known ByPassSelection values. - */ - public static Collection values() { - return values(ByPassSelection.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityParameter.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityParameter.java deleted file mode 100644 index 71dd4be17f73..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityParameter.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Calculate Model Capacity parameter. - */ -@Fluent -public final class CalculateModelCapacityParameter implements JsonSerializable { - /* - * Properties of Cognitive Services account deployment model. - */ - private DeploymentModel model; - - /* - * The name of SKU. - */ - private String skuName; - - /* - * List of Model Capacity Calculator Workload. - */ - private List workloads; - - /** - * Creates an instance of CalculateModelCapacityParameter class. - */ - public CalculateModelCapacityParameter() { - } - - /** - * Get the model property: Properties of Cognitive Services account deployment model. - * - * @return the model value. - */ - public DeploymentModel model() { - return this.model; - } - - /** - * Set the model property: Properties of Cognitive Services account deployment model. - * - * @param model the model value to set. - * @return the CalculateModelCapacityParameter object itself. - */ - public CalculateModelCapacityParameter withModel(DeploymentModel model) { - this.model = model; - return this; - } - - /** - * Get the skuName property: The name of SKU. - * - * @return the skuName value. - */ - public String skuName() { - return this.skuName; - } - - /** - * Set the skuName property: The name of SKU. - * - * @param skuName the skuName value to set. - * @return the CalculateModelCapacityParameter object itself. - */ - public CalculateModelCapacityParameter withSkuName(String skuName) { - this.skuName = skuName; - return this; - } - - /** - * Get the workloads property: List of Model Capacity Calculator Workload. - * - * @return the workloads value. - */ - public List workloads() { - return this.workloads; - } - - /** - * Set the workloads property: List of Model Capacity Calculator Workload. - * - * @param workloads the workloads value to set. - * @return the CalculateModelCapacityParameter object itself. - */ - public CalculateModelCapacityParameter withWorkloads(List workloads) { - this.workloads = workloads; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("model", this.model); - jsonWriter.writeStringField("skuName", this.skuName); - jsonWriter.writeArrayField("workloads", this.workloads, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CalculateModelCapacityParameter from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CalculateModelCapacityParameter 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 CalculateModelCapacityParameter. - */ - public static CalculateModelCapacityParameter fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CalculateModelCapacityParameter deserializedCalculateModelCapacityParameter - = new CalculateModelCapacityParameter(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("model".equals(fieldName)) { - deserializedCalculateModelCapacityParameter.model = DeploymentModel.fromJson(reader); - } else if ("skuName".equals(fieldName)) { - deserializedCalculateModelCapacityParameter.skuName = reader.getString(); - } else if ("workloads".equals(fieldName)) { - List workloads - = reader.readArray(reader1 -> ModelCapacityCalculatorWorkload.fromJson(reader1)); - deserializedCalculateModelCapacityParameter.workloads = workloads; - } else { - reader.skipChildren(); - } - } - - return deserializedCalculateModelCapacityParameter; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityResult.java deleted file mode 100644 index ad4021bf24d2..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityResult.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.CalculateModelCapacityResultInner; - -/** - * An immutable client-side representation of CalculateModelCapacityResult. - */ -public interface CalculateModelCapacityResult { - /** - * Gets the model property: Properties of Cognitive Services account deployment model. - * - * @return the model value. - */ - DeploymentModel model(); - - /** - * Gets the skuName property: The skuName property. - * - * @return the skuName value. - */ - String skuName(); - - /** - * Gets the estimatedCapacity property: Model Estimated Capacity. - * - * @return the estimatedCapacity value. - */ - CalculateModelCapacityResultEstimatedCapacity estimatedCapacity(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.CalculateModelCapacityResultInner - * object. - * - * @return the inner object. - */ - CalculateModelCapacityResultInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityResultEstimatedCapacity.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityResultEstimatedCapacity.java deleted file mode 100644 index a20cdd76827f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityResultEstimatedCapacity.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Model Estimated Capacity. - */ -@Immutable -public final class CalculateModelCapacityResultEstimatedCapacity - implements JsonSerializable { - /* - * The value property. - */ - private Integer value; - - /* - * The deployableValue property. - */ - private Integer deployableValue; - - /** - * Creates an instance of CalculateModelCapacityResultEstimatedCapacity class. - */ - private CalculateModelCapacityResultEstimatedCapacity() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public Integer value() { - return this.value; - } - - /** - * Get the deployableValue property: The deployableValue property. - * - * @return the deployableValue value. - */ - public Integer deployableValue() { - return this.deployableValue; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("value", this.value); - jsonWriter.writeNumberField("deployableValue", this.deployableValue); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CalculateModelCapacityResultEstimatedCapacity from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CalculateModelCapacityResultEstimatedCapacity 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 CalculateModelCapacityResultEstimatedCapacity. - */ - public static CalculateModelCapacityResultEstimatedCapacity fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CalculateModelCapacityResultEstimatedCapacity deserializedCalculateModelCapacityResultEstimatedCapacity - = new CalculateModelCapacityResultEstimatedCapacity(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - deserializedCalculateModelCapacityResultEstimatedCapacity.value - = reader.getNullable(JsonReader::getInt); - } else if ("deployableValue".equals(fieldName)) { - deserializedCalculateModelCapacityResultEstimatedCapacity.deployableValue - = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedCalculateModelCapacityResultEstimatedCapacity; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CallRateLimit.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CallRateLimit.java deleted file mode 100644 index 2860da0df016..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CallRateLimit.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * The call rate limit Cognitive Services account. - */ -@Immutable -public final class CallRateLimit implements JsonSerializable { - /* - * The count value of Call Rate Limit. - */ - private Float count; - - /* - * The renewal period in seconds of Call Rate Limit. - */ - private Float renewalPeriod; - - /* - * The rules property. - */ - private List rules; - - /** - * Creates an instance of CallRateLimit class. - */ - private CallRateLimit() { - } - - /** - * Get the count property: The count value of Call Rate Limit. - * - * @return the count value. - */ - public Float count() { - return this.count; - } - - /** - * Get the renewalPeriod property: The renewal period in seconds of Call Rate Limit. - * - * @return the renewalPeriod value. - */ - public Float renewalPeriod() { - return this.renewalPeriod; - } - - /** - * Get the rules property: The rules property. - * - * @return the rules value. - */ - public List rules() { - return this.rules; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("count", this.count); - jsonWriter.writeNumberField("renewalPeriod", this.renewalPeriod); - jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CallRateLimit from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CallRateLimit 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 CallRateLimit. - */ - public static CallRateLimit fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CallRateLimit deserializedCallRateLimit = new CallRateLimit(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("count".equals(fieldName)) { - deserializedCallRateLimit.count = reader.getNullable(JsonReader::getFloat); - } else if ("renewalPeriod".equals(fieldName)) { - deserializedCallRateLimit.renewalPeriod = reader.getNullable(JsonReader::getFloat); - } else if ("rules".equals(fieldName)) { - List rules = reader.readArray(reader1 -> ThrottlingRule.fromJson(reader1)); - deserializedCallRateLimit.rules = rules; - } else { - reader.skipChildren(); - } - } - - return deserializedCallRateLimit; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHost.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHost.java deleted file mode 100644 index 20c1f7daa6ea..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHost.java +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; - -/** - * An immutable client-side representation of CapabilityHost. - */ -public interface CapabilityHost { - /** - * 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: [Required] Additional attributes of the entity. - * - * @return the properties value. - */ - CapabilityHostProperties properties(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner object. - * - * @return the inner object. - */ - CapabilityHostInner innerModel(); - - /** - * The entirety of the CapabilityHost definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, DefinitionStages.WithCreate { - } - - /** - * The CapabilityHost definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the CapabilityHost definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the CapabilityHost definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, accountName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @return the next definition stage. - */ - WithProperties withExistingAccount(String resourceGroupName, String accountName); - } - - /** - * The stage of the CapabilityHost definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: [Required] Additional attributes of the entity.. - * - * @param properties [Required] Additional attributes of the entity. - * @return the next definition stage. - */ - WithCreate withProperties(CapabilityHostProperties properties); - } - - /** - * The stage of the CapabilityHost 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 { - /** - * Executes the create request. - * - * @return the created resource. - */ - CapabilityHost create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - CapabilityHost create(Context context); - } - } - - /** - * Begins update for the CapabilityHost resource. - * - * @return the stage of resource update. - */ - CapabilityHost.Update update(); - - /** - * The template for CapabilityHost update. - */ - interface Update extends UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - CapabilityHost apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - CapabilityHost apply(Context context); - } - - /** - * The CapabilityHost update stages. - */ - interface UpdateStages { - /** - * The stage of the CapabilityHost update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: [Required] Additional attributes of the entity.. - * - * @param properties [Required] Additional attributes of the entity. - * @return the next definition stage. - */ - Update withProperties(CapabilityHostProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - CapabilityHost refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - CapabilityHost refresh(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostKind.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostKind.java deleted file mode 100644 index edeccef85a52..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostKind.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for CapabilityHostKind. - */ -public final class CapabilityHostKind extends ExpandableStringEnum { - /** - * Static value Agents for CapabilityHostKind. - */ - public static final CapabilityHostKind AGENTS = fromString("Agents"); - - /** - * Creates a new instance of CapabilityHostKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public CapabilityHostKind() { - } - - /** - * Creates or finds a CapabilityHostKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding CapabilityHostKind. - */ - public static CapabilityHostKind fromString(String name) { - return fromString(name, CapabilityHostKind.class); - } - - /** - * Gets known CapabilityHostKind values. - * - * @return known CapabilityHostKind values. - */ - public static Collection values() { - return values(CapabilityHostKind.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProperties.java deleted file mode 100644 index d24abccebeb8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProperties.java +++ /dev/null @@ -1,316 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * The CapabilityHostProperties model. - */ -@Fluent -public final class CapabilityHostProperties extends ResourceBase { - /* - * List of AI services connections. - */ - private List aiServicesConnections; - - /* - * Kind of this capability host. - */ - private CapabilityHostKind capabilityHostKind; - - /* - * Customer subnet info to help set up this capability host. - */ - private String customerSubnet; - - /* - * Provisioning state for the CapabilityHost. - */ - private CapabilityHostProvisioningState provisioningState; - - /* - * List of connection names from those available in the account or project to be used as a storage resource. - */ - private List storageConnections; - - /* - * List of connection names from those available in the account or project to be used for Thread storage. - */ - private List threadStorageConnections; - - /* - * List of connection names from those available in the account or project to be used for vector database (e.g. - * CosmosDB). - */ - private List vectorStoreConnections; - - /* - * Whether public hosting environment is enabled for the capability host - */ - private Boolean enablePublicHostingEnvironment; - - /** - * Creates an instance of CapabilityHostProperties class. - */ - public CapabilityHostProperties() { - } - - /** - * Get the aiServicesConnections property: List of AI services connections. - * - * @return the aiServicesConnections value. - */ - public List aiServicesConnections() { - return this.aiServicesConnections; - } - - /** - * Set the aiServicesConnections property: List of AI services connections. - * - * @param aiServicesConnections the aiServicesConnections value to set. - * @return the CapabilityHostProperties object itself. - */ - public CapabilityHostProperties withAiServicesConnections(List aiServicesConnections) { - this.aiServicesConnections = aiServicesConnections; - return this; - } - - /** - * Get the capabilityHostKind property: Kind of this capability host. - * - * @return the capabilityHostKind value. - */ - public CapabilityHostKind capabilityHostKind() { - return this.capabilityHostKind; - } - - /** - * Set the capabilityHostKind property: Kind of this capability host. - * - * @param capabilityHostKind the capabilityHostKind value to set. - * @return the CapabilityHostProperties object itself. - */ - public CapabilityHostProperties withCapabilityHostKind(CapabilityHostKind capabilityHostKind) { - this.capabilityHostKind = capabilityHostKind; - return this; - } - - /** - * Get the customerSubnet property: Customer subnet info to help set up this capability host. - * - * @return the customerSubnet value. - */ - public String customerSubnet() { - return this.customerSubnet; - } - - /** - * Set the customerSubnet property: Customer subnet info to help set up this capability host. - * - * @param customerSubnet the customerSubnet value to set. - * @return the CapabilityHostProperties object itself. - */ - public CapabilityHostProperties withCustomerSubnet(String customerSubnet) { - this.customerSubnet = customerSubnet; - return this; - } - - /** - * Get the provisioningState property: Provisioning state for the CapabilityHost. - * - * @return the provisioningState value. - */ - public CapabilityHostProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the storageConnections property: List of connection names from those available in the account or project to - * be used as a storage resource. - * - * @return the storageConnections value. - */ - public List storageConnections() { - return this.storageConnections; - } - - /** - * Set the storageConnections property: List of connection names from those available in the account or project to - * be used as a storage resource. - * - * @param storageConnections the storageConnections value to set. - * @return the CapabilityHostProperties object itself. - */ - public CapabilityHostProperties withStorageConnections(List storageConnections) { - this.storageConnections = storageConnections; - return this; - } - - /** - * Get the threadStorageConnections property: List of connection names from those available in the account or - * project to be used for Thread storage. - * - * @return the threadStorageConnections value. - */ - public List threadStorageConnections() { - return this.threadStorageConnections; - } - - /** - * Set the threadStorageConnections property: List of connection names from those available in the account or - * project to be used for Thread storage. - * - * @param threadStorageConnections the threadStorageConnections value to set. - * @return the CapabilityHostProperties object itself. - */ - public CapabilityHostProperties withThreadStorageConnections(List threadStorageConnections) { - this.threadStorageConnections = threadStorageConnections; - return this; - } - - /** - * Get the vectorStoreConnections property: List of connection names from those available in the account or project - * to be used for vector database (e.g. CosmosDB). - * - * @return the vectorStoreConnections value. - */ - public List vectorStoreConnections() { - return this.vectorStoreConnections; - } - - /** - * Set the vectorStoreConnections property: List of connection names from those available in the account or project - * to be used for vector database (e.g. CosmosDB). - * - * @param vectorStoreConnections the vectorStoreConnections value to set. - * @return the CapabilityHostProperties object itself. - */ - public CapabilityHostProperties withVectorStoreConnections(List vectorStoreConnections) { - this.vectorStoreConnections = vectorStoreConnections; - return this; - } - - /** - * Get the enablePublicHostingEnvironment property: Whether public hosting environment is enabled for the capability - * host. - * - * @return the enablePublicHostingEnvironment value. - */ - public Boolean enablePublicHostingEnvironment() { - return this.enablePublicHostingEnvironment; - } - - /** - * Set the enablePublicHostingEnvironment property: Whether public hosting environment is enabled for the capability - * host. - * - * @param enablePublicHostingEnvironment the enablePublicHostingEnvironment value to set. - * @return the CapabilityHostProperties object itself. - */ - public CapabilityHostProperties withEnablePublicHostingEnvironment(Boolean enablePublicHostingEnvironment) { - this.enablePublicHostingEnvironment = enablePublicHostingEnvironment; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CapabilityHostProperties withDescription(String description) { - super.withDescription(description); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CapabilityHostProperties withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("description", description()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeArrayField("aiServicesConnections", this.aiServicesConnections, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("capabilityHostKind", - this.capabilityHostKind == null ? null : this.capabilityHostKind.toString()); - jsonWriter.writeStringField("customerSubnet", this.customerSubnet); - jsonWriter.writeArrayField("storageConnections", this.storageConnections, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeArrayField("threadStorageConnections", this.threadStorageConnections, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeArrayField("vectorStoreConnections", this.vectorStoreConnections, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("enablePublicHostingEnvironment", this.enablePublicHostingEnvironment); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CapabilityHostProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CapabilityHostProperties 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 CapabilityHostProperties. - */ - public static CapabilityHostProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CapabilityHostProperties deserializedCapabilityHostProperties = new CapabilityHostProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedCapabilityHostProperties.withDescription(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedCapabilityHostProperties.withTags(tags); - } else if ("aiServicesConnections".equals(fieldName)) { - List aiServicesConnections = reader.readArray(reader1 -> reader1.getString()); - deserializedCapabilityHostProperties.aiServicesConnections = aiServicesConnections; - } else if ("capabilityHostKind".equals(fieldName)) { - deserializedCapabilityHostProperties.capabilityHostKind - = CapabilityHostKind.fromString(reader.getString()); - } else if ("customerSubnet".equals(fieldName)) { - deserializedCapabilityHostProperties.customerSubnet = reader.getString(); - } else if ("provisioningState".equals(fieldName)) { - deserializedCapabilityHostProperties.provisioningState - = CapabilityHostProvisioningState.fromString(reader.getString()); - } else if ("storageConnections".equals(fieldName)) { - List storageConnections = reader.readArray(reader1 -> reader1.getString()); - deserializedCapabilityHostProperties.storageConnections = storageConnections; - } else if ("threadStorageConnections".equals(fieldName)) { - List threadStorageConnections = reader.readArray(reader1 -> reader1.getString()); - deserializedCapabilityHostProperties.threadStorageConnections = threadStorageConnections; - } else if ("vectorStoreConnections".equals(fieldName)) { - List vectorStoreConnections = reader.readArray(reader1 -> reader1.getString()); - deserializedCapabilityHostProperties.vectorStoreConnections = vectorStoreConnections; - } else if ("enablePublicHostingEnvironment".equals(fieldName)) { - deserializedCapabilityHostProperties.enablePublicHostingEnvironment - = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedCapabilityHostProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProvisioningState.java deleted file mode 100644 index 746f155e22ff..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProvisioningState.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Provisioning state of capability host. - */ -public final class CapabilityHostProvisioningState extends ExpandableStringEnum { - /** - * Static value Succeeded for CapabilityHostProvisioningState. - */ - public static final CapabilityHostProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Failed for CapabilityHostProvisioningState. - */ - public static final CapabilityHostProvisioningState FAILED = fromString("Failed"); - - /** - * Static value Canceled for CapabilityHostProvisioningState. - */ - public static final CapabilityHostProvisioningState CANCELED = fromString("Canceled"); - - /** - * Static value Creating for CapabilityHostProvisioningState. - */ - public static final CapabilityHostProvisioningState CREATING = fromString("Creating"); - - /** - * Static value Updating for CapabilityHostProvisioningState. - */ - public static final CapabilityHostProvisioningState UPDATING = fromString("Updating"); - - /** - * Static value Deleting for CapabilityHostProvisioningState. - */ - public static final CapabilityHostProvisioningState DELETING = fromString("Deleting"); - - /** - * Creates a new instance of CapabilityHostProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public CapabilityHostProvisioningState() { - } - - /** - * Creates or finds a CapabilityHostProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding CapabilityHostProvisioningState. - */ - public static CapabilityHostProvisioningState fromString(String name) { - return fromString(name, CapabilityHostProvisioningState.class); - } - - /** - * Gets known CapabilityHostProvisioningState values. - * - * @return known CapabilityHostProvisioningState values. - */ - public static Collection values() { - return values(CapabilityHostProvisioningState.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapacityConfig.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapacityConfig.java deleted file mode 100644 index 938a31b66724..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapacityConfig.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * The capacity configuration. - */ -@Immutable -public final class CapacityConfig implements JsonSerializable { - /* - * The minimum capacity. - */ - private Integer minimum; - - /* - * The maximum capacity. - */ - private Integer maximum; - - /* - * The minimal incremental between allowed values for capacity. - */ - private Integer step; - - /* - * The default capacity. - */ - private Integer defaultProperty; - - /* - * The array of allowed values for capacity. - */ - private List allowedValues; - - /** - * Creates an instance of CapacityConfig class. - */ - private CapacityConfig() { - } - - /** - * Get the minimum property: The minimum capacity. - * - * @return the minimum value. - */ - public Integer minimum() { - return this.minimum; - } - - /** - * Get the maximum property: The maximum capacity. - * - * @return the maximum value. - */ - public Integer maximum() { - return this.maximum; - } - - /** - * Get the step property: The minimal incremental between allowed values for capacity. - * - * @return the step value. - */ - public Integer step() { - return this.step; - } - - /** - * Get the defaultProperty property: The default capacity. - * - * @return the defaultProperty value. - */ - public Integer defaultProperty() { - return this.defaultProperty; - } - - /** - * Get the allowedValues property: The array of allowed values for capacity. - * - * @return the allowedValues value. - */ - public List allowedValues() { - return this.allowedValues; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("minimum", this.minimum); - jsonWriter.writeNumberField("maximum", this.maximum); - jsonWriter.writeNumberField("step", this.step); - jsonWriter.writeNumberField("default", this.defaultProperty); - jsonWriter.writeArrayField("allowedValues", this.allowedValues, (writer, element) -> writer.writeInt(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CapacityConfig from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CapacityConfig 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 CapacityConfig. - */ - public static CapacityConfig fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CapacityConfig deserializedCapacityConfig = new CapacityConfig(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("minimum".equals(fieldName)) { - deserializedCapacityConfig.minimum = reader.getNullable(JsonReader::getInt); - } else if ("maximum".equals(fieldName)) { - deserializedCapacityConfig.maximum = reader.getNullable(JsonReader::getInt); - } else if ("step".equals(fieldName)) { - deserializedCapacityConfig.step = reader.getNullable(JsonReader::getInt); - } else if ("default".equals(fieldName)) { - deserializedCapacityConfig.defaultProperty = reader.getNullable(JsonReader::getInt); - } else if ("allowedValues".equals(fieldName)) { - List allowedValues = reader.readArray(reader1 -> reader1.getInt()); - deserializedCapacityConfig.allowedValues = allowedValues; - } else { - reader.skipChildren(); - } - } - - return deserializedCapacityConfig; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ChannelsBuiltInAuthorizationPolicy.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ChannelsBuiltInAuthorizationPolicy.java deleted file mode 100644 index 30796c87ca50..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ChannelsBuiltInAuthorizationPolicy.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Represents a built-in authorization policy specific to Azure Bot Service/Channels authentication. - */ -@Immutable -public final class ChannelsBuiltInAuthorizationPolicy extends ApplicationAuthorizationPolicy { - /* - * Authorization scheme type. - */ - private BuiltInAuthorizationScheme type = BuiltInAuthorizationScheme.CHANNELS; - - /** - * Creates an instance of ChannelsBuiltInAuthorizationPolicy class. - */ - public ChannelsBuiltInAuthorizationPolicy() { - } - - /** - * Get the type property: Authorization scheme type. - * - * @return the type value. - */ - @Override - public BuiltInAuthorizationScheme type() { - return this.type; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ChannelsBuiltInAuthorizationPolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ChannelsBuiltInAuthorizationPolicy 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 ChannelsBuiltInAuthorizationPolicy. - */ - public static ChannelsBuiltInAuthorizationPolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ChannelsBuiltInAuthorizationPolicy deserializedChannelsBuiltInAuthorizationPolicy - = new ChannelsBuiltInAuthorizationPolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedChannelsBuiltInAuthorizationPolicy.type - = BuiltInAuthorizationScheme.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedChannelsBuiltInAuthorizationPolicy; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CheckDomainAvailabilityParameter.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CheckDomainAvailabilityParameter.java deleted file mode 100644 index a198152e0be5..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CheckDomainAvailabilityParameter.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Check Domain availability parameter. - */ -@Fluent -public final class CheckDomainAvailabilityParameter implements JsonSerializable { - /* - * The subdomain name to use. - */ - private String subdomainName; - - /* - * The Type of the resource. - */ - private String type; - - /* - * The kind (type) of cognitive service account. - */ - private String kind; - - /** - * Creates an instance of CheckDomainAvailabilityParameter class. - */ - public CheckDomainAvailabilityParameter() { - } - - /** - * Get the subdomainName property: The subdomain name to use. - * - * @return the subdomainName value. - */ - public String subdomainName() { - return this.subdomainName; - } - - /** - * Set the subdomainName property: The subdomain name to use. - * - * @param subdomainName the subdomainName value to set. - * @return the CheckDomainAvailabilityParameter object itself. - */ - public CheckDomainAvailabilityParameter withSubdomainName(String subdomainName) { - this.subdomainName = subdomainName; - return this; - } - - /** - * Get the type property: The Type of the resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: The Type of the resource. - * - * @param type the type value to set. - * @return the CheckDomainAvailabilityParameter object itself. - */ - public CheckDomainAvailabilityParameter withType(String type) { - this.type = type; - return this; - } - - /** - * Get the kind property: The kind (type) of cognitive service account. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: The kind (type) of cognitive service account. - * - * @param kind the kind value to set. - * @return the CheckDomainAvailabilityParameter object itself. - */ - public CheckDomainAvailabilityParameter withKind(String kind) { - this.kind = kind; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("subdomainName", this.subdomainName); - jsonWriter.writeStringField("type", this.type); - jsonWriter.writeStringField("kind", this.kind); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CheckDomainAvailabilityParameter from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CheckDomainAvailabilityParameter 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 CheckDomainAvailabilityParameter. - */ - public static CheckDomainAvailabilityParameter fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CheckDomainAvailabilityParameter deserializedCheckDomainAvailabilityParameter - = new CheckDomainAvailabilityParameter(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("subdomainName".equals(fieldName)) { - deserializedCheckDomainAvailabilityParameter.subdomainName = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedCheckDomainAvailabilityParameter.type = reader.getString(); - } else if ("kind".equals(fieldName)) { - deserializedCheckDomainAvailabilityParameter.kind = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCheckDomainAvailabilityParameter; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CheckSkuAvailabilityParameter.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CheckSkuAvailabilityParameter.java deleted file mode 100644 index cd780867bbcc..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CheckSkuAvailabilityParameter.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Check SKU availability parameter. - */ -@Fluent -public final class CheckSkuAvailabilityParameter implements JsonSerializable { - /* - * The SKU of the resource. - */ - private List skus; - - /* - * The kind (type) of cognitive service account. - */ - private String kind; - - /* - * The Type of the resource. - */ - private String type; - - /** - * Creates an instance of CheckSkuAvailabilityParameter class. - */ - public CheckSkuAvailabilityParameter() { - } - - /** - * Get the skus property: The SKU of the resource. - * - * @return the skus value. - */ - public List skus() { - return this.skus; - } - - /** - * Set the skus property: The SKU of the resource. - * - * @param skus the skus value to set. - * @return the CheckSkuAvailabilityParameter object itself. - */ - public CheckSkuAvailabilityParameter withSkus(List skus) { - this.skus = skus; - return this; - } - - /** - * Get the kind property: The kind (type) of cognitive service account. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: The kind (type) of cognitive service account. - * - * @param kind the kind value to set. - * @return the CheckSkuAvailabilityParameter object itself. - */ - public CheckSkuAvailabilityParameter withKind(String kind) { - this.kind = kind; - return this; - } - - /** - * Get the type property: The Type of the resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: The Type of the resource. - * - * @param type the type value to set. - * @return the CheckSkuAvailabilityParameter object itself. - */ - public CheckSkuAvailabilityParameter withType(String type) { - this.type = type; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("skus", this.skus, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("kind", this.kind); - jsonWriter.writeStringField("type", this.type); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CheckSkuAvailabilityParameter from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CheckSkuAvailabilityParameter 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 CheckSkuAvailabilityParameter. - */ - public static CheckSkuAvailabilityParameter fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CheckSkuAvailabilityParameter deserializedCheckSkuAvailabilityParameter - = new CheckSkuAvailabilityParameter(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("skus".equals(fieldName)) { - List skus = reader.readArray(reader1 -> reader1.getString()); - deserializedCheckSkuAvailabilityParameter.skus = skus; - } else if ("kind".equals(fieldName)) { - deserializedCheckSkuAvailabilityParameter.kind = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedCheckSkuAvailabilityParameter.type = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCheckSkuAvailabilityParameter; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ClusterComputeProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ClusterComputeProperties.java deleted file mode 100644 index 03b0c92039b8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ClusterComputeProperties.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Properties for a Cluster (AKS-backed) compute resource. - */ -@Fluent -public final class ClusterComputeProperties extends ComputeProperties { - /* - * The type of compute resource. - */ - private ComputeType computeType = ComputeType.CLUSTER; - - /* - * Pools attached to this compute cluster. - */ - private List pools; - - /* - * ARM ID of the subnet used for compute. - */ - private String subnetArmId; - - /** - * Creates an instance of ClusterComputeProperties class. - */ - public ClusterComputeProperties() { - } - - /** - * Get the computeType property: The type of compute resource. - * - * @return the computeType value. - */ - @Override - public ComputeType computeType() { - return this.computeType; - } - - /** - * Get the pools property: Pools attached to this compute cluster. - * - * @return the pools value. - */ - public List pools() { - return this.pools; - } - - /** - * Set the pools property: Pools attached to this compute cluster. - * - * @param pools the pools value to set. - * @return the ClusterComputeProperties object itself. - */ - public ClusterComputeProperties withPools(List pools) { - this.pools = pools; - return this; - } - - /** - * Get the subnetArmId property: ARM ID of the subnet used for compute. - * - * @return the subnetArmId value. - */ - public String subnetArmId() { - return this.subnetArmId; - } - - /** - * Set the subnetArmId property: ARM ID of the subnet used for compute. - * - * @param subnetArmId the subnetArmId value to set. - * @return the ClusterComputeProperties object itself. - */ - public ClusterComputeProperties withSubnetArmId(String subnetArmId) { - this.subnetArmId = subnetArmId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("pools", this.pools, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("computeType", this.computeType == null ? null : this.computeType.toString()); - jsonWriter.writeStringField("subnetArmId", this.subnetArmId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ClusterComputeProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ClusterComputeProperties 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 ClusterComputeProperties. - */ - public static ClusterComputeProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ClusterComputeProperties deserializedClusterComputeProperties = new ClusterComputeProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningState".equals(fieldName)) { - deserializedClusterComputeProperties - .withProvisioningState(ComputeProvisioningState.fromString(reader.getString())); - } else if ("errors".equals(fieldName)) { - List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); - deserializedClusterComputeProperties.withErrors(errors); - } else if ("creationTime".equals(fieldName)) { - deserializedClusterComputeProperties.withCreationTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("pools".equals(fieldName)) { - List pools = reader.readArray(reader1 -> Pool.fromJson(reader1)); - deserializedClusterComputeProperties.pools = pools; - } else if ("computeType".equals(fieldName)) { - deserializedClusterComputeProperties.computeType = ComputeType.fromString(reader.getString()); - } else if ("subnetArmId".equals(fieldName)) { - deserializedClusterComputeProperties.subnetArmId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedClusterComputeProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentCost.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentCost.java deleted file mode 100644 index f05fc9b6a00a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentCost.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Cognitive Services account commitment cost. - */ -@Immutable -public final class CommitmentCost implements JsonSerializable { - /* - * Commitment meter Id. - */ - private String commitmentMeterId; - - /* - * Overage meter Id. - */ - private String overageMeterId; - - /** - * Creates an instance of CommitmentCost class. - */ - private CommitmentCost() { - } - - /** - * Get the commitmentMeterId property: Commitment meter Id. - * - * @return the commitmentMeterId value. - */ - public String commitmentMeterId() { - return this.commitmentMeterId; - } - - /** - * Get the overageMeterId property: Overage meter Id. - * - * @return the overageMeterId value. - */ - public String overageMeterId() { - return this.overageMeterId; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("commitmentMeterId", this.commitmentMeterId); - jsonWriter.writeStringField("overageMeterId", this.overageMeterId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CommitmentCost from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CommitmentCost 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 CommitmentCost. - */ - public static CommitmentCost fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CommitmentCost deserializedCommitmentCost = new CommitmentCost(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("commitmentMeterId".equals(fieldName)) { - deserializedCommitmentCost.commitmentMeterId = reader.getString(); - } else if ("overageMeterId".equals(fieldName)) { - deserializedCommitmentCost.overageMeterId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCommitmentCost; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPeriod.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPeriod.java deleted file mode 100644 index 5f844962064c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPeriod.java +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Cognitive Services account commitment period. - */ -@Fluent -public final class CommitmentPeriod implements JsonSerializable { - /* - * Commitment period commitment tier. - */ - private String tier; - - /* - * Commitment period commitment count. - */ - private Integer count; - - /* - * Cognitive Services account commitment quota. - */ - private CommitmentQuota quota; - - /* - * Commitment period start date. - */ - private String startDate; - - /* - * Commitment period end date. - */ - private String endDate; - - /** - * Creates an instance of CommitmentPeriod class. - */ - public CommitmentPeriod() { - } - - /** - * Get the tier property: Commitment period commitment tier. - * - * @return the tier value. - */ - public String tier() { - return this.tier; - } - - /** - * Set the tier property: Commitment period commitment tier. - * - * @param tier the tier value to set. - * @return the CommitmentPeriod object itself. - */ - public CommitmentPeriod withTier(String tier) { - this.tier = tier; - return this; - } - - /** - * Get the count property: Commitment period commitment count. - * - * @return the count value. - */ - public Integer count() { - return this.count; - } - - /** - * Set the count property: Commitment period commitment count. - * - * @param count the count value to set. - * @return the CommitmentPeriod object itself. - */ - public CommitmentPeriod withCount(Integer count) { - this.count = count; - return this; - } - - /** - * Get the quota property: Cognitive Services account commitment quota. - * - * @return the quota value. - */ - public CommitmentQuota quota() { - return this.quota; - } - - /** - * Get the startDate property: Commitment period start date. - * - * @return the startDate value. - */ - public String startDate() { - return this.startDate; - } - - /** - * Get the endDate property: Commitment period end date. - * - * @return the endDate value. - */ - public String endDate() { - return this.endDate; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("tier", this.tier); - jsonWriter.writeNumberField("count", this.count); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CommitmentPeriod from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CommitmentPeriod 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 CommitmentPeriod. - */ - public static CommitmentPeriod fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CommitmentPeriod deserializedCommitmentPeriod = new CommitmentPeriod(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("tier".equals(fieldName)) { - deserializedCommitmentPeriod.tier = reader.getString(); - } else if ("count".equals(fieldName)) { - deserializedCommitmentPeriod.count = reader.getNullable(JsonReader::getInt); - } else if ("quota".equals(fieldName)) { - deserializedCommitmentPeriod.quota = CommitmentQuota.fromJson(reader); - } else if ("startDate".equals(fieldName)) { - deserializedCommitmentPeriod.startDate = reader.getString(); - } else if ("endDate".equals(fieldName)) { - deserializedCommitmentPeriod.endDate = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCommitmentPeriod; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlan.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlan.java deleted file mode 100644 index 751ca56e018a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlan.java +++ /dev/null @@ -1,313 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner; -import java.util.Map; - -/** - * An immutable client-side representation of CommitmentPlan. - */ -public interface CommitmentPlan { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Properties of Cognitive Services account commitment plan. - * - * @return the properties value. - */ - CommitmentPlanProperties properties(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the etag property: Resource Etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the kind property: The kind (type) of cognitive service account. - * - * @return the kind value. - */ - String kind(); - - /** - * Gets the sku property: The resource model definition representing SKU. - * - * @return the sku value. - */ - Sku sku(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner object. - * - * @return the inner object. - */ - CommitmentPlanInner innerModel(); - - /** - * The entirety of the CommitmentPlan definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { - } - - /** - * The CommitmentPlan definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the CommitmentPlan definition. - */ - interface Blank extends WithResourceGroup { - } - - /** - * The stage of the CommitmentPlan definition allowing to specify parent resource. - */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @return the next definition stage. - */ - WithCreate withExistingResourceGroup(String resourceGroupName); - } - - /** - * The stage of the CommitmentPlan 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.WithLocation, DefinitionStages.WithTags, - DefinitionStages.WithProperties, DefinitionStages.WithKind, DefinitionStages.WithSku { - /** - * Executes the create request. - * - * @return the created resource. - */ - CommitmentPlan create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - CommitmentPlan create(Context context); - } - - /** - * The stage of the CommitmentPlan definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(String location); - } - - /** - * The stage of the CommitmentPlan definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the CommitmentPlan definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of Cognitive Services account commitment plan.. - * - * @param properties Properties of Cognitive Services account commitment plan. - * @return the next definition stage. - */ - WithCreate withProperties(CommitmentPlanProperties properties); - } - - /** - * The stage of the CommitmentPlan definition allowing to specify kind. - */ - interface WithKind { - /** - * Specifies the kind property: The kind (type) of cognitive service account.. - * - * @param kind The kind (type) of cognitive service account. - * @return the next definition stage. - */ - WithCreate withKind(String kind); - } - - /** - * The stage of the CommitmentPlan definition allowing to specify sku. - */ - interface WithSku { - /** - * Specifies the sku property: The resource model definition representing SKU. - * - * @param sku The resource model definition representing SKU. - * @return the next definition stage. - */ - WithCreate withSku(Sku sku); - } - } - - /** - * Begins update for the CommitmentPlan resource. - * - * @return the stage of resource update. - */ - CommitmentPlan.Update update(); - - /** - * The template for CommitmentPlan update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithSku { - /** - * Executes the update request. - * - * @return the updated resource. - */ - CommitmentPlan apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - CommitmentPlan apply(Context context); - } - - /** - * The CommitmentPlan update stages. - */ - interface UpdateStages { - /** - * The stage of the CommitmentPlan update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the CommitmentPlan update allowing to specify sku. - */ - interface WithSku { - /** - * Specifies the sku property: The resource model definition representing SKU. - * - * @param sku The resource model definition representing SKU. - * @return the next definition stage. - */ - Update withSku(Sku sku); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - CommitmentPlan refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - CommitmentPlan refresh(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAccountAssociation.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAccountAssociation.java deleted file mode 100644 index b5ca01ea5499..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAccountAssociation.java +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanAccountAssociationInner; -import java.util.Map; - -/** - * An immutable client-side representation of CommitmentPlanAccountAssociation. - */ -public interface CommitmentPlanAccountAssociation { - /** - * 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 etag property: Resource Etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the accountId property: The Azure resource id of the account. - * - * @return the accountId value. - */ - String accountId(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanAccountAssociationInner - * object. - * - * @return the inner object. - */ - CommitmentPlanAccountAssociationInner innerModel(); - - /** - * The entirety of the CommitmentPlanAccountAssociation definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The CommitmentPlanAccountAssociation definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the CommitmentPlanAccountAssociation definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the CommitmentPlanAccountAssociation definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, commitmentPlanName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @return the next definition stage. - */ - WithCreate withExistingCommitmentPlan(String resourceGroupName, String commitmentPlanName); - } - - /** - * The stage of the CommitmentPlanAccountAssociation 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.WithTags, DefinitionStages.WithAccountId { - /** - * Executes the create request. - * - * @return the created resource. - */ - CommitmentPlanAccountAssociation create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - CommitmentPlanAccountAssociation create(Context context); - } - - /** - * The stage of the CommitmentPlanAccountAssociation definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the CommitmentPlanAccountAssociation definition allowing to specify accountId. - */ - interface WithAccountId { - /** - * Specifies the accountId property: The Azure resource id of the account.. - * - * @param accountId The Azure resource id of the account. - * @return the next definition stage. - */ - WithCreate withAccountId(String accountId); - } - } - - /** - * Begins update for the CommitmentPlanAccountAssociation resource. - * - * @return the stage of resource update. - */ - CommitmentPlanAccountAssociation.Update update(); - - /** - * The template for CommitmentPlanAccountAssociation update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithAccountId { - /** - * Executes the update request. - * - * @return the updated resource. - */ - CommitmentPlanAccountAssociation apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - CommitmentPlanAccountAssociation apply(Context context); - } - - /** - * The CommitmentPlanAccountAssociation update stages. - */ - interface UpdateStages { - /** - * The stage of the CommitmentPlanAccountAssociation update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the CommitmentPlanAccountAssociation update allowing to specify accountId. - */ - interface WithAccountId { - /** - * Specifies the accountId property: The Azure resource id of the account.. - * - * @param accountId The Azure resource id of the account. - * @return the next definition stage. - */ - Update withAccountId(String accountId); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - CommitmentPlanAccountAssociation refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - CommitmentPlanAccountAssociation refresh(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAssociation.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAssociation.java deleted file mode 100644 index 1c3dcb0e12c9..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAssociation.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The commitment plan association. - */ -@Immutable -public final class CommitmentPlanAssociation implements JsonSerializable { - /* - * The Azure resource id of the commitment plan. - */ - private String commitmentPlanId; - - /* - * The location of of the commitment plan. - */ - private String commitmentPlanLocation; - - /** - * Creates an instance of CommitmentPlanAssociation class. - */ - private CommitmentPlanAssociation() { - } - - /** - * Get the commitmentPlanId property: The Azure resource id of the commitment plan. - * - * @return the commitmentPlanId value. - */ - public String commitmentPlanId() { - return this.commitmentPlanId; - } - - /** - * Get the commitmentPlanLocation property: The location of of the commitment plan. - * - * @return the commitmentPlanLocation value. - */ - public String commitmentPlanLocation() { - return this.commitmentPlanLocation; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("commitmentPlanId", this.commitmentPlanId); - jsonWriter.writeStringField("commitmentPlanLocation", this.commitmentPlanLocation); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CommitmentPlanAssociation from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CommitmentPlanAssociation 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 CommitmentPlanAssociation. - */ - public static CommitmentPlanAssociation fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CommitmentPlanAssociation deserializedCommitmentPlanAssociation = new CommitmentPlanAssociation(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("commitmentPlanId".equals(fieldName)) { - deserializedCommitmentPlanAssociation.commitmentPlanId = reader.getString(); - } else if ("commitmentPlanLocation".equals(fieldName)) { - deserializedCommitmentPlanAssociation.commitmentPlanLocation = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCommitmentPlanAssociation; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProperties.java deleted file mode 100644 index b4444bbb1857..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProperties.java +++ /dev/null @@ -1,276 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 Cognitive Services account commitment plan. - */ -@Fluent -public final class CommitmentPlanProperties implements JsonSerializable { - /* - * Gets the status of the resource at the time the operation was called. - */ - private CommitmentPlanProvisioningState provisioningState; - - /* - * Commitment plan guid. - */ - private String commitmentPlanGuid; - - /* - * Account hosting model. - */ - private HostingModel hostingModel; - - /* - * Commitment plan type. - */ - private String planType; - - /* - * Cognitive Services account commitment period. - */ - private CommitmentPeriod current; - - /* - * AutoRenew commitment plan. - */ - private Boolean autoRenew; - - /* - * Cognitive Services account commitment period. - */ - private CommitmentPeriod next; - - /* - * Cognitive Services account commitment period. - */ - private CommitmentPeriod last; - - /* - * The list of ProvisioningIssue. - */ - private List provisioningIssues; - - /** - * Creates an instance of CommitmentPlanProperties class. - */ - public CommitmentPlanProperties() { - } - - /** - * Get the provisioningState property: Gets the status of the resource at the time the operation was called. - * - * @return the provisioningState value. - */ - public CommitmentPlanProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the commitmentPlanGuid property: Commitment plan guid. - * - * @return the commitmentPlanGuid value. - */ - public String commitmentPlanGuid() { - return this.commitmentPlanGuid; - } - - /** - * Set the commitmentPlanGuid property: Commitment plan guid. - * - * @param commitmentPlanGuid the commitmentPlanGuid value to set. - * @return the CommitmentPlanProperties object itself. - */ - public CommitmentPlanProperties withCommitmentPlanGuid(String commitmentPlanGuid) { - this.commitmentPlanGuid = commitmentPlanGuid; - return this; - } - - /** - * Get the hostingModel property: Account hosting model. - * - * @return the hostingModel value. - */ - public HostingModel hostingModel() { - return this.hostingModel; - } - - /** - * Set the hostingModel property: Account hosting model. - * - * @param hostingModel the hostingModel value to set. - * @return the CommitmentPlanProperties object itself. - */ - public CommitmentPlanProperties withHostingModel(HostingModel hostingModel) { - this.hostingModel = hostingModel; - return this; - } - - /** - * Get the planType property: Commitment plan type. - * - * @return the planType value. - */ - public String planType() { - return this.planType; - } - - /** - * Set the planType property: Commitment plan type. - * - * @param planType the planType value to set. - * @return the CommitmentPlanProperties object itself. - */ - public CommitmentPlanProperties withPlanType(String planType) { - this.planType = planType; - return this; - } - - /** - * Get the current property: Cognitive Services account commitment period. - * - * @return the current value. - */ - public CommitmentPeriod current() { - return this.current; - } - - /** - * Set the current property: Cognitive Services account commitment period. - * - * @param current the current value to set. - * @return the CommitmentPlanProperties object itself. - */ - public CommitmentPlanProperties withCurrent(CommitmentPeriod current) { - this.current = current; - return this; - } - - /** - * Get the autoRenew property: AutoRenew commitment plan. - * - * @return the autoRenew value. - */ - public Boolean autoRenew() { - return this.autoRenew; - } - - /** - * Set the autoRenew property: AutoRenew commitment plan. - * - * @param autoRenew the autoRenew value to set. - * @return the CommitmentPlanProperties object itself. - */ - public CommitmentPlanProperties withAutoRenew(Boolean autoRenew) { - this.autoRenew = autoRenew; - return this; - } - - /** - * Get the next property: Cognitive Services account commitment period. - * - * @return the next value. - */ - public CommitmentPeriod next() { - return this.next; - } - - /** - * Set the next property: Cognitive Services account commitment period. - * - * @param next the next value to set. - * @return the CommitmentPlanProperties object itself. - */ - public CommitmentPlanProperties withNext(CommitmentPeriod next) { - this.next = next; - return this; - } - - /** - * Get the last property: Cognitive Services account commitment period. - * - * @return the last value. - */ - public CommitmentPeriod last() { - return this.last; - } - - /** - * Get the provisioningIssues property: The list of ProvisioningIssue. - * - * @return the provisioningIssues value. - */ - public List provisioningIssues() { - return this.provisioningIssues; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("commitmentPlanGuid", this.commitmentPlanGuid); - jsonWriter.writeStringField("hostingModel", this.hostingModel == null ? null : this.hostingModel.toString()); - jsonWriter.writeStringField("planType", this.planType); - jsonWriter.writeJsonField("current", this.current); - jsonWriter.writeBooleanField("autoRenew", this.autoRenew); - jsonWriter.writeJsonField("next", this.next); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CommitmentPlanProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CommitmentPlanProperties 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 CommitmentPlanProperties. - */ - public static CommitmentPlanProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CommitmentPlanProperties deserializedCommitmentPlanProperties = new CommitmentPlanProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningState".equals(fieldName)) { - deserializedCommitmentPlanProperties.provisioningState - = CommitmentPlanProvisioningState.fromString(reader.getString()); - } else if ("commitmentPlanGuid".equals(fieldName)) { - deserializedCommitmentPlanProperties.commitmentPlanGuid = reader.getString(); - } else if ("hostingModel".equals(fieldName)) { - deserializedCommitmentPlanProperties.hostingModel = HostingModel.fromString(reader.getString()); - } else if ("planType".equals(fieldName)) { - deserializedCommitmentPlanProperties.planType = reader.getString(); - } else if ("current".equals(fieldName)) { - deserializedCommitmentPlanProperties.current = CommitmentPeriod.fromJson(reader); - } else if ("autoRenew".equals(fieldName)) { - deserializedCommitmentPlanProperties.autoRenew = reader.getNullable(JsonReader::getBoolean); - } else if ("next".equals(fieldName)) { - deserializedCommitmentPlanProperties.next = CommitmentPeriod.fromJson(reader); - } else if ("last".equals(fieldName)) { - deserializedCommitmentPlanProperties.last = CommitmentPeriod.fromJson(reader); - } else if ("provisioningIssues".equals(fieldName)) { - List provisioningIssues = reader.readArray(reader1 -> reader1.getString()); - deserializedCommitmentPlanProperties.provisioningIssues = provisioningIssues; - } else { - reader.skipChildren(); - } - } - - return deserializedCommitmentPlanProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProvisioningState.java deleted file mode 100644 index ef50ec0b5c10..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProvisioningState.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Gets the status of the resource at the time the operation was called. - */ -public final class CommitmentPlanProvisioningState extends ExpandableStringEnum { - /** - * Static value Accepted for CommitmentPlanProvisioningState. - */ - public static final CommitmentPlanProvisioningState ACCEPTED = fromString("Accepted"); - - /** - * Static value Creating for CommitmentPlanProvisioningState. - */ - public static final CommitmentPlanProvisioningState CREATING = fromString("Creating"); - - /** - * Static value Deleting for CommitmentPlanProvisioningState. - */ - public static final CommitmentPlanProvisioningState DELETING = fromString("Deleting"); - - /** - * Static value Moving for CommitmentPlanProvisioningState. - */ - public static final CommitmentPlanProvisioningState MOVING = fromString("Moving"); - - /** - * Static value Failed for CommitmentPlanProvisioningState. - */ - public static final CommitmentPlanProvisioningState FAILED = fromString("Failed"); - - /** - * Static value Succeeded for CommitmentPlanProvisioningState. - */ - public static final CommitmentPlanProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Canceled for CommitmentPlanProvisioningState. - */ - public static final CommitmentPlanProvisioningState CANCELED = fromString("Canceled"); - - /** - * Creates a new instance of CommitmentPlanProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public CommitmentPlanProvisioningState() { - } - - /** - * Creates or finds a CommitmentPlanProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding CommitmentPlanProvisioningState. - */ - public static CommitmentPlanProvisioningState fromString(String name) { - return fromString(name, CommitmentPlanProvisioningState.class); - } - - /** - * Gets known CommitmentPlanProvisioningState values. - * - * @return known CommitmentPlanProvisioningState values. - */ - public static Collection values() { - return values(CommitmentPlanProvisioningState.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlans.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlans.java deleted file mode 100644 index 39c223b41a5b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlans.java +++ /dev/null @@ -1,414 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner; - -/** - * Resource collection API of CommitmentPlans. - */ -public interface CommitmentPlans { - /** - * Gets the specified commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @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 specified commitmentPlans associated with the Cognitive Services account along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, String commitmentPlanName, - Context context); - - /** - * Gets the specified commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 commitmentPlans associated with the Cognitive Services account. - */ - CommitmentPlan get(String resourceGroupName, String accountName, String commitmentPlanName); - - /** - * Update the state of specified commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The commitmentPlan 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 cognitive Services account commitment plan along with {@link Response}. - */ - Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String commitmentPlanName, CommitmentPlanInner commitmentPlan, Context context); - - /** - * Update the state of specified commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The commitmentPlan 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 cognitive Services account commitment plan. - */ - CommitmentPlan createOrUpdate(String resourceGroupName, String accountName, String commitmentPlanName, - CommitmentPlanInner commitmentPlan); - - /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String commitmentPlanName); - - /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @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 accountName, String commitmentPlanName, Context context); - - /** - * Gets the commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the commitmentPlans associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 commitmentPlans associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, Context context); - - /** - * Returns a Cognitive Services commitment plan specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @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 cognitive Services account commitment plan along with {@link Response}. - */ - Response getByResourceGroupWithResponse(String resourceGroupName, String commitmentPlanName, - Context context); - - /** - * Returns a Cognitive Services commitment plan specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan. - */ - CommitmentPlan getByResourceGroup(String resourceGroupName, String commitmentPlanName); - - /** - * Deletes a Cognitive Services commitment plan from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 deletePlan(String resourceGroupName, String commitmentPlanName); - - /** - * Deletes a Cognitive Services commitment plan from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @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 deletePlan(String resourceGroupName, String commitmentPlanName, Context context); - - /** - * Returns all the resources of a particular type belonging to a resource group. - * - * @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 the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Returns all the resources of a particular type belonging to 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 com.azure.core.management.exception.ManagementException 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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listPlansBySubscription(); - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listPlansBySubscription(Context context); - - /** - * Gets the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @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 association of the Cognitive Services commitment plan along with {@link Response}. - */ - Response getAssociationWithResponse(String resourceGroupName, - String commitmentPlanName, String commitmentPlanAssociationName, Context context); - - /** - * Gets the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the association of the Cognitive Services commitment plan. - */ - CommitmentPlanAccountAssociation getAssociation(String resourceGroupName, String commitmentPlanName, - String commitmentPlanAssociationName); - - /** - * Deletes the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 deleteAssociation(String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName); - - /** - * Deletes the association of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive Services - * Account. - * @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 deleteAssociation(String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, - Context context); - - /** - * Gets the associations of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the associations of the Cognitive Services commitment plan as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listAssociations(String resourceGroupName, - String commitmentPlanName); - - /** - * Gets the associations of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @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 associations of the Cognitive Services commitment plan as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listAssociations(String resourceGroupName, - String commitmentPlanName, Context context); - - /** - * Returns a Cognitive Services commitment plan specified by the parameters. - * - * @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 cognitive Services account commitment plan along with {@link Response}. - */ - CommitmentPlan getById(String id); - - /** - * Returns a Cognitive Services commitment plan specified by the parameters. - * - * @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 cognitive Services account commitment plan along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Gets the association of the Cognitive Services commitment plan. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the association of the Cognitive Services commitment plan along with {@link Response}. - */ - CommitmentPlanAccountAssociation getAssociationById(String id); - - /** - * Gets the association of the Cognitive Services commitment plan. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the association of the Cognitive Services commitment plan along with {@link Response}. - */ - Response getAssociationByIdWithResponse(String id, Context context); - - /** - * Deletes a Cognitive Services commitment plan from the resource group. - * - * @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 deletePlanById(String id); - - /** - * Deletes a Cognitive Services commitment plan from the resource group. - * - * @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 deletePlanByIdWithResponse(String id, Context context); - - /** - * Deletes the association of the Cognitive Services commitment plan. - * - * @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 deleteAssociationById(String id); - - /** - * Deletes the association of the Cognitive Services commitment plan. - * - * @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 deleteAssociationByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new CommitmentPlan resource. - * - * @param name resource name. - * @return the first stage of the new CommitmentPlan definition. - */ - CommitmentPlan.DefinitionStages.Blank definePlan(String name); - - /** - * Begins definition for a new CommitmentPlanAccountAssociation resource. - * - * @param name resource name. - * @return the first stage of the new CommitmentPlanAccountAssociation definition. - */ - CommitmentPlanAccountAssociation.DefinitionStages.Blank defineAssociation(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentQuota.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentQuota.java deleted file mode 100644 index 079a5fdc6e9b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentQuota.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Cognitive Services account commitment quota. - */ -@Immutable -public final class CommitmentQuota implements JsonSerializable { - /* - * Commitment quota quantity. - */ - private Long quantity; - - /* - * Commitment quota unit. - */ - private String unit; - - /** - * Creates an instance of CommitmentQuota class. - */ - private CommitmentQuota() { - } - - /** - * Get the quantity property: Commitment quota quantity. - * - * @return the quantity value. - */ - public Long quantity() { - return this.quantity; - } - - /** - * Get the unit property: Commitment quota unit. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("quantity", this.quantity); - jsonWriter.writeStringField("unit", this.unit); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CommitmentQuota from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CommitmentQuota 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 CommitmentQuota. - */ - public static CommitmentQuota fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CommitmentQuota deserializedCommitmentQuota = new CommitmentQuota(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("quantity".equals(fieldName)) { - deserializedCommitmentQuota.quantity = reader.getNullable(JsonReader::getLong); - } else if ("unit".equals(fieldName)) { - deserializedCommitmentQuota.unit = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCommitmentQuota; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentTier.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentTier.java deleted file mode 100644 index b61e4d894e65..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentTier.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentTierInner; - -/** - * An immutable client-side representation of CommitmentTier. - */ -public interface CommitmentTier { - /** - * Gets the kind property: The kind (type) of cognitive service account. - * - * @return the kind value. - */ - String kind(); - - /** - * Gets the skuName property: The name of the SKU. Ex - P3. It is typically a letter+number code. - * - * @return the skuName value. - */ - String skuName(); - - /** - * Gets the hostingModel property: Account hosting model. - * - * @return the hostingModel value. - */ - HostingModel hostingModel(); - - /** - * Gets the planType property: Commitment plan type. - * - * @return the planType value. - */ - String planType(); - - /** - * Gets the tier property: Commitment period commitment tier. - * - * @return the tier value. - */ - String tier(); - - /** - * Gets the maxCount property: Commitment period commitment max count. - * - * @return the maxCount value. - */ - Integer maxCount(); - - /** - * Gets the quota property: Cognitive Services account commitment quota. - * - * @return the quota value. - */ - CommitmentQuota quota(); - - /** - * Gets the cost property: Cognitive Services account commitment cost. - * - * @return the cost value. - */ - CommitmentCost cost(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentTierInner object. - * - * @return the inner object. - */ - CommitmentTierInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentTiers.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentTiers.java deleted file mode 100644 index 3fa75524462b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentTiers.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of CommitmentTiers. - */ -public interface CommitmentTiers { - /** - * List Commitment Tiers. - * - * @param location The location 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 list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String location); - - /** - * List Commitment Tiers. - * - * @param location The location 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 list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String location, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Compute.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Compute.java deleted file mode 100644 index 2c59af7f72d9..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Compute.java +++ /dev/null @@ -1,412 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ComputeInner; -import java.util.Map; - -/** - * An immutable client-side representation of Compute. - */ -public interface Compute { - /** - * 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: Polymorphic properties of the compute resource. Use computeType to select Cluster - * or ContainerInstance. - * - * @return the properties value. - */ - ComputeProperties properties(); - - /** - * Gets the etag property: Resource Etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the location property: The location of the compute resource. - * - * @return the location value. - */ - String location(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the kind property: The kind (type) of compute resource. - * - * @return the kind value. - */ - String kind(); - - /** - * Gets the identity property: Identity for the resource. - * - * @return the identity value. - */ - Identity identity(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.ComputeInner object. - * - * @return the inner object. - */ - ComputeInner innerModel(); - - /** - * The entirety of the Compute definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, DefinitionStages.WithCreate { - } - - /** - * The Compute definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the Compute definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the Compute definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, accountName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @return the next definition stage. - */ - WithProperties withExistingAccount(String resourceGroupName, String accountName); - } - - /** - * The stage of the Compute definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Polymorphic properties of the compute resource. Use computeType to - * select Cluster or ContainerInstance.. - * - * @param properties Polymorphic properties of the compute resource. Use computeType to select Cluster or - * ContainerInstance. - * @return the next definition stage. - */ - WithCreate withProperties(ComputeProperties properties); - } - - /** - * The stage of the Compute 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.WithLocation, DefinitionStages.WithTags, - DefinitionStages.WithKind, DefinitionStages.WithIdentity { - /** - * Executes the create request. - * - * @return the created resource. - */ - Compute create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Compute create(Context context); - } - - /** - * The stage of the Compute definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The location of the compute resource. - * @return the next definition stage. - */ - WithCreate withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The location of the compute resource. - * @return the next definition stage. - */ - WithCreate withRegion(String location); - } - - /** - * The stage of the Compute definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the Compute definition allowing to specify kind. - */ - interface WithKind { - /** - * Specifies the kind property: The kind (type) of compute resource.. - * - * @param kind The kind (type) of compute resource. - * @return the next definition stage. - */ - WithCreate withKind(String kind); - } - - /** - * The stage of the Compute definition allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: Identity for the resource.. - * - * @param identity Identity for the resource. - * @return the next definition stage. - */ - WithCreate withIdentity(Identity identity); - } - } - - /** - * Begins update for the Compute resource. - * - * @return the stage of resource update. - */ - Compute.Update update(); - - /** - * The template for Compute update. - */ - interface Update - extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithKind, UpdateStages.WithIdentity { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Compute apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Compute apply(Context context); - } - - /** - * The Compute update stages. - */ - interface UpdateStages { - /** - * The stage of the Compute update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the Compute update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Polymorphic properties of the compute resource. Use computeType to - * select Cluster or ContainerInstance.. - * - * @param properties Polymorphic properties of the compute resource. Use computeType to select Cluster or - * ContainerInstance. - * @return the next definition stage. - */ - Update withProperties(ComputeProperties properties); - } - - /** - * The stage of the Compute update allowing to specify kind. - */ - interface WithKind { - /** - * Specifies the kind property: The kind (type) of compute resource.. - * - * @param kind The kind (type) of compute resource. - * @return the next definition stage. - */ - Update withKind(String kind); - } - - /** - * The stage of the Compute update allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: Identity for the resource.. - * - * @param identity Identity for the resource. - * @return the next definition stage. - */ - Update withIdentity(Identity identity); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Compute refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Compute refresh(Context context); - - /** - * Starts a stopped ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @throws com.azure.core.management.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 a stopped ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @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 a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @throws com.azure.core.management.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(); - - /** - * Stops a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @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 stop(Context context); - - /** - * Restarts a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @throws com.azure.core.management.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 restart(); - - /** - * Restarts a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @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 restart(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatus.java deleted file mode 100644 index e2a24cf118d3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatus.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ComputeOperationStatusInner; - -/** - * An immutable client-side representation of ComputeOperationStatus. - */ -public interface ComputeOperationStatus { - /** - * 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: The properties of the compute operation status. - * - * @return the properties value. - */ - ComputeOperationStatusProperties 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.cognitiveservices.fluent.models.ComputeOperationStatusInner object. - * - * @return the inner object. - */ - ComputeOperationStatusInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatusProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatusProperties.java deleted file mode 100644 index 43ae3f310b10..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatusProperties.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.exception.ManagementError; -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 properties of a compute operation status. - */ -@Immutable -public final class ComputeOperationStatusProperties implements JsonSerializable { - /* - * The start time of the operation. - */ - private OffsetDateTime startTime; - - /* - * The end time of the operation. - */ - private OffsetDateTime endTime; - - /* - * The status of the operation. - */ - private ComputeOperationStatusType status; - - /* - * Error details if the operation failed. - */ - private ManagementError error; - - /** - * Creates an instance of ComputeOperationStatusProperties class. - */ - private ComputeOperationStatusProperties() { - } - - /** - * Get the startTime property: The start time of the operation. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Get the endTime property: The end time of the operation. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Get the status property: The status of the operation. - * - * @return the status value. - */ - public ComputeOperationStatusType status() { - return this.status; - } - - /** - * Get the error property: Error details if the operation failed. - * - * @return the error value. - */ - public ManagementError error() { - return this.error; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeJsonField("error", this.error); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ComputeOperationStatusProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComputeOperationStatusProperties 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 ComputeOperationStatusProperties. - */ - public static ComputeOperationStatusProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ComputeOperationStatusProperties deserializedComputeOperationStatusProperties - = new ComputeOperationStatusProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("startTime".equals(fieldName)) { - deserializedComputeOperationStatusProperties.startTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("endTime".equals(fieldName)) { - deserializedComputeOperationStatusProperties.endTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("status".equals(fieldName)) { - deserializedComputeOperationStatusProperties.status - = ComputeOperationStatusType.fromString(reader.getString()); - } else if ("error".equals(fieldName)) { - deserializedComputeOperationStatusProperties.error = ManagementError.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedComputeOperationStatusProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatusType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatusType.java deleted file mode 100644 index fc0d7573e4d2..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatusType.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The status type of a compute operation. - */ -public final class ComputeOperationStatusType extends ExpandableStringEnum { - /** - * The operation is in progress. - */ - public static final ComputeOperationStatusType IN_PROGRESS = fromString("InProgress"); - - /** - * The operation has succeeded. - */ - public static final ComputeOperationStatusType SUCCEEDED = fromString("Succeeded"); - - /** - * The operation has failed. - */ - public static final ComputeOperationStatusType FAILED = fromString("Failed"); - - /** - * The operation has been canceled. - */ - public static final ComputeOperationStatusType CANCELED = fromString("Canceled"); - - /** - * Creates a new instance of ComputeOperationStatusType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ComputeOperationStatusType() { - } - - /** - * Creates or finds a ComputeOperationStatusType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ComputeOperationStatusType. - */ - public static ComputeOperationStatusType fromString(String name) { - return fromString(name, ComputeOperationStatusType.class); - } - - /** - * Gets known ComputeOperationStatusType values. - * - * @return known ComputeOperationStatusType values. - */ - public static Collection values() { - return values(ComputeOperationStatusType.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperations.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperations.java deleted file mode 100644 index 9746c3c051ea..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperations.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ComputeOperations. - */ -public interface ComputeOperations { - /** - * Gets the status of a compute operation. - * - * @param location The name of the Azure region. - * @param operationId The ID of the compute operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a compute operation along with {@link Response}. - */ - Response getWithResponse(String location, String operationId, Context context); - - /** - * Gets the status of a compute operation. - * - * @param location The name of the Azure region. - * @param operationId The ID of the compute operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a compute operation. - */ - ComputeOperationStatus get(String location, String operationId); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeProperties.java deleted file mode 100644 index c46ae8d05b79..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeProperties.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * Base properties for all compute resource types. - * The computeType discriminator determines the concrete property shape. - */ -@Immutable -public class ComputeProperties implements JsonSerializable { - /* - * The type of compute resource. - */ - private ComputeType computeType = ComputeType.fromString("ComputeProperties"); - - /* - * Provisioning state of the compute resource. - */ - private ComputeProvisioningState provisioningState; - - /* - * Error details for the compute resource. - */ - private List errors; - - /* - * Creation time of the compute resource. - */ - private OffsetDateTime creationTime; - - /** - * Creates an instance of ComputeProperties class. - */ - public ComputeProperties() { - } - - /** - * Get the computeType property: The type of compute resource. - * - * @return the computeType value. - */ - public ComputeType computeType() { - return this.computeType; - } - - /** - * Get the provisioningState property: Provisioning state of the compute resource. - * - * @return the provisioningState value. - */ - public ComputeProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Provisioning state of the compute resource. - * - * @param provisioningState the provisioningState value to set. - * @return the ComputeProperties object itself. - */ - ComputeProperties withProvisioningState(ComputeProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the errors property: Error details for the compute resource. - * - * @return the errors value. - */ - public List errors() { - return this.errors; - } - - /** - * Set the errors property: Error details for the compute resource. - * - * @param errors the errors value to set. - * @return the ComputeProperties object itself. - */ - ComputeProperties withErrors(List errors) { - this.errors = errors; - return this; - } - - /** - * Get the creationTime property: Creation time of the compute resource. - * - * @return the creationTime value. - */ - public OffsetDateTime creationTime() { - return this.creationTime; - } - - /** - * Set the creationTime property: Creation time of the compute resource. - * - * @param creationTime the creationTime value to set. - * @return the ComputeProperties object itself. - */ - ComputeProperties withCreationTime(OffsetDateTime creationTime) { - this.creationTime = creationTime; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("computeType", this.computeType == null ? null : this.computeType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ComputeProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComputeProperties 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 ComputeProperties. - */ - public static ComputeProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("computeType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("Cluster".equals(discriminatorValue)) { - return ClusterComputeProperties.fromJson(readerToUse.reset()); - } else if ("ContainerInstance".equals(discriminatorValue)) { - return ContainerInstanceComputeProperties.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static ComputeProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ComputeProperties deserializedComputeProperties = new ComputeProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("computeType".equals(fieldName)) { - deserializedComputeProperties.computeType = ComputeType.fromString(reader.getString()); - } else if ("provisioningState".equals(fieldName)) { - deserializedComputeProperties.provisioningState - = ComputeProvisioningState.fromString(reader.getString()); - } else if ("errors".equals(fieldName)) { - List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); - deserializedComputeProperties.errors = errors; - } else if ("creationTime".equals(fieldName)) { - deserializedComputeProperties.creationTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedComputeProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeProvisioningState.java deleted file mode 100644 index 56c2bc341c68..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeProvisioningState.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The provisioning state of a compute resource. - */ -public final class ComputeProvisioningState extends ExpandableStringEnum { - /** - * The resource provisioning request has been accepted. - */ - public static final ComputeProvisioningState ACCEPTED = fromString("Accepted"); - - /** - * The resource has been fully provisioned. - */ - public static final ComputeProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * The resource provisioning has failed. - */ - public static final ComputeProvisioningState FAILED = fromString("Failed"); - - /** - * The resource provisioning was canceled. - */ - public static final ComputeProvisioningState CANCELED = fromString("Canceled"); - - /** - * The resource is being deleted. - */ - public static final ComputeProvisioningState DELETING = fromString("Deleting"); - - /** - * The resource is scaling. - */ - public static final ComputeProvisioningState SCALING = fromString("Scaling"); - - /** - * The resource is disabled. - */ - public static final ComputeProvisioningState DISABLED = fromString("Disabled"); - - /** - * The compute resource is starting. - */ - public static final ComputeProvisioningState STARTING = fromString("Starting"); - - /** - * The compute resource is stopping. - */ - public static final ComputeProvisioningState STOPPING = fromString("Stopping"); - - /** - * The compute resource is restarting. - */ - public static final ComputeProvisioningState RESTARTING = fromString("Restarting"); - - /** - * The compute resource is stopped. - */ - public static final ComputeProvisioningState STOPPED = fromString("Stopped"); - - /** - * Creates a new instance of ComputeProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ComputeProvisioningState() { - } - - /** - * Creates or finds a ComputeProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ComputeProvisioningState. - */ - public static ComputeProvisioningState fromString(String name) { - return fromString(name, ComputeProvisioningState.class); - } - - /** - * Gets known ComputeProvisioningState values. - * - * @return known ComputeProvisioningState values. - */ - public static Collection values() { - return values(ComputeProvisioningState.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeType.java deleted file mode 100644 index eddcf0e1ff35..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeType.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The type of compute resource. - */ -public final class ComputeType extends ExpandableStringEnum { - /** - * Cluster (AKS-backed) compute type. - */ - public static final ComputeType CLUSTER = fromString("Cluster"); - - /** - * Container Instance compute type. - */ - public static final ComputeType CONTAINER_INSTANCE = fromString("ContainerInstance"); - - /** - * Creates a new instance of ComputeType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ComputeType() { - } - - /** - * Creates or finds a ComputeType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ComputeType. - */ - public static ComputeType fromString(String name) { - return fromString(name, ComputeType.class); - } - - /** - * Gets known ComputeType values. - * - * @return known ComputeType values. - */ - public static Collection values() { - return values(ComputeType.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Computes.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Computes.java deleted file mode 100644 index 4bba20888d7c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Computes.java +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 Computes. - */ -public interface Computes { - /** - * Gets the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @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 specified compute associated with the Cognitive Services account along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, String computeName, - Context context); - - /** - * Gets the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 compute associated with the Cognitive Services account. - */ - Compute get(String resourceGroupName, String accountName, String computeName); - - /** - * Deletes the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String computeName); - - /** - * Deletes the specified compute associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @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 accountName, String computeName, Context context); - - /** - * Gets the computes associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the computes associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the computes associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 computes associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, Context context); - - /** - * Starts a stopped ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String computeName); - - /** - * Starts a stopped ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @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 accountName, String computeName, Context context); - - /** - * Stops a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String computeName); - - /** - * Stops a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @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 stop(String resourceGroupName, String accountName, String computeName, Context context); - - /** - * Restarts a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 restart(String resourceGroupName, String accountName, String computeName); - - /** - * Restarts a running ContainerInstance compute resource. - * This is a long-running operation that returns 202 Accepted. - * Only applicable when computeType is ContainerInstance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param computeName The name of the compute associated with the Cognitive Services Account. - * @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 restart(String resourceGroupName, String accountName, String computeName, Context context); - - /** - * Gets the specified compute associated with the Cognitive Services account. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified compute associated with the Cognitive Services account along with {@link Response}. - */ - Compute getById(String id); - - /** - * Gets the specified compute associated with the Cognitive Services account. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified compute associated with the Cognitive Services account along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes the specified compute associated with the Cognitive Services account. - * - * @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 the specified compute associated with the Cognitive Services account. - * - * @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 Compute resource. - * - * @param name resource name. - * @return the first stage of the new Compute definition. - */ - Compute.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccessKey.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccessKey.java deleted file mode 100644 index 0a520b8c4c79..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccessKey.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 ConnectionAccessKey model. - */ -@Fluent -public final class ConnectionAccessKey implements JsonSerializable { - /* - * The accessKeyId property. - */ - private String accessKeyId; - - /* - * The secretAccessKey property. - */ - private String secretAccessKey; - - /** - * Creates an instance of ConnectionAccessKey class. - */ - public ConnectionAccessKey() { - } - - /** - * Get the accessKeyId property: The accessKeyId property. - * - * @return the accessKeyId value. - */ - public String accessKeyId() { - return this.accessKeyId; - } - - /** - * Set the accessKeyId property: The accessKeyId property. - * - * @param accessKeyId the accessKeyId value to set. - * @return the ConnectionAccessKey object itself. - */ - public ConnectionAccessKey withAccessKeyId(String accessKeyId) { - this.accessKeyId = accessKeyId; - return this; - } - - /** - * Get the secretAccessKey property: The secretAccessKey property. - * - * @return the secretAccessKey value. - */ - public String secretAccessKey() { - return this.secretAccessKey; - } - - /** - * Set the secretAccessKey property: The secretAccessKey property. - * - * @param secretAccessKey the secretAccessKey value to set. - * @return the ConnectionAccessKey object itself. - */ - public ConnectionAccessKey withSecretAccessKey(String secretAccessKey) { - this.secretAccessKey = secretAccessKey; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("accessKeyId", this.accessKeyId); - jsonWriter.writeStringField("secretAccessKey", this.secretAccessKey); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ConnectionAccessKey from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ConnectionAccessKey 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 ConnectionAccessKey. - */ - public static ConnectionAccessKey fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ConnectionAccessKey deserializedConnectionAccessKey = new ConnectionAccessKey(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("accessKeyId".equals(fieldName)) { - deserializedConnectionAccessKey.accessKeyId = reader.getString(); - } else if ("secretAccessKey".equals(fieldName)) { - deserializedConnectionAccessKey.secretAccessKey = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedConnectionAccessKey; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccountKey.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccountKey.java deleted file mode 100644 index 3a6769ab290c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccountKey.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Account key object for connection credential. - */ -@Fluent -public final class ConnectionAccountKey implements JsonSerializable { - /* - * The key property. - */ - private String key; - - /** - * Creates an instance of ConnectionAccountKey class. - */ - public ConnectionAccountKey() { - } - - /** - * Get the key property: The key property. - * - * @return the key value. - */ - public String key() { - return this.key; - } - - /** - * Set the key property: The key property. - * - * @param key the key value to set. - * @return the ConnectionAccountKey object itself. - */ - public ConnectionAccountKey withKey(String key) { - this.key = key; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("key", this.key); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ConnectionAccountKey from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ConnectionAccountKey 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 ConnectionAccountKey. - */ - public static ConnectionAccountKey fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ConnectionAccountKey deserializedConnectionAccountKey = new ConnectionAccountKey(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("key".equals(fieldName)) { - deserializedConnectionAccountKey.key = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedConnectionAccountKey; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionApiKey.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionApiKey.java deleted file mode 100644 index e80b47b8454b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionApiKey.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Api key object for connection credential. - */ -@Fluent -public final class ConnectionApiKey implements JsonSerializable { - /* - * The key property. - */ - private String key; - - /** - * Creates an instance of ConnectionApiKey class. - */ - public ConnectionApiKey() { - } - - /** - * Get the key property: The key property. - * - * @return the key value. - */ - public String key() { - return this.key; - } - - /** - * Set the key property: The key property. - * - * @param key the key value to set. - * @return the ConnectionApiKey object itself. - */ - public ConnectionApiKey withKey(String key) { - this.key = key; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("key", this.key); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ConnectionApiKey from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ConnectionApiKey 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 ConnectionApiKey. - */ - public static ConnectionApiKey fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ConnectionApiKey deserializedConnectionApiKey = new ConnectionApiKey(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("key".equals(fieldName)) { - deserializedConnectionApiKey.key = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedConnectionApiKey; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAuthType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAuthType.java deleted file mode 100644 index 642ea751554a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAuthType.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Authentication type of the connection target. - */ -public final class ConnectionAuthType extends ExpandableStringEnum { - /** - * Static value PAT for ConnectionAuthType. - */ - public static final ConnectionAuthType PAT = fromString("PAT"); - - /** - * Static value ManagedIdentity for ConnectionAuthType. - */ - public static final ConnectionAuthType MANAGED_IDENTITY = fromString("ManagedIdentity"); - - /** - * Static value UsernamePassword for ConnectionAuthType. - */ - public static final ConnectionAuthType USERNAME_PASSWORD = fromString("UsernamePassword"); - - /** - * Static value None for ConnectionAuthType. - */ - public static final ConnectionAuthType NONE = fromString("None"); - - /** - * Static value SAS for ConnectionAuthType. - */ - public static final ConnectionAuthType SAS = fromString("SAS"); - - /** - * Static value AccountKey for ConnectionAuthType. - */ - public static final ConnectionAuthType ACCOUNT_KEY = fromString("AccountKey"); - - /** - * Static value ServicePrincipal for ConnectionAuthType. - */ - public static final ConnectionAuthType SERVICE_PRINCIPAL = fromString("ServicePrincipal"); - - /** - * Static value AccessKey for ConnectionAuthType. - */ - public static final ConnectionAuthType ACCESS_KEY = fromString("AccessKey"); - - /** - * Static value ApiKey for ConnectionAuthType. - */ - public static final ConnectionAuthType API_KEY = fromString("ApiKey"); - - /** - * Static value CustomKeys for ConnectionAuthType. - */ - public static final ConnectionAuthType CUSTOM_KEYS = fromString("CustomKeys"); - - /** - * Static value OAuth2 for ConnectionAuthType. - */ - public static final ConnectionAuthType OAUTH2 = fromString("OAuth2"); - - /** - * Static value AAD for ConnectionAuthType. - */ - public static final ConnectionAuthType AAD = fromString("AAD"); - - /** - * Static value DelegatedSAS for ConnectionAuthType. - */ - public static final ConnectionAuthType DELEGATED_SAS = fromString("DelegatedSAS"); - - /** - * Static value ProjectManagedIdentity for ConnectionAuthType. - */ - public static final ConnectionAuthType PROJECT_MANAGED_IDENTITY = fromString("ProjectManagedIdentity"); - - /** - * Static value AccountManagedIdentity for ConnectionAuthType. - */ - public static final ConnectionAuthType ACCOUNT_MANAGED_IDENTITY = fromString("AccountManagedIdentity"); - - /** - * Static value UserEntraToken for ConnectionAuthType. - */ - public static final ConnectionAuthType USER_ENTRA_TOKEN = fromString("UserEntraToken"); - - /** - * Static value AgentUserImpersonation for ConnectionAuthType. - */ - public static final ConnectionAuthType AGENT_USER_IMPERSONATION = fromString("AgentUserImpersonation"); - - /** - * Static value AgenticIdentityToken for ConnectionAuthType. - */ - public static final ConnectionAuthType AGENTIC_IDENTITY_TOKEN = fromString("AgenticIdentityToken"); - - /** - * Static value AgenticUser for ConnectionAuthType. - */ - public static final ConnectionAuthType AGENTIC_USER = fromString("AgenticUser"); - - /** - * Creates a new instance of ConnectionAuthType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ConnectionAuthType() { - } - - /** - * Creates or finds a ConnectionAuthType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ConnectionAuthType. - */ - public static ConnectionAuthType fromString(String name) { - return fromString(name, ConnectionAuthType.class); - } - - /** - * Gets known ConnectionAuthType values. - * - * @return known ConnectionAuthType values. - */ - public static Collection values() { - return values(ConnectionAuthType.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionCategory.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionCategory.java deleted file mode 100644 index c1ec3524a1a4..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionCategory.java +++ /dev/null @@ -1,641 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Category of the connection. - */ -public final class ConnectionCategory extends ExpandableStringEnum { - /** - * Static value PythonFeed for ConnectionCategory. - */ - public static final ConnectionCategory PYTHON_FEED = fromString("PythonFeed"); - - /** - * Static value ContainerRegistry for ConnectionCategory. - */ - public static final ConnectionCategory CONTAINER_REGISTRY = fromString("ContainerRegistry"); - - /** - * Static value Git for ConnectionCategory. - */ - public static final ConnectionCategory GIT = fromString("Git"); - - /** - * Static value S3 for ConnectionCategory. - */ - public static final ConnectionCategory S3 = fromString("S3"); - - /** - * Static value Snowflake for ConnectionCategory. - */ - public static final ConnectionCategory SNOWFLAKE = fromString("Snowflake"); - - /** - * Static value AzureKeyVault for ConnectionCategory. - */ - public static final ConnectionCategory AZURE_KEY_VAULT = fromString("AzureKeyVault"); - - /** - * Static value AzureSqlDb for ConnectionCategory. - */ - public static final ConnectionCategory AZURE_SQL_DB = fromString("AzureSqlDb"); - - /** - * Static value AzureSynapseAnalytics for ConnectionCategory. - */ - public static final ConnectionCategory AZURE_SYNAPSE_ANALYTICS = fromString("AzureSynapseAnalytics"); - - /** - * Static value AzureMySqlDb for ConnectionCategory. - */ - public static final ConnectionCategory AZURE_MY_SQL_DB = fromString("AzureMySqlDb"); - - /** - * Static value AzurePostgresDb for ConnectionCategory. - */ - public static final ConnectionCategory AZURE_POSTGRES_DB = fromString("AzurePostgresDb"); - - /** - * Static value ADLSGen2 for ConnectionCategory. - */ - public static final ConnectionCategory ADLSGEN2 = fromString("ADLSGen2"); - - /** - * Static value AzureContainerAppEnvironment for ConnectionCategory. - */ - public static final ConnectionCategory AZURE_CONTAINER_APP_ENVIRONMENT = fromString("AzureContainerAppEnvironment"); - - /** - * Static value Redis for ConnectionCategory. - */ - public static final ConnectionCategory REDIS = fromString("Redis"); - - /** - * Static value ApiKey for ConnectionCategory. - */ - public static final ConnectionCategory API_KEY = fromString("ApiKey"); - - /** - * Static value AzureOpenAI for ConnectionCategory. - */ - public static final ConnectionCategory AZURE_OPEN_AI = fromString("AzureOpenAI"); - - /** - * Static value AIServices for ConnectionCategory. - */ - public static final ConnectionCategory AISERVICES = fromString("AIServices"); - - /** - * Static value CognitiveSearch for ConnectionCategory. - */ - public static final ConnectionCategory COGNITIVE_SEARCH = fromString("CognitiveSearch"); - - /** - * Static value CognitiveService for ConnectionCategory. - */ - public static final ConnectionCategory COGNITIVE_SERVICE = fromString("CognitiveService"); - - /** - * Static value CustomKeys for ConnectionCategory. - */ - public static final ConnectionCategory CUSTOM_KEYS = fromString("CustomKeys"); - - /** - * Static value AzureBlob for ConnectionCategory. - */ - public static final ConnectionCategory AZURE_BLOB = fromString("AzureBlob"); - - /** - * Static value AzureStorageAccount for ConnectionCategory. - */ - public static final ConnectionCategory AZURE_STORAGE_ACCOUNT = fromString("AzureStorageAccount"); - - /** - * Static value AzureOneLake for ConnectionCategory. - */ - public static final ConnectionCategory AZURE_ONE_LAKE = fromString("AzureOneLake"); - - /** - * Static value CosmosDb for ConnectionCategory. - */ - public static final ConnectionCategory COSMOS_DB = fromString("CosmosDb"); - - /** - * Static value CosmosDbMongoDbApi for ConnectionCategory. - */ - public static final ConnectionCategory COSMOS_DB_MONGO_DB_API = fromString("CosmosDbMongoDbApi"); - - /** - * Static value AzureDataExplorer for ConnectionCategory. - */ - public static final ConnectionCategory AZURE_DATA_EXPLORER = fromString("AzureDataExplorer"); - - /** - * Static value AzureMariaDb for ConnectionCategory. - */ - public static final ConnectionCategory AZURE_MARIA_DB = fromString("AzureMariaDb"); - - /** - * Static value AzureDatabricksDeltaLake for ConnectionCategory. - */ - public static final ConnectionCategory AZURE_DATABRICKS_DELTA_LAKE = fromString("AzureDatabricksDeltaLake"); - - /** - * Static value AzureSqlMi for ConnectionCategory. - */ - public static final ConnectionCategory AZURE_SQL_MI = fromString("AzureSqlMi"); - - /** - * Static value AzureTableStorage for ConnectionCategory. - */ - public static final ConnectionCategory AZURE_TABLE_STORAGE = fromString("AzureTableStorage"); - - /** - * Static value AmazonRdsForOracle for ConnectionCategory. - */ - public static final ConnectionCategory AMAZON_RDS_FOR_ORACLE = fromString("AmazonRdsForOracle"); - - /** - * Static value AmazonRdsForSqlServer for ConnectionCategory. - */ - public static final ConnectionCategory AMAZON_RDS_FOR_SQL_SERVER = fromString("AmazonRdsForSqlServer"); - - /** - * Static value AmazonRedshift for ConnectionCategory. - */ - public static final ConnectionCategory AMAZON_REDSHIFT = fromString("AmazonRedshift"); - - /** - * Static value Db2 for ConnectionCategory. - */ - public static final ConnectionCategory DB2 = fromString("Db2"); - - /** - * Static value Drill for ConnectionCategory. - */ - public static final ConnectionCategory DRILL = fromString("Drill"); - - /** - * Static value GoogleBigQuery for ConnectionCategory. - */ - public static final ConnectionCategory GOOGLE_BIG_QUERY = fromString("GoogleBigQuery"); - - /** - * Static value Greenplum for ConnectionCategory. - */ - public static final ConnectionCategory GREENPLUM = fromString("Greenplum"); - - /** - * Static value Hbase for ConnectionCategory. - */ - public static final ConnectionCategory HBASE = fromString("Hbase"); - - /** - * Static value Hive for ConnectionCategory. - */ - public static final ConnectionCategory HIVE = fromString("Hive"); - - /** - * Static value Impala for ConnectionCategory. - */ - public static final ConnectionCategory IMPALA = fromString("Impala"); - - /** - * Static value Informix for ConnectionCategory. - */ - public static final ConnectionCategory INFORMIX = fromString("Informix"); - - /** - * Static value MariaDb for ConnectionCategory. - */ - public static final ConnectionCategory MARIA_DB = fromString("MariaDb"); - - /** - * Static value MicrosoftAccess for ConnectionCategory. - */ - public static final ConnectionCategory MICROSOFT_ACCESS = fromString("MicrosoftAccess"); - - /** - * Static value MySql for ConnectionCategory. - */ - public static final ConnectionCategory MY_SQL = fromString("MySql"); - - /** - * Static value Netezza for ConnectionCategory. - */ - public static final ConnectionCategory NETEZZA = fromString("Netezza"); - - /** - * Static value Oracle for ConnectionCategory. - */ - public static final ConnectionCategory ORACLE = fromString("Oracle"); - - /** - * Static value Phoenix for ConnectionCategory. - */ - public static final ConnectionCategory PHOENIX = fromString("Phoenix"); - - /** - * Static value PostgreSql for ConnectionCategory. - */ - public static final ConnectionCategory POSTGRE_SQL = fromString("PostgreSql"); - - /** - * Static value Presto for ConnectionCategory. - */ - public static final ConnectionCategory PRESTO = fromString("Presto"); - - /** - * Static value SapOpenHub for ConnectionCategory. - */ - public static final ConnectionCategory SAP_OPEN_HUB = fromString("SapOpenHub"); - - /** - * Static value SapBw for ConnectionCategory. - */ - public static final ConnectionCategory SAP_BW = fromString("SapBw"); - - /** - * Static value SapHana for ConnectionCategory. - */ - public static final ConnectionCategory SAP_HANA = fromString("SapHana"); - - /** - * Static value SapTable for ConnectionCategory. - */ - public static final ConnectionCategory SAP_TABLE = fromString("SapTable"); - - /** - * Static value Spark for ConnectionCategory. - */ - public static final ConnectionCategory SPARK = fromString("Spark"); - - /** - * Static value SqlServer for ConnectionCategory. - */ - public static final ConnectionCategory SQL_SERVER = fromString("SqlServer"); - - /** - * Static value Sybase for ConnectionCategory. - */ - public static final ConnectionCategory SYBASE = fromString("Sybase"); - - /** - * Static value Teradata for ConnectionCategory. - */ - public static final ConnectionCategory TERADATA = fromString("Teradata"); - - /** - * Static value Vertica for ConnectionCategory. - */ - public static final ConnectionCategory VERTICA = fromString("Vertica"); - - /** - * Static value Pinecone for ConnectionCategory. - */ - public static final ConnectionCategory PINECONE = fromString("Pinecone"); - - /** - * Static value Databricks for ConnectionCategory. - */ - public static final ConnectionCategory DATABRICKS = fromString("Databricks"); - - /** - * Static value Cassandra for ConnectionCategory. - */ - public static final ConnectionCategory CASSANDRA = fromString("Cassandra"); - - /** - * Static value Couchbase for ConnectionCategory. - */ - public static final ConnectionCategory COUCHBASE = fromString("Couchbase"); - - /** - * Static value MongoDbV2 for ConnectionCategory. - */ - public static final ConnectionCategory MONGO_DB_V2 = fromString("MongoDbV2"); - - /** - * Static value MongoDbAtlas for ConnectionCategory. - */ - public static final ConnectionCategory MONGO_DB_ATLAS = fromString("MongoDbAtlas"); - - /** - * Static value AmazonS3Compatible for ConnectionCategory. - */ - public static final ConnectionCategory AMAZON_S3COMPATIBLE = fromString("AmazonS3Compatible"); - - /** - * Static value FileServer for ConnectionCategory. - */ - public static final ConnectionCategory FILE_SERVER = fromString("FileServer"); - - /** - * Static value FtpServer for ConnectionCategory. - */ - public static final ConnectionCategory FTP_SERVER = fromString("FtpServer"); - - /** - * Static value GoogleCloudStorage for ConnectionCategory. - */ - public static final ConnectionCategory GOOGLE_CLOUD_STORAGE = fromString("GoogleCloudStorage"); - - /** - * Static value Hdfs for ConnectionCategory. - */ - public static final ConnectionCategory HDFS = fromString("Hdfs"); - - /** - * Static value OracleCloudStorage for ConnectionCategory. - */ - public static final ConnectionCategory ORACLE_CLOUD_STORAGE = fromString("OracleCloudStorage"); - - /** - * Static value Sftp for ConnectionCategory. - */ - public static final ConnectionCategory SFTP = fromString("Sftp"); - - /** - * Static value GenericHttp for ConnectionCategory. - */ - public static final ConnectionCategory GENERIC_HTTP = fromString("GenericHttp"); - - /** - * Static value ODataRest for ConnectionCategory. - */ - public static final ConnectionCategory ODATA_REST = fromString("ODataRest"); - - /** - * Static value Odbc for ConnectionCategory. - */ - public static final ConnectionCategory ODBC = fromString("Odbc"); - - /** - * Static value GenericRest for ConnectionCategory. - */ - public static final ConnectionCategory GENERIC_REST = fromString("GenericRest"); - - /** - * Static value RemoteTool for ConnectionCategory. - */ - public static final ConnectionCategory REMOTE_TOOL = fromString("RemoteTool"); - - /** - * Static value AmazonMws for ConnectionCategory. - */ - public static final ConnectionCategory AMAZON_MWS = fromString("AmazonMws"); - - /** - * Static value Concur for ConnectionCategory. - */ - public static final ConnectionCategory CONCUR = fromString("Concur"); - - /** - * Static value Dynamics for ConnectionCategory. - */ - public static final ConnectionCategory DYNAMICS = fromString("Dynamics"); - - /** - * Static value DynamicsAx for ConnectionCategory. - */ - public static final ConnectionCategory DYNAMICS_AX = fromString("DynamicsAx"); - - /** - * Static value DynamicsCrm for ConnectionCategory. - */ - public static final ConnectionCategory DYNAMICS_CRM = fromString("DynamicsCrm"); - - /** - * Static value GoogleAdWords for ConnectionCategory. - */ - public static final ConnectionCategory GOOGLE_AD_WORDS = fromString("GoogleAdWords"); - - /** - * Static value Hubspot for ConnectionCategory. - */ - public static final ConnectionCategory HUBSPOT = fromString("Hubspot"); - - /** - * Static value Jira for ConnectionCategory. - */ - public static final ConnectionCategory JIRA = fromString("Jira"); - - /** - * Static value Magento for ConnectionCategory. - */ - public static final ConnectionCategory MAGENTO = fromString("Magento"); - - /** - * Static value Marketo for ConnectionCategory. - */ - public static final ConnectionCategory MARKETO = fromString("Marketo"); - - /** - * Static value Office365 for ConnectionCategory. - */ - public static final ConnectionCategory OFFICE365 = fromString("Office365"); - - /** - * Static value Eloqua for ConnectionCategory. - */ - public static final ConnectionCategory ELOQUA = fromString("Eloqua"); - - /** - * Static value Responsys for ConnectionCategory. - */ - public static final ConnectionCategory RESPONSYS = fromString("Responsys"); - - /** - * Static value OracleServiceCloud for ConnectionCategory. - */ - public static final ConnectionCategory ORACLE_SERVICE_CLOUD = fromString("OracleServiceCloud"); - - /** - * Static value PayPal for ConnectionCategory. - */ - public static final ConnectionCategory PAY_PAL = fromString("PayPal"); - - /** - * Static value QuickBooks for ConnectionCategory. - */ - public static final ConnectionCategory QUICK_BOOKS = fromString("QuickBooks"); - - /** - * Static value Salesforce for ConnectionCategory. - */ - public static final ConnectionCategory SALESFORCE = fromString("Salesforce"); - - /** - * Static value SalesforceServiceCloud for ConnectionCategory. - */ - public static final ConnectionCategory SALESFORCE_SERVICE_CLOUD = fromString("SalesforceServiceCloud"); - - /** - * Static value SalesforceMarketingCloud for ConnectionCategory. - */ - public static final ConnectionCategory SALESFORCE_MARKETING_CLOUD = fromString("SalesforceMarketingCloud"); - - /** - * Static value SapCloudForCustomer for ConnectionCategory. - */ - public static final ConnectionCategory SAP_CLOUD_FOR_CUSTOMER = fromString("SapCloudForCustomer"); - - /** - * Static value SapEcc for ConnectionCategory. - */ - public static final ConnectionCategory SAP_ECC = fromString("SapEcc"); - - /** - * Static value ServiceNow for ConnectionCategory. - */ - public static final ConnectionCategory SERVICE_NOW = fromString("ServiceNow"); - - /** - * Static value SharePointOnlineList for ConnectionCategory. - */ - public static final ConnectionCategory SHARE_POINT_ONLINE_LIST = fromString("SharePointOnlineList"); - - /** - * Static value Shopify for ConnectionCategory. - */ - public static final ConnectionCategory SHOPIFY = fromString("Shopify"); - - /** - * Static value Square for ConnectionCategory. - */ - public static final ConnectionCategory SQUARE = fromString("Square"); - - /** - * Static value WebTable for ConnectionCategory. - */ - public static final ConnectionCategory WEB_TABLE = fromString("WebTable"); - - /** - * Static value Xero for ConnectionCategory. - */ - public static final ConnectionCategory XERO = fromString("Xero"); - - /** - * Static value Zoho for ConnectionCategory. - */ - public static final ConnectionCategory ZOHO = fromString("Zoho"); - - /** - * Static value GenericContainerRegistry for ConnectionCategory. - */ - public static final ConnectionCategory GENERIC_CONTAINER_REGISTRY = fromString("GenericContainerRegistry"); - - /** - * Static value Elasticsearch for ConnectionCategory. - */ - public static final ConnectionCategory ELASTICSEARCH = fromString("Elasticsearch"); - - /** - * Static value AppInsights for ConnectionCategory. - */ - public static final ConnectionCategory APP_INSIGHTS = fromString("AppInsights"); - - /** - * Static value AppConfig for ConnectionCategory. - */ - public static final ConnectionCategory APP_CONFIG = fromString("AppConfig"); - - /** - * Static value OpenAI for ConnectionCategory. - */ - public static final ConnectionCategory OPEN_AI = fromString("OpenAI"); - - /** - * Static value Serp for ConnectionCategory. - */ - public static final ConnectionCategory SERP = fromString("Serp"); - - /** - * Static value BingLLMSearch for ConnectionCategory. - */ - public static final ConnectionCategory BING_LLMSEARCH = fromString("BingLLMSearch"); - - /** - * Static value Serverless for ConnectionCategory. - */ - public static final ConnectionCategory SERVERLESS = fromString("Serverless"); - - /** - * Static value ManagedOnlineEndpoint for ConnectionCategory. - */ - public static final ConnectionCategory MANAGED_ONLINE_ENDPOINT = fromString("ManagedOnlineEndpoint"); - - /** - * Static value ApiManagement for ConnectionCategory. - */ - public static final ConnectionCategory API_MANAGEMENT = fromString("ApiManagement"); - - /** - * Static value ModelGateway for ConnectionCategory. - */ - public static final ConnectionCategory MODEL_GATEWAY = fromString("ModelGateway"); - - /** - * Static value GroundingWithBingSearch for ConnectionCategory. - */ - public static final ConnectionCategory GROUNDING_WITH_BING_SEARCH = fromString("GroundingWithBingSearch"); - - /** - * Static value GroundingWithCustomSearch for ConnectionCategory. - */ - public static final ConnectionCategory GROUNDING_WITH_CUSTOM_SEARCH = fromString("GroundingWithCustomSearch"); - - /** - * Static value Sharepoint for ConnectionCategory. - */ - public static final ConnectionCategory SHAREPOINT = fromString("Sharepoint"); - - /** - * Static value MicrosoftFabric for ConnectionCategory. - */ - public static final ConnectionCategory MICROSOFT_FABRIC = fromString("MicrosoftFabric"); - - /** - * Static value PowerPlatformEnvironment for ConnectionCategory. - */ - public static final ConnectionCategory POWER_PLATFORM_ENVIRONMENT = fromString("PowerPlatformEnvironment"); - - /** - * Static value RemoteA2A for ConnectionCategory. - */ - public static final ConnectionCategory REMOTE_A2A = fromString("RemoteA2A"); - - /** - * Creates a new instance of ConnectionCategory value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ConnectionCategory() { - } - - /** - * Creates or finds a ConnectionCategory from its string representation. - * - * @param name a name to look for. - * @return the corresponding ConnectionCategory. - */ - public static ConnectionCategory fromString(String name) { - return fromString(name, ConnectionCategory.class); - } - - /** - * Gets known ConnectionCategory values. - * - * @return known ConnectionCategory values. - */ - public static Collection values() { - return values(ConnectionCategory.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionGroup.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionGroup.java deleted file mode 100644 index 59b3c99c9aec..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionGroup.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Group based on connection category. - */ -public final class ConnectionGroup extends ExpandableStringEnum { - /** - * Static value Azure for ConnectionGroup. - */ - public static final ConnectionGroup AZURE = fromString("Azure"); - - /** - * Static value AzureAI for ConnectionGroup. - */ - public static final ConnectionGroup AZURE_AI = fromString("AzureAI"); - - /** - * Static value Database for ConnectionGroup. - */ - public static final ConnectionGroup DATABASE = fromString("Database"); - - /** - * Static value NoSQL for ConnectionGroup. - */ - public static final ConnectionGroup NO_SQL = fromString("NoSQL"); - - /** - * Static value File for ConnectionGroup. - */ - public static final ConnectionGroup FILE = fromString("File"); - - /** - * Static value GenericProtocol for ConnectionGroup. - */ - public static final ConnectionGroup GENERIC_PROTOCOL = fromString("GenericProtocol"); - - /** - * Static value ServicesAndApps for ConnectionGroup. - */ - public static final ConnectionGroup SERVICES_AND_APPS = fromString("ServicesAndApps"); - - /** - * Creates a new instance of ConnectionGroup value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ConnectionGroup() { - } - - /** - * Creates or finds a ConnectionGroup from its string representation. - * - * @param name a name to look for. - * @return the corresponding ConnectionGroup. - */ - public static ConnectionGroup fromString(String name) { - return fromString(name, ConnectionGroup.class); - } - - /** - * Gets known ConnectionGroup values. - * - * @return known ConnectionGroup values. - */ - public static Collection values() { - return values(ConnectionGroup.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionManagedIdentity.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionManagedIdentity.java deleted file mode 100644 index 3d2b5f0148b0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionManagedIdentity.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 ConnectionManagedIdentity model. - */ -@Fluent -public final class ConnectionManagedIdentity implements JsonSerializable { - /* - * The clientId property. - */ - private String clientId; - - /* - * The resourceId property. - */ - private String resourceId; - - /** - * Creates an instance of ConnectionManagedIdentity class. - */ - public ConnectionManagedIdentity() { - } - - /** - * Get the clientId property: The clientId property. - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * Set the clientId property: The clientId property. - * - * @param clientId the clientId value to set. - * @return the ConnectionManagedIdentity object itself. - */ - public ConnectionManagedIdentity withClientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Get the resourceId property: The resourceId property. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: The resourceId property. - * - * @param resourceId the resourceId value to set. - * @return the ConnectionManagedIdentity object itself. - */ - public ConnectionManagedIdentity withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("clientId", this.clientId); - jsonWriter.writeStringField("resourceId", this.resourceId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ConnectionManagedIdentity from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ConnectionManagedIdentity 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 ConnectionManagedIdentity. - */ - public static ConnectionManagedIdentity fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ConnectionManagedIdentity deserializedConnectionManagedIdentity = new ConnectionManagedIdentity(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("clientId".equals(fieldName)) { - deserializedConnectionManagedIdentity.clientId = reader.getString(); - } else if ("resourceId".equals(fieldName)) { - deserializedConnectionManagedIdentity.resourceId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedConnectionManagedIdentity; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionOAuth2.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionOAuth2.java deleted file mode 100644 index bdba5f3bec71..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionOAuth2.java +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * ClientId and ClientSecret are required. Other properties are optional - * depending on each OAuth2 provider's implementation. - */ -@Fluent -public final class ConnectionOAuth2 implements JsonSerializable { - /* - * Required by Concur connection category - */ - private String authUrl; - - /* - * Client id in the format of UUID - */ - private String clientId; - - /* - * The clientSecret property. - */ - private String clientSecret; - - /* - * Required by GoogleAdWords connection category - */ - private String developerToken; - - /* - * The password property. - */ - private String password; - - /* - * Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, Xero, Zoho - * where user needs to get RefreshToken offline - */ - private String refreshToken; - - /* - * Required by QuickBooks and Xero connection categories - */ - private String tenantId; - - /* - * Concur, ServiceNow auth server AccessToken grant type is 'Password' - * which requires UsernamePassword - */ - private String username; - - /** - * Creates an instance of ConnectionOAuth2 class. - */ - public ConnectionOAuth2() { - } - - /** - * Get the authUrl property: Required by Concur connection category. - * - * @return the authUrl value. - */ - public String authUrl() { - return this.authUrl; - } - - /** - * Set the authUrl property: Required by Concur connection category. - * - * @param authUrl the authUrl value to set. - * @return the ConnectionOAuth2 object itself. - */ - public ConnectionOAuth2 withAuthUrl(String authUrl) { - this.authUrl = authUrl; - return this; - } - - /** - * Get the clientId property: Client id in the format of UUID. - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * Set the clientId property: Client id in the format of UUID. - * - * @param clientId the clientId value to set. - * @return the ConnectionOAuth2 object itself. - */ - public ConnectionOAuth2 withClientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Get the clientSecret property: The clientSecret property. - * - * @return the clientSecret value. - */ - public String clientSecret() { - return this.clientSecret; - } - - /** - * Set the clientSecret property: The clientSecret property. - * - * @param clientSecret the clientSecret value to set. - * @return the ConnectionOAuth2 object itself. - */ - public ConnectionOAuth2 withClientSecret(String clientSecret) { - this.clientSecret = clientSecret; - return this; - } - - /** - * Get the developerToken property: Required by GoogleAdWords connection category. - * - * @return the developerToken value. - */ - public String developerToken() { - return this.developerToken; - } - - /** - * Set the developerToken property: Required by GoogleAdWords connection category. - * - * @param developerToken the developerToken value to set. - * @return the ConnectionOAuth2 object itself. - */ - public ConnectionOAuth2 withDeveloperToken(String developerToken) { - this.developerToken = developerToken; - return this; - } - - /** - * Get the password property: The password property. - * - * @return the password value. - */ - public String password() { - return this.password; - } - - /** - * Set the password property: The password property. - * - * @param password the password value to set. - * @return the ConnectionOAuth2 object itself. - */ - public ConnectionOAuth2 withPassword(String password) { - this.password = password; - return this; - } - - /** - * Get the refreshToken property: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, Xero, Zoho - * where user needs to get RefreshToken offline. - * - * @return the refreshToken value. - */ - public String refreshToken() { - return this.refreshToken; - } - - /** - * Set the refreshToken property: Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, Xero, Zoho - * where user needs to get RefreshToken offline. - * - * @param refreshToken the refreshToken value to set. - * @return the ConnectionOAuth2 object itself. - */ - public ConnectionOAuth2 withRefreshToken(String refreshToken) { - this.refreshToken = refreshToken; - return this; - } - - /** - * Get the tenantId property: Required by QuickBooks and Xero connection categories. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Set the tenantId property: Required by QuickBooks and Xero connection categories. - * - * @param tenantId the tenantId value to set. - * @return the ConnectionOAuth2 object itself. - */ - public ConnectionOAuth2 withTenantId(String tenantId) { - this.tenantId = tenantId; - return this; - } - - /** - * Get the username property: Concur, ServiceNow auth server AccessToken grant type is 'Password' - * which requires UsernamePassword. - * - * @return the username value. - */ - public String username() { - return this.username; - } - - /** - * Set the username property: Concur, ServiceNow auth server AccessToken grant type is 'Password' - * which requires UsernamePassword. - * - * @param username the username value to set. - * @return the ConnectionOAuth2 object itself. - */ - public ConnectionOAuth2 withUsername(String username) { - this.username = username; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("authUrl", this.authUrl); - jsonWriter.writeStringField("clientId", this.clientId); - jsonWriter.writeStringField("clientSecret", this.clientSecret); - jsonWriter.writeStringField("developerToken", this.developerToken); - jsonWriter.writeStringField("password", this.password); - jsonWriter.writeStringField("refreshToken", this.refreshToken); - jsonWriter.writeStringField("tenantId", this.tenantId); - jsonWriter.writeStringField("username", this.username); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ConnectionOAuth2 from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ConnectionOAuth2 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 ConnectionOAuth2. - */ - public static ConnectionOAuth2 fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ConnectionOAuth2 deserializedConnectionOAuth2 = new ConnectionOAuth2(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("authUrl".equals(fieldName)) { - deserializedConnectionOAuth2.authUrl = reader.getString(); - } else if ("clientId".equals(fieldName)) { - deserializedConnectionOAuth2.clientId = reader.getString(); - } else if ("clientSecret".equals(fieldName)) { - deserializedConnectionOAuth2.clientSecret = reader.getString(); - } else if ("developerToken".equals(fieldName)) { - deserializedConnectionOAuth2.developerToken = reader.getString(); - } else if ("password".equals(fieldName)) { - deserializedConnectionOAuth2.password = reader.getString(); - } else if ("refreshToken".equals(fieldName)) { - deserializedConnectionOAuth2.refreshToken = reader.getString(); - } else if ("tenantId".equals(fieldName)) { - deserializedConnectionOAuth2.tenantId = reader.getString(); - } else if ("username".equals(fieldName)) { - deserializedConnectionOAuth2.username = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedConnectionOAuth2; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPersonalAccessToken.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPersonalAccessToken.java deleted file mode 100644 index c942979810e2..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPersonalAccessToken.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 ConnectionPersonalAccessToken model. - */ -@Fluent -public final class ConnectionPersonalAccessToken implements JsonSerializable { - /* - * The pat property. - */ - private String pat; - - /** - * Creates an instance of ConnectionPersonalAccessToken class. - */ - public ConnectionPersonalAccessToken() { - } - - /** - * Get the pat property: The pat property. - * - * @return the pat value. - */ - public String pat() { - return this.pat; - } - - /** - * Set the pat property: The pat property. - * - * @param pat the pat value to set. - * @return the ConnectionPersonalAccessToken object itself. - */ - public ConnectionPersonalAccessToken withPat(String pat) { - this.pat = pat; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("pat", this.pat); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ConnectionPersonalAccessToken from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ConnectionPersonalAccessToken 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 ConnectionPersonalAccessToken. - */ - public static ConnectionPersonalAccessToken fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ConnectionPersonalAccessToken deserializedConnectionPersonalAccessToken - = new ConnectionPersonalAccessToken(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("pat".equals(fieldName)) { - deserializedConnectionPersonalAccessToken.pat = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedConnectionPersonalAccessToken; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2.java deleted file mode 100644 index 9f76c62c2a19..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2.java +++ /dev/null @@ -1,471 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; -import java.util.List; -import java.util.Map; - -/** - * Connection property base schema. - */ -@Fluent -public class ConnectionPropertiesV2 implements JsonSerializable { - /* - * Authentication type of the connection target - */ - private ConnectionAuthType authType = ConnectionAuthType.fromString("ConnectionPropertiesV2"); - - /* - * Category of the connection - */ - private ConnectionCategory category; - - /* - * The createdByWorkspaceArmId property. - */ - private String createdByWorkspaceArmId; - - /* - * Provides the error message if the connection fails - */ - private String error; - - /* - * The expiryTime property. - */ - private OffsetDateTime expiryTime; - - /* - * Group based on connection category - */ - private ConnectionGroup group; - - /* - * The isSharedToAll property. - */ - private Boolean isSharedToAll; - - /* - * Store user metadata for this connection - */ - private Map metadata; - - /* - * Specifies how private endpoints are used with this connection: 'Required', 'NotRequired', or 'NotApplicable'. - */ - private ManagedPERequirement peRequirement; - - /* - * Specifies the status of private endpoints for this connection: 'Inactive', 'Active', or 'NotApplicable'. - */ - private ManagedPEStatus peStatus; - - /* - * The sharedUserList property. - */ - private List sharedUserList; - - /* - * The connection URL to be used. - */ - private String target; - - /* - * The useWorkspaceManagedIdentity property. - */ - private Boolean useWorkspaceManagedIdentity; - - /** - * Creates an instance of ConnectionPropertiesV2 class. - */ - public ConnectionPropertiesV2() { - } - - /** - * Get the authType property: Authentication type of the connection target. - * - * @return the authType value. - */ - public ConnectionAuthType authType() { - return this.authType; - } - - /** - * Get the category property: Category of the connection. - * - * @return the category value. - */ - public ConnectionCategory category() { - return this.category; - } - - /** - * Set the category property: Category of the connection. - * - * @param category the category value to set. - * @return the ConnectionPropertiesV2 object itself. - */ - public ConnectionPropertiesV2 withCategory(ConnectionCategory category) { - this.category = category; - return this; - } - - /** - * Get the createdByWorkspaceArmId property: The createdByWorkspaceArmId property. - * - * @return the createdByWorkspaceArmId value. - */ - public String createdByWorkspaceArmId() { - return this.createdByWorkspaceArmId; - } - - /** - * Set the createdByWorkspaceArmId property: The createdByWorkspaceArmId property. - * - * @param createdByWorkspaceArmId the createdByWorkspaceArmId value to set. - * @return the ConnectionPropertiesV2 object itself. - */ - ConnectionPropertiesV2 withCreatedByWorkspaceArmId(String createdByWorkspaceArmId) { - this.createdByWorkspaceArmId = createdByWorkspaceArmId; - return this; - } - - /** - * Get the error property: Provides the error message if the connection fails. - * - * @return the error value. - */ - public String error() { - return this.error; - } - - /** - * Set the error property: Provides the error message if the connection fails. - * - * @param error the error value to set. - * @return the ConnectionPropertiesV2 object itself. - */ - public ConnectionPropertiesV2 withError(String error) { - this.error = error; - return this; - } - - /** - * Get the expiryTime property: The expiryTime property. - * - * @return the expiryTime value. - */ - public OffsetDateTime expiryTime() { - return this.expiryTime; - } - - /** - * Set the expiryTime property: The expiryTime property. - * - * @param expiryTime the expiryTime value to set. - * @return the ConnectionPropertiesV2 object itself. - */ - public ConnectionPropertiesV2 withExpiryTime(OffsetDateTime expiryTime) { - this.expiryTime = expiryTime; - return this; - } - - /** - * Get the group property: Group based on connection category. - * - * @return the group value. - */ - public ConnectionGroup group() { - return this.group; - } - - /** - * Set the group property: Group based on connection category. - * - * @param group the group value to set. - * @return the ConnectionPropertiesV2 object itself. - */ - ConnectionPropertiesV2 withGroup(ConnectionGroup group) { - this.group = group; - return this; - } - - /** - * Get the isSharedToAll property: The isSharedToAll property. - * - * @return the isSharedToAll value. - */ - public Boolean isSharedToAll() { - return this.isSharedToAll; - } - - /** - * Set the isSharedToAll property: The isSharedToAll property. - * - * @param isSharedToAll the isSharedToAll value to set. - * @return the ConnectionPropertiesV2 object itself. - */ - public ConnectionPropertiesV2 withIsSharedToAll(Boolean isSharedToAll) { - this.isSharedToAll = isSharedToAll; - return this; - } - - /** - * Get the metadata property: Store user metadata for this connection. - * - * @return the metadata value. - */ - public Map metadata() { - return this.metadata; - } - - /** - * Set the metadata property: Store user metadata for this connection. - * - * @param metadata the metadata value to set. - * @return the ConnectionPropertiesV2 object itself. - */ - public ConnectionPropertiesV2 withMetadata(Map metadata) { - this.metadata = metadata; - return this; - } - - /** - * Get the peRequirement property: Specifies how private endpoints are used with this connection: 'Required', - * 'NotRequired', or 'NotApplicable'. - * - * @return the peRequirement value. - */ - public ManagedPERequirement peRequirement() { - return this.peRequirement; - } - - /** - * Set the peRequirement property: Specifies how private endpoints are used with this connection: 'Required', - * 'NotRequired', or 'NotApplicable'. - * - * @param peRequirement the peRequirement value to set. - * @return the ConnectionPropertiesV2 object itself. - */ - public ConnectionPropertiesV2 withPeRequirement(ManagedPERequirement peRequirement) { - this.peRequirement = peRequirement; - return this; - } - - /** - * Get the peStatus property: Specifies the status of private endpoints for this connection: 'Inactive', 'Active', - * or 'NotApplicable'. - * - * @return the peStatus value. - */ - public ManagedPEStatus peStatus() { - return this.peStatus; - } - - /** - * Set the peStatus property: Specifies the status of private endpoints for this connection: 'Inactive', 'Active', - * or 'NotApplicable'. - * - * @param peStatus the peStatus value to set. - * @return the ConnectionPropertiesV2 object itself. - */ - public ConnectionPropertiesV2 withPeStatus(ManagedPEStatus peStatus) { - this.peStatus = peStatus; - return this; - } - - /** - * Get the sharedUserList property: The sharedUserList property. - * - * @return the sharedUserList value. - */ - public List sharedUserList() { - return this.sharedUserList; - } - - /** - * Set the sharedUserList property: The sharedUserList property. - * - * @param sharedUserList the sharedUserList value to set. - * @return the ConnectionPropertiesV2 object itself. - */ - public ConnectionPropertiesV2 withSharedUserList(List sharedUserList) { - this.sharedUserList = sharedUserList; - return this; - } - - /** - * Get the target property: The connection URL to be used. - * - * @return the target value. - */ - public String target() { - return this.target; - } - - /** - * Set the target property: The connection URL to be used. - * - * @param target the target value to set. - * @return the ConnectionPropertiesV2 object itself. - */ - public ConnectionPropertiesV2 withTarget(String target) { - this.target = target; - return this; - } - - /** - * Get the useWorkspaceManagedIdentity property: The useWorkspaceManagedIdentity property. - * - * @return the useWorkspaceManagedIdentity value. - */ - public Boolean useWorkspaceManagedIdentity() { - return this.useWorkspaceManagedIdentity; - } - - /** - * Set the useWorkspaceManagedIdentity property: The useWorkspaceManagedIdentity property. - * - * @param useWorkspaceManagedIdentity the useWorkspaceManagedIdentity value to set. - * @return the ConnectionPropertiesV2 object itself. - */ - public ConnectionPropertiesV2 withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { - this.useWorkspaceManagedIdentity = useWorkspaceManagedIdentity; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); - jsonWriter.writeStringField("category", this.category == null ? null : this.category.toString()); - jsonWriter.writeStringField("error", this.error); - jsonWriter.writeStringField("expiryTime", - this.expiryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiryTime)); - jsonWriter.writeBooleanField("isSharedToAll", this.isSharedToAll); - jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("peRequirement", this.peRequirement == null ? null : this.peRequirement.toString()); - jsonWriter.writeStringField("peStatus", this.peStatus == null ? null : this.peStatus.toString()); - jsonWriter.writeArrayField("sharedUserList", this.sharedUserList, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("target", this.target); - jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", this.useWorkspaceManagedIdentity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ConnectionPropertiesV2 from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ConnectionPropertiesV2 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 ConnectionPropertiesV2. - */ - public static ConnectionPropertiesV2 fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("authType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("PAT".equals(discriminatorValue)) { - return PatAuthTypeConnectionProperties.fromJson(readerToUse.reset()); - } else if ("ManagedIdentity".equals(discriminatorValue)) { - return ManagedIdentityAuthTypeConnectionProperties.fromJson(readerToUse.reset()); - } else if ("UsernamePassword".equals(discriminatorValue)) { - return UsernamePasswordAuthTypeConnectionProperties.fromJson(readerToUse.reset()); - } else if ("None".equals(discriminatorValue)) { - return NoneAuthTypeConnectionProperties.fromJson(readerToUse.reset()); - } else if ("SAS".equals(discriminatorValue)) { - return SasAuthTypeConnectionProperties.fromJson(readerToUse.reset()); - } else if ("AccountKey".equals(discriminatorValue)) { - return AccountKeyAuthTypeConnectionProperties.fromJson(readerToUse.reset()); - } else if ("ServicePrincipal".equals(discriminatorValue)) { - return ServicePrincipalAuthTypeConnectionProperties.fromJson(readerToUse.reset()); - } else if ("AccessKey".equals(discriminatorValue)) { - return AccessKeyAuthTypeConnectionProperties.fromJson(readerToUse.reset()); - } else if ("ApiKey".equals(discriminatorValue)) { - return ApiKeyAuthConnectionProperties.fromJson(readerToUse.reset()); - } else if ("CustomKeys".equals(discriminatorValue)) { - return CustomKeysConnectionProperties.fromJson(readerToUse.reset()); - } else if ("OAuth2".equals(discriminatorValue)) { - return OAuth2AuthTypeConnectionProperties.fromJson(readerToUse.reset()); - } else if ("AAD".equals(discriminatorValue)) { - return AadAuthTypeConnectionProperties.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static ConnectionPropertiesV2 fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ConnectionPropertiesV2 deserializedConnectionPropertiesV2 = new ConnectionPropertiesV2(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("authType".equals(fieldName)) { - deserializedConnectionPropertiesV2.authType = ConnectionAuthType.fromString(reader.getString()); - } else if ("category".equals(fieldName)) { - deserializedConnectionPropertiesV2.category = ConnectionCategory.fromString(reader.getString()); - } else if ("createdByWorkspaceArmId".equals(fieldName)) { - deserializedConnectionPropertiesV2.createdByWorkspaceArmId = reader.getString(); - } else if ("error".equals(fieldName)) { - deserializedConnectionPropertiesV2.error = reader.getString(); - } else if ("expiryTime".equals(fieldName)) { - deserializedConnectionPropertiesV2.expiryTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("group".equals(fieldName)) { - deserializedConnectionPropertiesV2.group = ConnectionGroup.fromString(reader.getString()); - } else if ("isSharedToAll".equals(fieldName)) { - deserializedConnectionPropertiesV2.isSharedToAll = reader.getNullable(JsonReader::getBoolean); - } else if ("metadata".equals(fieldName)) { - Map metadata = reader.readMap(reader1 -> reader1.getString()); - deserializedConnectionPropertiesV2.metadata = metadata; - } else if ("peRequirement".equals(fieldName)) { - deserializedConnectionPropertiesV2.peRequirement - = ManagedPERequirement.fromString(reader.getString()); - } else if ("peStatus".equals(fieldName)) { - deserializedConnectionPropertiesV2.peStatus = ManagedPEStatus.fromString(reader.getString()); - } else if ("sharedUserList".equals(fieldName)) { - List sharedUserList = reader.readArray(reader1 -> reader1.getString()); - deserializedConnectionPropertiesV2.sharedUserList = sharedUserList; - } else if ("target".equals(fieldName)) { - deserializedConnectionPropertiesV2.target = reader.getString(); - } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { - deserializedConnectionPropertiesV2.useWorkspaceManagedIdentity - = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedConnectionPropertiesV2; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2BasicResource.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2BasicResource.java deleted file mode 100644 index 58c66fe07127..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2BasicResource.java +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; - -/** - * An immutable client-side representation of ConnectionPropertiesV2BasicResource. - */ -public interface ConnectionPropertiesV2BasicResource { - /** - * 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: Connection property base schema. - * - * @return the properties value. - */ - ConnectionPropertiesV2 properties(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner - * object. - * - * @return the inner object. - */ - ConnectionPropertiesV2BasicResourceInner innerModel(); - - /** - * The entirety of the ConnectionPropertiesV2BasicResource definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, DefinitionStages.WithCreate { - } - - /** - * The ConnectionPropertiesV2BasicResource definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the ConnectionPropertiesV2BasicResource definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the ConnectionPropertiesV2BasicResource definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, accountName, projectName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @return the next definition stage. - */ - WithProperties withExistingProject(String resourceGroupName, String accountName, String projectName); - } - - /** - * The stage of the ConnectionPropertiesV2BasicResource definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Connection property base schema.. - * - * @param properties Connection property base schema. - * @return the next definition stage. - */ - WithCreate withProperties(ConnectionPropertiesV2 properties); - } - - /** - * The stage of the ConnectionPropertiesV2BasicResource 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 { - /** - * Executes the create request. - * - * @return the created resource. - */ - ConnectionPropertiesV2BasicResource create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - ConnectionPropertiesV2BasicResource create(Context context); - } - } - - /** - * Begins update for the ConnectionPropertiesV2BasicResource resource. - * - * @return the stage of resource update. - */ - ConnectionPropertiesV2BasicResource.Update update(); - - /** - * The template for ConnectionPropertiesV2BasicResource update. - */ - interface Update extends UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - ConnectionPropertiesV2BasicResource apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - ConnectionPropertiesV2BasicResource apply(Context context); - } - - /** - * The ConnectionPropertiesV2BasicResource update stages. - */ - interface UpdateStages { - /** - * The stage of the ConnectionPropertiesV2BasicResource update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: The properties that the Cognitive services connection will be updated - * with.. - * - * @param properties The properties that the Cognitive services connection will be updated with. - * @return the next definition stage. - */ - Update withProperties(ConnectionPropertiesV2 properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - ConnectionPropertiesV2BasicResource refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - ConnectionPropertiesV2BasicResource refresh(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionServicePrincipal.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionServicePrincipal.java deleted file mode 100644 index 29b905db695d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionServicePrincipal.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 ConnectionServicePrincipal model. - */ -@Fluent -public final class ConnectionServicePrincipal implements JsonSerializable { - /* - * The clientId property. - */ - private String clientId; - - /* - * The clientSecret property. - */ - private String clientSecret; - - /* - * The tenantId property. - */ - private String tenantId; - - /** - * Creates an instance of ConnectionServicePrincipal class. - */ - public ConnectionServicePrincipal() { - } - - /** - * Get the clientId property: The clientId property. - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * Set the clientId property: The clientId property. - * - * @param clientId the clientId value to set. - * @return the ConnectionServicePrincipal object itself. - */ - public ConnectionServicePrincipal withClientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Get the clientSecret property: The clientSecret property. - * - * @return the clientSecret value. - */ - public String clientSecret() { - return this.clientSecret; - } - - /** - * Set the clientSecret property: The clientSecret property. - * - * @param clientSecret the clientSecret value to set. - * @return the ConnectionServicePrincipal object itself. - */ - public ConnectionServicePrincipal withClientSecret(String clientSecret) { - this.clientSecret = clientSecret; - return this; - } - - /** - * Get the tenantId property: The tenantId property. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Set the tenantId property: The tenantId property. - * - * @param tenantId the tenantId value to set. - * @return the ConnectionServicePrincipal object itself. - */ - public ConnectionServicePrincipal withTenantId(String tenantId) { - this.tenantId = tenantId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("clientId", this.clientId); - jsonWriter.writeStringField("clientSecret", this.clientSecret); - jsonWriter.writeStringField("tenantId", this.tenantId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ConnectionServicePrincipal from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ConnectionServicePrincipal 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 ConnectionServicePrincipal. - */ - public static ConnectionServicePrincipal fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ConnectionServicePrincipal deserializedConnectionServicePrincipal = new ConnectionServicePrincipal(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("clientId".equals(fieldName)) { - deserializedConnectionServicePrincipal.clientId = reader.getString(); - } else if ("clientSecret".equals(fieldName)) { - deserializedConnectionServicePrincipal.clientSecret = reader.getString(); - } else if ("tenantId".equals(fieldName)) { - deserializedConnectionServicePrincipal.tenantId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedConnectionServicePrincipal; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionSharedAccessSignature.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionSharedAccessSignature.java deleted file mode 100644 index 2e405c3bf493..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionSharedAccessSignature.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 ConnectionSharedAccessSignature model. - */ -@Fluent -public final class ConnectionSharedAccessSignature implements JsonSerializable { - /* - * The sas property. - */ - private String sas; - - /** - * Creates an instance of ConnectionSharedAccessSignature class. - */ - public ConnectionSharedAccessSignature() { - } - - /** - * Get the sas property: The sas property. - * - * @return the sas value. - */ - public String sas() { - return this.sas; - } - - /** - * Set the sas property: The sas property. - * - * @param sas the sas value to set. - * @return the ConnectionSharedAccessSignature object itself. - */ - public ConnectionSharedAccessSignature withSas(String sas) { - this.sas = sas; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("sas", this.sas); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ConnectionSharedAccessSignature from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ConnectionSharedAccessSignature 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 ConnectionSharedAccessSignature. - */ - public static ConnectionSharedAccessSignature fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ConnectionSharedAccessSignature deserializedConnectionSharedAccessSignature - = new ConnectionSharedAccessSignature(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sas".equals(fieldName)) { - deserializedConnectionSharedAccessSignature.sas = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedConnectionSharedAccessSignature; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUpdateContent.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUpdateContent.java deleted file mode 100644 index ccef05933e10..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUpdateContent.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 properties that the Cognitive services connection will be updated with. - */ -@Fluent -public final class ConnectionUpdateContent implements JsonSerializable { - /* - * The properties that the Cognitive services connection will be updated with. - */ - private ConnectionPropertiesV2 properties; - - /** - * Creates an instance of ConnectionUpdateContent class. - */ - public ConnectionUpdateContent() { - } - - /** - * Get the properties property: The properties that the Cognitive services connection will be updated with. - * - * @return the properties value. - */ - public ConnectionPropertiesV2 properties() { - return this.properties; - } - - /** - * Set the properties property: The properties that the Cognitive services connection will be updated with. - * - * @param properties the properties value to set. - * @return the ConnectionUpdateContent object itself. - */ - public ConnectionUpdateContent withProperties(ConnectionPropertiesV2 properties) { - this.properties = properties; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ConnectionUpdateContent from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ConnectionUpdateContent 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 ConnectionUpdateContent. - */ - public static ConnectionUpdateContent fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ConnectionUpdateContent deserializedConnectionUpdateContent = new ConnectionUpdateContent(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedConnectionUpdateContent.properties = ConnectionPropertiesV2.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedConnectionUpdateContent; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUsernamePassword.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUsernamePassword.java deleted file mode 100644 index 2e299d2c3fb0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUsernamePassword.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 ConnectionUsernamePassword model. - */ -@Fluent -public final class ConnectionUsernamePassword implements JsonSerializable { - /* - * The password property. - */ - private String password; - - /* - * Optional, required by connections like SalesForce for extra security in addition to UsernamePassword - */ - private String securityToken; - - /* - * The username property. - */ - private String username; - - /** - * Creates an instance of ConnectionUsernamePassword class. - */ - public ConnectionUsernamePassword() { - } - - /** - * Get the password property: The password property. - * - * @return the password value. - */ - public String password() { - return this.password; - } - - /** - * Set the password property: The password property. - * - * @param password the password value to set. - * @return the ConnectionUsernamePassword object itself. - */ - public ConnectionUsernamePassword withPassword(String password) { - this.password = password; - return this; - } - - /** - * Get the securityToken property: Optional, required by connections like SalesForce for extra security in addition - * to UsernamePassword. - * - * @return the securityToken value. - */ - public String securityToken() { - return this.securityToken; - } - - /** - * Set the securityToken property: Optional, required by connections like SalesForce for extra security in addition - * to UsernamePassword. - * - * @param securityToken the securityToken value to set. - * @return the ConnectionUsernamePassword object itself. - */ - public ConnectionUsernamePassword withSecurityToken(String securityToken) { - this.securityToken = securityToken; - return this; - } - - /** - * Get the username property: The username property. - * - * @return the username value. - */ - public String username() { - return this.username; - } - - /** - * Set the username property: The username property. - * - * @param username the username value to set. - * @return the ConnectionUsernamePassword object itself. - */ - public ConnectionUsernamePassword withUsername(String username) { - this.username = username; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("password", this.password); - jsonWriter.writeStringField("securityToken", this.securityToken); - jsonWriter.writeStringField("username", this.username); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ConnectionUsernamePassword from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ConnectionUsernamePassword 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 ConnectionUsernamePassword. - */ - public static ConnectionUsernamePassword fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ConnectionUsernamePassword deserializedConnectionUsernamePassword = new ConnectionUsernamePassword(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("password".equals(fieldName)) { - deserializedConnectionUsernamePassword.password = reader.getString(); - } else if ("securityToken".equals(fieldName)) { - deserializedConnectionUsernamePassword.securityToken = reader.getString(); - } else if ("username".equals(fieldName)) { - deserializedConnectionUsernamePassword.username = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedConnectionUsernamePassword; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectivityEndpoints.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectivityEndpoints.java deleted file mode 100644 index 50fb842564de..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectivityEndpoints.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Network connectivity endpoints for a Container Instance compute. - */ -@Immutable -public final class ConnectivityEndpoints implements JsonSerializable { - /* - * The public IP address of the compute instance. - */ - private String publicIpAddress; - - /* - * The SSH port for the compute instance. - */ - private Integer sshPort; - - /** - * Creates an instance of ConnectivityEndpoints class. - */ - private ConnectivityEndpoints() { - } - - /** - * Get the publicIpAddress property: The public IP address of the compute instance. - * - * @return the publicIpAddress value. - */ - public String publicIpAddress() { - return this.publicIpAddress; - } - - /** - * Get the sshPort property: The SSH port for the compute instance. - * - * @return the sshPort value. - */ - public Integer sshPort() { - return this.sshPort; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ConnectivityEndpoints from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ConnectivityEndpoints 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 ConnectivityEndpoints. - */ - public static ConnectivityEndpoints fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ConnectivityEndpoints deserializedConnectivityEndpoints = new ConnectivityEndpoints(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("publicIpAddress".equals(fieldName)) { - deserializedConnectivityEndpoints.publicIpAddress = reader.getString(); - } else if ("sshPort".equals(fieldName)) { - deserializedConnectivityEndpoints.sshPort = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedConnectivityEndpoints; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ContainerInstanceComputeProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ContainerInstanceComputeProperties.java deleted file mode 100644 index 387288c4690d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ContainerInstanceComputeProperties.java +++ /dev/null @@ -1,220 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Properties for a Container Instance compute resource. - */ -@Fluent -public final class ContainerInstanceComputeProperties extends ComputeProperties { - /* - * The type of compute resource. - */ - private ComputeType computeType = ComputeType.CONTAINER_INSTANCE; - - /* - * ARM resource ID of the parent cluster that hosts this container instance. - */ - private String targetClusterId; - - /* - * Container image URI (e.g., MCR or ACR image path) for the container instance. - */ - private String imageLink; - - /* - * ISO 8601 duration before the idle instance is automatically shut down (e.g., 'PT30M'). - */ - private String idleTimeBeforeShutdown; - - /* - * SSH configuration for remote access to the container instance. - */ - private SshSettings sshSettings; - - /* - * Network connectivity endpoints assigned to the container instance. - */ - private ConnectivityEndpoints connectivityEndpoints; - - /** - * Creates an instance of ContainerInstanceComputeProperties class. - */ - public ContainerInstanceComputeProperties() { - } - - /** - * Get the computeType property: The type of compute resource. - * - * @return the computeType value. - */ - @Override - public ComputeType computeType() { - return this.computeType; - } - - /** - * Get the targetClusterId property: ARM resource ID of the parent cluster that hosts this container instance. - * - * @return the targetClusterId value. - */ - public String targetClusterId() { - return this.targetClusterId; - } - - /** - * Set the targetClusterId property: ARM resource ID of the parent cluster that hosts this container instance. - * - * @param targetClusterId the targetClusterId value to set. - * @return the ContainerInstanceComputeProperties object itself. - */ - public ContainerInstanceComputeProperties withTargetClusterId(String targetClusterId) { - this.targetClusterId = targetClusterId; - return this; - } - - /** - * Get the imageLink property: Container image URI (e.g., MCR or ACR image path) for the container instance. - * - * @return the imageLink value. - */ - public String imageLink() { - return this.imageLink; - } - - /** - * Set the imageLink property: Container image URI (e.g., MCR or ACR image path) for the container instance. - * - * @param imageLink the imageLink value to set. - * @return the ContainerInstanceComputeProperties object itself. - */ - public ContainerInstanceComputeProperties withImageLink(String imageLink) { - this.imageLink = imageLink; - return this; - } - - /** - * Get the idleTimeBeforeShutdown property: ISO 8601 duration before the idle instance is automatically shut down - * (e.g., 'PT30M'). - * - * @return the idleTimeBeforeShutdown value. - */ - public String idleTimeBeforeShutdown() { - return this.idleTimeBeforeShutdown; - } - - /** - * Set the idleTimeBeforeShutdown property: ISO 8601 duration before the idle instance is automatically shut down - * (e.g., 'PT30M'). - * - * @param idleTimeBeforeShutdown the idleTimeBeforeShutdown value to set. - * @return the ContainerInstanceComputeProperties object itself. - */ - public ContainerInstanceComputeProperties withIdleTimeBeforeShutdown(String idleTimeBeforeShutdown) { - this.idleTimeBeforeShutdown = idleTimeBeforeShutdown; - return this; - } - - /** - * Get the sshSettings property: SSH configuration for remote access to the container instance. - * - * @return the sshSettings value. - */ - public SshSettings sshSettings() { - return this.sshSettings; - } - - /** - * Set the sshSettings property: SSH configuration for remote access to the container instance. - * - * @param sshSettings the sshSettings value to set. - * @return the ContainerInstanceComputeProperties object itself. - */ - public ContainerInstanceComputeProperties withSshSettings(SshSettings sshSettings) { - this.sshSettings = sshSettings; - return this; - } - - /** - * Get the connectivityEndpoints property: Network connectivity endpoints assigned to the container instance. - * - * @return the connectivityEndpoints value. - */ - public ConnectivityEndpoints connectivityEndpoints() { - return this.connectivityEndpoints; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("targetClusterId", this.targetClusterId); - jsonWriter.writeStringField("imageLink", this.imageLink); - jsonWriter.writeStringField("computeType", this.computeType == null ? null : this.computeType.toString()); - jsonWriter.writeStringField("idleTimeBeforeShutdown", this.idleTimeBeforeShutdown); - jsonWriter.writeJsonField("sshSettings", this.sshSettings); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ContainerInstanceComputeProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ContainerInstanceComputeProperties 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 ContainerInstanceComputeProperties. - */ - public static ContainerInstanceComputeProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ContainerInstanceComputeProperties deserializedContainerInstanceComputeProperties - = new ContainerInstanceComputeProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningState".equals(fieldName)) { - deserializedContainerInstanceComputeProperties - .withProvisioningState(ComputeProvisioningState.fromString(reader.getString())); - } else if ("errors".equals(fieldName)) { - List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); - deserializedContainerInstanceComputeProperties.withErrors(errors); - } else if ("creationTime".equals(fieldName)) { - deserializedContainerInstanceComputeProperties.withCreationTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("targetClusterId".equals(fieldName)) { - deserializedContainerInstanceComputeProperties.targetClusterId = reader.getString(); - } else if ("imageLink".equals(fieldName)) { - deserializedContainerInstanceComputeProperties.imageLink = reader.getString(); - } else if ("computeType".equals(fieldName)) { - deserializedContainerInstanceComputeProperties.computeType - = ComputeType.fromString(reader.getString()); - } else if ("idleTimeBeforeShutdown".equals(fieldName)) { - deserializedContainerInstanceComputeProperties.idleTimeBeforeShutdown = reader.getString(); - } else if ("sshSettings".equals(fieldName)) { - deserializedContainerInstanceComputeProperties.sshSettings = SshSettings.fromJson(reader); - } else if ("connectivityEndpoints".equals(fieldName)) { - deserializedContainerInstanceComputeProperties.connectivityEndpoints - = ConnectivityEndpoints.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedContainerInstanceComputeProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ContentLevel.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ContentLevel.java deleted file mode 100644 index 6a88f6fe5005..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ContentLevel.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Level at which content is filtered. - */ -public final class ContentLevel extends ExpandableStringEnum { - /** - * Static value Low for ContentLevel. - */ - public static final ContentLevel LOW = fromString("Low"); - - /** - * Static value Medium for ContentLevel. - */ - public static final ContentLevel MEDIUM = fromString("Medium"); - - /** - * Static value High for ContentLevel. - */ - public static final ContentLevel HIGH = fromString("High"); - - /** - * Creates a new instance of ContentLevel value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ContentLevel() { - } - - /** - * Creates or finds a ContentLevel from its string representation. - * - * @param name a name to look for. - * @return the corresponding ContentLevel. - */ - public static ContentLevel fromString(String name) { - return fromString(name, ContentLevel.class); - } - - /** - * Gets known ContentLevel values. - * - * @return known ContentLevel values. - */ - public static Collection values() { - return values(ContentLevel.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomBlocklistConfig.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomBlocklistConfig.java deleted file mode 100644 index 268d0d2c809f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomBlocklistConfig.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Gets or sets the source to which filter applies. - */ -@Fluent -public final class CustomBlocklistConfig extends RaiBlocklistConfig { - /* - * Content source to apply the Content Filters. - */ - private RaiPolicyContentSource source; - - /** - * Creates an instance of CustomBlocklistConfig class. - */ - public CustomBlocklistConfig() { - } - - /** - * Get the source property: Content source to apply the Content Filters. - * - * @return the source value. - */ - public RaiPolicyContentSource source() { - return this.source; - } - - /** - * Set the source property: Content source to apply the Content Filters. - * - * @param source the source value to set. - * @return the CustomBlocklistConfig object itself. - */ - public CustomBlocklistConfig withSource(RaiPolicyContentSource source) { - this.source = source; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CustomBlocklistConfig withBlocklistName(String blocklistName) { - super.withBlocklistName(blocklistName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CustomBlocklistConfig withBlocking(Boolean blocking) { - super.withBlocking(blocking); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("blocklistName", blocklistName()); - jsonWriter.writeBooleanField("blocking", blocking()); - jsonWriter.writeStringField("source", this.source == null ? null : this.source.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CustomBlocklistConfig from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CustomBlocklistConfig 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 CustomBlocklistConfig. - */ - public static CustomBlocklistConfig fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CustomBlocklistConfig deserializedCustomBlocklistConfig = new CustomBlocklistConfig(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("blocklistName".equals(fieldName)) { - deserializedCustomBlocklistConfig.withBlocklistName(reader.getString()); - } else if ("blocking".equals(fieldName)) { - deserializedCustomBlocklistConfig.withBlocking(reader.getNullable(JsonReader::getBoolean)); - } else if ("source".equals(fieldName)) { - deserializedCustomBlocklistConfig.source = RaiPolicyContentSource.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedCustomBlocklistConfig; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeys.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeys.java deleted file mode 100644 index 3801409dc041..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeys.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Custom Keys credential object. - */ -@Fluent -public final class CustomKeys implements JsonSerializable { - /* - * Dictionary of - */ - private Map keys; - - /** - * Creates an instance of CustomKeys class. - */ - public CustomKeys() { - } - - /** - * Get the keys property: Dictionary of <string>. - * - * @return the keys value. - */ - public Map keys() { - return this.keys; - } - - /** - * Set the keys property: Dictionary of <string>. - * - * @param keys the keys value to set. - * @return the CustomKeys object itself. - */ - public CustomKeys withKeys(Map keys) { - this.keys = keys; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeMapField("keys", this.keys, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CustomKeys from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CustomKeys 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 CustomKeys. - */ - public static CustomKeys fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CustomKeys deserializedCustomKeys = new CustomKeys(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("keys".equals(fieldName)) { - Map keys = reader.readMap(reader1 -> reader1.getString()); - deserializedCustomKeys.keys = keys; - } else { - reader.skipChildren(); - } - } - - return deserializedCustomKeys; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeysConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeysConnectionProperties.java deleted file mode 100644 index ef26dc4ad4ed..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeysConnectionProperties.java +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * Category:= CustomKeys - * AuthType:= CustomKeys (as type discriminator) - * Credentials:= {CustomKeys} as CustomKeys - * Target:= {any value} - * Use Metadata property bag for ApiVersion and other metadata fields. - */ -@Fluent -public final class CustomKeysConnectionProperties extends ConnectionPropertiesV2 { - /* - * Authentication type of the connection target - */ - private ConnectionAuthType authType = ConnectionAuthType.CUSTOM_KEYS; - - /* - * Custom Keys credential object - */ - private CustomKeys credentials; - - /** - * Creates an instance of CustomKeysConnectionProperties class. - */ - public CustomKeysConnectionProperties() { - } - - /** - * Get the authType property: Authentication type of the connection target. - * - * @return the authType value. - */ - @Override - public ConnectionAuthType authType() { - return this.authType; - } - - /** - * Get the credentials property: Custom Keys credential object. - * - * @return the credentials value. - */ - public CustomKeys credentials() { - return this.credentials; - } - - /** - * Set the credentials property: Custom Keys credential object. - * - * @param credentials the credentials value to set. - * @return the CustomKeysConnectionProperties object itself. - */ - public CustomKeysConnectionProperties withCredentials(CustomKeys credentials) { - this.credentials = credentials; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CustomKeysConnectionProperties withCategory(ConnectionCategory category) { - super.withCategory(category); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CustomKeysConnectionProperties withError(String error) { - super.withError(error); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CustomKeysConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { - super.withExpiryTime(expiryTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CustomKeysConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { - super.withIsSharedToAll(isSharedToAll); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CustomKeysConnectionProperties withMetadata(Map metadata) { - super.withMetadata(metadata); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CustomKeysConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { - super.withPeRequirement(peRequirement); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CustomKeysConnectionProperties withPeStatus(ManagedPEStatus peStatus) { - super.withPeStatus(peStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CustomKeysConnectionProperties withSharedUserList(List sharedUserList) { - super.withSharedUserList(sharedUserList); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CustomKeysConnectionProperties withTarget(String target) { - super.withTarget(target); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CustomKeysConnectionProperties withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { - super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("category", category() == null ? null : category().toString()); - jsonWriter.writeStringField("error", error()); - jsonWriter.writeStringField("expiryTime", - expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); - jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); - jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); - jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); - jsonWriter.writeArrayField("sharedUserList", sharedUserList(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("target", target()); - jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); - jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); - jsonWriter.writeJsonField("credentials", this.credentials); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CustomKeysConnectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CustomKeysConnectionProperties 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 CustomKeysConnectionProperties. - */ - public static CustomKeysConnectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CustomKeysConnectionProperties deserializedCustomKeysConnectionProperties - = new CustomKeysConnectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("category".equals(fieldName)) { - deserializedCustomKeysConnectionProperties - .withCategory(ConnectionCategory.fromString(reader.getString())); - } else if ("createdByWorkspaceArmId".equals(fieldName)) { - deserializedCustomKeysConnectionProperties.withCreatedByWorkspaceArmId(reader.getString()); - } else if ("error".equals(fieldName)) { - deserializedCustomKeysConnectionProperties.withError(reader.getString()); - } else if ("expiryTime".equals(fieldName)) { - deserializedCustomKeysConnectionProperties.withExpiryTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("group".equals(fieldName)) { - deserializedCustomKeysConnectionProperties - .withGroup(ConnectionGroup.fromString(reader.getString())); - } else if ("isSharedToAll".equals(fieldName)) { - deserializedCustomKeysConnectionProperties - .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); - } else if ("metadata".equals(fieldName)) { - Map metadata = reader.readMap(reader1 -> reader1.getString()); - deserializedCustomKeysConnectionProperties.withMetadata(metadata); - } else if ("peRequirement".equals(fieldName)) { - deserializedCustomKeysConnectionProperties - .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); - } else if ("peStatus".equals(fieldName)) { - deserializedCustomKeysConnectionProperties - .withPeStatus(ManagedPEStatus.fromString(reader.getString())); - } else if ("sharedUserList".equals(fieldName)) { - List sharedUserList = reader.readArray(reader1 -> reader1.getString()); - deserializedCustomKeysConnectionProperties.withSharedUserList(sharedUserList); - } else if ("target".equals(fieldName)) { - deserializedCustomKeysConnectionProperties.withTarget(reader.getString()); - } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { - deserializedCustomKeysConnectionProperties - .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); - } else if ("authType".equals(fieldName)) { - deserializedCustomKeysConnectionProperties.authType - = ConnectionAuthType.fromString(reader.getString()); - } else if ("credentials".equals(fieldName)) { - deserializedCustomKeysConnectionProperties.credentials = CustomKeys.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCustomKeysConnectionProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISetting.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISetting.java deleted file mode 100644 index 6c0234e2bebd..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISetting.java +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.DefenderForAISettingInner; -import java.util.Map; - -/** - * An immutable client-side representation of DefenderForAISetting. - */ -public interface DefenderForAISetting { - /** - * 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 etag property: Resource Etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the state property: Defender for AI state on the AI resource. - * - * @return the state value. - */ - DefenderForAISettingState state(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.DefenderForAISettingInner object. - * - * @return the inner object. - */ - DefenderForAISettingInner innerModel(); - - /** - * The entirety of the DefenderForAISetting definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The DefenderForAISetting definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the DefenderForAISetting definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the DefenderForAISetting definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, accountName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @return the next definition stage. - */ - WithCreate withExistingAccount(String resourceGroupName, String accountName); - } - - /** - * The stage of the DefenderForAISetting 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.WithTags, DefinitionStages.WithState { - /** - * Executes the create request. - * - * @return the created resource. - */ - DefenderForAISetting create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - DefenderForAISetting create(Context context); - } - - /** - * The stage of the DefenderForAISetting definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the DefenderForAISetting definition allowing to specify state. - */ - interface WithState { - /** - * Specifies the state property: Defender for AI state on the AI resource.. - * - * @param state Defender for AI state on the AI resource. - * @return the next definition stage. - */ - WithCreate withState(DefenderForAISettingState state); - } - } - - /** - * Begins update for the DefenderForAISetting resource. - * - * @return the stage of resource update. - */ - DefenderForAISetting.Update update(); - - /** - * The template for DefenderForAISetting update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithState { - /** - * Executes the update request. - * - * @return the updated resource. - */ - DefenderForAISetting apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - DefenderForAISetting apply(Context context); - } - - /** - * The DefenderForAISetting update stages. - */ - interface UpdateStages { - /** - * The stage of the DefenderForAISetting update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the DefenderForAISetting update allowing to specify state. - */ - interface WithState { - /** - * Specifies the state property: Defender for AI state on the AI resource.. - * - * @param state Defender for AI state on the AI resource. - * @return the next definition stage. - */ - Update withState(DefenderForAISettingState state); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - DefenderForAISetting refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - DefenderForAISetting refresh(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISettingState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISettingState.java deleted file mode 100644 index 92b9c24b3479..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISettingState.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defender for AI state on the AI resource. - */ -public final class DefenderForAISettingState extends ExpandableStringEnum { - /** - * Static value Disabled for DefenderForAISettingState. - */ - public static final DefenderForAISettingState DISABLED = fromString("Disabled"); - - /** - * Static value Enabled for DefenderForAISettingState. - */ - public static final DefenderForAISettingState ENABLED = fromString("Enabled"); - - /** - * Creates a new instance of DefenderForAISettingState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DefenderForAISettingState() { - } - - /** - * Creates or finds a DefenderForAISettingState from its string representation. - * - * @param name a name to look for. - * @return the corresponding DefenderForAISettingState. - */ - public static DefenderForAISettingState fromString(String name) { - return fromString(name, DefenderForAISettingState.class); - } - - /** - * Gets known DefenderForAISettingState values. - * - * @return known DefenderForAISettingState values. - */ - public static Collection values() { - return values(DefenderForAISettingState.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISettings.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISettings.java deleted file mode 100644 index 23936244acb7..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISettings.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 DefenderForAISettings. - */ -public interface DefenderForAISettings { - /** - * Gets the specified Defender for AI setting by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. - * @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 specified Defender for AI setting by name along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, - String defenderForAISettingName, Context context); - - /** - * Gets the specified Defender for AI setting by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 Defender for AI setting by name. - */ - DefenderForAISetting get(String resourceGroupName, String accountName, String defenderForAISettingName); - - /** - * Lists the Defender for AI settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 cognitive services Defender for AI Settings as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Lists the Defender for AI settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 cognitive services Defender for AI Settings as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, Context context); - - /** - * Gets the specified Defender for AI setting by name. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Defender for AI setting by name along with {@link Response}. - */ - DefenderForAISetting getById(String id); - - /** - * Gets the specified Defender for AI setting by name. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Defender for AI setting by name along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new DefenderForAISetting resource. - * - * @param name resource name. - * @return the first stage of the new DefenderForAISetting definition. - */ - DefenderForAISetting.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeletedAccounts.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeletedAccounts.java deleted file mode 100644 index 204bbc2b412e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeletedAccounts.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 DeletedAccounts. - */ -public interface DeletedAccounts { - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU along with {@link Response}. - */ - Response getWithResponse(String location, String resourceGroupName, String accountName, Context context); - - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU. - */ - Account get(String location, String resourceGroupName, String accountName); - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 purge(String location, String resourceGroupName, String accountName); - - /** - * Deletes a Cognitive Services account from the resource group. - * - * @param location The location name. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 purge(String location, String resourceGroupName, String accountName, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployment.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployment.java deleted file mode 100644 index 0364e1be11c2..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployment.java +++ /dev/null @@ -1,310 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.DeploymentInner; -import java.util.Map; - -/** - * An immutable client-side representation of Deployment. - */ -public interface Deployment { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Properties of Cognitive Services account deployment. - * - * @return the properties value. - */ - DeploymentProperties properties(); - - /** - * Gets the sku property: The resource model definition representing SKU. - * - * @return the sku value. - */ - Sku sku(); - - /** - * Gets the etag property: Resource Etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.DeploymentInner object. - * - * @return the inner object. - */ - DeploymentInner innerModel(); - - /** - * The entirety of the Deployment definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The Deployment definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the Deployment definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the Deployment definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, accountName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @return the next definition stage. - */ - WithCreate withExistingAccount(String resourceGroupName, String accountName); - } - - /** - * The stage of the Deployment 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.WithTags, DefinitionStages.WithProperties, DefinitionStages.WithSku { - /** - * Executes the create request. - * - * @return the created resource. - */ - Deployment create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Deployment create(Context context); - } - - /** - * The stage of the Deployment definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the Deployment definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of Cognitive Services account deployment.. - * - * @param properties Properties of Cognitive Services account deployment. - * @return the next definition stage. - */ - WithCreate withProperties(DeploymentProperties properties); - } - - /** - * The stage of the Deployment definition allowing to specify sku. - */ - interface WithSku { - /** - * Specifies the sku property: The resource model definition representing SKU. - * - * @param sku The resource model definition representing SKU. - * @return the next definition stage. - */ - WithCreate withSku(Sku sku); - } - } - - /** - * Begins update for the Deployment resource. - * - * @return the stage of resource update. - */ - Deployment.Update update(); - - /** - * The template for Deployment update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithSku { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Deployment apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Deployment apply(Context context); - } - - /** - * The Deployment update stages. - */ - interface UpdateStages { - /** - * The stage of the Deployment update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the Deployment update allowing to specify sku. - */ - interface WithSku { - /** - * Specifies the sku property: The resource model definition representing SKU. - * - * @param sku The resource model definition representing SKU. - * @return the next definition stage. - */ - Update withSku(Sku sku); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Deployment refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Deployment refresh(Context context); - - /** - * Pause a deployment - * - * Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see - * #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, DataZoneStandard, and - * GlobalStandard SKUs support this operation. Inference requests to the paused deployment endpoint will receive - * HTTP 423 (Locked). This operation is idempotent. - * - * @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 cognitive Services account deployment along with {@link Response}. - */ - Response pauseWithResponse(Context context); - - /** - * Pause a deployment - * - * Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see - * #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, DataZoneStandard, and - * GlobalStandard SKUs support this operation. Inference requests to the paused deployment endpoint will receive - * HTTP 423 (Locked). This operation is idempotent. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account deployment. - */ - Deployment pause(); - - /** - * Resume a deployment - * - * Resumes inferencing on a previously paused deployment by setting the deploymentState to 'Running' (see - * #/definitions/DeploymentProperties/properties/deploymentState). This operation is idempotent and can be safely - * called on already running deployments. - * - * @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 cognitive Services account deployment along with {@link Response}. - */ - Response resumeWithResponse(Context context); - - /** - * Resume a deployment - * - * Resumes inferencing on a previously paused deployment by setting the deploymentState to 'Running' (see - * #/definitions/DeploymentProperties/properties/deploymentState). This operation is idempotent and can be safely - * called on already running deployments. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account deployment. - */ - Deployment resume(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentCapacitySettings.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentCapacitySettings.java deleted file mode 100644 index 6acb9b6fb69a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentCapacitySettings.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Internal use only. - */ -@Fluent -public final class DeploymentCapacitySettings implements JsonSerializable { - /* - * The designated capacity. - */ - private Integer designatedCapacity; - - /* - * The priority of this capacity setting. - */ - private Integer priority; - - /** - * Creates an instance of DeploymentCapacitySettings class. - */ - public DeploymentCapacitySettings() { - } - - /** - * Get the designatedCapacity property: The designated capacity. - * - * @return the designatedCapacity value. - */ - public Integer designatedCapacity() { - return this.designatedCapacity; - } - - /** - * Set the designatedCapacity property: The designated capacity. - * - * @param designatedCapacity the designatedCapacity value to set. - * @return the DeploymentCapacitySettings object itself. - */ - public DeploymentCapacitySettings withDesignatedCapacity(Integer designatedCapacity) { - this.designatedCapacity = designatedCapacity; - return this; - } - - /** - * Get the priority property: The priority of this capacity setting. - * - * @return the priority value. - */ - public Integer priority() { - return this.priority; - } - - /** - * Set the priority property: The priority of this capacity setting. - * - * @param priority the priority value to set. - * @return the DeploymentCapacitySettings object itself. - */ - public DeploymentCapacitySettings withPriority(Integer priority) { - this.priority = priority; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("designatedCapacity", this.designatedCapacity); - jsonWriter.writeNumberField("priority", this.priority); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeploymentCapacitySettings from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeploymentCapacitySettings 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 DeploymentCapacitySettings. - */ - public static DeploymentCapacitySettings fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DeploymentCapacitySettings deserializedDeploymentCapacitySettings = new DeploymentCapacitySettings(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("designatedCapacity".equals(fieldName)) { - deserializedDeploymentCapacitySettings.designatedCapacity = reader.getNullable(JsonReader::getInt); - } else if ("priority".equals(fieldName)) { - deserializedDeploymentCapacitySettings.priority = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedDeploymentCapacitySettings; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModel.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModel.java deleted file mode 100644 index 7a0dbccaf297..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModel.java +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Properties of Cognitive Services account deployment model. - */ -@Fluent -public class DeploymentModel implements JsonSerializable { - /* - * Deployment model publisher. - */ - private String publisher; - - /* - * Deployment model format. - */ - private String format; - - /* - * Deployment model name. - */ - private String name; - - /* - * Optional. Deployment model version. If version is not specified, a default version will be assigned. The default - * version is different for different models and might change when there is new version available for a model. - * Default version for a model could be found from list models API. - */ - private String version; - - /* - * Optional. Deployment model source ARM resource ID. - */ - private String source; - - /* - * Optional. Source of the model, another Microsoft.CognitiveServices accounts ARM resource ID. - */ - private String sourceAccount; - - /* - * The call rate limit Cognitive Services account. - */ - private CallRateLimit callRateLimit; - - /** - * Creates an instance of DeploymentModel class. - */ - public DeploymentModel() { - } - - /** - * Get the publisher property: Deployment model publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Set the publisher property: Deployment model publisher. - * - * @param publisher the publisher value to set. - * @return the DeploymentModel object itself. - */ - public DeploymentModel withPublisher(String publisher) { - this.publisher = publisher; - return this; - } - - /** - * Get the format property: Deployment model format. - * - * @return the format value. - */ - public String format() { - return this.format; - } - - /** - * Set the format property: Deployment model format. - * - * @param format the format value to set. - * @return the DeploymentModel object itself. - */ - public DeploymentModel withFormat(String format) { - this.format = format; - return this; - } - - /** - * Get the name property: Deployment model name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Deployment model name. - * - * @param name the name value to set. - * @return the DeploymentModel object itself. - */ - public DeploymentModel withName(String name) { - this.name = name; - return this; - } - - /** - * Get the version property: Optional. Deployment model version. If version is not specified, a default version will - * be assigned. The default version is different for different models and might change when there is new version - * available for a model. Default version for a model could be found from list models API. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Set the version property: Optional. Deployment model version. If version is not specified, a default version will - * be assigned. The default version is different for different models and might change when there is new version - * available for a model. Default version for a model could be found from list models API. - * - * @param version the version value to set. - * @return the DeploymentModel object itself. - */ - public DeploymentModel withVersion(String version) { - this.version = version; - return this; - } - - /** - * Get the source property: Optional. Deployment model source ARM resource ID. - * - * @return the source value. - */ - public String source() { - return this.source; - } - - /** - * Set the source property: Optional. Deployment model source ARM resource ID. - * - * @param source the source value to set. - * @return the DeploymentModel object itself. - */ - public DeploymentModel withSource(String source) { - this.source = source; - return this; - } - - /** - * Get the sourceAccount property: Optional. Source of the model, another Microsoft.CognitiveServices accounts ARM - * resource ID. - * - * @return the sourceAccount value. - */ - public String sourceAccount() { - return this.sourceAccount; - } - - /** - * Set the sourceAccount property: Optional. Source of the model, another Microsoft.CognitiveServices accounts ARM - * resource ID. - * - * @param sourceAccount the sourceAccount value to set. - * @return the DeploymentModel object itself. - */ - public DeploymentModel withSourceAccount(String sourceAccount) { - this.sourceAccount = sourceAccount; - return this; - } - - /** - * Get the callRateLimit property: The call rate limit Cognitive Services account. - * - * @return the callRateLimit value. - */ - public CallRateLimit callRateLimit() { - return this.callRateLimit; - } - - /** - * Set the callRateLimit property: The call rate limit Cognitive Services account. - * - * @param callRateLimit the callRateLimit value to set. - * @return the DeploymentModel object itself. - */ - DeploymentModel withCallRateLimit(CallRateLimit callRateLimit) { - this.callRateLimit = callRateLimit; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("publisher", this.publisher); - jsonWriter.writeStringField("format", this.format); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("version", this.version); - jsonWriter.writeStringField("source", this.source); - jsonWriter.writeStringField("sourceAccount", this.sourceAccount); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeploymentModel from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeploymentModel 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 DeploymentModel. - */ - public static DeploymentModel fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DeploymentModel deserializedDeploymentModel = new DeploymentModel(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("publisher".equals(fieldName)) { - deserializedDeploymentModel.publisher = reader.getString(); - } else if ("format".equals(fieldName)) { - deserializedDeploymentModel.format = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedDeploymentModel.name = reader.getString(); - } else if ("version".equals(fieldName)) { - deserializedDeploymentModel.version = reader.getString(); - } else if ("source".equals(fieldName)) { - deserializedDeploymentModel.source = reader.getString(); - } else if ("sourceAccount".equals(fieldName)) { - deserializedDeploymentModel.sourceAccount = reader.getString(); - } else if ("callRateLimit".equals(fieldName)) { - deserializedDeploymentModel.callRateLimit = CallRateLimit.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDeploymentModel; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModelVersionUpgradeOption.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModelVersionUpgradeOption.java deleted file mode 100644 index a634fa606b40..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModelVersionUpgradeOption.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Deployment model version upgrade option. - */ -public final class DeploymentModelVersionUpgradeOption - extends ExpandableStringEnum { - /** - * Static value OnceNewDefaultVersionAvailable for DeploymentModelVersionUpgradeOption. - */ - public static final DeploymentModelVersionUpgradeOption ONCE_NEW_DEFAULT_VERSION_AVAILABLE - = fromString("OnceNewDefaultVersionAvailable"); - - /** - * Static value OnceCurrentVersionExpired for DeploymentModelVersionUpgradeOption. - */ - public static final DeploymentModelVersionUpgradeOption ONCE_CURRENT_VERSION_EXPIRED - = fromString("OnceCurrentVersionExpired"); - - /** - * Static value NoAutoUpgrade for DeploymentModelVersionUpgradeOption. - */ - public static final DeploymentModelVersionUpgradeOption NO_AUTO_UPGRADE = fromString("NoAutoUpgrade"); - - /** - * Creates a new instance of DeploymentModelVersionUpgradeOption value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DeploymentModelVersionUpgradeOption() { - } - - /** - * Creates or finds a DeploymentModelVersionUpgradeOption from its string representation. - * - * @param name a name to look for. - * @return the corresponding DeploymentModelVersionUpgradeOption. - */ - public static DeploymentModelVersionUpgradeOption fromString(String name) { - return fromString(name, DeploymentModelVersionUpgradeOption.class); - } - - /** - * Gets known DeploymentModelVersionUpgradeOption values. - * - * @return known DeploymentModelVersionUpgradeOption values. - */ - public static Collection values() { - return values(DeploymentModelVersionUpgradeOption.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentPolicyEvaluationResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentPolicyEvaluationResult.java deleted file mode 100644 index 74bf72bf119c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentPolicyEvaluationResult.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Policy evaluation result for a single deployment. - */ -@Immutable -public final class DeploymentPolicyEvaluationResult implements JsonSerializable { - /* - * The evaluation outcome. - */ - private PolicyEvaluationOutcome evaluationOutcome; - - /* - * Error message if the evaluation outcome is Error. - */ - private String errorMessage; - - /* - * Details of non-compliant policy assignments. - */ - private List nonCompliantAssignments; - - /** - * Creates an instance of DeploymentPolicyEvaluationResult class. - */ - private DeploymentPolicyEvaluationResult() { - } - - /** - * Get the evaluationOutcome property: The evaluation outcome. - * - * @return the evaluationOutcome value. - */ - public PolicyEvaluationOutcome evaluationOutcome() { - return this.evaluationOutcome; - } - - /** - * Get the errorMessage property: Error message if the evaluation outcome is Error. - * - * @return the errorMessage value. - */ - public String errorMessage() { - return this.errorMessage; - } - - /** - * Get the nonCompliantAssignments property: Details of non-compliant policy assignments. - * - * @return the nonCompliantAssignments value. - */ - public List nonCompliantAssignments() { - return this.nonCompliantAssignments; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("evaluationOutcome", - this.evaluationOutcome == null ? null : this.evaluationOutcome.toString()); - jsonWriter.writeStringField("errorMessage", this.errorMessage); - jsonWriter.writeArrayField("nonCompliantAssignments", this.nonCompliantAssignments, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeploymentPolicyEvaluationResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeploymentPolicyEvaluationResult 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 DeploymentPolicyEvaluationResult. - */ - public static DeploymentPolicyEvaluationResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DeploymentPolicyEvaluationResult deserializedDeploymentPolicyEvaluationResult - = new DeploymentPolicyEvaluationResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("evaluationOutcome".equals(fieldName)) { - deserializedDeploymentPolicyEvaluationResult.evaluationOutcome - = PolicyEvaluationOutcome.fromString(reader.getString()); - } else if ("errorMessage".equals(fieldName)) { - deserializedDeploymentPolicyEvaluationResult.errorMessage = reader.getString(); - } else if ("nonCompliantAssignments".equals(fieldName)) { - List nonCompliantAssignments - = reader.readArray(reader1 -> PolicyAssignmentEvaluationDetails.fromJson(reader1)); - deserializedDeploymentPolicyEvaluationResult.nonCompliantAssignments = nonCompliantAssignments; - } else { - reader.skipChildren(); - } - } - - return deserializedDeploymentPolicyEvaluationResult; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProperties.java deleted file mode 100644 index 8ee26958e765..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProperties.java +++ /dev/null @@ -1,512 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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.Map; - -/** - * Properties of Cognitive Services account deployment. - */ -@Fluent -public final class DeploymentProperties implements JsonSerializable { - /* - * Gets the status of the resource at the time the operation was called. - */ - private DeploymentProvisioningState provisioningState; - - /* - * Properties of Cognitive Services account deployment model. - */ - private DeploymentModel model; - - /* - * Speculative decoding settings for the deployment. This configuration applies to Fireworks model formats. - */ - private DeploymentSpeculativeDecoding speculativeDecoding; - - /* - * Properties of Cognitive Services account deployment model. (Deprecated, please use Deployment.sku instead.) - */ - private DeploymentScaleSettings scaleSettings; - - /* - * The capabilities. - */ - private Map capabilities; - - /* - * The name of RAI policy. - */ - private String raiPolicyName; - - /* - * The call rate limit Cognitive Services account. - */ - private CallRateLimit callRateLimit; - - /* - * The rateLimits property. - */ - private List rateLimits; - - /* - * Deployment model version upgrade option. - */ - private DeploymentModelVersionUpgradeOption versionUpgradeOption; - - /* - * If the dynamic throttling is enabled. - */ - private Boolean dynamicThrottlingEnabled; - - /* - * The current capacity. - */ - private Integer currentCapacity; - - /* - * Internal use only. - */ - private DeploymentCapacitySettings capacitySettings; - - /* - * The name of parent deployment. - */ - private String parentDeploymentName; - - /* - * Specifies the deployment name that should serve requests when the request would have otherwise been throttled due - * to reaching current deployment throughput limit. - */ - private String spilloverDeploymentName; - - /* - * The service tier for the deployment. Determines the pricing and performance level for request processing. Use - * 'Default' for standard pricing or 'Priority' for higher-priority processing with premium pricing. Note: Pause - * operations are only supported on Standard, DataZoneStandard, and GlobalStandard SKUs. - */ - private ServiceTier serviceTier; - - /* - * The state of the deployment. Controls whether the deployment is accepting inference requests. Use 'Running' for - * active deployments that process requests, or 'Paused' to temporarily stop inference while preserving the - * deployment configuration. - */ - private DeploymentState deploymentState; - - /* - * Routing configuration for the model-router deployment. This property is only applicable when the deployed model - * is 'model-router' version 2025-11-18 or later. Allows you to select the models subset for routing and the routing - * mode (balanced, quality, cost) for routing across all supported models or the model subset. - */ - private DeploymentRouting routing; - - /** - * Creates an instance of DeploymentProperties class. - */ - public DeploymentProperties() { - } - - /** - * Get the provisioningState property: Gets the status of the resource at the time the operation was called. - * - * @return the provisioningState value. - */ - public DeploymentProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the model property: Properties of Cognitive Services account deployment model. - * - * @return the model value. - */ - public DeploymentModel model() { - return this.model; - } - - /** - * Set the model property: Properties of Cognitive Services account deployment model. - * - * @param model the model value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withModel(DeploymentModel model) { - this.model = model; - return this; - } - - /** - * Get the speculativeDecoding property: Speculative decoding settings for the deployment. This configuration - * applies to Fireworks model formats. - * - * @return the speculativeDecoding value. - */ - public DeploymentSpeculativeDecoding speculativeDecoding() { - return this.speculativeDecoding; - } - - /** - * Set the speculativeDecoding property: Speculative decoding settings for the deployment. This configuration - * applies to Fireworks model formats. - * - * @param speculativeDecoding the speculativeDecoding value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withSpeculativeDecoding(DeploymentSpeculativeDecoding speculativeDecoding) { - this.speculativeDecoding = speculativeDecoding; - return this; - } - - /** - * Get the scaleSettings property: Properties of Cognitive Services account deployment model. (Deprecated, please - * use Deployment.sku instead.). - * - * @return the scaleSettings value. - */ - public DeploymentScaleSettings scaleSettings() { - return this.scaleSettings; - } - - /** - * Set the scaleSettings property: Properties of Cognitive Services account deployment model. (Deprecated, please - * use Deployment.sku instead.). - * - * @param scaleSettings the scaleSettings value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withScaleSettings(DeploymentScaleSettings scaleSettings) { - this.scaleSettings = scaleSettings; - return this; - } - - /** - * Get the capabilities property: The capabilities. - * - * @return the capabilities value. - */ - public Map capabilities() { - return this.capabilities; - } - - /** - * Get the raiPolicyName property: The name of RAI policy. - * - * @return the raiPolicyName value. - */ - public String raiPolicyName() { - return this.raiPolicyName; - } - - /** - * Set the raiPolicyName property: The name of RAI policy. - * - * @param raiPolicyName the raiPolicyName value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withRaiPolicyName(String raiPolicyName) { - this.raiPolicyName = raiPolicyName; - return this; - } - - /** - * Get the callRateLimit property: The call rate limit Cognitive Services account. - * - * @return the callRateLimit value. - */ - public CallRateLimit callRateLimit() { - return this.callRateLimit; - } - - /** - * Get the rateLimits property: The rateLimits property. - * - * @return the rateLimits value. - */ - public List rateLimits() { - return this.rateLimits; - } - - /** - * Get the versionUpgradeOption property: Deployment model version upgrade option. - * - * @return the versionUpgradeOption value. - */ - public DeploymentModelVersionUpgradeOption versionUpgradeOption() { - return this.versionUpgradeOption; - } - - /** - * Set the versionUpgradeOption property: Deployment model version upgrade option. - * - * @param versionUpgradeOption the versionUpgradeOption value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withVersionUpgradeOption(DeploymentModelVersionUpgradeOption versionUpgradeOption) { - this.versionUpgradeOption = versionUpgradeOption; - return this; - } - - /** - * Get the dynamicThrottlingEnabled property: If the dynamic throttling is enabled. - * - * @return the dynamicThrottlingEnabled value. - */ - public Boolean dynamicThrottlingEnabled() { - return this.dynamicThrottlingEnabled; - } - - /** - * Get the currentCapacity property: The current capacity. - * - * @return the currentCapacity value. - */ - public Integer currentCapacity() { - return this.currentCapacity; - } - - /** - * Set the currentCapacity property: The current capacity. - * - * @param currentCapacity the currentCapacity value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withCurrentCapacity(Integer currentCapacity) { - this.currentCapacity = currentCapacity; - return this; - } - - /** - * Get the capacitySettings property: Internal use only. - * - * @return the capacitySettings value. - */ - public DeploymentCapacitySettings capacitySettings() { - return this.capacitySettings; - } - - /** - * Set the capacitySettings property: Internal use only. - * - * @param capacitySettings the capacitySettings value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withCapacitySettings(DeploymentCapacitySettings capacitySettings) { - this.capacitySettings = capacitySettings; - return this; - } - - /** - * Get the parentDeploymentName property: The name of parent deployment. - * - * @return the parentDeploymentName value. - */ - public String parentDeploymentName() { - return this.parentDeploymentName; - } - - /** - * Set the parentDeploymentName property: The name of parent deployment. - * - * @param parentDeploymentName the parentDeploymentName value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withParentDeploymentName(String parentDeploymentName) { - this.parentDeploymentName = parentDeploymentName; - return this; - } - - /** - * Get the spilloverDeploymentName property: Specifies the deployment name that should serve requests when the - * request would have otherwise been throttled due to reaching current deployment throughput limit. - * - * @return the spilloverDeploymentName value. - */ - public String spilloverDeploymentName() { - return this.spilloverDeploymentName; - } - - /** - * Set the spilloverDeploymentName property: Specifies the deployment name that should serve requests when the - * request would have otherwise been throttled due to reaching current deployment throughput limit. - * - * @param spilloverDeploymentName the spilloverDeploymentName value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withSpilloverDeploymentName(String spilloverDeploymentName) { - this.spilloverDeploymentName = spilloverDeploymentName; - return this; - } - - /** - * Get the serviceTier property: The service tier for the deployment. Determines the pricing and performance level - * for request processing. Use 'Default' for standard pricing or 'Priority' for higher-priority processing with - * premium pricing. Note: Pause operations are only supported on Standard, DataZoneStandard, and GlobalStandard - * SKUs. - * - * @return the serviceTier value. - */ - public ServiceTier serviceTier() { - return this.serviceTier; - } - - /** - * Set the serviceTier property: The service tier for the deployment. Determines the pricing and performance level - * for request processing. Use 'Default' for standard pricing or 'Priority' for higher-priority processing with - * premium pricing. Note: Pause operations are only supported on Standard, DataZoneStandard, and GlobalStandard - * SKUs. - * - * @param serviceTier the serviceTier value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withServiceTier(ServiceTier serviceTier) { - this.serviceTier = serviceTier; - return this; - } - - /** - * Get the deploymentState property: The state of the deployment. Controls whether the deployment is accepting - * inference requests. Use 'Running' for active deployments that process requests, or 'Paused' to temporarily stop - * inference while preserving the deployment configuration. - * - * @return the deploymentState value. - */ - public DeploymentState deploymentState() { - return this.deploymentState; - } - - /** - * Set the deploymentState property: The state of the deployment. Controls whether the deployment is accepting - * inference requests. Use 'Running' for active deployments that process requests, or 'Paused' to temporarily stop - * inference while preserving the deployment configuration. - * - * @param deploymentState the deploymentState value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withDeploymentState(DeploymentState deploymentState) { - this.deploymentState = deploymentState; - return this; - } - - /** - * Get the routing property: Routing configuration for the model-router deployment. This property is only applicable - * when the deployed model is 'model-router' version 2025-11-18 or later. Allows you to select the models subset for - * routing and the routing mode (balanced, quality, cost) for routing across all supported models or the model - * subset. - * - * @return the routing value. - */ - public DeploymentRouting routing() { - return this.routing; - } - - /** - * Set the routing property: Routing configuration for the model-router deployment. This property is only applicable - * when the deployed model is 'model-router' version 2025-11-18 or later. Allows you to select the models subset for - * routing and the routing mode (balanced, quality, cost) for routing across all supported models or the model - * subset. - * - * @param routing the routing value to set. - * @return the DeploymentProperties object itself. - */ - public DeploymentProperties withRouting(DeploymentRouting routing) { - this.routing = routing; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("model", this.model); - jsonWriter.writeJsonField("speculativeDecoding", this.speculativeDecoding); - jsonWriter.writeJsonField("scaleSettings", this.scaleSettings); - jsonWriter.writeStringField("raiPolicyName", this.raiPolicyName); - jsonWriter.writeStringField("versionUpgradeOption", - this.versionUpgradeOption == null ? null : this.versionUpgradeOption.toString()); - jsonWriter.writeNumberField("currentCapacity", this.currentCapacity); - jsonWriter.writeJsonField("capacitySettings", this.capacitySettings); - jsonWriter.writeStringField("parentDeploymentName", this.parentDeploymentName); - jsonWriter.writeStringField("spilloverDeploymentName", this.spilloverDeploymentName); - jsonWriter.writeStringField("serviceTier", this.serviceTier == null ? null : this.serviceTier.toString()); - jsonWriter.writeStringField("deploymentState", - this.deploymentState == null ? null : this.deploymentState.toString()); - jsonWriter.writeJsonField("routing", this.routing); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeploymentProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeploymentProperties 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 DeploymentProperties. - */ - public static DeploymentProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DeploymentProperties deserializedDeploymentProperties = new DeploymentProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningState".equals(fieldName)) { - deserializedDeploymentProperties.provisioningState - = DeploymentProvisioningState.fromString(reader.getString()); - } else if ("model".equals(fieldName)) { - deserializedDeploymentProperties.model = DeploymentModel.fromJson(reader); - } else if ("speculativeDecoding".equals(fieldName)) { - deserializedDeploymentProperties.speculativeDecoding - = DeploymentSpeculativeDecoding.fromJson(reader); - } else if ("scaleSettings".equals(fieldName)) { - deserializedDeploymentProperties.scaleSettings = DeploymentScaleSettings.fromJson(reader); - } else if ("capabilities".equals(fieldName)) { - Map capabilities = reader.readMap(reader1 -> reader1.getString()); - deserializedDeploymentProperties.capabilities = capabilities; - } else if ("raiPolicyName".equals(fieldName)) { - deserializedDeploymentProperties.raiPolicyName = reader.getString(); - } else if ("callRateLimit".equals(fieldName)) { - deserializedDeploymentProperties.callRateLimit = CallRateLimit.fromJson(reader); - } else if ("rateLimits".equals(fieldName)) { - List rateLimits = reader.readArray(reader1 -> ThrottlingRule.fromJson(reader1)); - deserializedDeploymentProperties.rateLimits = rateLimits; - } else if ("versionUpgradeOption".equals(fieldName)) { - deserializedDeploymentProperties.versionUpgradeOption - = DeploymentModelVersionUpgradeOption.fromString(reader.getString()); - } else if ("dynamicThrottlingEnabled".equals(fieldName)) { - deserializedDeploymentProperties.dynamicThrottlingEnabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("currentCapacity".equals(fieldName)) { - deserializedDeploymentProperties.currentCapacity = reader.getNullable(JsonReader::getInt); - } else if ("capacitySettings".equals(fieldName)) { - deserializedDeploymentProperties.capacitySettings = DeploymentCapacitySettings.fromJson(reader); - } else if ("parentDeploymentName".equals(fieldName)) { - deserializedDeploymentProperties.parentDeploymentName = reader.getString(); - } else if ("spilloverDeploymentName".equals(fieldName)) { - deserializedDeploymentProperties.spilloverDeploymentName = reader.getString(); - } else if ("serviceTier".equals(fieldName)) { - deserializedDeploymentProperties.serviceTier = ServiceTier.fromString(reader.getString()); - } else if ("deploymentState".equals(fieldName)) { - deserializedDeploymentProperties.deploymentState = DeploymentState.fromString(reader.getString()); - } else if ("routing".equals(fieldName)) { - deserializedDeploymentProperties.routing = DeploymentRouting.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDeploymentProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProvisioningState.java deleted file mode 100644 index 7d220b06aa1d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProvisioningState.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Gets the status of the resource at the time the operation was called. - */ -public final class DeploymentProvisioningState extends ExpandableStringEnum { - /** - * Static value Accepted for DeploymentProvisioningState. - */ - public static final DeploymentProvisioningState ACCEPTED = fromString("Accepted"); - - /** - * Static value Creating for DeploymentProvisioningState. - */ - public static final DeploymentProvisioningState CREATING = fromString("Creating"); - - /** - * Static value Deleting for DeploymentProvisioningState. - */ - public static final DeploymentProvisioningState DELETING = fromString("Deleting"); - - /** - * Static value Moving for DeploymentProvisioningState. - */ - public static final DeploymentProvisioningState MOVING = fromString("Moving"); - - /** - * Static value Failed for DeploymentProvisioningState. - */ - public static final DeploymentProvisioningState FAILED = fromString("Failed"); - - /** - * Static value Succeeded for DeploymentProvisioningState. - */ - public static final DeploymentProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Disabled for DeploymentProvisioningState. - */ - public static final DeploymentProvisioningState DISABLED = fromString("Disabled"); - - /** - * Static value Canceled for DeploymentProvisioningState. - */ - public static final DeploymentProvisioningState CANCELED = fromString("Canceled"); - - /** - * Creates a new instance of DeploymentProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DeploymentProvisioningState() { - } - - /** - * Creates or finds a DeploymentProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding DeploymentProvisioningState. - */ - public static DeploymentProvisioningState fromString(String name) { - return fromString(name, DeploymentProvisioningState.class); - } - - /** - * Gets known DeploymentProvisioningState values. - * - * @return known DeploymentProvisioningState values. - */ - public static Collection values() { - return values(DeploymentProvisioningState.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentRouting.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentRouting.java deleted file mode 100644 index ebef82e78bb6..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentRouting.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Routing configuration for the model-router deployment. Specifies how requests are routed across multiple models. - */ -@Fluent -public final class DeploymentRouting implements JsonSerializable { - /* - * The model-router routing mode that determines how requests are distributed across models. - */ - private RoutingMode mode; - - /* - * Optional. The list of model-router supported models that the model router can use to route requests across. If - * not specified, the model router will route to all available models specified in the model-router version. - */ - private List models; - - /** - * Creates an instance of DeploymentRouting class. - */ - public DeploymentRouting() { - } - - /** - * Get the mode property: The model-router routing mode that determines how requests are distributed across models. - * - * @return the mode value. - */ - public RoutingMode mode() { - return this.mode; - } - - /** - * Set the mode property: The model-router routing mode that determines how requests are distributed across models. - * - * @param mode the mode value to set. - * @return the DeploymentRouting object itself. - */ - public DeploymentRouting withMode(RoutingMode mode) { - this.mode = mode; - return this; - } - - /** - * Get the models property: Optional. The list of model-router supported models that the model router can use to - * route requests across. If not specified, the model router will route to all available models specified in the - * model-router version. - * - * @return the models value. - */ - public List models() { - return this.models; - } - - /** - * Set the models property: Optional. The list of model-router supported models that the model router can use to - * route requests across. If not specified, the model router will route to all available models specified in the - * model-router version. - * - * @param models the models value to set. - * @return the DeploymentRouting object itself. - */ - public DeploymentRouting withModels(List models) { - this.models = models; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); - jsonWriter.writeArrayField("models", this.models, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeploymentRouting from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeploymentRouting 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 DeploymentRouting. - */ - public static DeploymentRouting fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DeploymentRouting deserializedDeploymentRouting = new DeploymentRouting(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("mode".equals(fieldName)) { - deserializedDeploymentRouting.mode = RoutingMode.fromString(reader.getString()); - } else if ("models".equals(fieldName)) { - List models = reader.readArray(reader1 -> DeploymentModel.fromJson(reader1)); - deserializedDeploymentRouting.models = models; - } else { - reader.skipChildren(); - } - } - - return deserializedDeploymentRouting; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentScaleSettings.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentScaleSettings.java deleted file mode 100644 index 89ca4100e0c0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentScaleSettings.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Properties of Cognitive Services account deployment model. (Deprecated, please use Deployment.sku instead.). - */ -@Fluent -public final class DeploymentScaleSettings implements JsonSerializable { - /* - * Deployment scale type. - */ - private DeploymentScaleType scaleType; - - /* - * Deployment capacity. - */ - private Integer capacity; - - /* - * Deployment active capacity. This value might be different from `capacity` if customer recently updated - * `capacity`. - */ - private Integer activeCapacity; - - /** - * Creates an instance of DeploymentScaleSettings class. - */ - public DeploymentScaleSettings() { - } - - /** - * Get the scaleType property: Deployment scale type. - * - * @return the scaleType value. - */ - public DeploymentScaleType scaleType() { - return this.scaleType; - } - - /** - * Set the scaleType property: Deployment scale type. - * - * @param scaleType the scaleType value to set. - * @return the DeploymentScaleSettings object itself. - */ - public DeploymentScaleSettings withScaleType(DeploymentScaleType scaleType) { - this.scaleType = scaleType; - return this; - } - - /** - * Get the capacity property: Deployment capacity. - * - * @return the capacity value. - */ - public Integer capacity() { - return this.capacity; - } - - /** - * Set the capacity property: Deployment capacity. - * - * @param capacity the capacity value to set. - * @return the DeploymentScaleSettings object itself. - */ - public DeploymentScaleSettings withCapacity(Integer capacity) { - this.capacity = capacity; - return this; - } - - /** - * Get the activeCapacity property: Deployment active capacity. This value might be different from `capacity` if - * customer recently updated `capacity`. - * - * @return the activeCapacity value. - */ - public Integer activeCapacity() { - return this.activeCapacity; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("scaleType", this.scaleType == null ? null : this.scaleType.toString()); - jsonWriter.writeNumberField("capacity", this.capacity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeploymentScaleSettings from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeploymentScaleSettings 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 DeploymentScaleSettings. - */ - public static DeploymentScaleSettings fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DeploymentScaleSettings deserializedDeploymentScaleSettings = new DeploymentScaleSettings(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("scaleType".equals(fieldName)) { - deserializedDeploymentScaleSettings.scaleType = DeploymentScaleType.fromString(reader.getString()); - } else if ("capacity".equals(fieldName)) { - deserializedDeploymentScaleSettings.capacity = reader.getNullable(JsonReader::getInt); - } else if ("activeCapacity".equals(fieldName)) { - deserializedDeploymentScaleSettings.activeCapacity = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedDeploymentScaleSettings; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentScaleType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentScaleType.java deleted file mode 100644 index e1df252bd222..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentScaleType.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Deployment scale type. - */ -public final class DeploymentScaleType extends ExpandableStringEnum { - /** - * Static value Standard for DeploymentScaleType. - */ - public static final DeploymentScaleType STANDARD = fromString("Standard"); - - /** - * Static value Manual for DeploymentScaleType. - */ - public static final DeploymentScaleType MANUAL = fromString("Manual"); - - /** - * Creates a new instance of DeploymentScaleType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DeploymentScaleType() { - } - - /** - * Creates or finds a DeploymentScaleType from its string representation. - * - * @param name a name to look for. - * @return the corresponding DeploymentScaleType. - */ - public static DeploymentScaleType fromString(String name) { - return fromString(name, DeploymentScaleType.class); - } - - /** - * Gets known DeploymentScaleType values. - * - * @return known DeploymentScaleType values. - */ - public static Collection values() { - return values(DeploymentScaleType.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentSizeCapacity.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentSizeCapacity.java deleted file mode 100644 index 253b87892d29..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentSizeCapacity.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Capacity information for a specific deployment size. - */ -@Immutable -public final class DeploymentSizeCapacity implements JsonSerializable { - /* - * The number of accelerators required per model instance. - */ - private Integer modelInstanceAcceleratorCount; - - /* - * The total available capacity for this deployment size. - */ - private Integer totalAvailableCapacity; - - /* - * The largest contiguous deployment capacity available for this deployment size. - */ - private Integer largestDeploymentCapacity; - - /** - * Creates an instance of DeploymentSizeCapacity class. - */ - private DeploymentSizeCapacity() { - } - - /** - * Get the modelInstanceAcceleratorCount property: The number of accelerators required per model instance. - * - * @return the modelInstanceAcceleratorCount value. - */ - public Integer modelInstanceAcceleratorCount() { - return this.modelInstanceAcceleratorCount; - } - - /** - * Get the totalAvailableCapacity property: The total available capacity for this deployment size. - * - * @return the totalAvailableCapacity value. - */ - public Integer totalAvailableCapacity() { - return this.totalAvailableCapacity; - } - - /** - * Get the largestDeploymentCapacity property: The largest contiguous deployment capacity available for this - * deployment size. - * - * @return the largestDeploymentCapacity value. - */ - public Integer largestDeploymentCapacity() { - return this.largestDeploymentCapacity; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeploymentSizeCapacity from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeploymentSizeCapacity 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 DeploymentSizeCapacity. - */ - public static DeploymentSizeCapacity fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DeploymentSizeCapacity deserializedDeploymentSizeCapacity = new DeploymentSizeCapacity(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("modelInstanceAcceleratorCount".equals(fieldName)) { - deserializedDeploymentSizeCapacity.modelInstanceAcceleratorCount - = reader.getNullable(JsonReader::getInt); - } else if ("totalAvailableCapacity".equals(fieldName)) { - deserializedDeploymentSizeCapacity.totalAvailableCapacity = reader.getNullable(JsonReader::getInt); - } else if ("largestDeploymentCapacity".equals(fieldName)) { - deserializedDeploymentSizeCapacity.largestDeploymentCapacity - = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedDeploymentSizeCapacity; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentSpeculativeDecoding.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentSpeculativeDecoding.java deleted file mode 100644 index 706d178d26c4..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentSpeculativeDecoding.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Speculative decoding settings for a deployment. - */ -@Fluent -public final class DeploymentSpeculativeDecoding implements JsonSerializable { - /* - * Draft model used to generate speculative decoding tokens. - */ - private DeploymentModel draftModel; - - /* - * The number of draft tokens attempted per speculation step. - */ - private Integer draftTokenCount; - - /** - * Creates an instance of DeploymentSpeculativeDecoding class. - */ - public DeploymentSpeculativeDecoding() { - } - - /** - * Get the draftModel property: Draft model used to generate speculative decoding tokens. - * - * @return the draftModel value. - */ - public DeploymentModel draftModel() { - return this.draftModel; - } - - /** - * Set the draftModel property: Draft model used to generate speculative decoding tokens. - * - * @param draftModel the draftModel value to set. - * @return the DeploymentSpeculativeDecoding object itself. - */ - public DeploymentSpeculativeDecoding withDraftModel(DeploymentModel draftModel) { - this.draftModel = draftModel; - return this; - } - - /** - * Get the draftTokenCount property: The number of draft tokens attempted per speculation step. - * - * @return the draftTokenCount value. - */ - public Integer draftTokenCount() { - return this.draftTokenCount; - } - - /** - * Set the draftTokenCount property: The number of draft tokens attempted per speculation step. - * - * @param draftTokenCount the draftTokenCount value to set. - * @return the DeploymentSpeculativeDecoding object itself. - */ - public DeploymentSpeculativeDecoding withDraftTokenCount(Integer draftTokenCount) { - this.draftTokenCount = draftTokenCount; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("draftModel", this.draftModel); - jsonWriter.writeNumberField("draftTokenCount", this.draftTokenCount); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeploymentSpeculativeDecoding from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeploymentSpeculativeDecoding 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 DeploymentSpeculativeDecoding. - */ - public static DeploymentSpeculativeDecoding fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DeploymentSpeculativeDecoding deserializedDeploymentSpeculativeDecoding - = new DeploymentSpeculativeDecoding(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("draftModel".equals(fieldName)) { - deserializedDeploymentSpeculativeDecoding.draftModel = DeploymentModel.fromJson(reader); - } else if ("draftTokenCount".equals(fieldName)) { - deserializedDeploymentSpeculativeDecoding.draftTokenCount = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedDeploymentSpeculativeDecoding; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentState.java deleted file mode 100644 index 1d91b008eb1b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentState.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The state of the deployment. Controls whether the deployment is accepting inference requests. Use 'Running' for - * active deployments that process requests, or 'Paused' to temporarily stop inference while preserving the deployment - * configuration. - */ -public final class DeploymentState extends ExpandableStringEnum { - /** - * The deployment is running and accepting inference requests. - */ - public static final DeploymentState RUNNING = fromString("Running"); - - /** - * The deployment is paused and not accepting inference requests. - */ - public static final DeploymentState PAUSED = fromString("Paused"); - - /** - * Creates a new instance of DeploymentState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DeploymentState() { - } - - /** - * Creates or finds a DeploymentState from its string representation. - * - * @param name a name to look for. - * @return the corresponding DeploymentState. - */ - public static DeploymentState fromString(String name) { - return fromString(name, DeploymentState.class); - } - - /** - * Gets known DeploymentState values. - * - * @return known DeploymentState values. - */ - public static Collection values() { - return values(DeploymentState.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployments.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployments.java deleted file mode 100644 index cae21bfbdcef..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployments.java +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 Deployments. - */ -public interface Deployments { - /** - * Gets the specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @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 specified deployments associated with the Cognitive Services account along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, String deploymentName, - Context context); - - /** - * Gets the specified deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 deployments associated with the Cognitive Services account. - */ - Deployment get(String resourceGroupName, String accountName, String deploymentName); - - /** - * Deletes the specified deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String deploymentName); - - /** - * Deletes the specified deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @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 accountName, String deploymentName, Context context); - - /** - * Gets the deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployments associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 deployments associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, Context context); - - /** - * Lists the specified deployments skus associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listSkus(String resourceGroupName, String accountName, String deploymentName); - - /** - * Lists the specified deployments skus associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listSkus(String resourceGroupName, String accountName, String deploymentName, - Context context); - - /** - * Pause a deployment - * - * Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see - * #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, DataZoneStandard, and - * GlobalStandard SKUs support this operation. Inference requests to the paused deployment endpoint will receive - * HTTP 423 (Locked). This operation is idempotent. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @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 cognitive Services account deployment along with {@link Response}. - */ - Response pauseWithResponse(String resourceGroupName, String accountName, String deploymentName, - Context context); - - /** - * Pause a deployment - * - * Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see - * #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, DataZoneStandard, and - * GlobalStandard SKUs support this operation. Inference requests to the paused deployment endpoint will receive - * HTTP 423 (Locked). This operation is idempotent. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account deployment. - */ - Deployment pause(String resourceGroupName, String accountName, String deploymentName); - - /** - * Resume a deployment - * - * Resumes inferencing on a previously paused deployment by setting the deploymentState to 'Running' (see - * #/definitions/DeploymentProperties/properties/deploymentState). This operation is idempotent and can be safely - * called on already running deployments. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @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 cognitive Services account deployment along with {@link Response}. - */ - Response resumeWithResponse(String resourceGroupName, String accountName, String deploymentName, - Context context); - - /** - * Resume a deployment - * - * Resumes inferencing on a previously paused deployment by setting the deploymentState to 'Running' (see - * #/definitions/DeploymentProperties/properties/deploymentState). This operation is idempotent and can be safely - * called on already running deployments. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account deployment. - */ - Deployment resume(String resourceGroupName, String accountName, String deploymentName); - - /** - * Gets the specified deployments associated with the Cognitive Services account. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified deployments associated with the Cognitive Services account along with {@link Response}. - */ - Deployment getById(String id); - - /** - * Gets the specified deployments associated with the Cognitive Services account. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified deployments associated with the Cognitive Services account along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes the specified deployment associated with the Cognitive Services account. - * - * @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 the specified deployment associated with the Cognitive Services account. - * - * @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 Deployment resource. - * - * @param name resource name. - * @return the first stage of the new Deployment definition. - */ - Deployment.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeprecationStatus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeprecationStatus.java deleted file mode 100644 index 25e13f011ff4..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeprecationStatus.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Indicates whether the deprecation date is a confirmed planned end-of-life date or an estimated deprecation date. When - * 'Planned', the deprecation date represents a confirmed and communicated model end-of-life date. When 'Tentative', the - * deprecation date is an estimated timeline that may be subject to change. - */ -public final class DeprecationStatus extends ExpandableStringEnum { - /** - * Static value Planned for DeprecationStatus. - */ - public static final DeprecationStatus PLANNED = fromString("Planned"); - - /** - * Static value Tentative for DeprecationStatus. - */ - public static final DeprecationStatus TENTATIVE = fromString("Tentative"); - - /** - * Creates a new instance of DeprecationStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DeprecationStatus() { - } - - /** - * Creates or finds a DeprecationStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding DeprecationStatus. - */ - public static DeprecationStatus fromString(String name) { - return fromString(name, DeprecationStatus.class); - } - - /** - * Gets known DeprecationStatus values. - * - * @return known DeprecationStatus values. - */ - public static Collection values() { - return values(DeprecationStatus.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DomainAvailability.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DomainAvailability.java deleted file mode 100644 index 4fa491b7d79e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DomainAvailability.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.DomainAvailabilityInner; - -/** - * An immutable client-side representation of DomainAvailability. - */ -public interface DomainAvailability { - /** - * Gets the isSubdomainAvailable property: Indicates the given SKU is available or not. - * - * @return the isSubdomainAvailable value. - */ - Boolean isSubdomainAvailable(); - - /** - * Gets the reason property: Reason why the SKU is not available. - * - * @return the reason value. - */ - String reason(); - - /** - * Gets the subdomainName property: The subdomain name to use. - * - * @return the subdomainName value. - */ - String subdomainName(); - - /** - * Gets the type property: The Type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the kind property: The kind (type) of cognitive service account. - * - * @return the kind value. - */ - String kind(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.DomainAvailabilityInner object. - * - * @return the inner object. - */ - DomainAvailabilityInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Encryption.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Encryption.java deleted file mode 100644 index c97022b8961d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Encryption.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Properties to configure Encryption. - */ -@Fluent -public class Encryption implements JsonSerializable { - /* - * Properties of KeyVault - */ - private KeyVaultProperties keyVaultProperties; - - /* - * Enumerates the possible value of keySource for Encryption - */ - private KeySource keySource; - - /** - * Creates an instance of Encryption class. - */ - public Encryption() { - } - - /** - * Get the keyVaultProperties property: Properties of KeyVault. - * - * @return the keyVaultProperties value. - */ - public KeyVaultProperties keyVaultProperties() { - return this.keyVaultProperties; - } - - /** - * Set the keyVaultProperties property: Properties of KeyVault. - * - * @param keyVaultProperties the keyVaultProperties value to set. - * @return the Encryption object itself. - */ - public Encryption withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { - this.keyVaultProperties = keyVaultProperties; - return this; - } - - /** - * Get the keySource property: Enumerates the possible value of keySource for Encryption. - * - * @return the keySource value. - */ - public KeySource keySource() { - return this.keySource; - } - - /** - * Set the keySource property: Enumerates the possible value of keySource for Encryption. - * - * @param keySource the keySource value to set. - * @return the Encryption object itself. - */ - public Encryption withKeySource(KeySource keySource) { - this.keySource = keySource; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("keyVaultProperties", this.keyVaultProperties); - jsonWriter.writeStringField("keySource", this.keySource == null ? null : this.keySource.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Encryption from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Encryption 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 Encryption. - */ - public static Encryption fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Encryption deserializedEncryption = new Encryption(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("keyVaultProperties".equals(fieldName)) { - deserializedEncryption.keyVaultProperties = KeyVaultProperties.fromJson(reader); - } else if ("keySource".equals(fieldName)) { - deserializedEncryption.keySource = KeySource.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedEncryption; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScope.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScope.java deleted file mode 100644 index e33b784d672a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScope.java +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.EncryptionScopeInner; -import java.util.Map; - -/** - * An immutable client-side representation of EncryptionScope. - */ -public interface EncryptionScope { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Properties of Cognitive Services EncryptionScope. - * - * @return the properties value. - */ - EncryptionScopeProperties properties(); - - /** - * Gets the etag property: Resource Etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.EncryptionScopeInner object. - * - * @return the inner object. - */ - EncryptionScopeInner innerModel(); - - /** - * The entirety of the EncryptionScope definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The EncryptionScope definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the EncryptionScope definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the EncryptionScope definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, accountName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @return the next definition stage. - */ - WithCreate withExistingAccount(String resourceGroupName, String accountName); - } - - /** - * The stage of the EncryptionScope 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.WithTags, DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - EncryptionScope create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - EncryptionScope create(Context context); - } - - /** - * The stage of the EncryptionScope definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the EncryptionScope definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of Cognitive Services EncryptionScope.. - * - * @param properties Properties of Cognitive Services EncryptionScope. - * @return the next definition stage. - */ - WithCreate withProperties(EncryptionScopeProperties properties); - } - } - - /** - * Begins update for the EncryptionScope resource. - * - * @return the stage of resource update. - */ - EncryptionScope.Update update(); - - /** - * The template for EncryptionScope update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - EncryptionScope apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - EncryptionScope apply(Context context); - } - - /** - * The EncryptionScope update stages. - */ - interface UpdateStages { - /** - * The stage of the EncryptionScope update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the EncryptionScope update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of Cognitive Services EncryptionScope.. - * - * @param properties Properties of Cognitive Services EncryptionScope. - * @return the next definition stage. - */ - Update withProperties(EncryptionScopeProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - EncryptionScope refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - EncryptionScope refresh(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeProperties.java deleted file mode 100644 index f90da17cee12..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeProperties.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Properties to EncryptionScope. - */ -@Fluent -public final class EncryptionScopeProperties extends Encryption { - /* - * Gets the status of the resource at the time the operation was called. - */ - private EncryptionScopeProvisioningState provisioningState; - - /* - * The encryptionScope state. - */ - private EncryptionScopeState state; - - /** - * Creates an instance of EncryptionScopeProperties class. - */ - public EncryptionScopeProperties() { - } - - /** - * Get the provisioningState property: Gets the status of the resource at the time the operation was called. - * - * @return the provisioningState value. - */ - public EncryptionScopeProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the state property: The encryptionScope state. - * - * @return the state value. - */ - public EncryptionScopeState state() { - return this.state; - } - - /** - * Set the state property: The encryptionScope state. - * - * @param state the state value to set. - * @return the EncryptionScopeProperties object itself. - */ - public EncryptionScopeProperties withState(EncryptionScopeState state) { - this.state = state; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public EncryptionScopeProperties withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { - super.withKeyVaultProperties(keyVaultProperties); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public EncryptionScopeProperties withKeySource(KeySource keySource) { - super.withKeySource(keySource); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("keyVaultProperties", keyVaultProperties()); - jsonWriter.writeStringField("keySource", keySource() == null ? null : keySource().toString()); - jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EncryptionScopeProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EncryptionScopeProperties 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 EncryptionScopeProperties. - */ - public static EncryptionScopeProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EncryptionScopeProperties deserializedEncryptionScopeProperties = new EncryptionScopeProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("keyVaultProperties".equals(fieldName)) { - deserializedEncryptionScopeProperties.withKeyVaultProperties(KeyVaultProperties.fromJson(reader)); - } else if ("keySource".equals(fieldName)) { - deserializedEncryptionScopeProperties.withKeySource(KeySource.fromString(reader.getString())); - } else if ("provisioningState".equals(fieldName)) { - deserializedEncryptionScopeProperties.provisioningState - = EncryptionScopeProvisioningState.fromString(reader.getString()); - } else if ("state".equals(fieldName)) { - deserializedEncryptionScopeProperties.state = EncryptionScopeState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedEncryptionScopeProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeProvisioningState.java deleted file mode 100644 index f049dc913a6e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeProvisioningState.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Gets the status of the resource at the time the operation was called. - */ -public final class EncryptionScopeProvisioningState extends ExpandableStringEnum { - /** - * Static value Accepted for EncryptionScopeProvisioningState. - */ - public static final EncryptionScopeProvisioningState ACCEPTED = fromString("Accepted"); - - /** - * Static value Creating for EncryptionScopeProvisioningState. - */ - public static final EncryptionScopeProvisioningState CREATING = fromString("Creating"); - - /** - * Static value Deleting for EncryptionScopeProvisioningState. - */ - public static final EncryptionScopeProvisioningState DELETING = fromString("Deleting"); - - /** - * Static value Moving for EncryptionScopeProvisioningState. - */ - public static final EncryptionScopeProvisioningState MOVING = fromString("Moving"); - - /** - * Static value Failed for EncryptionScopeProvisioningState. - */ - public static final EncryptionScopeProvisioningState FAILED = fromString("Failed"); - - /** - * Static value Succeeded for EncryptionScopeProvisioningState. - */ - public static final EncryptionScopeProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Canceled for EncryptionScopeProvisioningState. - */ - public static final EncryptionScopeProvisioningState CANCELED = fromString("Canceled"); - - /** - * Creates a new instance of EncryptionScopeProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public EncryptionScopeProvisioningState() { - } - - /** - * Creates or finds a EncryptionScopeProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding EncryptionScopeProvisioningState. - */ - public static EncryptionScopeProvisioningState fromString(String name) { - return fromString(name, EncryptionScopeProvisioningState.class); - } - - /** - * Gets known EncryptionScopeProvisioningState values. - * - * @return known EncryptionScopeProvisioningState values. - */ - public static Collection values() { - return values(EncryptionScopeProvisioningState.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeState.java deleted file mode 100644 index e554d47b196d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeState.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The encryptionScope state. - */ -public final class EncryptionScopeState extends ExpandableStringEnum { - /** - * Static value Disabled for EncryptionScopeState. - */ - public static final EncryptionScopeState DISABLED = fromString("Disabled"); - - /** - * Static value Enabled for EncryptionScopeState. - */ - public static final EncryptionScopeState ENABLED = fromString("Enabled"); - - /** - * Creates a new instance of EncryptionScopeState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public EncryptionScopeState() { - } - - /** - * Creates or finds a EncryptionScopeState from its string representation. - * - * @param name a name to look for. - * @return the corresponding EncryptionScopeState. - */ - public static EncryptionScopeState fromString(String name) { - return fromString(name, EncryptionScopeState.class); - } - - /** - * Gets known EncryptionScopeState values. - * - * @return known EncryptionScopeState values. - */ - public static Collection values() { - return values(EncryptionScopeState.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopes.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopes.java deleted file mode 100644 index 06595bb18665..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopes.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 EncryptionScopes. - */ -public interface EncryptionScopes { - /** - * Gets the specified EncryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @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 specified EncryptionScope associated with the Cognitive Services account along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, String encryptionScopeName, - Context context); - - /** - * Gets the specified EncryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 EncryptionScope associated with the Cognitive Services account. - */ - EncryptionScope get(String resourceGroupName, String accountName, String encryptionScopeName); - - /** - * Deletes the specified encryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String encryptionScopeName); - - /** - * Deletes the specified encryptionScope associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @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 accountName, String encryptionScopeName, Context context); - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, Context context); - - /** - * Gets the specified EncryptionScope associated with the Cognitive Services account. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified EncryptionScope associated with the Cognitive Services account along with {@link Response}. - */ - EncryptionScope getById(String id); - - /** - * Gets the specified EncryptionScope associated with the Cognitive Services account. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified EncryptionScope associated with the Cognitive Services account along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes the specified encryptionScope associated with the Cognitive Services account. - * - * @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 the specified encryptionScope associated with the Cognitive Services account. - * - * @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 EncryptionScope resource. - * - * @param name resource name. - * @return the first stage of the new EncryptionScope definition. - */ - EncryptionScope.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EvaluateDeploymentPoliciesDeployment.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EvaluateDeploymentPoliciesDeployment.java deleted file mode 100644 index cbc82ee50b99..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EvaluateDeploymentPoliciesDeployment.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * A hypothetical deployment definition used for policy dry-run evaluation. - */ -@Fluent -public final class EvaluateDeploymentPoliciesDeployment - implements JsonSerializable { - /* - * The name of the hypothetical deployment. - */ - private String name; - - /* - * Properties of the hypothetical deployment. - */ - private EvaluateDeploymentPoliciesDeploymentProperties properties; - - /** - * Creates an instance of EvaluateDeploymentPoliciesDeployment class. - */ - public EvaluateDeploymentPoliciesDeployment() { - } - - /** - * Get the name property: The name of the hypothetical deployment. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the hypothetical deployment. - * - * @param name the name value to set. - * @return the EvaluateDeploymentPoliciesDeployment object itself. - */ - public EvaluateDeploymentPoliciesDeployment withName(String name) { - this.name = name; - return this; - } - - /** - * Get the properties property: Properties of the hypothetical deployment. - * - * @return the properties value. - */ - public EvaluateDeploymentPoliciesDeploymentProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of the hypothetical deployment. - * - * @param properties the properties value to set. - * @return the EvaluateDeploymentPoliciesDeployment object itself. - */ - public EvaluateDeploymentPoliciesDeployment - withProperties(EvaluateDeploymentPoliciesDeploymentProperties properties) { - this.properties = properties; - return this; - } - - /** - * {@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 EvaluateDeploymentPoliciesDeployment from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EvaluateDeploymentPoliciesDeployment 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 EvaluateDeploymentPoliciesDeployment. - */ - public static EvaluateDeploymentPoliciesDeployment fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EvaluateDeploymentPoliciesDeployment deserializedEvaluateDeploymentPoliciesDeployment - = new EvaluateDeploymentPoliciesDeployment(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedEvaluateDeploymentPoliciesDeployment.name = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedEvaluateDeploymentPoliciesDeployment.properties - = EvaluateDeploymentPoliciesDeploymentProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedEvaluateDeploymentPoliciesDeployment; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EvaluateDeploymentPoliciesDeploymentProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EvaluateDeploymentPoliciesDeploymentProperties.java deleted file mode 100644 index 2a0769827337..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EvaluateDeploymentPoliciesDeploymentProperties.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Properties of a hypothetical deployment for policy evaluation. - */ -@Fluent -public final class EvaluateDeploymentPoliciesDeploymentProperties - implements JsonSerializable { - /* - * The model to evaluate. - */ - private DeploymentModel model; - - /* - * The name of the RAI policy to evaluate. - */ - private String raiPolicyName; - - /** - * Creates an instance of EvaluateDeploymentPoliciesDeploymentProperties class. - */ - public EvaluateDeploymentPoliciesDeploymentProperties() { - } - - /** - * Get the model property: The model to evaluate. - * - * @return the model value. - */ - public DeploymentModel model() { - return this.model; - } - - /** - * Set the model property: The model to evaluate. - * - * @param model the model value to set. - * @return the EvaluateDeploymentPoliciesDeploymentProperties object itself. - */ - public EvaluateDeploymentPoliciesDeploymentProperties withModel(DeploymentModel model) { - this.model = model; - return this; - } - - /** - * Get the raiPolicyName property: The name of the RAI policy to evaluate. - * - * @return the raiPolicyName value. - */ - public String raiPolicyName() { - return this.raiPolicyName; - } - - /** - * Set the raiPolicyName property: The name of the RAI policy to evaluate. - * - * @param raiPolicyName the raiPolicyName value to set. - * @return the EvaluateDeploymentPoliciesDeploymentProperties object itself. - */ - public EvaluateDeploymentPoliciesDeploymentProperties withRaiPolicyName(String raiPolicyName) { - this.raiPolicyName = raiPolicyName; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("model", this.model); - jsonWriter.writeStringField("raiPolicyName", this.raiPolicyName); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EvaluateDeploymentPoliciesDeploymentProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EvaluateDeploymentPoliciesDeploymentProperties 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 EvaluateDeploymentPoliciesDeploymentProperties. - */ - public static EvaluateDeploymentPoliciesDeploymentProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EvaluateDeploymentPoliciesDeploymentProperties deserializedEvaluateDeploymentPoliciesDeploymentProperties - = new EvaluateDeploymentPoliciesDeploymentProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("model".equals(fieldName)) { - deserializedEvaluateDeploymentPoliciesDeploymentProperties.model = DeploymentModel.fromJson(reader); - } else if ("raiPolicyName".equals(fieldName)) { - deserializedEvaluateDeploymentPoliciesDeploymentProperties.raiPolicyName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedEvaluateDeploymentPoliciesDeploymentProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EvaluateDeploymentPoliciesRequest.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EvaluateDeploymentPoliciesRequest.java deleted file mode 100644 index 4c1bbebcb377..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EvaluateDeploymentPoliciesRequest.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Request body for the evaluateDeploymentPolicies action. - */ -@Fluent -public final class EvaluateDeploymentPoliciesRequest implements JsonSerializable { - /* - * The list of hypothetical deployments to evaluate against Azure Policy. - */ - private List deployments; - - /** - * Creates an instance of EvaluateDeploymentPoliciesRequest class. - */ - public EvaluateDeploymentPoliciesRequest() { - } - - /** - * Get the deployments property: The list of hypothetical deployments to evaluate against Azure Policy. - * - * @return the deployments value. - */ - public List deployments() { - return this.deployments; - } - - /** - * Set the deployments property: The list of hypothetical deployments to evaluate against Azure Policy. - * - * @param deployments the deployments value to set. - * @return the EvaluateDeploymentPoliciesRequest object itself. - */ - public EvaluateDeploymentPoliciesRequest withDeployments(List deployments) { - this.deployments = deployments; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("deployments", this.deployments, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EvaluateDeploymentPoliciesRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EvaluateDeploymentPoliciesRequest 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 EvaluateDeploymentPoliciesRequest. - */ - public static EvaluateDeploymentPoliciesRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EvaluateDeploymentPoliciesRequest deserializedEvaluateDeploymentPoliciesRequest - = new EvaluateDeploymentPoliciesRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("deployments".equals(fieldName)) { - List deployments - = reader.readArray(reader1 -> EvaluateDeploymentPoliciesDeployment.fromJson(reader1)); - deserializedEvaluateDeploymentPoliciesRequest.deployments = deployments; - } else { - reader.skipChildren(); - } - } - - return deserializedEvaluateDeploymentPoliciesRequest; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EvaluateDeploymentPoliciesResponse.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EvaluateDeploymentPoliciesResponse.java deleted file mode 100644 index ce7894dabeef..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EvaluateDeploymentPoliciesResponse.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.EvaluateDeploymentPoliciesResponseInner; -import java.util.Map; - -/** - * An immutable client-side representation of EvaluateDeploymentPoliciesResponse. - */ -public interface EvaluateDeploymentPoliciesResponse { - /** - * Gets the results property: Per-deployment policy evaluation results, keyed by deployment name. - * - * @return the results value. - */ - Map results(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.EvaluateDeploymentPoliciesResponseInner - * object. - * - * @return the inner object. - */ - EvaluateDeploymentPoliciesResponseInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FirewallSku.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FirewallSku.java deleted file mode 100644 index d896eca41404..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FirewallSku.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Firewall Sku used for FQDN Rules. - */ -public final class FirewallSku extends ExpandableStringEnum { - /** - * Static value Standard for FirewallSku. - */ - public static final FirewallSku STANDARD = fromString("Standard"); - - /** - * Static value Basic for FirewallSku. - */ - public static final FirewallSku BASIC = fromString("Basic"); - - /** - * Creates a new instance of FirewallSku value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public FirewallSku() { - } - - /** - * Creates or finds a FirewallSku from its string representation. - * - * @param name a name to look for. - * @return the corresponding FirewallSku. - */ - public static FirewallSku fromString(String name) { - return fromString(name, FirewallSku.class); - } - - /** - * Gets known FirewallSku values. - * - * @return known FirewallSku values. - */ - public static Collection values() { - return values(FirewallSku.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FoundryAutoUpgrade.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FoundryAutoUpgrade.java deleted file mode 100644 index 452ad73e4645..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FoundryAutoUpgrade.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Represents the foundry auto-upgrade configuration for a Cognitive Services account. - * Customers can opt out of auto-upgrade by setting mode to Disabled. - */ -@Fluent -public final class FoundryAutoUpgrade implements JsonSerializable { - /* - * Gets or sets the auto-upgrade mode. - */ - private FoundryAutoUpgradeMode mode; - - /* - * Gets or sets a value indicating whether the auto-upgrade is planned by Microsoft. - */ - private Boolean plannedByMicrosoft; - - /* - * Gets or sets the status reason for the auto-upgrade configuration. - */ - private String statusReason; - - /* - * Gets or sets the scheduled time for the auto-upgrade. - */ - private OffsetDateTime scheduledAt; - - /** - * Creates an instance of FoundryAutoUpgrade class. - */ - public FoundryAutoUpgrade() { - } - - /** - * Get the mode property: Gets or sets the auto-upgrade mode. - * - * @return the mode value. - */ - public FoundryAutoUpgradeMode mode() { - return this.mode; - } - - /** - * Set the mode property: Gets or sets the auto-upgrade mode. - * - * @param mode the mode value to set. - * @return the FoundryAutoUpgrade object itself. - */ - public FoundryAutoUpgrade withMode(FoundryAutoUpgradeMode mode) { - this.mode = mode; - return this; - } - - /** - * Get the plannedByMicrosoft property: Gets or sets a value indicating whether the auto-upgrade is planned by - * Microsoft. - * - * @return the plannedByMicrosoft value. - */ - public Boolean plannedByMicrosoft() { - return this.plannedByMicrosoft; - } - - /** - * Set the plannedByMicrosoft property: Gets or sets a value indicating whether the auto-upgrade is planned by - * Microsoft. - * - * @param plannedByMicrosoft the plannedByMicrosoft value to set. - * @return the FoundryAutoUpgrade object itself. - */ - public FoundryAutoUpgrade withPlannedByMicrosoft(Boolean plannedByMicrosoft) { - this.plannedByMicrosoft = plannedByMicrosoft; - return this; - } - - /** - * Get the statusReason property: Gets or sets the status reason for the auto-upgrade configuration. - * - * @return the statusReason value. - */ - public String statusReason() { - return this.statusReason; - } - - /** - * Set the statusReason property: Gets or sets the status reason for the auto-upgrade configuration. - * - * @param statusReason the statusReason value to set. - * @return the FoundryAutoUpgrade object itself. - */ - public FoundryAutoUpgrade withStatusReason(String statusReason) { - this.statusReason = statusReason; - return this; - } - - /** - * Get the scheduledAt property: Gets or sets the scheduled time for the auto-upgrade. - * - * @return the scheduledAt value. - */ - public OffsetDateTime scheduledAt() { - return this.scheduledAt; - } - - /** - * Set the scheduledAt property: Gets or sets the scheduled time for the auto-upgrade. - * - * @param scheduledAt the scheduledAt value to set. - * @return the FoundryAutoUpgrade object itself. - */ - public FoundryAutoUpgrade withScheduledAt(OffsetDateTime scheduledAt) { - this.scheduledAt = scheduledAt; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); - jsonWriter.writeBooleanField("plannedByMicrosoft", this.plannedByMicrosoft); - jsonWriter.writeStringField("statusReason", this.statusReason); - jsonWriter.writeStringField("scheduledAt", - this.scheduledAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.scheduledAt)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FoundryAutoUpgrade from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FoundryAutoUpgrade 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 FoundryAutoUpgrade. - */ - public static FoundryAutoUpgrade fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FoundryAutoUpgrade deserializedFoundryAutoUpgrade = new FoundryAutoUpgrade(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("mode".equals(fieldName)) { - deserializedFoundryAutoUpgrade.mode = FoundryAutoUpgradeMode.fromString(reader.getString()); - } else if ("plannedByMicrosoft".equals(fieldName)) { - deserializedFoundryAutoUpgrade.plannedByMicrosoft = reader.getNullable(JsonReader::getBoolean); - } else if ("statusReason".equals(fieldName)) { - deserializedFoundryAutoUpgrade.statusReason = reader.getString(); - } else if ("scheduledAt".equals(fieldName)) { - deserializedFoundryAutoUpgrade.scheduledAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedFoundryAutoUpgrade; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FoundryAutoUpgradeMode.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FoundryAutoUpgradeMode.java deleted file mode 100644 index bedd73a6489f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FoundryAutoUpgradeMode.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Represents the mode for foundry auto-upgrade configuration. - */ -public final class FoundryAutoUpgradeMode extends ExpandableStringEnum { - /** - * Auto-upgrade is enabled. - */ - public static final FoundryAutoUpgradeMode ENABLED = fromString("Enabled"); - - /** - * Auto-upgrade is disabled (opted out). - */ - public static final FoundryAutoUpgradeMode DISABLED = fromString("Disabled"); - - /** - * Creates a new instance of FoundryAutoUpgradeMode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public FoundryAutoUpgradeMode() { - } - - /** - * Creates or finds a FoundryAutoUpgradeMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding FoundryAutoUpgradeMode. - */ - public static FoundryAutoUpgradeMode fromString(String name) { - return fromString(name, FoundryAutoUpgradeMode.class); - } - - /** - * Gets known FoundryAutoUpgradeMode values. - * - * @return known FoundryAutoUpgradeMode values. - */ - public static Collection values() { - return values(FoundryAutoUpgradeMode.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FqdnOutboundRule.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FqdnOutboundRule.java deleted file mode 100644 index 4e7c1dbd166d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FqdnOutboundRule.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * FQDN Outbound Rule for the managed network of a cognitive services account. - */ -@Fluent -public final class FqdnOutboundRule extends OutboundRule { - /* - * Type of a managed network Outbound Rule of a cognitive services account. - */ - private RuleType type = RuleType.FQDN; - - /* - * The destination property. - */ - private String destination; - - /** - * Creates an instance of FqdnOutboundRule class. - */ - public FqdnOutboundRule() { - } - - /** - * Get the type property: Type of a managed network Outbound Rule of a cognitive services account. - * - * @return the type value. - */ - @Override - public RuleType type() { - return this.type; - } - - /** - * Get the destination property: The destination property. - * - * @return the destination value. - */ - public String destination() { - return this.destination; - } - - /** - * Set the destination property: The destination property. - * - * @param destination the destination value to set. - * @return the FqdnOutboundRule object itself. - */ - public FqdnOutboundRule withDestination(String destination) { - this.destination = destination; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public FqdnOutboundRule withCategory(RuleCategory category) { - super.withCategory(category); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public FqdnOutboundRule withStatus(RuleStatus status) { - super.withStatus(status); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("category", category() == null ? null : category().toString()); - jsonWriter.writeStringField("status", status() == null ? null : status().toString()); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("destination", this.destination); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FqdnOutboundRule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FqdnOutboundRule 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 FqdnOutboundRule. - */ - public static FqdnOutboundRule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FqdnOutboundRule deserializedFqdnOutboundRule = new FqdnOutboundRule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("category".equals(fieldName)) { - deserializedFqdnOutboundRule.withCategory(RuleCategory.fromString(reader.getString())); - } else if ("status".equals(fieldName)) { - deserializedFqdnOutboundRule.withStatus(RuleStatus.fromString(reader.getString())); - } else if ("errorInformation".equals(fieldName)) { - deserializedFqdnOutboundRule.withErrorInformation(reader.getString()); - } else if ("parentRuleNames".equals(fieldName)) { - List parentRuleNames = reader.readArray(reader1 -> reader1.getString()); - deserializedFqdnOutboundRule.withParentRuleNames(parentRuleNames); - } else if ("type".equals(fieldName)) { - deserializedFqdnOutboundRule.type = RuleType.fromString(reader.getString()); - } else if ("destination".equals(fieldName)) { - deserializedFqdnOutboundRule.destination = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedFqdnOutboundRule; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/HostedAgentDeployment.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/HostedAgentDeployment.java deleted file mode 100644 index 6824fdf953e4..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/HostedAgentDeployment.java +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * Represents a hosted agent deployment where the underlying infrastructure is owned by the platform. - */ -@Fluent -public final class HostedAgentDeployment extends AgentDeploymentProperties { - /* - * Gets or sets the type of deployment for the agent. - */ - private AgentDeploymentType deploymentType = AgentDeploymentType.HOSTED; - - /* - * Gets or sets the minimum number of replicas for this hosted deployment. - */ - private Integer minReplicas; - - /* - * Gets or sets the maximum number of replicas for this hosted deployment. - */ - private Integer maxReplicas; - - /** - * Creates an instance of HostedAgentDeployment class. - */ - public HostedAgentDeployment() { - } - - /** - * Get the deploymentType property: Gets or sets the type of deployment for the agent. - * - * @return the deploymentType value. - */ - @Override - public AgentDeploymentType deploymentType() { - return this.deploymentType; - } - - /** - * Get the minReplicas property: Gets or sets the minimum number of replicas for this hosted deployment. - * - * @return the minReplicas value. - */ - public Integer minReplicas() { - return this.minReplicas; - } - - /** - * Set the minReplicas property: Gets or sets the minimum number of replicas for this hosted deployment. - * - * @param minReplicas the minReplicas value to set. - * @return the HostedAgentDeployment object itself. - */ - public HostedAgentDeployment withMinReplicas(Integer minReplicas) { - this.minReplicas = minReplicas; - return this; - } - - /** - * Get the maxReplicas property: Gets or sets the maximum number of replicas for this hosted deployment. - * - * @return the maxReplicas value. - */ - public Integer maxReplicas() { - return this.maxReplicas; - } - - /** - * Set the maxReplicas property: Gets or sets the maximum number of replicas for this hosted deployment. - * - * @param maxReplicas the maxReplicas value to set. - * @return the HostedAgentDeployment object itself. - */ - public HostedAgentDeployment withMaxReplicas(Integer maxReplicas) { - this.maxReplicas = maxReplicas; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public HostedAgentDeployment withDisplayName(String displayName) { - super.withDisplayName(displayName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public HostedAgentDeployment withDeploymentId(String deploymentId) { - super.withDeploymentId(deploymentId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public HostedAgentDeployment withState(AgentDeploymentState state) { - super.withState(state); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public HostedAgentDeployment withProtocols(List protocols) { - super.withProtocols(protocols); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public HostedAgentDeployment withAgents(List agents) { - super.withAgents(agents); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public HostedAgentDeployment withDescription(String description) { - super.withDescription(description); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public HostedAgentDeployment withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("description", description()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("displayName", displayName()); - jsonWriter.writeStringField("deploymentId", deploymentId()); - jsonWriter.writeStringField("state", state() == null ? null : state().toString()); - jsonWriter.writeArrayField("protocols", protocols(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("agents", agents(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("deploymentType", - this.deploymentType == null ? null : this.deploymentType.toString()); - jsonWriter.writeNumberField("minReplicas", this.minReplicas); - jsonWriter.writeNumberField("maxReplicas", this.maxReplicas); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of HostedAgentDeployment from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HostedAgentDeployment 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 HostedAgentDeployment. - */ - public static HostedAgentDeployment fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HostedAgentDeployment deserializedHostedAgentDeployment = new HostedAgentDeployment(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedHostedAgentDeployment.withDescription(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedHostedAgentDeployment.withTags(tags); - } else if ("displayName".equals(fieldName)) { - deserializedHostedAgentDeployment.withDisplayName(reader.getString()); - } else if ("deploymentId".equals(fieldName)) { - deserializedHostedAgentDeployment.withDeploymentId(reader.getString()); - } else if ("state".equals(fieldName)) { - deserializedHostedAgentDeployment.withState(AgentDeploymentState.fromString(reader.getString())); - } else if ("protocols".equals(fieldName)) { - List protocols - = reader.readArray(reader1 -> AgentProtocolVersion.fromJson(reader1)); - deserializedHostedAgentDeployment.withProtocols(protocols); - } else if ("agents".equals(fieldName)) { - List agents - = reader.readArray(reader1 -> VersionedAgentReference.fromJson(reader1)); - deserializedHostedAgentDeployment.withAgents(agents); - } else if ("provisioningState".equals(fieldName)) { - deserializedHostedAgentDeployment - .withProvisioningState(AgentDeploymentProvisioningState.fromString(reader.getString())); - } else if ("deploymentType".equals(fieldName)) { - deserializedHostedAgentDeployment.deploymentType - = AgentDeploymentType.fromString(reader.getString()); - } else if ("minReplicas".equals(fieldName)) { - deserializedHostedAgentDeployment.minReplicas = reader.getNullable(JsonReader::getInt); - } else if ("maxReplicas".equals(fieldName)) { - deserializedHostedAgentDeployment.maxReplicas = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedHostedAgentDeployment; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/HostingModel.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/HostingModel.java deleted file mode 100644 index 99af491bff83..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/HostingModel.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Account hosting model. - */ -public final class HostingModel extends ExpandableStringEnum { - /** - * Static value Web for HostingModel. - */ - public static final HostingModel WEB = fromString("Web"); - - /** - * Static value ConnectedContainer for HostingModel. - */ - public static final HostingModel CONNECTED_CONTAINER = fromString("ConnectedContainer"); - - /** - * Static value DisconnectedContainer for HostingModel. - */ - public static final HostingModel DISCONNECTED_CONTAINER = fromString("DisconnectedContainer"); - - /** - * Static value ProvisionedWeb for HostingModel. - */ - public static final HostingModel PROVISIONED_WEB = fromString("ProvisionedWeb"); - - /** - * Creates a new instance of HostingModel value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public HostingModel() { - } - - /** - * Creates or finds a HostingModel from its string representation. - * - * @param name a name to look for. - * @return the corresponding HostingModel. - */ - public static HostingModel fromString(String name) { - return fromString(name, HostingModel.class); - } - - /** - * Gets known HostingModel values. - * - * @return known HostingModel values. - */ - public static Collection values() { - return values(HostingModel.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Identity.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Identity.java deleted file mode 100644 index 822c8614671c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Identity.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Identity for the resource. - */ -@Fluent -public final class Identity implements JsonSerializable { - /* - * The identity type. - */ - private ResourceIdentityType type; - - /* - * The tenant ID of resource. - */ - private String tenantId; - - /* - * The principal ID of resource identity. - */ - private String principalId; - - /* - * The list of user assigned identities associated with the resource. The user identity dictionary key references - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ - * userAssignedIdentities/{identityName} - */ - private Map userAssignedIdentities; - - /** - * Creates an instance of Identity class. - */ - public Identity() { - } - - /** - * Get the type property: The identity type. - * - * @return the type value. - */ - public ResourceIdentityType type() { - return this.type; - } - - /** - * Set the type property: The identity type. - * - * @param type the type value to set. - * @return the Identity object itself. - */ - public Identity withType(ResourceIdentityType type) { - this.type = type; - return this; - } - - /** - * Get the tenantId property: The tenant ID of resource. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the principalId property: The principal ID of resource identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the userAssignedIdentities property: The list of user assigned identities associated with the resource. The - * user identity dictionary key references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - * - * @return the userAssignedIdentities value. - */ - public Map userAssignedIdentities() { - return this.userAssignedIdentities; - } - - /** - * Set the userAssignedIdentities property: The list of user assigned identities associated with the resource. The - * user identity dictionary key references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - * - * @param userAssignedIdentities the userAssignedIdentities value to set. - * @return the Identity object itself. - */ - public Identity withUserAssignedIdentities(Map userAssignedIdentities) { - this.userAssignedIdentities = userAssignedIdentities; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Identity from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Identity 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 Identity. - */ - public static Identity fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Identity deserializedIdentity = new Identity(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedIdentity.type = ResourceIdentityType.fromString(reader.getString()); - } else if ("tenantId".equals(fieldName)) { - deserializedIdentity.tenantId = reader.getString(); - } else if ("principalId".equals(fieldName)) { - deserializedIdentity.principalId = reader.getString(); - } else if ("userAssignedIdentities".equals(fieldName)) { - Map userAssignedIdentities - = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); - deserializedIdentity.userAssignedIdentities = userAssignedIdentities; - } else { - reader.skipChildren(); - } - } - - return deserializedIdentity; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityKind.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityKind.java deleted file mode 100644 index 31c6e8d55be5..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityKind.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Specifies the kind of Entra identity described by this object. - */ -public final class IdentityKind extends ExpandableStringEnum { - /** - * Represents a class identity, used for agentic applications. - */ - public static final IdentityKind AGENT_BLUEPRINT = fromString("AgentBlueprint"); - - /** - * Represents an instance identity. - */ - public static final IdentityKind AGENT_INSTANCE = fromString("AgentInstance"); - - /** - * Represents an agentic instance identity with user-like traits. - */ - public static final IdentityKind AGENTIC_USER = fromString("AgenticUser"); - - /** - * Represents a classic managed identity. - */ - public static final IdentityKind MANAGED = fromString("Managed"); - - /** - * No identity. - */ - public static final IdentityKind NONE = fromString("None"); - - /** - * Creates a new instance of IdentityKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public IdentityKind() { - } - - /** - * Creates or finds a IdentityKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding IdentityKind. - */ - public static IdentityKind fromString(String name) { - return fromString(name, IdentityKind.class); - } - - /** - * Gets known IdentityKind values. - * - * @return known IdentityKind values. - */ - public static Collection values() { - return values(IdentityKind.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityManagementType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityManagementType.java deleted file mode 100644 index 3cbe13f1aa7e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityManagementType.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Enumeration of identity types, from the perspective of management. - */ -public final class IdentityManagementType extends ExpandableStringEnum { - /** - * Platform-managed identity. - */ - public static final IdentityManagementType SYSTEM = fromString("System"); - - /** - * User-managed identity. - */ - public static final IdentityManagementType USER = fromString("User"); - - /** - * No identity. - */ - public static final IdentityManagementType NONE = fromString("None"); - - /** - * Creates a new instance of IdentityManagementType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public IdentityManagementType() { - } - - /** - * Creates or finds a IdentityManagementType from its string representation. - * - * @param name a name to look for. - * @return the corresponding IdentityManagementType. - */ - public static IdentityManagementType fromString(String name) { - return fromString(name, IdentityManagementType.class); - } - - /** - * Gets known IdentityManagementType values. - * - * @return known IdentityManagementType values. - */ - public static Collection values() { - return values(IdentityManagementType.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityProvisioningState.java deleted file mode 100644 index 04d8b5b34989..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityProvisioningState.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Represents the provisioning state of an identity resource. - */ -public final class IdentityProvisioningState extends ExpandableStringEnum { - /** - * Identity is being created. - */ - public static final IdentityProvisioningState CREATING = fromString("Creating"); - - /** - * Identity is being updated. - */ - public static final IdentityProvisioningState UPDATING = fromString("Updating"); - - /** - * Identity has been successfully provisioned. - */ - public static final IdentityProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * Identity provisioning has failed. - */ - public static final IdentityProvisioningState FAILED = fromString("Failed"); - - /** - * Identity provisioning has been canceled. - */ - public static final IdentityProvisioningState CANCELED = fromString("Canceled"); - - /** - * Identity is being deleted. - */ - public static final IdentityProvisioningState DELETING = fromString("Deleting"); - - /** - * Creates a new instance of IdentityProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public IdentityProvisioningState() { - } - - /** - * Creates or finds a IdentityProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding IdentityProvisioningState. - */ - public static IdentityProvisioningState fromString(String name) { - return fromString(name, IdentityProvisioningState.class); - } - - /** - * Gets known IdentityProvisioningState values. - * - * @return known IdentityProvisioningState values. - */ - public static Collection values() { - return values(IdentityProvisioningState.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IpRule.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IpRule.java deleted file mode 100644 index 0de85f99a07a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IpRule.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * A rule governing the accessibility from a specific ip address or ip range. - */ -@Fluent -public final class IpRule implements JsonSerializable { - /* - * An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all - * addresses that start with 124.56.78). - */ - private String value; - - /** - * Creates an instance of IpRule class. - */ - public IpRule() { - } - - /** - * Get the value property: An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or - * '124.56.78.0/24' (all addresses that start with 124.56.78). - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: An IPv4 address range in CIDR notation, such as '124.56.78.91' (simple IP address) or - * '124.56.78.0/24' (all addresses that start with 124.56.78). - * - * @param value the value value to set. - * @return the IpRule object itself. - */ - public IpRule withValue(String value) { - this.value = value; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("value", this.value); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IpRule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IpRule 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 IpRule. - */ - public static IpRule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IpRule deserializedIpRule = new IpRule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - deserializedIpRule.value = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedIpRule; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IsolationMode.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IsolationMode.java deleted file mode 100644 index f4db2cf4d2a4..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IsolationMode.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Isolation mode for the managed network of a cognitive services account. - */ -public final class IsolationMode extends ExpandableStringEnum { - /** - * Static value Disabled for IsolationMode. - */ - public static final IsolationMode DISABLED = fromString("Disabled"); - - /** - * Static value AllowInternetOutbound for IsolationMode. - */ - public static final IsolationMode ALLOW_INTERNET_OUTBOUND = fromString("AllowInternetOutbound"); - - /** - * Static value AllowOnlyApprovedOutbound for IsolationMode. - */ - public static final IsolationMode ALLOW_ONLY_APPROVED_OUTBOUND = fromString("AllowOnlyApprovedOutbound"); - - /** - * Creates a new instance of IsolationMode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public IsolationMode() { - } - - /** - * Creates or finds a IsolationMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding IsolationMode. - */ - public static IsolationMode fromString(String name) { - return fromString(name, IsolationMode.class); - } - - /** - * Gets known IsolationMode values. - * - * @return known IsolationMode values. - */ - public static Collection values() { - return values(IsolationMode.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeyName.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeyName.java deleted file mode 100644 index a386afd0cea3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeyName.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -/** - * key name to generate (Key1|Key2). - */ -public enum KeyName { - /** - * Enum value Key1. - */ - KEY1("Key1"), - - /** - * Enum value Key2. - */ - KEY2("Key2"); - - /** - * The actual serialized value for a KeyName instance. - */ - private final String value; - - KeyName(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a KeyName instance. - * - * @param value the serialized value to parse. - * @return the parsed KeyName object, or null if unable to parse. - */ - public static KeyName fromString(String value) { - if (value == null) { - return null; - } - KeyName[] items = KeyName.values(); - for (KeyName item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeySource.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeySource.java deleted file mode 100644 index fd1b8f082057..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeySource.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Enumerates the possible value of keySource for Encryption. - */ -public final class KeySource extends ExpandableStringEnum { - /** - * Static value Microsoft.CognitiveServices for KeySource. - */ - public static final KeySource MICROSOFT_COGNITIVE_SERVICES = fromString("Microsoft.CognitiveServices"); - - /** - * Static value Microsoft.KeyVault for KeySource. - */ - public static final KeySource MICROSOFT_KEY_VAULT = fromString("Microsoft.KeyVault"); - - /** - * Creates a new instance of KeySource value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public KeySource() { - } - - /** - * Creates or finds a KeySource from its string representation. - * - * @param name a name to look for. - * @return the corresponding KeySource. - */ - public static KeySource fromString(String name) { - return fromString(name, KeySource.class); - } - - /** - * Gets known KeySource values. - * - * @return known KeySource values. - */ - public static Collection values() { - return values(KeySource.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeyVaultProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeyVaultProperties.java deleted file mode 100644 index 2d45ce81a9e6..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeyVaultProperties.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Properties to configure keyVault Properties. - */ -@Fluent -public final class KeyVaultProperties implements JsonSerializable { - /* - * Name of the Key from KeyVault - */ - private String keyName; - - /* - * Version of the Key from KeyVault - */ - private String keyVersion; - - /* - * Uri of KeyVault - */ - private String keyVaultUri; - - /* - * The identityClientId property. - */ - private String identityClientId; - - /** - * Creates an instance of KeyVaultProperties class. - */ - public KeyVaultProperties() { - } - - /** - * Get the keyName property: Name of the Key from KeyVault. - * - * @return the keyName value. - */ - public String keyName() { - return this.keyName; - } - - /** - * Set the keyName property: Name of the Key from KeyVault. - * - * @param keyName the keyName value to set. - * @return the KeyVaultProperties object itself. - */ - public KeyVaultProperties withKeyName(String keyName) { - this.keyName = keyName; - return this; - } - - /** - * Get the keyVersion property: Version of the Key from KeyVault. - * - * @return the keyVersion value. - */ - public String keyVersion() { - return this.keyVersion; - } - - /** - * Set the keyVersion property: Version of the Key from KeyVault. - * - * @param keyVersion the keyVersion value to set. - * @return the KeyVaultProperties object itself. - */ - public KeyVaultProperties withKeyVersion(String keyVersion) { - this.keyVersion = keyVersion; - return this; - } - - /** - * Get the keyVaultUri property: Uri of KeyVault. - * - * @return the keyVaultUri value. - */ - public String keyVaultUri() { - return this.keyVaultUri; - } - - /** - * Set the keyVaultUri property: Uri of KeyVault. - * - * @param keyVaultUri the keyVaultUri value to set. - * @return the KeyVaultProperties object itself. - */ - public KeyVaultProperties withKeyVaultUri(String keyVaultUri) { - this.keyVaultUri = keyVaultUri; - return this; - } - - /** - * Get the identityClientId property: The identityClientId property. - * - * @return the identityClientId value. - */ - public String identityClientId() { - return this.identityClientId; - } - - /** - * Set the identityClientId property: The identityClientId property. - * - * @param identityClientId the identityClientId value to set. - * @return the KeyVaultProperties object itself. - */ - public KeyVaultProperties withIdentityClientId(String identityClientId) { - this.identityClientId = identityClientId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("keyName", this.keyName); - jsonWriter.writeStringField("keyVersion", this.keyVersion); - jsonWriter.writeStringField("keyVaultUri", this.keyVaultUri); - jsonWriter.writeStringField("identityClientId", this.identityClientId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of KeyVaultProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of KeyVaultProperties 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 KeyVaultProperties. - */ - public static KeyVaultProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - KeyVaultProperties deserializedKeyVaultProperties = new KeyVaultProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("keyName".equals(fieldName)) { - deserializedKeyVaultProperties.keyName = reader.getString(); - } else if ("keyVersion".equals(fieldName)) { - deserializedKeyVaultProperties.keyVersion = reader.getString(); - } else if ("keyVaultUri".equals(fieldName)) { - deserializedKeyVaultProperties.keyVaultUri = reader.getString(); - } else if ("identityClientId".equals(fieldName)) { - deserializedKeyVaultProperties.identityClientId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedKeyVaultProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/LocationBasedModelCapacities.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/LocationBasedModelCapacities.java deleted file mode 100644 index c8be2f4c95fb..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/LocationBasedModelCapacities.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of LocationBasedModelCapacities. - */ -public interface LocationBasedModelCapacities { - /** - * List Location Based ModelCapacities. - * - * @param location The location name. - * @param modelFormat The format of the Model. - * @param modelName The name of the Model. - * @param modelVersion The version of the Model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String location, String modelFormat, String modelName, - String modelVersion); - - /** - * List Location Based ModelCapacities. - * - * @param location The location name. - * @param modelFormat The format of the Model. - * @param modelName The name of the Model. - * @param modelVersion The version of the Model. - * @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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String location, String modelFormat, String modelName, - String modelVersion, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedAgentDeployment.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedAgentDeployment.java deleted file mode 100644 index 79103b0d73d0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedAgentDeployment.java +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * Represents a managed agent deployment where the underlying infrastructure is managed by the platform in the - * deployer's subscription. - */ -@Fluent -public final class ManagedAgentDeployment extends AgentDeploymentProperties { - /* - * Gets or sets the type of deployment for the agent. - */ - private AgentDeploymentType deploymentType = AgentDeploymentType.MANAGED; - - /** - * Creates an instance of ManagedAgentDeployment class. - */ - public ManagedAgentDeployment() { - } - - /** - * Get the deploymentType property: Gets or sets the type of deployment for the agent. - * - * @return the deploymentType value. - */ - @Override - public AgentDeploymentType deploymentType() { - return this.deploymentType; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedAgentDeployment withDisplayName(String displayName) { - super.withDisplayName(displayName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedAgentDeployment withDeploymentId(String deploymentId) { - super.withDeploymentId(deploymentId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedAgentDeployment withState(AgentDeploymentState state) { - super.withState(state); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedAgentDeployment withProtocols(List protocols) { - super.withProtocols(protocols); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedAgentDeployment withAgents(List agents) { - super.withAgents(agents); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedAgentDeployment withDescription(String description) { - super.withDescription(description); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedAgentDeployment withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("description", description()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("displayName", displayName()); - jsonWriter.writeStringField("deploymentId", deploymentId()); - jsonWriter.writeStringField("state", state() == null ? null : state().toString()); - jsonWriter.writeArrayField("protocols", protocols(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("agents", agents(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("deploymentType", - this.deploymentType == null ? null : this.deploymentType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ManagedAgentDeployment from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedAgentDeployment 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 ManagedAgentDeployment. - */ - public static ManagedAgentDeployment fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedAgentDeployment deserializedManagedAgentDeployment = new ManagedAgentDeployment(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedManagedAgentDeployment.withDescription(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedManagedAgentDeployment.withTags(tags); - } else if ("displayName".equals(fieldName)) { - deserializedManagedAgentDeployment.withDisplayName(reader.getString()); - } else if ("deploymentId".equals(fieldName)) { - deserializedManagedAgentDeployment.withDeploymentId(reader.getString()); - } else if ("state".equals(fieldName)) { - deserializedManagedAgentDeployment.withState(AgentDeploymentState.fromString(reader.getString())); - } else if ("protocols".equals(fieldName)) { - List protocols - = reader.readArray(reader1 -> AgentProtocolVersion.fromJson(reader1)); - deserializedManagedAgentDeployment.withProtocols(protocols); - } else if ("agents".equals(fieldName)) { - List agents - = reader.readArray(reader1 -> VersionedAgentReference.fromJson(reader1)); - deserializedManagedAgentDeployment.withAgents(agents); - } else if ("provisioningState".equals(fieldName)) { - deserializedManagedAgentDeployment - .withProvisioningState(AgentDeploymentProvisioningState.fromString(reader.getString())); - } else if ("deploymentType".equals(fieldName)) { - deserializedManagedAgentDeployment.deploymentType - = AgentDeploymentType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedManagedAgentDeployment; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeCapacities.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeCapacities.java deleted file mode 100644 index 655305f53df3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeCapacities.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of ManagedComputeCapacities. - */ -public interface ManagedComputeCapacities { - /** - * Gets the managed compute capacities for a subscription. Returns available capacity - * per accelerator type, including deployment size information. - * - * @param offer The offer name to query capacity for (required). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managed compute capacities for a subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String offer); - - /** - * Gets the managed compute capacities for a subscription. Returns available capacity - * per accelerator type, including deployment size information. - * - * @param offer The offer name to query capacity for (required). - * @param acceleratorType Optional accelerator type filter to narrow results to a specific accelerator type. - * @param deploymentId Optional deployment resource ID. When provided, returns capacity for the specific region - * where the deployment is hosted rather than the best available region. - * @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 managed compute capacities for a subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String offer, String acceleratorType, String deploymentId, - Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeCapacity.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeCapacity.java deleted file mode 100644 index 8b4918f667c2..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeCapacity.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedComputeCapacityInner; - -/** - * An immutable client-side representation of ManagedComputeCapacity. - */ -public interface ManagedComputeCapacity { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Properties of the managed compute capacity resource. - * - * @return the properties value. - */ - ManagedComputeCapacityProperties 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.cognitiveservices.fluent.models.ManagedComputeCapacityInner object. - * - * @return the inner object. - */ - ManagedComputeCapacityInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeCapacityProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeCapacityProperties.java deleted file mode 100644 index d3bf322a5150..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeCapacityProperties.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Properties of a managed compute capacity resource. - */ -@Immutable -public final class ManagedComputeCapacityProperties implements JsonSerializable { - /* - * The type of accelerator (e.g., Azure.A100, Azure.H100). - */ - private String acceleratorType; - - /* - * The number of available accelerators in the region. - */ - private Integer availableAccelerators; - - /* - * Capacity information broken down by deployment size. - */ - private List deploymentSizeCapacities; - - /** - * Creates an instance of ManagedComputeCapacityProperties class. - */ - private ManagedComputeCapacityProperties() { - } - - /** - * Get the acceleratorType property: The type of accelerator (e.g., Azure.A100, Azure.H100). - * - * @return the acceleratorType value. - */ - public String acceleratorType() { - return this.acceleratorType; - } - - /** - * Get the availableAccelerators property: The number of available accelerators in the region. - * - * @return the availableAccelerators value. - */ - public Integer availableAccelerators() { - return this.availableAccelerators; - } - - /** - * Get the deploymentSizeCapacities property: Capacity information broken down by deployment size. - * - * @return the deploymentSizeCapacities value. - */ - public List deploymentSizeCapacities() { - return this.deploymentSizeCapacities; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ManagedComputeCapacityProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedComputeCapacityProperties 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 ManagedComputeCapacityProperties. - */ - public static ManagedComputeCapacityProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedComputeCapacityProperties deserializedManagedComputeCapacityProperties - = new ManagedComputeCapacityProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("acceleratorType".equals(fieldName)) { - deserializedManagedComputeCapacityProperties.acceleratorType = reader.getString(); - } else if ("availableAccelerators".equals(fieldName)) { - deserializedManagedComputeCapacityProperties.availableAccelerators - = reader.getNullable(JsonReader::getInt); - } else if ("deploymentSizeCapacities".equals(fieldName)) { - List deploymentSizeCapacities - = reader.readArray(reader1 -> DeploymentSizeCapacity.fromJson(reader1)); - deserializedManagedComputeCapacityProperties.deploymentSizeCapacities = deploymentSizeCapacities; - } else { - reader.skipChildren(); - } - } - - return deserializedManagedComputeCapacityProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeployment.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeployment.java deleted file mode 100644 index a4a9e3338fcd..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeployment.java +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedComputeDeploymentInner; - -/** - * An immutable client-side representation of ManagedComputeDeployment. - */ -public interface ManagedComputeDeployment { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Properties of the Cognitive Services managed compute deployment. - * - * @return the properties value. - */ - ManagedComputeDeploymentProperties properties(); - - /** - * Gets the sku property: The resource model definition representing SKU. - * - * @return the sku value. - */ - Sku sku(); - - /** - * Gets the etag property: Resource Etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedComputeDeploymentInner object. - * - * @return the inner object. - */ - ManagedComputeDeploymentInner innerModel(); - - /** - * The entirety of the ManagedComputeDeployment definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The ManagedComputeDeployment definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the ManagedComputeDeployment definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the ManagedComputeDeployment definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, accountName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @return the next definition stage. - */ - WithCreate withExistingAccount(String resourceGroupName, String accountName); - } - - /** - * The stage of the ManagedComputeDeployment definition which contains all the minimum required properties for - * the resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithProperties, DefinitionStages.WithSku { - /** - * Executes the create request. - * - * @return the created resource. - */ - ManagedComputeDeployment create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - ManagedComputeDeployment create(Context context); - } - - /** - * The stage of the ManagedComputeDeployment definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of the Cognitive Services managed compute deployment.. - * - * @param properties Properties of the Cognitive Services managed compute deployment. - * @return the next definition stage. - */ - WithCreate withProperties(ManagedComputeDeploymentProperties properties); - } - - /** - * The stage of the ManagedComputeDeployment definition allowing to specify sku. - */ - interface WithSku { - /** - * Specifies the sku property: The resource model definition representing SKU. - * - * @param sku The resource model definition representing SKU. - * @return the next definition stage. - */ - WithCreate withSku(Sku sku); - } - } - - /** - * Begins update for the ManagedComputeDeployment resource. - * - * @return the stage of resource update. - */ - ManagedComputeDeployment.Update update(); - - /** - * The template for ManagedComputeDeployment update. - */ - interface Update extends UpdateStages.WithSku { - /** - * Executes the update request. - * - * @return the updated resource. - */ - ManagedComputeDeployment apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - ManagedComputeDeployment apply(Context context); - } - - /** - * The ManagedComputeDeployment update stages. - */ - interface UpdateStages { - /** - * The stage of the ManagedComputeDeployment update allowing to specify sku. - */ - interface WithSku { - /** - * Specifies the sku property: The resource model definition representing SKU. - * - * @param sku The resource model definition representing SKU. - * @return the next definition stage. - */ - Update withSku(Sku sku); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - ManagedComputeDeployment refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - ManagedComputeDeployment refresh(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeploymentInfo.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeploymentInfo.java deleted file mode 100644 index f82e5c45bcc5..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeploymentInfo.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Deployment detail within a managed compute usage entry. - */ -@Immutable -public final class ManagedComputeDeploymentInfo implements JsonSerializable { - /* - * Full ARM resource ID of the deployment. - */ - private String deploymentId; - - /* - * Full ARM resource ID of the account/project. - */ - private String projectId; - - /* - * Model name (e.g., 'azureml://registries//models//versions/gpt-4o'). - */ - private String modelId; - - /* - * Number of GPUs consumed by this deployment. - */ - private Long acceleratorCount; - - /* - * Number of instances for this deployment. - */ - private Integer instanceCount; - - /** - * Creates an instance of ManagedComputeDeploymentInfo class. - */ - private ManagedComputeDeploymentInfo() { - } - - /** - * Get the deploymentId property: Full ARM resource ID of the deployment. - * - * @return the deploymentId value. - */ - public String deploymentId() { - return this.deploymentId; - } - - /** - * Get the projectId property: Full ARM resource ID of the account/project. - * - * @return the projectId value. - */ - public String projectId() { - return this.projectId; - } - - /** - * Get the modelId property: Model name (e.g., 'azureml://registries//models//versions/gpt-4o'). - * - * @return the modelId value. - */ - public String modelId() { - return this.modelId; - } - - /** - * Get the acceleratorCount property: Number of GPUs consumed by this deployment. - * - * @return the acceleratorCount value. - */ - public Long acceleratorCount() { - return this.acceleratorCount; - } - - /** - * Get the instanceCount property: Number of instances for this deployment. - * - * @return the instanceCount value. - */ - public Integer instanceCount() { - return this.instanceCount; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("deploymentId", this.deploymentId); - jsonWriter.writeStringField("projectId", this.projectId); - jsonWriter.writeStringField("modelId", this.modelId); - jsonWriter.writeNumberField("acceleratorCount", this.acceleratorCount); - jsonWriter.writeNumberField("instanceCount", this.instanceCount); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ManagedComputeDeploymentInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedComputeDeploymentInfo 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 ManagedComputeDeploymentInfo. - */ - public static ManagedComputeDeploymentInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedComputeDeploymentInfo deserializedManagedComputeDeploymentInfo = new ManagedComputeDeploymentInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("deploymentId".equals(fieldName)) { - deserializedManagedComputeDeploymentInfo.deploymentId = reader.getString(); - } else if ("projectId".equals(fieldName)) { - deserializedManagedComputeDeploymentInfo.projectId = reader.getString(); - } else if ("modelId".equals(fieldName)) { - deserializedManagedComputeDeploymentInfo.modelId = reader.getString(); - } else if ("acceleratorCount".equals(fieldName)) { - deserializedManagedComputeDeploymentInfo.acceleratorCount = reader.getNullable(JsonReader::getLong); - } else if ("instanceCount".equals(fieldName)) { - deserializedManagedComputeDeploymentInfo.instanceCount = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedManagedComputeDeploymentInfo; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeploymentProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeploymentProperties.java deleted file mode 100644 index cc49338f0fa1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeploymentProperties.java +++ /dev/null @@ -1,361 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Properties of a Cognitive Services managed compute deployment. - */ -@Fluent -public final class ManagedComputeDeploymentProperties implements JsonSerializable { - /* - * AzureML Registry model asset URI. Required on creation; immutable after creation. - * Example: azureml://registries/{registry}/models/{model}/versions/{version} - */ - private String model; - - /* - * Deployment template identifier. Optional on creation. - * Accepts an AzureML Registry deployment template URI or a project-scoped deployment template path for - * VmManagedCompute. - * Examples: azureml://registries/{registry}/deploymenttemplates/{template}/versions/{version}, - * projects/{project}/deploymentTemplates/{template}/versions/{version} - */ - private String deploymentTemplate; - - /* - * Accelerator type (e.g., H100_80GB). Optional on creation; immutable after creation. - */ - private String acceleratorType; - - /* - * Template auto-upgrade policy. Defaults to OnceNewDefaultVersionAvailable. - */ - private DeploymentModelVersionUpgradeOption versionUpgradeOption; - - /* - * Deployment capabilities represented as key-value pairs. - * Example: { assetsV2: "true" }. - */ - private Map capabilities; - - /* - * Foundry compute ARM resource ID for VM-backed managed compute deployments. Required when sku.name is - * VmManagedCompute; immutable after creation. - */ - private String computeId; - - /* - * Scheduling priority for VM-backed managed compute deployments. Immutable after creation. - */ - private String priority; - - /* - * Read-only. Number of accelerators (GPUs) consumed by each model instance, sourced from the deployment template. - */ - private Integer acceleratorsPerInstance; - - /* - * Read-only. Total accelerators allocated: sku.capacity (instances) x acceleratorsPerInstance. - */ - private Integer totalAccelerators; - - /* - * Read-only. Current provisioning state. - */ - private ProvisioningState provisioningState; - - /* - * Read-only. Status message and timestamp from the last provisioning operation. - */ - private ManagedComputeDeploymentProvisioningDetails provisioningDetails; - - /* - * Read-only. Inference route paths relative to the account endpoint. Populated when provisioningState is Succeeded. - */ - private ManagedComputeDeploymentRoutes routes; - - /** - * Creates an instance of ManagedComputeDeploymentProperties class. - */ - public ManagedComputeDeploymentProperties() { - } - - /** - * Get the model property: AzureML Registry model asset URI. Required on creation; immutable after creation. - * Example: azureml://registries/{registry}/models/{model}/versions/{version}. - * - * @return the model value. - */ - public String model() { - return this.model; - } - - /** - * Set the model property: AzureML Registry model asset URI. Required on creation; immutable after creation. - * Example: azureml://registries/{registry}/models/{model}/versions/{version}. - * - * @param model the model value to set. - * @return the ManagedComputeDeploymentProperties object itself. - */ - public ManagedComputeDeploymentProperties withModel(String model) { - this.model = model; - return this; - } - - /** - * Get the deploymentTemplate property: Deployment template identifier. Optional on creation. - * Accepts an AzureML Registry deployment template URI or a project-scoped deployment template path for - * VmManagedCompute. - * Examples: azureml://registries/{registry}/deploymenttemplates/{template}/versions/{version}, - * projects/{project}/deploymentTemplates/{template}/versions/{version}. - * - * @return the deploymentTemplate value. - */ - public String deploymentTemplate() { - return this.deploymentTemplate; - } - - /** - * Set the deploymentTemplate property: Deployment template identifier. Optional on creation. - * Accepts an AzureML Registry deployment template URI or a project-scoped deployment template path for - * VmManagedCompute. - * Examples: azureml://registries/{registry}/deploymenttemplates/{template}/versions/{version}, - * projects/{project}/deploymentTemplates/{template}/versions/{version}. - * - * @param deploymentTemplate the deploymentTemplate value to set. - * @return the ManagedComputeDeploymentProperties object itself. - */ - public ManagedComputeDeploymentProperties withDeploymentTemplate(String deploymentTemplate) { - this.deploymentTemplate = deploymentTemplate; - return this; - } - - /** - * Get the acceleratorType property: Accelerator type (e.g., H100_80GB). Optional on creation; immutable after - * creation. - * - * @return the acceleratorType value. - */ - public String acceleratorType() { - return this.acceleratorType; - } - - /** - * Set the acceleratorType property: Accelerator type (e.g., H100_80GB). Optional on creation; immutable after - * creation. - * - * @param acceleratorType the acceleratorType value to set. - * @return the ManagedComputeDeploymentProperties object itself. - */ - public ManagedComputeDeploymentProperties withAcceleratorType(String acceleratorType) { - this.acceleratorType = acceleratorType; - return this; - } - - /** - * Get the versionUpgradeOption property: Template auto-upgrade policy. Defaults to OnceNewDefaultVersionAvailable. - * - * @return the versionUpgradeOption value. - */ - public DeploymentModelVersionUpgradeOption versionUpgradeOption() { - return this.versionUpgradeOption; - } - - /** - * Set the versionUpgradeOption property: Template auto-upgrade policy. Defaults to OnceNewDefaultVersionAvailable. - * - * @param versionUpgradeOption the versionUpgradeOption value to set. - * @return the ManagedComputeDeploymentProperties object itself. - */ - public ManagedComputeDeploymentProperties - withVersionUpgradeOption(DeploymentModelVersionUpgradeOption versionUpgradeOption) { - this.versionUpgradeOption = versionUpgradeOption; - return this; - } - - /** - * Get the capabilities property: Deployment capabilities represented as key-value pairs. - * Example: { assetsV2: "true" }. - * - * @return the capabilities value. - */ - public Map capabilities() { - return this.capabilities; - } - - /** - * Get the computeId property: Foundry compute ARM resource ID for VM-backed managed compute deployments. Required - * when sku.name is VmManagedCompute; immutable after creation. - * - * @return the computeId value. - */ - public String computeId() { - return this.computeId; - } - - /** - * Set the computeId property: Foundry compute ARM resource ID for VM-backed managed compute deployments. Required - * when sku.name is VmManagedCompute; immutable after creation. - * - * @param computeId the computeId value to set. - * @return the ManagedComputeDeploymentProperties object itself. - */ - public ManagedComputeDeploymentProperties withComputeId(String computeId) { - this.computeId = computeId; - return this; - } - - /** - * Get the priority property: Scheduling priority for VM-backed managed compute deployments. Immutable after - * creation. - * - * @return the priority value. - */ - public String priority() { - return this.priority; - } - - /** - * Set the priority property: Scheduling priority for VM-backed managed compute deployments. Immutable after - * creation. - * - * @param priority the priority value to set. - * @return the ManagedComputeDeploymentProperties object itself. - */ - public ManagedComputeDeploymentProperties withPriority(String priority) { - this.priority = priority; - return this; - } - - /** - * Get the acceleratorsPerInstance property: Read-only. Number of accelerators (GPUs) consumed by each model - * instance, sourced from the deployment template. - * - * @return the acceleratorsPerInstance value. - */ - public Integer acceleratorsPerInstance() { - return this.acceleratorsPerInstance; - } - - /** - * Get the totalAccelerators property: Read-only. Total accelerators allocated: sku.capacity (instances) x - * acceleratorsPerInstance. - * - * @return the totalAccelerators value. - */ - public Integer totalAccelerators() { - return this.totalAccelerators; - } - - /** - * Get the provisioningState property: Read-only. Current provisioning state. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the provisioningDetails property: Read-only. Status message and timestamp from the last provisioning - * operation. - * - * @return the provisioningDetails value. - */ - public ManagedComputeDeploymentProvisioningDetails provisioningDetails() { - return this.provisioningDetails; - } - - /** - * Get the routes property: Read-only. Inference route paths relative to the account endpoint. Populated when - * provisioningState is Succeeded. - * - * @return the routes value. - */ - public ManagedComputeDeploymentRoutes routes() { - return this.routes; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("model", this.model); - jsonWriter.writeStringField("deploymentTemplate", this.deploymentTemplate); - jsonWriter.writeStringField("acceleratorType", this.acceleratorType); - jsonWriter.writeStringField("versionUpgradeOption", - this.versionUpgradeOption == null ? null : this.versionUpgradeOption.toString()); - jsonWriter.writeStringField("computeId", this.computeId); - jsonWriter.writeStringField("priority", this.priority); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ManagedComputeDeploymentProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedComputeDeploymentProperties 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 ManagedComputeDeploymentProperties. - */ - public static ManagedComputeDeploymentProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedComputeDeploymentProperties deserializedManagedComputeDeploymentProperties - = new ManagedComputeDeploymentProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("model".equals(fieldName)) { - deserializedManagedComputeDeploymentProperties.model = reader.getString(); - } else if ("deploymentTemplate".equals(fieldName)) { - deserializedManagedComputeDeploymentProperties.deploymentTemplate = reader.getString(); - } else if ("acceleratorType".equals(fieldName)) { - deserializedManagedComputeDeploymentProperties.acceleratorType = reader.getString(); - } else if ("versionUpgradeOption".equals(fieldName)) { - deserializedManagedComputeDeploymentProperties.versionUpgradeOption - = DeploymentModelVersionUpgradeOption.fromString(reader.getString()); - } else if ("capabilities".equals(fieldName)) { - Map capabilities = reader.readMap(reader1 -> reader1.getString()); - deserializedManagedComputeDeploymentProperties.capabilities = capabilities; - } else if ("computeId".equals(fieldName)) { - deserializedManagedComputeDeploymentProperties.computeId = reader.getString(); - } else if ("priority".equals(fieldName)) { - deserializedManagedComputeDeploymentProperties.priority = reader.getString(); - } else if ("acceleratorsPerInstance".equals(fieldName)) { - deserializedManagedComputeDeploymentProperties.acceleratorsPerInstance - = reader.getNullable(JsonReader::getInt); - } else if ("totalAccelerators".equals(fieldName)) { - deserializedManagedComputeDeploymentProperties.totalAccelerators - = reader.getNullable(JsonReader::getInt); - } else if ("provisioningState".equals(fieldName)) { - deserializedManagedComputeDeploymentProperties.provisioningState - = ProvisioningState.fromString(reader.getString()); - } else if ("provisioningDetails".equals(fieldName)) { - deserializedManagedComputeDeploymentProperties.provisioningDetails - = ManagedComputeDeploymentProvisioningDetails.fromJson(reader); - } else if ("routes".equals(fieldName)) { - deserializedManagedComputeDeploymentProperties.routes - = ManagedComputeDeploymentRoutes.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedManagedComputeDeploymentProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeploymentProvisioningDetails.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeploymentProvisioningDetails.java deleted file mode 100644 index 7da878c5d6a6..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeploymentProvisioningDetails.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Provisioning status details for a managed compute deployment. - */ -@Immutable -public final class ManagedComputeDeploymentProvisioningDetails - implements JsonSerializable { - /* - * A human-readable status message from the last provisioning operation. - */ - private String message; - - /* - * Timestamp of the last provisioning operation. - */ - private OffsetDateTime lastOperationTimestamp; - - /** - * Creates an instance of ManagedComputeDeploymentProvisioningDetails class. - */ - private ManagedComputeDeploymentProvisioningDetails() { - } - - /** - * Get the message property: A human-readable status message from the last provisioning operation. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Get the lastOperationTimestamp property: Timestamp of the last provisioning operation. - * - * @return the lastOperationTimestamp value. - */ - public OffsetDateTime lastOperationTimestamp() { - return this.lastOperationTimestamp; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("message", this.message); - jsonWriter.writeStringField("lastOperationTimestamp", - this.lastOperationTimestamp == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastOperationTimestamp)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ManagedComputeDeploymentProvisioningDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedComputeDeploymentProvisioningDetails 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 ManagedComputeDeploymentProvisioningDetails. - */ - public static ManagedComputeDeploymentProvisioningDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedComputeDeploymentProvisioningDetails deserializedManagedComputeDeploymentProvisioningDetails - = new ManagedComputeDeploymentProvisioningDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("message".equals(fieldName)) { - deserializedManagedComputeDeploymentProvisioningDetails.message = reader.getString(); - } else if ("lastOperationTimestamp".equals(fieldName)) { - deserializedManagedComputeDeploymentProvisioningDetails.lastOperationTimestamp = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedManagedComputeDeploymentProvisioningDetails; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeploymentRoutes.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeploymentRoutes.java deleted file mode 100644 index e6d208af10ff..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeploymentRoutes.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Inference route paths for a managed compute deployment, relative to the account endpoint. - * Populated when provisioningState is Succeeded. - */ -@Immutable -public final class ManagedComputeDeploymentRoutes implements JsonSerializable { - /* - * Relative path to the chat completions scoring endpoint. - */ - private String chatCompletionsScoringPath; - - /* - * Relative path to the Swagger/OpenAPI endpoint. - */ - private String swagger; - - /* - * Relative path to the messages API scoring endpoint. - */ - private String messagesApiScoringPath; - - /** - * Creates an instance of ManagedComputeDeploymentRoutes class. - */ - private ManagedComputeDeploymentRoutes() { - } - - /** - * Get the chatCompletionsScoringPath property: Relative path to the chat completions scoring endpoint. - * - * @return the chatCompletionsScoringPath value. - */ - public String chatCompletionsScoringPath() { - return this.chatCompletionsScoringPath; - } - - /** - * Get the swagger property: Relative path to the Swagger/OpenAPI endpoint. - * - * @return the swagger value. - */ - public String swagger() { - return this.swagger; - } - - /** - * Get the messagesApiScoringPath property: Relative path to the messages API scoring endpoint. - * - * @return the messagesApiScoringPath value. - */ - public String messagesApiScoringPath() { - return this.messagesApiScoringPath; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("chatCompletionsScoringPath", this.chatCompletionsScoringPath); - jsonWriter.writeStringField("swagger", this.swagger); - jsonWriter.writeStringField("messagesApiScoringPath", this.messagesApiScoringPath); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ManagedComputeDeploymentRoutes from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedComputeDeploymentRoutes 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 ManagedComputeDeploymentRoutes. - */ - public static ManagedComputeDeploymentRoutes fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedComputeDeploymentRoutes deserializedManagedComputeDeploymentRoutes - = new ManagedComputeDeploymentRoutes(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("chatCompletionsScoringPath".equals(fieldName)) { - deserializedManagedComputeDeploymentRoutes.chatCompletionsScoringPath = reader.getString(); - } else if ("swagger".equals(fieldName)) { - deserializedManagedComputeDeploymentRoutes.swagger = reader.getString(); - } else if ("messagesApiScoringPath".equals(fieldName)) { - deserializedManagedComputeDeploymentRoutes.messagesApiScoringPath = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedManagedComputeDeploymentRoutes; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeployments.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeployments.java deleted file mode 100644 index eaecec8a1174..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeDeployments.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 ManagedComputeDeployments. - */ -public interface ManagedComputeDeployments { - /** - * Gets the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @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 specified managed compute deployment associated with the Cognitive Services account along with - * {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, - String deploymentName, Context context); - - /** - * Gets the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 managed compute deployment associated with the Cognitive Services account. - */ - ManagedComputeDeployment get(String resourceGroupName, String accountName, String deploymentName); - - /** - * Deletes the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String deploymentName); - - /** - * Deletes the specified managed compute deployment associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the managed compute deployment associated with the Cognitive Services Account. - * @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 accountName, String deploymentName, Context context); - - /** - * Gets the managed compute deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the managed compute deployments associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the managed compute deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 managed compute deployments associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, Context context); - - /** - * Gets the specified managed compute deployment associated with the Cognitive Services account. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified managed compute deployment associated with the Cognitive Services account along with - * {@link Response}. - */ - ManagedComputeDeployment getById(String id); - - /** - * Gets the specified managed compute deployment associated with the Cognitive Services account. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified managed compute deployment associated with the Cognitive Services account along with - * {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes the specified managed compute deployment associated with the Cognitive Services account. - * - * @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 the specified managed compute deployment associated with the Cognitive Services account. - * - * @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 ManagedComputeDeployment resource. - * - * @param name resource name. - * @return the first stage of the new ManagedComputeDeployment definition. - */ - ManagedComputeDeployment.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeUsage.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeUsage.java deleted file mode 100644 index a5fba93e09de..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeUsage.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedComputeUsageInner; -import java.util.List; - -/** - * An immutable client-side representation of ManagedComputeUsage. - */ -public interface ManagedComputeUsage { - /** - * Gets the id property: Fully qualified resource ID for the managed compute usage. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name information for the metric. - * - * @return the name value. - */ - MetricName name(); - - /** - * Gets the type property: The resource type. - * - * @return the type value. - */ - String type(); - - /** - * Gets the unit property: The unit of the metric. - * - * @return the unit value. - */ - UnitType unit(); - - /** - * Gets the limit property: Maximum value for this metric. - * - * @return the limit value. - */ - Double limit(); - - /** - * Gets the currentValue property: Current value for this metric. - * - * @return the currentValue value. - */ - Double currentValue(); - - /** - * Gets the offerScope property: Offer scope (e.g., 'Global', 'Datazone-US'). - * - * @return the offerScope value. - */ - String offerScope(); - - /** - * Gets the deployments property: Deployments consuming this managed compute quota. - * - * @return the deployments value. - */ - List deployments(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedComputeUsageInner object. - * - * @return the inner object. - */ - ManagedComputeUsageInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeUsagesOperationGroups.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeUsagesOperationGroups.java deleted file mode 100644 index e5af71c3cb9e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedComputeUsagesOperationGroups.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of ManagedComputeUsagesOperationGroups. - */ -public interface ManagedComputeUsagesOperationGroups { - /** - * List managed compute quota usages for a subscription and location. - * - * @param location The location name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed compute quota entries as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String location); - - /** - * List managed compute quota usages for a subscription and location. - * - * @param location The location 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 list of managed compute quota entries as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String location, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedIdentityAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedIdentityAuthTypeConnectionProperties.java deleted file mode 100644 index f92aa79cab38..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedIdentityAuthTypeConnectionProperties.java +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * The ManagedIdentityAuthTypeConnectionProperties model. - */ -@Fluent -public final class ManagedIdentityAuthTypeConnectionProperties extends ConnectionPropertiesV2 { - /* - * Authentication type of the connection target - */ - private ConnectionAuthType authType = ConnectionAuthType.MANAGED_IDENTITY; - - /* - * The credentials property. - */ - private ConnectionManagedIdentity credentials; - - /** - * Creates an instance of ManagedIdentityAuthTypeConnectionProperties class. - */ - public ManagedIdentityAuthTypeConnectionProperties() { - } - - /** - * Get the authType property: Authentication type of the connection target. - * - * @return the authType value. - */ - @Override - public ConnectionAuthType authType() { - return this.authType; - } - - /** - * Get the credentials property: The credentials property. - * - * @return the credentials value. - */ - public ConnectionManagedIdentity credentials() { - return this.credentials; - } - - /** - * Set the credentials property: The credentials property. - * - * @param credentials the credentials value to set. - * @return the ManagedIdentityAuthTypeConnectionProperties object itself. - */ - public ManagedIdentityAuthTypeConnectionProperties withCredentials(ConnectionManagedIdentity credentials) { - this.credentials = credentials; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedIdentityAuthTypeConnectionProperties withCategory(ConnectionCategory category) { - super.withCategory(category); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedIdentityAuthTypeConnectionProperties withError(String error) { - super.withError(error); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedIdentityAuthTypeConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { - super.withExpiryTime(expiryTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedIdentityAuthTypeConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { - super.withIsSharedToAll(isSharedToAll); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedIdentityAuthTypeConnectionProperties withMetadata(Map metadata) { - super.withMetadata(metadata); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedIdentityAuthTypeConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { - super.withPeRequirement(peRequirement); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedIdentityAuthTypeConnectionProperties withPeStatus(ManagedPEStatus peStatus) { - super.withPeStatus(peStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedIdentityAuthTypeConnectionProperties withSharedUserList(List sharedUserList) { - super.withSharedUserList(sharedUserList); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedIdentityAuthTypeConnectionProperties withTarget(String target) { - super.withTarget(target); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedIdentityAuthTypeConnectionProperties - withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { - super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("category", category() == null ? null : category().toString()); - jsonWriter.writeStringField("error", error()); - jsonWriter.writeStringField("expiryTime", - expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); - jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); - jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); - jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); - jsonWriter.writeArrayField("sharedUserList", sharedUserList(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("target", target()); - jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); - jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); - jsonWriter.writeJsonField("credentials", this.credentials); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ManagedIdentityAuthTypeConnectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedIdentityAuthTypeConnectionProperties 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 ManagedIdentityAuthTypeConnectionProperties. - */ - public static ManagedIdentityAuthTypeConnectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedIdentityAuthTypeConnectionProperties deserializedManagedIdentityAuthTypeConnectionProperties - = new ManagedIdentityAuthTypeConnectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("category".equals(fieldName)) { - deserializedManagedIdentityAuthTypeConnectionProperties - .withCategory(ConnectionCategory.fromString(reader.getString())); - } else if ("createdByWorkspaceArmId".equals(fieldName)) { - deserializedManagedIdentityAuthTypeConnectionProperties - .withCreatedByWorkspaceArmId(reader.getString()); - } else if ("error".equals(fieldName)) { - deserializedManagedIdentityAuthTypeConnectionProperties.withError(reader.getString()); - } else if ("expiryTime".equals(fieldName)) { - deserializedManagedIdentityAuthTypeConnectionProperties.withExpiryTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("group".equals(fieldName)) { - deserializedManagedIdentityAuthTypeConnectionProperties - .withGroup(ConnectionGroup.fromString(reader.getString())); - } else if ("isSharedToAll".equals(fieldName)) { - deserializedManagedIdentityAuthTypeConnectionProperties - .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); - } else if ("metadata".equals(fieldName)) { - Map metadata = reader.readMap(reader1 -> reader1.getString()); - deserializedManagedIdentityAuthTypeConnectionProperties.withMetadata(metadata); - } else if ("peRequirement".equals(fieldName)) { - deserializedManagedIdentityAuthTypeConnectionProperties - .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); - } else if ("peStatus".equals(fieldName)) { - deserializedManagedIdentityAuthTypeConnectionProperties - .withPeStatus(ManagedPEStatus.fromString(reader.getString())); - } else if ("sharedUserList".equals(fieldName)) { - List sharedUserList = reader.readArray(reader1 -> reader1.getString()); - deserializedManagedIdentityAuthTypeConnectionProperties.withSharedUserList(sharedUserList); - } else if ("target".equals(fieldName)) { - deserializedManagedIdentityAuthTypeConnectionProperties.withTarget(reader.getString()); - } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { - deserializedManagedIdentityAuthTypeConnectionProperties - .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); - } else if ("authType".equals(fieldName)) { - deserializedManagedIdentityAuthTypeConnectionProperties.authType - = ConnectionAuthType.fromString(reader.getString()); - } else if ("credentials".equals(fieldName)) { - deserializedManagedIdentityAuthTypeConnectionProperties.credentials - = ConnectionManagedIdentity.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedManagedIdentityAuthTypeConnectionProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkKind.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkKind.java deleted file mode 100644 index 379e71718083..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkKind.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The Kind of the managed network. Users can switch from V1 to V2 for granular access controls, but cannot switch back - * to V1 once V2 is enabled. - */ -public final class ManagedNetworkKind extends ExpandableStringEnum { - /** - * Static value V1 for ManagedNetworkKind. - */ - public static final ManagedNetworkKind V1 = fromString("V1"); - - /** - * Static value V2 for ManagedNetworkKind. - */ - public static final ManagedNetworkKind V2 = fromString("V2"); - - /** - * Creates a new instance of ManagedNetworkKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ManagedNetworkKind() { - } - - /** - * Creates or finds a ManagedNetworkKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding ManagedNetworkKind. - */ - public static ManagedNetworkKind fromString(String name) { - return fromString(name, ManagedNetworkKind.class); - } - - /** - * Gets known ManagedNetworkKind values. - * - * @return known ManagedNetworkKind values. - */ - public static Collection values() { - return values(ManagedNetworkKind.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisionOptions.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisionOptions.java deleted file mode 100644 index 1e72e31669aa..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisionOptions.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Managed Network Provisioning options for managed network of a cognitive services account. - */ -@Immutable -public final class ManagedNetworkProvisionOptions implements JsonSerializable { - /** - * Creates an instance of ManagedNetworkProvisionOptions class. - */ - public ManagedNetworkProvisionOptions() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ManagedNetworkProvisionOptions from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedNetworkProvisionOptions 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 ManagedNetworkProvisionOptions. - */ - public static ManagedNetworkProvisionOptions fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedNetworkProvisionOptions deserializedManagedNetworkProvisionOptions - = new ManagedNetworkProvisionOptions(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - reader.skipChildren(); - } - - return deserializedManagedNetworkProvisionOptions; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisionStatus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisionStatus.java deleted file mode 100644 index cea1aa190f6d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisionStatus.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; - -/** - * An immutable client-side representation of ManagedNetworkProvisionStatus. - */ -public interface ManagedNetworkProvisionStatus { - /** - * Gets the status property: Status for the managed network of a cognitive services account. - * - * @return the status value. - */ - ManagedNetworkStatus status(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner - * object. - * - * @return the inner object. - */ - ManagedNetworkProvisionStatusInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisioningState.java deleted file mode 100644 index 23e2b46cf7e5..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisioningState.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for ManagedNetworkProvisioningState. - */ -public final class ManagedNetworkProvisioningState extends ExpandableStringEnum { - /** - * Static value Deferred for ManagedNetworkProvisioningState. - */ - public static final ManagedNetworkProvisioningState DEFERRED = fromString("Deferred"); - - /** - * Static value Updating for ManagedNetworkProvisioningState. - */ - public static final ManagedNetworkProvisioningState UPDATING = fromString("Updating"); - - /** - * Static value Succeeded for ManagedNetworkProvisioningState. - */ - public static final ManagedNetworkProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Failed for ManagedNetworkProvisioningState. - */ - public static final ManagedNetworkProvisioningState FAILED = fromString("Failed"); - - /** - * Static value Deleting for ManagedNetworkProvisioningState. - */ - public static final ManagedNetworkProvisioningState DELETING = fromString("Deleting"); - - /** - * Static value Deleted for ManagedNetworkProvisioningState. - */ - public static final ManagedNetworkProvisioningState DELETED = fromString("Deleted"); - - /** - * Creates a new instance of ManagedNetworkProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ManagedNetworkProvisioningState() { - } - - /** - * Creates or finds a ManagedNetworkProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ManagedNetworkProvisioningState. - */ - public static ManagedNetworkProvisioningState fromString(String name) { - return fromString(name, ManagedNetworkProvisioningState.class); - } - - /** - * Gets known ManagedNetworkProvisioningState values. - * - * @return known ManagedNetworkProvisioningState values. - */ - public static Collection values() { - return values(ManagedNetworkProvisioningState.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisions.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisions.java deleted file mode 100644 index 96e549a5fc92..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisions.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.Context; - -/** - * Resource collection API of ManagedNetworkProvisions. - */ -public interface ManagedNetworkProvisions { - /** - * Provisions the managed network of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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. - */ - ManagedNetworkProvisionStatus provisionManagedNetwork(String resourceGroupName, String accountName, - String managedNetworkName); - - /** - * Provisions the managed network of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body Managed Network Provisioning Options for a cognitive services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - ManagedNetworkProvisionStatus provisionManagedNetwork(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkProvisionOptions body, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettings.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettings.java deleted file mode 100644 index 7df62878fcea..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettings.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsInner; -import java.util.Map; - -/** - * An immutable client-side representation of ManagedNetworkSettings. - */ -public interface ManagedNetworkSettings { - /** - * Gets the isolationMode property: Isolation mode for the managed network of a cognitive services account. - * - * @return the isolationMode value. - */ - IsolationMode isolationMode(); - - /** - * Gets the networkId property: The networkId property. - * - * @return the networkId value. - */ - String networkId(); - - /** - * Gets the outboundRules property: Dictionary of <OutboundRule>. - * - * @return the outboundRules value. - */ - Map outboundRules(); - - /** - * Gets the status property: Status of the Provisioning for the managed network of a cognitive services account. - * - * @return the status value. - */ - ManagedNetworkProvisionStatus status(); - - /** - * Gets the firewallSku property: Firewall Sku used for FQDN Rules. - * - * @return the firewallSku value. - */ - FirewallSku firewallSku(); - - /** - * Gets the managedNetworkKind property: The Kind of the managed network. Users can switch from V1 to V2 for - * granular access controls, but cannot switch back to V1 once V2 is enabled. - * - * @return the managedNetworkKind value. - */ - ManagedNetworkKind managedNetworkKind(); - - /** - * Gets the firewallPublicIpAddress property: Public IP address assigned to the Azure Firewall. - * - * @return the firewallPublicIpAddress value. - */ - String firewallPublicIpAddress(); - - /** - * Gets the provisioningState property: The provisioning state of the managed network settings. - * - * @return the provisioningState value. - */ - ManagedNetworkProvisioningState provisioningState(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsInner object. - * - * @return the inner object. - */ - ManagedNetworkSettingsInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsBasicResource.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsBasicResource.java deleted file mode 100644 index 6092f8edbc08..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsBasicResource.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsBasicResourceInner; - -/** - * An immutable client-side representation of ManagedNetworkSettingsBasicResource. - */ -public interface ManagedNetworkSettingsBasicResource { - /** - * 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: Managed Network settings for a cognitive services account. - * - * @return the properties value. - */ - ManagedNetworkSettings 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.cognitiveservices.fluent.models.ManagedNetworkSettingsBasicResourceInner - * object. - * - * @return the inner object. - */ - ManagedNetworkSettingsBasicResourceInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsEx.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsEx.java deleted file mode 100644 index 0f7868422b53..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsEx.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsInner; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * The ManagedNetworkSettingsEx model. - */ -@Fluent -public final class ManagedNetworkSettingsEx extends ManagedNetworkSettingsInner { - /* - * The changeableIsolationModes property. - */ - private List changeableIsolationModes; - - /* - * The provisioning state of the managed network settings. - */ - private ManagedNetworkProvisioningState provisioningState; - - /* - * Public IP address assigned to the Azure Firewall. - */ - private String firewallPublicIpAddress; - - /* - * The networkId property. - */ - private String networkId; - - /** - * Creates an instance of ManagedNetworkSettingsEx class. - */ - public ManagedNetworkSettingsEx() { - } - - /** - * Get the changeableIsolationModes property: The changeableIsolationModes property. - * - * @return the changeableIsolationModes value. - */ - public List changeableIsolationModes() { - return this.changeableIsolationModes; - } - - /** - * Get the provisioningState property: The provisioning state of the managed network settings. - * - * @return the provisioningState value. - */ - @Override - public ManagedNetworkProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the firewallPublicIpAddress property: Public IP address assigned to the Azure Firewall. - * - * @return the firewallPublicIpAddress value. - */ - @Override - public String firewallPublicIpAddress() { - return this.firewallPublicIpAddress; - } - - /** - * Get the networkId property: The networkId property. - * - * @return the networkId value. - */ - @Override - public String networkId() { - return this.networkId; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedNetworkSettingsEx withIsolationMode(IsolationMode isolationMode) { - super.withIsolationMode(isolationMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedNetworkSettingsEx withOutboundRules(Map outboundRules) { - super.withOutboundRules(outboundRules); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedNetworkSettingsEx withStatus(ManagedNetworkProvisionStatusInner status) { - super.withStatus(status); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedNetworkSettingsEx withFirewallSku(FirewallSku firewallSku) { - super.withFirewallSku(firewallSku); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ManagedNetworkSettingsEx withManagedNetworkKind(ManagedNetworkKind managedNetworkKind) { - super.withManagedNetworkKind(managedNetworkKind); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("isolationMode", isolationMode() == null ? null : isolationMode().toString()); - jsonWriter.writeMapField("outboundRules", outboundRules(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("status", status()); - jsonWriter.writeStringField("firewallSku", firewallSku() == null ? null : firewallSku().toString()); - jsonWriter.writeStringField("managedNetworkKind", - managedNetworkKind() == null ? null : managedNetworkKind().toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ManagedNetworkSettingsEx from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedNetworkSettingsEx 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 ManagedNetworkSettingsEx. - */ - public static ManagedNetworkSettingsEx fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedNetworkSettingsEx deserializedManagedNetworkSettingsEx = new ManagedNetworkSettingsEx(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("isolationMode".equals(fieldName)) { - deserializedManagedNetworkSettingsEx - .withIsolationMode(IsolationMode.fromString(reader.getString())); - } else if ("networkId".equals(fieldName)) { - deserializedManagedNetworkSettingsEx.networkId = reader.getString(); - } else if ("outboundRules".equals(fieldName)) { - Map outboundRules = reader.readMap(reader1 -> OutboundRule.fromJson(reader1)); - deserializedManagedNetworkSettingsEx.withOutboundRules(outboundRules); - } else if ("status".equals(fieldName)) { - deserializedManagedNetworkSettingsEx - .withStatus(ManagedNetworkProvisionStatusInner.fromJson(reader)); - } else if ("firewallSku".equals(fieldName)) { - deserializedManagedNetworkSettingsEx.withFirewallSku(FirewallSku.fromString(reader.getString())); - } else if ("managedNetworkKind".equals(fieldName)) { - deserializedManagedNetworkSettingsEx - .withManagedNetworkKind(ManagedNetworkKind.fromString(reader.getString())); - } else if ("firewallPublicIpAddress".equals(fieldName)) { - deserializedManagedNetworkSettingsEx.firewallPublicIpAddress = reader.getString(); - } else if ("provisioningState".equals(fieldName)) { - deserializedManagedNetworkSettingsEx.provisioningState - = ManagedNetworkProvisioningState.fromString(reader.getString()); - } else if ("changeableIsolationModes".equals(fieldName)) { - List changeableIsolationModes - = reader.readArray(reader1 -> IsolationMode.fromString(reader1.getString())); - deserializedManagedNetworkSettingsEx.changeableIsolationModes = changeableIsolationModes; - } else { - reader.skipChildren(); - } - } - - return deserializedManagedNetworkSettingsEx; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsOperations.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsOperations.java deleted file mode 100644 index 97f78b95e50b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsOperations.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 ManagedNetworkSettingsOperations. - */ -public interface ManagedNetworkSettingsOperations { - /** - * Get API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @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 aPI for managed network settings of a cognitive services account along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, - String accountName, String managedNetworkName, Context context); - - /** - * Get API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return aPI for managed network settings of a cognitive services account. - */ - ManagedNetworkSettingsPropertiesBasicResource get(String resourceGroupName, String accountName, - String managedNetworkName); - - /** - * Delete API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String managedNetworkName); - - /** - * Delete API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @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 accountName, String managedNetworkName, Context context); - - /** - * List API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed networks of a cognitive services account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName); - - /** - * List API for managed network settings of a cognitive services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed networks of a cognitive services account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, - Context context); - - /** - * Get API for managed network settings of a cognitive services account. - * - * @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 aPI for managed network settings of a cognitive services account along with {@link Response}. - */ - ManagedNetworkSettingsPropertiesBasicResource getById(String id); - - /** - * Get API for managed network settings of a cognitive services account. - * - * @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 aPI for managed network settings of a cognitive services account along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete API for managed network settings of a cognitive services account. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete API for managed network settings of a cognitive services account. - * - * @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 ManagedNetworkSettingsPropertiesBasicResource resource. - * - * @param name resource name. - * @return the first stage of the new ManagedNetworkSettingsPropertiesBasicResource definition. - */ - ManagedNetworkSettingsPropertiesBasicResource.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsProperties.java deleted file mode 100644 index 13409f37ee89..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsProperties.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 properties of the managed network settings of a cognitive services account. - */ -@Fluent -public final class ManagedNetworkSettingsProperties implements JsonSerializable { - /* - * Managed Network settings for a cognitive services account. - */ - private ManagedNetworkSettingsEx managedNetwork; - - /* - * The current deployment state of the managed network resource. The provisioningState is to indicate states for - * resource provisioning. - */ - private ManagedNetworkProvisioningState provisioningState; - - /** - * Creates an instance of ManagedNetworkSettingsProperties class. - */ - public ManagedNetworkSettingsProperties() { - } - - /** - * Get the managedNetwork property: Managed Network settings for a cognitive services account. - * - * @return the managedNetwork value. - */ - public ManagedNetworkSettingsEx managedNetwork() { - return this.managedNetwork; - } - - /** - * Set the managedNetwork property: Managed Network settings for a cognitive services account. - * - * @param managedNetwork the managedNetwork value to set. - * @return the ManagedNetworkSettingsProperties object itself. - */ - public ManagedNetworkSettingsProperties withManagedNetwork(ManagedNetworkSettingsEx managedNetwork) { - this.managedNetwork = managedNetwork; - return this; - } - - /** - * Get the provisioningState property: The current deployment state of the managed network resource. The - * provisioningState is to indicate states for resource provisioning. - * - * @return the provisioningState value. - */ - public ManagedNetworkProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("managedNetwork", this.managedNetwork); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ManagedNetworkSettingsProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedNetworkSettingsProperties 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 ManagedNetworkSettingsProperties. - */ - public static ManagedNetworkSettingsProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedNetworkSettingsProperties deserializedManagedNetworkSettingsProperties - = new ManagedNetworkSettingsProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("managedNetwork".equals(fieldName)) { - deserializedManagedNetworkSettingsProperties.managedNetwork - = ManagedNetworkSettingsEx.fromJson(reader); - } else if ("provisioningState".equals(fieldName)) { - deserializedManagedNetworkSettingsProperties.provisioningState - = ManagedNetworkProvisioningState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedManagedNetworkSettingsProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsPropertiesBasicResource.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsPropertiesBasicResource.java deleted file mode 100644 index 0db311c69932..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsPropertiesBasicResource.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsPropertiesBasicResourceInner; - -/** - * An immutable client-side representation of ManagedNetworkSettingsPropertiesBasicResource. - */ -public interface ManagedNetworkSettingsPropertiesBasicResource { - /** - * 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: The properties of the managed network settings of a cognitive services account. - * - * @return the properties value. - */ - ManagedNetworkSettingsProperties properties(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner - * com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsPropertiesBasicResourceInner - * object. - * - * @return the inner object. - */ - ManagedNetworkSettingsPropertiesBasicResourceInner innerModel(); - - /** - * The entirety of the ManagedNetworkSettingsPropertiesBasicResource definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The ManagedNetworkSettingsPropertiesBasicResource definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the ManagedNetworkSettingsPropertiesBasicResource definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the ManagedNetworkSettingsPropertiesBasicResource definition allowing to specify parent - * resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, accountName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @return the next definition stage. - */ - WithCreate withExistingAccount(String resourceGroupName, String accountName); - } - - /** - * The stage of the ManagedNetworkSettingsPropertiesBasicResource definition which contains all the minimum - * required properties for the resource to be created, but also allows for any other optional properties to be - * specified. - */ - interface WithCreate extends DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - ManagedNetworkSettingsPropertiesBasicResource create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - ManagedNetworkSettingsPropertiesBasicResource create(Context context); - } - - /** - * The stage of the ManagedNetworkSettingsPropertiesBasicResource definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: The properties of the managed network settings of a cognitive services - * account.. - * - * @param properties The properties of the managed network settings of a cognitive services account. - * @return the next definition stage. - */ - WithCreate withProperties(ManagedNetworkSettingsProperties properties); - } - } - - /** - * Begins update for the ManagedNetworkSettingsPropertiesBasicResource resource. - * - * @return the stage of resource update. - */ - ManagedNetworkSettingsPropertiesBasicResource.Update update(); - - /** - * The template for ManagedNetworkSettingsPropertiesBasicResource update. - */ - interface Update extends UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - ManagedNetworkSettingsPropertiesBasicResource apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - ManagedNetworkSettingsPropertiesBasicResource apply(Context context); - } - - /** - * The ManagedNetworkSettingsPropertiesBasicResource update stages. - */ - interface UpdateStages { - /** - * The stage of the ManagedNetworkSettingsPropertiesBasicResource update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: The properties of the managed network settings of a cognitive services - * account.. - * - * @param properties The properties of the managed network settings of a cognitive services account. - * @return the next definition stage. - */ - Update withProperties(ManagedNetworkSettingsProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - ManagedNetworkSettingsPropertiesBasicResource refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - ManagedNetworkSettingsPropertiesBasicResource refresh(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkStatus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkStatus.java deleted file mode 100644 index 5b450b418d63..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkStatus.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Status for the managed network of a cognitive services account. - */ -public final class ManagedNetworkStatus extends ExpandableStringEnum { - /** - * Static value Inactive for ManagedNetworkStatus. - */ - public static final ManagedNetworkStatus INACTIVE = fromString("Inactive"); - - /** - * Static value Active for ManagedNetworkStatus. - */ - public static final ManagedNetworkStatus ACTIVE = fromString("Active"); - - /** - * Creates a new instance of ManagedNetworkStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ManagedNetworkStatus() { - } - - /** - * Creates or finds a ManagedNetworkStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding ManagedNetworkStatus. - */ - public static ManagedNetworkStatus fromString(String name) { - return fromString(name, ManagedNetworkStatus.class); - } - - /** - * Gets known ManagedNetworkStatus values. - * - * @return known ManagedNetworkStatus values. - */ - public static Collection values() { - return values(ManagedNetworkStatus.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPERequirement.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPERequirement.java deleted file mode 100644 index c50698875302..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPERequirement.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for ManagedPERequirement. - */ -public final class ManagedPERequirement extends ExpandableStringEnum { - /** - * Static value Required for ManagedPERequirement. - */ - public static final ManagedPERequirement REQUIRED = fromString("Required"); - - /** - * Static value NotRequired for ManagedPERequirement. - */ - public static final ManagedPERequirement NOT_REQUIRED = fromString("NotRequired"); - - /** - * Static value NotApplicable for ManagedPERequirement. - */ - public static final ManagedPERequirement NOT_APPLICABLE = fromString("NotApplicable"); - - /** - * Creates a new instance of ManagedPERequirement value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ManagedPERequirement() { - } - - /** - * Creates or finds a ManagedPERequirement from its string representation. - * - * @param name a name to look for. - * @return the corresponding ManagedPERequirement. - */ - public static ManagedPERequirement fromString(String name) { - return fromString(name, ManagedPERequirement.class); - } - - /** - * Gets known ManagedPERequirement values. - * - * @return known ManagedPERequirement values. - */ - public static Collection values() { - return values(ManagedPERequirement.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPEStatus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPEStatus.java deleted file mode 100644 index 54f73edae10d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPEStatus.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for ManagedPEStatus. - */ -public final class ManagedPEStatus extends ExpandableStringEnum { - /** - * Static value Inactive for ManagedPEStatus. - */ - public static final ManagedPEStatus INACTIVE = fromString("Inactive"); - - /** - * Static value Active for ManagedPEStatus. - */ - public static final ManagedPEStatus ACTIVE = fromString("Active"); - - /** - * Static value NotApplicable for ManagedPEStatus. - */ - public static final ManagedPEStatus NOT_APPLICABLE = fromString("NotApplicable"); - - /** - * Creates a new instance of ManagedPEStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ManagedPEStatus() { - } - - /** - * Creates or finds a ManagedPEStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding ManagedPEStatus. - */ - public static ManagedPEStatus fromString(String name) { - return fromString(name, ManagedPEStatus.class); - } - - /** - * Gets known ManagedPEStatus values. - * - * @return known ManagedPEStatus values. - */ - public static Collection values() { - return values(ManagedPEStatus.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/MetricName.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/MetricName.java deleted file mode 100644 index 4c5bcda658e7..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/MetricName.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * A metric name. - */ -@Immutable -public final class MetricName implements JsonSerializable { - /* - * The name of the metric. - */ - private String value; - - /* - * The friendly name of the metric. - */ - private String localizedValue; - - /** - * Creates an instance of MetricName class. - */ - private MetricName() { - } - - /** - * Get the value property: The name of the metric. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Get the localizedValue property: The friendly name of the metric. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.localizedValue; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("value", this.value); - jsonWriter.writeStringField("localizedValue", this.localizedValue); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MetricName from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MetricName 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 MetricName. - */ - public static MetricName fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MetricName deserializedMetricName = new MetricName(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - deserializedMetricName.value = reader.getString(); - } else if ("localizedValue".equals(fieldName)) { - deserializedMetricName.localizedValue = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedMetricName; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Model.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Model.java deleted file mode 100644 index fc0883ae2a9a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Model.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelInner; - -/** - * An immutable client-side representation of Model. - */ -public interface Model { - /** - * Gets the model property: Cognitive Services account Model. - * - * @return the model value. - */ - AccountModel model(); - - /** - * Gets the kind property: The kind (type) of cognitive service account. - * - * @return the kind value. - */ - String kind(); - - /** - * Gets the skuName property: The name of SKU. - * - * @return the skuName value. - */ - String skuName(); - - /** - * Gets the description property: The description of the model. - * - * @return the description value. - */ - String description(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.ModelInner object. - * - * @return the inner object. - */ - ModelInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacities.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacities.java deleted file mode 100644 index 03ce548aa724..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacities.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of ModelCapacities. - */ -public interface ModelCapacities { - /** - * List ModelCapacities. - * - * @param modelFormat The format of the Model. - * @param modelName The name of the Model. - * @param modelVersion The version of the Model. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String modelFormat, String modelName, String modelVersion); - - /** - * List ModelCapacities. - * - * @param modelFormat The format of the Model. - * @param modelName The name of the Model. - * @param modelVersion The version of the Model. - * @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 cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String modelFormat, String modelName, String modelVersion, - Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityCalculatorWorkload.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityCalculatorWorkload.java deleted file mode 100644 index 85fa708e798a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityCalculatorWorkload.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Model Capacity Calculator Workload. - */ -@Fluent -public final class ModelCapacityCalculatorWorkload implements JsonSerializable { - /* - * Request per minute. - */ - private Long requestPerMinute; - - /* - * Dictionary, Model Capacity Calculator Workload Parameters. - */ - private ModelCapacityCalculatorWorkloadRequestParam requestParameters; - - /** - * Creates an instance of ModelCapacityCalculatorWorkload class. - */ - public ModelCapacityCalculatorWorkload() { - } - - /** - * Get the requestPerMinute property: Request per minute. - * - * @return the requestPerMinute value. - */ - public Long requestPerMinute() { - return this.requestPerMinute; - } - - /** - * Set the requestPerMinute property: Request per minute. - * - * @param requestPerMinute the requestPerMinute value to set. - * @return the ModelCapacityCalculatorWorkload object itself. - */ - public ModelCapacityCalculatorWorkload withRequestPerMinute(Long requestPerMinute) { - this.requestPerMinute = requestPerMinute; - return this; - } - - /** - * Get the requestParameters property: Dictionary, Model Capacity Calculator Workload Parameters. - * - * @return the requestParameters value. - */ - public ModelCapacityCalculatorWorkloadRequestParam requestParameters() { - return this.requestParameters; - } - - /** - * Set the requestParameters property: Dictionary, Model Capacity Calculator Workload Parameters. - * - * @param requestParameters the requestParameters value to set. - * @return the ModelCapacityCalculatorWorkload object itself. - */ - public ModelCapacityCalculatorWorkload - withRequestParameters(ModelCapacityCalculatorWorkloadRequestParam requestParameters) { - this.requestParameters = requestParameters; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("requestPerMinute", this.requestPerMinute); - jsonWriter.writeJsonField("requestParameters", this.requestParameters); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ModelCapacityCalculatorWorkload from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ModelCapacityCalculatorWorkload 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 ModelCapacityCalculatorWorkload. - */ - public static ModelCapacityCalculatorWorkload fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ModelCapacityCalculatorWorkload deserializedModelCapacityCalculatorWorkload - = new ModelCapacityCalculatorWorkload(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("requestPerMinute".equals(fieldName)) { - deserializedModelCapacityCalculatorWorkload.requestPerMinute - = reader.getNullable(JsonReader::getLong); - } else if ("requestParameters".equals(fieldName)) { - deserializedModelCapacityCalculatorWorkload.requestParameters - = ModelCapacityCalculatorWorkloadRequestParam.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedModelCapacityCalculatorWorkload; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityCalculatorWorkloadRequestParam.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityCalculatorWorkloadRequestParam.java deleted file mode 100644 index 3a954f5a9528..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityCalculatorWorkloadRequestParam.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Dictionary, Model Capacity Calculator Workload Parameters. - */ -@Fluent -public final class ModelCapacityCalculatorWorkloadRequestParam - implements JsonSerializable { - /* - * Average prompt tokens. - */ - private Long avgPromptTokens; - - /* - * Average generated tokens. - */ - private Long avgGeneratedTokens; - - /** - * Creates an instance of ModelCapacityCalculatorWorkloadRequestParam class. - */ - public ModelCapacityCalculatorWorkloadRequestParam() { - } - - /** - * Get the avgPromptTokens property: Average prompt tokens. - * - * @return the avgPromptTokens value. - */ - public Long avgPromptTokens() { - return this.avgPromptTokens; - } - - /** - * Set the avgPromptTokens property: Average prompt tokens. - * - * @param avgPromptTokens the avgPromptTokens value to set. - * @return the ModelCapacityCalculatorWorkloadRequestParam object itself. - */ - public ModelCapacityCalculatorWorkloadRequestParam withAvgPromptTokens(Long avgPromptTokens) { - this.avgPromptTokens = avgPromptTokens; - return this; - } - - /** - * Get the avgGeneratedTokens property: Average generated tokens. - * - * @return the avgGeneratedTokens value. - */ - public Long avgGeneratedTokens() { - return this.avgGeneratedTokens; - } - - /** - * Set the avgGeneratedTokens property: Average generated tokens. - * - * @param avgGeneratedTokens the avgGeneratedTokens value to set. - * @return the ModelCapacityCalculatorWorkloadRequestParam object itself. - */ - public ModelCapacityCalculatorWorkloadRequestParam withAvgGeneratedTokens(Long avgGeneratedTokens) { - this.avgGeneratedTokens = avgGeneratedTokens; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("avgPromptTokens", this.avgPromptTokens); - jsonWriter.writeNumberField("avgGeneratedTokens", this.avgGeneratedTokens); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ModelCapacityCalculatorWorkloadRequestParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ModelCapacityCalculatorWorkloadRequestParam 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 ModelCapacityCalculatorWorkloadRequestParam. - */ - public static ModelCapacityCalculatorWorkloadRequestParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ModelCapacityCalculatorWorkloadRequestParam deserializedModelCapacityCalculatorWorkloadRequestParam - = new ModelCapacityCalculatorWorkloadRequestParam(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("avgPromptTokens".equals(fieldName)) { - deserializedModelCapacityCalculatorWorkloadRequestParam.avgPromptTokens - = reader.getNullable(JsonReader::getLong); - } else if ("avgGeneratedTokens".equals(fieldName)) { - deserializedModelCapacityCalculatorWorkloadRequestParam.avgGeneratedTokens - = reader.getNullable(JsonReader::getLong); - } else { - reader.skipChildren(); - } - } - - return deserializedModelCapacityCalculatorWorkloadRequestParam; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityListResultValueItem.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityListResultValueItem.java deleted file mode 100644 index eb9035da3bef..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityListResultValueItem.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelCapacityListResultValueItemInner; - -/** - * An immutable client-side representation of ModelCapacityListResultValueItem. - */ -public interface ModelCapacityListResultValueItem { - /** - * 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 location property: The location of the Model Sku Capacity. - * - * @return the location value. - */ - String location(); - - /** - * Gets the properties property: Cognitive Services account ModelSkuCapacity. - * - * @return the properties value. - */ - ModelSkuCapacityProperties 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.cognitiveservices.fluent.models.ModelCapacityListResultValueItemInner - * object. - * - * @return the inner object. - */ - ModelCapacityListResultValueItemInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelDeprecationInfo.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelDeprecationInfo.java deleted file mode 100644 index fe0685867ea8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelDeprecationInfo.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Cognitive Services account ModelDeprecationInfo. - */ -@Immutable -public final class ModelDeprecationInfo implements JsonSerializable { - /* - * The datetime of deprecation of the fineTune Model. - */ - private String fineTune; - - /* - * The datetime of deprecation of the inference Model. - */ - private String inference; - - /* - * Indicates whether the deprecation date is a confirmed planned end-of-life date or an estimated deprecation date. - * When 'Planned', the deprecation date represents a confirmed and communicated model end-of-life date. When - * 'Tentative', the deprecation date is an estimated timeline that may be subject to change. - */ - private DeprecationStatus deprecationStatus; - - /** - * Creates an instance of ModelDeprecationInfo class. - */ - private ModelDeprecationInfo() { - } - - /** - * Get the fineTune property: The datetime of deprecation of the fineTune Model. - * - * @return the fineTune value. - */ - public String fineTune() { - return this.fineTune; - } - - /** - * Get the inference property: The datetime of deprecation of the inference Model. - * - * @return the inference value. - */ - public String inference() { - return this.inference; - } - - /** - * Get the deprecationStatus property: Indicates whether the deprecation date is a confirmed planned end-of-life - * date or an estimated deprecation date. When 'Planned', the deprecation date represents a confirmed and - * communicated model end-of-life date. When 'Tentative', the deprecation date is an estimated timeline that may be - * subject to change. - * - * @return the deprecationStatus value. - */ - public DeprecationStatus deprecationStatus() { - return this.deprecationStatus; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("fineTune", this.fineTune); - jsonWriter.writeStringField("inference", this.inference); - jsonWriter.writeStringField("deprecationStatus", - this.deprecationStatus == null ? null : this.deprecationStatus.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ModelDeprecationInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ModelDeprecationInfo 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 ModelDeprecationInfo. - */ - public static ModelDeprecationInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ModelDeprecationInfo deserializedModelDeprecationInfo = new ModelDeprecationInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("fineTune".equals(fieldName)) { - deserializedModelDeprecationInfo.fineTune = reader.getString(); - } else if ("inference".equals(fieldName)) { - deserializedModelDeprecationInfo.inference = reader.getString(); - } else if ("deprecationStatus".equals(fieldName)) { - deserializedModelDeprecationInfo.deprecationStatus - = DeprecationStatus.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedModelDeprecationInfo; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelLifecycleStatus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelLifecycleStatus.java deleted file mode 100644 index 113530af733f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelLifecycleStatus.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Model lifecycle status. - */ -public final class ModelLifecycleStatus extends ExpandableStringEnum { - /** - * Legacy state. Replaced with GenerallyAvailable going forward. - */ - public static final ModelLifecycleStatus STABLE = fromString("Stable"); - - /** - * Model is in preview and may be subject to changes. - */ - public static final ModelLifecycleStatus PREVIEW = fromString("Preview"); - - /** - * Model is generally available for production use. - */ - public static final ModelLifecycleStatus GENERALLY_AVAILABLE = fromString("GenerallyAvailable"); - - /** - * Model is being deprecated and will be removed in the future. Only customers with existing deployments can create - * new deployments with this model. - */ - public static final ModelLifecycleStatus DEPRECATING = fromString("Deprecating"); - - /** - * Model has been deprecated, also known as retired, and is no longer supported. Inference calls to deployments of - * models in this lifecycle state will return 410 errors. - */ - public static final ModelLifecycleStatus DEPRECATED = fromString("Deprecated"); - - /** - * Model is a legacy version that is no longer recommended for use. Customers should migrate to newer models. Check - * replacementConfig for upgrade information. - */ - public static final ModelLifecycleStatus LEGACY = fromString("Legacy"); - - /** - * Creates a new instance of ModelLifecycleStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ModelLifecycleStatus() { - } - - /** - * Creates or finds a ModelLifecycleStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding ModelLifecycleStatus. - */ - public static ModelLifecycleStatus fromString(String name) { - return fromString(name, ModelLifecycleStatus.class); - } - - /** - * Gets known ModelLifecycleStatus values. - * - * @return known ModelLifecycleStatus values. - */ - public static Collection values() { - return values(ModelLifecycleStatus.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelSku.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelSku.java deleted file mode 100644 index 02e97886fa9b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelSku.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Describes an available Cognitive Services Model SKU. - */ -@Immutable -public final class ModelSku implements JsonSerializable { - /* - * The name of the model SKU. - */ - private String name; - - /* - * The usage name of the model SKU. - */ - private String usageName; - - /* - * The datetime of deprecation of the model SKU. - */ - private OffsetDateTime deprecationDate; - - /* - * The capacity configuration. - */ - private CapacityConfig capacity; - - /* - * The list of rateLimit. - */ - private List rateLimits; - - /* - * The list of billing meter info. - */ - private List cost; - - /** - * Creates an instance of ModelSku class. - */ - private ModelSku() { - } - - /** - * Get the name property: The name of the model SKU. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the usageName property: The usage name of the model SKU. - * - * @return the usageName value. - */ - public String usageName() { - return this.usageName; - } - - /** - * Get the deprecationDate property: The datetime of deprecation of the model SKU. - * - * @return the deprecationDate value. - */ - public OffsetDateTime deprecationDate() { - return this.deprecationDate; - } - - /** - * Get the capacity property: The capacity configuration. - * - * @return the capacity value. - */ - public CapacityConfig capacity() { - return this.capacity; - } - - /** - * Get the rateLimits property: The list of rateLimit. - * - * @return the rateLimits value. - */ - public List rateLimits() { - return this.rateLimits; - } - - /** - * Get the cost property: The list of billing meter info. - * - * @return the cost value. - */ - public List cost() { - return this.cost; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("usageName", this.usageName); - jsonWriter.writeStringField("deprecationDate", - this.deprecationDate == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.deprecationDate)); - jsonWriter.writeJsonField("capacity", this.capacity); - jsonWriter.writeArrayField("rateLimits", this.rateLimits, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("cost", this.cost, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ModelSku from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ModelSku 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 ModelSku. - */ - public static ModelSku fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ModelSku deserializedModelSku = new ModelSku(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedModelSku.name = reader.getString(); - } else if ("usageName".equals(fieldName)) { - deserializedModelSku.usageName = reader.getString(); - } else if ("deprecationDate".equals(fieldName)) { - deserializedModelSku.deprecationDate = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("capacity".equals(fieldName)) { - deserializedModelSku.capacity = CapacityConfig.fromJson(reader); - } else if ("rateLimits".equals(fieldName)) { - List rateLimits = reader.readArray(reader1 -> CallRateLimit.fromJson(reader1)); - deserializedModelSku.rateLimits = rateLimits; - } else if ("cost".equals(fieldName)) { - List cost = reader.readArray(reader1 -> BillingMeterInfo.fromJson(reader1)); - deserializedModelSku.cost = cost; - } else { - reader.skipChildren(); - } - } - - return deserializedModelSku; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelSkuCapacityProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelSkuCapacityProperties.java deleted file mode 100644 index b7682acaf7fa..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelSkuCapacityProperties.java +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Cognitive Services account ModelSkuCapacity. - */ -@Immutable -public final class ModelSkuCapacityProperties implements JsonSerializable { - /* - * Properties of Cognitive Services account deployment model. - */ - private DeploymentModel model; - - /* - * The skuName property. - */ - private String skuName; - - /* - * The available capacity for deployment with this model and sku. - */ - private Float availableCapacity; - - /* - * The available capacity for deployment with a fine-tune version of this model and sku. - */ - private Float availableFinetuneCapacity; - - /* - * The scope identifier for model SKU capacity. - */ - private String scopeId; - - /* - * The scope type for model SKU capacity. - */ - private QuotaScopeType scopeType; - - /** - * Creates an instance of ModelSkuCapacityProperties class. - */ - private ModelSkuCapacityProperties() { - } - - /** - * Get the model property: Properties of Cognitive Services account deployment model. - * - * @return the model value. - */ - public DeploymentModel model() { - return this.model; - } - - /** - * Get the skuName property: The skuName property. - * - * @return the skuName value. - */ - public String skuName() { - return this.skuName; - } - - /** - * Get the availableCapacity property: The available capacity for deployment with this model and sku. - * - * @return the availableCapacity value. - */ - public Float availableCapacity() { - return this.availableCapacity; - } - - /** - * Get the availableFinetuneCapacity property: The available capacity for deployment with a fine-tune version of - * this model and sku. - * - * @return the availableFinetuneCapacity value. - */ - public Float availableFinetuneCapacity() { - return this.availableFinetuneCapacity; - } - - /** - * Get the scopeId property: The scope identifier for model SKU capacity. - * - * @return the scopeId value. - */ - public String scopeId() { - return this.scopeId; - } - - /** - * Get the scopeType property: The scope type for model SKU capacity. - * - * @return the scopeType value. - */ - public QuotaScopeType scopeType() { - return this.scopeType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("model", this.model); - jsonWriter.writeStringField("skuName", this.skuName); - jsonWriter.writeNumberField("availableCapacity", this.availableCapacity); - jsonWriter.writeNumberField("availableFinetuneCapacity", this.availableFinetuneCapacity); - jsonWriter.writeStringField("scopeId", this.scopeId); - jsonWriter.writeStringField("scopeType", this.scopeType == null ? null : this.scopeType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ModelSkuCapacityProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ModelSkuCapacityProperties 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 ModelSkuCapacityProperties. - */ - public static ModelSkuCapacityProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ModelSkuCapacityProperties deserializedModelSkuCapacityProperties = new ModelSkuCapacityProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("model".equals(fieldName)) { - deserializedModelSkuCapacityProperties.model = DeploymentModel.fromJson(reader); - } else if ("skuName".equals(fieldName)) { - deserializedModelSkuCapacityProperties.skuName = reader.getString(); - } else if ("availableCapacity".equals(fieldName)) { - deserializedModelSkuCapacityProperties.availableCapacity = reader.getNullable(JsonReader::getFloat); - } else if ("availableFinetuneCapacity".equals(fieldName)) { - deserializedModelSkuCapacityProperties.availableFinetuneCapacity - = reader.getNullable(JsonReader::getFloat); - } else if ("scopeId".equals(fieldName)) { - deserializedModelSkuCapacityProperties.scopeId = reader.getString(); - } else if ("scopeType".equals(fieldName)) { - deserializedModelSkuCapacityProperties.scopeType = QuotaScopeType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedModelSkuCapacityProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Models.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Models.java deleted file mode 100644 index 74fd896d349f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Models.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of Models. - */ -public interface Models { - /** - * List Models. - * - * @param location The location 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 list of cognitive services models as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String location); - - /** - * List Models. - * - * @param location The location 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 list of cognitive services models as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String location, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/MultiRegionSettings.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/MultiRegionSettings.java deleted file mode 100644 index 9efe460f476f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/MultiRegionSettings.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * The multiregion settings Cognitive Services account. - */ -@Fluent -public final class MultiRegionSettings implements JsonSerializable { - /* - * Multiregion routing methods. - */ - private RoutingMethods routingMethod; - - /* - * The regions property. - */ - private List regions; - - /** - * Creates an instance of MultiRegionSettings class. - */ - public MultiRegionSettings() { - } - - /** - * Get the routingMethod property: Multiregion routing methods. - * - * @return the routingMethod value. - */ - public RoutingMethods routingMethod() { - return this.routingMethod; - } - - /** - * Set the routingMethod property: Multiregion routing methods. - * - * @param routingMethod the routingMethod value to set. - * @return the MultiRegionSettings object itself. - */ - public MultiRegionSettings withRoutingMethod(RoutingMethods routingMethod) { - this.routingMethod = routingMethod; - return this; - } - - /** - * Get the regions property: The regions property. - * - * @return the regions value. - */ - public List regions() { - return this.regions; - } - - /** - * Set the regions property: The regions property. - * - * @param regions the regions value to set. - * @return the MultiRegionSettings object itself. - */ - public MultiRegionSettings withRegions(List regions) { - this.regions = regions; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("routingMethod", this.routingMethod == null ? null : this.routingMethod.toString()); - jsonWriter.writeArrayField("regions", this.regions, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MultiRegionSettings from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MultiRegionSettings 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 MultiRegionSettings. - */ - public static MultiRegionSettings fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MultiRegionSettings deserializedMultiRegionSettings = new MultiRegionSettings(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("routingMethod".equals(fieldName)) { - deserializedMultiRegionSettings.routingMethod = RoutingMethods.fromString(reader.getString()); - } else if ("regions".equals(fieldName)) { - List regions = reader.readArray(reader1 -> RegionSetting.fromJson(reader1)); - deserializedMultiRegionSettings.regions = regions; - } else { - reader.skipChildren(); - } - } - - return deserializedMultiRegionSettings; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkInjection.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkInjection.java deleted file mode 100644 index 2913dafa7bf9..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkInjection.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Specifies in AI Foundry where virtual network injection occurs to secure scenarios like Agents entirely within the - * user's private network, eliminating public internet exposure while maintaining control over network configurations - * and resources. - */ -@Fluent -public final class NetworkInjection implements JsonSerializable { - /* - * Specifies what features in AI Foundry network injection applies to. Currently only supports 'agent' for agent - * scenarios. 'none' means no network injection. - */ - private ScenarioType scenario; - - /* - * Specify the subnet for which your Agent Client is injected into. - */ - private String subnetArmId; - - /* - * Boolean to enable Microsoft Managed Network for subnet delegation - */ - private Boolean useMicrosoftManagedNetwork; - - /** - * Creates an instance of NetworkInjection class. - */ - public NetworkInjection() { - } - - /** - * Get the scenario property: Specifies what features in AI Foundry network injection applies to. Currently only - * supports 'agent' for agent scenarios. 'none' means no network injection. - * - * @return the scenario value. - */ - public ScenarioType scenario() { - return this.scenario; - } - - /** - * Set the scenario property: Specifies what features in AI Foundry network injection applies to. Currently only - * supports 'agent' for agent scenarios. 'none' means no network injection. - * - * @param scenario the scenario value to set. - * @return the NetworkInjection object itself. - */ - public NetworkInjection withScenario(ScenarioType scenario) { - this.scenario = scenario; - return this; - } - - /** - * Get the subnetArmId property: Specify the subnet for which your Agent Client is injected into. - * - * @return the subnetArmId value. - */ - public String subnetArmId() { - return this.subnetArmId; - } - - /** - * Set the subnetArmId property: Specify the subnet for which your Agent Client is injected into. - * - * @param subnetArmId the subnetArmId value to set. - * @return the NetworkInjection object itself. - */ - public NetworkInjection withSubnetArmId(String subnetArmId) { - this.subnetArmId = subnetArmId; - return this; - } - - /** - * Get the useMicrosoftManagedNetwork property: Boolean to enable Microsoft Managed Network for subnet delegation. - * - * @return the useMicrosoftManagedNetwork value. - */ - public Boolean useMicrosoftManagedNetwork() { - return this.useMicrosoftManagedNetwork; - } - - /** - * Set the useMicrosoftManagedNetwork property: Boolean to enable Microsoft Managed Network for subnet delegation. - * - * @param useMicrosoftManagedNetwork the useMicrosoftManagedNetwork value to set. - * @return the NetworkInjection object itself. - */ - public NetworkInjection withUseMicrosoftManagedNetwork(Boolean useMicrosoftManagedNetwork) { - this.useMicrosoftManagedNetwork = useMicrosoftManagedNetwork; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("scenario", this.scenario == null ? null : this.scenario.toString()); - jsonWriter.writeStringField("subnetArmId", this.subnetArmId); - jsonWriter.writeBooleanField("useMicrosoftManagedNetwork", this.useMicrosoftManagedNetwork); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of NetworkInjection from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of NetworkInjection 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 NetworkInjection. - */ - public static NetworkInjection fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - NetworkInjection deserializedNetworkInjection = new NetworkInjection(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("scenario".equals(fieldName)) { - deserializedNetworkInjection.scenario = ScenarioType.fromString(reader.getString()); - } else if ("subnetArmId".equals(fieldName)) { - deserializedNetworkInjection.subnetArmId = reader.getString(); - } else if ("useMicrosoftManagedNetwork".equals(fieldName)) { - deserializedNetworkInjection.useMicrosoftManagedNetwork - = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedNetworkInjection; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkRuleAction.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkRuleAction.java deleted file mode 100644 index 3315f7471af6..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkRuleAction.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The default action when no rule from ipRules and from virtualNetworkRules match. This is only used after the bypass - * property has been evaluated. - */ -public final class NetworkRuleAction extends ExpandableStringEnum { - /** - * Static value Allow for NetworkRuleAction. - */ - public static final NetworkRuleAction ALLOW = fromString("Allow"); - - /** - * Static value Deny for NetworkRuleAction. - */ - public static final NetworkRuleAction DENY = fromString("Deny"); - - /** - * Creates a new instance of NetworkRuleAction value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public NetworkRuleAction() { - } - - /** - * Creates or finds a NetworkRuleAction from its string representation. - * - * @param name a name to look for. - * @return the corresponding NetworkRuleAction. - */ - public static NetworkRuleAction fromString(String name) { - return fromString(name, NetworkRuleAction.class); - } - - /** - * Gets known NetworkRuleAction values. - * - * @return known NetworkRuleAction values. - */ - public static Collection values() { - return values(NetworkRuleAction.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkRuleSet.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkRuleSet.java deleted file mode 100644 index 0ed8a863229b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkRuleSet.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * A set of rules governing the network accessibility. - */ -@Fluent -public final class NetworkRuleSet implements JsonSerializable { - /* - * The default action when no rule from ipRules and from virtualNetworkRules match. This is only used after the - * bypass property has been evaluated. - */ - private NetworkRuleAction defaultAction; - - /* - * Setting for trusted services. - */ - private ByPassSelection bypass; - - /* - * The list of IP address rules. - */ - private List ipRules; - - /* - * The list of virtual network rules. - */ - private List virtualNetworkRules; - - /** - * Creates an instance of NetworkRuleSet class. - */ - public NetworkRuleSet() { - } - - /** - * Get the defaultAction property: The default action when no rule from ipRules and from virtualNetworkRules match. - * This is only used after the bypass property has been evaluated. - * - * @return the defaultAction value. - */ - public NetworkRuleAction defaultAction() { - return this.defaultAction; - } - - /** - * Set the defaultAction property: The default action when no rule from ipRules and from virtualNetworkRules match. - * This is only used after the bypass property has been evaluated. - * - * @param defaultAction the defaultAction value to set. - * @return the NetworkRuleSet object itself. - */ - public NetworkRuleSet withDefaultAction(NetworkRuleAction defaultAction) { - this.defaultAction = defaultAction; - return this; - } - - /** - * Get the bypass property: Setting for trusted services. - * - * @return the bypass value. - */ - public ByPassSelection bypass() { - return this.bypass; - } - - /** - * Set the bypass property: Setting for trusted services. - * - * @param bypass the bypass value to set. - * @return the NetworkRuleSet object itself. - */ - public NetworkRuleSet withBypass(ByPassSelection bypass) { - this.bypass = bypass; - return this; - } - - /** - * Get the ipRules property: The list of IP address rules. - * - * @return the ipRules value. - */ - public List ipRules() { - return this.ipRules; - } - - /** - * Set the ipRules property: The list of IP address rules. - * - * @param ipRules the ipRules value to set. - * @return the NetworkRuleSet object itself. - */ - public NetworkRuleSet withIpRules(List ipRules) { - this.ipRules = ipRules; - return this; - } - - /** - * Get the virtualNetworkRules property: The list of virtual network rules. - * - * @return the virtualNetworkRules value. - */ - public List virtualNetworkRules() { - return this.virtualNetworkRules; - } - - /** - * Set the virtualNetworkRules property: The list of virtual network rules. - * - * @param virtualNetworkRules the virtualNetworkRules value to set. - * @return the NetworkRuleSet object itself. - */ - public NetworkRuleSet withVirtualNetworkRules(List virtualNetworkRules) { - this.virtualNetworkRules = virtualNetworkRules; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("defaultAction", this.defaultAction == null ? null : this.defaultAction.toString()); - jsonWriter.writeStringField("bypass", this.bypass == null ? null : this.bypass.toString()); - jsonWriter.writeArrayField("ipRules", this.ipRules, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("virtualNetworkRules", this.virtualNetworkRules, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of NetworkRuleSet from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of NetworkRuleSet 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 NetworkRuleSet. - */ - public static NetworkRuleSet fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - NetworkRuleSet deserializedNetworkRuleSet = new NetworkRuleSet(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("defaultAction".equals(fieldName)) { - deserializedNetworkRuleSet.defaultAction = NetworkRuleAction.fromString(reader.getString()); - } else if ("bypass".equals(fieldName)) { - deserializedNetworkRuleSet.bypass = ByPassSelection.fromString(reader.getString()); - } else if ("ipRules".equals(fieldName)) { - List ipRules = reader.readArray(reader1 -> IpRule.fromJson(reader1)); - deserializedNetworkRuleSet.ipRules = ipRules; - } else if ("virtualNetworkRules".equals(fieldName)) { - List virtualNetworkRules - = reader.readArray(reader1 -> VirtualNetworkRule.fromJson(reader1)); - deserializedNetworkRuleSet.virtualNetworkRules = virtualNetworkRules; - } else { - reader.skipChildren(); - } - } - - return deserializedNetworkRuleSet; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeter.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeter.java deleted file mode 100644 index 7507a023c831..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeter.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Information about a linked Network Security Perimeter. - */ -@Immutable -public final class NetworkSecurityPerimeter implements JsonSerializable { - /* - * Fully qualified identifier of the resource - */ - private String id; - - /* - * Guid of the resource - */ - private String perimeterGuid; - - /* - * Location of the resource - */ - private String location; - - /** - * Creates an instance of NetworkSecurityPerimeter class. - */ - private NetworkSecurityPerimeter() { - } - - /** - * Get the id property: Fully qualified identifier of the resource. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the perimeterGuid property: Guid of the resource. - * - * @return the perimeterGuid value. - */ - public String perimeterGuid() { - return this.perimeterGuid; - } - - /** - * Get the location property: Location of the resource. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("perimeterGuid", this.perimeterGuid); - 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.getString(); - } else if ("location".equals(fieldName)) { - deserializedNetworkSecurityPerimeter.location = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedNetworkSecurityPerimeter; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRule.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRule.java deleted file mode 100644 index c4ad40cc902c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRule.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Network Security Perimeter Access Rule. - */ -@Immutable -public final class NetworkSecurityPerimeterAccessRule implements JsonSerializable { - /* - * Network Security Perimeter Access Rule Name - */ - private String name; - - /* - * Properties of Network Security Perimeter Access Rule - */ - private NetworkSecurityPerimeterAccessRuleProperties properties; - - /** - * Creates an instance of NetworkSecurityPerimeterAccessRule class. - */ - private NetworkSecurityPerimeterAccessRule() { - } - - /** - * Get the name property: Network Security Perimeter Access Rule Name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the properties property: Properties of Network Security Perimeter Access Rule. - * - * @return the properties value. - */ - public NetworkSecurityPerimeterAccessRuleProperties properties() { - return this.properties; - } - - /** - * {@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 NetworkSecurityPerimeterAccessRule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of NetworkSecurityPerimeterAccessRule 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 NetworkSecurityPerimeterAccessRule. - */ - public static NetworkSecurityPerimeterAccessRule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - NetworkSecurityPerimeterAccessRule deserializedNetworkSecurityPerimeterAccessRule - = new NetworkSecurityPerimeterAccessRule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedNetworkSecurityPerimeterAccessRule.name = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedNetworkSecurityPerimeterAccessRule.properties - = NetworkSecurityPerimeterAccessRuleProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedNetworkSecurityPerimeterAccessRule; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRuleProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRuleProperties.java deleted file mode 100644 index 92db2f0d9d04..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRuleProperties.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * The Properties of Network Security Perimeter Rule. - */ -@Immutable -public final class NetworkSecurityPerimeterAccessRuleProperties - implements JsonSerializable { - /* - * Direction of Access Rule - */ - private NspAccessRuleDirection direction; - - /* - * Address prefixes for inbound rules - */ - private List addressPrefixes; - - /* - * Subscriptions for inbound rules - */ - private List subscriptions; - - /* - * NetworkSecurityPerimeters for inbound rules - */ - private List networkSecurityPerimeters; - - /* - * Fully qualified domain name for outbound rules - */ - private List fullyQualifiedDomainNames; - - /** - * Creates an instance of NetworkSecurityPerimeterAccessRuleProperties class. - */ - private NetworkSecurityPerimeterAccessRuleProperties() { - } - - /** - * Get the direction property: Direction of Access Rule. - * - * @return the direction value. - */ - public NspAccessRuleDirection direction() { - return this.direction; - } - - /** - * Get the addressPrefixes property: Address prefixes for inbound rules. - * - * @return the addressPrefixes value. - */ - public List addressPrefixes() { - return this.addressPrefixes; - } - - /** - * Get the subscriptions property: Subscriptions for inbound rules. - * - * @return the subscriptions value. - */ - public List subscriptions() { - return this.subscriptions; - } - - /** - * Get the networkSecurityPerimeters property: NetworkSecurityPerimeters for inbound rules. - * - * @return the networkSecurityPerimeters value. - */ - public List networkSecurityPerimeters() { - return this.networkSecurityPerimeters; - } - - /** - * Get the fullyQualifiedDomainNames property: Fully qualified domain name for outbound rules. - * - * @return the fullyQualifiedDomainNames value. - */ - public List fullyQualifiedDomainNames() { - return this.fullyQualifiedDomainNames; - } - - /** - * {@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)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of NetworkSecurityPerimeterAccessRuleProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of NetworkSecurityPerimeterAccessRuleProperties 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 NetworkSecurityPerimeterAccessRuleProperties. - */ - public static NetworkSecurityPerimeterAccessRuleProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - NetworkSecurityPerimeterAccessRuleProperties deserializedNetworkSecurityPerimeterAccessRuleProperties - = new NetworkSecurityPerimeterAccessRuleProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("direction".equals(fieldName)) { - deserializedNetworkSecurityPerimeterAccessRuleProperties.direction - = NspAccessRuleDirection.fromString(reader.getString()); - } else if ("addressPrefixes".equals(fieldName)) { - List addressPrefixes = reader.readArray(reader1 -> reader1.getString()); - deserializedNetworkSecurityPerimeterAccessRuleProperties.addressPrefixes = addressPrefixes; - } else if ("subscriptions".equals(fieldName)) { - List subscriptions - = reader.readArray( - reader1 -> NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem.fromJson(reader1)); - deserializedNetworkSecurityPerimeterAccessRuleProperties.subscriptions = subscriptions; - } else if ("networkSecurityPerimeters".equals(fieldName)) { - List networkSecurityPerimeters - = reader.readArray(reader1 -> NetworkSecurityPerimeter.fromJson(reader1)); - deserializedNetworkSecurityPerimeterAccessRuleProperties.networkSecurityPerimeters - = networkSecurityPerimeters; - } else if ("fullyQualifiedDomainNames".equals(fieldName)) { - List fullyQualifiedDomainNames = reader.readArray(reader1 -> reader1.getString()); - deserializedNetworkSecurityPerimeterAccessRuleProperties.fullyQualifiedDomainNames - = fullyQualifiedDomainNames; - } else { - reader.skipChildren(); - } - } - - return deserializedNetworkSecurityPerimeterAccessRuleProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem.java deleted file mode 100644 index 4425fef24079..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Subscription for inbound rule. - */ -@Immutable -public final class NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem - implements JsonSerializable { - /* - * Fully qualified identifier of subscription - */ - private String id; - - /** - * Creates an instance of NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem class. - */ - private NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem() { - } - - /** - * Get the id property: Fully qualified identifier of subscription. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem 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 - * NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem. - */ - public static NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem deserializedNetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem - = new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedNetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem.id = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedNetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfiguration.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfiguration.java deleted file mode 100644 index 924d8dc3b47a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfiguration.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.cognitiveservices.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: NSP 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.cognitiveservices.fluent.models.NetworkSecurityPerimeterConfigurationInner object. - * - * @return the inner object. - */ - NetworkSecurityPerimeterConfigurationInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurationAssociationInfo.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurationAssociationInfo.java deleted file mode 100644 index e8752cc6c585..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurationAssociationInfo.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Network Security Perimeter Configuration Association Information. - */ -@Immutable -public final class NetworkSecurityPerimeterConfigurationAssociationInfo - implements JsonSerializable { - /* - * Name of the resource association - */ - private String name; - - /* - * Access Mode of the resource association - */ - private String accessMode; - - /** - * Creates an instance of NetworkSecurityPerimeterConfigurationAssociationInfo class. - */ - private NetworkSecurityPerimeterConfigurationAssociationInfo() { - } - - /** - * Get the name property: Name of the resource association. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the accessMode property: Access Mode of the resource association. - * - * @return the accessMode value. - */ - public String accessMode() { - return this.accessMode; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("accessMode", this.accessMode); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of NetworkSecurityPerimeterConfigurationAssociationInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of NetworkSecurityPerimeterConfigurationAssociationInfo 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 NetworkSecurityPerimeterConfigurationAssociationInfo. - */ - public static NetworkSecurityPerimeterConfigurationAssociationInfo fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - NetworkSecurityPerimeterConfigurationAssociationInfo deserializedNetworkSecurityPerimeterConfigurationAssociationInfo - = new NetworkSecurityPerimeterConfigurationAssociationInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedNetworkSecurityPerimeterConfigurationAssociationInfo.name = reader.getString(); - } else if ("accessMode".equals(fieldName)) { - deserializedNetworkSecurityPerimeterConfigurationAssociationInfo.accessMode = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedNetworkSecurityPerimeterConfigurationAssociationInfo; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurationProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurationProperties.java deleted file mode 100644 index ee7d82ea8963..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurationProperties.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * The properties of an NSP Configuration. - */ -@Immutable -public final class NetworkSecurityPerimeterConfigurationProperties - implements JsonSerializable { - /* - * Provisioning state of NetworkSecurityPerimeter configuration - */ - private String provisioningState; - - /* - * List of Provisioning Issues - */ - private List provisioningIssues; - - /* - * Information about a linked Network Security Perimeter - */ - private NetworkSecurityPerimeter networkSecurityPerimeter; - - /* - * Network Security Perimeter Configuration Association Information - */ - private NetworkSecurityPerimeterConfigurationAssociationInfo resourceAssociation; - - /* - * Network Security Perimeter Profile Information - */ - private NetworkSecurityPerimeterProfileInfo profile; - - /** - * Creates an instance of NetworkSecurityPerimeterConfigurationProperties class. - */ - private NetworkSecurityPerimeterConfigurationProperties() { - } - - /** - * Get the provisioningState property: Provisioning state of NetworkSecurityPerimeter configuration. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the provisioningIssues property: List of Provisioning Issues. - * - * @return the provisioningIssues value. - */ - public List provisioningIssues() { - return this.provisioningIssues; - } - - /** - * Get the networkSecurityPerimeter property: Information about a linked Network Security Perimeter. - * - * @return the networkSecurityPerimeter value. - */ - public NetworkSecurityPerimeter networkSecurityPerimeter() { - return this.networkSecurityPerimeter; - } - - /** - * Get the resourceAssociation property: Network Security Perimeter Configuration Association Information. - * - * @return the resourceAssociation value. - */ - public NetworkSecurityPerimeterConfigurationAssociationInfo resourceAssociation() { - return this.resourceAssociation; - } - - /** - * Get the profile property: Network Security Perimeter Profile Information. - * - * @return the profile value. - */ - public NetworkSecurityPerimeterProfileInfo profile() { - return this.profile; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("provisioningIssues", this.provisioningIssues, - (writer, element) -> writer.writeJson(element)); - 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 = 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 - = NetworkSecurityPerimeterConfigurationAssociationInfo.fromJson(reader); - } else if ("profile".equals(fieldName)) { - deserializedNetworkSecurityPerimeterConfigurationProperties.profile - = NetworkSecurityPerimeterProfileInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedNetworkSecurityPerimeterConfigurationProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurations.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurations.java deleted file mode 100644 index e99f3b3d1c4e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurations.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 NetworkSecurityPerimeterConfigurations. - */ -public interface NetworkSecurityPerimeterConfigurations { - /** - * Gets the specified NSP configurations for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 specified NSP configurations for an account along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, - String nspConfigurationName, Context context); - - /** - * Gets the specified NSP configurations for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 specified NSP configurations for an account. - */ - NetworkSecurityPerimeterConfiguration get(String resourceGroupName, String accountName, - String nspConfigurationName); - - /** - * Gets a list of NSP configurations for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 an account as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets a list of NSP configurations for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 an account as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, - Context context); - - /** - * Reconcile the NSP configuration for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 nSP Configuration for an Cognitive Services account. - */ - NetworkSecurityPerimeterConfiguration reconcile(String resourceGroupName, String accountName, - String nspConfigurationName); - - /** - * Reconcile the NSP configuration for an account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP 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 nSP Configuration for an Cognitive Services account. - */ - NetworkSecurityPerimeterConfiguration reconcile(String resourceGroupName, String accountName, - String nspConfigurationName, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterProfileInfo.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterProfileInfo.java deleted file mode 100644 index bb95b8388b88..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterProfileInfo.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Network Security Perimeter Profile Information. - */ -@Immutable -public final class NetworkSecurityPerimeterProfileInfo - implements JsonSerializable { - /* - * Name of the resource profile - */ - private String name; - - /* - * Access rules version of the resource profile - */ - private Long accessRulesVersion; - - /* - * The accessRules property. - */ - private List accessRules; - - /* - * Current diagnostic settings version - */ - private Long diagnosticSettingsVersion; - - /* - * List of enabled log categories - */ - private List enabledLogCategories; - - /** - * Creates an instance of NetworkSecurityPerimeterProfileInfo class. - */ - private NetworkSecurityPerimeterProfileInfo() { - } - - /** - * Get the name property: Name of the resource profile. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the accessRulesVersion property: Access rules version of the resource profile. - * - * @return the accessRulesVersion value. - */ - public Long accessRulesVersion() { - return this.accessRulesVersion; - } - - /** - * Get the accessRules property: The accessRules property. - * - * @return the accessRules value. - */ - public List accessRules() { - return this.accessRules; - } - - /** - * Get the diagnosticSettingsVersion property: Current diagnostic settings version. - * - * @return the diagnosticSettingsVersion value. - */ - public Long diagnosticSettingsVersion() { - return this.diagnosticSettingsVersion; - } - - /** - * Get the enabledLogCategories property: List of enabled log categories. - * - * @return the enabledLogCategories value. - */ - public List enabledLogCategories() { - return this.enabledLogCategories; - } - - /** - * {@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 NetworkSecurityPerimeterProfileInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of NetworkSecurityPerimeterProfileInfo 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 NetworkSecurityPerimeterProfileInfo. - */ - public static NetworkSecurityPerimeterProfileInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - NetworkSecurityPerimeterProfileInfo deserializedNetworkSecurityPerimeterProfileInfo - = new NetworkSecurityPerimeterProfileInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedNetworkSecurityPerimeterProfileInfo.name = reader.getString(); - } else if ("accessRulesVersion".equals(fieldName)) { - deserializedNetworkSecurityPerimeterProfileInfo.accessRulesVersion - = reader.getNullable(JsonReader::getLong); - } else if ("accessRules".equals(fieldName)) { - List accessRules - = reader.readArray(reader1 -> NetworkSecurityPerimeterAccessRule.fromJson(reader1)); - deserializedNetworkSecurityPerimeterProfileInfo.accessRules = accessRules; - } else if ("diagnosticSettingsVersion".equals(fieldName)) { - deserializedNetworkSecurityPerimeterProfileInfo.diagnosticSettingsVersion - = reader.getNullable(JsonReader::getLong); - } else if ("enabledLogCategories".equals(fieldName)) { - List enabledLogCategories = reader.readArray(reader1 -> reader1.getString()); - deserializedNetworkSecurityPerimeterProfileInfo.enabledLogCategories = enabledLogCategories; - } else { - reader.skipChildren(); - } - } - - return deserializedNetworkSecurityPerimeterProfileInfo; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NoneAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NoneAuthTypeConnectionProperties.java deleted file mode 100644 index c365b91f1155..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NoneAuthTypeConnectionProperties.java +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * The NoneAuthTypeConnectionProperties model. - */ -@Fluent -public final class NoneAuthTypeConnectionProperties extends ConnectionPropertiesV2 { - /* - * Authentication type of the connection target - */ - private ConnectionAuthType authType = ConnectionAuthType.NONE; - - /** - * Creates an instance of NoneAuthTypeConnectionProperties class. - */ - public NoneAuthTypeConnectionProperties() { - } - - /** - * Get the authType property: Authentication type of the connection target. - * - * @return the authType value. - */ - @Override - public ConnectionAuthType authType() { - return this.authType; - } - - /** - * {@inheritDoc} - */ - @Override - public NoneAuthTypeConnectionProperties withCategory(ConnectionCategory category) { - super.withCategory(category); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public NoneAuthTypeConnectionProperties withError(String error) { - super.withError(error); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public NoneAuthTypeConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { - super.withExpiryTime(expiryTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public NoneAuthTypeConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { - super.withIsSharedToAll(isSharedToAll); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public NoneAuthTypeConnectionProperties withMetadata(Map metadata) { - super.withMetadata(metadata); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public NoneAuthTypeConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { - super.withPeRequirement(peRequirement); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public NoneAuthTypeConnectionProperties withPeStatus(ManagedPEStatus peStatus) { - super.withPeStatus(peStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public NoneAuthTypeConnectionProperties withSharedUserList(List sharedUserList) { - super.withSharedUserList(sharedUserList); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public NoneAuthTypeConnectionProperties withTarget(String target) { - super.withTarget(target); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public NoneAuthTypeConnectionProperties withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { - super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("category", category() == null ? null : category().toString()); - jsonWriter.writeStringField("error", error()); - jsonWriter.writeStringField("expiryTime", - expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); - jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); - jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); - jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); - jsonWriter.writeArrayField("sharedUserList", sharedUserList(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("target", target()); - jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); - jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of NoneAuthTypeConnectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of NoneAuthTypeConnectionProperties 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 NoneAuthTypeConnectionProperties. - */ - public static NoneAuthTypeConnectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - NoneAuthTypeConnectionProperties deserializedNoneAuthTypeConnectionProperties - = new NoneAuthTypeConnectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("category".equals(fieldName)) { - deserializedNoneAuthTypeConnectionProperties - .withCategory(ConnectionCategory.fromString(reader.getString())); - } else if ("createdByWorkspaceArmId".equals(fieldName)) { - deserializedNoneAuthTypeConnectionProperties.withCreatedByWorkspaceArmId(reader.getString()); - } else if ("error".equals(fieldName)) { - deserializedNoneAuthTypeConnectionProperties.withError(reader.getString()); - } else if ("expiryTime".equals(fieldName)) { - deserializedNoneAuthTypeConnectionProperties.withExpiryTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("group".equals(fieldName)) { - deserializedNoneAuthTypeConnectionProperties - .withGroup(ConnectionGroup.fromString(reader.getString())); - } else if ("isSharedToAll".equals(fieldName)) { - deserializedNoneAuthTypeConnectionProperties - .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); - } else if ("metadata".equals(fieldName)) { - Map metadata = reader.readMap(reader1 -> reader1.getString()); - deserializedNoneAuthTypeConnectionProperties.withMetadata(metadata); - } else if ("peRequirement".equals(fieldName)) { - deserializedNoneAuthTypeConnectionProperties - .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); - } else if ("peStatus".equals(fieldName)) { - deserializedNoneAuthTypeConnectionProperties - .withPeStatus(ManagedPEStatus.fromString(reader.getString())); - } else if ("sharedUserList".equals(fieldName)) { - List sharedUserList = reader.readArray(reader1 -> reader1.getString()); - deserializedNoneAuthTypeConnectionProperties.withSharedUserList(sharedUserList); - } else if ("target".equals(fieldName)) { - deserializedNoneAuthTypeConnectionProperties.withTarget(reader.getString()); - } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { - deserializedNoneAuthTypeConnectionProperties - .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); - } else if ("authType".equals(fieldName)) { - deserializedNoneAuthTypeConnectionProperties.authType - = ConnectionAuthType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedNoneAuthTypeConnectionProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NspAccessRuleDirection.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NspAccessRuleDirection.java deleted file mode 100644 index 8fd471541470..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NspAccessRuleDirection.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Direction of Access Rule. - */ -public final class NspAccessRuleDirection extends ExpandableStringEnum { - /** - * Static value Inbound for NspAccessRuleDirection. - */ - public static final NspAccessRuleDirection INBOUND = fromString("Inbound"); - - /** - * Static value Outbound for NspAccessRuleDirection. - */ - public static final NspAccessRuleDirection OUTBOUND = fromString("Outbound"); - - /** - * Creates a new instance of NspAccessRuleDirection value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public NspAccessRuleDirection() { - } - - /** - * Creates or finds a NspAccessRuleDirection from its string representation. - * - * @param name a name to look for. - * @return the corresponding NspAccessRuleDirection. - */ - public static NspAccessRuleDirection fromString(String name) { - return fromString(name, NspAccessRuleDirection.class); - } - - /** - * Gets known NspAccessRuleDirection values. - * - * @return known NspAccessRuleDirection values. - */ - public static Collection values() { - return values(NspAccessRuleDirection.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OAuth2AuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OAuth2AuthTypeConnectionProperties.java deleted file mode 100644 index f312be5560f1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OAuth2AuthTypeConnectionProperties.java +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * The OAuth2AuthTypeConnectionProperties model. - */ -@Fluent -public final class OAuth2AuthTypeConnectionProperties extends ConnectionPropertiesV2 { - /* - * Authentication type of the connection target - */ - private ConnectionAuthType authType = ConnectionAuthType.OAUTH2; - - /* - * ClientId and ClientSecret are required. Other properties are optional - * depending on each OAuth2 provider's implementation. - */ - private ConnectionOAuth2 credentials; - - /** - * Creates an instance of OAuth2AuthTypeConnectionProperties class. - */ - public OAuth2AuthTypeConnectionProperties() { - } - - /** - * Get the authType property: Authentication type of the connection target. - * - * @return the authType value. - */ - @Override - public ConnectionAuthType authType() { - return this.authType; - } - - /** - * Get the credentials property: ClientId and ClientSecret are required. Other properties are optional - * depending on each OAuth2 provider's implementation. - * - * @return the credentials value. - */ - public ConnectionOAuth2 credentials() { - return this.credentials; - } - - /** - * Set the credentials property: ClientId and ClientSecret are required. Other properties are optional - * depending on each OAuth2 provider's implementation. - * - * @param credentials the credentials value to set. - * @return the OAuth2AuthTypeConnectionProperties object itself. - */ - public OAuth2AuthTypeConnectionProperties withCredentials(ConnectionOAuth2 credentials) { - this.credentials = credentials; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OAuth2AuthTypeConnectionProperties withCategory(ConnectionCategory category) { - super.withCategory(category); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OAuth2AuthTypeConnectionProperties withError(String error) { - super.withError(error); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OAuth2AuthTypeConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { - super.withExpiryTime(expiryTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OAuth2AuthTypeConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { - super.withIsSharedToAll(isSharedToAll); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OAuth2AuthTypeConnectionProperties withMetadata(Map metadata) { - super.withMetadata(metadata); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OAuth2AuthTypeConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { - super.withPeRequirement(peRequirement); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OAuth2AuthTypeConnectionProperties withPeStatus(ManagedPEStatus peStatus) { - super.withPeStatus(peStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OAuth2AuthTypeConnectionProperties withSharedUserList(List sharedUserList) { - super.withSharedUserList(sharedUserList); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OAuth2AuthTypeConnectionProperties withTarget(String target) { - super.withTarget(target); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public OAuth2AuthTypeConnectionProperties withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { - super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("category", category() == null ? null : category().toString()); - jsonWriter.writeStringField("error", error()); - jsonWriter.writeStringField("expiryTime", - expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); - jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); - jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); - jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); - jsonWriter.writeArrayField("sharedUserList", sharedUserList(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("target", target()); - jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); - jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); - jsonWriter.writeJsonField("credentials", this.credentials); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OAuth2AuthTypeConnectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OAuth2AuthTypeConnectionProperties 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 OAuth2AuthTypeConnectionProperties. - */ - public static OAuth2AuthTypeConnectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OAuth2AuthTypeConnectionProperties deserializedOAuth2AuthTypeConnectionProperties - = new OAuth2AuthTypeConnectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("category".equals(fieldName)) { - deserializedOAuth2AuthTypeConnectionProperties - .withCategory(ConnectionCategory.fromString(reader.getString())); - } else if ("createdByWorkspaceArmId".equals(fieldName)) { - deserializedOAuth2AuthTypeConnectionProperties.withCreatedByWorkspaceArmId(reader.getString()); - } else if ("error".equals(fieldName)) { - deserializedOAuth2AuthTypeConnectionProperties.withError(reader.getString()); - } else if ("expiryTime".equals(fieldName)) { - deserializedOAuth2AuthTypeConnectionProperties.withExpiryTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("group".equals(fieldName)) { - deserializedOAuth2AuthTypeConnectionProperties - .withGroup(ConnectionGroup.fromString(reader.getString())); - } else if ("isSharedToAll".equals(fieldName)) { - deserializedOAuth2AuthTypeConnectionProperties - .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); - } else if ("metadata".equals(fieldName)) { - Map metadata = reader.readMap(reader1 -> reader1.getString()); - deserializedOAuth2AuthTypeConnectionProperties.withMetadata(metadata); - } else if ("peRequirement".equals(fieldName)) { - deserializedOAuth2AuthTypeConnectionProperties - .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); - } else if ("peStatus".equals(fieldName)) { - deserializedOAuth2AuthTypeConnectionProperties - .withPeStatus(ManagedPEStatus.fromString(reader.getString())); - } else if ("sharedUserList".equals(fieldName)) { - List sharedUserList = reader.readArray(reader1 -> reader1.getString()); - deserializedOAuth2AuthTypeConnectionProperties.withSharedUserList(sharedUserList); - } else if ("target".equals(fieldName)) { - deserializedOAuth2AuthTypeConnectionProperties.withTarget(reader.getString()); - } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { - deserializedOAuth2AuthTypeConnectionProperties - .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); - } else if ("authType".equals(fieldName)) { - deserializedOAuth2AuthTypeConnectionProperties.authType - = ConnectionAuthType.fromString(reader.getString()); - } else if ("credentials".equals(fieldName)) { - deserializedOAuth2AuthTypeConnectionProperties.credentials = ConnectionOAuth2.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedOAuth2AuthTypeConnectionProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Operation.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Operation.java deleted file mode 100644 index ea3f53a43ac7..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Operation.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.OperationInner; - -/** - * An immutable client-side representation of Operation. - */ -public interface Operation { - /** - * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * - * @return the name value. - */ - String name(); - - /** - * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for Azure Resource Manager/control-plane operations. - * - * @return the isDataAction value. - */ - Boolean isDataAction(); - - /** - * Gets the display property: Localized display information for this particular operation. - * - * @return the display value. - */ - OperationDisplay display(); - - /** - * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and - * audit logs UX. Default value is "user,system". - * - * @return the origin value. - */ - Origin origin(); - - /** - * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are - * for internal only APIs. - * - * @return the actionType value. - */ - ActionType actionType(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.OperationInner object. - * - * @return the inner object. - */ - OperationInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OperationDisplay.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OperationDisplay.java deleted file mode 100644 index 51d1e4e6bf90..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OperationDisplay.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Localized display information for an operation. - */ -@Immutable -public final class OperationDisplay implements JsonSerializable { - /* - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or - * "Microsoft Compute". - */ - private String provider; - - /* - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or - * "Job Schedule Collections". - */ - private String resource; - - /* - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. - * "Create or Update Virtual Machine", "Restart Virtual Machine". - */ - private String operation; - - /* - * The short, localized friendly description of the operation; suitable for tool tips and detailed views. - */ - private String description; - - /** - * Creates an instance of OperationDisplay class. - */ - private OperationDisplay() { - } - - /** - * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring - * Insights" or "Microsoft Compute". - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. - * "Virtual Machines" or "Job Schedule Collections". - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. - * "Create or Update Virtual Machine", "Restart Virtual Machine". - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Get the description property: The short, localized friendly description of the operation; suitable for tool tips - * and detailed views. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationDisplay from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationDisplay 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 OperationDisplay. - */ - public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationDisplay deserializedOperationDisplay = new OperationDisplay(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provider".equals(fieldName)) { - deserializedOperationDisplay.provider = reader.getString(); - } else if ("resource".equals(fieldName)) { - deserializedOperationDisplay.resource = reader.getString(); - } else if ("operation".equals(fieldName)) { - deserializedOperationDisplay.operation = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedOperationDisplay.description = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationDisplay; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Operations.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Operations.java deleted file mode 100644 index e9fb62381799..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Operations.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of Operations. - */ -public interface Operations { - /** - * Lists all the available Cognitive Services account operations. - * - * @throws com.azure.core.management.exception.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 REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Lists all the available Cognitive Services account 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OrganizationSharedBuiltInAuthorizationPolicy.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OrganizationSharedBuiltInAuthorizationPolicy.java deleted file mode 100644 index 6f3c9edfd28d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OrganizationSharedBuiltInAuthorizationPolicy.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Built-in authorization policy scoped to organization/tenant. - */ -@Immutable -public final class OrganizationSharedBuiltInAuthorizationPolicy extends ApplicationAuthorizationPolicy { - /* - * Authorization scheme type. - */ - private BuiltInAuthorizationScheme type = BuiltInAuthorizationScheme.ORGANIZATION_SCOPE; - - /** - * Creates an instance of OrganizationSharedBuiltInAuthorizationPolicy class. - */ - public OrganizationSharedBuiltInAuthorizationPolicy() { - } - - /** - * Get the type property: Authorization scheme type. - * - * @return the type value. - */ - @Override - public BuiltInAuthorizationScheme type() { - return this.type; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OrganizationSharedBuiltInAuthorizationPolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OrganizationSharedBuiltInAuthorizationPolicy 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 OrganizationSharedBuiltInAuthorizationPolicy. - */ - public static OrganizationSharedBuiltInAuthorizationPolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OrganizationSharedBuiltInAuthorizationPolicy deserializedOrganizationSharedBuiltInAuthorizationPolicy - = new OrganizationSharedBuiltInAuthorizationPolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedOrganizationSharedBuiltInAuthorizationPolicy.type - = BuiltInAuthorizationScheme.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedOrganizationSharedBuiltInAuthorizationPolicy; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Origin.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Origin.java deleted file mode 100644 index 2042adc83ad0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Origin.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value - * is "user,system". - */ -public final class Origin extends ExpandableStringEnum { - /** - * Indicates the operation is initiated by a user. - */ - public static final Origin USER = fromString("user"); - - /** - * Indicates the operation is initiated by a system. - */ - public static final Origin SYSTEM = fromString("system"); - - /** - * Indicates the operation is initiated by a user or system. - */ - public static final Origin USER_SYSTEM = fromString("user,system"); - - /** - * Creates a new instance of Origin value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Origin() { - } - - /** - * Creates or finds a Origin from its string representation. - * - * @param name a name to look for. - * @return the corresponding Origin. - */ - public static Origin fromString(String name) { - return fromString(name, Origin.class); - } - - /** - * Gets known Origin values. - * - * @return known Origin values. - */ - public static Collection values() { - return values(Origin.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRule.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRule.java deleted file mode 100644 index f0d16e260d04..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRule.java +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Outbound Rule for the managed network of a cognitive services account. - */ -@Fluent -public class OutboundRule implements JsonSerializable { - /* - * Type of a managed network Outbound Rule of a cognitive services account. - */ - private RuleType type = RuleType.fromString("OutboundRule"); - - /* - * Category of a managed network Outbound Rule of a cognitive services account. - */ - private RuleCategory category; - - /* - * Type of a managed network Outbound Rule of a cognitive services account. - */ - private RuleStatus status; - - /* - * Error information about an outbound rule of a cognitive services account if RuleStatus is failed. - */ - private String errorInformation; - - /* - * The parentRuleNames property. - */ - private List parentRuleNames; - - /** - * Creates an instance of OutboundRule class. - */ - public OutboundRule() { - } - - /** - * Get the type property: Type of a managed network Outbound Rule of a cognitive services account. - * - * @return the type value. - */ - public RuleType type() { - return this.type; - } - - /** - * Get the category property: Category of a managed network Outbound Rule of a cognitive services account. - * - * @return the category value. - */ - public RuleCategory category() { - return this.category; - } - - /** - * Set the category property: Category of a managed network Outbound Rule of a cognitive services account. - * - * @param category the category value to set. - * @return the OutboundRule object itself. - */ - public OutboundRule withCategory(RuleCategory category) { - this.category = category; - return this; - } - - /** - * Get the status property: Type of a managed network Outbound Rule of a cognitive services account. - * - * @return the status value. - */ - public RuleStatus status() { - return this.status; - } - - /** - * Set the status property: Type of a managed network Outbound Rule of a cognitive services account. - * - * @param status the status value to set. - * @return the OutboundRule object itself. - */ - public OutboundRule withStatus(RuleStatus status) { - this.status = status; - return this; - } - - /** - * Get the errorInformation property: Error information about an outbound rule of a cognitive services account if - * RuleStatus is failed. - * - * @return the errorInformation value. - */ - public String errorInformation() { - return this.errorInformation; - } - - /** - * Set the errorInformation property: Error information about an outbound rule of a cognitive services account if - * RuleStatus is failed. - * - * @param errorInformation the errorInformation value to set. - * @return the OutboundRule object itself. - */ - OutboundRule withErrorInformation(String errorInformation) { - this.errorInformation = errorInformation; - return this; - } - - /** - * Get the parentRuleNames property: The parentRuleNames property. - * - * @return the parentRuleNames value. - */ - public List parentRuleNames() { - return this.parentRuleNames; - } - - /** - * Set the parentRuleNames property: The parentRuleNames property. - * - * @param parentRuleNames the parentRuleNames value to set. - * @return the OutboundRule object itself. - */ - OutboundRule withParentRuleNames(List parentRuleNames) { - this.parentRuleNames = parentRuleNames; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("category", this.category == null ? null : this.category.toString()); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OutboundRule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OutboundRule 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 OutboundRule. - */ - public static OutboundRule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("type".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("FQDN".equals(discriminatorValue)) { - return FqdnOutboundRule.fromJson(readerToUse.reset()); - } else if ("PrivateEndpoint".equals(discriminatorValue)) { - return PrivateEndpointOutboundRule.fromJson(readerToUse.reset()); - } else if ("ServiceTag".equals(discriminatorValue)) { - return ServiceTagOutboundRule.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static OutboundRule fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OutboundRule deserializedOutboundRule = new OutboundRule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedOutboundRule.type = RuleType.fromString(reader.getString()); - } else if ("category".equals(fieldName)) { - deserializedOutboundRule.category = RuleCategory.fromString(reader.getString()); - } else if ("status".equals(fieldName)) { - deserializedOutboundRule.status = RuleStatus.fromString(reader.getString()); - } else if ("errorInformation".equals(fieldName)) { - deserializedOutboundRule.errorInformation = reader.getString(); - } else if ("parentRuleNames".equals(fieldName)) { - List parentRuleNames = reader.readArray(reader1 -> reader1.getString()); - deserializedOutboundRule.parentRuleNames = parentRuleNames; - } else { - reader.skipChildren(); - } - } - - return deserializedOutboundRule; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRuleBasicResource.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRuleBasicResource.java deleted file mode 100644 index 86688a8183ff..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRuleBasicResource.java +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleBasicResourceInner; - -/** - * An immutable client-side representation of OutboundRuleBasicResource. - */ -public interface OutboundRuleBasicResource { - /** - * 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: Outbound Rule for the managed network of a cognitive services account. - * - * @return the properties value. - */ - OutboundRule properties(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleBasicResourceInner object. - * - * @return the inner object. - */ - OutboundRuleBasicResourceInner innerModel(); - - /** - * The entirety of the OutboundRuleBasicResource definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, DefinitionStages.WithCreate { - } - - /** - * The OutboundRuleBasicResource definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the OutboundRuleBasicResource definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the OutboundRuleBasicResource definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, accountName, managedNetworkName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @return the next definition stage. - */ - WithProperties withExistingManagedNetwork(String resourceGroupName, String accountName, - String managedNetworkName); - } - - /** - * The stage of the OutboundRuleBasicResource definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Outbound Rule for the managed network of a cognitive services - * account.. - * - * @param properties Outbound Rule for the managed network of a cognitive services account. - * @return the next definition stage. - */ - WithCreate withProperties(OutboundRule properties); - } - - /** - * The stage of the OutboundRuleBasicResource 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 { - /** - * Executes the create request. - * - * @return the created resource. - */ - OutboundRuleBasicResource create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - OutboundRuleBasicResource create(Context context); - } - } - - /** - * Begins update for the OutboundRuleBasicResource resource. - * - * @return the stage of resource update. - */ - OutboundRuleBasicResource.Update update(); - - /** - * The template for OutboundRuleBasicResource update. - */ - interface Update extends UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - OutboundRuleBasicResource apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - OutboundRuleBasicResource apply(Context context); - } - - /** - * The OutboundRuleBasicResource update stages. - */ - interface UpdateStages { - /** - * The stage of the OutboundRuleBasicResource update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Outbound Rule for the managed network of a cognitive services - * account.. - * - * @param properties Outbound Rule for the managed network of a cognitive services account. - * @return the next definition stage. - */ - Update withProperties(OutboundRule properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - OutboundRuleBasicResource refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - OutboundRuleBasicResource refresh(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRules.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRules.java deleted file mode 100644 index 8de7cdd5199c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRules.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 OutboundRules. - */ -public interface OutboundRules { - /** - * The GET API for retrieving a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound 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 concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, - String managedNetworkName, String ruleName, Context context); - - /** - * The GET API for retrieving a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type. - */ - OutboundRuleBasicResource get(String resourceGroupName, String accountName, String managedNetworkName, - String ruleName); - - /** - * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String managedNetworkName, String ruleName); - - /** - * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param ruleName Name of the cognitive services account managed network outbound 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 delete(String resourceGroupName, String accountName, String managedNetworkName, String ruleName, - Context context); - - /** - * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, - String managedNetworkName); - - /** - * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive - * services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, - String managedNetworkName, Context context); - - /** - * The GET API for retrieving a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @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 concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. - */ - OutboundRuleBasicResource getById(String id); - - /** - * The GET API for retrieving a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @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 concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @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); - - /** - * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services - * account. - * - * @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 OutboundRuleBasicResource resource. - * - * @param name resource name. - * @return the first stage of the new OutboundRuleBasicResource definition. - */ - OutboundRuleBasicResource.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRulesOperations.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRulesOperations.java deleted file mode 100644 index 9ada8a2992bf..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRulesOperations.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsBasicResourceInner; - -/** - * Resource collection API of OutboundRulesOperations. - */ -public interface OutboundRulesOperations { - /** - * The POST API for updating the outbound rules of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable post(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsBasicResourceInner body); - - /** - * The POST API for updating the outbound rules of the managed network associated with the cognitive services - * account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only - * 'default' is supported. - * @param body The Managed Network Settings object of the account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of outbound rules for the managed network of a cognitive services account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable post(String resourceGroupName, String accountName, - String managedNetworkName, ManagedNetworkSettingsBasicResourceInner body, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatAuthTypeConnectionProperties.java deleted file mode 100644 index 58d620dc96fe..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatAuthTypeConnectionProperties.java +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * The PatAuthTypeConnectionProperties model. - */ -@Fluent -public final class PatAuthTypeConnectionProperties extends ConnectionPropertiesV2 { - /* - * Authentication type of the connection target - */ - private ConnectionAuthType authType = ConnectionAuthType.PAT; - - /* - * The credentials property. - */ - private ConnectionPersonalAccessToken credentials; - - /** - * Creates an instance of PatAuthTypeConnectionProperties class. - */ - public PatAuthTypeConnectionProperties() { - } - - /** - * Get the authType property: Authentication type of the connection target. - * - * @return the authType value. - */ - @Override - public ConnectionAuthType authType() { - return this.authType; - } - - /** - * Get the credentials property: The credentials property. - * - * @return the credentials value. - */ - public ConnectionPersonalAccessToken credentials() { - return this.credentials; - } - - /** - * Set the credentials property: The credentials property. - * - * @param credentials the credentials value to set. - * @return the PatAuthTypeConnectionProperties object itself. - */ - public PatAuthTypeConnectionProperties withCredentials(ConnectionPersonalAccessToken credentials) { - this.credentials = credentials; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PatAuthTypeConnectionProperties withCategory(ConnectionCategory category) { - super.withCategory(category); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PatAuthTypeConnectionProperties withError(String error) { - super.withError(error); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PatAuthTypeConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { - super.withExpiryTime(expiryTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PatAuthTypeConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { - super.withIsSharedToAll(isSharedToAll); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PatAuthTypeConnectionProperties withMetadata(Map metadata) { - super.withMetadata(metadata); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PatAuthTypeConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { - super.withPeRequirement(peRequirement); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PatAuthTypeConnectionProperties withPeStatus(ManagedPEStatus peStatus) { - super.withPeStatus(peStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PatAuthTypeConnectionProperties withSharedUserList(List sharedUserList) { - super.withSharedUserList(sharedUserList); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PatAuthTypeConnectionProperties withTarget(String target) { - super.withTarget(target); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PatAuthTypeConnectionProperties withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { - super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("category", category() == null ? null : category().toString()); - jsonWriter.writeStringField("error", error()); - jsonWriter.writeStringField("expiryTime", - expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); - jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); - jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); - jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); - jsonWriter.writeArrayField("sharedUserList", sharedUserList(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("target", target()); - jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); - jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); - jsonWriter.writeJsonField("credentials", this.credentials); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PatAuthTypeConnectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PatAuthTypeConnectionProperties 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 PatAuthTypeConnectionProperties. - */ - public static PatAuthTypeConnectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PatAuthTypeConnectionProperties deserializedPatAuthTypeConnectionProperties - = new PatAuthTypeConnectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("category".equals(fieldName)) { - deserializedPatAuthTypeConnectionProperties - .withCategory(ConnectionCategory.fromString(reader.getString())); - } else if ("createdByWorkspaceArmId".equals(fieldName)) { - deserializedPatAuthTypeConnectionProperties.withCreatedByWorkspaceArmId(reader.getString()); - } else if ("error".equals(fieldName)) { - deserializedPatAuthTypeConnectionProperties.withError(reader.getString()); - } else if ("expiryTime".equals(fieldName)) { - deserializedPatAuthTypeConnectionProperties.withExpiryTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("group".equals(fieldName)) { - deserializedPatAuthTypeConnectionProperties - .withGroup(ConnectionGroup.fromString(reader.getString())); - } else if ("isSharedToAll".equals(fieldName)) { - deserializedPatAuthTypeConnectionProperties - .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); - } else if ("metadata".equals(fieldName)) { - Map metadata = reader.readMap(reader1 -> reader1.getString()); - deserializedPatAuthTypeConnectionProperties.withMetadata(metadata); - } else if ("peRequirement".equals(fieldName)) { - deserializedPatAuthTypeConnectionProperties - .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); - } else if ("peStatus".equals(fieldName)) { - deserializedPatAuthTypeConnectionProperties - .withPeStatus(ManagedPEStatus.fromString(reader.getString())); - } else if ("sharedUserList".equals(fieldName)) { - List sharedUserList = reader.readArray(reader1 -> reader1.getString()); - deserializedPatAuthTypeConnectionProperties.withSharedUserList(sharedUserList); - } else if ("target".equals(fieldName)) { - deserializedPatAuthTypeConnectionProperties.withTarget(reader.getString()); - } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { - deserializedPatAuthTypeConnectionProperties - .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); - } else if ("authType".equals(fieldName)) { - deserializedPatAuthTypeConnectionProperties.authType - = ConnectionAuthType.fromString(reader.getString()); - } else if ("credentials".equals(fieldName)) { - deserializedPatAuthTypeConnectionProperties.credentials - = ConnectionPersonalAccessToken.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedPatAuthTypeConnectionProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceSku.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceSku.java deleted file mode 100644 index 33fbeb8242db..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceSku.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 object being used to update sku of a resource, in general used for PATCH operations. - */ -@Fluent -public final class PatchResourceSku implements JsonSerializable { - /* - * The resource model definition representing SKU - */ - private Sku sku; - - /** - * Creates an instance of PatchResourceSku class. - */ - public PatchResourceSku() { - } - - /** - * Get the sku property: The resource model definition representing SKU. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The resource model definition representing SKU. - * - * @param sku the sku value to set. - * @return the PatchResourceSku object itself. - */ - public PatchResourceSku withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("sku", this.sku); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PatchResourceSku from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PatchResourceSku 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 PatchResourceSku. - */ - public static PatchResourceSku fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PatchResourceSku deserializedPatchResourceSku = new PatchResourceSku(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sku".equals(fieldName)) { - deserializedPatchResourceSku.sku = Sku.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedPatchResourceSku; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTags.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTags.java deleted file mode 100644 index 3bc0f2889c53..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTags.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * The object being used to update tags of a resource, in general used for PATCH operations. - */ -@Fluent -public class PatchResourceTags implements JsonSerializable { - /* - * Resource tags. - */ - private Map tags; - - /** - * Creates an instance of PatchResourceTags class. - */ - public PatchResourceTags() { - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the PatchResourceTags object itself. - */ - public PatchResourceTags withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PatchResourceTags from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PatchResourceTags 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 PatchResourceTags. - */ - public static PatchResourceTags fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PatchResourceTags deserializedPatchResourceTags = new PatchResourceTags(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedPatchResourceTags.tags = tags; - } else { - reader.skipChildren(); - } - } - - return deserializedPatchResourceTags; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTagsAndSku.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTagsAndSku.java deleted file mode 100644 index ba7b104decc1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTagsAndSku.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.Map; - -/** - * The object being used to update tags and sku of a resource, in general used for PATCH operations. - */ -@Fluent -public final class PatchResourceTagsAndSku extends PatchResourceTags { - /* - * The resource model definition representing SKU - */ - private Sku sku; - - /** - * Creates an instance of PatchResourceTagsAndSku class. - */ - public PatchResourceTagsAndSku() { - } - - /** - * Get the sku property: The resource model definition representing SKU. - * - * @return the sku value. - */ - public Sku sku() { - return this.sku; - } - - /** - * Set the sku property: The resource model definition representing SKU. - * - * @param sku the sku value to set. - * @return the PatchResourceTagsAndSku object itself. - */ - public PatchResourceTagsAndSku withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PatchResourceTagsAndSku withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("sku", this.sku); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PatchResourceTagsAndSku from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PatchResourceTagsAndSku 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 PatchResourceTagsAndSku. - */ - public static PatchResourceTagsAndSku fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PatchResourceTagsAndSku deserializedPatchResourceTagsAndSku = new PatchResourceTagsAndSku(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedPatchResourceTagsAndSku.withTags(tags); - } else if ("sku".equals(fieldName)) { - deserializedPatchResourceTagsAndSku.sku = Sku.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedPatchResourceTagsAndSku; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PolicyAssignmentEvaluationDetails.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PolicyAssignmentEvaluationDetails.java deleted file mode 100644 index 1613c45cb531..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PolicyAssignmentEvaluationDetails.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 non-compliant policy assignment. - */ -@Immutable -public final class PolicyAssignmentEvaluationDetails implements JsonSerializable { - /* - * The policy assignment ID. - */ - private String assignmentId; - - /* - * The policy definition ID. - */ - private String policyDefinitionId; - - /* - * The policy set definition ID. - */ - private String policySetDefinitionId; - - /* - * The evaluation outcome for this assignment. - */ - private PolicyEvaluationOutcome evaluationOutcome; - - /* - * The reason for non-compliance. - */ - private String nonComplianceReason; - - /* - * The policy effect (e.g., Deny, Audit). - */ - private String effect; - - /* - * Expression-level evaluation details. - */ - private List expressionEvaluations; - - /** - * Creates an instance of PolicyAssignmentEvaluationDetails class. - */ - private PolicyAssignmentEvaluationDetails() { - } - - /** - * Get the assignmentId property: The policy assignment ID. - * - * @return the assignmentId value. - */ - public String assignmentId() { - return this.assignmentId; - } - - /** - * Get the policyDefinitionId property: The policy definition ID. - * - * @return the policyDefinitionId value. - */ - public String policyDefinitionId() { - return this.policyDefinitionId; - } - - /** - * Get the policySetDefinitionId property: The policy set definition ID. - * - * @return the policySetDefinitionId value. - */ - public String policySetDefinitionId() { - return this.policySetDefinitionId; - } - - /** - * Get the evaluationOutcome property: The evaluation outcome for this assignment. - * - * @return the evaluationOutcome value. - */ - public PolicyEvaluationOutcome evaluationOutcome() { - return this.evaluationOutcome; - } - - /** - * Get the nonComplianceReason property: The reason for non-compliance. - * - * @return the nonComplianceReason value. - */ - public String nonComplianceReason() { - return this.nonComplianceReason; - } - - /** - * Get the effect property: The policy effect (e.g., Deny, Audit). - * - * @return the effect value. - */ - public String effect() { - return this.effect; - } - - /** - * Get the expressionEvaluations property: Expression-level evaluation details. - * - * @return the expressionEvaluations value. - */ - public List expressionEvaluations() { - return this.expressionEvaluations; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("assignmentId", this.assignmentId); - jsonWriter.writeStringField("policyDefinitionId", this.policyDefinitionId); - jsonWriter.writeStringField("policySetDefinitionId", this.policySetDefinitionId); - jsonWriter.writeStringField("evaluationOutcome", - this.evaluationOutcome == null ? null : this.evaluationOutcome.toString()); - jsonWriter.writeStringField("nonComplianceReason", this.nonComplianceReason); - jsonWriter.writeStringField("effect", this.effect); - jsonWriter.writeArrayField("expressionEvaluations", this.expressionEvaluations, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PolicyAssignmentEvaluationDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PolicyAssignmentEvaluationDetails 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 PolicyAssignmentEvaluationDetails. - */ - public static PolicyAssignmentEvaluationDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PolicyAssignmentEvaluationDetails deserializedPolicyAssignmentEvaluationDetails - = new PolicyAssignmentEvaluationDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("assignmentId".equals(fieldName)) { - deserializedPolicyAssignmentEvaluationDetails.assignmentId = reader.getString(); - } else if ("policyDefinitionId".equals(fieldName)) { - deserializedPolicyAssignmentEvaluationDetails.policyDefinitionId = reader.getString(); - } else if ("policySetDefinitionId".equals(fieldName)) { - deserializedPolicyAssignmentEvaluationDetails.policySetDefinitionId = reader.getString(); - } else if ("evaluationOutcome".equals(fieldName)) { - deserializedPolicyAssignmentEvaluationDetails.evaluationOutcome - = PolicyEvaluationOutcome.fromString(reader.getString()); - } else if ("nonComplianceReason".equals(fieldName)) { - deserializedPolicyAssignmentEvaluationDetails.nonComplianceReason = reader.getString(); - } else if ("effect".equals(fieldName)) { - deserializedPolicyAssignmentEvaluationDetails.effect = reader.getString(); - } else if ("expressionEvaluations".equals(fieldName)) { - List expressionEvaluations - = reader.readArray(reader1 -> PolicyExpressionEvaluationDetails.fromJson(reader1)); - deserializedPolicyAssignmentEvaluationDetails.expressionEvaluations = expressionEvaluations; - } else { - reader.skipChildren(); - } - } - - return deserializedPolicyAssignmentEvaluationDetails; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PolicyEvaluationOutcome.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PolicyEvaluationOutcome.java deleted file mode 100644 index c55849b38796..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PolicyEvaluationOutcome.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The outcome of a policy evaluation. - */ -public final class PolicyEvaluationOutcome extends ExpandableStringEnum { - /** - * The deployment is compliant with all policies. - */ - public static final PolicyEvaluationOutcome COMPLIANT = fromString("Compliant"); - - /** - * The deployment violates one or more policies. - */ - public static final PolicyEvaluationOutcome NON_COMPLIANT = fromString("NonCompliant"); - - /** - * An error occurred during evaluation. - */ - public static final PolicyEvaluationOutcome ERROR = fromString("Error"); - - /** - * Creates a new instance of PolicyEvaluationOutcome value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public PolicyEvaluationOutcome() { - } - - /** - * Creates or finds a PolicyEvaluationOutcome from its string representation. - * - * @param name a name to look for. - * @return the corresponding PolicyEvaluationOutcome. - */ - public static PolicyEvaluationOutcome fromString(String name) { - return fromString(name, PolicyEvaluationOutcome.class); - } - - /** - * Gets known PolicyEvaluationOutcome values. - * - * @return known PolicyEvaluationOutcome values. - */ - public static Collection values() { - return values(PolicyEvaluationOutcome.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PolicyExpressionEvaluationDetails.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PolicyExpressionEvaluationDetails.java deleted file mode 100644 index 4b303be83294..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PolicyExpressionEvaluationDetails.java +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Details of a policy expression evaluation. - */ -@Immutable -public final class PolicyExpressionEvaluationDetails implements JsonSerializable { - /* - * The policy expression. - */ - private String expression; - - /* - * The kind of expression. - */ - private String expressionKind; - - /* - * The operator used in evaluation. - */ - private String operator; - - /* - * The evaluation result. - */ - private String result; - - /* - * The target value of the expression. - */ - private String targetValue; - - /* - * The actual value of the expression. - */ - private String expressionValue; - - /** - * Creates an instance of PolicyExpressionEvaluationDetails class. - */ - private PolicyExpressionEvaluationDetails() { - } - - /** - * Get the expression property: The policy expression. - * - * @return the expression value. - */ - public String expression() { - return this.expression; - } - - /** - * Get the expressionKind property: The kind of expression. - * - * @return the expressionKind value. - */ - public String expressionKind() { - return this.expressionKind; - } - - /** - * Get the operator property: The operator used in evaluation. - * - * @return the operator value. - */ - public String operator() { - return this.operator; - } - - /** - * Get the result property: The evaluation result. - * - * @return the result value. - */ - public String result() { - return this.result; - } - - /** - * Get the targetValue property: The target value of the expression. - * - * @return the targetValue value. - */ - public String targetValue() { - return this.targetValue; - } - - /** - * Get the expressionValue property: The actual value of the expression. - * - * @return the expressionValue value. - */ - public String expressionValue() { - return this.expressionValue; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("expression", this.expression); - jsonWriter.writeStringField("expressionKind", this.expressionKind); - jsonWriter.writeStringField("operator", this.operator); - jsonWriter.writeStringField("result", this.result); - jsonWriter.writeStringField("targetValue", this.targetValue); - jsonWriter.writeStringField("expressionValue", this.expressionValue); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PolicyExpressionEvaluationDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PolicyExpressionEvaluationDetails 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 PolicyExpressionEvaluationDetails. - */ - public static PolicyExpressionEvaluationDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PolicyExpressionEvaluationDetails deserializedPolicyExpressionEvaluationDetails - = new PolicyExpressionEvaluationDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("expression".equals(fieldName)) { - deserializedPolicyExpressionEvaluationDetails.expression = reader.getString(); - } else if ("expressionKind".equals(fieldName)) { - deserializedPolicyExpressionEvaluationDetails.expressionKind = reader.getString(); - } else if ("operator".equals(fieldName)) { - deserializedPolicyExpressionEvaluationDetails.operator = reader.getString(); - } else if ("result".equals(fieldName)) { - deserializedPolicyExpressionEvaluationDetails.result = reader.getString(); - } else if ("targetValue".equals(fieldName)) { - deserializedPolicyExpressionEvaluationDetails.targetValue = reader.getString(); - } else if ("expressionValue".equals(fieldName)) { - deserializedPolicyExpressionEvaluationDetails.expressionValue = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPolicyExpressionEvaluationDetails; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Pool.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Pool.java deleted file mode 100644 index f9142ab01827..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Pool.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * A compute pool configuration. - */ -@Fluent -public final class Pool implements JsonSerializable { - /* - * The name of the pool. - */ - private String name; - - /* - * The VM priority of the pool. - */ - private VmPriority vmPriority; - - /* - * The instance type (VM SKU) used in the pool. - */ - private String instanceType; - - /* - * The number of nodes in the pool. - */ - private int nodeCount; - - /** - * Creates an instance of Pool class. - */ - public Pool() { - } - - /** - * Get the name property: The name of the pool. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the pool. - * - * @param name the name value to set. - * @return the Pool object itself. - */ - public Pool withName(String name) { - this.name = name; - return this; - } - - /** - * Get the vmPriority property: The VM priority of the pool. - * - * @return the vmPriority value. - */ - public VmPriority vmPriority() { - return this.vmPriority; - } - - /** - * Set the vmPriority property: The VM priority of the pool. - * - * @param vmPriority the vmPriority value to set. - * @return the Pool object itself. - */ - public Pool withVmPriority(VmPriority vmPriority) { - this.vmPriority = vmPriority; - return this; - } - - /** - * Get the instanceType property: The instance type (VM SKU) used in the pool. - * - * @return the instanceType value. - */ - public String instanceType() { - return this.instanceType; - } - - /** - * Set the instanceType property: The instance type (VM SKU) used in the pool. - * - * @param instanceType the instanceType value to set. - * @return the Pool object itself. - */ - public Pool withInstanceType(String instanceType) { - this.instanceType = instanceType; - return this; - } - - /** - * Get the nodeCount property: The number of nodes in the pool. - * - * @return the nodeCount value. - */ - public int nodeCount() { - return this.nodeCount; - } - - /** - * Set the nodeCount property: The number of nodes in the pool. - * - * @param nodeCount the nodeCount value to set. - * @return the Pool object itself. - */ - public Pool withNodeCount(int nodeCount) { - this.nodeCount = nodeCount; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("vmPriority", this.vmPriority == null ? null : this.vmPriority.toString()); - jsonWriter.writeStringField("instanceType", this.instanceType); - jsonWriter.writeIntField("nodeCount", this.nodeCount); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Pool from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Pool 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 Pool. - */ - public static Pool fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Pool deserializedPool = new Pool(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedPool.name = reader.getString(); - } else if ("vmPriority".equals(fieldName)) { - deserializedPool.vmPriority = VmPriority.fromString(reader.getString()); - } else if ("instanceType".equals(fieldName)) { - deserializedPool.instanceType = reader.getString(); - } else if ("nodeCount".equals(fieldName)) { - deserializedPool.nodeCount = reader.getInt(); - } else { - reader.skipChildren(); - } - } - - return deserializedPool; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpoint.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpoint.java deleted file mode 100644 index a52b4bd1c420..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpoint.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The private endpoint resource. - */ -@Immutable -public final class PrivateEndpoint implements JsonSerializable { - /* - * The resource identifier of the private endpoint - */ - private String id; - - /** - * Creates an instance of PrivateEndpoint class. - */ - public PrivateEndpoint() { - } - - /** - * Get the id property: The resource identifier of the private endpoint. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateEndpoint from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpoint 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 PrivateEndpoint. - */ - public static PrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpoint deserializedPrivateEndpoint = new PrivateEndpoint(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedPrivateEndpoint.id = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpoint; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnection.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnection.java deleted file mode 100644 index cb0a222e9cb2..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnection.java +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionInner; - -/** - * An immutable client-side representation of PrivateEndpointConnection. - */ -public interface PrivateEndpointConnection { - /** - * 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: Resource properties. - * - * @return the properties value. - */ - PrivateEndpointConnectionProperties properties(); - - /** - * Gets the etag property: Resource Etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the location property: The location of the private endpoint connection. - * - * @return the location value. - */ - String location(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionInner object. - * - * @return the inner object. - */ - PrivateEndpointConnectionInner innerModel(); - - /** - * The entirety of the PrivateEndpointConnection definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The PrivateEndpointConnection definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the PrivateEndpointConnection definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the PrivateEndpointConnection definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, accountName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @return the next definition stage. - */ - WithCreate withExistingAccount(String resourceGroupName, String accountName); - } - - /** - * The stage of the PrivateEndpointConnection 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.WithLocation, DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - PrivateEndpointConnection create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - PrivateEndpointConnection create(Context context); - } - - /** - * The stage of the PrivateEndpointConnection definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The location of the private endpoint connection. - * @return the next definition stage. - */ - WithCreate withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The location of the private endpoint connection. - * @return the next definition stage. - */ - WithCreate withRegion(String location); - } - - /** - * The stage of the PrivateEndpointConnection definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Resource properties.. - * - * @param properties Resource properties. - * @return the next definition stage. - */ - WithCreate withProperties(PrivateEndpointConnectionProperties properties); - } - } - - /** - * Begins update for the PrivateEndpointConnection resource. - * - * @return the stage of resource update. - */ - PrivateEndpointConnection.Update update(); - - /** - * The template for PrivateEndpointConnection update. - */ - interface Update extends UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - PrivateEndpointConnection apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - PrivateEndpointConnection apply(Context context); - } - - /** - * The PrivateEndpointConnection update stages. - */ - interface UpdateStages { - /** - * The stage of the PrivateEndpointConnection update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Resource properties.. - * - * @param properties Resource properties. - * @return the next definition stage. - */ - Update withProperties(PrivateEndpointConnectionProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - PrivateEndpointConnection refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - PrivateEndpointConnection refresh(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionListResult.java deleted file mode 100644 index e08551a83896..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionListResult.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionListResultInner; -import java.util.List; - -/** - * An immutable client-side representation of PrivateEndpointConnectionListResult. - */ -public interface PrivateEndpointConnectionListResult { - /** - * Gets the value property: Array of private endpoint connections. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionListResultInner - * object. - * - * @return the inner object. - */ - PrivateEndpointConnectionListResultInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionProperties.java deleted file mode 100644 index 57369694d322..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionProperties.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 the PrivateEndpointConnectProperties. - */ -@Fluent -public final class PrivateEndpointConnectionProperties - implements JsonSerializable { - /* - * The resource of private end point. - */ - private PrivateEndpoint privateEndpoint; - - /* - * A collection of information about the state of the connection between service consumer and provider. - */ - private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; - - /* - * The provisioning state of the private endpoint connection resource. - */ - private PrivateEndpointConnectionProvisioningState provisioningState; - - /* - * The private link resource group ids. - */ - private List groupIds; - - /** - * Creates an instance of PrivateEndpointConnectionProperties class. - */ - public PrivateEndpointConnectionProperties() { - } - - /** - * Get the privateEndpoint property: The resource of private end point. - * - * @return the privateEndpoint value. - */ - public PrivateEndpoint privateEndpoint() { - return this.privateEndpoint; - } - - /** - * Set the privateEndpoint property: The resource of private end point. - * - * @param privateEndpoint the privateEndpoint value to set. - * @return the PrivateEndpointConnectionProperties object itself. - */ - public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - this.privateEndpoint = privateEndpoint; - return this; - } - - /** - * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @return the privateLinkServiceConnectionState value. - */ - public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { - return this.privateLinkServiceConnectionState; - } - - /** - * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. - * @return the PrivateEndpointConnectionProperties object itself. - */ - public PrivateEndpointConnectionProperties - withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { - this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the private endpoint connection resource. - * - * @return the provisioningState value. - */ - public PrivateEndpointConnectionProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the groupIds property: The private link resource group ids. - * - * @return the groupIds value. - */ - public List groupIds() { - return this.groupIds; - } - - /** - * Set the groupIds property: The private link resource group ids. - * - * @param groupIds the groupIds value to set. - * @return the PrivateEndpointConnectionProperties object itself. - */ - public PrivateEndpointConnectionProperties withGroupIds(List groupIds) { - this.groupIds = groupIds; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); - jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); - jsonWriter.writeArrayField("groupIds", this.groupIds, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateEndpointConnectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpointConnectionProperties 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 PrivateEndpointConnectionProperties. - */ - public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpointConnectionProperties deserializedPrivateEndpointConnectionProperties - = new PrivateEndpointConnectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("privateLinkServiceConnectionState".equals(fieldName)) { - deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState - = PrivateLinkServiceConnectionState.fromJson(reader); - } else if ("privateEndpoint".equals(fieldName)) { - deserializedPrivateEndpointConnectionProperties.privateEndpoint = PrivateEndpoint.fromJson(reader); - } else if ("provisioningState".equals(fieldName)) { - deserializedPrivateEndpointConnectionProperties.provisioningState - = PrivateEndpointConnectionProvisioningState.fromString(reader.getString()); - } else if ("groupIds".equals(fieldName)) { - List groupIds = reader.readArray(reader1 -> reader1.getString()); - deserializedPrivateEndpointConnectionProperties.groupIds = groupIds; - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpointConnectionProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionProvisioningState.java deleted file mode 100644 index 5a5f1564afb1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionProvisioningState.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The current provisioning state. - */ -public final class PrivateEndpointConnectionProvisioningState - extends ExpandableStringEnum { - /** - * Connection has been provisioned. - */ - public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * Connection is being created. - */ - public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); - - /** - * Connection is being deleted. - */ - public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); - - /** - * Connection provisioning has failed. - */ - public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); - - /** - * Creates a new instance of PrivateEndpointConnectionProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public PrivateEndpointConnectionProvisioningState() { - } - - /** - * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding PrivateEndpointConnectionProvisioningState. - */ - public static PrivateEndpointConnectionProvisioningState fromString(String name) { - return fromString(name, PrivateEndpointConnectionProvisioningState.class); - } - - /** - * Gets known PrivateEndpointConnectionProvisioningState values. - * - * @return known PrivateEndpointConnectionProvisioningState values. - */ - public static Collection values() { - return values(PrivateEndpointConnectionProvisioningState.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnections.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnections.java deleted file mode 100644 index 8c0da4b4f438..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnections.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of PrivateEndpointConnections. - */ -public interface PrivateEndpointConnections { - /** - * Gets the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @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 specified private endpoint connection associated with the Cognitive Services account along with - * {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, - String privateEndpointConnectionName, Context context); - - /** - * Gets the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 private endpoint connection associated with the Cognitive Services account. - */ - PrivateEndpointConnection get(String resourceGroupName, String accountName, String privateEndpointConnectionName); - - /** - * Deletes the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String privateEndpointConnectionName); - - /** - * Deletes the specified private endpoint connection associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @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 accountName, String privateEndpointConnectionName, Context context); - - /** - * Gets the private endpoint connections associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 private endpoint connections associated with the Cognitive Services account along with - * {@link Response}. - */ - Response listWithResponse(String resourceGroupName, String accountName, - Context context); - - /** - * Gets the private endpoint connections associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connections associated with the Cognitive Services account. - */ - PrivateEndpointConnectionListResult list(String resourceGroupName, String accountName); - - /** - * Gets the specified private endpoint connection associated with the Cognitive Services account. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the Cognitive Services account along with - * {@link Response}. - */ - PrivateEndpointConnection getById(String id); - - /** - * Gets the specified private endpoint connection associated with the Cognitive Services account. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the Cognitive Services account along with - * {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes the specified private endpoint connection associated with the Cognitive Services account. - * - * @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 the specified private endpoint connection associated with the Cognitive Services account. - * - * @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 PrivateEndpointConnection resource. - * - * @param name resource name. - * @return the first stage of the new PrivateEndpointConnection definition. - */ - PrivateEndpointConnection.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointOutboundRule.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointOutboundRule.java deleted file mode 100644 index 22204060a5e4..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointOutboundRule.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Private Endpoint outbound rule for the managed network of a cognitive services account. - */ -@Fluent -public final class PrivateEndpointOutboundRule extends OutboundRule { - /* - * Type of a managed network Outbound Rule of a cognitive services account. - */ - private RuleType type = RuleType.PRIVATE_ENDPOINT; - - /* - * Private Endpoint destination. - */ - private PrivateEndpointOutboundRuleDestination destination; - - /* - * List of FQDNs associated with the private endpoint outbound rule. - */ - private List fqdns; - - /** - * Creates an instance of PrivateEndpointOutboundRule class. - */ - public PrivateEndpointOutboundRule() { - } - - /** - * Get the type property: Type of a managed network Outbound Rule of a cognitive services account. - * - * @return the type value. - */ - @Override - public RuleType type() { - return this.type; - } - - /** - * Get the destination property: Private Endpoint destination. - * - * @return the destination value. - */ - public PrivateEndpointOutboundRuleDestination destination() { - return this.destination; - } - - /** - * Set the destination property: Private Endpoint destination. - * - * @param destination the destination value to set. - * @return the PrivateEndpointOutboundRule object itself. - */ - public PrivateEndpointOutboundRule withDestination(PrivateEndpointOutboundRuleDestination destination) { - this.destination = destination; - return this; - } - - /** - * Get the fqdns property: List of FQDNs associated with the private endpoint outbound rule. - * - * @return the fqdns value. - */ - public List fqdns() { - return this.fqdns; - } - - /** - * Set the fqdns property: List of FQDNs associated with the private endpoint outbound rule. - * - * @param fqdns the fqdns value to set. - * @return the PrivateEndpointOutboundRule object itself. - */ - public PrivateEndpointOutboundRule withFqdns(List fqdns) { - this.fqdns = fqdns; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PrivateEndpointOutboundRule withCategory(RuleCategory category) { - super.withCategory(category); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PrivateEndpointOutboundRule withStatus(RuleStatus status) { - super.withStatus(status); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("category", category() == null ? null : category().toString()); - jsonWriter.writeStringField("status", status() == null ? null : status().toString()); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeJsonField("destination", this.destination); - jsonWriter.writeArrayField("fqdns", this.fqdns, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateEndpointOutboundRule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpointOutboundRule 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 PrivateEndpointOutboundRule. - */ - public static PrivateEndpointOutboundRule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpointOutboundRule deserializedPrivateEndpointOutboundRule = new PrivateEndpointOutboundRule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("category".equals(fieldName)) { - deserializedPrivateEndpointOutboundRule.withCategory(RuleCategory.fromString(reader.getString())); - } else if ("status".equals(fieldName)) { - deserializedPrivateEndpointOutboundRule.withStatus(RuleStatus.fromString(reader.getString())); - } else if ("errorInformation".equals(fieldName)) { - deserializedPrivateEndpointOutboundRule.withErrorInformation(reader.getString()); - } else if ("parentRuleNames".equals(fieldName)) { - List parentRuleNames = reader.readArray(reader1 -> reader1.getString()); - deserializedPrivateEndpointOutboundRule.withParentRuleNames(parentRuleNames); - } else if ("type".equals(fieldName)) { - deserializedPrivateEndpointOutboundRule.type = RuleType.fromString(reader.getString()); - } else if ("destination".equals(fieldName)) { - deserializedPrivateEndpointOutboundRule.destination - = PrivateEndpointOutboundRuleDestination.fromJson(reader); - } else if ("fqdns".equals(fieldName)) { - List fqdns = reader.readArray(reader1 -> reader1.getString()); - deserializedPrivateEndpointOutboundRule.fqdns = fqdns; - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpointOutboundRule; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointOutboundRuleDestination.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointOutboundRuleDestination.java deleted file mode 100644 index c685f722181e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointOutboundRuleDestination.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Private Endpoint destination for an outbound rule. - */ -@Fluent -public final class PrivateEndpointOutboundRuleDestination - implements JsonSerializable { - /* - * The Azure resource ID of the target private endpoint service. - */ - private String serviceResourceId; - - /* - * The subresource of the target service to connect to. - */ - private String subresourceTarget; - - /** - * Creates an instance of PrivateEndpointOutboundRuleDestination class. - */ - public PrivateEndpointOutboundRuleDestination() { - } - - /** - * Get the serviceResourceId property: The Azure resource ID of the target private endpoint service. - * - * @return the serviceResourceId value. - */ - public String serviceResourceId() { - return this.serviceResourceId; - } - - /** - * Set the serviceResourceId property: The Azure resource ID of the target private endpoint service. - * - * @param serviceResourceId the serviceResourceId value to set. - * @return the PrivateEndpointOutboundRuleDestination object itself. - */ - public PrivateEndpointOutboundRuleDestination withServiceResourceId(String serviceResourceId) { - this.serviceResourceId = serviceResourceId; - return this; - } - - /** - * Get the subresourceTarget property: The subresource of the target service to connect to. - * - * @return the subresourceTarget value. - */ - public String subresourceTarget() { - return this.subresourceTarget; - } - - /** - * Set the subresourceTarget property: The subresource of the target service to connect to. - * - * @param subresourceTarget the subresourceTarget value to set. - * @return the PrivateEndpointOutboundRuleDestination object itself. - */ - public PrivateEndpointOutboundRuleDestination withSubresourceTarget(String subresourceTarget) { - this.subresourceTarget = subresourceTarget; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("serviceResourceId", this.serviceResourceId); - jsonWriter.writeStringField("subresourceTarget", this.subresourceTarget); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateEndpointOutboundRuleDestination from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpointOutboundRuleDestination 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 PrivateEndpointOutboundRuleDestination. - */ - public static PrivateEndpointOutboundRuleDestination fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpointOutboundRuleDestination deserializedPrivateEndpointOutboundRuleDestination - = new PrivateEndpointOutboundRuleDestination(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("serviceResourceId".equals(fieldName)) { - deserializedPrivateEndpointOutboundRuleDestination.serviceResourceId = reader.getString(); - } else if ("subresourceTarget".equals(fieldName)) { - deserializedPrivateEndpointOutboundRuleDestination.subresourceTarget = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpointOutboundRuleDestination; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointServiceConnectionStatus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointServiceConnectionStatus.java deleted file mode 100644 index 2234525b4ef9..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointServiceConnectionStatus.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The private endpoint connection status. - */ -public final class PrivateEndpointServiceConnectionStatus - extends ExpandableStringEnum { - /** - * Connection waiting for approval or rejection. - */ - public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); - - /** - * Connection approved. - */ - public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); - - /** - * Connection Rejected. - */ - public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); - - /** - * Creates a new instance of PrivateEndpointServiceConnectionStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public PrivateEndpointServiceConnectionStatus() { - } - - /** - * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding PrivateEndpointServiceConnectionStatus. - */ - public static PrivateEndpointServiceConnectionStatus fromString(String name) { - return fromString(name, PrivateEndpointServiceConnectionStatus.class); - } - - /** - * Gets known PrivateEndpointServiceConnectionStatus values. - * - * @return known PrivateEndpointServiceConnectionStatus values. - */ - public static Collection values() { - return values(PrivateEndpointServiceConnectionStatus.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResource.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResource.java deleted file mode 100644 index e35abaeb2ef2..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResource.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * A private link resource. - */ -@Immutable -public final class PrivateLinkResource extends ProxyResource { - /* - * Resource properties. - */ - private PrivateLinkResourceProperties 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 PrivateLinkResource class. - */ - private PrivateLinkResource() { - } - - /** - * Get the properties property: Resource properties. - * - * @return the properties value. - */ - public PrivateLinkResourceProperties properties() { - return this.properties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateLinkResource from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateLinkResource 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 PrivateLinkResource. - */ - public static PrivateLinkResource fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateLinkResource deserializedPrivateLinkResource = new PrivateLinkResource(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedPrivateLinkResource.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedPrivateLinkResource.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedPrivateLinkResource.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedPrivateLinkResource.properties = PrivateLinkResourceProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedPrivateLinkResource.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateLinkResource; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResourceListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResourceListResult.java deleted file mode 100644 index efc23025a9ae..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResourceListResult.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateLinkResourceListResultInner; -import java.util.List; - -/** - * An immutable client-side representation of PrivateLinkResourceListResult. - */ -public interface PrivateLinkResourceListResult { - /** - * Gets the value property: Array of private link resources. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateLinkResourceListResultInner - * object. - * - * @return the inner object. - */ - PrivateLinkResourceListResultInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResourceProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResourceProperties.java deleted file mode 100644 index 7170a6fa06d6..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResourceProperties.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Properties of a private link resource. - */ -@Immutable -public final class PrivateLinkResourceProperties implements JsonSerializable { - /* - * The private link resource group id. - */ - private String groupId; - - /* - * The private link resource required member names. - */ - private List requiredMembers; - - /* - * The private link resource Private link DNS zone name. - */ - private List requiredZoneNames; - - /* - * The private link resource display name. - */ - private String displayName; - - /** - * Creates an instance of PrivateLinkResourceProperties class. - */ - private PrivateLinkResourceProperties() { - } - - /** - * Get the groupId property: The private link resource group id. - * - * @return the groupId value. - */ - public String groupId() { - return this.groupId; - } - - /** - * Get the requiredMembers property: The private link resource required member names. - * - * @return the requiredMembers value. - */ - public List requiredMembers() { - return this.requiredMembers; - } - - /** - * Get the requiredZoneNames property: The private link resource Private link DNS zone name. - * - * @return the requiredZoneNames value. - */ - public List requiredZoneNames() { - return this.requiredZoneNames; - } - - /** - * Get the displayName property: The private link resource display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("requiredZoneNames", this.requiredZoneNames, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateLinkResourceProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateLinkResourceProperties 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 PrivateLinkResourceProperties. - */ - public static PrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateLinkResourceProperties deserializedPrivateLinkResourceProperties - = new PrivateLinkResourceProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("groupId".equals(fieldName)) { - deserializedPrivateLinkResourceProperties.groupId = reader.getString(); - } else if ("requiredMembers".equals(fieldName)) { - List requiredMembers = reader.readArray(reader1 -> reader1.getString()); - deserializedPrivateLinkResourceProperties.requiredMembers = requiredMembers; - } else if ("requiredZoneNames".equals(fieldName)) { - List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); - deserializedPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames; - } else if ("displayName".equals(fieldName)) { - deserializedPrivateLinkResourceProperties.displayName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateLinkResourceProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResources.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResources.java deleted file mode 100644 index 1cefdbe6d1c8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResources.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of PrivateLinkResources. - */ -public interface PrivateLinkResources { - /** - * Gets the private link resources that need to be created for a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 private link resources that need to be created for a Cognitive Services account along with - * {@link Response}. - */ - Response listWithResponse(String resourceGroupName, String accountName, - Context context); - - /** - * Gets the private link resources that need to be created for a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private link resources that need to be created for a Cognitive Services account. - */ - PrivateLinkResourceListResult list(String resourceGroupName, String accountName); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkServiceConnectionState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkServiceConnectionState.java deleted file mode 100644 index 180630ad647a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkServiceConnectionState.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * A collection of information about the state of the connection between service consumer and provider. - */ -@Fluent -public final class PrivateLinkServiceConnectionState implements JsonSerializable { - /* - * Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. - */ - private PrivateEndpointServiceConnectionStatus status; - - /* - * The reason for approval/rejection of the connection. - */ - private String description; - - /* - * A message indicating if changes on the service provider require any updates on the consumer. - */ - private String actionsRequired; - - /** - * Creates an instance of PrivateLinkServiceConnectionState class. - */ - public PrivateLinkServiceConnectionState() { - } - - /** - * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the - * service. - * - * @return the status value. - */ - public PrivateEndpointServiceConnectionStatus status() { - return this.status; - } - - /** - * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the - * service. - * - * @param status the status value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { - this.status = status; - return this; - } - - /** - * Get the description property: The reason for approval/rejection of the connection. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The reason for approval/rejection of the connection. - * - * @param description the description value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on - * the consumer. - * - * @return the actionsRequired value. - */ - public String actionsRequired() { - return this.actionsRequired; - } - - /** - * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on - * the consumer. - * - * @param actionsRequired the actionsRequired value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { - this.actionsRequired = actionsRequired; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeStringField("actionsRequired", this.actionsRequired); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateLinkServiceConnectionState from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateLinkServiceConnectionState 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 PrivateLinkServiceConnectionState. - */ - public static PrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateLinkServiceConnectionState deserializedPrivateLinkServiceConnectionState - = new PrivateLinkServiceConnectionState(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedPrivateLinkServiceConnectionState.status - = PrivateEndpointServiceConnectionStatus.fromString(reader.getString()); - } else if ("description".equals(fieldName)) { - deserializedPrivateLinkServiceConnectionState.description = reader.getString(); - } else if ("actionsRequired".equals(fieldName)) { - deserializedPrivateLinkServiceConnectionState.actionsRequired = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateLinkServiceConnectionState; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Project.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Project.java deleted file mode 100644 index 8f59c5da7232..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Project.java +++ /dev/null @@ -1,307 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectInner; -import java.util.Map; - -/** - * An immutable client-side representation of Project. - */ -public interface Project { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Properties of Cognitive Services project. - * - * @return the properties value. - */ - ProjectProperties properties(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the etag property: Resource Etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the identity property: Identity for the resource. - * - * @return the identity value. - */ - Identity identity(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectInner object. - * - * @return the inner object. - */ - ProjectInner innerModel(); - - /** - * The entirety of the Project definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The Project definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the Project definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the Project definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, accountName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @return the next definition stage. - */ - WithCreate withExistingAccount(String resourceGroupName, String accountName); - } - - /** - * The stage of the Project 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.WithLocation, DefinitionStages.WithTags, - DefinitionStages.WithProperties, DefinitionStages.WithIdentity { - /** - * Executes the create request. - * - * @return the created resource. - */ - Project create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Project create(Context context); - } - - /** - * The stage of the Project definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(String location); - } - - /** - * The stage of the Project definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the Project definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of Cognitive Services project.. - * - * @param properties Properties of Cognitive Services project. - * @return the next definition stage. - */ - WithCreate withProperties(ProjectProperties properties); - } - - /** - * The stage of the Project definition allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: Identity for the resource.. - * - * @param identity Identity for the resource. - * @return the next definition stage. - */ - WithCreate withIdentity(Identity identity); - } - } - - /** - * Begins update for the Project resource. - * - * @return the stage of resource update. - */ - Project.Update update(); - - /** - * The template for Project update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithIdentity { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Project apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Project apply(Context context); - } - - /** - * The Project update stages. - */ - interface UpdateStages { - /** - * The stage of the Project update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the Project update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of Cognitive Services project.. - * - * @param properties Properties of Cognitive Services project. - * @return the next definition stage. - */ - Update withProperties(ProjectProperties properties); - } - - /** - * The stage of the Project update allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: Identity for the resource.. - * - * @param identity Identity for the resource. - * @return the next definition stage. - */ - Update withIdentity(Identity identity); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Project refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Project refresh(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHost.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHost.java deleted file mode 100644 index f35ab7acda77..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHost.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectCapabilityHostInner; - -/** - * An immutable client-side representation of ProjectCapabilityHost. - */ -public interface ProjectCapabilityHost { - /** - * 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: [Required] Additional attributes of the entity. - * - * @return the properties value. - */ - ProjectCapabilityHostProperties properties(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectCapabilityHostInner object. - * - * @return the inner object. - */ - ProjectCapabilityHostInner innerModel(); - - /** - * The entirety of the ProjectCapabilityHost definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, DefinitionStages.WithCreate { - } - - /** - * The ProjectCapabilityHost definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the ProjectCapabilityHost definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the ProjectCapabilityHost definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, accountName, projectName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @return the next definition stage. - */ - WithProperties withExistingProject(String resourceGroupName, String accountName, String projectName); - } - - /** - * The stage of the ProjectCapabilityHost definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: [Required] Additional attributes of the entity.. - * - * @param properties [Required] Additional attributes of the entity. - * @return the next definition stage. - */ - WithCreate withProperties(ProjectCapabilityHostProperties properties); - } - - /** - * The stage of the ProjectCapabilityHost 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 { - /** - * Executes the create request. - * - * @return the created resource. - */ - ProjectCapabilityHost create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - ProjectCapabilityHost create(Context context); - } - } - - /** - * Begins update for the ProjectCapabilityHost resource. - * - * @return the stage of resource update. - */ - ProjectCapabilityHost.Update update(); - - /** - * The template for ProjectCapabilityHost update. - */ - interface Update extends UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - ProjectCapabilityHost apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - ProjectCapabilityHost apply(Context context); - } - - /** - * The ProjectCapabilityHost update stages. - */ - interface UpdateStages { - /** - * The stage of the ProjectCapabilityHost update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: [Required] Additional attributes of the entity.. - * - * @param properties [Required] Additional attributes of the entity. - * @return the next definition stage. - */ - Update withProperties(ProjectCapabilityHostProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - ProjectCapabilityHost refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - ProjectCapabilityHost refresh(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHostProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHostProperties.java deleted file mode 100644 index 1e68fcaffed5..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHostProperties.java +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * The ProjectCapabilityHostProperties model. - */ -@Fluent -public final class ProjectCapabilityHostProperties implements JsonSerializable { - /* - * List of AI services connections. - */ - private List aiServicesConnections; - - /* - * List of connection names from those available in the account or project to be used for vector database (e.g. - * CosmosDB). - */ - private List vectorStoreConnections; - - /* - * List of connection names from those available in the account or project to be used as a storage resource. - */ - private List storageConnections; - - /* - * List of connection names from those available in the account or project to be used for Thread storage. - */ - private List threadStorageConnections; - - /* - * Provisioning state for the CapabilityHost. - */ - private CapabilityHostProvisioningState provisioningState; - - /** - * Creates an instance of ProjectCapabilityHostProperties class. - */ - public ProjectCapabilityHostProperties() { - } - - /** - * Get the aiServicesConnections property: List of AI services connections. - * - * @return the aiServicesConnections value. - */ - public List aiServicesConnections() { - return this.aiServicesConnections; - } - - /** - * Set the aiServicesConnections property: List of AI services connections. - * - * @param aiServicesConnections the aiServicesConnections value to set. - * @return the ProjectCapabilityHostProperties object itself. - */ - public ProjectCapabilityHostProperties withAiServicesConnections(List aiServicesConnections) { - this.aiServicesConnections = aiServicesConnections; - return this; - } - - /** - * Get the vectorStoreConnections property: List of connection names from those available in the account or project - * to be used for vector database (e.g. CosmosDB). - * - * @return the vectorStoreConnections value. - */ - public List vectorStoreConnections() { - return this.vectorStoreConnections; - } - - /** - * Set the vectorStoreConnections property: List of connection names from those available in the account or project - * to be used for vector database (e.g. CosmosDB). - * - * @param vectorStoreConnections the vectorStoreConnections value to set. - * @return the ProjectCapabilityHostProperties object itself. - */ - public ProjectCapabilityHostProperties withVectorStoreConnections(List vectorStoreConnections) { - this.vectorStoreConnections = vectorStoreConnections; - return this; - } - - /** - * Get the storageConnections property: List of connection names from those available in the account or project to - * be used as a storage resource. - * - * @return the storageConnections value. - */ - public List storageConnections() { - return this.storageConnections; - } - - /** - * Set the storageConnections property: List of connection names from those available in the account or project to - * be used as a storage resource. - * - * @param storageConnections the storageConnections value to set. - * @return the ProjectCapabilityHostProperties object itself. - */ - public ProjectCapabilityHostProperties withStorageConnections(List storageConnections) { - this.storageConnections = storageConnections; - return this; - } - - /** - * Get the threadStorageConnections property: List of connection names from those available in the account or - * project to be used for Thread storage. - * - * @return the threadStorageConnections value. - */ - public List threadStorageConnections() { - return this.threadStorageConnections; - } - - /** - * Set the threadStorageConnections property: List of connection names from those available in the account or - * project to be used for Thread storage. - * - * @param threadStorageConnections the threadStorageConnections value to set. - * @return the ProjectCapabilityHostProperties object itself. - */ - public ProjectCapabilityHostProperties withThreadStorageConnections(List threadStorageConnections) { - this.threadStorageConnections = threadStorageConnections; - return this; - } - - /** - * Get the provisioningState property: Provisioning state for the CapabilityHost. - * - * @return the provisioningState value. - */ - public CapabilityHostProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("aiServicesConnections", this.aiServicesConnections, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeArrayField("vectorStoreConnections", this.vectorStoreConnections, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeArrayField("storageConnections", this.storageConnections, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeArrayField("threadStorageConnections", this.threadStorageConnections, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ProjectCapabilityHostProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProjectCapabilityHostProperties 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 ProjectCapabilityHostProperties. - */ - public static ProjectCapabilityHostProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProjectCapabilityHostProperties deserializedProjectCapabilityHostProperties - = new ProjectCapabilityHostProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("aiServicesConnections".equals(fieldName)) { - List aiServicesConnections = reader.readArray(reader1 -> reader1.getString()); - deserializedProjectCapabilityHostProperties.aiServicesConnections = aiServicesConnections; - } else if ("vectorStoreConnections".equals(fieldName)) { - List vectorStoreConnections = reader.readArray(reader1 -> reader1.getString()); - deserializedProjectCapabilityHostProperties.vectorStoreConnections = vectorStoreConnections; - } else if ("storageConnections".equals(fieldName)) { - List storageConnections = reader.readArray(reader1 -> reader1.getString()); - deserializedProjectCapabilityHostProperties.storageConnections = storageConnections; - } else if ("threadStorageConnections".equals(fieldName)) { - List threadStorageConnections = reader.readArray(reader1 -> reader1.getString()); - deserializedProjectCapabilityHostProperties.threadStorageConnections = threadStorageConnections; - } else if ("provisioningState".equals(fieldName)) { - deserializedProjectCapabilityHostProperties.provisioningState - = CapabilityHostProvisioningState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedProjectCapabilityHostProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHosts.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHosts.java deleted file mode 100644 index ff3902e4d967..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHosts.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 ProjectCapabilityHosts. - */ -public interface ProjectCapabilityHosts { - /** - * Get project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 project capabilityHost along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, String projectName, - String capabilityHostName, Context context); - - /** - * Get project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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 project capabilityHost. - */ - ProjectCapabilityHost get(String resourceGroupName, String accountName, String projectName, - String capabilityHostName); - - /** - * Delete project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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. - */ - void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostName); - - /** - * Delete project capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostName The name of the capability host associated with the Cognitive Services 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. - */ - void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostName, - Context context); - - /** - * List capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 paginated list of Project Capability Host entities as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, String projectName); - - /** - * List capabilityHost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @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 paginated list of Project Capability Host entities as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, String projectName, - Context context); - - /** - * Get project capabilityHost. - * - * @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 project capabilityHost along with {@link Response}. - */ - ProjectCapabilityHost getById(String id); - - /** - * Get project capabilityHost. - * - * @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 project capabilityHost along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete project capabilityHost. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete project capabilityHost. - * - * @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 ProjectCapabilityHost resource. - * - * @param name resource name. - * @return the first stage of the new ProjectCapabilityHost definition. - */ - ProjectCapabilityHost.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectConnections.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectConnections.java deleted file mode 100644 index 232f328ed24d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectConnections.java +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 ProjectConnections. - */ -public interface ProjectConnections { - /** - * Lists Cognitive Services project connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @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 connection base resource schema along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, - String projectName, String connectionName, Context context); - - /** - * Lists Cognitive Services project connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. - */ - ConnectionPropertiesV2BasicResource get(String resourceGroupName, String accountName, String projectName, - String connectionName); - - /** - * Delete Cognitive Services project connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, - String connectionName, Context context); - - /** - * Delete Cognitive Services project connection by name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String projectName, String connectionName); - - /** - * Lists all the available Cognitive Services project connections under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, - String projectName); - - /** - * Lists all the available Cognitive Services project connections under the specified project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param target Target of the connection. - * @param category Category of the connection. - * @param includeAll query parameter that indicates if get connection call should return both connections and - * datastores. - * @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 paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, - String projectName, String target, String category, Boolean includeAll, Context context); - - /** - * Lists Cognitive Services project connection by name. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response}. - */ - ConnectionPropertiesV2BasicResource getById(String id); - - /** - * Lists Cognitive Services project connection by name. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete Cognitive Services project connection by name. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete Cognitive Services project connection by name. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new ConnectionPropertiesV2BasicResource resource. - * - * @param name resource name. - * @return the first stage of the new ConnectionPropertiesV2BasicResource definition. - */ - ConnectionPropertiesV2BasicResource.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectProperties.java deleted file mode 100644 index 2b7c1066a408..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectProperties.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Properties of Cognitive Services Project'. - */ -@Fluent -public final class ProjectProperties implements JsonSerializable { - /* - * Gets the status of the cognitive services project at the time the operation was called. - */ - private ProvisioningState provisioningState; - - /* - * The display name of the Cognitive Services Project. - */ - private String displayName; - - /* - * The description of the Cognitive Services Project. - */ - private String description; - - /* - * The list of endpoint for this Cognitive Services Project. - */ - private Map endpoints; - - /* - * Indicates whether the project is the default project for the account. - */ - private Boolean isDefault; - - /** - * Creates an instance of ProjectProperties class. - */ - public ProjectProperties() { - } - - /** - * Get the provisioningState property: Gets the status of the cognitive services project at the time the operation - * was called. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the displayName property: The display name of the Cognitive Services Project. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the Cognitive Services Project. - * - * @param displayName the displayName value to set. - * @return the ProjectProperties object itself. - */ - public ProjectProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the description property: The description of the Cognitive Services Project. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description of the Cognitive Services Project. - * - * @param description the description value to set. - * @return the ProjectProperties object itself. - */ - public ProjectProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the endpoints property: The list of endpoint for this Cognitive Services Project. - * - * @return the endpoints value. - */ - public Map endpoints() { - return this.endpoints; - } - - /** - * Get the isDefault property: Indicates whether the project is the default project for the account. - * - * @return the isDefault value. - */ - public Boolean isDefault() { - return this.isDefault; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeStringField("description", this.description); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ProjectProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProjectProperties 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 ProjectProperties. - */ - public static ProjectProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProjectProperties deserializedProjectProperties = new ProjectProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningState".equals(fieldName)) { - deserializedProjectProperties.provisioningState = ProvisioningState.fromString(reader.getString()); - } else if ("displayName".equals(fieldName)) { - deserializedProjectProperties.displayName = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedProjectProperties.description = reader.getString(); - } else if ("endpoints".equals(fieldName)) { - Map endpoints = reader.readMap(reader1 -> reader1.getString()); - deserializedProjectProperties.endpoints = endpoints; - } else if ("isDefault".equals(fieldName)) { - deserializedProjectProperties.isDefault = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedProjectProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Projects.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Projects.java deleted file mode 100644 index 6e69108d07a5..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Projects.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 Projects. - */ -public interface Projects { - /** - * Returns a Cognitive Services project specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @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 cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, String projectName, - Context context); - - /** - * Returns a Cognitive Services project specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU. - */ - Project get(String resourceGroupName, String accountName, String projectName); - - /** - * Deletes a Cognitive Services project from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String projectName); - - /** - * Deletes a Cognitive Services project from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @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 accountName, String projectName, Context context); - - /** - * Returns all the projects in a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 cognitive services projects operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Returns all the projects in a Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 cognitive services projects operation response as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, Context context); - - /** - * Returns a Cognitive Services project specified by the parameters. - * - * @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 cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU along with {@link Response}. - */ - Project getById(String id); - - /** - * Returns a Cognitive Services project specified by the parameters. - * - * @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 cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes a Cognitive Services project from the resource group. - * - * @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 a Cognitive Services project from the resource group. - * - * @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 Project resource. - * - * @param name resource name. - * @return the first stage of the new Project definition. - */ - Project.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningIssue.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningIssue.java deleted file mode 100644 index 0c5a1112beec..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningIssue.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ProvisioningIssue model. - */ -@Immutable -public final class ProvisioningIssue implements JsonSerializable { - /* - * Name of the NSP provisioning issue - */ - private String name; - - /* - * Properties of Provisioning Issue - */ - private ProvisioningIssueProperties properties; - - /** - * Creates an instance of ProvisioningIssue class. - */ - private ProvisioningIssue() { - } - - /** - * Get the name property: Name of the NSP provisioning issue. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the properties property: Properties of Provisioning Issue. - * - * @return the properties value. - */ - public ProvisioningIssueProperties properties() { - return this.properties; - } - - /** - * {@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 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/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningIssueProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningIssueProperties.java deleted file mode 100644 index abd991261c78..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningIssueProperties.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Properties of Provisioning Issue. - */ -@Immutable -public final class ProvisioningIssueProperties implements JsonSerializable { - /* - * Type of Issue - */ - private String issueType; - - /* - * Severity of the issue - */ - private String severity; - - /* - * Description of the issue - */ - private String description; - - /* - * IDs of resources that can be associated to the same perimeter to remediate the issue. - */ - private List suggestedResourceIds; - - /* - * Optional array, suggested access rules - */ - private List suggestedAccessRules; - - /** - * Creates an instance of ProvisioningIssueProperties class. - */ - private ProvisioningIssueProperties() { - } - - /** - * Get the issueType property: Type of Issue. - * - * @return the issueType value. - */ - public String issueType() { - return this.issueType; - } - - /** - * Get the severity property: Severity of the issue. - * - * @return the severity value. - */ - public String 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: IDs of resources that can be associated to the same perimeter to remediate - * the issue. - * - * @return the suggestedResourceIds value. - */ - public List suggestedResourceIds() { - return this.suggestedResourceIds; - } - - /** - * Get the suggestedAccessRules property: Optional array, suggested access rules. - * - * @return the suggestedAccessRules value. - */ - public List suggestedAccessRules() { - return this.suggestedAccessRules; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("issueType", this.issueType); - jsonWriter.writeStringField("severity", this.severity); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeArrayField("suggestedResourceIds", this.suggestedResourceIds, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeArrayField("suggestedAccessRules", this.suggestedAccessRules, - (writer, element) -> writer.writeJson(element)); - 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 = reader.getString(); - } else if ("severity".equals(fieldName)) { - deserializedProvisioningIssueProperties.severity = 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 -> NetworkSecurityPerimeterAccessRule.fromJson(reader1)); - deserializedProvisioningIssueProperties.suggestedAccessRules = suggestedAccessRules; - } else { - reader.skipChildren(); - } - } - - return deserializedProvisioningIssueProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningState.java deleted file mode 100644 index 0bbe1646973e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningState.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Gets the status of the cognitive services account at the time the operation was called. - */ -public final class ProvisioningState extends ExpandableStringEnum { - /** - * Static value Accepted for ProvisioningState. - */ - public static final ProvisioningState ACCEPTED = fromString("Accepted"); - - /** - * Static value Creating for ProvisioningState. - */ - public static final ProvisioningState CREATING = fromString("Creating"); - - /** - * Static value Deleting for ProvisioningState. - */ - public static final ProvisioningState DELETING = fromString("Deleting"); - - /** - * Static value Moving for ProvisioningState. - */ - public static final ProvisioningState MOVING = fromString("Moving"); - - /** - * Static value Failed for ProvisioningState. - */ - public static final ProvisioningState FAILED = fromString("Failed"); - - /** - * Static value Succeeded for ProvisioningState. - */ - public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Canceled for ProvisioningState. - */ - public static final ProvisioningState CANCELED = fromString("Canceled"); - - /** - * Static value ResolvingDNS for ProvisioningState. - */ - public static final ProvisioningState RESOLVING_DNS = fromString("ResolvingDNS"); - - /** - * Creates a new instance of ProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ProvisioningState() { - } - - /** - * Creates or finds a ProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProvisioningState. - */ - public static ProvisioningState fromString(String name) { - return fromString(name, ProvisioningState.class); - } - - /** - * Gets known ProvisioningState values. - * - * @return known ProvisioningState values. - */ - public static Collection values() { - return values(ProvisioningState.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PublicNetworkAccess.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PublicNetworkAccess.java deleted file mode 100644 index 22fe90cc4ee0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PublicNetworkAccess.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Whether or not public endpoint access is allowed for this account. - */ -public final class PublicNetworkAccess extends ExpandableStringEnum { - /** - * Static value Enabled for PublicNetworkAccess. - */ - public static final PublicNetworkAccess ENABLED = fromString("Enabled"); - - /** - * Static value Disabled for PublicNetworkAccess. - */ - public static final PublicNetworkAccess DISABLED = fromString("Disabled"); - - /** - * Creates a new instance of PublicNetworkAccess value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public PublicNetworkAccess() { - } - - /** - * Creates or finds a PublicNetworkAccess from its string representation. - * - * @param name a name to look for. - * @return the corresponding PublicNetworkAccess. - */ - public static PublicNetworkAccess fromString(String name) { - return fromString(name, PublicNetworkAccess.class); - } - - /** - * Gets known PublicNetworkAccess values. - * - * @return known PublicNetworkAccess values. - */ - public static Collection values() { - return values(PublicNetworkAccess.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaLimit.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaLimit.java deleted file mode 100644 index a7f1a2fff126..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaLimit.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * The QuotaLimit model. - */ -@Immutable -public final class QuotaLimit implements JsonSerializable { - /* - * The count property. - */ - private Float count; - - /* - * The renewalPeriod property. - */ - private Float renewalPeriod; - - /* - * The rules property. - */ - private List rules; - - /** - * Creates an instance of QuotaLimit class. - */ - private QuotaLimit() { - } - - /** - * Get the count property: The count property. - * - * @return the count value. - */ - public Float count() { - return this.count; - } - - /** - * Get the renewalPeriod property: The renewalPeriod property. - * - * @return the renewalPeriod value. - */ - public Float renewalPeriod() { - return this.renewalPeriod; - } - - /** - * Get the rules property: The rules property. - * - * @return the rules value. - */ - public List rules() { - return this.rules; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("count", this.count); - jsonWriter.writeNumberField("renewalPeriod", this.renewalPeriod); - jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QuotaLimit from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QuotaLimit 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 QuotaLimit. - */ - public static QuotaLimit fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QuotaLimit deserializedQuotaLimit = new QuotaLimit(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("count".equals(fieldName)) { - deserializedQuotaLimit.count = reader.getNullable(JsonReader::getFloat); - } else if ("renewalPeriod".equals(fieldName)) { - deserializedQuotaLimit.renewalPeriod = reader.getNullable(JsonReader::getFloat); - } else if ("rules".equals(fieldName)) { - List rules = reader.readArray(reader1 -> ThrottlingRule.fromJson(reader1)); - deserializedQuotaLimit.rules = rules; - } else { - reader.skipChildren(); - } - } - - return deserializedQuotaLimit; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaScopeType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaScopeType.java deleted file mode 100644 index af1bcb4b9a36..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaScopeType.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The quota scope that determines the level at which the quota is applied. - */ -public final class QuotaScopeType extends ExpandableStringEnum { - /** - * Static value Regional for QuotaScopeType. - */ - public static final QuotaScopeType REGIONAL = fromString("Regional"); - - /** - * Static value Global for QuotaScopeType. - */ - public static final QuotaScopeType GLOBAL = fromString("Global"); - - /** - * Static value DataZone for QuotaScopeType. - */ - public static final QuotaScopeType DATA_ZONE = fromString("DataZone"); - - /** - * Static value Classic for QuotaScopeType. - */ - public static final QuotaScopeType CLASSIC = fromString("Classic"); - - /** - * Creates a new instance of QuotaScopeType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public QuotaScopeType() { - } - - /** - * Creates or finds a QuotaScopeType from its string representation. - * - * @param name a name to look for. - * @return the corresponding QuotaScopeType. - */ - public static QuotaScopeType fromString(String name) { - return fromString(name, QuotaScopeType.class); - } - - /** - * Gets known QuotaScopeType values. - * - * @return known QuotaScopeType values. - */ - public static Collection values() { - return values(QuotaScopeType.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTier.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTier.java deleted file mode 100644 index 79173bf5a8cf..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTier.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.QuotaTierInner; - -/** - * An immutable client-side representation of QuotaTier. - */ -public interface QuotaTier { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Properties of quota tier resource. - * - * @return the properties value. - */ - QuotaTierProperties 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.cognitiveservices.fluent.models.QuotaTierInner object. - * - * @return the inner object. - */ - QuotaTierInner innerModel(); - - /** - * The entirety of the QuotaTier definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { - } - - /** - * The QuotaTier definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the QuotaTier definition. - */ - interface Blank extends WithCreate { - } - - /** - * The stage of the QuotaTier definition which contains all the minimum required properties for the resource to - * be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - QuotaTier create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - QuotaTier create(Context context); - } - - /** - * The stage of the QuotaTier definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of quota tier resource.. - * - * @param properties Properties of quota tier resource. - * @return the next definition stage. - */ - WithCreate withProperties(QuotaTierProperties properties); - } - } - - /** - * Begins update for the QuotaTier resource. - * - * @return the stage of resource update. - */ - QuotaTier.Update update(); - - /** - * The template for QuotaTier update. - */ - interface Update extends UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - QuotaTier apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - QuotaTier apply(Context context); - } - - /** - * The QuotaTier update stages. - */ - interface UpdateStages { - /** - * The stage of the QuotaTier update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of quota tier resource.. - * - * @param properties Properties of quota tier resource. - * @return the next definition stage. - */ - Update withProperties(QuotaTierProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - QuotaTier refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - QuotaTier refresh(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTierProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTierProperties.java deleted file mode 100644 index 72bf189a9f44..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTierProperties.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Properties of Quota Tier resource'. - */ -@Fluent -public final class QuotaTierProperties implements JsonSerializable { - /* - * Name of the current quota tier for the subscription. - */ - private String currentTierName; - - /* - * Gets the tier upgrade policy for the subscription. - */ - private TierUpgradePolicy tierUpgradePolicy; - - /* - * The date on which the current tier was assigned to the subscription (UTC). - */ - private OffsetDateTime assignmentDate; - - /* - * Information about the quota tier upgrade eligibility for the subscription. - */ - private QuotaTierUpgradeEligibilityInfo tierUpgradeEligibilityInfo; - - /** - * Creates an instance of QuotaTierProperties class. - */ - public QuotaTierProperties() { - } - - /** - * Get the currentTierName property: Name of the current quota tier for the subscription. - * - * @return the currentTierName value. - */ - public String currentTierName() { - return this.currentTierName; - } - - /** - * Get the tierUpgradePolicy property: Gets the tier upgrade policy for the subscription. - * - * @return the tierUpgradePolicy value. - */ - public TierUpgradePolicy tierUpgradePolicy() { - return this.tierUpgradePolicy; - } - - /** - * Set the tierUpgradePolicy property: Gets the tier upgrade policy for the subscription. - * - * @param tierUpgradePolicy the tierUpgradePolicy value to set. - * @return the QuotaTierProperties object itself. - */ - public QuotaTierProperties withTierUpgradePolicy(TierUpgradePolicy tierUpgradePolicy) { - this.tierUpgradePolicy = tierUpgradePolicy; - return this; - } - - /** - * Get the assignmentDate property: The date on which the current tier was assigned to the subscription (UTC). - * - * @return the assignmentDate value. - */ - public OffsetDateTime assignmentDate() { - return this.assignmentDate; - } - - /** - * Get the tierUpgradeEligibilityInfo property: Information about the quota tier upgrade eligibility for the - * subscription. - * - * @return the tierUpgradeEligibilityInfo value. - */ - public QuotaTierUpgradeEligibilityInfo tierUpgradeEligibilityInfo() { - return this.tierUpgradeEligibilityInfo; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("tierUpgradePolicy", - this.tierUpgradePolicy == null ? null : this.tierUpgradePolicy.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QuotaTierProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QuotaTierProperties 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 QuotaTierProperties. - */ - public static QuotaTierProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QuotaTierProperties deserializedQuotaTierProperties = new QuotaTierProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("currentTierName".equals(fieldName)) { - deserializedQuotaTierProperties.currentTierName = reader.getString(); - } else if ("tierUpgradePolicy".equals(fieldName)) { - deserializedQuotaTierProperties.tierUpgradePolicy - = TierUpgradePolicy.fromString(reader.getString()); - } else if ("assignmentDate".equals(fieldName)) { - deserializedQuotaTierProperties.assignmentDate = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("tierUpgradeEligibilityInfo".equals(fieldName)) { - deserializedQuotaTierProperties.tierUpgradeEligibilityInfo - = QuotaTierUpgradeEligibilityInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedQuotaTierProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTierUpgradeEligibilityInfo.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTierUpgradeEligibilityInfo.java deleted file mode 100644 index d2b1d508931c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTierUpgradeEligibilityInfo.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Information about the quota tier upgrade eligibility for the subscription. - */ -@Immutable -public final class QuotaTierUpgradeEligibilityInfo implements JsonSerializable { - /* - * Name of the next quota tier for the subscription. - */ - private String nextTierName; - - /* - * Specifies whether an upgrade to the next quota tier is available. - */ - private UpgradeAvailabilityStatus upgradeAvailabilityStatus; - - /* - * The date after which the current tier will be upgraded to the next tier if the TierUpgradePolicy is - * "OnceUpgradeIsAvailable" (UTC). - */ - private OffsetDateTime upgradeApplicableDate; - - /* - * Reason in case the subscription is not eligible for upgrade to the next tier. - */ - private String upgradeUnavailabilityReason; - - /** - * Creates an instance of QuotaTierUpgradeEligibilityInfo class. - */ - private QuotaTierUpgradeEligibilityInfo() { - } - - /** - * Get the nextTierName property: Name of the next quota tier for the subscription. - * - * @return the nextTierName value. - */ - public String nextTierName() { - return this.nextTierName; - } - - /** - * Get the upgradeAvailabilityStatus property: Specifies whether an upgrade to the next quota tier is available. - * - * @return the upgradeAvailabilityStatus value. - */ - public UpgradeAvailabilityStatus upgradeAvailabilityStatus() { - return this.upgradeAvailabilityStatus; - } - - /** - * Get the upgradeApplicableDate property: The date after which the current tier will be upgraded to the next tier - * if the TierUpgradePolicy is "OnceUpgradeIsAvailable" (UTC). - * - * @return the upgradeApplicableDate value. - */ - public OffsetDateTime upgradeApplicableDate() { - return this.upgradeApplicableDate; - } - - /** - * Get the upgradeUnavailabilityReason property: Reason in case the subscription is not eligible for upgrade to the - * next tier. - * - * @return the upgradeUnavailabilityReason value. - */ - public String upgradeUnavailabilityReason() { - return this.upgradeUnavailabilityReason; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextTierName", this.nextTierName); - jsonWriter.writeStringField("upgradeAvailabilityStatus", - this.upgradeAvailabilityStatus == null ? null : this.upgradeAvailabilityStatus.toString()); - jsonWriter.writeStringField("upgradeApplicableDate", - this.upgradeApplicableDate == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.upgradeApplicableDate)); - jsonWriter.writeStringField("upgradeUnavailabilityReason", this.upgradeUnavailabilityReason); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QuotaTierUpgradeEligibilityInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QuotaTierUpgradeEligibilityInfo 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 QuotaTierUpgradeEligibilityInfo. - */ - public static QuotaTierUpgradeEligibilityInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QuotaTierUpgradeEligibilityInfo deserializedQuotaTierUpgradeEligibilityInfo - = new QuotaTierUpgradeEligibilityInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextTierName".equals(fieldName)) { - deserializedQuotaTierUpgradeEligibilityInfo.nextTierName = reader.getString(); - } else if ("upgradeAvailabilityStatus".equals(fieldName)) { - deserializedQuotaTierUpgradeEligibilityInfo.upgradeAvailabilityStatus - = UpgradeAvailabilityStatus.fromString(reader.getString()); - } else if ("upgradeApplicableDate".equals(fieldName)) { - deserializedQuotaTierUpgradeEligibilityInfo.upgradeApplicableDate = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("upgradeUnavailabilityReason".equals(fieldName)) { - deserializedQuotaTierUpgradeEligibilityInfo.upgradeUnavailabilityReason = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedQuotaTierUpgradeEligibilityInfo; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTiers.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTiers.java deleted file mode 100644 index 4581b1c9f6f1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTiers.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 QuotaTiers. - */ -public interface QuotaTiers { - /** - * Gets the Quota Tier for a subscription - * - * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param defaultParameter Default parameter. Leave the value as default. - * @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 Quota Tier for a subscription - * - * Gets the Quota Tier information for the given subscription along with {@link Response}. - */ - Response getWithResponse(String defaultParameter, Context context); - - /** - * Gets the Quota Tier for a subscription - * - * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param defaultParameter Default parameter. Leave the value as default. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Quota Tier for a subscription - * - * Gets the Quota Tier information for the given subscription. - */ - QuotaTier get(String defaultParameter); - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Quota Tiers response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Quota Tiers response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Gets the Quota Tier for a subscription - * - * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Quota Tier for a subscription - * - * Gets the Quota Tier information for the given subscription along with {@link Response}. - */ - QuotaTier getById(String id); - - /** - * Gets the Quota Tier for a subscription - * - * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Quota Tier for a subscription - * - * Gets the Quota Tier information for the given subscription along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new QuotaTier resource. - * - * @param name resource name. - * @return the first stage of the new QuotaTier definition. - */ - QuotaTier.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaUsageStatus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaUsageStatus.java deleted file mode 100644 index 2dfbb7fc7094..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaUsageStatus.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Cognitive Services account quota usage status. - */ -public final class QuotaUsageStatus extends ExpandableStringEnum { - /** - * Static value Included for QuotaUsageStatus. - */ - public static final QuotaUsageStatus INCLUDED = fromString("Included"); - - /** - * Static value Blocked for QuotaUsageStatus. - */ - public static final QuotaUsageStatus BLOCKED = fromString("Blocked"); - - /** - * Static value InOverage for QuotaUsageStatus. - */ - public static final QuotaUsageStatus IN_OVERAGE = fromString("InOverage"); - - /** - * Static value Unknown for QuotaUsageStatus. - */ - public static final QuotaUsageStatus UNKNOWN = fromString("Unknown"); - - /** - * Creates a new instance of QuotaUsageStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public QuotaUsageStatus() { - } - - /** - * Creates or finds a QuotaUsageStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding QuotaUsageStatus. - */ - public static QuotaUsageStatus fromString(String name) { - return fromString(name, QuotaUsageStatus.class); - } - - /** - * Gets known QuotaUsageStatus values. - * - * @return known QuotaUsageStatus values. - */ - public static Collection values() { - return values(QuotaUsageStatus.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiActionType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiActionType.java deleted file mode 100644 index 6cabf82d74a3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiActionType.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The action types to apply to the content filters. - */ -public final class RaiActionType extends ExpandableStringEnum { - /** - * Static value None for RaiActionType. - */ - public static final RaiActionType NONE = fromString("None"); - - /** - * Static value BLOCKING for RaiActionType. - */ - public static final RaiActionType BLOCKING = fromString("BLOCKING"); - - /** - * Static value ANNOTATING for RaiActionType. - */ - public static final RaiActionType ANNOTATING = fromString("ANNOTATING"); - - /** - * Static value HITL for RaiActionType. - */ - public static final RaiActionType HITL = fromString("HITL"); - - /** - * Static value RETRY for RaiActionType. - */ - public static final RaiActionType RETRY = fromString("RETRY"); - - /** - * Creates a new instance of RaiActionType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RaiActionType() { - } - - /** - * Creates or finds a RaiActionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding RaiActionType. - */ - public static RaiActionType fromString(String name) { - return fromString(name, RaiActionType.class); - } - - /** - * Gets known RaiActionType values. - * - * @return known RaiActionType values. - */ - public static Collection values() { - return values(RaiActionType.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklist.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklist.java deleted file mode 100644 index df36f4953777..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklist.java +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistInner; -import java.util.Map; - -/** - * An immutable client-side representation of RaiBlocklist. - */ -public interface RaiBlocklist { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Properties of Cognitive Services RaiBlocklist. - * - * @return the properties value. - */ - RaiBlocklistProperties properties(); - - /** - * Gets the etag property: Resource Etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistInner object. - * - * @return the inner object. - */ - RaiBlocklistInner innerModel(); - - /** - * The entirety of the RaiBlocklist definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The RaiBlocklist definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the RaiBlocklist definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the RaiBlocklist definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, accountName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @return the next definition stage. - */ - WithCreate withExistingAccount(String resourceGroupName, String accountName); - } - - /** - * The stage of the RaiBlocklist 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.WithTags, DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - RaiBlocklist create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - RaiBlocklist create(Context context); - } - - /** - * The stage of the RaiBlocklist definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the RaiBlocklist definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of Cognitive Services RaiBlocklist.. - * - * @param properties Properties of Cognitive Services RaiBlocklist. - * @return the next definition stage. - */ - WithCreate withProperties(RaiBlocklistProperties properties); - } - } - - /** - * Begins update for the RaiBlocklist resource. - * - * @return the stage of resource update. - */ - RaiBlocklist.Update update(); - - /** - * The template for RaiBlocklist update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - RaiBlocklist apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - RaiBlocklist apply(Context context); - } - - /** - * The RaiBlocklist update stages. - */ - interface UpdateStages { - /** - * The stage of the RaiBlocklist update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the RaiBlocklist update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of Cognitive Services RaiBlocklist.. - * - * @param properties Properties of Cognitive Services RaiBlocklist. - * @return the next definition stage. - */ - Update withProperties(RaiBlocklistProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - RaiBlocklist refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - RaiBlocklist refresh(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistConfig.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistConfig.java deleted file mode 100644 index 0acdaa46ef9c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistConfig.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Azure OpenAI blocklist config. - */ -@Fluent -public class RaiBlocklistConfig implements JsonSerializable { - /* - * Name of ContentFilter. - */ - private String blocklistName; - - /* - * If blocking would occur. - */ - private Boolean blocking; - - /** - * Creates an instance of RaiBlocklistConfig class. - */ - public RaiBlocklistConfig() { - } - - /** - * Get the blocklistName property: Name of ContentFilter. - * - * @return the blocklistName value. - */ - public String blocklistName() { - return this.blocklistName; - } - - /** - * Set the blocklistName property: Name of ContentFilter. - * - * @param blocklistName the blocklistName value to set. - * @return the RaiBlocklistConfig object itself. - */ - public RaiBlocklistConfig withBlocklistName(String blocklistName) { - this.blocklistName = blocklistName; - return this; - } - - /** - * Get the blocking property: If blocking would occur. - * - * @return the blocking value. - */ - public Boolean blocking() { - return this.blocking; - } - - /** - * Set the blocking property: If blocking would occur. - * - * @param blocking the blocking value to set. - * @return the RaiBlocklistConfig object itself. - */ - public RaiBlocklistConfig withBlocking(Boolean blocking) { - this.blocking = blocking; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("blocklistName", this.blocklistName); - jsonWriter.writeBooleanField("blocking", this.blocking); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiBlocklistConfig from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiBlocklistConfig 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 RaiBlocklistConfig. - */ - public static RaiBlocklistConfig fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiBlocklistConfig deserializedRaiBlocklistConfig = new RaiBlocklistConfig(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("blocklistName".equals(fieldName)) { - deserializedRaiBlocklistConfig.blocklistName = reader.getString(); - } else if ("blocking".equals(fieldName)) { - deserializedRaiBlocklistConfig.blocking = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiBlocklistConfig; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItem.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItem.java deleted file mode 100644 index 40ae0c3fdd98..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItem.java +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistItemInner; -import java.util.Map; - -/** - * An immutable client-side representation of RaiBlocklistItem. - */ -public interface RaiBlocklistItem { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Properties of Cognitive Services RaiBlocklist Item. - * - * @return the properties value. - */ - RaiBlocklistItemProperties properties(); - - /** - * Gets the etag property: Resource Etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistItemInner object. - * - * @return the inner object. - */ - RaiBlocklistItemInner innerModel(); - - /** - * The entirety of the RaiBlocklistItem definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The RaiBlocklistItem definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the RaiBlocklistItem definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the RaiBlocklistItem definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, accountName, raiBlocklistName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @return the next definition stage. - */ - WithCreate withExistingRaiBlocklist(String resourceGroupName, String accountName, String raiBlocklistName); - } - - /** - * The stage of the RaiBlocklistItem 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.WithTags, DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - RaiBlocklistItem create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - RaiBlocklistItem create(Context context); - } - - /** - * The stage of the RaiBlocklistItem definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the RaiBlocklistItem definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of Cognitive Services RaiBlocklist Item.. - * - * @param properties Properties of Cognitive Services RaiBlocklist Item. - * @return the next definition stage. - */ - WithCreate withProperties(RaiBlocklistItemProperties properties); - } - } - - /** - * Begins update for the RaiBlocklistItem resource. - * - * @return the stage of resource update. - */ - RaiBlocklistItem.Update update(); - - /** - * The template for RaiBlocklistItem update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - RaiBlocklistItem apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - RaiBlocklistItem apply(Context context); - } - - /** - * The RaiBlocklistItem update stages. - */ - interface UpdateStages { - /** - * The stage of the RaiBlocklistItem update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the RaiBlocklistItem update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of Cognitive Services RaiBlocklist Item.. - * - * @param properties Properties of Cognitive Services RaiBlocklist Item. - * @return the next definition stage. - */ - Update withProperties(RaiBlocklistItemProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - RaiBlocklistItem refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - RaiBlocklistItem refresh(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItemBulkRequest.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItemBulkRequest.java deleted file mode 100644 index d79adbc17a60..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItemBulkRequest.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 Cognitive Services RaiBlocklist Item request body. - */ -@Fluent -public final class RaiBlocklistItemBulkRequest implements JsonSerializable { - /* - * The name property. - */ - private String name; - - /* - * Properties of Cognitive Services RaiBlocklist Item. - */ - private RaiBlocklistItemProperties properties; - - /** - * Creates an instance of RaiBlocklistItemBulkRequest class. - */ - public RaiBlocklistItemBulkRequest() { - } - - /** - * Get the name property: The name property. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name property. - * - * @param name the name value to set. - * @return the RaiBlocklistItemBulkRequest object itself. - */ - public RaiBlocklistItemBulkRequest withName(String name) { - this.name = name; - return this; - } - - /** - * Get the properties property: Properties of Cognitive Services RaiBlocklist Item. - * - * @return the properties value. - */ - public RaiBlocklistItemProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of Cognitive Services RaiBlocklist Item. - * - * @param properties the properties value to set. - * @return the RaiBlocklistItemBulkRequest object itself. - */ - public RaiBlocklistItemBulkRequest withProperties(RaiBlocklistItemProperties properties) { - this.properties = properties; - return this; - } - - /** - * {@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 RaiBlocklistItemBulkRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiBlocklistItemBulkRequest 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 RaiBlocklistItemBulkRequest. - */ - public static RaiBlocklistItemBulkRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiBlocklistItemBulkRequest deserializedRaiBlocklistItemBulkRequest = new RaiBlocklistItemBulkRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedRaiBlocklistItemBulkRequest.name = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedRaiBlocklistItemBulkRequest.properties = RaiBlocklistItemProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiBlocklistItemBulkRequest; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItemProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItemProperties.java deleted file mode 100644 index e78e3b88f48f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItemProperties.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * RAI Custom Blocklist Item properties. - */ -@Fluent -public final class RaiBlocklistItemProperties implements JsonSerializable { - /* - * Pattern to match against. - */ - private String pattern; - - /* - * If the pattern is a regex pattern. - */ - private Boolean isRegex; - - /** - * Creates an instance of RaiBlocklistItemProperties class. - */ - public RaiBlocklistItemProperties() { - } - - /** - * Get the pattern property: Pattern to match against. - * - * @return the pattern value. - */ - public String pattern() { - return this.pattern; - } - - /** - * Set the pattern property: Pattern to match against. - * - * @param pattern the pattern value to set. - * @return the RaiBlocklistItemProperties object itself. - */ - public RaiBlocklistItemProperties withPattern(String pattern) { - this.pattern = pattern; - return this; - } - - /** - * Get the isRegex property: If the pattern is a regex pattern. - * - * @return the isRegex value. - */ - public Boolean isRegex() { - return this.isRegex; - } - - /** - * Set the isRegex property: If the pattern is a regex pattern. - * - * @param isRegex the isRegex value to set. - * @return the RaiBlocklistItemProperties object itself. - */ - public RaiBlocklistItemProperties withIsRegex(Boolean isRegex) { - this.isRegex = isRegex; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("pattern", this.pattern); - jsonWriter.writeBooleanField("isRegex", this.isRegex); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiBlocklistItemProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiBlocklistItemProperties 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 RaiBlocklistItemProperties. - */ - public static RaiBlocklistItemProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiBlocklistItemProperties deserializedRaiBlocklistItemProperties = new RaiBlocklistItemProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("pattern".equals(fieldName)) { - deserializedRaiBlocklistItemProperties.pattern = reader.getString(); - } else if ("isRegex".equals(fieldName)) { - deserializedRaiBlocklistItemProperties.isRegex = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiBlocklistItemProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItems.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItems.java deleted file mode 100644 index 4f86d4117042..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItems.java +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import java.util.List; - -/** - * Resource collection API of RaiBlocklistItems. - */ -public interface RaiBlocklistItems { - /** - * Gets the specified custom blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @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 specified custom blocklist Item associated with the custom blocklist along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, - String raiBlocklistItemName, Context context); - - /** - * Gets the specified custom blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 custom blocklist Item associated with the custom blocklist. - */ - RaiBlocklistItem get(String resourceGroupName, String accountName, String raiBlocklistName, - String raiBlocklistItemName); - - /** - * Deletes the specified blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String raiBlocklistName, String raiBlocklistItemName); - - /** - * Deletes the specified blocklist Item associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @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 accountName, String raiBlocklistName, String raiBlocklistItemName, - Context context); - - /** - * Gets the blocklist items associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blocklist items associated with the custom blocklist as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, String raiBlocklistName); - - /** - * Gets the blocklist items associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @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 blocklist items associated with the custom blocklist as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, String raiBlocklistName, - Context context); - - /** - * Batch operation to add blocklist items. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItems Properties describing the custom blocklist items. - * @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 cognitive Services RaiBlocklist along with {@link Response}. - */ - Response batchAddWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, - List raiBlocklistItems, Context context); - - /** - * Batch operation to add blocklist items. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItems Properties describing the custom blocklist items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiBlocklist. - */ - RaiBlocklist batchAdd(String resourceGroupName, String accountName, String raiBlocklistName, - List raiBlocklistItems); - - /** - * Batch operation to delete blocklist items. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemsNames List of RAI Blocklist Items Names. - * @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 batchDeleteWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, - List raiBlocklistItemsNames, Context context); - - /** - * Batch operation to delete blocklist items. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemsNames List of RAI Blocklist Items Names. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 batchDelete(String resourceGroupName, String accountName, String raiBlocklistName, - List raiBlocklistItemsNames); - - /** - * Gets the specified custom blocklist Item associated with the custom blocklist. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified custom blocklist Item associated with the custom blocklist along with {@link Response}. - */ - RaiBlocklistItem getById(String id); - - /** - * Gets the specified custom blocklist Item associated with the custom blocklist. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified custom blocklist Item associated with the custom blocklist along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes the specified blocklist Item associated with the custom blocklist. - * - * @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 the specified blocklist Item associated with the custom blocklist. - * - * @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 RaiBlocklistItem resource. - * - * @param name resource name. - * @return the first stage of the new RaiBlocklistItem definition. - */ - RaiBlocklistItem.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistProperties.java deleted file mode 100644 index 662d1f41204c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistProperties.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * RAI Custom Blocklist properties. - */ -@Fluent -public final class RaiBlocklistProperties implements JsonSerializable { - /* - * Description of the block list. - */ - private String description; - - /** - * Creates an instance of RaiBlocklistProperties class. - */ - public RaiBlocklistProperties() { - } - - /** - * Get the description property: Description of the block list. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the block list. - * - * @param description the description value to set. - * @return the RaiBlocklistProperties object itself. - */ - public RaiBlocklistProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("description", this.description); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiBlocklistProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiBlocklistProperties 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 RaiBlocklistProperties. - */ - public static RaiBlocklistProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiBlocklistProperties deserializedRaiBlocklistProperties = new RaiBlocklistProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedRaiBlocklistProperties.description = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiBlocklistProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklists.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklists.java deleted file mode 100644 index 5a64820eec30..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklists.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 RaiBlocklists. - */ -public interface RaiBlocklists { - /** - * Gets the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @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 specified custom blocklist associated with the Azure OpenAI account along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, - Context context); - - /** - * Gets the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 custom blocklist associated with the Azure OpenAI account. - */ - RaiBlocklist get(String resourceGroupName, String accountName, String raiBlocklistName); - - /** - * Deletes the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String raiBlocklistName); - - /** - * Deletes the specified custom blocklist associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @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 accountName, String raiBlocklistName, Context context); - - /** - * Gets the custom blocklists associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom blocklists associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the custom blocklists associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 custom blocklists associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, Context context); - - /** - * Gets the specified custom blocklist associated with the Azure OpenAI account. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified custom blocklist associated with the Azure OpenAI account along with {@link Response}. - */ - RaiBlocklist getById(String id); - - /** - * Gets the specified custom blocklist associated with the Azure OpenAI account. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified custom blocklist associated with the Azure OpenAI account along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes the specified custom blocklist associated with the Azure OpenAI account. - * - * @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 the specified custom blocklist associated with the Azure OpenAI account. - * - * @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 RaiBlocklist resource. - * - * @param name resource name. - * @return the first stage of the new RaiBlocklist definition. - */ - RaiBlocklist.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilter.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilter.java deleted file mode 100644 index 6e26f51a64f0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilter.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiContentFilterInner; - -/** - * An immutable client-side representation of RaiContentFilter. - */ -public interface RaiContentFilter { - /** - * 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: Azure OpenAI Content Filter Properties. - * - * @return the properties value. - */ - RaiContentFilterProperties 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.cognitiveservices.fluent.models.RaiContentFilterInner object. - * - * @return the inner object. - */ - RaiContentFilterInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilterProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilterProperties.java deleted file mode 100644 index ed3c4304e3c9..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilterProperties.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Azure OpenAI Content Filter Properties. - */ -@Immutable -public final class RaiContentFilterProperties implements JsonSerializable { - /* - * Name of Content Filter. - */ - private String name; - - /* - * If the Content Filter has multi severity levels(Low, Medium, or High). - */ - private Boolean isMultiLevelFilter; - - /* - * Content source to apply the Content Filters. - */ - private RaiPolicyContentSource source; - - /** - * Creates an instance of RaiContentFilterProperties class. - */ - private RaiContentFilterProperties() { - } - - /** - * Get the name property: Name of Content Filter. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the isMultiLevelFilter property: If the Content Filter has multi severity levels(Low, Medium, or High). - * - * @return the isMultiLevelFilter value. - */ - public Boolean isMultiLevelFilter() { - return this.isMultiLevelFilter; - } - - /** - * Get the source property: Content source to apply the Content Filters. - * - * @return the source value. - */ - public RaiPolicyContentSource source() { - return this.source; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeBooleanField("isMultiLevelFilter", this.isMultiLevelFilter); - jsonWriter.writeStringField("source", this.source == null ? null : this.source.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiContentFilterProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiContentFilterProperties 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 RaiContentFilterProperties. - */ - public static RaiContentFilterProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiContentFilterProperties deserializedRaiContentFilterProperties = new RaiContentFilterProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedRaiContentFilterProperties.name = reader.getString(); - } else if ("isMultiLevelFilter".equals(fieldName)) { - deserializedRaiContentFilterProperties.isMultiLevelFilter - = reader.getNullable(JsonReader::getBoolean); - } else if ("source".equals(fieldName)) { - deserializedRaiContentFilterProperties.source - = RaiPolicyContentSource.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiContentFilterProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilters.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilters.java deleted file mode 100644 index a7e942d903f2..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilters.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 RaiContentFilters. - */ -public interface RaiContentFilters { - /** - * Get Content Filters by Name. - * - * @param location The name of the Azure region. - * @param filterName The name of the RAI Content Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return content Filters by Name along with {@link Response}. - */ - Response getWithResponse(String location, String filterName, Context context); - - /** - * Get Content Filters by Name. - * - * @param location The name of the Azure region. - * @param filterName The name of the RAI Content Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return content Filters by Name. - */ - RaiContentFilter get(String location, String filterName); - - /** - * List Content Filters types. - * - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 Content Filters as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String location); - - /** - * List Content Filters types. - * - * @param location The name of the Azure region. - * @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 Content Filters as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String location, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressDefaultAction.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressDefaultAction.java deleted file mode 100644 index 6dc9f5dbec72..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressDefaultAction.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The default action when no user-defined egress rules match. - */ -public final class RaiEgressDefaultAction extends ExpandableStringEnum { - /** - * Allow traffic by default when no rules match. - */ - public static final RaiEgressDefaultAction ALLOW = fromString("Allow"); - - /** - * Deny traffic by default when no rules match. - */ - public static final RaiEgressDefaultAction DENY = fromString("Deny"); - - /** - * Creates a new instance of RaiEgressDefaultAction value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RaiEgressDefaultAction() { - } - - /** - * Creates or finds a RaiEgressDefaultAction from its string representation. - * - * @param name a name to look for. - * @return the corresponding RaiEgressDefaultAction. - */ - public static RaiEgressDefaultAction fromString(String name) { - return fromString(name, RaiEgressDefaultAction.class); - } - - /** - * Gets known RaiEgressDefaultAction values. - * - * @return known RaiEgressDefaultAction values. - */ - public static Collection values() { - return values(RaiEgressDefaultAction.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressHeaderOperation.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressHeaderOperation.java deleted file mode 100644 index 8f701a68fe83..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressHeaderOperation.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The operation to apply to a header in a Transform or Rewrite action. - */ -public final class RaiEgressHeaderOperation extends ExpandableStringEnum { - /** - * Set or overwrite the header value, creating it if it does not exist. - */ - public static final RaiEgressHeaderOperation SET = fromString("Set"); - - /** - * Add the header only if it is not already present. - */ - public static final RaiEgressHeaderOperation INSERT = fromString("Insert"); - - /** - * Remove the header if present. - */ - public static final RaiEgressHeaderOperation REMOVE = fromString("Remove"); - - /** - * Creates a new instance of RaiEgressHeaderOperation value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RaiEgressHeaderOperation() { - } - - /** - * Creates or finds a RaiEgressHeaderOperation from its string representation. - * - * @param name a name to look for. - * @return the corresponding RaiEgressHeaderOperation. - */ - public static RaiEgressHeaderOperation fromString(String name) { - return fromString(name, RaiEgressHeaderOperation.class); - } - - /** - * Gets known RaiEgressHeaderOperation values. - * - * @return known RaiEgressHeaderOperation values. - */ - public static Collection values() { - return values(RaiEgressHeaderOperation.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressHeaderTransform.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressHeaderTransform.java deleted file mode 100644 index c81227e35da4..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressHeaderTransform.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * A header transformation applied to matched traffic. - * For Set or Insert operations, exactly one of value or valueRef must be provided. - * For Remove operations, neither value nor valueRef should be set. - */ -@Fluent -public final class RaiEgressHeaderTransform implements JsonSerializable { - /* - * The operation to perform on this header. - */ - private RaiEgressHeaderOperation operation; - - /* - * The HTTP header name (e.g., "Authorization", "X-Custom-Auth"). - */ - private String name; - - /* - * A static header value. Write-only: accepted on create/update, never returned on read. - * If omitted on update, the existing value is preserved. Use this for non-sensitive values; - * for credentials, use valueRef instead. - */ - private String value; - - /* - * A dynamic header value resolved at request time from a secret or managed identity. - */ - private RaiEgressHeaderValueRef valueRef; - - /** - * Creates an instance of RaiEgressHeaderTransform class. - */ - public RaiEgressHeaderTransform() { - } - - /** - * Get the operation property: The operation to perform on this header. - * - * @return the operation value. - */ - public RaiEgressHeaderOperation operation() { - return this.operation; - } - - /** - * Set the operation property: The operation to perform on this header. - * - * @param operation the operation value to set. - * @return the RaiEgressHeaderTransform object itself. - */ - public RaiEgressHeaderTransform withOperation(RaiEgressHeaderOperation operation) { - this.operation = operation; - return this; - } - - /** - * Get the name property: The HTTP header name (e.g., "Authorization", "X-Custom-Auth"). - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The HTTP header name (e.g., "Authorization", "X-Custom-Auth"). - * - * @param name the name value to set. - * @return the RaiEgressHeaderTransform object itself. - */ - public RaiEgressHeaderTransform withName(String name) { - this.name = name; - return this; - } - - /** - * Get the value property: A static header value. Write-only: accepted on create/update, never returned on read. - * If omitted on update, the existing value is preserved. Use this for non-sensitive values; - * for credentials, use valueRef instead. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: A static header value. Write-only: accepted on create/update, never returned on read. - * If omitted on update, the existing value is preserved. Use this for non-sensitive values; - * for credentials, use valueRef instead. - * - * @param value the value value to set. - * @return the RaiEgressHeaderTransform object itself. - */ - public RaiEgressHeaderTransform withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the valueRef property: A dynamic header value resolved at request time from a secret or managed identity. - * - * @return the valueRef value. - */ - public RaiEgressHeaderValueRef valueRef() { - return this.valueRef; - } - - /** - * Set the valueRef property: A dynamic header value resolved at request time from a secret or managed identity. - * - * @param valueRef the valueRef value to set. - * @return the RaiEgressHeaderTransform object itself. - */ - public RaiEgressHeaderTransform withValueRef(RaiEgressHeaderValueRef valueRef) { - this.valueRef = valueRef; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("operation", this.operation == null ? null : this.operation.toString()); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("value", this.value); - jsonWriter.writeJsonField("valueRef", this.valueRef); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiEgressHeaderTransform from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiEgressHeaderTransform 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 RaiEgressHeaderTransform. - */ - public static RaiEgressHeaderTransform fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiEgressHeaderTransform deserializedRaiEgressHeaderTransform = new RaiEgressHeaderTransform(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("operation".equals(fieldName)) { - deserializedRaiEgressHeaderTransform.operation - = RaiEgressHeaderOperation.fromString(reader.getString()); - } else if ("name".equals(fieldName)) { - deserializedRaiEgressHeaderTransform.name = reader.getString(); - } else if ("value".equals(fieldName)) { - deserializedRaiEgressHeaderTransform.value = reader.getString(); - } else if ("valueRef".equals(fieldName)) { - deserializedRaiEgressHeaderTransform.valueRef = RaiEgressHeaderValueRef.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiEgressHeaderTransform; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressHeaderValueRef.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressHeaderValueRef.java deleted file mode 100644 index 7252ef840470..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressHeaderValueRef.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * A dynamic source for a header value. Exactly one of secretRef or managedIdentityRef must be set. - */ -@Fluent -public final class RaiEgressHeaderValueRef implements JsonSerializable { - /* - * Resolve the value from a stored secret. - */ - private RaiEgressSecretRef secretRef; - - /* - * Resolve the value from a managed-identity token. - */ - private RaiEgressManagedIdentityRef managedIdentityRef; - - /** - * Creates an instance of RaiEgressHeaderValueRef class. - */ - public RaiEgressHeaderValueRef() { - } - - /** - * Get the secretRef property: Resolve the value from a stored secret. - * - * @return the secretRef value. - */ - public RaiEgressSecretRef secretRef() { - return this.secretRef; - } - - /** - * Set the secretRef property: Resolve the value from a stored secret. - * - * @param secretRef the secretRef value to set. - * @return the RaiEgressHeaderValueRef object itself. - */ - public RaiEgressHeaderValueRef withSecretRef(RaiEgressSecretRef secretRef) { - this.secretRef = secretRef; - return this; - } - - /** - * Get the managedIdentityRef property: Resolve the value from a managed-identity token. - * - * @return the managedIdentityRef value. - */ - public RaiEgressManagedIdentityRef managedIdentityRef() { - return this.managedIdentityRef; - } - - /** - * Set the managedIdentityRef property: Resolve the value from a managed-identity token. - * - * @param managedIdentityRef the managedIdentityRef value to set. - * @return the RaiEgressHeaderValueRef object itself. - */ - public RaiEgressHeaderValueRef withManagedIdentityRef(RaiEgressManagedIdentityRef managedIdentityRef) { - this.managedIdentityRef = managedIdentityRef; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("secretRef", this.secretRef); - jsonWriter.writeJsonField("managedIdentityRef", this.managedIdentityRef); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiEgressHeaderValueRef from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiEgressHeaderValueRef 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 RaiEgressHeaderValueRef. - */ - public static RaiEgressHeaderValueRef fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiEgressHeaderValueRef deserializedRaiEgressHeaderValueRef = new RaiEgressHeaderValueRef(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("secretRef".equals(fieldName)) { - deserializedRaiEgressHeaderValueRef.secretRef = RaiEgressSecretRef.fromJson(reader); - } else if ("managedIdentityRef".equals(fieldName)) { - deserializedRaiEgressHeaderValueRef.managedIdentityRef - = RaiEgressManagedIdentityRef.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiEgressHeaderValueRef; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressManagedIdentityRef.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressManagedIdentityRef.java deleted file mode 100644 index 93f2a86dfadb..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressManagedIdentityRef.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * A reference to a managed-identity token used as a header value. - */ -@Fluent -public final class RaiEgressManagedIdentityRef implements JsonSerializable { - /* - * The resource/audience the token is requested for. - */ - private String resource; - - /* - * Optional format for the resolved token; "{value}" is the placeholder, e.g. "Bearer {value}". - */ - private String format; - - /** - * Creates an instance of RaiEgressManagedIdentityRef class. - */ - public RaiEgressManagedIdentityRef() { - } - - /** - * Get the resource property: The resource/audience the token is requested for. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Set the resource property: The resource/audience the token is requested for. - * - * @param resource the resource value to set. - * @return the RaiEgressManagedIdentityRef object itself. - */ - public RaiEgressManagedIdentityRef withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the format property: Optional format for the resolved token; "{value}" is the placeholder, e.g. "Bearer - * {value}". - * - * @return the format value. - */ - public String format() { - return this.format; - } - - /** - * Set the format property: Optional format for the resolved token; "{value}" is the placeholder, e.g. "Bearer - * {value}". - * - * @param format the format value to set. - * @return the RaiEgressManagedIdentityRef object itself. - */ - public RaiEgressManagedIdentityRef withFormat(String format) { - this.format = format; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("resource", this.resource); - jsonWriter.writeStringField("format", this.format); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiEgressManagedIdentityRef from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiEgressManagedIdentityRef 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 RaiEgressManagedIdentityRef. - */ - public static RaiEgressManagedIdentityRef fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiEgressManagedIdentityRef deserializedRaiEgressManagedIdentityRef = new RaiEgressManagedIdentityRef(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resource".equals(fieldName)) { - deserializedRaiEgressManagedIdentityRef.resource = reader.getString(); - } else if ("format".equals(fieldName)) { - deserializedRaiEgressManagedIdentityRef.format = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiEgressManagedIdentityRef; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressMode.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressMode.java deleted file mode 100644 index ee31d1d792ab..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressMode.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The enforcement mode for egress rules. - * If omitted on create, the server defaults to Enforced. - */ -public final class RaiEgressMode extends ExpandableStringEnum { - /** - * Rules are enforced. Matching traffic is allowed or denied per rule actions. - */ - public static final RaiEgressMode ENFORCED = fromString("Enforced"); - - /** - * Rules are evaluated and logged but not enforced. Traffic is always forwarded regardless of - * rule action. A would-be Deny is logged but not applied. Transform and Rewrite actions are - * still applied to matching traffic (only Deny enforcement is suppressed). - */ - public static final RaiEgressMode AUDIT = fromString("Audit"); - - /** - * Creates a new instance of RaiEgressMode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RaiEgressMode() { - } - - /** - * Creates or finds a RaiEgressMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding RaiEgressMode. - */ - public static RaiEgressMode fromString(String name) { - return fromString(name, RaiEgressMode.class); - } - - /** - * Gets known RaiEgressMode values. - * - * @return known RaiEgressMode values. - */ - public static Collection values() { - return values(RaiEgressMode.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressPolicyConfig.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressPolicyConfig.java deleted file mode 100644 index f0825fd697fc..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressPolicyConfig.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Egress (outbound network) policy configuration nested within an RAI policy. - * Controls which external endpoints sandboxed agents can reach and what - * transformations (header injection, URL rewrite) are applied to matching traffic. - */ -@Fluent -public final class RaiEgressPolicyConfig implements JsonSerializable { - /* - * The enforcement mode for egress rules. - * If omitted on create, the server defaults to Enforced. On subsequent GET - * requests, the server always returns the effective mode. - */ - private RaiEgressMode mode; - - /* - * The default action when no user-defined rules match. - * Deny blocks unmatched traffic; Allow permits it. Transform and Rewrite rules - * are always applied to their matched traffic regardless of this setting — - * defaultAction only governs traffic that does not match any rule. - * If omitted on create, the server defaults to Deny (fail-closed). On subsequent - * GET requests, the server always returns the effective value. - */ - private RaiEgressDefaultAction defaultAction; - - /* - * Description of the egress policy. - */ - private String description; - - /* - * Ordered list of egress rules. First matching rule wins. - * Rules are evaluated in declaration order; the first rule whose match criteria - * are satisfied determines the action taken on the request. - */ - private List rules; - - /** - * Creates an instance of RaiEgressPolicyConfig class. - */ - public RaiEgressPolicyConfig() { - } - - /** - * Get the mode property: The enforcement mode for egress rules. - * If omitted on create, the server defaults to Enforced. On subsequent GET - * requests, the server always returns the effective mode. - * - * @return the mode value. - */ - public RaiEgressMode mode() { - return this.mode; - } - - /** - * Set the mode property: The enforcement mode for egress rules. - * If omitted on create, the server defaults to Enforced. On subsequent GET - * requests, the server always returns the effective mode. - * - * @param mode the mode value to set. - * @return the RaiEgressPolicyConfig object itself. - */ - public RaiEgressPolicyConfig withMode(RaiEgressMode mode) { - this.mode = mode; - return this; - } - - /** - * Get the defaultAction property: The default action when no user-defined rules match. - * Deny blocks unmatched traffic; Allow permits it. Transform and Rewrite rules - * are always applied to their matched traffic regardless of this setting — - * defaultAction only governs traffic that does not match any rule. - * If omitted on create, the server defaults to Deny (fail-closed). On subsequent - * GET requests, the server always returns the effective value. - * - * @return the defaultAction value. - */ - public RaiEgressDefaultAction defaultAction() { - return this.defaultAction; - } - - /** - * Set the defaultAction property: The default action when no user-defined rules match. - * Deny blocks unmatched traffic; Allow permits it. Transform and Rewrite rules - * are always applied to their matched traffic regardless of this setting — - * defaultAction only governs traffic that does not match any rule. - * If omitted on create, the server defaults to Deny (fail-closed). On subsequent - * GET requests, the server always returns the effective value. - * - * @param defaultAction the defaultAction value to set. - * @return the RaiEgressPolicyConfig object itself. - */ - public RaiEgressPolicyConfig withDefaultAction(RaiEgressDefaultAction defaultAction) { - this.defaultAction = defaultAction; - return this; - } - - /** - * Get the description property: Description of the egress policy. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the egress policy. - * - * @param description the description value to set. - * @return the RaiEgressPolicyConfig object itself. - */ - public RaiEgressPolicyConfig withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the rules property: Ordered list of egress rules. First matching rule wins. - * Rules are evaluated in declaration order; the first rule whose match criteria - * are satisfied determines the action taken on the request. - * - * @return the rules value. - */ - public List rules() { - return this.rules; - } - - /** - * Set the rules property: Ordered list of egress rules. First matching rule wins. - * Rules are evaluated in declaration order; the first rule whose match criteria - * are satisfied determines the action taken on the request. - * - * @param rules the rules value to set. - * @return the RaiEgressPolicyConfig object itself. - */ - public RaiEgressPolicyConfig withRules(List rules) { - this.rules = rules; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); - jsonWriter.writeStringField("defaultAction", this.defaultAction == null ? null : this.defaultAction.toString()); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiEgressPolicyConfig from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiEgressPolicyConfig 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 RaiEgressPolicyConfig. - */ - public static RaiEgressPolicyConfig fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiEgressPolicyConfig deserializedRaiEgressPolicyConfig = new RaiEgressPolicyConfig(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("mode".equals(fieldName)) { - deserializedRaiEgressPolicyConfig.mode = RaiEgressMode.fromString(reader.getString()); - } else if ("defaultAction".equals(fieldName)) { - deserializedRaiEgressPolicyConfig.defaultAction - = RaiEgressDefaultAction.fromString(reader.getString()); - } else if ("description".equals(fieldName)) { - deserializedRaiEgressPolicyConfig.description = reader.getString(); - } else if ("rules".equals(fieldName)) { - List rules = reader.readArray(reader1 -> RaiEgressRule.fromJson(reader1)); - deserializedRaiEgressPolicyConfig.rules = rules; - } else { - reader.skipChildren(); - } - } - - return deserializedRaiEgressPolicyConfig; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRewriteTarget.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRewriteTarget.java deleted file mode 100644 index 4a5351f84d0d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRewriteTarget.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Where a Rewrite action sends matched traffic. At least one field must be set; - * omitted fields retain the original request values. This constraint is enforced - * by the server (400 Bad Request if all fields are omitted). - */ -@Fluent -public final class RaiEgressRewriteTarget implements JsonSerializable { - /* - * Target scheme. Original scheme is kept if omitted. - */ - private RaiEgressScheme scheme; - - /* - * Target host. Original host is kept if omitted. - */ - private String host; - - /* - * Target path (literal string). Original path (and query) is kept if omitted. - */ - private String path; - - /** - * Creates an instance of RaiEgressRewriteTarget class. - */ - public RaiEgressRewriteTarget() { - } - - /** - * Get the scheme property: Target scheme. Original scheme is kept if omitted. - * - * @return the scheme value. - */ - public RaiEgressScheme scheme() { - return this.scheme; - } - - /** - * Set the scheme property: Target scheme. Original scheme is kept if omitted. - * - * @param scheme the scheme value to set. - * @return the RaiEgressRewriteTarget object itself. - */ - public RaiEgressRewriteTarget withScheme(RaiEgressScheme scheme) { - this.scheme = scheme; - return this; - } - - /** - * Get the host property: Target host. Original host is kept if omitted. - * - * @return the host value. - */ - public String host() { - return this.host; - } - - /** - * Set the host property: Target host. Original host is kept if omitted. - * - * @param host the host value to set. - * @return the RaiEgressRewriteTarget object itself. - */ - public RaiEgressRewriteTarget withHost(String host) { - this.host = host; - return this; - } - - /** - * Get the path property: Target path (literal string). Original path (and query) is kept if omitted. - * - * @return the path value. - */ - public String path() { - return this.path; - } - - /** - * Set the path property: Target path (literal string). Original path (and query) is kept if omitted. - * - * @param path the path value to set. - * @return the RaiEgressRewriteTarget object itself. - */ - public RaiEgressRewriteTarget withPath(String path) { - this.path = path; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("scheme", this.scheme == null ? null : this.scheme.toString()); - jsonWriter.writeStringField("host", this.host); - jsonWriter.writeStringField("path", this.path); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiEgressRewriteTarget from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiEgressRewriteTarget 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 RaiEgressRewriteTarget. - */ - public static RaiEgressRewriteTarget fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiEgressRewriteTarget deserializedRaiEgressRewriteTarget = new RaiEgressRewriteTarget(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("scheme".equals(fieldName)) { - deserializedRaiEgressRewriteTarget.scheme = RaiEgressScheme.fromString(reader.getString()); - } else if ("host".equals(fieldName)) { - deserializedRaiEgressRewriteTarget.host = reader.getString(); - } else if ("path".equals(fieldName)) { - deserializedRaiEgressRewriteTarget.path = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiEgressRewriteTarget; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRule.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRule.java deleted file mode 100644 index ae3957b1f907..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRule.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * A single egress rule. Rules are evaluated in order; first match wins. - */ -@Fluent -public final class RaiEgressRule implements JsonSerializable { - /* - * Name of the rule. Must be unique within the policy. - */ - private String name; - - /* - * Description of the rule. - */ - private String description; - - /* - * The type of rule (e.g., Fqdn). Determines how match criteria are interpreted. - */ - private RaiEgressRuleType ruleType; - - /* - * The match criteria for this rule. - */ - private RaiEgressRuleMatch match; - - /* - * The action to take when this rule matches, including the action type and any - * type-specific configuration (headers for Transform, rewrite target for Rewrite). - */ - private RaiEgressRuleAction action; - - /** - * Creates an instance of RaiEgressRule class. - */ - public RaiEgressRule() { - } - - /** - * Get the name property: Name of the rule. Must be unique within the policy. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the rule. Must be unique within the policy. - * - * @param name the name value to set. - * @return the RaiEgressRule object itself. - */ - public RaiEgressRule withName(String name) { - this.name = name; - return this; - } - - /** - * Get the description property: Description of the rule. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the rule. - * - * @param description the description value to set. - * @return the RaiEgressRule object itself. - */ - public RaiEgressRule withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the ruleType property: The type of rule (e.g., Fqdn). Determines how match criteria are interpreted. - * - * @return the ruleType value. - */ - public RaiEgressRuleType ruleType() { - return this.ruleType; - } - - /** - * Set the ruleType property: The type of rule (e.g., Fqdn). Determines how match criteria are interpreted. - * - * @param ruleType the ruleType value to set. - * @return the RaiEgressRule object itself. - */ - public RaiEgressRule withRuleType(RaiEgressRuleType ruleType) { - this.ruleType = ruleType; - return this; - } - - /** - * Get the match property: The match criteria for this rule. - * - * @return the match value. - */ - public RaiEgressRuleMatch match() { - return this.match; - } - - /** - * Set the match property: The match criteria for this rule. - * - * @param match the match value to set. - * @return the RaiEgressRule object itself. - */ - public RaiEgressRule withMatch(RaiEgressRuleMatch match) { - this.match = match; - return this; - } - - /** - * Get the action property: The action to take when this rule matches, including the action type and any - * type-specific configuration (headers for Transform, rewrite target for Rewrite). - * - * @return the action value. - */ - public RaiEgressRuleAction action() { - return this.action; - } - - /** - * Set the action property: The action to take when this rule matches, including the action type and any - * type-specific configuration (headers for Transform, rewrite target for Rewrite). - * - * @param action the action value to set. - * @return the RaiEgressRule object itself. - */ - public RaiEgressRule withAction(RaiEgressRuleAction action) { - this.action = action; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("ruleType", this.ruleType == null ? null : this.ruleType.toString()); - jsonWriter.writeJsonField("action", this.action); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeJsonField("match", this.match); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiEgressRule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiEgressRule 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 RaiEgressRule. - */ - public static RaiEgressRule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiEgressRule deserializedRaiEgressRule = new RaiEgressRule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedRaiEgressRule.name = reader.getString(); - } else if ("ruleType".equals(fieldName)) { - deserializedRaiEgressRule.ruleType = RaiEgressRuleType.fromString(reader.getString()); - } else if ("action".equals(fieldName)) { - deserializedRaiEgressRule.action = RaiEgressRuleAction.fromJson(reader); - } else if ("description".equals(fieldName)) { - deserializedRaiEgressRule.description = reader.getString(); - } else if ("match".equals(fieldName)) { - deserializedRaiEgressRule.match = RaiEgressRuleMatch.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiEgressRule; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRuleAction.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRuleAction.java deleted file mode 100644 index 702e4884253b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRuleAction.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * The action an egress rule takes when it matches. - * - Allow/Deny: no additional fields needed; headers and rewrite must not be set. - * - Transform: headers is required with at least one entry; rewrite must not be set. - * - Rewrite: rewrite is required with at least one of scheme/host/path; - * headers is optional for injecting headers alongside the redirect. - */ -@Fluent -public final class RaiEgressRuleAction implements JsonSerializable { - /* - * The kind of action. - */ - private RaiEgressRuleActionType actionType; - - /* - * Header transforms to apply. Required for Transform; optional for Rewrite; - * not allowed for Allow or Deny. - */ - private List headers; - - /* - * Destination override. Required for Rewrite; not allowed otherwise. - */ - private RaiEgressRewriteTarget rewrite; - - /** - * Creates an instance of RaiEgressRuleAction class. - */ - public RaiEgressRuleAction() { - } - - /** - * Get the actionType property: The kind of action. - * - * @return the actionType value. - */ - public RaiEgressRuleActionType actionType() { - return this.actionType; - } - - /** - * Set the actionType property: The kind of action. - * - * @param actionType the actionType value to set. - * @return the RaiEgressRuleAction object itself. - */ - public RaiEgressRuleAction withActionType(RaiEgressRuleActionType actionType) { - this.actionType = actionType; - return this; - } - - /** - * Get the headers property: Header transforms to apply. Required for Transform; optional for Rewrite; - * not allowed for Allow or Deny. - * - * @return the headers value. - */ - public List headers() { - return this.headers; - } - - /** - * Set the headers property: Header transforms to apply. Required for Transform; optional for Rewrite; - * not allowed for Allow or Deny. - * - * @param headers the headers value to set. - * @return the RaiEgressRuleAction object itself. - */ - public RaiEgressRuleAction withHeaders(List headers) { - this.headers = headers; - return this; - } - - /** - * Get the rewrite property: Destination override. Required for Rewrite; not allowed otherwise. - * - * @return the rewrite value. - */ - public RaiEgressRewriteTarget rewrite() { - return this.rewrite; - } - - /** - * Set the rewrite property: Destination override. Required for Rewrite; not allowed otherwise. - * - * @param rewrite the rewrite value to set. - * @return the RaiEgressRuleAction object itself. - */ - public RaiEgressRuleAction withRewrite(RaiEgressRewriteTarget rewrite) { - this.rewrite = rewrite; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("actionType", this.actionType == null ? null : this.actionType.toString()); - jsonWriter.writeArrayField("headers", this.headers, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("rewrite", this.rewrite); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiEgressRuleAction from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiEgressRuleAction 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 RaiEgressRuleAction. - */ - public static RaiEgressRuleAction fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiEgressRuleAction deserializedRaiEgressRuleAction = new RaiEgressRuleAction(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("actionType".equals(fieldName)) { - deserializedRaiEgressRuleAction.actionType = RaiEgressRuleActionType.fromString(reader.getString()); - } else if ("headers".equals(fieldName)) { - List headers - = reader.readArray(reader1 -> RaiEgressHeaderTransform.fromJson(reader1)); - deserializedRaiEgressRuleAction.headers = headers; - } else if ("rewrite".equals(fieldName)) { - deserializedRaiEgressRuleAction.rewrite = RaiEgressRewriteTarget.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiEgressRuleAction; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRuleActionType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRuleActionType.java deleted file mode 100644 index 2c2c53ba5c8d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRuleActionType.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The kind of action an egress rule takes when it matches. - */ -public final class RaiEgressRuleActionType extends ExpandableStringEnum { - /** - * Allow the matched traffic. - */ - public static final RaiEgressRuleActionType ALLOW = fromString("Allow"); - - /** - * Deny the matched traffic. - */ - public static final RaiEgressRuleActionType DENY = fromString("Deny"); - - /** - * Forward the matched traffic after applying header transforms. Requires at least one header. - */ - public static final RaiEgressRuleActionType TRANSFORM = fromString("Transform"); - - /** - * Redirect the matched traffic to a new destination, optionally applying header transforms. Requires a rewrite - * target. - */ - public static final RaiEgressRuleActionType REWRITE = fromString("Rewrite"); - - /** - * Creates a new instance of RaiEgressRuleActionType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RaiEgressRuleActionType() { - } - - /** - * Creates or finds a RaiEgressRuleActionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding RaiEgressRuleActionType. - */ - public static RaiEgressRuleActionType fromString(String name) { - return fromString(name, RaiEgressRuleActionType.class); - } - - /** - * Gets known RaiEgressRuleActionType values. - * - * @return known RaiEgressRuleActionType values. - */ - public static Collection values() { - return values(RaiEgressRuleActionType.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRuleMatch.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRuleMatch.java deleted file mode 100644 index 4d65d9612bbc..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRuleMatch.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 match criteria for an egress rule. - * If both host and path are omitted, the rule matches all traffic. - * Host uses DNS wildcard syntax (e.g., "*.openai.com" matches "api.openai.com"). - * Path uses URI prefix matching with '*' as a single-segment wildcard (e.g., "/v1/*" matches "/v1/chat"). - */ -@Fluent -public final class RaiEgressRuleMatch implements JsonSerializable { - /* - * Host pattern to match using DNS wildcard syntax (e.g., "*.openai.com"). - * A leading "*." matches any subdomain. Omit to match all hosts. - */ - private String host; - - /* - * Path pattern to match using URI prefix with '*' wildcard (e.g., "/v1/*"). - * Omit to match all paths. - */ - private String path; - - /** - * Creates an instance of RaiEgressRuleMatch class. - */ - public RaiEgressRuleMatch() { - } - - /** - * Get the host property: Host pattern to match using DNS wildcard syntax (e.g., "*.openai.com"). - * A leading "*." matches any subdomain. Omit to match all hosts. - * - * @return the host value. - */ - public String host() { - return this.host; - } - - /** - * Set the host property: Host pattern to match using DNS wildcard syntax (e.g., "*.openai.com"). - * A leading "*." matches any subdomain. Omit to match all hosts. - * - * @param host the host value to set. - * @return the RaiEgressRuleMatch object itself. - */ - public RaiEgressRuleMatch withHost(String host) { - this.host = host; - return this; - } - - /** - * Get the path property: Path pattern to match using URI prefix with '*' wildcard (e.g., "/v1/*"). - * Omit to match all paths. - * - * @return the path value. - */ - public String path() { - return this.path; - } - - /** - * Set the path property: Path pattern to match using URI prefix with '*' wildcard (e.g., "/v1/*"). - * Omit to match all paths. - * - * @param path the path value to set. - * @return the RaiEgressRuleMatch object itself. - */ - public RaiEgressRuleMatch withPath(String path) { - this.path = path; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("host", this.host); - jsonWriter.writeStringField("path", this.path); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiEgressRuleMatch from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiEgressRuleMatch 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 RaiEgressRuleMatch. - */ - public static RaiEgressRuleMatch fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiEgressRuleMatch deserializedRaiEgressRuleMatch = new RaiEgressRuleMatch(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("host".equals(fieldName)) { - deserializedRaiEgressRuleMatch.host = reader.getString(); - } else if ("path".equals(fieldName)) { - deserializedRaiEgressRuleMatch.path = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiEgressRuleMatch; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRuleType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRuleType.java deleted file mode 100644 index 1d8bba338af4..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressRuleType.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The type of an egress rule, determining what kind of traffic matching it performs. - */ -public final class RaiEgressRuleType extends ExpandableStringEnum { - /** - * Fully qualified domain name (FQDN) based rule matching on host and path patterns. - */ - public static final RaiEgressRuleType FQDN = fromString("Fqdn"); - - /** - * Creates a new instance of RaiEgressRuleType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RaiEgressRuleType() { - } - - /** - * Creates or finds a RaiEgressRuleType from its string representation. - * - * @param name a name to look for. - * @return the corresponding RaiEgressRuleType. - */ - public static RaiEgressRuleType fromString(String name) { - return fromString(name, RaiEgressRuleType.class); - } - - /** - * Gets known RaiEgressRuleType values. - * - * @return known RaiEgressRuleType values. - */ - public static Collection values() { - return values(RaiEgressRuleType.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressScheme.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressScheme.java deleted file mode 100644 index 3c3ef676ba0a..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressScheme.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * URL scheme for rewrite targets. Only HTTP and HTTPS are supported. - */ -public final class RaiEgressScheme extends ExpandableStringEnum { - /** - * HTTP scheme. - */ - public static final RaiEgressScheme HTTP = fromString("http"); - - /** - * HTTPS scheme. - */ - public static final RaiEgressScheme HTTPS = fromString("https"); - - /** - * Creates a new instance of RaiEgressScheme value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RaiEgressScheme() { - } - - /** - * Creates or finds a RaiEgressScheme from its string representation. - * - * @param name a name to look for. - * @return the corresponding RaiEgressScheme. - */ - public static RaiEgressScheme fromString(String name) { - return fromString(name, RaiEgressScheme.class); - } - - /** - * Gets known RaiEgressScheme values. - * - * @return known RaiEgressScheme values. - */ - public static Collection values() { - return values(RaiEgressScheme.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressSecretRef.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressSecretRef.java deleted file mode 100644 index 3d0e08d393e1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiEgressSecretRef.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * A reference to a stored secret used as a header value. - */ -@Fluent -public final class RaiEgressSecretRef implements JsonSerializable { - /* - * Identifier of the secret to inject. - */ - private String secretId; - - /* - * Optional key within the secret. - */ - private String secretKey; - - /* - * Optional format for the resolved value; "{value}" is the placeholder, e.g. "Bearer {value}". - */ - private String format; - - /** - * Creates an instance of RaiEgressSecretRef class. - */ - public RaiEgressSecretRef() { - } - - /** - * Get the secretId property: Identifier of the secret to inject. - * - * @return the secretId value. - */ - public String secretId() { - return this.secretId; - } - - /** - * Set the secretId property: Identifier of the secret to inject. - * - * @param secretId the secretId value to set. - * @return the RaiEgressSecretRef object itself. - */ - public RaiEgressSecretRef withSecretId(String secretId) { - this.secretId = secretId; - return this; - } - - /** - * Get the secretKey property: Optional key within the secret. - * - * @return the secretKey value. - */ - public String secretKey() { - return this.secretKey; - } - - /** - * Set the secretKey property: Optional key within the secret. - * - * @param secretKey the secretKey value to set. - * @return the RaiEgressSecretRef object itself. - */ - public RaiEgressSecretRef withSecretKey(String secretKey) { - this.secretKey = secretKey; - return this; - } - - /** - * Get the format property: Optional format for the resolved value; "{value}" is the placeholder, e.g. "Bearer - * {value}". - * - * @return the format value. - */ - public String format() { - return this.format; - } - - /** - * Set the format property: Optional format for the resolved value; "{value}" is the placeholder, e.g. "Bearer - * {value}". - * - * @param format the format value to set. - * @return the RaiEgressSecretRef object itself. - */ - public RaiEgressSecretRef withFormat(String format) { - this.format = format; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("secretId", this.secretId); - jsonWriter.writeStringField("secretKey", this.secretKey); - jsonWriter.writeStringField("format", this.format); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiEgressSecretRef from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiEgressSecretRef 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 RaiEgressSecretRef. - */ - public static RaiEgressSecretRef fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiEgressSecretRef deserializedRaiEgressSecretRef = new RaiEgressSecretRef(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("secretId".equals(fieldName)) { - deserializedRaiEgressSecretRef.secretId = reader.getString(); - } else if ("secretKey".equals(fieldName)) { - deserializedRaiEgressSecretRef.secretKey = reader.getString(); - } else if ("format".equals(fieldName)) { - deserializedRaiEgressSecretRef.format = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiEgressSecretRef; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderSchema.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderSchema.java deleted file mode 100644 index 3c8ffa3b113b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderSchema.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; -import java.util.Map; - -/** - * An immutable client-side representation of RaiExternalSafetyProviderSchema. - */ -public interface RaiExternalSafetyProviderSchema { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Properties of Cognitive Services Rai External Safety provider. - * - * @return the properties value. - */ - RaiExternalSafetyProviderSchemaProperties properties(); - - /** - * Gets the etag property: Resource Etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner - * object. - * - * @return the inner object. - */ - RaiExternalSafetyProviderSchemaInner innerModel(); - - /** - * The entirety of the RaiExternalSafetyProviderSchema definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The RaiExternalSafetyProviderSchema definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the RaiExternalSafetyProviderSchema definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the RaiExternalSafetyProviderSchema definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, accountName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @return the next definition stage. - */ - WithCreate withExistingAccount(String resourceGroupName, String accountName); - } - - /** - * The stage of the RaiExternalSafetyProviderSchema definition which contains all the minimum required - * properties for the resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - RaiExternalSafetyProviderSchema create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - RaiExternalSafetyProviderSchema create(Context context); - } - - /** - * The stage of the RaiExternalSafetyProviderSchema definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of Cognitive Services Rai External Safety provider.. - * - * @param properties Properties of Cognitive Services Rai External Safety provider. - * @return the next definition stage. - */ - WithCreate withProperties(RaiExternalSafetyProviderSchemaProperties properties); - } - } - - /** - * Begins update for the RaiExternalSafetyProviderSchema resource. - * - * @return the stage of resource update. - */ - RaiExternalSafetyProviderSchema.Update update(); - - /** - * The template for RaiExternalSafetyProviderSchema update. - */ - interface Update extends UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - RaiExternalSafetyProviderSchema apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - RaiExternalSafetyProviderSchema apply(Context context); - } - - /** - * The RaiExternalSafetyProviderSchema update stages. - */ - interface UpdateStages { - /** - * The stage of the RaiExternalSafetyProviderSchema update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of Cognitive Services Rai External Safety provider.. - * - * @param properties Properties of Cognitive Services Rai External Safety provider. - * @return the next definition stage. - */ - Update withProperties(RaiExternalSafetyProviderSchemaProperties properties); - } - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderSchemaProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderSchemaProperties.java deleted file mode 100644 index 2909a46b6237..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderSchemaProperties.java +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * RAI External SafetyProvider schema properties. - */ -@Fluent -public final class RaiExternalSafetyProviderSchemaProperties - implements JsonSerializable { - /* - * The unique identifier of the safety provider. - */ - private String providerId; - - /* - * Name of the safety provider. - */ - private String providerName; - - /* - * Safety provider mode sync/async. - */ - private String mode; - - /* - * Webhook URL for the safety provider. - */ - private String url; - - /* - * The name of the secret in Key Vault that contains the api key to access the webhook. - */ - private String secretName; - - /* - * The managed identity to access the Key Vault. - */ - private String managedIdentity; - - /* - * The Key Vault URI that contains the api key for safety provider urls. - */ - private String keyVaultUri; - - /* - * Creation time of the safety provider. - */ - private OffsetDateTime createdAt; - - /* - * Last modified time of the safety provider. - */ - private OffsetDateTime lastModifiedAt; - - /** - * Creates an instance of RaiExternalSafetyProviderSchemaProperties class. - */ - public RaiExternalSafetyProviderSchemaProperties() { - } - - /** - * Get the providerId property: The unique identifier of the safety provider. - * - * @return the providerId value. - */ - public String providerId() { - return this.providerId; - } - - /** - * Set the providerId property: The unique identifier of the safety provider. - * - * @param providerId the providerId value to set. - * @return the RaiExternalSafetyProviderSchemaProperties object itself. - */ - public RaiExternalSafetyProviderSchemaProperties withProviderId(String providerId) { - this.providerId = providerId; - return this; - } - - /** - * Get the providerName property: Name of the safety provider. - * - * @return the providerName value. - */ - public String providerName() { - return this.providerName; - } - - /** - * Set the providerName property: Name of the safety provider. - * - * @param providerName the providerName value to set. - * @return the RaiExternalSafetyProviderSchemaProperties object itself. - */ - public RaiExternalSafetyProviderSchemaProperties withProviderName(String providerName) { - this.providerName = providerName; - return this; - } - - /** - * Get the mode property: Safety provider mode sync/async. - * - * @return the mode value. - */ - public String mode() { - return this.mode; - } - - /** - * Set the mode property: Safety provider mode sync/async. - * - * @param mode the mode value to set. - * @return the RaiExternalSafetyProviderSchemaProperties object itself. - */ - public RaiExternalSafetyProviderSchemaProperties withMode(String mode) { - this.mode = mode; - return this; - } - - /** - * Get the url property: Webhook URL for the safety provider. - * - * @return the url value. - */ - public String url() { - return this.url; - } - - /** - * Set the url property: Webhook URL for the safety provider. - * - * @param url the url value to set. - * @return the RaiExternalSafetyProviderSchemaProperties object itself. - */ - public RaiExternalSafetyProviderSchemaProperties withUrl(String url) { - this.url = url; - return this; - } - - /** - * Get the secretName property: The name of the secret in Key Vault that contains the api key to access the webhook. - * - * @return the secretName value. - */ - public String secretName() { - return this.secretName; - } - - /** - * Set the secretName property: The name of the secret in Key Vault that contains the api key to access the webhook. - * - * @param secretName the secretName value to set. - * @return the RaiExternalSafetyProviderSchemaProperties object itself. - */ - public RaiExternalSafetyProviderSchemaProperties withSecretName(String secretName) { - this.secretName = secretName; - return this; - } - - /** - * Get the managedIdentity property: The managed identity to access the Key Vault. - * - * @return the managedIdentity value. - */ - public String managedIdentity() { - return this.managedIdentity; - } - - /** - * Set the managedIdentity property: The managed identity to access the Key Vault. - * - * @param managedIdentity the managedIdentity value to set. - * @return the RaiExternalSafetyProviderSchemaProperties object itself. - */ - public RaiExternalSafetyProviderSchemaProperties withManagedIdentity(String managedIdentity) { - this.managedIdentity = managedIdentity; - return this; - } - - /** - * Get the keyVaultUri property: The Key Vault URI that contains the api key for safety provider urls. - * - * @return the keyVaultUri value. - */ - public String keyVaultUri() { - return this.keyVaultUri; - } - - /** - * Set the keyVaultUri property: The Key Vault URI that contains the api key for safety provider urls. - * - * @param keyVaultUri the keyVaultUri value to set. - * @return the RaiExternalSafetyProviderSchemaProperties object itself. - */ - public RaiExternalSafetyProviderSchemaProperties withKeyVaultUri(String keyVaultUri) { - this.keyVaultUri = keyVaultUri; - return this; - } - - /** - * Get the createdAt property: Creation time of the safety provider. - * - * @return the createdAt value. - */ - public OffsetDateTime createdAt() { - return this.createdAt; - } - - /** - * Get the lastModifiedAt property: Last modified time of the safety provider. - * - * @return the lastModifiedAt value. - */ - public OffsetDateTime lastModifiedAt() { - return this.lastModifiedAt; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("providerId", this.providerId); - jsonWriter.writeStringField("providerName", this.providerName); - jsonWriter.writeStringField("mode", this.mode); - jsonWriter.writeStringField("url", this.url); - jsonWriter.writeStringField("secretName", this.secretName); - jsonWriter.writeStringField("managedIdentity", this.managedIdentity); - jsonWriter.writeStringField("keyVaultUri", this.keyVaultUri); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiExternalSafetyProviderSchemaProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiExternalSafetyProviderSchemaProperties 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 RaiExternalSafetyProviderSchemaProperties. - */ - public static RaiExternalSafetyProviderSchemaProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiExternalSafetyProviderSchemaProperties deserializedRaiExternalSafetyProviderSchemaProperties - = new RaiExternalSafetyProviderSchemaProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("providerId".equals(fieldName)) { - deserializedRaiExternalSafetyProviderSchemaProperties.providerId = reader.getString(); - } else if ("providerName".equals(fieldName)) { - deserializedRaiExternalSafetyProviderSchemaProperties.providerName = reader.getString(); - } else if ("mode".equals(fieldName)) { - deserializedRaiExternalSafetyProviderSchemaProperties.mode = reader.getString(); - } else if ("url".equals(fieldName)) { - deserializedRaiExternalSafetyProviderSchemaProperties.url = reader.getString(); - } else if ("secretName".equals(fieldName)) { - deserializedRaiExternalSafetyProviderSchemaProperties.secretName = reader.getString(); - } else if ("managedIdentity".equals(fieldName)) { - deserializedRaiExternalSafetyProviderSchemaProperties.managedIdentity = reader.getString(); - } else if ("keyVaultUri".equals(fieldName)) { - deserializedRaiExternalSafetyProviderSchemaProperties.keyVaultUri = reader.getString(); - } else if ("createdAt".equals(fieldName)) { - deserializedRaiExternalSafetyProviderSchemaProperties.createdAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("lastModifiedAt".equals(fieldName)) { - deserializedRaiExternalSafetyProviderSchemaProperties.lastModifiedAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiExternalSafetyProviderSchemaProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviders.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviders.java deleted file mode 100644 index e55db4f9dd16..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviders.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; - -/** - * Resource collection API of RaiExternalSafetyProviders. - */ -public interface RaiExternalSafetyProviders { - /** - * Gets the specified external safety provider associated with the Subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @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 specified external safety provider associated with the Subscription along with {@link Response}. - */ - Response getWithResponse(String safetyProviderName, Context context); - - /** - * Gets the specified external safety provider associated with the Subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 external safety provider associated with the Subscription. - */ - RaiExternalSafetyProviderSchema get(String safetyProviderName); - - /** - * Create the rai safety provider associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @param safetyProvider Properties describing the rai external safety provider. - * @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 cognitive Services Rai External Safety provider Schema along with {@link Response}. - */ - Response createOrUpdateWithResponse(String safetyProviderName, - RaiExternalSafetyProviderSchemaInner safetyProvider, Context context); - - /** - * Create the rai safety provider associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @param safetyProvider Properties describing the rai external safety provider. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services Rai External Safety provider Schema. - */ - RaiExternalSafetyProviderSchema createOrUpdate(String safetyProviderName, - RaiExternalSafetyProviderSchemaInner safetyProvider); - - /** - * Deletes the specified custom topic associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 safetyProviderName); - - /** - * Deletes the specified custom topic associated with the subscription. - * - * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services - * Account. - * @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 safetyProviderName, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProvidersOperations.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProvidersOperations.java deleted file mode 100644 index be6871c61ecb..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProvidersOperations.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of RaiExternalSafetyProvidersOperations. - */ -public interface RaiExternalSafetyProvidersOperations { - /** - * Gets the safety providers associated with the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the safety providers associated with the subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Gets the safety providers associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the safety providers associated with the subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiMonitorConfig.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiMonitorConfig.java deleted file mode 100644 index bf96a808f6dc..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiMonitorConfig.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Cognitive Services Rai Monitor Config. - */ -@Fluent -public final class RaiMonitorConfig implements JsonSerializable { - /* - * The storage resource Id. - */ - private String adxStorageResourceId; - - /* - * The identity client Id to access the storage. - */ - private String identityClientId; - - /** - * Creates an instance of RaiMonitorConfig class. - */ - public RaiMonitorConfig() { - } - - /** - * Get the adxStorageResourceId property: The storage resource Id. - * - * @return the adxStorageResourceId value. - */ - public String adxStorageResourceId() { - return this.adxStorageResourceId; - } - - /** - * Set the adxStorageResourceId property: The storage resource Id. - * - * @param adxStorageResourceId the adxStorageResourceId value to set. - * @return the RaiMonitorConfig object itself. - */ - public RaiMonitorConfig withAdxStorageResourceId(String adxStorageResourceId) { - this.adxStorageResourceId = adxStorageResourceId; - return this; - } - - /** - * Get the identityClientId property: The identity client Id to access the storage. - * - * @return the identityClientId value. - */ - public String identityClientId() { - return this.identityClientId; - } - - /** - * Set the identityClientId property: The identity client Id to access the storage. - * - * @param identityClientId the identityClientId value to set. - * @return the RaiMonitorConfig object itself. - */ - public RaiMonitorConfig withIdentityClientId(String identityClientId) { - this.identityClientId = identityClientId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("adxStorageResourceId", this.adxStorageResourceId); - jsonWriter.writeStringField("identityClientId", this.identityClientId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiMonitorConfig from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiMonitorConfig 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 RaiMonitorConfig. - */ - public static RaiMonitorConfig fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiMonitorConfig deserializedRaiMonitorConfig = new RaiMonitorConfig(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("adxStorageResourceId".equals(fieldName)) { - deserializedRaiMonitorConfig.adxStorageResourceId = reader.getString(); - } else if ("identityClientId".equals(fieldName)) { - deserializedRaiMonitorConfig.identityClientId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiMonitorConfig; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicies.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicies.java deleted file mode 100644 index 999254099e2b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicies.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 RaiPolicies. - */ -public interface RaiPolicies { - /** - * Gets the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @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 specified Content Filters associated with the Azure OpenAI account along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, String raiPolicyName, - Context context); - - /** - * Gets the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 Content Filters associated with the Azure OpenAI account. - */ - RaiPolicy get(String resourceGroupName, String accountName, String raiPolicyName); - - /** - * Deletes the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String raiPolicyName); - - /** - * Deletes the specified Content Filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @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 accountName, String raiPolicyName, Context context); - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, Context context); - - /** - * Gets the specified Content Filters associated with the Azure OpenAI account. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Content Filters associated with the Azure OpenAI account along with {@link Response}. - */ - RaiPolicy getById(String id); - - /** - * Gets the specified Content Filters associated with the Azure OpenAI account. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Content Filters associated with the Azure OpenAI account along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes the specified Content Filters associated with the Azure OpenAI account. - * - * @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 the specified Content Filters associated with the Azure OpenAI account. - * - * @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 RaiPolicy resource. - * - * @param name resource name. - * @return the first stage of the new RaiPolicy definition. - */ - RaiPolicy.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicy.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicy.java deleted file mode 100644 index 02ba26aba154..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicy.java +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner; -import java.util.Map; - -/** - * An immutable client-side representation of RaiPolicy. - */ -public interface RaiPolicy { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Properties of Cognitive Services RaiPolicy. - * - * @return the properties value. - */ - RaiPolicyProperties properties(); - - /** - * Gets the etag property: Resource Etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner object. - * - * @return the inner object. - */ - RaiPolicyInner innerModel(); - - /** - * The entirety of the RaiPolicy definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The RaiPolicy definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the RaiPolicy definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the RaiPolicy definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, accountName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @return the next definition stage. - */ - WithCreate withExistingAccount(String resourceGroupName, String accountName); - } - - /** - * The stage of the RaiPolicy 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.WithTags, DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - RaiPolicy create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - RaiPolicy create(Context context); - } - - /** - * The stage of the RaiPolicy definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the RaiPolicy definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of Cognitive Services RaiPolicy.. - * - * @param properties Properties of Cognitive Services RaiPolicy. - * @return the next definition stage. - */ - WithCreate withProperties(RaiPolicyProperties properties); - } - } - - /** - * Begins update for the RaiPolicy resource. - * - * @return the stage of resource update. - */ - RaiPolicy.Update update(); - - /** - * The template for RaiPolicy update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - RaiPolicy apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - RaiPolicy apply(Context context); - } - - /** - * The RaiPolicy update stages. - */ - interface UpdateStages { - /** - * The stage of the RaiPolicy update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the RaiPolicy update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of Cognitive Services RaiPolicy.. - * - * @param properties Properties of Cognitive Services RaiPolicy. - * @return the next definition stage. - */ - Update withProperties(RaiPolicyProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - RaiPolicy refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - RaiPolicy refresh(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyContentFilter.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyContentFilter.java deleted file mode 100644 index 87e2c8062fb8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyContentFilter.java +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Azure OpenAI Content Filter. - */ -@Fluent -public final class RaiPolicyContentFilter implements JsonSerializable { - /* - * Name of ContentFilter. - */ - private String name; - - /* - * If the ContentFilter is enabled. - */ - private Boolean enabled; - - /* - * Level at which content is filtered. - */ - private ContentLevel severityThreshold; - - /* - * If blocking would occur. - */ - private Boolean blocking; - - /* - * Content source to apply the Content Filters. - */ - private RaiPolicyContentSource source; - - /* - * The action types to apply to the content filters - */ - private RaiActionType action; - - /** - * Creates an instance of RaiPolicyContentFilter class. - */ - public RaiPolicyContentFilter() { - } - - /** - * Get the name property: Name of ContentFilter. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of ContentFilter. - * - * @param name the name value to set. - * @return the RaiPolicyContentFilter object itself. - */ - public RaiPolicyContentFilter withName(String name) { - this.name = name; - return this; - } - - /** - * Get the enabled property: If the ContentFilter is enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: If the ContentFilter is enabled. - * - * @param enabled the enabled value to set. - * @return the RaiPolicyContentFilter object itself. - */ - public RaiPolicyContentFilter withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the severityThreshold property: Level at which content is filtered. - * - * @return the severityThreshold value. - */ - public ContentLevel severityThreshold() { - return this.severityThreshold; - } - - /** - * Set the severityThreshold property: Level at which content is filtered. - * - * @param severityThreshold the severityThreshold value to set. - * @return the RaiPolicyContentFilter object itself. - */ - public RaiPolicyContentFilter withSeverityThreshold(ContentLevel severityThreshold) { - this.severityThreshold = severityThreshold; - return this; - } - - /** - * Get the blocking property: If blocking would occur. - * - * @return the blocking value. - */ - public Boolean blocking() { - return this.blocking; - } - - /** - * Set the blocking property: If blocking would occur. - * - * @param blocking the blocking value to set. - * @return the RaiPolicyContentFilter object itself. - */ - public RaiPolicyContentFilter withBlocking(Boolean blocking) { - this.blocking = blocking; - return this; - } - - /** - * Get the source property: Content source to apply the Content Filters. - * - * @return the source value. - */ - public RaiPolicyContentSource source() { - return this.source; - } - - /** - * Set the source property: Content source to apply the Content Filters. - * - * @param source the source value to set. - * @return the RaiPolicyContentFilter object itself. - */ - public RaiPolicyContentFilter withSource(RaiPolicyContentSource source) { - this.source = source; - return this; - } - - /** - * Get the action property: The action types to apply to the content filters. - * - * @return the action value. - */ - public RaiActionType action() { - return this.action; - } - - /** - * Set the action property: The action types to apply to the content filters. - * - * @param action the action value to set. - * @return the RaiPolicyContentFilter object itself. - */ - public RaiPolicyContentFilter withAction(RaiActionType action) { - this.action = action; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeStringField("severityThreshold", - this.severityThreshold == null ? null : this.severityThreshold.toString()); - jsonWriter.writeBooleanField("blocking", this.blocking); - jsonWriter.writeStringField("source", this.source == null ? null : this.source.toString()); - jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiPolicyContentFilter from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiPolicyContentFilter 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 RaiPolicyContentFilter. - */ - public static RaiPolicyContentFilter fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiPolicyContentFilter deserializedRaiPolicyContentFilter = new RaiPolicyContentFilter(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedRaiPolicyContentFilter.name = reader.getString(); - } else if ("enabled".equals(fieldName)) { - deserializedRaiPolicyContentFilter.enabled = reader.getNullable(JsonReader::getBoolean); - } else if ("severityThreshold".equals(fieldName)) { - deserializedRaiPolicyContentFilter.severityThreshold = ContentLevel.fromString(reader.getString()); - } else if ("blocking".equals(fieldName)) { - deserializedRaiPolicyContentFilter.blocking = reader.getNullable(JsonReader::getBoolean); - } else if ("source".equals(fieldName)) { - deserializedRaiPolicyContentFilter.source = RaiPolicyContentSource.fromString(reader.getString()); - } else if ("action".equals(fieldName)) { - deserializedRaiPolicyContentFilter.action = RaiActionType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiPolicyContentFilter; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyContentSource.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyContentSource.java deleted file mode 100644 index 69798a1fc443..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyContentSource.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Content source to apply the Content Filters. - */ -public final class RaiPolicyContentSource extends ExpandableStringEnum { - /** - * Static value Prompt for RaiPolicyContentSource. - */ - public static final RaiPolicyContentSource PROMPT = fromString("Prompt"); - - /** - * Static value Completion for RaiPolicyContentSource. - */ - public static final RaiPolicyContentSource COMPLETION = fromString("Completion"); - - /** - * Static value PreToolCall for RaiPolicyContentSource. - */ - public static final RaiPolicyContentSource PRE_TOOL_CALL = fromString("PreToolCall"); - - /** - * Static value PostToolCall for RaiPolicyContentSource. - */ - public static final RaiPolicyContentSource POST_TOOL_CALL = fromString("PostToolCall"); - - /** - * Static value PreRun for RaiPolicyContentSource. - */ - public static final RaiPolicyContentSource PRE_RUN = fromString("PreRun"); - - /** - * Static value PostRun for RaiPolicyContentSource. - */ - public static final RaiPolicyContentSource POST_RUN = fromString("PostRun"); - - /** - * Creates a new instance of RaiPolicyContentSource value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RaiPolicyContentSource() { - } - - /** - * Creates or finds a RaiPolicyContentSource from its string representation. - * - * @param name a name to look for. - * @return the corresponding RaiPolicyContentSource. - */ - public static RaiPolicyContentSource fromString(String name) { - return fromString(name, RaiPolicyContentSource.class); - } - - /** - * Gets known RaiPolicyContentSource values. - * - * @return known RaiPolicyContentSource values. - */ - public static Collection values() { - return values(RaiPolicyContentSource.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyMode.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyMode.java deleted file mode 100644 index 38c25e1385d1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyMode.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. - * Please use 'Asynchronous_filter' after 2025-06-01. It is the same as 'Deferred' in previous version. - */ -public final class RaiPolicyMode extends ExpandableStringEnum { - /** - * Static value Default for RaiPolicyMode. - */ - public static final RaiPolicyMode DEFAULT = fromString("Default"); - - /** - * Static value Deferred for RaiPolicyMode. - */ - public static final RaiPolicyMode DEFERRED = fromString("Deferred"); - - /** - * Static value Blocking for RaiPolicyMode. - */ - public static final RaiPolicyMode BLOCKING = fromString("Blocking"); - - /** - * Static value Asynchronous_filter for RaiPolicyMode. - */ - public static final RaiPolicyMode ASYNCHRONOUS_FILTER = fromString("Asynchronous_filter"); - - /** - * Creates a new instance of RaiPolicyMode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RaiPolicyMode() { - } - - /** - * Creates or finds a RaiPolicyMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding RaiPolicyMode. - */ - public static RaiPolicyMode fromString(String name) { - return fromString(name, RaiPolicyMode.class); - } - - /** - * Gets known RaiPolicyMode values. - * - * @return known RaiPolicyMode values. - */ - public static Collection values() { - return values(RaiPolicyMode.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyProperties.java deleted file mode 100644 index d2883b1856ad..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyProperties.java +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Azure OpenAI Content Filters properties. - */ -@Fluent -public final class RaiPolicyProperties implements JsonSerializable { - /* - * Content Filters policy type. - */ - private RaiPolicyType type; - - /* - * Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. - * Please use 'Asynchronous_filter' after 2025-06-01. It is the same as 'Deferred' in previous version. - */ - private RaiPolicyMode mode; - - /* - * Name of Rai policy. - */ - private String basePolicyName; - - /* - * The list of Content Filters. - */ - private List contentFilters; - - /* - * The list of custom Blocklist. - */ - private List customBlocklists; - - /* - * The list of Safety Providers. - */ - private List safetyProviders; - - /* - * Egress (outbound network) policy controlling which external endpoints sandboxed - * agents can reach. Includes rules with Allow/Deny/Transform/Rewrite actions. - */ - private RaiEgressPolicyConfig egressPolicy; - - /** - * Creates an instance of RaiPolicyProperties class. - */ - public RaiPolicyProperties() { - } - - /** - * Get the type property: Content Filters policy type. - * - * @return the type value. - */ - public RaiPolicyType type() { - return this.type; - } - - /** - * Get the mode property: Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, - * Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2025-06-01. It is the same as 'Deferred' in - * previous version. - * - * @return the mode value. - */ - public RaiPolicyMode mode() { - return this.mode; - } - - /** - * Set the mode property: Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, - * Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2025-06-01. It is the same as 'Deferred' in - * previous version. - * - * @param mode the mode value to set. - * @return the RaiPolicyProperties object itself. - */ - public RaiPolicyProperties withMode(RaiPolicyMode mode) { - this.mode = mode; - return this; - } - - /** - * Get the basePolicyName property: Name of Rai policy. - * - * @return the basePolicyName value. - */ - public String basePolicyName() { - return this.basePolicyName; - } - - /** - * Set the basePolicyName property: Name of Rai policy. - * - * @param basePolicyName the basePolicyName value to set. - * @return the RaiPolicyProperties object itself. - */ - public RaiPolicyProperties withBasePolicyName(String basePolicyName) { - this.basePolicyName = basePolicyName; - return this; - } - - /** - * Get the contentFilters property: The list of Content Filters. - * - * @return the contentFilters value. - */ - public List contentFilters() { - return this.contentFilters; - } - - /** - * Set the contentFilters property: The list of Content Filters. - * - * @param contentFilters the contentFilters value to set. - * @return the RaiPolicyProperties object itself. - */ - public RaiPolicyProperties withContentFilters(List contentFilters) { - this.contentFilters = contentFilters; - return this; - } - - /** - * Get the customBlocklists property: The list of custom Blocklist. - * - * @return the customBlocklists value. - */ - public List customBlocklists() { - return this.customBlocklists; - } - - /** - * Set the customBlocklists property: The list of custom Blocklist. - * - * @param customBlocklists the customBlocklists value to set. - * @return the RaiPolicyProperties object itself. - */ - public RaiPolicyProperties withCustomBlocklists(List customBlocklists) { - this.customBlocklists = customBlocklists; - return this; - } - - /** - * Get the safetyProviders property: The list of Safety Providers. - * - * @return the safetyProviders value. - */ - public List safetyProviders() { - return this.safetyProviders; - } - - /** - * Set the safetyProviders property: The list of Safety Providers. - * - * @param safetyProviders the safetyProviders value to set. - * @return the RaiPolicyProperties object itself. - */ - public RaiPolicyProperties withSafetyProviders(List safetyProviders) { - this.safetyProviders = safetyProviders; - return this; - } - - /** - * Get the egressPolicy property: Egress (outbound network) policy controlling which external endpoints sandboxed - * agents can reach. Includes rules with Allow/Deny/Transform/Rewrite actions. - * - * @return the egressPolicy value. - */ - public RaiEgressPolicyConfig egressPolicy() { - return this.egressPolicy; - } - - /** - * Set the egressPolicy property: Egress (outbound network) policy controlling which external endpoints sandboxed - * agents can reach. Includes rules with Allow/Deny/Transform/Rewrite actions. - * - * @param egressPolicy the egressPolicy value to set. - * @return the RaiPolicyProperties object itself. - */ - public RaiPolicyProperties withEgressPolicy(RaiEgressPolicyConfig egressPolicy) { - this.egressPolicy = egressPolicy; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); - jsonWriter.writeStringField("basePolicyName", this.basePolicyName); - jsonWriter.writeArrayField("contentFilters", this.contentFilters, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("customBlocklists", this.customBlocklists, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("safetyProviders", this.safetyProviders, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("egressPolicy", this.egressPolicy); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiPolicyProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiPolicyProperties 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 RaiPolicyProperties. - */ - public static RaiPolicyProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiPolicyProperties deserializedRaiPolicyProperties = new RaiPolicyProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedRaiPolicyProperties.type = RaiPolicyType.fromString(reader.getString()); - } else if ("mode".equals(fieldName)) { - deserializedRaiPolicyProperties.mode = RaiPolicyMode.fromString(reader.getString()); - } else if ("basePolicyName".equals(fieldName)) { - deserializedRaiPolicyProperties.basePolicyName = reader.getString(); - } else if ("contentFilters".equals(fieldName)) { - List contentFilters - = reader.readArray(reader1 -> RaiPolicyContentFilter.fromJson(reader1)); - deserializedRaiPolicyProperties.contentFilters = contentFilters; - } else if ("customBlocklists".equals(fieldName)) { - List customBlocklists - = reader.readArray(reader1 -> CustomBlocklistConfig.fromJson(reader1)); - deserializedRaiPolicyProperties.customBlocklists = customBlocklists; - } else if ("safetyProviders".equals(fieldName)) { - List safetyProviders - = reader.readArray(reader1 -> SafetyProviderConfig.fromJson(reader1)); - deserializedRaiPolicyProperties.safetyProviders = safetyProviders; - } else if ("egressPolicy".equals(fieldName)) { - deserializedRaiPolicyProperties.egressPolicy = RaiEgressPolicyConfig.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiPolicyProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyType.java deleted file mode 100644 index de1538ff3d8e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyType.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Content Filters policy type. - */ -public final class RaiPolicyType extends ExpandableStringEnum { - /** - * Static value UserManaged for RaiPolicyType. - */ - public static final RaiPolicyType USER_MANAGED = fromString("UserManaged"); - - /** - * Static value SystemManaged for RaiPolicyType. - */ - public static final RaiPolicyType SYSTEM_MANAGED = fromString("SystemManaged"); - - /** - * Creates a new instance of RaiPolicyType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RaiPolicyType() { - } - - /** - * Creates or finds a RaiPolicyType from its string representation. - * - * @param name a name to look for. - * @return the corresponding RaiPolicyType. - */ - public static RaiPolicyType fromString(String name) { - return fromString(name, RaiPolicyType.class); - } - - /** - * Gets known RaiPolicyType values. - * - * @return known RaiPolicyType values. - */ - public static Collection values() { - return values(RaiPolicyType.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiSafetyProviderConfig.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiSafetyProviderConfig.java deleted file mode 100644 index d7db17a80902..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiSafetyProviderConfig.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Azure OpenAI RAI safety provider config. - */ -@Fluent -public class RaiSafetyProviderConfig implements JsonSerializable { - /* - * Name of RAI Safety Provider. - */ - private String safetyProviderName; - - /* - * If blocking would occur. - */ - private Boolean blocking; - - /** - * Creates an instance of RaiSafetyProviderConfig class. - */ - public RaiSafetyProviderConfig() { - } - - /** - * Get the safetyProviderName property: Name of RAI Safety Provider. - * - * @return the safetyProviderName value. - */ - public String safetyProviderName() { - return this.safetyProviderName; - } - - /** - * Set the safetyProviderName property: Name of RAI Safety Provider. - * - * @param safetyProviderName the safetyProviderName value to set. - * @return the RaiSafetyProviderConfig object itself. - */ - public RaiSafetyProviderConfig withSafetyProviderName(String safetyProviderName) { - this.safetyProviderName = safetyProviderName; - return this; - } - - /** - * Get the blocking property: If blocking would occur. - * - * @return the blocking value. - */ - public Boolean blocking() { - return this.blocking; - } - - /** - * Set the blocking property: If blocking would occur. - * - * @param blocking the blocking value to set. - * @return the RaiSafetyProviderConfig object itself. - */ - public RaiSafetyProviderConfig withBlocking(Boolean blocking) { - this.blocking = blocking; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("safetyProviderName", this.safetyProviderName); - jsonWriter.writeBooleanField("blocking", this.blocking); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiSafetyProviderConfig from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiSafetyProviderConfig 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 RaiSafetyProviderConfig. - */ - public static RaiSafetyProviderConfig fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiSafetyProviderConfig deserializedRaiSafetyProviderConfig = new RaiSafetyProviderConfig(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("safetyProviderName".equals(fieldName)) { - deserializedRaiSafetyProviderConfig.safetyProviderName = reader.getString(); - } else if ("blocking".equals(fieldName)) { - deserializedRaiSafetyProviderConfig.blocking = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiSafetyProviderConfig; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabel.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabel.java deleted file mode 100644 index f017be7f1424..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabel.java +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiToolLabelInner; -import java.util.Map; - -/** - * An immutable client-side representation of RaiToolLabel. - */ -public interface RaiToolLabel { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Properties of the RAI Tool Label. - * - * @return the properties value. - */ - RaiToolLabelProperties properties(); - - /** - * Gets the etag property: Resource Etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.RaiToolLabelInner object. - * - * @return the inner object. - */ - RaiToolLabelInner innerModel(); - - /** - * The entirety of the RaiToolLabel definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The RaiToolLabel definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the RaiToolLabel definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the RaiToolLabel definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, accountName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @return the next definition stage. - */ - WithCreate withExistingAccount(String resourceGroupName, String accountName); - } - - /** - * The stage of the RaiToolLabel 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.WithTags, DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - RaiToolLabel create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - RaiToolLabel create(Context context); - } - - /** - * The stage of the RaiToolLabel definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the RaiToolLabel definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of the RAI Tool Label.. - * - * @param properties Properties of the RAI Tool Label. - * @return the next definition stage. - */ - WithCreate withProperties(RaiToolLabelProperties properties); - } - } - - /** - * Begins update for the RaiToolLabel resource. - * - * @return the stage of resource update. - */ - RaiToolLabel.Update update(); - - /** - * The template for RaiToolLabel update. - */ - interface Update extends UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - RaiToolLabel apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - RaiToolLabel apply(Context context); - } - - /** - * The RaiToolLabel update stages. - */ - interface UpdateStages { - /** - * The stage of the RaiToolLabel update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of the RAI Tool Label.. - * - * @param properties Properties of the RAI Tool Label. - * @return the next definition stage. - */ - Update withProperties(RaiToolLabelProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - RaiToolLabel refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - RaiToolLabel refresh(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelProperties.java deleted file mode 100644 index ca340263db4f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelProperties.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * RAI Tool Label properties. - */ -@Fluent -public final class RaiToolLabelProperties implements JsonSerializable { - /* - * The unique tool connection name, e.g., 'Web_Search'. - */ - private String toolConnectionName; - - /* - * Account-level tool label definition. - */ - private RaiToolLabelPropertiesAccountScope accountScope; - - /* - * List of project-level tool label definitions. - */ - private List projectScopes; - - /** - * Creates an instance of RaiToolLabelProperties class. - */ - public RaiToolLabelProperties() { - } - - /** - * Get the toolConnectionName property: The unique tool connection name, e.g., 'Web_Search'. - * - * @return the toolConnectionName value. - */ - public String toolConnectionName() { - return this.toolConnectionName; - } - - /** - * Set the toolConnectionName property: The unique tool connection name, e.g., 'Web_Search'. - * - * @param toolConnectionName the toolConnectionName value to set. - * @return the RaiToolLabelProperties object itself. - */ - public RaiToolLabelProperties withToolConnectionName(String toolConnectionName) { - this.toolConnectionName = toolConnectionName; - return this; - } - - /** - * Get the accountScope property: Account-level tool label definition. - * - * @return the accountScope value. - */ - public RaiToolLabelPropertiesAccountScope accountScope() { - return this.accountScope; - } - - /** - * Set the accountScope property: Account-level tool label definition. - * - * @param accountScope the accountScope value to set. - * @return the RaiToolLabelProperties object itself. - */ - public RaiToolLabelProperties withAccountScope(RaiToolLabelPropertiesAccountScope accountScope) { - this.accountScope = accountScope; - return this; - } - - /** - * Get the projectScopes property: List of project-level tool label definitions. - * - * @return the projectScopes value. - */ - public List projectScopes() { - return this.projectScopes; - } - - /** - * Set the projectScopes property: List of project-level tool label definitions. - * - * @param projectScopes the projectScopes value to set. - * @return the RaiToolLabelProperties object itself. - */ - public RaiToolLabelProperties withProjectScopes(List projectScopes) { - this.projectScopes = projectScopes; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("toolConnectionName", this.toolConnectionName); - jsonWriter.writeJsonField("accountScope", this.accountScope); - jsonWriter.writeArrayField("projectScopes", this.projectScopes, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiToolLabelProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiToolLabelProperties 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 RaiToolLabelProperties. - */ - public static RaiToolLabelProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiToolLabelProperties deserializedRaiToolLabelProperties = new RaiToolLabelProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("toolConnectionName".equals(fieldName)) { - deserializedRaiToolLabelProperties.toolConnectionName = reader.getString(); - } else if ("accountScope".equals(fieldName)) { - deserializedRaiToolLabelProperties.accountScope - = RaiToolLabelPropertiesAccountScope.fromJson(reader); - } else if ("projectScopes".equals(fieldName)) { - List projectScopes - = reader.readArray(reader1 -> RaiToolLabelPropertiesProjectScopesItem.fromJson(reader1)); - deserializedRaiToolLabelProperties.projectScopes = projectScopes; - } else { - reader.skipChildren(); - } - } - - return deserializedRaiToolLabelProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelPropertiesAccountScope.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelPropertiesAccountScope.java deleted file mode 100644 index ee00f0a0f47f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelPropertiesAccountScope.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Account-level tool label definition. - */ -@Fluent -public final class RaiToolLabelPropertiesAccountScope implements JsonSerializable { - /* - * Dictionary of label key-value pairs for the account scope. - */ - private Map labelValues; - - /** - * Creates an instance of RaiToolLabelPropertiesAccountScope class. - */ - public RaiToolLabelPropertiesAccountScope() { - } - - /** - * Get the labelValues property: Dictionary of label key-value pairs for the account scope. - * - * @return the labelValues value. - */ - public Map labelValues() { - return this.labelValues; - } - - /** - * Set the labelValues property: Dictionary of label key-value pairs for the account scope. - * - * @param labelValues the labelValues value to set. - * @return the RaiToolLabelPropertiesAccountScope object itself. - */ - public RaiToolLabelPropertiesAccountScope withLabelValues(Map labelValues) { - this.labelValues = labelValues; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeMapField("labelValues", this.labelValues, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiToolLabelPropertiesAccountScope from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiToolLabelPropertiesAccountScope 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 RaiToolLabelPropertiesAccountScope. - */ - public static RaiToolLabelPropertiesAccountScope fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiToolLabelPropertiesAccountScope deserializedRaiToolLabelPropertiesAccountScope - = new RaiToolLabelPropertiesAccountScope(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("labelValues".equals(fieldName)) { - Map labelValues = reader.readMap(reader1 -> reader1.getString()); - deserializedRaiToolLabelPropertiesAccountScope.labelValues = labelValues; - } else { - reader.skipChildren(); - } - } - - return deserializedRaiToolLabelPropertiesAccountScope; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelPropertiesProjectScopesItem.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelPropertiesProjectScopesItem.java deleted file mode 100644 index 9fd37bcbb5ef..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelPropertiesProjectScopesItem.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * The RaiToolLabelPropertiesProjectScopesItem model. - */ -@Fluent -public final class RaiToolLabelPropertiesProjectScopesItem - implements JsonSerializable { - /* - * Project name to which this scope applies. - */ - private String project; - - /* - * Dictionary of label key-value pairs for the project scope. - */ - private Map labelValues; - - /** - * Creates an instance of RaiToolLabelPropertiesProjectScopesItem class. - */ - public RaiToolLabelPropertiesProjectScopesItem() { - } - - /** - * Get the project property: Project name to which this scope applies. - * - * @return the project value. - */ - public String project() { - return this.project; - } - - /** - * Set the project property: Project name to which this scope applies. - * - * @param project the project value to set. - * @return the RaiToolLabelPropertiesProjectScopesItem object itself. - */ - public RaiToolLabelPropertiesProjectScopesItem withProject(String project) { - this.project = project; - return this; - } - - /** - * Get the labelValues property: Dictionary of label key-value pairs for the project scope. - * - * @return the labelValues value. - */ - public Map labelValues() { - return this.labelValues; - } - - /** - * Set the labelValues property: Dictionary of label key-value pairs for the project scope. - * - * @param labelValues the labelValues value to set. - * @return the RaiToolLabelPropertiesProjectScopesItem object itself. - */ - public RaiToolLabelPropertiesProjectScopesItem withLabelValues(Map labelValues) { - this.labelValues = labelValues; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("project", this.project); - jsonWriter.writeMapField("labelValues", this.labelValues, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiToolLabelPropertiesProjectScopesItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiToolLabelPropertiesProjectScopesItem 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 RaiToolLabelPropertiesProjectScopesItem. - */ - public static RaiToolLabelPropertiesProjectScopesItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiToolLabelPropertiesProjectScopesItem deserializedRaiToolLabelPropertiesProjectScopesItem - = new RaiToolLabelPropertiesProjectScopesItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("project".equals(fieldName)) { - deserializedRaiToolLabelPropertiesProjectScopesItem.project = reader.getString(); - } else if ("labelValues".equals(fieldName)) { - Map labelValues = reader.readMap(reader1 -> reader1.getString()); - deserializedRaiToolLabelPropertiesProjectScopesItem.labelValues = labelValues; - } else { - reader.skipChildren(); - } - } - - return deserializedRaiToolLabelPropertiesProjectScopesItem; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabels.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabels.java deleted file mode 100644 index e7b54aebbc5c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabels.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 RaiToolLabels. - */ -public interface RaiToolLabels { - /** - * Gets the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @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 specified RAI Tool Label associated with the Azure OpenAI account along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, String raiToolConnectionName, - Context context); - - /** - * Gets the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 RAI Tool Label associated with the Azure OpenAI account. - */ - RaiToolLabel get(String resourceGroupName, String accountName, String raiToolConnectionName); - - /** - * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String raiToolConnectionName); - - /** - * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiToolConnectionName The name of the Rai Tool Label. - * @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 accountName, String raiToolConnectionName, Context context); - - /** - * Lists all RAI Tool Labels associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 Cognitive Services RAI Tool Labels as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Lists all RAI Tool Labels associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 Cognitive Services RAI Tool Labels as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, Context context); - - /** - * Gets the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified RAI Tool Label associated with the Azure OpenAI account along with {@link Response}. - */ - RaiToolLabel getById(String id); - - /** - * Gets the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified RAI Tool Label associated with the Azure OpenAI account along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @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 the specified RAI Tool Label associated with the Azure OpenAI account. - * - * @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 RaiToolLabel resource. - * - * @param name resource name. - * @return the first stage of the new RaiToolLabel definition. - */ - RaiToolLabel.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopic.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopic.java deleted file mode 100644 index c49de9f4bcc1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopic.java +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiTopicInner; -import java.util.Map; - -/** - * An immutable client-side representation of RaiTopic. - */ -public interface RaiTopic { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Properties of Cognitive Services Rai Topic. - * - * @return the properties value. - */ - RaiTopicProperties properties(); - - /** - * Gets the etag property: Resource Etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.RaiTopicInner object. - * - * @return the inner object. - */ - RaiTopicInner innerModel(); - - /** - * The entirety of the RaiTopic definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The RaiTopic definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the RaiTopic definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the RaiTopic definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, accountName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @return the next definition stage. - */ - WithCreate withExistingAccount(String resourceGroupName, String accountName); - } - - /** - * The stage of the RaiTopic 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.WithTags, DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - RaiTopic create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - RaiTopic create(Context context); - } - - /** - * The stage of the RaiTopic definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the RaiTopic definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of Cognitive Services Rai Topic.. - * - * @param properties Properties of Cognitive Services Rai Topic. - * @return the next definition stage. - */ - WithCreate withProperties(RaiTopicProperties properties); - } - } - - /** - * Begins update for the RaiTopic resource. - * - * @return the stage of resource update. - */ - RaiTopic.Update update(); - - /** - * The template for RaiTopic update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - RaiTopic apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - RaiTopic apply(Context context); - } - - /** - * The RaiTopic update stages. - */ - interface UpdateStages { - /** - * The stage of the RaiTopic update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the RaiTopic update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of Cognitive Services Rai Topic.. - * - * @param properties Properties of Cognitive Services Rai Topic. - * @return the next definition stage. - */ - Update withProperties(RaiTopicProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - RaiTopic refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - RaiTopic refresh(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopicProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopicProperties.java deleted file mode 100644 index 01e82a9b9cbb..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopicProperties.java +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * RAI Custom Topic properties. - */ -@Fluent -public final class RaiTopicProperties implements JsonSerializable { - /* - * The unique identifier of the custom topic. - */ - private String topicId; - - /* - * The name of the custom topic. - */ - private String topicName; - - /* - * Description of the custom topic. - */ - private String description; - - /* - * Sample blob url for the custom topic. - */ - private String sampleBlobUrl; - - /* - * Status of the custom topic. - */ - private String status; - - /* - * Failed reason if the status is Failed. - */ - private String failedReason; - - /* - * Creation time of the custom topic. - */ - private OffsetDateTime createdAt; - - /* - * Last modified time of the custom topic. - */ - private OffsetDateTime lastModifiedAt; - - /** - * Creates an instance of RaiTopicProperties class. - */ - public RaiTopicProperties() { - } - - /** - * Get the topicId property: The unique identifier of the custom topic. - * - * @return the topicId value. - */ - public String topicId() { - return this.topicId; - } - - /** - * Set the topicId property: The unique identifier of the custom topic. - * - * @param topicId the topicId value to set. - * @return the RaiTopicProperties object itself. - */ - public RaiTopicProperties withTopicId(String topicId) { - this.topicId = topicId; - return this; - } - - /** - * Get the topicName property: The name of the custom topic. - * - * @return the topicName value. - */ - public String topicName() { - return this.topicName; - } - - /** - * Set the topicName property: The name of the custom topic. - * - * @param topicName the topicName value to set. - * @return the RaiTopicProperties object itself. - */ - public RaiTopicProperties withTopicName(String topicName) { - this.topicName = topicName; - return this; - } - - /** - * Get the description property: Description of the custom topic. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the custom topic. - * - * @param description the description value to set. - * @return the RaiTopicProperties object itself. - */ - public RaiTopicProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the sampleBlobUrl property: Sample blob url for the custom topic. - * - * @return the sampleBlobUrl value. - */ - public String sampleBlobUrl() { - return this.sampleBlobUrl; - } - - /** - * Set the sampleBlobUrl property: Sample blob url for the custom topic. - * - * @param sampleBlobUrl the sampleBlobUrl value to set. - * @return the RaiTopicProperties object itself. - */ - public RaiTopicProperties withSampleBlobUrl(String sampleBlobUrl) { - this.sampleBlobUrl = sampleBlobUrl; - return this; - } - - /** - * Get the status property: Status of the custom topic. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: Status of the custom topic. - * - * @param status the status value to set. - * @return the RaiTopicProperties object itself. - */ - public RaiTopicProperties withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the failedReason property: Failed reason if the status is Failed. - * - * @return the failedReason value. - */ - public String failedReason() { - return this.failedReason; - } - - /** - * Set the failedReason property: Failed reason if the status is Failed. - * - * @param failedReason the failedReason value to set. - * @return the RaiTopicProperties object itself. - */ - public RaiTopicProperties withFailedReason(String failedReason) { - this.failedReason = failedReason; - return this; - } - - /** - * Get the createdAt property: Creation time of the custom topic. - * - * @return the createdAt value. - */ - public OffsetDateTime createdAt() { - return this.createdAt; - } - - /** - * Set the createdAt property: Creation time of the custom topic. - * - * @param createdAt the createdAt value to set. - * @return the RaiTopicProperties object itself. - */ - public RaiTopicProperties withCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Get the lastModifiedAt property: Last modified time of the custom topic. - * - * @return the lastModifiedAt value. - */ - public OffsetDateTime lastModifiedAt() { - return this.lastModifiedAt; - } - - /** - * Set the lastModifiedAt property: Last modified time of the custom topic. - * - * @param lastModifiedAt the lastModifiedAt value to set. - * @return the RaiTopicProperties object itself. - */ - public RaiTopicProperties withLastModifiedAt(OffsetDateTime lastModifiedAt) { - this.lastModifiedAt = lastModifiedAt; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("topicId", this.topicId); - jsonWriter.writeStringField("topicName", this.topicName); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeStringField("sampleBlobUrl", this.sampleBlobUrl); - jsonWriter.writeStringField("status", this.status); - jsonWriter.writeStringField("failedReason", this.failedReason); - jsonWriter.writeStringField("createdAt", - this.createdAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdAt)); - jsonWriter.writeStringField("lastModifiedAt", - this.lastModifiedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedAt)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RaiTopicProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RaiTopicProperties 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 RaiTopicProperties. - */ - public static RaiTopicProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RaiTopicProperties deserializedRaiTopicProperties = new RaiTopicProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("topicId".equals(fieldName)) { - deserializedRaiTopicProperties.topicId = reader.getString(); - } else if ("topicName".equals(fieldName)) { - deserializedRaiTopicProperties.topicName = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedRaiTopicProperties.description = reader.getString(); - } else if ("sampleBlobUrl".equals(fieldName)) { - deserializedRaiTopicProperties.sampleBlobUrl = reader.getString(); - } else if ("status".equals(fieldName)) { - deserializedRaiTopicProperties.status = reader.getString(); - } else if ("failedReason".equals(fieldName)) { - deserializedRaiTopicProperties.failedReason = reader.getString(); - } else if ("createdAt".equals(fieldName)) { - deserializedRaiTopicProperties.createdAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("lastModifiedAt".equals(fieldName)) { - deserializedRaiTopicProperties.lastModifiedAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedRaiTopicProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopics.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopics.java deleted file mode 100644 index 9311fc4b9079..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopics.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 RaiTopics. - */ -public interface RaiTopics { - /** - * Gets the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @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 specified custom topic associated with the Azure OpenAI account along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, String raiTopicName, - Context context); - - /** - * Gets the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 custom topic associated with the Azure OpenAI account. - */ - RaiTopic get(String resourceGroupName, String accountName, String raiTopicName); - - /** - * Deletes the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String raiTopicName); - - /** - * Deletes the specified custom topic associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiTopicName The name of the Rai Topic associated with the Cognitive Services Account. - * @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 accountName, String raiTopicName, Context context); - - /** - * Gets the custom topics associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom topics associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the custom topics associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @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 custom topics associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, Context context); - - /** - * Gets the specified custom topic associated with the Azure OpenAI account. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified custom topic associated with the Azure OpenAI account along with {@link Response}. - */ - RaiTopic getById(String id); - - /** - * Gets the specified custom topic associated with the Azure OpenAI account. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified custom topic associated with the Azure OpenAI account along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes the specified custom topic associated with the Azure OpenAI account. - * - * @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 the specified custom topic associated with the Azure OpenAI account. - * - * @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 RaiTopic resource. - * - * @param name resource name. - * @return the first stage of the new RaiTopic definition. - */ - RaiTopic.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegenerateKeyParameters.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegenerateKeyParameters.java deleted file mode 100644 index a427be7f275e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegenerateKeyParameters.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Regenerate key parameters. - */ -@Fluent -public final class RegenerateKeyParameters implements JsonSerializable { - /* - * key name to generate (Key1|Key2) - */ - private KeyName keyName; - - /** - * Creates an instance of RegenerateKeyParameters class. - */ - public RegenerateKeyParameters() { - } - - /** - * Get the keyName property: key name to generate (Key1|Key2). - * - * @return the keyName value. - */ - public KeyName keyName() { - return this.keyName; - } - - /** - * Set the keyName property: key name to generate (Key1|Key2). - * - * @param keyName the keyName value to set. - * @return the RegenerateKeyParameters object itself. - */ - public RegenerateKeyParameters withKeyName(KeyName keyName) { - this.keyName = keyName; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("keyName", this.keyName == null ? null : this.keyName.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RegenerateKeyParameters from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RegenerateKeyParameters 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 RegenerateKeyParameters. - */ - public static RegenerateKeyParameters fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RegenerateKeyParameters deserializedRegenerateKeyParameters = new RegenerateKeyParameters(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("keyName".equals(fieldName)) { - deserializedRegenerateKeyParameters.keyName = KeyName.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedRegenerateKeyParameters; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegionSetting.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegionSetting.java deleted file mode 100644 index 66252df02953..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegionSetting.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 call rate limit Cognitive Services account. - */ -@Fluent -public final class RegionSetting implements JsonSerializable { - /* - * Name of the region. - */ - private String name; - - /* - * A value for priority or weighted routing methods. - */ - private Float value; - - /* - * Maps the region to the regional custom subdomain. - */ - private String customsubdomain; - - /** - * Creates an instance of RegionSetting class. - */ - public RegionSetting() { - } - - /** - * Get the name property: Name of the region. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the region. - * - * @param name the name value to set. - * @return the RegionSetting object itself. - */ - public RegionSetting withName(String name) { - this.name = name; - return this; - } - - /** - * Get the value property: A value for priority or weighted routing methods. - * - * @return the value value. - */ - public Float value() { - return this.value; - } - - /** - * Set the value property: A value for priority or weighted routing methods. - * - * @param value the value value to set. - * @return the RegionSetting object itself. - */ - public RegionSetting withValue(Float value) { - this.value = value; - return this; - } - - /** - * Get the customsubdomain property: Maps the region to the regional custom subdomain. - * - * @return the customsubdomain value. - */ - public String customsubdomain() { - return this.customsubdomain; - } - - /** - * Set the customsubdomain property: Maps the region to the regional custom subdomain. - * - * @param customsubdomain the customsubdomain value to set. - * @return the RegionSetting object itself. - */ - public RegionSetting withCustomsubdomain(String customsubdomain) { - this.customsubdomain = customsubdomain; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeNumberField("value", this.value); - jsonWriter.writeStringField("customsubdomain", this.customsubdomain); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RegionSetting from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RegionSetting 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 RegionSetting. - */ - public static RegionSetting fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RegionSetting deserializedRegionSetting = new RegionSetting(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedRegionSetting.name = reader.getString(); - } else if ("value".equals(fieldName)) { - deserializedRegionSetting.value = reader.getNullable(JsonReader::getFloat); - } else if ("customsubdomain".equals(fieldName)) { - deserializedRegionSetting.customsubdomain = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRegionSetting; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ReplacementConfig.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ReplacementConfig.java deleted file mode 100644 index 281396913bf7..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ReplacementConfig.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Configuration for model replacement. - */ -@Immutable -public final class ReplacementConfig implements JsonSerializable { - /* - * The name of the replacement model. - */ - private String targetModelName; - - /* - * The version of the replacement model. - */ - private String targetModelVersion; - - /* - * The date when automatic upgrade should start. This applies to deployments with the OnceNewDefaultVersionAvailable - * upgrade option. - */ - private OffsetDateTime autoUpgradeStartDate; - - /* - * The number of days before deprecation date to trigger upgrade. This applies to deployments with the - * OnceCurrentVersionExpired upgrade option. - */ - private Integer upgradeOnExpiryLeadTimeDays; - - /** - * Creates an instance of ReplacementConfig class. - */ - private ReplacementConfig() { - } - - /** - * Get the targetModelName property: The name of the replacement model. - * - * @return the targetModelName value. - */ - public String targetModelName() { - return this.targetModelName; - } - - /** - * Get the targetModelVersion property: The version of the replacement model. - * - * @return the targetModelVersion value. - */ - public String targetModelVersion() { - return this.targetModelVersion; - } - - /** - * Get the autoUpgradeStartDate property: The date when automatic upgrade should start. This applies to deployments - * with the OnceNewDefaultVersionAvailable upgrade option. - * - * @return the autoUpgradeStartDate value. - */ - public OffsetDateTime autoUpgradeStartDate() { - return this.autoUpgradeStartDate; - } - - /** - * Get the upgradeOnExpiryLeadTimeDays property: The number of days before deprecation date to trigger upgrade. This - * applies to deployments with the OnceCurrentVersionExpired upgrade option. - * - * @return the upgradeOnExpiryLeadTimeDays value. - */ - public Integer upgradeOnExpiryLeadTimeDays() { - return this.upgradeOnExpiryLeadTimeDays; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("targetModelName", this.targetModelName); - jsonWriter.writeStringField("targetModelVersion", this.targetModelVersion); - jsonWriter.writeStringField("autoUpgradeStartDate", - this.autoUpgradeStartDate == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.autoUpgradeStartDate)); - jsonWriter.writeNumberField("upgradeOnExpiryLeadTimeDays", this.upgradeOnExpiryLeadTimeDays); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ReplacementConfig from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ReplacementConfig 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 ReplacementConfig. - */ - public static ReplacementConfig fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ReplacementConfig deserializedReplacementConfig = new ReplacementConfig(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("targetModelName".equals(fieldName)) { - deserializedReplacementConfig.targetModelName = reader.getString(); - } else if ("targetModelVersion".equals(fieldName)) { - deserializedReplacementConfig.targetModelVersion = reader.getString(); - } else if ("autoUpgradeStartDate".equals(fieldName)) { - deserializedReplacementConfig.autoUpgradeStartDate = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("upgradeOnExpiryLeadTimeDays".equals(fieldName)) { - deserializedReplacementConfig.upgradeOnExpiryLeadTimeDays = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedReplacementConfig; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RequestMatchPattern.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RequestMatchPattern.java deleted file mode 100644 index 431c0ee68cd6..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RequestMatchPattern.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The RequestMatchPattern model. - */ -@Immutable -public final class RequestMatchPattern implements JsonSerializable { - /* - * The path property. - */ - private String path; - - /* - * The method property. - */ - private String method; - - /** - * Creates an instance of RequestMatchPattern class. - */ - private RequestMatchPattern() { - } - - /** - * Get the path property: The path property. - * - * @return the path value. - */ - public String path() { - return this.path; - } - - /** - * Get the method property: The method property. - * - * @return the method value. - */ - public String method() { - return this.method; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("path", this.path); - jsonWriter.writeStringField("method", this.method); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RequestMatchPattern from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RequestMatchPattern 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 RequestMatchPattern. - */ - public static RequestMatchPattern fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RequestMatchPattern deserializedRequestMatchPattern = new RequestMatchPattern(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("path".equals(fieldName)) { - deserializedRequestMatchPattern.path = reader.getString(); - } else if ("method".equals(fieldName)) { - deserializedRequestMatchPattern.method = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRequestMatchPattern; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceBase.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceBase.java deleted file mode 100644 index 777e77c3c5a8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceBase.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * The ResourceBase model. - */ -@Fluent -public class ResourceBase implements JsonSerializable { - /* - * The asset description text. - */ - private String description; - - /* - * Tag dictionary. Tags can be added, removed, and updated. - */ - private Map tags; - - /** - * Creates an instance of ResourceBase class. - */ - public ResourceBase() { - } - - /** - * Get the description property: The asset description text. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The asset description text. - * - * @param description the description value to set. - * @return the ResourceBase object itself. - */ - public ResourceBase withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the tags property: Tag dictionary. Tags can be added, removed, and updated. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Tag dictionary. Tags can be added, removed, and updated. - * - * @param tags the tags value to set. - * @return the ResourceBase object itself. - */ - public ResourceBase withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceBase from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceBase 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 ResourceBase. - */ - public static ResourceBase fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceBase deserializedResourceBase = new ResourceBase(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedResourceBase.description = reader.getString(); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedResourceBase.tags = tags; - } else { - reader.skipChildren(); - } - } - - return deserializedResourceBase; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceIdentityType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceIdentityType.java deleted file mode 100644 index af0eb2de1550..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceIdentityType.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -/** - * The identity type. - */ -public enum ResourceIdentityType { - /** - * Enum value None. - */ - NONE("None"), - - /** - * Enum value SystemAssigned. - */ - SYSTEM_ASSIGNED("SystemAssigned"), - - /** - * Enum value UserAssigned. - */ - USER_ASSIGNED("UserAssigned"), - - /** - * Enum value SystemAssigned, UserAssigned. - */ - SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"); - - /** - * The actual serialized value for a ResourceIdentityType instance. - */ - private final String value; - - ResourceIdentityType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ResourceIdentityType instance. - * - * @param value the serialized value to parse. - * @return the parsed ResourceIdentityType object, or null if unable to parse. - */ - public static ResourceIdentityType fromString(String value) { - if (value == null) { - return null; - } - ResourceIdentityType[] items = ResourceIdentityType.values(); - for (ResourceIdentityType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceProviders.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceProviders.java deleted file mode 100644 index 2876ab94c76d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceProviders.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ResourceProviders. - */ -public interface ResourceProviders { - /** - * Check available SKUs. - * - * @param location The location name. - * @param parameters The request body. - * @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 check SKU availability result list along with {@link Response}. - */ - Response checkSkuAvailabilityWithResponse(String location, - CheckSkuAvailabilityParameter parameters, Context context); - - /** - * Check available SKUs. - * - * @param location The location name. - * @param parameters The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return check SKU availability result list. - */ - SkuAvailabilityListResult checkSkuAvailability(String location, CheckSkuAvailabilityParameter parameters); - - /** - * Check whether a domain is available. - * - * @param parameters The request body. - * @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 domain availability along with {@link Response}. - */ - Response checkDomainAvailabilityWithResponse(CheckDomainAvailabilityParameter parameters, - Context context); - - /** - * Check whether a domain is available. - * - * @param parameters The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return domain availability. - */ - DomainAvailability checkDomainAvailability(CheckDomainAvailabilityParameter parameters); - - /** - * Model capacity calculator. - * - * @param parameters The request body. - * @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 calculate Model Capacity result along with {@link Response}. - */ - Response - calculateModelCapacityWithResponse(CalculateModelCapacityParameter parameters, Context context); - - /** - * Model capacity calculator. - * - * @param parameters The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return calculate Model Capacity result. - */ - CalculateModelCapacityResult calculateModelCapacity(CalculateModelCapacityParameter parameters); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSku.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSku.java deleted file mode 100644 index 7d36ccefe0e9..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSku.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.ResourceSkuInner; -import java.util.List; - -/** - * An immutable client-side representation of ResourceSku. - */ -public interface ResourceSku { - /** - * Gets the resourceType property: The type of resource the SKU applies to. - * - * @return the resourceType value. - */ - String resourceType(); - - /** - * Gets the name property: The name of SKU. - * - * @return the name value. - */ - String name(); - - /** - * Gets the tier property: Specifies the tier of Cognitive Services account. - * - * @return the tier value. - */ - String tier(); - - /** - * Gets the kind property: The Kind of resources that are supported in this SKU. - * - * @return the kind value. - */ - String kind(); - - /** - * Gets the locations property: The set of locations that the SKU is available. - * - * @return the locations value. - */ - List locations(); - - /** - * Gets the restrictions property: The restrictions because of which SKU cannot be used. This is empty if there are - * no restrictions. - * - * @return the restrictions value. - */ - List restrictions(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.ResourceSkuInner object. - * - * @return the inner object. - */ - ResourceSkuInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionInfo.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionInfo.java deleted file mode 100644 index a89c7b2b6360..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionInfo.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * The ResourceSkuRestrictionInfo model. - */ -@Immutable -public final class ResourceSkuRestrictionInfo implements JsonSerializable { - /* - * Locations where the SKU is restricted - */ - private List locations; - - /* - * List of availability zones where the SKU is restricted. - */ - private List zones; - - /** - * Creates an instance of ResourceSkuRestrictionInfo class. - */ - private ResourceSkuRestrictionInfo() { - } - - /** - * Get the locations property: Locations where the SKU is restricted. - * - * @return the locations value. - */ - public List locations() { - return this.locations; - } - - /** - * Get the zones property: List of availability zones where the SKU is restricted. - * - * @return the zones value. - */ - public List zones() { - return this.zones; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("locations", this.locations, (writer, element) -> writer.writeString(element)); - jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceSkuRestrictionInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceSkuRestrictionInfo 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 ResourceSkuRestrictionInfo. - */ - public static ResourceSkuRestrictionInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceSkuRestrictionInfo deserializedResourceSkuRestrictionInfo = new ResourceSkuRestrictionInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("locations".equals(fieldName)) { - List locations = reader.readArray(reader1 -> reader1.getString()); - deserializedResourceSkuRestrictionInfo.locations = locations; - } else if ("zones".equals(fieldName)) { - List zones = reader.readArray(reader1 -> reader1.getString()); - deserializedResourceSkuRestrictionInfo.zones = zones; - } else { - reader.skipChildren(); - } - } - - return deserializedResourceSkuRestrictionInfo; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictions.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictions.java deleted file mode 100644 index a65979efc1ca..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictions.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Describes restrictions of a SKU. - */ -@Immutable -public final class ResourceSkuRestrictions implements JsonSerializable { - /* - * The type of restrictions. - */ - private ResourceSkuRestrictionsType type; - - /* - * The value of restrictions. If the restriction type is set to location. This would be different locations where - * the SKU is restricted. - */ - private List values; - - /* - * The information about the restriction where the SKU cannot be used. - */ - private ResourceSkuRestrictionInfo restrictionInfo; - - /* - * The reason for restriction. - */ - private ResourceSkuRestrictionsReasonCode reasonCode; - - /** - * Creates an instance of ResourceSkuRestrictions class. - */ - private ResourceSkuRestrictions() { - } - - /** - * Get the type property: The type of restrictions. - * - * @return the type value. - */ - public ResourceSkuRestrictionsType type() { - return this.type; - } - - /** - * Get the values property: The value of restrictions. If the restriction type is set to location. This would be - * different locations where the SKU is restricted. - * - * @return the values value. - */ - public List values() { - return this.values; - } - - /** - * Get the restrictionInfo property: The information about the restriction where the SKU cannot be used. - * - * @return the restrictionInfo value. - */ - public ResourceSkuRestrictionInfo restrictionInfo() { - return this.restrictionInfo; - } - - /** - * Get the reasonCode property: The reason for restriction. - * - * @return the reasonCode value. - */ - public ResourceSkuRestrictionsReasonCode reasonCode() { - return this.reasonCode; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeArrayField("values", this.values, (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("restrictionInfo", this.restrictionInfo); - jsonWriter.writeStringField("reasonCode", this.reasonCode == null ? null : this.reasonCode.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceSkuRestrictions from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceSkuRestrictions 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 ResourceSkuRestrictions. - */ - public static ResourceSkuRestrictions fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceSkuRestrictions deserializedResourceSkuRestrictions = new ResourceSkuRestrictions(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedResourceSkuRestrictions.type - = ResourceSkuRestrictionsType.fromString(reader.getString()); - } else if ("values".equals(fieldName)) { - List values = reader.readArray(reader1 -> reader1.getString()); - deserializedResourceSkuRestrictions.values = values; - } else if ("restrictionInfo".equals(fieldName)) { - deserializedResourceSkuRestrictions.restrictionInfo = ResourceSkuRestrictionInfo.fromJson(reader); - } else if ("reasonCode".equals(fieldName)) { - deserializedResourceSkuRestrictions.reasonCode - = ResourceSkuRestrictionsReasonCode.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedResourceSkuRestrictions; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionsReasonCode.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionsReasonCode.java deleted file mode 100644 index bcea279cc496..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionsReasonCode.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The reason for restriction. - */ -public final class ResourceSkuRestrictionsReasonCode extends ExpandableStringEnum { - /** - * Static value QuotaId for ResourceSkuRestrictionsReasonCode. - */ - public static final ResourceSkuRestrictionsReasonCode QUOTA_ID = fromString("QuotaId"); - - /** - * Static value NotAvailableForSubscription for ResourceSkuRestrictionsReasonCode. - */ - public static final ResourceSkuRestrictionsReasonCode NOT_AVAILABLE_FOR_SUBSCRIPTION - = fromString("NotAvailableForSubscription"); - - /** - * Creates a new instance of ResourceSkuRestrictionsReasonCode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ResourceSkuRestrictionsReasonCode() { - } - - /** - * Creates or finds a ResourceSkuRestrictionsReasonCode from its string representation. - * - * @param name a name to look for. - * @return the corresponding ResourceSkuRestrictionsReasonCode. - */ - public static ResourceSkuRestrictionsReasonCode fromString(String name) { - return fromString(name, ResourceSkuRestrictionsReasonCode.class); - } - - /** - * Gets known ResourceSkuRestrictionsReasonCode values. - * - * @return known ResourceSkuRestrictionsReasonCode values. - */ - public static Collection values() { - return values(ResourceSkuRestrictionsReasonCode.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionsType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionsType.java deleted file mode 100644 index d5b782d926d5..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionsType.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -/** - * The type of restrictions. - */ -public enum ResourceSkuRestrictionsType { - /** - * Enum value Location. - */ - LOCATION("Location"), - - /** - * Enum value Zone. - */ - ZONE("Zone"); - - /** - * The actual serialized value for a ResourceSkuRestrictionsType instance. - */ - private final String value; - - ResourceSkuRestrictionsType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ResourceSkuRestrictionsType instance. - * - * @param value the serialized value to parse. - * @return the parsed ResourceSkuRestrictionsType object, or null if unable to parse. - */ - public static ResourceSkuRestrictionsType fromString(String value) { - if (value == null) { - return null; - } - ResourceSkuRestrictionsType[] items = ResourceSkuRestrictionsType.values(); - for (ResourceSkuRestrictionsType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkus.java deleted file mode 100644 index e8d00d7f7228..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkus.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of ResourceSkus. - */ -public interface ResourceSkus { - /** - * Gets the list of Microsoft.CognitiveServices SKUs available for your Subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Microsoft.CognitiveServices SKUs available for your Subscription as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Gets the list of Microsoft.CognitiveServices SKUs available for your Subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Microsoft.CognitiveServices SKUs available for your Subscription as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoleBasedBuiltInAuthorizationPolicy.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoleBasedBuiltInAuthorizationPolicy.java deleted file mode 100644 index 941ca99d76a7..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoleBasedBuiltInAuthorizationPolicy.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Built-in role-based authorization policy. - */ -@Immutable -public final class RoleBasedBuiltInAuthorizationPolicy extends ApplicationAuthorizationPolicy { - /* - * Authorization scheme type. - */ - private BuiltInAuthorizationScheme type = BuiltInAuthorizationScheme.DEFAULT; - - /** - * Creates an instance of RoleBasedBuiltInAuthorizationPolicy class. - */ - public RoleBasedBuiltInAuthorizationPolicy() { - } - - /** - * Get the type property: Authorization scheme type. - * - * @return the type value. - */ - @Override - public BuiltInAuthorizationScheme type() { - return this.type; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RoleBasedBuiltInAuthorizationPolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RoleBasedBuiltInAuthorizationPolicy 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 RoleBasedBuiltInAuthorizationPolicy. - */ - public static RoleBasedBuiltInAuthorizationPolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RoleBasedBuiltInAuthorizationPolicy deserializedRoleBasedBuiltInAuthorizationPolicy - = new RoleBasedBuiltInAuthorizationPolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedRoleBasedBuiltInAuthorizationPolicy.type - = BuiltInAuthorizationScheme.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedRoleBasedBuiltInAuthorizationPolicy; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoutingMethods.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoutingMethods.java deleted file mode 100644 index dee5121771f9..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoutingMethods.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Multiregion routing methods. - */ -public final class RoutingMethods extends ExpandableStringEnum { - /** - * Static value Priority for RoutingMethods. - */ - public static final RoutingMethods PRIORITY = fromString("Priority"); - - /** - * Static value Weighted for RoutingMethods. - */ - public static final RoutingMethods WEIGHTED = fromString("Weighted"); - - /** - * Static value Performance for RoutingMethods. - */ - public static final RoutingMethods PERFORMANCE = fromString("Performance"); - - /** - * Creates a new instance of RoutingMethods value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RoutingMethods() { - } - - /** - * Creates or finds a RoutingMethods from its string representation. - * - * @param name a name to look for. - * @return the corresponding RoutingMethods. - */ - public static RoutingMethods fromString(String name) { - return fromString(name, RoutingMethods.class); - } - - /** - * Gets known RoutingMethods values. - * - * @return known RoutingMethods values. - */ - public static Collection values() { - return values(RoutingMethods.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoutingMode.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoutingMode.java deleted file mode 100644 index 8aa7ca6cb65e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoutingMode.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The model-router routing mode that determines how requests are distributed across models. - */ -public final class RoutingMode extends ExpandableStringEnum { - /** - * Route requests to minimize cost while meeting performance requirements. - */ - public static final RoutingMode COST = fromString("cost"); - - /** - * Balance cost and quality when routing requests across models. - */ - public static final RoutingMode BALANCED = fromString("balanced"); - - /** - * Route requests to maximize quality regardless of cost. - */ - public static final RoutingMode QUALITY = fromString("quality"); - - /** - * Creates a new instance of RoutingMode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RoutingMode() { - } - - /** - * Creates or finds a RoutingMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding RoutingMode. - */ - public static RoutingMode fromString(String name) { - return fromString(name, RoutingMode.class); - } - - /** - * Gets known RoutingMode values. - * - * @return known RoutingMode values. - */ - public static Collection values() { - return values(RoutingMode.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleAction.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleAction.java deleted file mode 100644 index 5421f2388738..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleAction.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The action enum for a managed network outbound rule. - */ -public final class RuleAction extends ExpandableStringEnum { - /** - * Static value Allow for RuleAction. - */ - public static final RuleAction ALLOW = fromString("Allow"); - - /** - * Static value Deny for RuleAction. - */ - public static final RuleAction DENY = fromString("Deny"); - - /** - * Creates a new instance of RuleAction value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RuleAction() { - } - - /** - * Creates or finds a RuleAction from its string representation. - * - * @param name a name to look for. - * @return the corresponding RuleAction. - */ - public static RuleAction fromString(String name) { - return fromString(name, RuleAction.class); - } - - /** - * Gets known RuleAction values. - * - * @return known RuleAction values. - */ - public static Collection values() { - return values(RuleAction.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleCategory.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleCategory.java deleted file mode 100644 index 0f59515ada74..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleCategory.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Category of a managed network Outbound Rule of a cognitive services account. - */ -public final class RuleCategory extends ExpandableStringEnum { - /** - * Static value Required for RuleCategory. - */ - public static final RuleCategory REQUIRED = fromString("Required"); - - /** - * Static value Recommended for RuleCategory. - */ - public static final RuleCategory RECOMMENDED = fromString("Recommended"); - - /** - * Static value UserDefined for RuleCategory. - */ - public static final RuleCategory USER_DEFINED = fromString("UserDefined"); - - /** - * Static value Dependency for RuleCategory. - */ - public static final RuleCategory DEPENDENCY = fromString("Dependency"); - - /** - * Creates a new instance of RuleCategory value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RuleCategory() { - } - - /** - * Creates or finds a RuleCategory from its string representation. - * - * @param name a name to look for. - * @return the corresponding RuleCategory. - */ - public static RuleCategory fromString(String name) { - return fromString(name, RuleCategory.class); - } - - /** - * Gets known RuleCategory values. - * - * @return known RuleCategory values. - */ - public static Collection values() { - return values(RuleCategory.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleStatus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleStatus.java deleted file mode 100644 index 3c54e5f321e9..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleStatus.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Type of a managed network Outbound Rule of a cognitive services account. - */ -public final class RuleStatus extends ExpandableStringEnum { - /** - * Static value Inactive for RuleStatus. - */ - public static final RuleStatus INACTIVE = fromString("Inactive"); - - /** - * Static value Active for RuleStatus. - */ - public static final RuleStatus ACTIVE = fromString("Active"); - - /** - * Static value Provisioning for RuleStatus. - */ - public static final RuleStatus PROVISIONING = fromString("Provisioning"); - - /** - * Static value Deleting for RuleStatus. - */ - public static final RuleStatus DELETING = fromString("Deleting"); - - /** - * Static value Failed for RuleStatus. - */ - public static final RuleStatus FAILED = fromString("Failed"); - - /** - * Creates a new instance of RuleStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RuleStatus() { - } - - /** - * Creates or finds a RuleStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding RuleStatus. - */ - public static RuleStatus fromString(String name) { - return fromString(name, RuleStatus.class); - } - - /** - * Gets known RuleStatus values. - * - * @return known RuleStatus values. - */ - public static Collection values() { - return values(RuleStatus.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleType.java deleted file mode 100644 index 9c93f4cb878f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleType.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Type of a managed network Outbound Rule of a cognitive services account. - */ -public final class RuleType extends ExpandableStringEnum { - /** - * Static value FQDN for RuleType. - */ - public static final RuleType FQDN = fromString("FQDN"); - - /** - * Static value PrivateEndpoint for RuleType. - */ - public static final RuleType PRIVATE_ENDPOINT = fromString("PrivateEndpoint"); - - /** - * Static value ServiceTag for RuleType. - */ - public static final RuleType SERVICE_TAG = fromString("ServiceTag"); - - /** - * Creates a new instance of RuleType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RuleType() { - } - - /** - * Creates or finds a RuleType from its string representation. - * - * @param name a name to look for. - * @return the corresponding RuleType. - */ - public static RuleType fromString(String name) { - return fromString(name, RuleType.class); - } - - /** - * Gets known RuleType values. - * - * @return known RuleType values. - */ - public static Collection values() { - return values(RuleType.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SafetyProviderConfig.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SafetyProviderConfig.java deleted file mode 100644 index ed4323fb5cbc..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SafetyProviderConfig.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Gets or sets the source to which safety providers applies. - */ -@Fluent -public final class SafetyProviderConfig extends RaiSafetyProviderConfig { - /* - * Content source to apply the Content Filters. - */ - private RaiPolicyContentSource source; - - /** - * Creates an instance of SafetyProviderConfig class. - */ - public SafetyProviderConfig() { - } - - /** - * Get the source property: Content source to apply the Content Filters. - * - * @return the source value. - */ - public RaiPolicyContentSource source() { - return this.source; - } - - /** - * Set the source property: Content source to apply the Content Filters. - * - * @param source the source value to set. - * @return the SafetyProviderConfig object itself. - */ - public SafetyProviderConfig withSource(RaiPolicyContentSource source) { - this.source = source; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SafetyProviderConfig withSafetyProviderName(String safetyProviderName) { - super.withSafetyProviderName(safetyProviderName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SafetyProviderConfig withBlocking(Boolean blocking) { - super.withBlocking(blocking); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("safetyProviderName", safetyProviderName()); - jsonWriter.writeBooleanField("blocking", blocking()); - jsonWriter.writeStringField("source", this.source == null ? null : this.source.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SafetyProviderConfig from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SafetyProviderConfig 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 SafetyProviderConfig. - */ - public static SafetyProviderConfig fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SafetyProviderConfig deserializedSafetyProviderConfig = new SafetyProviderConfig(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("safetyProviderName".equals(fieldName)) { - deserializedSafetyProviderConfig.withSafetyProviderName(reader.getString()); - } else if ("blocking".equals(fieldName)) { - deserializedSafetyProviderConfig.withBlocking(reader.getNullable(JsonReader::getBoolean)); - } else if ("source".equals(fieldName)) { - deserializedSafetyProviderConfig.source = RaiPolicyContentSource.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedSafetyProviderConfig; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SasAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SasAuthTypeConnectionProperties.java deleted file mode 100644 index 5aa4160bcdda..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SasAuthTypeConnectionProperties.java +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * The SasAuthTypeConnectionProperties model. - */ -@Fluent -public final class SasAuthTypeConnectionProperties extends ConnectionPropertiesV2 { - /* - * Authentication type of the connection target - */ - private ConnectionAuthType authType = ConnectionAuthType.SAS; - - /* - * The credentials property. - */ - private ConnectionSharedAccessSignature credentials; - - /** - * Creates an instance of SasAuthTypeConnectionProperties class. - */ - public SasAuthTypeConnectionProperties() { - } - - /** - * Get the authType property: Authentication type of the connection target. - * - * @return the authType value. - */ - @Override - public ConnectionAuthType authType() { - return this.authType; - } - - /** - * Get the credentials property: The credentials property. - * - * @return the credentials value. - */ - public ConnectionSharedAccessSignature credentials() { - return this.credentials; - } - - /** - * Set the credentials property: The credentials property. - * - * @param credentials the credentials value to set. - * @return the SasAuthTypeConnectionProperties object itself. - */ - public SasAuthTypeConnectionProperties withCredentials(ConnectionSharedAccessSignature credentials) { - this.credentials = credentials; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SasAuthTypeConnectionProperties withCategory(ConnectionCategory category) { - super.withCategory(category); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SasAuthTypeConnectionProperties withError(String error) { - super.withError(error); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SasAuthTypeConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { - super.withExpiryTime(expiryTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SasAuthTypeConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { - super.withIsSharedToAll(isSharedToAll); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SasAuthTypeConnectionProperties withMetadata(Map metadata) { - super.withMetadata(metadata); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SasAuthTypeConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { - super.withPeRequirement(peRequirement); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SasAuthTypeConnectionProperties withPeStatus(ManagedPEStatus peStatus) { - super.withPeStatus(peStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SasAuthTypeConnectionProperties withSharedUserList(List sharedUserList) { - super.withSharedUserList(sharedUserList); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SasAuthTypeConnectionProperties withTarget(String target) { - super.withTarget(target); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SasAuthTypeConnectionProperties withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { - super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("category", category() == null ? null : category().toString()); - jsonWriter.writeStringField("error", error()); - jsonWriter.writeStringField("expiryTime", - expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); - jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); - jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); - jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); - jsonWriter.writeArrayField("sharedUserList", sharedUserList(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("target", target()); - jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); - jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); - jsonWriter.writeJsonField("credentials", this.credentials); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SasAuthTypeConnectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SasAuthTypeConnectionProperties 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 SasAuthTypeConnectionProperties. - */ - public static SasAuthTypeConnectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SasAuthTypeConnectionProperties deserializedSasAuthTypeConnectionProperties - = new SasAuthTypeConnectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("category".equals(fieldName)) { - deserializedSasAuthTypeConnectionProperties - .withCategory(ConnectionCategory.fromString(reader.getString())); - } else if ("createdByWorkspaceArmId".equals(fieldName)) { - deserializedSasAuthTypeConnectionProperties.withCreatedByWorkspaceArmId(reader.getString()); - } else if ("error".equals(fieldName)) { - deserializedSasAuthTypeConnectionProperties.withError(reader.getString()); - } else if ("expiryTime".equals(fieldName)) { - deserializedSasAuthTypeConnectionProperties.withExpiryTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("group".equals(fieldName)) { - deserializedSasAuthTypeConnectionProperties - .withGroup(ConnectionGroup.fromString(reader.getString())); - } else if ("isSharedToAll".equals(fieldName)) { - deserializedSasAuthTypeConnectionProperties - .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); - } else if ("metadata".equals(fieldName)) { - Map metadata = reader.readMap(reader1 -> reader1.getString()); - deserializedSasAuthTypeConnectionProperties.withMetadata(metadata); - } else if ("peRequirement".equals(fieldName)) { - deserializedSasAuthTypeConnectionProperties - .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); - } else if ("peStatus".equals(fieldName)) { - deserializedSasAuthTypeConnectionProperties - .withPeStatus(ManagedPEStatus.fromString(reader.getString())); - } else if ("sharedUserList".equals(fieldName)) { - List sharedUserList = reader.readArray(reader1 -> reader1.getString()); - deserializedSasAuthTypeConnectionProperties.withSharedUserList(sharedUserList); - } else if ("target".equals(fieldName)) { - deserializedSasAuthTypeConnectionProperties.withTarget(reader.getString()); - } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { - deserializedSasAuthTypeConnectionProperties - .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); - } else if ("authType".equals(fieldName)) { - deserializedSasAuthTypeConnectionProperties.authType - = ConnectionAuthType.fromString(reader.getString()); - } else if ("credentials".equals(fieldName)) { - deserializedSasAuthTypeConnectionProperties.credentials - = ConnectionSharedAccessSignature.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSasAuthTypeConnectionProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ScenarioType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ScenarioType.java deleted file mode 100644 index 0f6c936f28c1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ScenarioType.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Specifies what features in AI Foundry network injection applies to. Currently only supports 'agent' for agent - * scenarios. 'none' means no network injection. - */ -public final class ScenarioType extends ExpandableStringEnum { - /** - * Static value none for ScenarioType. - */ - public static final ScenarioType NONE = fromString("none"); - - /** - * Static value agent for ScenarioType. - */ - public static final ScenarioType AGENT = fromString("agent"); - - /** - * Creates a new instance of ScenarioType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ScenarioType() { - } - - /** - * Creates or finds a ScenarioType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ScenarioType. - */ - public static ScenarioType fromString(String name) { - return fromString(name, ScenarioType.class); - } - - /** - * Gets known ScenarioType values. - * - * @return known ScenarioType values. - */ - public static Collection values() { - return values(ScenarioType.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServicePrincipalAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServicePrincipalAuthTypeConnectionProperties.java deleted file mode 100644 index 367c22a54051..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServicePrincipalAuthTypeConnectionProperties.java +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * The ServicePrincipalAuthTypeConnectionProperties model. - */ -@Fluent -public final class ServicePrincipalAuthTypeConnectionProperties extends ConnectionPropertiesV2 { - /* - * Authentication type of the connection target - */ - private ConnectionAuthType authType = ConnectionAuthType.SERVICE_PRINCIPAL; - - /* - * The credentials property. - */ - private ConnectionServicePrincipal credentials; - - /** - * Creates an instance of ServicePrincipalAuthTypeConnectionProperties class. - */ - public ServicePrincipalAuthTypeConnectionProperties() { - } - - /** - * Get the authType property: Authentication type of the connection target. - * - * @return the authType value. - */ - @Override - public ConnectionAuthType authType() { - return this.authType; - } - - /** - * Get the credentials property: The credentials property. - * - * @return the credentials value. - */ - public ConnectionServicePrincipal credentials() { - return this.credentials; - } - - /** - * Set the credentials property: The credentials property. - * - * @param credentials the credentials value to set. - * @return the ServicePrincipalAuthTypeConnectionProperties object itself. - */ - public ServicePrincipalAuthTypeConnectionProperties withCredentials(ConnectionServicePrincipal credentials) { - this.credentials = credentials; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ServicePrincipalAuthTypeConnectionProperties withCategory(ConnectionCategory category) { - super.withCategory(category); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ServicePrincipalAuthTypeConnectionProperties withError(String error) { - super.withError(error); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ServicePrincipalAuthTypeConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { - super.withExpiryTime(expiryTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ServicePrincipalAuthTypeConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { - super.withIsSharedToAll(isSharedToAll); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ServicePrincipalAuthTypeConnectionProperties withMetadata(Map metadata) { - super.withMetadata(metadata); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ServicePrincipalAuthTypeConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { - super.withPeRequirement(peRequirement); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ServicePrincipalAuthTypeConnectionProperties withPeStatus(ManagedPEStatus peStatus) { - super.withPeStatus(peStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ServicePrincipalAuthTypeConnectionProperties withSharedUserList(List sharedUserList) { - super.withSharedUserList(sharedUserList); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ServicePrincipalAuthTypeConnectionProperties withTarget(String target) { - super.withTarget(target); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ServicePrincipalAuthTypeConnectionProperties - withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { - super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("category", category() == null ? null : category().toString()); - jsonWriter.writeStringField("error", error()); - jsonWriter.writeStringField("expiryTime", - expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); - jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); - jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); - jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); - jsonWriter.writeArrayField("sharedUserList", sharedUserList(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("target", target()); - jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); - jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); - jsonWriter.writeJsonField("credentials", this.credentials); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ServicePrincipalAuthTypeConnectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServicePrincipalAuthTypeConnectionProperties 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 ServicePrincipalAuthTypeConnectionProperties. - */ - public static ServicePrincipalAuthTypeConnectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServicePrincipalAuthTypeConnectionProperties deserializedServicePrincipalAuthTypeConnectionProperties - = new ServicePrincipalAuthTypeConnectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("category".equals(fieldName)) { - deserializedServicePrincipalAuthTypeConnectionProperties - .withCategory(ConnectionCategory.fromString(reader.getString())); - } else if ("createdByWorkspaceArmId".equals(fieldName)) { - deserializedServicePrincipalAuthTypeConnectionProperties - .withCreatedByWorkspaceArmId(reader.getString()); - } else if ("error".equals(fieldName)) { - deserializedServicePrincipalAuthTypeConnectionProperties.withError(reader.getString()); - } else if ("expiryTime".equals(fieldName)) { - deserializedServicePrincipalAuthTypeConnectionProperties.withExpiryTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("group".equals(fieldName)) { - deserializedServicePrincipalAuthTypeConnectionProperties - .withGroup(ConnectionGroup.fromString(reader.getString())); - } else if ("isSharedToAll".equals(fieldName)) { - deserializedServicePrincipalAuthTypeConnectionProperties - .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); - } else if ("metadata".equals(fieldName)) { - Map metadata = reader.readMap(reader1 -> reader1.getString()); - deserializedServicePrincipalAuthTypeConnectionProperties.withMetadata(metadata); - } else if ("peRequirement".equals(fieldName)) { - deserializedServicePrincipalAuthTypeConnectionProperties - .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); - } else if ("peStatus".equals(fieldName)) { - deserializedServicePrincipalAuthTypeConnectionProperties - .withPeStatus(ManagedPEStatus.fromString(reader.getString())); - } else if ("sharedUserList".equals(fieldName)) { - List sharedUserList = reader.readArray(reader1 -> reader1.getString()); - deserializedServicePrincipalAuthTypeConnectionProperties.withSharedUserList(sharedUserList); - } else if ("target".equals(fieldName)) { - deserializedServicePrincipalAuthTypeConnectionProperties.withTarget(reader.getString()); - } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { - deserializedServicePrincipalAuthTypeConnectionProperties - .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); - } else if ("authType".equals(fieldName)) { - deserializedServicePrincipalAuthTypeConnectionProperties.authType - = ConnectionAuthType.fromString(reader.getString()); - } else if ("credentials".equals(fieldName)) { - deserializedServicePrincipalAuthTypeConnectionProperties.credentials - = ConnectionServicePrincipal.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedServicePrincipalAuthTypeConnectionProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTagOutboundRule.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTagOutboundRule.java deleted file mode 100644 index 36006fafeda3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTagOutboundRule.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Service Tag outbound rule for the managed network of a cognitive services account. - */ -@Fluent -public final class ServiceTagOutboundRule extends OutboundRule { - /* - * Type of a managed network Outbound Rule of a cognitive services account. - */ - private RuleType type = RuleType.SERVICE_TAG; - - /* - * Service Tag destination. - */ - private ServiceTagOutboundRuleDestination destination; - - /** - * Creates an instance of ServiceTagOutboundRule class. - */ - public ServiceTagOutboundRule() { - } - - /** - * Get the type property: Type of a managed network Outbound Rule of a cognitive services account. - * - * @return the type value. - */ - @Override - public RuleType type() { - return this.type; - } - - /** - * Get the destination property: Service Tag destination. - * - * @return the destination value. - */ - public ServiceTagOutboundRuleDestination destination() { - return this.destination; - } - - /** - * Set the destination property: Service Tag destination. - * - * @param destination the destination value to set. - * @return the ServiceTagOutboundRule object itself. - */ - public ServiceTagOutboundRule withDestination(ServiceTagOutboundRuleDestination destination) { - this.destination = destination; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ServiceTagOutboundRule withCategory(RuleCategory category) { - super.withCategory(category); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ServiceTagOutboundRule withStatus(RuleStatus status) { - super.withStatus(status); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("category", category() == null ? null : category().toString()); - jsonWriter.writeStringField("status", status() == null ? null : status().toString()); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeJsonField("destination", this.destination); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ServiceTagOutboundRule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServiceTagOutboundRule 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 ServiceTagOutboundRule. - */ - public static ServiceTagOutboundRule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServiceTagOutboundRule deserializedServiceTagOutboundRule = new ServiceTagOutboundRule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("category".equals(fieldName)) { - deserializedServiceTagOutboundRule.withCategory(RuleCategory.fromString(reader.getString())); - } else if ("status".equals(fieldName)) { - deserializedServiceTagOutboundRule.withStatus(RuleStatus.fromString(reader.getString())); - } else if ("errorInformation".equals(fieldName)) { - deserializedServiceTagOutboundRule.withErrorInformation(reader.getString()); - } else if ("parentRuleNames".equals(fieldName)) { - List parentRuleNames = reader.readArray(reader1 -> reader1.getString()); - deserializedServiceTagOutboundRule.withParentRuleNames(parentRuleNames); - } else if ("type".equals(fieldName)) { - deserializedServiceTagOutboundRule.type = RuleType.fromString(reader.getString()); - } else if ("destination".equals(fieldName)) { - deserializedServiceTagOutboundRule.destination = ServiceTagOutboundRuleDestination.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedServiceTagOutboundRule; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTagOutboundRuleDestination.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTagOutboundRuleDestination.java deleted file mode 100644 index 6302a6956434..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTagOutboundRuleDestination.java +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Service Tag destination for an outbound rule. - */ -@Fluent -public final class ServiceTagOutboundRuleDestination implements JsonSerializable { - /* - * Name of the Azure service tag to target. - */ - private String serviceTag; - - /* - * Network protocol used by the service tag rule. - */ - private String protocol; - - /* - * Destination port ranges. - */ - private String portRanges; - - /* - * The action for the service tag outbound rule. - */ - private RuleAction action; - - /* - * Optional address prefixes. If provided, the serviceTag property will be ignored. - */ - private List addressPrefixes; - - /** - * Creates an instance of ServiceTagOutboundRuleDestination class. - */ - public ServiceTagOutboundRuleDestination() { - } - - /** - * Get the serviceTag property: Name of the Azure service tag to target. - * - * @return the serviceTag value. - */ - public String serviceTag() { - return this.serviceTag; - } - - /** - * Set the serviceTag property: Name of the Azure service tag to target. - * - * @param serviceTag the serviceTag value to set. - * @return the ServiceTagOutboundRuleDestination object itself. - */ - public ServiceTagOutboundRuleDestination withServiceTag(String serviceTag) { - this.serviceTag = serviceTag; - return this; - } - - /** - * Get the protocol property: Network protocol used by the service tag rule. - * - * @return the protocol value. - */ - public String protocol() { - return this.protocol; - } - - /** - * Set the protocol property: Network protocol used by the service tag rule. - * - * @param protocol the protocol value to set. - * @return the ServiceTagOutboundRuleDestination object itself. - */ - public ServiceTagOutboundRuleDestination withProtocol(String protocol) { - this.protocol = protocol; - return this; - } - - /** - * Get the portRanges property: Destination port ranges. - * - * @return the portRanges value. - */ - public String portRanges() { - return this.portRanges; - } - - /** - * Set the portRanges property: Destination port ranges. - * - * @param portRanges the portRanges value to set. - * @return the ServiceTagOutboundRuleDestination object itself. - */ - public ServiceTagOutboundRuleDestination withPortRanges(String portRanges) { - this.portRanges = portRanges; - return this; - } - - /** - * Get the action property: The action for the service tag outbound rule. - * - * @return the action value. - */ - public RuleAction action() { - return this.action; - } - - /** - * Set the action property: The action for the service tag outbound rule. - * - * @param action the action value to set. - * @return the ServiceTagOutboundRuleDestination object itself. - */ - public ServiceTagOutboundRuleDestination withAction(RuleAction action) { - this.action = action; - return this; - } - - /** - * Get the addressPrefixes property: Optional address prefixes. If provided, the serviceTag property will be - * ignored. - * - * @return the addressPrefixes value. - */ - public List addressPrefixes() { - return this.addressPrefixes; - } - - /** - * Set the addressPrefixes property: Optional address prefixes. If provided, the serviceTag property will be - * ignored. - * - * @param addressPrefixes the addressPrefixes value to set. - * @return the ServiceTagOutboundRuleDestination object itself. - */ - public ServiceTagOutboundRuleDestination withAddressPrefixes(List addressPrefixes) { - this.addressPrefixes = addressPrefixes; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("serviceTag", this.serviceTag); - jsonWriter.writeStringField("protocol", this.protocol); - jsonWriter.writeStringField("portRanges", this.portRanges); - jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); - jsonWriter.writeArrayField("addressPrefixes", this.addressPrefixes, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ServiceTagOutboundRuleDestination from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServiceTagOutboundRuleDestination 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 ServiceTagOutboundRuleDestination. - */ - public static ServiceTagOutboundRuleDestination fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServiceTagOutboundRuleDestination deserializedServiceTagOutboundRuleDestination - = new ServiceTagOutboundRuleDestination(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("serviceTag".equals(fieldName)) { - deserializedServiceTagOutboundRuleDestination.serviceTag = reader.getString(); - } else if ("protocol".equals(fieldName)) { - deserializedServiceTagOutboundRuleDestination.protocol = reader.getString(); - } else if ("portRanges".equals(fieldName)) { - deserializedServiceTagOutboundRuleDestination.portRanges = reader.getString(); - } else if ("action".equals(fieldName)) { - deserializedServiceTagOutboundRuleDestination.action = RuleAction.fromString(reader.getString()); - } else if ("addressPrefixes".equals(fieldName)) { - List addressPrefixes = reader.readArray(reader1 -> reader1.getString()); - deserializedServiceTagOutboundRuleDestination.addressPrefixes = addressPrefixes; - } else { - reader.skipChildren(); - } - } - - return deserializedServiceTagOutboundRuleDestination; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTier.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTier.java deleted file mode 100644 index 2488272d1f68..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTier.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The service tier for the deployment. Determines the pricing and performance level for request processing. Use - * 'Default' for standard pricing or 'Priority' for higher-priority processing with premium pricing. Note: Pause - * operations are only supported on Standard, DataZoneStandard, and GlobalStandard SKUs. - */ -public final class ServiceTier extends ExpandableStringEnum { - /** - * Default service tier meaning the request will be processed with the standard pricing and performance for the - * selected model. - */ - public static final ServiceTier DEFAULT = fromString("Default"); - - /** - * Priority service tier meaning the request will be processed with higher pricing and performance for the selected - * model. - */ - public static final ServiceTier PRIORITY = fromString("Priority"); - - /** - * Creates a new instance of ServiceTier value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ServiceTier() { - } - - /** - * Creates or finds a ServiceTier from its string representation. - * - * @param name a name to look for. - * @return the corresponding ServiceTier. - */ - public static ServiceTier fromString(String name) { - return fromString(name, ServiceTier.class); - } - - /** - * Gets known ServiceTier values. - * - * @return known ServiceTier values. - */ - public static Collection values() { - return values(ServiceTier.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Sku.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Sku.java deleted file mode 100644 index b884089eac00..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Sku.java +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 resource model definition representing SKU. - */ -@Fluent -public final class Sku implements JsonSerializable { - /* - * The name of the SKU. Ex - P3. It is typically a letter+number code - */ - private String name; - - /* - * This field is required to be implemented by the Resource Provider if the service has more than one tier, but is - * not required on a PUT. - */ - private SkuTier tier; - - /* - * The SKU size. When the name field is the combination of tier and some other value, this would be the standalone - * code. - */ - private String size; - - /* - * If the service has different generations of hardware, for the same SKU, then that can be captured here. - */ - private String family; - - /* - * If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible - * for the resource this may be omitted. - */ - private Integer capacity; - - /** - * Creates an instance of Sku class. - */ - public Sku() { - } - - /** - * Get the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the SKU. Ex - P3. It is typically a letter+number code. - * - * @param name the name value to set. - * @return the Sku object itself. - */ - public Sku withName(String name) { - this.name = name; - return this; - } - - /** - * Get the tier property: This field is required to be implemented by the Resource Provider if the service has more - * than one tier, but is not required on a PUT. - * - * @return the tier value. - */ - public SkuTier tier() { - return this.tier; - } - - /** - * Set the tier property: This field is required to be implemented by the Resource Provider if the service has more - * than one tier, but is not required on a PUT. - * - * @param tier the tier value to set. - * @return the Sku object itself. - */ - public Sku withTier(SkuTier tier) { - this.tier = tier; - return this; - } - - /** - * Get the size property: The SKU size. When the name field is the combination of tier and some other value, this - * would be the standalone code. - * - * @return the size value. - */ - public String size() { - return this.size; - } - - /** - * Set the size property: The SKU size. When the name field is the combination of tier and some other value, this - * would be the standalone code. - * - * @param size the size value to set. - * @return the Sku object itself. - */ - public Sku withSize(String size) { - this.size = size; - return this; - } - - /** - * Get the family property: If the service has different generations of hardware, for the same SKU, then that can be - * captured here. - * - * @return the family value. - */ - public String family() { - return this.family; - } - - /** - * Set the family property: If the service has different generations of hardware, for the same SKU, then that can be - * captured here. - * - * @param family the family value to set. - * @return the Sku object itself. - */ - public Sku withFamily(String family) { - this.family = family; - return this; - } - - /** - * Get the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If - * scale out/in is not possible for the resource this may be omitted. - * - * @return the capacity value. - */ - public Integer capacity() { - return this.capacity; - } - - /** - * Set the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If - * scale out/in is not possible for the resource this may be omitted. - * - * @param capacity the capacity value to set. - * @return the Sku object itself. - */ - public Sku withCapacity(Integer capacity) { - this.capacity = capacity; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString()); - jsonWriter.writeStringField("size", this.size); - jsonWriter.writeStringField("family", this.family); - jsonWriter.writeNumberField("capacity", this.capacity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Sku from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Sku 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 Sku. - */ - public static Sku fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Sku deserializedSku = new Sku(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedSku.name = reader.getString(); - } else if ("tier".equals(fieldName)) { - deserializedSku.tier = SkuTier.fromString(reader.getString()); - } else if ("size".equals(fieldName)) { - deserializedSku.size = reader.getString(); - } else if ("family".equals(fieldName)) { - deserializedSku.family = reader.getString(); - } else if ("capacity".equals(fieldName)) { - deserializedSku.capacity = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedSku; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuAvailability.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuAvailability.java deleted file mode 100644 index 75737d8d271f..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuAvailability.java +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * SKU availability. - */ -@Immutable -public final class SkuAvailability implements JsonSerializable { - /* - * The kind (type) of cognitive service account. - */ - private String kind; - - /* - * The Type of the resource. - */ - private String type; - - /* - * The name of SKU. - */ - private String skuName; - - /* - * Indicates the given SKU is available or not. - */ - private Boolean skuAvailable; - - /* - * Reason why the SKU is not available. - */ - private String reason; - - /* - * Additional error message. - */ - private String message; - - /** - * Creates an instance of SkuAvailability class. - */ - private SkuAvailability() { - } - - /** - * Get the kind property: The kind (type) of cognitive service account. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Get the type property: The Type of the resource. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the skuName property: The name of SKU. - * - * @return the skuName value. - */ - public String skuName() { - return this.skuName; - } - - /** - * Get the skuAvailable property: Indicates the given SKU is available or not. - * - * @return the skuAvailable value. - */ - public Boolean skuAvailable() { - return this.skuAvailable; - } - - /** - * Get the reason property: Reason why the SKU is not available. - * - * @return the reason value. - */ - public String reason() { - return this.reason; - } - - /** - * Get the message property: Additional error message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("kind", this.kind); - jsonWriter.writeStringField("type", this.type); - jsonWriter.writeStringField("skuName", this.skuName); - jsonWriter.writeBooleanField("skuAvailable", this.skuAvailable); - jsonWriter.writeStringField("reason", this.reason); - jsonWriter.writeStringField("message", this.message); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SkuAvailability from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SkuAvailability 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 SkuAvailability. - */ - public static SkuAvailability fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SkuAvailability deserializedSkuAvailability = new SkuAvailability(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("kind".equals(fieldName)) { - deserializedSkuAvailability.kind = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSkuAvailability.type = reader.getString(); - } else if ("skuName".equals(fieldName)) { - deserializedSkuAvailability.skuName = reader.getString(); - } else if ("skuAvailable".equals(fieldName)) { - deserializedSkuAvailability.skuAvailable = reader.getNullable(JsonReader::getBoolean); - } else if ("reason".equals(fieldName)) { - deserializedSkuAvailability.reason = reader.getString(); - } else if ("message".equals(fieldName)) { - deserializedSkuAvailability.message = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSkuAvailability; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuAvailabilityListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuAvailabilityListResult.java deleted file mode 100644 index 090763e50bd1..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuAvailabilityListResult.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.SkuAvailabilityListResultInner; -import java.util.List; - -/** - * An immutable client-side representation of SkuAvailabilityListResult. - */ -public interface SkuAvailabilityListResult { - /** - * Gets the value property: Check SKU availability result list. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.SkuAvailabilityListResultInner object. - * - * @return the inner object. - */ - SkuAvailabilityListResultInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuCapability.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuCapability.java deleted file mode 100644 index debcdaba2918..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuCapability.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * SkuCapability indicates the capability of a certain feature. - */ -@Immutable -public final class SkuCapability implements JsonSerializable { - /* - * The name of the SkuCapability. - */ - private String name; - - /* - * The value of the SkuCapability. - */ - private String value; - - /** - * Creates an instance of SkuCapability class. - */ - private SkuCapability() { - } - - /** - * Get the name property: The name of the SkuCapability. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the value property: The value of the SkuCapability. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("value", this.value); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SkuCapability from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SkuCapability 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 SkuCapability. - */ - public static SkuCapability fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SkuCapability deserializedSkuCapability = new SkuCapability(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedSkuCapability.name = reader.getString(); - } else if ("value".equals(fieldName)) { - deserializedSkuCapability.value = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSkuCapability; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuChangeInfo.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuChangeInfo.java deleted file mode 100644 index bf4d7b071cb9..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuChangeInfo.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Sku change info of account. - */ -@Immutable -public final class SkuChangeInfo implements JsonSerializable { - /* - * Gets the count of downgrades. - */ - private Float countOfDowngrades; - - /* - * Gets the count of upgrades after downgrades. - */ - private Float countOfUpgradesAfterDowngrades; - - /* - * Gets the last change date. - */ - private String lastChangeDate; - - /** - * Creates an instance of SkuChangeInfo class. - */ - private SkuChangeInfo() { - } - - /** - * Get the countOfDowngrades property: Gets the count of downgrades. - * - * @return the countOfDowngrades value. - */ - public Float countOfDowngrades() { - return this.countOfDowngrades; - } - - /** - * Get the countOfUpgradesAfterDowngrades property: Gets the count of upgrades after downgrades. - * - * @return the countOfUpgradesAfterDowngrades value. - */ - public Float countOfUpgradesAfterDowngrades() { - return this.countOfUpgradesAfterDowngrades; - } - - /** - * Get the lastChangeDate property: Gets the last change date. - * - * @return the lastChangeDate value. - */ - public String lastChangeDate() { - return this.lastChangeDate; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("countOfDowngrades", this.countOfDowngrades); - jsonWriter.writeNumberField("countOfUpgradesAfterDowngrades", this.countOfUpgradesAfterDowngrades); - jsonWriter.writeStringField("lastChangeDate", this.lastChangeDate); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SkuChangeInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SkuChangeInfo 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 SkuChangeInfo. - */ - public static SkuChangeInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SkuChangeInfo deserializedSkuChangeInfo = new SkuChangeInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("countOfDowngrades".equals(fieldName)) { - deserializedSkuChangeInfo.countOfDowngrades = reader.getNullable(JsonReader::getFloat); - } else if ("countOfUpgradesAfterDowngrades".equals(fieldName)) { - deserializedSkuChangeInfo.countOfUpgradesAfterDowngrades = reader.getNullable(JsonReader::getFloat); - } else if ("lastChangeDate".equals(fieldName)) { - deserializedSkuChangeInfo.lastChangeDate = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSkuChangeInfo; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuResource.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuResource.java deleted file mode 100644 index ca9f42862bf8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuResource.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.SkuResourceInner; - -/** - * An immutable client-side representation of SkuResource. - */ -public interface SkuResource { - /** - * Gets the resourceType property: The resource type name. - * - * @return the resourceType value. - */ - String resourceType(); - - /** - * Gets the sku property: The resource model definition representing SKU. - * - * @return the sku value. - */ - Sku sku(); - - /** - * Gets the capacity property: The capacity configuration. - * - * @return the capacity value. - */ - CapacityConfig capacity(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.SkuResourceInner object. - * - * @return the inner object. - */ - SkuResourceInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuTier.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuTier.java deleted file mode 100644 index e9e78a089181..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuTier.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not - * required on a PUT. - */ -public final class SkuTier extends ExpandableStringEnum { - /** - * Static value Free for SkuTier. - */ - public static final SkuTier FREE = fromString("Free"); - - /** - * Static value Basic for SkuTier. - */ - public static final SkuTier BASIC = fromString("Basic"); - - /** - * Static value Standard for SkuTier. - */ - public static final SkuTier STANDARD = fromString("Standard"); - - /** - * Static value Premium for SkuTier. - */ - public static final SkuTier PREMIUM = fromString("Premium"); - - /** - * Static value Enterprise for SkuTier. - */ - public static final SkuTier ENTERPRISE = fromString("Enterprise"); - - /** - * Creates a new instance of SkuTier value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SkuTier() { - } - - /** - * Creates or finds a SkuTier from its string representation. - * - * @param name a name to look for. - * @return the corresponding SkuTier. - */ - public static SkuTier fromString(String name) { - return fromString(name, SkuTier.class); - } - - /** - * Gets known SkuTier values. - * - * @return known SkuTier values. - */ - public static Collection values() { - return values(SkuTier.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SshSettings.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SshSettings.java deleted file mode 100644 index 4380a3e42cfc..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SshSettings.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * SSH configuration for a Container Instance compute. - */ -@Fluent -public final class SshSettings implements JsonSerializable { - /* - * The SSH public key for authenticating to the compute instance. - */ - private String sshPublicKey; - - /* - * Whether SSH admin access is enabled. - */ - private Boolean adminEnabled; - - /** - * Creates an instance of SshSettings class. - */ - public SshSettings() { - } - - /** - * Get the sshPublicKey property: The SSH public key for authenticating to the compute instance. - * - * @return the sshPublicKey value. - */ - public String sshPublicKey() { - return this.sshPublicKey; - } - - /** - * Set the sshPublicKey property: The SSH public key for authenticating to the compute instance. - * - * @param sshPublicKey the sshPublicKey value to set. - * @return the SshSettings object itself. - */ - public SshSettings withSshPublicKey(String sshPublicKey) { - this.sshPublicKey = sshPublicKey; - return this; - } - - /** - * Get the adminEnabled property: Whether SSH admin access is enabled. - * - * @return the adminEnabled value. - */ - public Boolean adminEnabled() { - return this.adminEnabled; - } - - /** - * Set the adminEnabled property: Whether SSH admin access is enabled. - * - * @param adminEnabled the adminEnabled value to set. - * @return the SshSettings object itself. - */ - public SshSettings withAdminEnabled(Boolean adminEnabled) { - this.adminEnabled = adminEnabled; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("sshPublicKey", this.sshPublicKey); - jsonWriter.writeBooleanField("adminEnabled", this.adminEnabled); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SshSettings from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SshSettings 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 SshSettings. - */ - public static SshSettings fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SshSettings deserializedSshSettings = new SshSettings(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sshPublicKey".equals(fieldName)) { - deserializedSshSettings.sshPublicKey = reader.getString(); - } else if ("adminEnabled".equals(fieldName)) { - deserializedSshSettings.adminEnabled = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedSshSettings; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SubscriptionRaiPolicies.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SubscriptionRaiPolicies.java deleted file mode 100644 index c7cc2dea41be..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SubscriptionRaiPolicies.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner; - -/** - * Resource collection API of SubscriptionRaiPolicies. - */ -public interface SubscriptionRaiPolicies { - /** - * Gets the specified Content Filters associated with the Subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @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 specified Content Filters associated with the Subscription along with {@link Response}. - */ - Response getWithResponse(String raiPolicyName, Context context); - - /** - * Gets the specified Content Filters associated with the Subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 Content Filters associated with the Subscription. - */ - RaiPolicy get(String raiPolicyName); - - /** - * Update the state of specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @param raiPolicy Properties describing the Content Filters. - * @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 cognitive Services RaiPolicy along with {@link Response}. - */ - Response createOrUpdateWithResponse(String raiPolicyName, RaiPolicyInner raiPolicy, Context context); - - /** - * Update the state of specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @param raiPolicy Properties describing the Content Filters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services RaiPolicy. - */ - RaiPolicy createOrUpdate(String raiPolicyName, RaiPolicyInner raiPolicy); - - /** - * Deletes the specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 raiPolicyName); - - /** - * Deletes the specified Content Filters associated with the subscription. - * - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @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 raiPolicyName, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TestRaiExternalSafetyProviders.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TestRaiExternalSafetyProviders.java deleted file mode 100644 index df017b0c026e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TestRaiExternalSafetyProviders.java +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -/** - * Resource collection API of TestRaiExternalSafetyProviders. - */ -public interface TestRaiExternalSafetyProviders { - /** - * Begins definition for a new RaiExternalSafetyProviderSchema resource. - * - * @param name resource name. - * @return the first stage of the new RaiExternalSafetyProviderSchema definition. - */ - RaiExternalSafetyProviderSchema.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ThrottlingRule.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ThrottlingRule.java deleted file mode 100644 index d13bc6bd1928..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ThrottlingRule.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * The ThrottlingRule model. - */ -@Immutable -public final class ThrottlingRule implements JsonSerializable { - /* - * The key property. - */ - private String key; - - /* - * The renewalPeriod property. - */ - private Float renewalPeriod; - - /* - * The count property. - */ - private Float count; - - /* - * The minCount property. - */ - private Float minCount; - - /* - * The dynamicThrottlingEnabled property. - */ - private Boolean dynamicThrottlingEnabled; - - /* - * The matchPatterns property. - */ - private List matchPatterns; - - /** - * Creates an instance of ThrottlingRule class. - */ - private ThrottlingRule() { - } - - /** - * Get the key property: The key property. - * - * @return the key value. - */ - public String key() { - return this.key; - } - - /** - * Get the renewalPeriod property: The renewalPeriod property. - * - * @return the renewalPeriod value. - */ - public Float renewalPeriod() { - return this.renewalPeriod; - } - - /** - * Get the count property: The count property. - * - * @return the count value. - */ - public Float count() { - return this.count; - } - - /** - * Get the minCount property: The minCount property. - * - * @return the minCount value. - */ - public Float minCount() { - return this.minCount; - } - - /** - * Get the dynamicThrottlingEnabled property: The dynamicThrottlingEnabled property. - * - * @return the dynamicThrottlingEnabled value. - */ - public Boolean dynamicThrottlingEnabled() { - return this.dynamicThrottlingEnabled; - } - - /** - * Get the matchPatterns property: The matchPatterns property. - * - * @return the matchPatterns value. - */ - public List matchPatterns() { - return this.matchPatterns; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("key", this.key); - jsonWriter.writeNumberField("renewalPeriod", this.renewalPeriod); - jsonWriter.writeNumberField("count", this.count); - jsonWriter.writeNumberField("minCount", this.minCount); - jsonWriter.writeBooleanField("dynamicThrottlingEnabled", this.dynamicThrottlingEnabled); - jsonWriter.writeArrayField("matchPatterns", this.matchPatterns, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ThrottlingRule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ThrottlingRule 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 ThrottlingRule. - */ - public static ThrottlingRule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ThrottlingRule deserializedThrottlingRule = new ThrottlingRule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("key".equals(fieldName)) { - deserializedThrottlingRule.key = reader.getString(); - } else if ("renewalPeriod".equals(fieldName)) { - deserializedThrottlingRule.renewalPeriod = reader.getNullable(JsonReader::getFloat); - } else if ("count".equals(fieldName)) { - deserializedThrottlingRule.count = reader.getNullable(JsonReader::getFloat); - } else if ("minCount".equals(fieldName)) { - deserializedThrottlingRule.minCount = reader.getNullable(JsonReader::getFloat); - } else if ("dynamicThrottlingEnabled".equals(fieldName)) { - deserializedThrottlingRule.dynamicThrottlingEnabled = reader.getNullable(JsonReader::getBoolean); - } else if ("matchPatterns".equals(fieldName)) { - List matchPatterns - = reader.readArray(reader1 -> RequestMatchPattern.fromJson(reader1)); - deserializedThrottlingRule.matchPatterns = matchPatterns; - } else { - reader.skipChildren(); - } - } - - return deserializedThrottlingRule; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TierUpgradePolicy.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TierUpgradePolicy.java deleted file mode 100644 index f8e5eb0ce79c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TierUpgradePolicy.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Gets the tier upgrade policy for the subscription. - */ -public final class TierUpgradePolicy extends ExpandableStringEnum { - /** - * Static value OnceUpgradeIsAvailable for TierUpgradePolicy. - */ - public static final TierUpgradePolicy ONCE_UPGRADE_IS_AVAILABLE = fromString("OnceUpgradeIsAvailable"); - - /** - * Static value NoAutoUpgrade for TierUpgradePolicy. - */ - public static final TierUpgradePolicy NO_AUTO_UPGRADE = fromString("NoAutoUpgrade"); - - /** - * Creates a new instance of TierUpgradePolicy value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public TierUpgradePolicy() { - } - - /** - * Creates or finds a TierUpgradePolicy from its string representation. - * - * @param name a name to look for. - * @return the corresponding TierUpgradePolicy. - */ - public static TierUpgradePolicy fromString(String name) { - return fromString(name, TierUpgradePolicy.class); - } - - /** - * Gets known TierUpgradePolicy values. - * - * @return known TierUpgradePolicy values. - */ - public static Collection values() { - return values(TierUpgradePolicy.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TrafficRoutingProtocol.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TrafficRoutingProtocol.java deleted file mode 100644 index 4645d0848314..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TrafficRoutingProtocol.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Traffic routing protocol, used to distribute an application's inbound traffic to its deployments. - */ -public final class TrafficRoutingProtocol extends ExpandableStringEnum { - /** - * Percentage based routing. - */ - public static final TrafficRoutingProtocol FIXED_RATIO = fromString("FixedRatio"); - - /** - * Creates a new instance of TrafficRoutingProtocol value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public TrafficRoutingProtocol() { - } - - /** - * Creates or finds a TrafficRoutingProtocol from its string representation. - * - * @param name a name to look for. - * @return the corresponding TrafficRoutingProtocol. - */ - public static TrafficRoutingProtocol fromString(String name) { - return fromString(name, TrafficRoutingProtocol.class); - } - - /** - * Gets known TrafficRoutingProtocol values. - * - * @return known TrafficRoutingProtocol values. - */ - public static Collection values() { - return values(TrafficRoutingProtocol.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TrafficRoutingRule.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TrafficRoutingRule.java deleted file mode 100644 index b9ef27b6ac9b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TrafficRoutingRule.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * Represents a rule for routing traffic to a specific deployment. - */ -@Fluent -public final class TrafficRoutingRule implements JsonSerializable { - /* - * The identifier of this traffic routing rule. - */ - private String ruleId; - - /* - * A user-provided description for this traffic routing rule. - */ - private String description; - - /* - * The unique identifier of the deployment to which traffic is routed by this rule. - */ - private String deploymentId; - - /* - * Gets or sets the percentage of traffic allocated to this instance. - */ - private Integer trafficPercentage; - - /** - * Creates an instance of TrafficRoutingRule class. - */ - public TrafficRoutingRule() { - } - - /** - * Get the ruleId property: The identifier of this traffic routing rule. - * - * @return the ruleId value. - */ - public String ruleId() { - return this.ruleId; - } - - /** - * Set the ruleId property: The identifier of this traffic routing rule. - * - * @param ruleId the ruleId value to set. - * @return the TrafficRoutingRule object itself. - */ - public TrafficRoutingRule withRuleId(String ruleId) { - this.ruleId = ruleId; - return this; - } - - /** - * Get the description property: A user-provided description for this traffic routing rule. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: A user-provided description for this traffic routing rule. - * - * @param description the description value to set. - * @return the TrafficRoutingRule object itself. - */ - public TrafficRoutingRule withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the deploymentId property: The unique identifier of the deployment to which traffic is routed by this rule. - * - * @return the deploymentId value. - */ - public String deploymentId() { - return this.deploymentId; - } - - /** - * Set the deploymentId property: The unique identifier of the deployment to which traffic is routed by this rule. - * - * @param deploymentId the deploymentId value to set. - * @return the TrafficRoutingRule object itself. - */ - public TrafficRoutingRule withDeploymentId(String deploymentId) { - this.deploymentId = deploymentId; - return this; - } - - /** - * Get the trafficPercentage property: Gets or sets the percentage of traffic allocated to this instance. - * - * @return the trafficPercentage value. - */ - public Integer trafficPercentage() { - return this.trafficPercentage; - } - - /** - * Set the trafficPercentage property: Gets or sets the percentage of traffic allocated to this instance. - * - * @param trafficPercentage the trafficPercentage value to set. - * @return the TrafficRoutingRule object itself. - */ - public TrafficRoutingRule withTrafficPercentage(Integer trafficPercentage) { - this.trafficPercentage = trafficPercentage; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("ruleId", this.ruleId); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeStringField("deploymentId", this.deploymentId); - jsonWriter.writeNumberField("trafficPercentage", this.trafficPercentage); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of TrafficRoutingRule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TrafficRoutingRule 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 TrafficRoutingRule. - */ - public static TrafficRoutingRule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - TrafficRoutingRule deserializedTrafficRoutingRule = new TrafficRoutingRule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("ruleId".equals(fieldName)) { - deserializedTrafficRoutingRule.ruleId = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedTrafficRoutingRule.description = reader.getString(); - } else if ("deploymentId".equals(fieldName)) { - deserializedTrafficRoutingRule.deploymentId = reader.getString(); - } else if ("trafficPercentage".equals(fieldName)) { - deserializedTrafficRoutingRule.trafficPercentage = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedTrafficRoutingRule; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UnitType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UnitType.java deleted file mode 100644 index 2e5e1eff1a91..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UnitType.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The unit of the metric. - */ -public final class UnitType extends ExpandableStringEnum { - /** - * Static value Count for UnitType. - */ - public static final UnitType COUNT = fromString("Count"); - - /** - * Static value Bytes for UnitType. - */ - public static final UnitType BYTES = fromString("Bytes"); - - /** - * Static value Seconds for UnitType. - */ - public static final UnitType SECONDS = fromString("Seconds"); - - /** - * Static value Percent for UnitType. - */ - public static final UnitType PERCENT = fromString("Percent"); - - /** - * Static value CountPerSecond for UnitType. - */ - public static final UnitType COUNT_PER_SECOND = fromString("CountPerSecond"); - - /** - * Static value BytesPerSecond for UnitType. - */ - public static final UnitType BYTES_PER_SECOND = fromString("BytesPerSecond"); - - /** - * Static value Milliseconds for UnitType. - */ - public static final UnitType MILLISECONDS = fromString("Milliseconds"); - - /** - * Creates a new instance of UnitType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public UnitType() { - } - - /** - * Creates or finds a UnitType from its string representation. - * - * @param name a name to look for. - * @return the corresponding UnitType. - */ - public static UnitType fromString(String name) { - return fromString(name, UnitType.class); - } - - /** - * Gets known UnitType values. - * - * @return known UnitType values. - */ - public static Collection values() { - return values(UnitType.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UpgradeAvailabilityStatus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UpgradeAvailabilityStatus.java deleted file mode 100644 index fc504c3cd47d..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UpgradeAvailabilityStatus.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Specifies whether an upgrade to the next quota tier is available. - */ -public final class UpgradeAvailabilityStatus extends ExpandableStringEnum { - /** - * Static value Available for UpgradeAvailabilityStatus. - */ - public static final UpgradeAvailabilityStatus AVAILABLE = fromString("Available"); - - /** - * Static value NotAvailable for UpgradeAvailabilityStatus. - */ - public static final UpgradeAvailabilityStatus NOT_AVAILABLE = fromString("NotAvailable"); - - /** - * Creates a new instance of UpgradeAvailabilityStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public UpgradeAvailabilityStatus() { - } - - /** - * Creates or finds a UpgradeAvailabilityStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding UpgradeAvailabilityStatus. - */ - public static UpgradeAvailabilityStatus fromString(String name) { - return fromString(name, UpgradeAvailabilityStatus.class); - } - - /** - * Gets known UpgradeAvailabilityStatus values. - * - * @return known UpgradeAvailabilityStatus values. - */ - public static Collection values() { - return values(UpgradeAvailabilityStatus.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usage.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usage.java deleted file mode 100644 index 0c1e1c38ee39..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usage.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner; - -/** - * An immutable client-side representation of Usage. - */ -public interface Usage { - /** - * Gets the unit property: The unit of the metric. - * - * @return the unit value. - */ - UnitType unit(); - - /** - * Gets the name property: The name information for the metric. - * - * @return the name value. - */ - MetricName name(); - - /** - * Gets the quotaPeriod property: The quota period used to summarize the usage values. - * - * @return the quotaPeriod value. - */ - String quotaPeriod(); - - /** - * Gets the limit property: Maximum value for this metric. - * - * @return the limit value. - */ - Double limit(); - - /** - * Gets the currentValue property: Current value for this metric. - * - * @return the currentValue value. - */ - Double currentValue(); - - /** - * Gets the nextResetTime property: Next reset time for current quota. - * - * @return the nextResetTime value. - */ - String nextResetTime(); - - /** - * Gets the status property: Cognitive Services account quota usage status. - * - * @return the status value. - */ - QuotaUsageStatus status(); - - /** - * Gets the scopeType property: The scope type of the quota usage. - * - * @return the scopeType value. - */ - QuotaScopeType scopeType(); - - /** - * Gets the scopeId property: The scope identifier of the quota usage. - * - * @return the scopeId value. - */ - String scopeId(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner object. - * - * @return the inner object. - */ - UsageInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsageListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsageListResult.java deleted file mode 100644 index 623496fcd4b7..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsageListResult.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageListResultInner; -import java.util.List; - -/** - * An immutable client-side representation of UsageListResult. - */ -public interface UsageListResult { - /** - * Gets the nextLink property: The link used to get the next page of Usages. - * - * @return the nextLink value. - */ - String nextLink(); - - /** - * Gets the value property: The list of usages for Cognitive Service account. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.UsageListResultInner object. - * - * @return the inner object. - */ - UsageListResultInner innerModel(); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usages.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usages.java deleted file mode 100644 index 654c52be873b..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usages.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of Usages. - */ -public interface Usages { - /** - * Get usages for the requested subscription. - * - * @param location The location 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 usages for the requested subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String location); - - /** - * Get usages for the requested subscription. - * - * @param location The location name. - * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is - * name.value (name of the metric, can have an or of multiple names). - * @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 usages for the requested subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String location, String filter, Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserAssignedIdentity.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserAssignedIdentity.java deleted file mode 100644 index 075f29630ef0..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserAssignedIdentity.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * User-assigned managed identity. - */ -@Immutable -public final class UserAssignedIdentity implements JsonSerializable { - /* - * Azure Active Directory principal ID associated with this Identity. - */ - private String principalId; - - /* - * Client App Id associated with this identity. - */ - private String clientId; - - /** - * Creates an instance of UserAssignedIdentity class. - */ - public UserAssignedIdentity() { - } - - /** - * Get the principalId property: Azure Active Directory principal ID associated with this Identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the clientId property: Client App Id associated with this identity. - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of UserAssignedIdentity from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of UserAssignedIdentity 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 UserAssignedIdentity. - */ - public static UserAssignedIdentity fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - UserAssignedIdentity deserializedUserAssignedIdentity = new UserAssignedIdentity(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("principalId".equals(fieldName)) { - deserializedUserAssignedIdentity.principalId = reader.getString(); - } else if ("clientId".equals(fieldName)) { - deserializedUserAssignedIdentity.clientId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedUserAssignedIdentity; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedAmlWorkspace.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedAmlWorkspace.java deleted file mode 100644 index 0afebb4248e2..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedAmlWorkspace.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 user owned AML account for Cognitive Services account. - */ -@Fluent -public final class UserOwnedAmlWorkspace implements JsonSerializable { - /* - * Full resource id of a AML account resource. - */ - private String resourceId; - - /* - * Identity Client id of a AML account resource. - */ - private String identityClientId; - - /** - * Creates an instance of UserOwnedAmlWorkspace class. - */ - public UserOwnedAmlWorkspace() { - } - - /** - * Get the resourceId property: Full resource id of a AML account resource. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: Full resource id of a AML account resource. - * - * @param resourceId the resourceId value to set. - * @return the UserOwnedAmlWorkspace object itself. - */ - public UserOwnedAmlWorkspace withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the identityClientId property: Identity Client id of a AML account resource. - * - * @return the identityClientId value. - */ - public String identityClientId() { - return this.identityClientId; - } - - /** - * Set the identityClientId property: Identity Client id of a AML account resource. - * - * @param identityClientId the identityClientId value to set. - * @return the UserOwnedAmlWorkspace object itself. - */ - public UserOwnedAmlWorkspace withIdentityClientId(String identityClientId) { - this.identityClientId = identityClientId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("resourceId", this.resourceId); - jsonWriter.writeStringField("identityClientId", this.identityClientId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of UserOwnedAmlWorkspace from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of UserOwnedAmlWorkspace 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 UserOwnedAmlWorkspace. - */ - public static UserOwnedAmlWorkspace fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - UserOwnedAmlWorkspace deserializedUserOwnedAmlWorkspace = new UserOwnedAmlWorkspace(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceId".equals(fieldName)) { - deserializedUserOwnedAmlWorkspace.resourceId = reader.getString(); - } else if ("identityClientId".equals(fieldName)) { - deserializedUserOwnedAmlWorkspace.identityClientId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedUserOwnedAmlWorkspace; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedStorage.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedStorage.java deleted file mode 100644 index 9e44cf8b3880..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedStorage.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 user owned storage for Cognitive Services account. - */ -@Fluent -public final class UserOwnedStorage implements JsonSerializable { - /* - * Full resource id of a Microsoft.Storage resource. - */ - private String resourceId; - - /* - * The identityClientId property. - */ - private String identityClientId; - - /** - * Creates an instance of UserOwnedStorage class. - */ - public UserOwnedStorage() { - } - - /** - * Get the resourceId property: Full resource id of a Microsoft.Storage resource. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: Full resource id of a Microsoft.Storage resource. - * - * @param resourceId the resourceId value to set. - * @return the UserOwnedStorage object itself. - */ - public UserOwnedStorage withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the identityClientId property: The identityClientId property. - * - * @return the identityClientId value. - */ - public String identityClientId() { - return this.identityClientId; - } - - /** - * Set the identityClientId property: The identityClientId property. - * - * @param identityClientId the identityClientId value to set. - * @return the UserOwnedStorage object itself. - */ - public UserOwnedStorage withIdentityClientId(String identityClientId) { - this.identityClientId = identityClientId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("resourceId", this.resourceId); - jsonWriter.writeStringField("identityClientId", this.identityClientId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of UserOwnedStorage from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of UserOwnedStorage 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 UserOwnedStorage. - */ - public static UserOwnedStorage fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - UserOwnedStorage deserializedUserOwnedStorage = new UserOwnedStorage(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceId".equals(fieldName)) { - deserializedUserOwnedStorage.resourceId = reader.getString(); - } else if ("identityClientId".equals(fieldName)) { - deserializedUserOwnedStorage.identityClientId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedUserOwnedStorage; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsernamePasswordAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsernamePasswordAuthTypeConnectionProperties.java deleted file mode 100644 index c01d84e90bee..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsernamePasswordAuthTypeConnectionProperties.java +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * The UsernamePasswordAuthTypeConnectionProperties model. - */ -@Fluent -public final class UsernamePasswordAuthTypeConnectionProperties extends ConnectionPropertiesV2 { - /* - * Authentication type of the connection target - */ - private ConnectionAuthType authType = ConnectionAuthType.USERNAME_PASSWORD; - - /* - * The credentials property. - */ - private ConnectionUsernamePassword credentials; - - /** - * Creates an instance of UsernamePasswordAuthTypeConnectionProperties class. - */ - public UsernamePasswordAuthTypeConnectionProperties() { - } - - /** - * Get the authType property: Authentication type of the connection target. - * - * @return the authType value. - */ - @Override - public ConnectionAuthType authType() { - return this.authType; - } - - /** - * Get the credentials property: The credentials property. - * - * @return the credentials value. - */ - public ConnectionUsernamePassword credentials() { - return this.credentials; - } - - /** - * Set the credentials property: The credentials property. - * - * @param credentials the credentials value to set. - * @return the UsernamePasswordAuthTypeConnectionProperties object itself. - */ - public UsernamePasswordAuthTypeConnectionProperties withCredentials(ConnectionUsernamePassword credentials) { - this.credentials = credentials; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UsernamePasswordAuthTypeConnectionProperties withCategory(ConnectionCategory category) { - super.withCategory(category); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UsernamePasswordAuthTypeConnectionProperties withError(String error) { - super.withError(error); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UsernamePasswordAuthTypeConnectionProperties withExpiryTime(OffsetDateTime expiryTime) { - super.withExpiryTime(expiryTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UsernamePasswordAuthTypeConnectionProperties withIsSharedToAll(Boolean isSharedToAll) { - super.withIsSharedToAll(isSharedToAll); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UsernamePasswordAuthTypeConnectionProperties withMetadata(Map metadata) { - super.withMetadata(metadata); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UsernamePasswordAuthTypeConnectionProperties withPeRequirement(ManagedPERequirement peRequirement) { - super.withPeRequirement(peRequirement); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UsernamePasswordAuthTypeConnectionProperties withPeStatus(ManagedPEStatus peStatus) { - super.withPeStatus(peStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UsernamePasswordAuthTypeConnectionProperties withSharedUserList(List sharedUserList) { - super.withSharedUserList(sharedUserList); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UsernamePasswordAuthTypeConnectionProperties withTarget(String target) { - super.withTarget(target); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public UsernamePasswordAuthTypeConnectionProperties - withUseWorkspaceManagedIdentity(Boolean useWorkspaceManagedIdentity) { - super.withUseWorkspaceManagedIdentity(useWorkspaceManagedIdentity); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("category", category() == null ? null : category().toString()); - jsonWriter.writeStringField("error", error()); - jsonWriter.writeStringField("expiryTime", - expiryTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(expiryTime())); - jsonWriter.writeBooleanField("isSharedToAll", isSharedToAll()); - jsonWriter.writeMapField("metadata", metadata(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("peRequirement", peRequirement() == null ? null : peRequirement().toString()); - jsonWriter.writeStringField("peStatus", peStatus() == null ? null : peStatus().toString()); - jsonWriter.writeArrayField("sharedUserList", sharedUserList(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("target", target()); - jsonWriter.writeBooleanField("useWorkspaceManagedIdentity", useWorkspaceManagedIdentity()); - jsonWriter.writeStringField("authType", this.authType == null ? null : this.authType.toString()); - jsonWriter.writeJsonField("credentials", this.credentials); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of UsernamePasswordAuthTypeConnectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of UsernamePasswordAuthTypeConnectionProperties 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 UsernamePasswordAuthTypeConnectionProperties. - */ - public static UsernamePasswordAuthTypeConnectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - UsernamePasswordAuthTypeConnectionProperties deserializedUsernamePasswordAuthTypeConnectionProperties - = new UsernamePasswordAuthTypeConnectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("category".equals(fieldName)) { - deserializedUsernamePasswordAuthTypeConnectionProperties - .withCategory(ConnectionCategory.fromString(reader.getString())); - } else if ("createdByWorkspaceArmId".equals(fieldName)) { - deserializedUsernamePasswordAuthTypeConnectionProperties - .withCreatedByWorkspaceArmId(reader.getString()); - } else if ("error".equals(fieldName)) { - deserializedUsernamePasswordAuthTypeConnectionProperties.withError(reader.getString()); - } else if ("expiryTime".equals(fieldName)) { - deserializedUsernamePasswordAuthTypeConnectionProperties.withExpiryTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("group".equals(fieldName)) { - deserializedUsernamePasswordAuthTypeConnectionProperties - .withGroup(ConnectionGroup.fromString(reader.getString())); - } else if ("isSharedToAll".equals(fieldName)) { - deserializedUsernamePasswordAuthTypeConnectionProperties - .withIsSharedToAll(reader.getNullable(JsonReader::getBoolean)); - } else if ("metadata".equals(fieldName)) { - Map metadata = reader.readMap(reader1 -> reader1.getString()); - deserializedUsernamePasswordAuthTypeConnectionProperties.withMetadata(metadata); - } else if ("peRequirement".equals(fieldName)) { - deserializedUsernamePasswordAuthTypeConnectionProperties - .withPeRequirement(ManagedPERequirement.fromString(reader.getString())); - } else if ("peStatus".equals(fieldName)) { - deserializedUsernamePasswordAuthTypeConnectionProperties - .withPeStatus(ManagedPEStatus.fromString(reader.getString())); - } else if ("sharedUserList".equals(fieldName)) { - List sharedUserList = reader.readArray(reader1 -> reader1.getString()); - deserializedUsernamePasswordAuthTypeConnectionProperties.withSharedUserList(sharedUserList); - } else if ("target".equals(fieldName)) { - deserializedUsernamePasswordAuthTypeConnectionProperties.withTarget(reader.getString()); - } else if ("useWorkspaceManagedIdentity".equals(fieldName)) { - deserializedUsernamePasswordAuthTypeConnectionProperties - .withUseWorkspaceManagedIdentity(reader.getNullable(JsonReader::getBoolean)); - } else if ("authType".equals(fieldName)) { - deserializedUsernamePasswordAuthTypeConnectionProperties.authType - = ConnectionAuthType.fromString(reader.getString()); - } else if ("credentials".equals(fieldName)) { - deserializedUsernamePasswordAuthTypeConnectionProperties.credentials - = ConnectionUsernamePassword.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedUsernamePasswordAuthTypeConnectionProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/VersionedAgentReference.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/VersionedAgentReference.java deleted file mode 100644 index 687cb226511c..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/VersionedAgentReference.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Type modeling a reference to a version of an agent definition. - */ -@Fluent -public final class VersionedAgentReference extends AgentReferenceProperties { - /* - * Gets the agent's version (unique for each agent lineage). - */ - private String agentVersion; - - /** - * Creates an instance of VersionedAgentReference class. - */ - public VersionedAgentReference() { - } - - /** - * Get the agentVersion property: Gets the agent's version (unique for each agent lineage). - * - * @return the agentVersion value. - */ - public String agentVersion() { - return this.agentVersion; - } - - /** - * Set the agentVersion property: Gets the agent's version (unique for each agent lineage). - * - * @param agentVersion the agentVersion value to set. - * @return the VersionedAgentReference object itself. - */ - public VersionedAgentReference withAgentVersion(String agentVersion) { - this.agentVersion = agentVersion; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public VersionedAgentReference withAgentId(String agentId) { - super.withAgentId(agentId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public VersionedAgentReference withAgentName(String agentName) { - super.withAgentName(agentName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("agentId", agentId()); - jsonWriter.writeStringField("agentName", agentName()); - jsonWriter.writeStringField("agentVersion", this.agentVersion); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of VersionedAgentReference from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of VersionedAgentReference 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 VersionedAgentReference. - */ - public static VersionedAgentReference fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - VersionedAgentReference deserializedVersionedAgentReference = new VersionedAgentReference(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("agentId".equals(fieldName)) { - deserializedVersionedAgentReference.withAgentId(reader.getString()); - } else if ("agentName".equals(fieldName)) { - deserializedVersionedAgentReference.withAgentName(reader.getString()); - } else if ("agentVersion".equals(fieldName)) { - deserializedVersionedAgentReference.agentVersion = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedVersionedAgentReference; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/VirtualNetworkRule.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/VirtualNetworkRule.java deleted file mode 100644 index 0c0559bffba5..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/VirtualNetworkRule.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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; - -/** - * A rule governing the accessibility from a specific virtual network. - */ -@Fluent -public final class VirtualNetworkRule implements JsonSerializable { - /* - * Full resource id of a vnet subnet, such as - * '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. - */ - private String id; - - /* - * Gets the state of virtual network rule. - */ - private String state; - - /* - * Ignore missing vnet service endpoint or not. - */ - private Boolean ignoreMissingVnetServiceEndpoint; - - /** - * Creates an instance of VirtualNetworkRule class. - */ - public VirtualNetworkRule() { - } - - /** - * Get the id property: Full resource id of a vnet subnet, such as - * '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Full resource id of a vnet subnet, such as - * '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. - * - * @param id the id value to set. - * @return the VirtualNetworkRule object itself. - */ - public VirtualNetworkRule withId(String id) { - this.id = id; - return this; - } - - /** - * Get the state property: Gets the state of virtual network rule. - * - * @return the state value. - */ - public String state() { - return this.state; - } - - /** - * Set the state property: Gets the state of virtual network rule. - * - * @param state the state value to set. - * @return the VirtualNetworkRule object itself. - */ - public VirtualNetworkRule withState(String state) { - this.state = state; - return this; - } - - /** - * Get the ignoreMissingVnetServiceEndpoint property: Ignore missing vnet service endpoint or not. - * - * @return the ignoreMissingVnetServiceEndpoint value. - */ - public Boolean ignoreMissingVnetServiceEndpoint() { - return this.ignoreMissingVnetServiceEndpoint; - } - - /** - * Set the ignoreMissingVnetServiceEndpoint property: Ignore missing vnet service endpoint or not. - * - * @param ignoreMissingVnetServiceEndpoint the ignoreMissingVnetServiceEndpoint value to set. - * @return the VirtualNetworkRule object itself. - */ - public VirtualNetworkRule withIgnoreMissingVnetServiceEndpoint(Boolean ignoreMissingVnetServiceEndpoint) { - this.ignoreMissingVnetServiceEndpoint = ignoreMissingVnetServiceEndpoint; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("state", this.state); - jsonWriter.writeBooleanField("ignoreMissingVnetServiceEndpoint", this.ignoreMissingVnetServiceEndpoint); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of VirtualNetworkRule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of VirtualNetworkRule 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 VirtualNetworkRule. - */ - public static VirtualNetworkRule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - VirtualNetworkRule deserializedVirtualNetworkRule = new VirtualNetworkRule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedVirtualNetworkRule.id = reader.getString(); - } else if ("state".equals(fieldName)) { - deserializedVirtualNetworkRule.state = reader.getString(); - } else if ("ignoreMissingVnetServiceEndpoint".equals(fieldName)) { - deserializedVirtualNetworkRule.ignoreMissingVnetServiceEndpoint - = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedVirtualNetworkRule; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/VmPriority.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/VmPriority.java deleted file mode 100644 index 892c2da6fdbd..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/VmPriority.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * VM priority for a compute pool. - */ -public final class VmPriority extends ExpandableStringEnum { - /** - * Regular VM priority. - */ - public static final VmPriority REGULAR = fromString("Regular"); - - /** - * Low-priority VM. - */ - public static final VmPriority LOW_PRIORITY = fromString("LowPriority"); - - /** - * Creates a new instance of VmPriority value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public VmPriority() { - } - - /** - * Creates or finds a VmPriority from its string representation. - * - * @param name a name to look for. - * @return the corresponding VmPriority. - */ - public static VmPriority fromString(String name) { - return fromString(name, VmPriority.class); - } - - /** - * Gets known VmPriority values. - * - * @return known VmPriority values. - */ - public static Collection values() { - return values(VmPriority.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Workbench.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Workbench.java deleted file mode 100644 index 812d823b0eea..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Workbench.java +++ /dev/null @@ -1,374 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.WorkbenchInner; -import java.util.Map; - -/** - * An immutable client-side representation of Workbench. - */ -public interface Workbench { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Properties of the workbench resource. - * - * @return the properties value. - */ - WorkbenchProperties properties(); - - /** - * Gets the etag property: Resource Etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the location property: The location of the workbench resource. - * - * @return the location value. - */ - String location(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the identity property: Identity for the resource. - * - * @return the identity value. - */ - Identity identity(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.WorkbenchInner object. - * - * @return the inner object. - */ - WorkbenchInner innerModel(); - - /** - * The entirety of the Workbench definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, DefinitionStages.WithCreate { - } - - /** - * The Workbench definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the Workbench definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the Workbench definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, accountName, projectName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @return the next definition stage. - */ - WithProperties withExistingProject(String resourceGroupName, String accountName, String projectName); - } - - /** - * The stage of the Workbench definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of the workbench resource.. - * - * @param properties Properties of the workbench resource. - * @return the next definition stage. - */ - WithCreate withProperties(WorkbenchProperties properties); - } - - /** - * The stage of the Workbench 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.WithLocation, DefinitionStages.WithTags, DefinitionStages.WithIdentity { - /** - * Executes the create request. - * - * @return the created resource. - */ - Workbench create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Workbench create(Context context); - } - - /** - * The stage of the Workbench definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The location of the workbench resource. - * @return the next definition stage. - */ - WithCreate withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The location of the workbench resource. - * @return the next definition stage. - */ - WithCreate withRegion(String location); - } - - /** - * The stage of the Workbench definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the Workbench definition allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: Identity for the resource.. - * - * @param identity Identity for the resource. - * @return the next definition stage. - */ - WithCreate withIdentity(Identity identity); - } - } - - /** - * Begins update for the Workbench resource. - * - * @return the stage of resource update. - */ - Workbench.Update update(); - - /** - * The template for Workbench update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithIdentity { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Workbench apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Workbench apply(Context context); - } - - /** - * The Workbench update stages. - */ - interface UpdateStages { - /** - * The stage of the Workbench update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the Workbench update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of the workbench resource.. - * - * @param properties Properties of the workbench resource. - * @return the next definition stage. - */ - Update withProperties(WorkbenchProperties properties); - } - - /** - * The stage of the Workbench update allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: Identity for the resource.. - * - * @param identity Identity for the resource. - * @return the next definition stage. - */ - Update withIdentity(Identity identity); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Workbench refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Workbench refresh(Context context); - - /** - * Starts a stopped workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @throws com.azure.core.management.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 a stopped workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @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 a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @throws com.azure.core.management.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(); - - /** - * Stops a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @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 stop(Context context); - - /** - * Restarts a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @throws com.azure.core.management.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 restart(); - - /** - * Restarts a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @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 restart(Context context); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/WorkbenchProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/WorkbenchProperties.java deleted file mode 100644 index f654dd8acd71..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/WorkbenchProperties.java +++ /dev/null @@ -1,287 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * Properties for a Workbench resource. - */ -@Fluent -public final class WorkbenchProperties implements JsonSerializable { - /* - * ARM resource ID of the parent cluster that hosts this workbench. - */ - private String targetClusterId; - - /* - * Container image URI (e.g., MCR or ACR image path) for the workbench. - */ - private String imageLink; - - /* - * ISO 8601 duration before the idle workbench is automatically shut down (e.g., 'PT30M'). - */ - private String idleTimeBeforeShutdown; - - /* - * The dataset ID to mount for the workbench. - */ - private String datasetId; - - /* - * SSH configuration for remote access to the workbench. - */ - private SshSettings sshSettings; - - /* - * Network connectivity endpoints assigned to the workbench. - */ - private ConnectivityEndpoints connectivityEndpoints; - - /* - * The web endpoint URL for accessing the workbench. - */ - private String webEndpoint; - - /* - * Provisioning state of the workbench resource. - */ - private ComputeProvisioningState provisioningState; - - /* - * Error details for the workbench resource. - */ - private List errors; - - /* - * Creation time of the workbench resource. - */ - private OffsetDateTime creationTime; - - /** - * Creates an instance of WorkbenchProperties class. - */ - public WorkbenchProperties() { - } - - /** - * Get the targetClusterId property: ARM resource ID of the parent cluster that hosts this workbench. - * - * @return the targetClusterId value. - */ - public String targetClusterId() { - return this.targetClusterId; - } - - /** - * Set the targetClusterId property: ARM resource ID of the parent cluster that hosts this workbench. - * - * @param targetClusterId the targetClusterId value to set. - * @return the WorkbenchProperties object itself. - */ - public WorkbenchProperties withTargetClusterId(String targetClusterId) { - this.targetClusterId = targetClusterId; - return this; - } - - /** - * Get the imageLink property: Container image URI (e.g., MCR or ACR image path) for the workbench. - * - * @return the imageLink value. - */ - public String imageLink() { - return this.imageLink; - } - - /** - * Set the imageLink property: Container image URI (e.g., MCR or ACR image path) for the workbench. - * - * @param imageLink the imageLink value to set. - * @return the WorkbenchProperties object itself. - */ - public WorkbenchProperties withImageLink(String imageLink) { - this.imageLink = imageLink; - return this; - } - - /** - * Get the idleTimeBeforeShutdown property: ISO 8601 duration before the idle workbench is automatically shut down - * (e.g., 'PT30M'). - * - * @return the idleTimeBeforeShutdown value. - */ - public String idleTimeBeforeShutdown() { - return this.idleTimeBeforeShutdown; - } - - /** - * Set the idleTimeBeforeShutdown property: ISO 8601 duration before the idle workbench is automatically shut down - * (e.g., 'PT30M'). - * - * @param idleTimeBeforeShutdown the idleTimeBeforeShutdown value to set. - * @return the WorkbenchProperties object itself. - */ - public WorkbenchProperties withIdleTimeBeforeShutdown(String idleTimeBeforeShutdown) { - this.idleTimeBeforeShutdown = idleTimeBeforeShutdown; - return this; - } - - /** - * Get the datasetId property: The dataset ID to mount for the workbench. - * - * @return the datasetId value. - */ - public String datasetId() { - return this.datasetId; - } - - /** - * Set the datasetId property: The dataset ID to mount for the workbench. - * - * @param datasetId the datasetId value to set. - * @return the WorkbenchProperties object itself. - */ - public WorkbenchProperties withDatasetId(String datasetId) { - this.datasetId = datasetId; - return this; - } - - /** - * Get the sshSettings property: SSH configuration for remote access to the workbench. - * - * @return the sshSettings value. - */ - public SshSettings sshSettings() { - return this.sshSettings; - } - - /** - * Set the sshSettings property: SSH configuration for remote access to the workbench. - * - * @param sshSettings the sshSettings value to set. - * @return the WorkbenchProperties object itself. - */ - public WorkbenchProperties withSshSettings(SshSettings sshSettings) { - this.sshSettings = sshSettings; - return this; - } - - /** - * Get the connectivityEndpoints property: Network connectivity endpoints assigned to the workbench. - * - * @return the connectivityEndpoints value. - */ - public ConnectivityEndpoints connectivityEndpoints() { - return this.connectivityEndpoints; - } - - /** - * Get the webEndpoint property: The web endpoint URL for accessing the workbench. - * - * @return the webEndpoint value. - */ - public String webEndpoint() { - return this.webEndpoint; - } - - /** - * Get the provisioningState property: Provisioning state of the workbench resource. - * - * @return the provisioningState value. - */ - public ComputeProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the errors property: Error details for the workbench resource. - * - * @return the errors value. - */ - public List errors() { - return this.errors; - } - - /** - * Get the creationTime property: Creation time of the workbench resource. - * - * @return the creationTime value. - */ - public OffsetDateTime creationTime() { - return this.creationTime; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("targetClusterId", this.targetClusterId); - jsonWriter.writeStringField("imageLink", this.imageLink); - jsonWriter.writeStringField("idleTimeBeforeShutdown", this.idleTimeBeforeShutdown); - jsonWriter.writeStringField("datasetId", this.datasetId); - jsonWriter.writeJsonField("sshSettings", this.sshSettings); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WorkbenchProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WorkbenchProperties 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 WorkbenchProperties. - */ - public static WorkbenchProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WorkbenchProperties deserializedWorkbenchProperties = new WorkbenchProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("targetClusterId".equals(fieldName)) { - deserializedWorkbenchProperties.targetClusterId = reader.getString(); - } else if ("imageLink".equals(fieldName)) { - deserializedWorkbenchProperties.imageLink = reader.getString(); - } else if ("idleTimeBeforeShutdown".equals(fieldName)) { - deserializedWorkbenchProperties.idleTimeBeforeShutdown = reader.getString(); - } else if ("datasetId".equals(fieldName)) { - deserializedWorkbenchProperties.datasetId = reader.getString(); - } else if ("sshSettings".equals(fieldName)) { - deserializedWorkbenchProperties.sshSettings = SshSettings.fromJson(reader); - } else if ("connectivityEndpoints".equals(fieldName)) { - deserializedWorkbenchProperties.connectivityEndpoints = ConnectivityEndpoints.fromJson(reader); - } else if ("webEndpoint".equals(fieldName)) { - deserializedWorkbenchProperties.webEndpoint = reader.getString(); - } else if ("provisioningState".equals(fieldName)) { - deserializedWorkbenchProperties.provisioningState - = ComputeProvisioningState.fromString(reader.getString()); - } else if ("errors".equals(fieldName)) { - List errors = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); - deserializedWorkbenchProperties.errors = errors; - } else if ("creationTime".equals(fieldName)) { - deserializedWorkbenchProperties.creationTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedWorkbenchProperties; - }); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Workbenches.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Workbenches.java deleted file mode 100644 index 4ca872bf9a71..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Workbenches.java +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.cognitiveservices.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 Workbenches. - */ -public interface Workbenches { - /** - * Gets the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @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 specified workbench associated with the project along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String accountName, String projectName, - String workbenchName, Context context); - - /** - * Gets the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 workbench associated with the project. - */ - Workbench get(String resourceGroupName, String accountName, String projectName, String workbenchName); - - /** - * Deletes the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String projectName, String workbenchName); - - /** - * Deletes the specified workbench associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @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 accountName, String projectName, String workbenchName, - Context context); - - /** - * Gets the workbenches associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the workbenches associated with the project as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, String projectName); - - /** - * Gets the workbenches associated with the project. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @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 workbenches associated with the project as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, String projectName, Context context); - - /** - * Starts a stopped workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String projectName, String workbenchName); - - /** - * Starts a stopped workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @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 accountName, String projectName, String workbenchName, Context context); - - /** - * Stops a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 accountName, String projectName, String workbenchName); - - /** - * Stops a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @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 stop(String resourceGroupName, String accountName, String projectName, String workbenchName, Context context); - - /** - * Restarts a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 restart(String resourceGroupName, String accountName, String projectName, String workbenchName); - - /** - * Restarts a running workbench resource. - * This is a long-running operation that returns 202 Accepted. - * Returns 204 if the workbench is already in the target state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param workbenchName The name of the workbench associated with the project. - * @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 restart(String resourceGroupName, String accountName, String projectName, String workbenchName, - Context context); - - /** - * Gets the specified workbench associated with the project. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified workbench associated with the project along with {@link Response}. - */ - Workbench getById(String id); - - /** - * Gets the specified workbench associated with the project. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified workbench associated with the project along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes the specified workbench associated with the project. - * - * @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 the specified workbench associated with the project. - * - * @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 Workbench resource. - * - * @param name resource name. - * @return the first stage of the new Workbench definition. - */ - Workbench.DefinitionStages.Blank define(String name); -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/package-info.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/package-info.java deleted file mode 100644 index 4ecc9d5e0083..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// 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 CognitiveServices. - * Cognitive Services Management Client. - */ -package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/package-info.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/package-info.java deleted file mode 100644 index 95b4c2115c10..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// 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 CognitiveServices. - * Cognitive Services Management Client. - */ -package com.azure.resourcemanager.cognitiveservices; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/module-info.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/module-info.java deleted file mode 100644 index 57a185485cea..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/module-info.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -module com.azure.resourcemanager.cognitiveservices { - requires transitive com.azure.core.management; - - exports com.azure.resourcemanager.cognitiveservices; - exports com.azure.resourcemanager.cognitiveservices.fluent; - exports com.azure.resourcemanager.cognitiveservices.fluent.models; - exports com.azure.resourcemanager.cognitiveservices.models; - - opens com.azure.resourcemanager.cognitiveservices.fluent.models to com.azure.core; - opens com.azure.resourcemanager.cognitiveservices.models to com.azure.core; - opens com.azure.resourcemanager.cognitiveservices.implementation.models to com.azure.core; -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cognitiveservices/proxy-config.json b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cognitiveservices/proxy-config.json deleted file mode 100644 index 7434ab0c14a8..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cognitiveservices/proxy-config.json +++ /dev/null @@ -1 +0,0 @@ -[["com.azure.resourcemanager.cognitiveservices.implementation.AccountCapabilityHostsClientImpl$AccountCapabilityHostsService"],["com.azure.resourcemanager.cognitiveservices.implementation.AccountConnectionsClientImpl$AccountConnectionsService"],["com.azure.resourcemanager.cognitiveservices.implementation.AccountsClientImpl$AccountsService"],["com.azure.resourcemanager.cognitiveservices.implementation.AgentApplicationsClientImpl$AgentApplicationsService"],["com.azure.resourcemanager.cognitiveservices.implementation.AgentDeploymentsClientImpl$AgentDeploymentsService"],["com.azure.resourcemanager.cognitiveservices.implementation.CommitmentPlansClientImpl$CommitmentPlansService"],["com.azure.resourcemanager.cognitiveservices.implementation.CommitmentTiersClientImpl$CommitmentTiersService"],["com.azure.resourcemanager.cognitiveservices.implementation.ComputeOperationsClientImpl$ComputeOperationsService"],["com.azure.resourcemanager.cognitiveservices.implementation.ComputesClientImpl$ComputesService"],["com.azure.resourcemanager.cognitiveservices.implementation.DefenderForAISettingsClientImpl$DefenderForAISettingsService"],["com.azure.resourcemanager.cognitiveservices.implementation.DeletedAccountsClientImpl$DeletedAccountsService"],["com.azure.resourcemanager.cognitiveservices.implementation.DeploymentsClientImpl$DeploymentsService"],["com.azure.resourcemanager.cognitiveservices.implementation.EncryptionScopesClientImpl$EncryptionScopesService"],["com.azure.resourcemanager.cognitiveservices.implementation.LocationBasedModelCapacitiesClientImpl$LocationBasedModelCapacitiesService"],["com.azure.resourcemanager.cognitiveservices.implementation.ManagedComputeCapacitiesClientImpl$ManagedComputeCapacitiesService"],["com.azure.resourcemanager.cognitiveservices.implementation.ManagedComputeDeploymentsClientImpl$ManagedComputeDeploymentsService"],["com.azure.resourcemanager.cognitiveservices.implementation.ManagedComputeUsagesOperationGroupsClientImpl$ManagedComputeUsagesOperationGroupsService"],["com.azure.resourcemanager.cognitiveservices.implementation.ManagedNetworkProvisionsClientImpl$ManagedNetworkProvisionsService"],["com.azure.resourcemanager.cognitiveservices.implementation.ManagedNetworkSettingsOperationsClientImpl$ManagedNetworkSettingsOperationsService"],["com.azure.resourcemanager.cognitiveservices.implementation.ModelCapacitiesClientImpl$ModelCapacitiesService"],["com.azure.resourcemanager.cognitiveservices.implementation.ModelsClientImpl$ModelsService"],["com.azure.resourcemanager.cognitiveservices.implementation.NetworkSecurityPerimeterConfigurationsClientImpl$NetworkSecurityPerimeterConfigurationsService"],["com.azure.resourcemanager.cognitiveservices.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.cognitiveservices.implementation.OutboundRulesClientImpl$OutboundRulesService"],["com.azure.resourcemanager.cognitiveservices.implementation.OutboundRulesOperationsClientImpl$OutboundRulesOperationsService"],["com.azure.resourcemanager.cognitiveservices.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.cognitiveservices.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.cognitiveservices.implementation.ProjectCapabilityHostsClientImpl$ProjectCapabilityHostsService"],["com.azure.resourcemanager.cognitiveservices.implementation.ProjectConnectionsClientImpl$ProjectConnectionsService"],["com.azure.resourcemanager.cognitiveservices.implementation.ProjectsClientImpl$ProjectsService"],["com.azure.resourcemanager.cognitiveservices.implementation.QuotaTiersClientImpl$QuotaTiersService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiBlocklistItemsClientImpl$RaiBlocklistItemsService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiBlocklistsClientImpl$RaiBlocklistsService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiContentFiltersClientImpl$RaiContentFiltersService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiExternalSafetyProvidersClientImpl$RaiExternalSafetyProvidersService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiExternalSafetyProvidersOperationsClientImpl$RaiExternalSafetyProvidersOperationsService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiPoliciesClientImpl$RaiPoliciesService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiToolLabelsClientImpl$RaiToolLabelsService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiTopicsClientImpl$RaiTopicsService"],["com.azure.resourcemanager.cognitiveservices.implementation.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.cognitiveservices.implementation.ResourceSkusClientImpl$ResourceSkusService"],["com.azure.resourcemanager.cognitiveservices.implementation.SubscriptionRaiPoliciesClientImpl$SubscriptionRaiPoliciesService"],["com.azure.resourcemanager.cognitiveservices.implementation.TestRaiExternalSafetyProvidersClientImpl$TestRaiExternalSafetyProvidersService"],["com.azure.resourcemanager.cognitiveservices.implementation.UsagesClientImpl$UsagesService"],["com.azure.resourcemanager.cognitiveservices.implementation.WorkbenchesClientImpl$WorkbenchesService"]] \ No newline at end of file diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cognitiveservices/reflect-config.json b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cognitiveservices/reflect-config.json deleted file mode 100644 index 0637a088a01e..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cognitiveservices/reflect-config.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/azure-resourcemanager-cognitiveservices.properties b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/azure-resourcemanager-cognitiveservices.properties deleted file mode 100644 index defbd48204e4..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/azure-resourcemanager-cognitiveservices.properties +++ /dev/null @@ -1 +0,0 @@ -version=${project.version} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClientBuilder.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClientBuilder.java index 3b2bc1ffc014..55b9ad29df8b 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClientBuilder.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationClientBuilder.java @@ -212,7 +212,7 @@ public JobRouterAdministrationClientBuilder endpoint(String endpoint) { * Service version */ @Generated - private JobRouterServiceVersion serviceVersion; + private JobRouterAdministrationServiceVersion serviceVersion; /* * The retry policy that will attempt to retry failed requests, if applicable. @@ -241,8 +241,8 @@ public JobRouterAdministrationClientBuilder retryPolicy(RetryPolicy retryPolicy) private JobRouterAdministrationClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - JobRouterServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : JobRouterServiceVersion.getLatest(); + JobRouterAdministrationServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : JobRouterAdministrationServiceVersion.getLatest(); JobRouterAdministrationClientImpl client = new JobRouterAdministrationClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; @@ -333,18 +333,6 @@ public JobRouterAdministrationClientBuilder credential(KeyCredential credential) return this; } - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the JobRouterAdministrationClientBuilder. - */ - @Generated - public JobRouterAdministrationClientBuilder serviceVersion(JobRouterServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - /** * Set a connection string for authorization. * @@ -379,4 +367,16 @@ private void validateClient() { @Generated private static final String[] DEFAULT_SCOPES = new String[] { "https://communication.azure.com/.default" }; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the JobRouterAdministrationClientBuilder. + */ + @Generated + public JobRouterAdministrationClientBuilder serviceVersion(JobRouterAdministrationServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } } diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationServiceVersion.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationServiceVersion.java new file mode 100644 index 000000000000..4fbe9e3faeda --- /dev/null +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/JobRouterAdministrationServiceVersion.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.communication.jobrouter; + +import com.azure.core.util.ServiceVersion; + +/** + * Service version of JobRouterAdministrationClient. + */ +public enum JobRouterAdministrationServiceVersion implements ServiceVersion { + /** + * Enum value 2023-11-01. + */ + V2023_11_01("2023-11-01"), + + /** + * Enum value 2024-01-18-preview. + */ + V2024_01_18_PREVIEW("2024-01-18-preview"); + + private final String version; + + JobRouterAdministrationServiceVersion(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 JobRouterAdministrationServiceVersion}. + */ + public static JobRouterAdministrationServiceVersion getLatest() { + return V2024_01_18_PREVIEW; + } +} diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java index 3a598fb5a4ec..530c15e40e9d 100644 --- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java +++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java @@ -4,7 +4,7 @@ package com.azure.communication.jobrouter.implementation; -import com.azure.communication.jobrouter.JobRouterServiceVersion; +import com.azure.communication.jobrouter.JobRouterAdministrationServiceVersion; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; @@ -71,14 +71,14 @@ public String getEndpoint() { /** * Service version. */ - private final JobRouterServiceVersion serviceVersion; + private final JobRouterAdministrationServiceVersion serviceVersion; /** * Gets Service version. * * @return the serviceVersion value. */ - public JobRouterServiceVersion getServiceVersion() { + public JobRouterAdministrationServiceVersion getServiceVersion() { return this.serviceVersion; } @@ -116,7 +116,7 @@ public SerializerAdapter getSerializerAdapter() { * @param endpoint Uri of your Communication resource. * @param serviceVersion Service version. */ - public JobRouterAdministrationClientImpl(String endpoint, JobRouterServiceVersion serviceVersion) { + public JobRouterAdministrationClientImpl(String endpoint, JobRouterAdministrationServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -129,7 +129,7 @@ public JobRouterAdministrationClientImpl(String endpoint, JobRouterServiceVersio * @param serviceVersion Service version. */ public JobRouterAdministrationClientImpl(HttpPipeline httpPipeline, String endpoint, - JobRouterServiceVersion serviceVersion) { + JobRouterAdministrationServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -142,7 +142,7 @@ public JobRouterAdministrationClientImpl(HttpPipeline httpPipeline, String endpo * @param serviceVersion Service version. */ public JobRouterAdministrationClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, JobRouterServiceVersion serviceVersion) { + String endpoint, JobRouterAdministrationServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessageTemplateClientBuilder.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessageTemplateClientBuilder.java index 31f5c45866ec..f037731fbd06 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessageTemplateClientBuilder.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessageTemplateClientBuilder.java @@ -241,19 +241,7 @@ public MessageTemplateClientBuilder endpoint(String endpoint) { * Service version */ @Generated - private MessagesServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the MessageTemplateClientBuilder. - */ - @Generated - public MessageTemplateClientBuilder serviceVersion(MessagesServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } + private MessageTemplateServiceVersion serviceVersion; /* * The retry policy that will attempt to retry failed requests, if applicable. @@ -282,8 +270,8 @@ public MessageTemplateClientBuilder retryPolicy(RetryPolicy retryPolicy) { private MessageTemplateClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - MessagesServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : MessagesServiceVersion.getLatest(); + MessageTemplateServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : MessageTemplateServiceVersion.getLatest(); MessageTemplateClientImpl client = new MessageTemplateClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; @@ -379,4 +367,16 @@ private HttpPipelinePolicy createHttpPipelineAuthPolicy() { } private static final ClientLogger LOGGER = new ClientLogger(MessageTemplateClientBuilder.class); + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the MessageTemplateClientBuilder. + */ + @Generated + public MessageTemplateClientBuilder serviceVersion(MessageTemplateServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } } diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessagesServiceVersion.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessageTemplateServiceVersion.java similarity index 74% rename from sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessagesServiceVersion.java rename to sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessageTemplateServiceVersion.java index 462bb0b33834..bacce7c8ddef 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessagesServiceVersion.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/MessageTemplateServiceVersion.java @@ -7,9 +7,9 @@ import com.azure.core.util.ServiceVersion; /** - * Service version of MessagesClient. + * Service version of MessageTemplateClient. */ -public enum MessagesServiceVersion implements ServiceVersion { +public enum MessageTemplateServiceVersion implements ServiceVersion { /** * Enum value 2024-02-01. */ @@ -27,7 +27,7 @@ public enum MessagesServiceVersion implements ServiceVersion { private final String version; - MessagesServiceVersion(String version) { + MessageTemplateServiceVersion(String version) { this.version = version; } @@ -42,9 +42,9 @@ public String getVersion() { /** * Gets the latest service version supported by this client library. * - * @return The latest {@link MessagesServiceVersion}. + * @return The latest {@link MessageTemplateServiceVersion}. */ - public static MessagesServiceVersion getLatest() { + public static MessageTemplateServiceVersion getLatest() { return V2025_01_15_PREVIEW; } } diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesClientBuilder.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesClientBuilder.java index af62f5409aa3..c235f4e41286 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesClientBuilder.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesClientBuilder.java @@ -241,19 +241,7 @@ public NotificationMessagesClientBuilder endpoint(String endpoint) { * Service version */ @Generated - private MessagesServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the NotificationMessagesClientBuilder. - */ - @Generated - public NotificationMessagesClientBuilder serviceVersion(MessagesServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } + private NotificationMessagesServiceVersion serviceVersion; /* * The retry policy that will attempt to retry failed requests, if applicable. @@ -282,8 +270,8 @@ public NotificationMessagesClientBuilder retryPolicy(RetryPolicy retryPolicy) { private NotificationMessagesClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - MessagesServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : MessagesServiceVersion.getLatest(); + NotificationMessagesServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : NotificationMessagesServiceVersion.getLatest(); NotificationMessagesClientImpl client = new NotificationMessagesClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; @@ -379,4 +367,16 @@ private HttpPipelinePolicy createHttpPipelineAuthPolicy() { } private static final ClientLogger LOGGER = new ClientLogger(NotificationMessagesClientBuilder.class); + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the NotificationMessagesClientBuilder. + */ + @Generated + public NotificationMessagesClientBuilder serviceVersion(NotificationMessagesServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } } diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesServiceVersion.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesServiceVersion.java new file mode 100644 index 000000000000..08c923d44b52 --- /dev/null +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/NotificationMessagesServiceVersion.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.communication.messages; + +import com.azure.core.util.ServiceVersion; + +/** + * Service version of NotificationMessagesClient. + */ +public enum NotificationMessagesServiceVersion implements ServiceVersion { + /** + * Enum value 2024-02-01. + */ + V2024_02_01("2024-02-01"), + + /** + * Enum value 2024-08-30. + */ + V2024_08_30("2024-08-30"), + + /** + * Enum value 2025-01-15-preview. + */ + V2025_01_15_PREVIEW("2025-01-15-preview"); + + private final String version; + + NotificationMessagesServiceVersion(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 NotificationMessagesServiceVersion}. + */ + public static NotificationMessagesServiceVersion getLatest() { + return V2025_01_15_PREVIEW; + } +} diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/MessageTemplateClientImpl.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/MessageTemplateClientImpl.java index a05f5928fdac..77620a4c5f5c 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/MessageTemplateClientImpl.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/MessageTemplateClientImpl.java @@ -4,7 +4,7 @@ package com.azure.communication.messages.implementation; -import com.azure.communication.messages.MessagesServiceVersion; +import com.azure.communication.messages.MessageTemplateServiceVersion; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; @@ -68,14 +68,14 @@ public String getEndpoint() { /** * Service version. */ - private final MessagesServiceVersion serviceVersion; + private final MessageTemplateServiceVersion serviceVersion; /** * Gets Service version. * * @return the serviceVersion value. */ - public MessagesServiceVersion getServiceVersion() { + public MessageTemplateServiceVersion getServiceVersion() { return this.serviceVersion; } @@ -113,7 +113,7 @@ public SerializerAdapter getSerializerAdapter() { * @param endpoint The communication resource, for example https://my-resource.communication.azure.com. * @param serviceVersion Service version. */ - public MessageTemplateClientImpl(String endpoint, MessagesServiceVersion serviceVersion) { + public MessageTemplateClientImpl(String endpoint, MessageTemplateServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -126,7 +126,7 @@ public MessageTemplateClientImpl(String endpoint, MessagesServiceVersion service * @param serviceVersion Service version. */ public MessageTemplateClientImpl(HttpPipeline httpPipeline, String endpoint, - MessagesServiceVersion serviceVersion) { + MessageTemplateServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -139,7 +139,7 @@ public MessageTemplateClientImpl(HttpPipeline httpPipeline, String endpoint, * @param serviceVersion Service version. */ public MessageTemplateClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - MessagesServiceVersion serviceVersion) { + MessageTemplateServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; diff --git a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/NotificationMessagesClientImpl.java b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/NotificationMessagesClientImpl.java index 152420a68ace..1ac053fb0a6e 100644 --- a/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/NotificationMessagesClientImpl.java +++ b/sdk/communication/azure-communication-messages/src/main/java/com/azure/communication/messages/implementation/NotificationMessagesClientImpl.java @@ -4,7 +4,7 @@ package com.azure.communication.messages.implementation; -import com.azure.communication.messages.MessagesServiceVersion; +import com.azure.communication.messages.NotificationMessagesServiceVersion; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; @@ -66,14 +66,14 @@ public String getEndpoint() { /** * Service version. */ - private final MessagesServiceVersion serviceVersion; + private final NotificationMessagesServiceVersion serviceVersion; /** * Gets Service version. * * @return the serviceVersion value. */ - public MessagesServiceVersion getServiceVersion() { + public NotificationMessagesServiceVersion getServiceVersion() { return this.serviceVersion; } @@ -111,7 +111,7 @@ public SerializerAdapter getSerializerAdapter() { * @param endpoint The communication resource, for example https://my-resource.communication.azure.com. * @param serviceVersion Service version. */ - public NotificationMessagesClientImpl(String endpoint, MessagesServiceVersion serviceVersion) { + public NotificationMessagesClientImpl(String endpoint, NotificationMessagesServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -124,7 +124,7 @@ public NotificationMessagesClientImpl(String endpoint, MessagesServiceVersion se * @param serviceVersion Service version. */ public NotificationMessagesClientImpl(HttpPipeline httpPipeline, String endpoint, - MessagesServiceVersion serviceVersion) { + NotificationMessagesServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -137,7 +137,7 @@ public NotificationMessagesClientImpl(HttpPipeline httpPipeline, String endpoint * @param serviceVersion Service version. */ public NotificationMessagesClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, MessagesServiceVersion serviceVersion) { + String endpoint, NotificationMessagesServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; diff --git a/sdk/compute/azure-resourcemanager-compute/src/samples/java/com/azure/resourcemanager/compute/generated/UsageListSamples.java b/sdk/compute/azure-resourcemanager-compute/src/samples/java/com/azure/resourcemanager/compute/generated/UsageListSamples.java index f6fba57eb03c..458bddd5bcf5 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/samples/java/com/azure/resourcemanager/compute/generated/UsageListSamples.java +++ b/sdk/compute/azure-resourcemanager-compute/src/samples/java/com/azure/resourcemanager/compute/generated/UsageListSamples.java @@ -29,6 +29,6 @@ public static void usageListMinimumSetGen(com.azure.resourcemanager.compute.Comp * @param manager Entry point to ComputeManager. */ public static void usageListMaximumSetGen(com.azure.resourcemanager.compute.ComputeManager manager) { - manager.serviceClient().getUsages().list("4.0", com.azure.core.util.Context.NONE); + manager.serviceClient().getUsages().list("4_.", com.azure.core.util.Context.NONE); } } diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMCategory.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMCategory.java index 712db453e194..c3d97aa34fbe 100644 --- a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMCategory.java +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMCategory.java @@ -32,20 +32,23 @@ public final class VMCategory extends ExpandableStringEnum { public static final VMCategory MEMORY_OPTIMIZED = fromString("MemoryOptimized"); /** - * Storage optimized virtual machine (VM) sizes offer high disk throughput and IO, and are ideal for Big Data, SQL, - * NoSQL databases, data warehousing, and large transactional databases. + * Storage optimized virtual machine (VM) + * sizes offer high disk throughput and IO, and are ideal for Big Data, SQL, NoSQL databases, data warehousing, and + * large transactional databases. * Examples include Cassandra, MongoDB, Cloudera, and Redis. */ public static final VMCategory STORAGE_OPTIMIZED = fromString("StorageOptimized"); /** - * GPU optimized VM sizes are specialized virtual machines available with single, multiple, or fractional GPUs. + * GPU optimized VM sizes are specialized + * virtual machines available with single, multiple, or fractional GPUs. * These sizes are designed for compute-intensive, graphics-intensive, and visualization workloads. */ public static final VMCategory GPU_ACCELERATED = fromString("GpuAccelerated"); /** - * FPGA optimized VM sizes are specialized virtual machines available with single or multiple FPGA. + * FPGA optimized VM sizes are specialized + * virtual machines available with single or multiple FPGA. * These sizes are designed for compute-intensive workloads. This article provides information about the number and * type of FPGA, vCPUs, data disks, and NICs. * Storage throughput and network bandwidth are also included for each size in this grouping. @@ -53,8 +56,9 @@ public final class VMCategory extends ExpandableStringEnum { public static final VMCategory FPGA_ACCELERATED = fromString("FpgaAccelerated"); /** - * Azure High Performance Compute VMs are optimized for various HPC workloads such as computational fluid dynamics, - * finite element analysis, frontend and backend EDA, + * Azure High Performance Compute VMs are + * optimized for various HPC workloads such as computational fluid dynamics, finite element analysis, frontend and + * backend EDA, * rendering, molecular dynamics, computational geo science, weather simulation, and financial risk analysis. */ public static final VMCategory HIGH_PERFORMANCE_COMPUTE = fromString("HighPerformanceCompute"); diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZoneDistributionStrategy.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZoneDistributionStrategy.java index 4c866d47a0a7..7b8e53305776 100644 --- a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZoneDistributionStrategy.java +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZoneDistributionStrategy.java @@ -12,19 +12,22 @@ */ public final class ZoneDistributionStrategy extends ExpandableStringEnum { /** - * Default. Launch instances in a single zone based on best effort. + * Default. Launch instances in a single zone + * based on best effort. * If capacity is not available, LaunchBulkInstancesOperation can allocate capacity in different zones. */ public static final ZoneDistributionStrategy BEST_EFFORT_SINGLE_ZONE = fromString("BestEffortSingleZone"); /** - * Launch instances based on zone preferences. + * Launch instances based on zone + * preferences. * Higher priority zones are filled first before allocating to lower priority zones. */ public static final ZoneDistributionStrategy PRIORITIZED = fromString("Prioritized"); /** - * Balance launching instances across zones specified based on best effort. + * Balance launching instances across zones + * specified based on best effort. * If capacity is not available, LaunchBulkInstancesOperation can deviate balancing across all zones. */ public static final ZoneDistributionStrategy BEST_EFFORT_BALANCED = fromString("BestEffortBalanced"); diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZonePreference.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZonePreference.java index a80bddcce40a..c7490da34257 100644 --- a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZonePreference.java +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZonePreference.java @@ -22,7 +22,8 @@ public final class ZonePreference implements JsonSerializable { private String zone; /* - * The rank of the zone. This is used with 'Prioritized' ZoneDistributionStrategy. + * The rank of the zone. This is used with + * 'Prioritized' ZoneDistributionStrategy. * The lower the number, the higher the priority, starting with 0. * 0 is the highest rank. If not specified, defaults to lowest rank. */ @@ -55,7 +56,8 @@ public ZonePreference withZone(String zone) { } /** - * Get the rank property: The rank of the zone. This is used with 'Prioritized' ZoneDistributionStrategy. + * Get the rank property: The rank of the zone. This is used with + * 'Prioritized' ZoneDistributionStrategy. * The lower the number, the higher the priority, starting with 0. * 0 is the highest rank. If not specified, defaults to lowest rank. * @@ -66,7 +68,8 @@ public Integer rank() { } /** - * Set the rank property: The rank of the zone. This is used with 'Prioritized' ZoneDistributionStrategy. + * Set the rank property: The rank of the zone. This is used with + * 'Prioritized' ZoneDistributionStrategy. * The lower the number, the higher the priority, starting with 0. * 0 is the highest rank. If not specified, defaults to lowest rank. * diff --git a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/AdditionalUnattendContent.java b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/AdditionalUnattendContent.java index 952b28f17a3f..34bdfc5e0a2a 100644 --- a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/AdditionalUnattendContent.java +++ b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/AdditionalUnattendContent.java @@ -30,12 +30,14 @@ public final class AdditionalUnattendContent implements JsonSerializable { /* + * * Specifies the reboot setting for all AutomaticByPlatform patch installation * operations. */ @@ -36,7 +37,8 @@ public LinuxVMGuestPatchAutomaticByPlatformSettings() { } /** - * Get the rebootSetting property: Specifies the reboot setting for all AutomaticByPlatform patch installation + * Get the rebootSetting property: + * Specifies the reboot setting for all AutomaticByPlatform patch installation * operations. * * @return the rebootSetting value. @@ -46,7 +48,8 @@ public LinuxVMGuestPatchAutomaticByPlatformRebootSetting rebootSetting() { } /** - * Set the rebootSetting property: Specifies the reboot setting for all AutomaticByPlatform patch installation + * Set the rebootSetting property: + * Specifies the reboot setting for all AutomaticByPlatform patch installation * operations. * * @param rebootSetting the rebootSetting value to set. diff --git a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VMDiskSecurityProfile.java b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VMDiskSecurityProfile.java index 217264e20639..f5b01bd349ba 100644 --- a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VMDiskSecurityProfile.java +++ b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VMDiskSecurityProfile.java @@ -18,6 +18,7 @@ @Fluent public final class VMDiskSecurityProfile implements JsonSerializable { /* + * * Specifies the EncryptionType of the managed disk. It is set to * DiskWithVMGuestState for encryption of the managed disk along with VMGuestState * blob, VMGuestStateOnly for encryption of just the VMGuestState blob, and @@ -27,6 +28,7 @@ public final class VMDiskSecurityProfile implements JsonSerializable { /* + * * If a value is provided and is different from the previous value, the extension * handler will be forced to update even if the extension configuration has not * changed. @@ -43,6 +44,7 @@ public final class VirtualMachineScaleSetExtensionProperties private String typeHandlerVersion; /* + * * Indicates whether the extension should use a newer minor version if one is * available at deployment time. Once deployed, however, the extension will not * upgrade minor versions unless redeployed, even with this property set to true. @@ -50,6 +52,7 @@ public final class VirtualMachineScaleSetExtensionProperties private Boolean autoUpgradeMinorVersion; /* + * * Indicates whether the extension should be automatically upgraded by the * platform if there is a newer version of the extension available. */ @@ -72,12 +75,14 @@ public final class VirtualMachineScaleSetExtensionProperties private String provisioningState; /* + * * Collection of extension names after which this extension needs to be * provisioned. */ private List provisionAfterExtensions; /* + * * Indicates whether failures stemming from the extension will be suppressed * (Operational failures such as not connecting to the VM will not be suppressed * regardless of this value). The default is false. @@ -85,6 +90,7 @@ public final class VirtualMachineScaleSetExtensionProperties private Boolean suppressFailures; /* + * * The extensions protected settings that are passed by reference, and consumed * from key vault */ @@ -97,7 +103,8 @@ public VirtualMachineScaleSetExtensionProperties() { } /** - * Get the forceUpdateTag property: If a value is provided and is different from the previous value, the extension + * Get the forceUpdateTag property: + * If a value is provided and is different from the previous value, the extension * handler will be forced to update even if the extension configuration has not * changed. * @@ -108,7 +115,8 @@ public String forceUpdateTag() { } /** - * Set the forceUpdateTag property: If a value is provided and is different from the previous value, the extension + * Set the forceUpdateTag property: + * If a value is provided and is different from the previous value, the extension * handler will be forced to update even if the extension configuration has not * changed. * @@ -181,8 +189,8 @@ public VirtualMachineScaleSetExtensionProperties withTypeHandlerVersion(String t } /** - * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is + * Get the autoUpgradeMinorVersion property: + * Indicates whether the extension should use a newer minor version if one is * available at deployment time. Once deployed, however, the extension will not * upgrade minor versions unless redeployed, even with this property set to true. * @@ -193,8 +201,8 @@ public Boolean autoUpgradeMinorVersion() { } /** - * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is + * Set the autoUpgradeMinorVersion property: + * Indicates whether the extension should use a newer minor version if one is * available at deployment time. Once deployed, however, the extension will not * upgrade minor versions unless redeployed, even with this property set to true. * @@ -207,7 +215,8 @@ public VirtualMachineScaleSetExtensionProperties withAutoUpgradeMinorVersion(Boo } /** - * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * Get the enableAutomaticUpgrade property: + * Indicates whether the extension should be automatically upgraded by the * platform if there is a newer version of the extension available. * * @return the enableAutomaticUpgrade value. @@ -217,7 +226,8 @@ public Boolean enableAutomaticUpgrade() { } /** - * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * Set the enableAutomaticUpgrade property: + * Indicates whether the extension should be automatically upgraded by the * platform if there is a newer version of the extension available. * * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. @@ -280,7 +290,8 @@ public String provisioningState() { } /** - * Get the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * Get the provisionAfterExtensions property: + * Collection of extension names after which this extension needs to be * provisioned. * * @return the provisionAfterExtensions value. @@ -290,7 +301,8 @@ public List provisionAfterExtensions() { } /** - * Set the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * Set the provisionAfterExtensions property: + * Collection of extension names after which this extension needs to be * provisioned. * * @param provisionAfterExtensions the provisionAfterExtensions value to set. @@ -303,7 +315,8 @@ public List provisionAfterExtensions() { } /** - * Get the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * Get the suppressFailures property: + * Indicates whether failures stemming from the extension will be suppressed * (Operational failures such as not connecting to the VM will not be suppressed * regardless of this value). The default is false. * @@ -314,7 +327,8 @@ public Boolean suppressFailures() { } /** - * Set the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * Set the suppressFailures property: + * Indicates whether failures stemming from the extension will be suppressed * (Operational failures such as not connecting to the VM will not be suppressed * regardless of this value). The default is false. * @@ -327,8 +341,8 @@ public VirtualMachineScaleSetExtensionProperties withSuppressFailures(Boolean su } /** - * Get the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, - * and consumed + * Get the protectedSettingsFromKeyVault property: + * The extensions protected settings that are passed by reference, and consumed * from key vault. * * @return the protectedSettingsFromKeyVault value. @@ -338,8 +352,8 @@ public KeyVaultSecretReference protectedSettingsFromKeyVault() { } /** - * Set the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, - * and consumed + * Set the protectedSettingsFromKeyVault property: + * The extensions protected settings that are passed by reference, and consumed * from key vault. * * @param protectedSettingsFromKeyVault the protectedSettingsFromKeyVault value to set. diff --git a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VirtualMachineScaleSetIPConfiguration.java b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VirtualMachineScaleSetIPConfiguration.java index a8c460630ccb..5885a824aaf7 100644 --- a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VirtualMachineScaleSetIPConfiguration.java +++ b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VirtualMachineScaleSetIPConfiguration.java @@ -23,6 +23,7 @@ public final class VirtualMachineScaleSetIPConfiguration private String name; /* + * * Describes a virtual machine scale set network profile's IP configuration * properties. */ @@ -55,7 +56,8 @@ public VirtualMachineScaleSetIPConfiguration withName(String name) { } /** - * Get the properties property: Describes a virtual machine scale set network profile's IP configuration + * Get the properties property: + * Describes a virtual machine scale set network profile's IP configuration * properties. * * @return the properties value. @@ -65,7 +67,8 @@ public VirtualMachineScaleSetIPConfigurationProperties properties() { } /** - * Set the properties property: Describes a virtual machine scale set network profile's IP configuration + * Set the properties property: + * Describes a virtual machine scale set network profile's IP configuration * properties. * * @param properties the properties value to set. diff --git a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VirtualMachineScaleSetNetworkConfigurationProperties.java b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VirtualMachineScaleSetNetworkConfigurationProperties.java index facaa2b175cd..2b3d5b563416 100644 --- a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VirtualMachineScaleSetNetworkConfigurationProperties.java +++ b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VirtualMachineScaleSetNetworkConfigurationProperties.java @@ -20,6 +20,7 @@ public final class VirtualMachineScaleSetNetworkConfigurationProperties implements JsonSerializable { /* + * * Specifies the primary network interface in case the virtual machine has more * than 1 network interface. */ @@ -66,12 +67,14 @@ public final class VirtualMachineScaleSetNetworkConfigurationProperties private DeleteOptions deleteOption; /* + * * Specifies whether the Auxiliary mode is enabled for the Network Interface * resource. */ private NetworkInterfaceAuxiliaryMode auxiliaryMode; /* + * * Specifies whether the Auxiliary sku is enabled for the Network Interface * resource. */ @@ -84,7 +87,8 @@ public VirtualMachineScaleSetNetworkConfigurationProperties() { } /** - * Get the primary property: Specifies the primary network interface in case the virtual machine has more + * Get the primary property: + * Specifies the primary network interface in case the virtual machine has more * than 1 network interface. * * @return the primary value. @@ -94,7 +98,8 @@ public Boolean primary() { } /** - * Set the primary property: Specifies the primary network interface in case the virtual machine has more + * Set the primary property: + * Specifies the primary network interface in case the virtual machine has more * than 1 network interface. * * @param primary the primary value to set. @@ -275,7 +280,8 @@ public VirtualMachineScaleSetNetworkConfigurationProperties withDeleteOption(Del } /** - * Get the auxiliaryMode property: Specifies whether the Auxiliary mode is enabled for the Network Interface + * Get the auxiliaryMode property: + * Specifies whether the Auxiliary mode is enabled for the Network Interface * resource. * * @return the auxiliaryMode value. @@ -285,7 +291,8 @@ public NetworkInterfaceAuxiliaryMode auxiliaryMode() { } /** - * Set the auxiliaryMode property: Specifies whether the Auxiliary mode is enabled for the Network Interface + * Set the auxiliaryMode property: + * Specifies whether the Auxiliary mode is enabled for the Network Interface * resource. * * @param auxiliaryMode the auxiliaryMode value to set. @@ -298,7 +305,8 @@ public NetworkInterfaceAuxiliaryMode auxiliaryMode() { } /** - * Get the auxiliarySku property: Specifies whether the Auxiliary sku is enabled for the Network Interface + * Get the auxiliarySku property: + * Specifies whether the Auxiliary sku is enabled for the Network Interface * resource. * * @return the auxiliarySku value. @@ -308,7 +316,8 @@ public NetworkInterfaceAuxiliarySku auxiliarySku() { } /** - * Set the auxiliarySku property: Specifies whether the Auxiliary sku is enabled for the Network Interface + * Set the auxiliarySku property: + * Specifies whether the Auxiliary sku is enabled for the Network Interface * resource. * * @param auxiliarySku the auxiliarySku value to set. diff --git a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/WinRMListener.java b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/WinRMListener.java index 2ec4b204943c..33376ece79a8 100644 --- a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/WinRMListener.java +++ b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/WinRMListener.java @@ -17,6 +17,7 @@ @Fluent public final class WinRMListener implements JsonSerializable { /* + * * Specifies the protocol of WinRM listener. Possible values are: **http,** * **https.** */ @@ -46,7 +47,8 @@ public WinRMListener() { } /** - * Get the protocol property: Specifies the protocol of WinRM listener. Possible values are: **http,** + * Get the protocol property: + * Specifies the protocol of WinRM listener. Possible values are: **http,** * **https.**. * * @return the protocol value. @@ -56,7 +58,8 @@ public ProtocolTypes protocol() { } /** - * Set the protocol property: Specifies the protocol of WinRM listener. Possible values are: **http,** + * Set the protocol property: + * Specifies the protocol of WinRM listener. Possible values are: **http,** * **https.**. * * @param protocol the protocol value to set. diff --git a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/WindowsVMGuestPatchAutomaticByPlatformSettings.java b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/WindowsVMGuestPatchAutomaticByPlatformSettings.java index b5448d09efa5..94c246fd8868 100644 --- a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/WindowsVMGuestPatchAutomaticByPlatformSettings.java +++ b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/WindowsVMGuestPatchAutomaticByPlatformSettings.java @@ -19,6 +19,7 @@ public final class WindowsVMGuestPatchAutomaticByPlatformSettings implements JsonSerializable { /* + * * Specifies the reboot setting for all AutomaticByPlatform patch installation * operations. */ @@ -36,7 +37,8 @@ public WindowsVMGuestPatchAutomaticByPlatformSettings() { } /** - * Get the rebootSetting property: Specifies the reboot setting for all AutomaticByPlatform patch installation + * Get the rebootSetting property: + * Specifies the reboot setting for all AutomaticByPlatform patch installation * operations. * * @return the rebootSetting value. @@ -46,7 +48,8 @@ public WindowsVMGuestPatchAutomaticByPlatformRebootSetting rebootSetting() { } /** - * Set the rebootSetting property: Specifies the reboot setting for all AutomaticByPlatform patch installation + * Set the rebootSetting property: + * Specifies the reboot setting for all AutomaticByPlatform patch installation * operations. * * @param rebootSetting the rebootSetting value to set. diff --git a/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/fluent/OccurrencesClient.java b/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/fluent/OccurrencesClient.java index 85bc96cb4cd8..6d67f9552194 100644 --- a/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/fluent/OccurrencesClient.java +++ b/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/fluent/OccurrencesClient.java @@ -145,7 +145,7 @@ RecurringActionsResourceOperationResultInner cancel(String resourceGroupName, St String occurrenceId, CancelOccurrenceRequest body); /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -162,7 +162,7 @@ RecurringActionsResourceOperationResultInner cancel(String resourceGroupName, St beginDelay(String resourceGroupName, String scheduledActionName, String occurrenceId, DelayRequest body); /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -181,7 +181,7 @@ RecurringActionsResourceOperationResultInner cancel(String resourceGroupName, St Context context); /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -197,7 +197,7 @@ RecurringActionsResourceOperationResultInner delay(String resourceGroupName, Str String occurrenceId, DelayRequest body); /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. diff --git a/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/implementation/OccurrencesClientImpl.java b/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/implementation/OccurrencesClientImpl.java index d41e2d6bcf30..cb17285751ea 100644 --- a/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/implementation/OccurrencesClientImpl.java +++ b/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/implementation/OccurrencesClientImpl.java @@ -616,7 +616,7 @@ public RecurringActionsResourceOperationResultInner cancel(String resourceGroupN } /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -641,7 +641,7 @@ private Mono>> delayWithResponseAsync(String resourceG } /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -664,7 +664,7 @@ private Response delayWithResponse(String resourceGroupName, String } /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -688,7 +688,7 @@ private Response delayWithResponse(String resourceGroupName, String } /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -713,7 +713,7 @@ private Response delayWithResponse(String resourceGroupName, String } /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -737,7 +737,7 @@ private Response delayWithResponse(String resourceGroupName, String } /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -764,7 +764,7 @@ private Response delayWithResponse(String resourceGroupName, String } /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -784,7 +784,7 @@ private Mono delayAsync(String res } /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -802,7 +802,7 @@ public RecurringActionsResourceOperationResultInner delay(String resourceGroupNa } /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. diff --git a/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/models/Occurrences.java b/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/models/Occurrences.java index 2332a6280725..876a25d1ef45 100644 --- a/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/models/Occurrences.java +++ b/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/models/Occurrences.java @@ -128,7 +128,7 @@ RecurringActionsResourceOperationResult cancel(String resourceGroupName, String String occurrenceId, CancelOccurrenceRequest body); /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -143,7 +143,7 @@ RecurringActionsResourceOperationResult delay(String resourceGroupName, String s String occurrenceId, DelayRequest body); /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-tasks/src/main/java/com/azure/resourcemanager/containerregistry/tasks/models/CustomRegistryCredentials.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-tasks/src/main/java/com/azure/resourcemanager/containerregistry/tasks/models/CustomRegistryCredentials.java index d248bfb6d1bd..628306d3f5df 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry-tasks/src/main/java/com/azure/resourcemanager/containerregistry/tasks/models/CustomRegistryCredentials.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-tasks/src/main/java/com/azure/resourcemanager/containerregistry/tasks/models/CustomRegistryCredentials.java @@ -22,6 +22,7 @@ public final class CustomRegistryCredentials implements JsonSerializable arguments() { } /** - * Set the arguments property: Gets or sets the collection of override arguments to be used when + * Set the arguments property: + * Gets or sets the collection of override arguments to be used when * executing a build step. * * @param arguments the arguments value to set. diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-tasks/src/main/java/com/azure/resourcemanager/containerregistry/tasks/models/SourceRegistryCredentials.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-tasks/src/main/java/com/azure/resourcemanager/containerregistry/tasks/models/SourceRegistryCredentials.java index 5f9cce4e1463..96d924c38fa4 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry-tasks/src/main/java/com/azure/resourcemanager/containerregistry/tasks/models/SourceRegistryCredentials.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-tasks/src/main/java/com/azure/resourcemanager/containerregistry/tasks/models/SourceRegistryCredentials.java @@ -17,6 +17,7 @@ @Fluent public final class SourceRegistryCredentials implements JsonSerializable { /* + * * The Entra identity used for source registry login. * The value is `[system]` for system-assigned managed identity, `[caller]` for caller identity, * and client ID for user-assigned managed identity. @@ -24,6 +25,7 @@ public final class SourceRegistryCredentials implements JsonSerializable { /* + * * Name of the group. * It must match a group name of an existing fleet member. */ private String name; /* + * * The max number of upgrades that can run concurrently in this specific group. * Acts as a ceiling (and not a quota) for the number of concurrent upgrades within the group you want to tolerate * at a time. @@ -59,7 +61,8 @@ public UpdateGroup() { } /** - * Get the name property: Name of the group. + * Get the name property: + * Name of the group. * It must match a group name of an existing fleet member. * * @return the name value. @@ -69,7 +72,8 @@ public String name() { } /** - * Set the name property: Name of the group. + * Set the name property: + * Name of the group. * It must match a group name of an existing fleet member. * * @param name the name value to set. @@ -81,7 +85,8 @@ public UpdateGroup withName(String name) { } /** - * Get the maxConcurrency property: The max number of upgrades that can run concurrently in this specific group. + * Get the maxConcurrency property: + * The max number of upgrades that can run concurrently in this specific group. * Acts as a ceiling (and not a quota) for the number of concurrent upgrades within the group you want to tolerate * at a time. * Actual concurrency may be lower depending on stage-level concurrency limits or individual member conditions. @@ -104,7 +109,8 @@ public String maxConcurrency() { } /** - * Set the maxConcurrency property: The max number of upgrades that can run concurrently in this specific group. + * Set the maxConcurrency property: + * The max number of upgrades that can run concurrently in this specific group. * Acts as a ceiling (and not a quota) for the number of concurrent upgrades within the group you want to tolerate * at a time. * Actual concurrency may be lower depending on stage-level concurrency limits or individual member conditions. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpgradeChannel.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpgradeChannel.java index b276c4efe4a3..7052c77ad23d 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpgradeChannel.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpgradeChannel.java @@ -12,8 +12,9 @@ */ public final class UpgradeChannel extends ExpandableStringEnum { /** - * Upgrades the clusters kubernetes version to the latest supported patch release on minor version N-1, where N is - * the latest supported minor version. + * Upgrades the clusters kubernetes + * version to the latest supported patch release on minor version N-1, where N is the latest supported minor + * version. * For example, if a cluster runs version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, the * cluster upgrades to 1.18.6. */ @@ -31,8 +32,8 @@ public final class UpgradeChannel extends ExpandableStringEnum { public static final UpgradeChannel NODE_IMAGE = fromString("NodeImage"); /** - * Upgrades the clusters Kubernetes version to the latest supported patch version of the specified target Kubernetes - * version. + * Upgrades the clusters Kubernetes + * version to the latest supported patch version of the specified target Kubernetes version. * For information on the behavior of update run for Kubernetes version upgrade, * see https://learn.microsoft.com/en-us/azure/kubernetes-fleet/update-orchestration?tabs=azure-portal. */ diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistClientBuilder.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistClientBuilder.java index 18779dca9c84..5a587bc06486 100644 --- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistClientBuilder.java +++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistClientBuilder.java @@ -235,19 +235,7 @@ public BlocklistClientBuilder endpoint(String endpoint) { * Service version */ @Generated - private ContentSafetyServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the BlocklistClientBuilder. - */ - @Generated - public BlocklistClientBuilder serviceVersion(ContentSafetyServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } + private BlocklistServiceVersion serviceVersion; /* * The retry policy that will attempt to retry failed requests, if applicable. @@ -276,8 +264,8 @@ public BlocklistClientBuilder retryPolicy(RetryPolicy retryPolicy) { private BlocklistClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - ContentSafetyServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : ContentSafetyServiceVersion.getLatest(); + BlocklistServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : BlocklistServiceVersion.getLatest(); BlocklistClientImpl client = new BlocklistClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; @@ -352,4 +340,16 @@ private void validateClient() { // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the BlocklistClientBuilder. + */ + @Generated + public BlocklistClientBuilder serviceVersion(BlocklistServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } } diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistServiceVersion.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistServiceVersion.java new file mode 100644 index 000000000000..6058470a6d0f --- /dev/null +++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/BlocklistServiceVersion.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.contentsafety; + +import com.azure.core.util.ServiceVersion; + +/** + * Service version of BlocklistClient. + */ +public enum BlocklistServiceVersion implements ServiceVersion { + /** + * Enum value 2023-10-01. + */ + V2023_10_01("2023-10-01"); + + private final String version; + + BlocklistServiceVersion(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 BlocklistServiceVersion}. + */ + public static BlocklistServiceVersion getLatest() { + return V2023_10_01; + } +} diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/BlocklistClientImpl.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/BlocklistClientImpl.java index 727d27c55475..c61d48281269 100644 --- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/BlocklistClientImpl.java +++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/BlocklistClientImpl.java @@ -4,7 +4,7 @@ package com.azure.ai.contentsafety.implementation; -import com.azure.ai.contentsafety.ContentSafetyServiceVersion; +import com.azure.ai.contentsafety.BlocklistServiceVersion; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; @@ -74,14 +74,14 @@ public String getEndpoint() { /** * Service version. */ - private final ContentSafetyServiceVersion serviceVersion; + private final BlocklistServiceVersion serviceVersion; /** * Gets Service version. * * @return the serviceVersion value. */ - public ContentSafetyServiceVersion getServiceVersion() { + public BlocklistServiceVersion getServiceVersion() { return this.serviceVersion; } @@ -120,7 +120,7 @@ public SerializerAdapter getSerializerAdapter() { * https://<resource-name>.cognitiveservices.azure.com). * @param serviceVersion Service version. */ - public BlocklistClientImpl(String endpoint, ContentSafetyServiceVersion serviceVersion) { + public BlocklistClientImpl(String endpoint, BlocklistServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -133,7 +133,7 @@ public BlocklistClientImpl(String endpoint, ContentSafetyServiceVersion serviceV * https://<resource-name>.cognitiveservices.azure.com). * @param serviceVersion Service version. */ - public BlocklistClientImpl(HttpPipeline httpPipeline, String endpoint, ContentSafetyServiceVersion serviceVersion) { + public BlocklistClientImpl(HttpPipeline httpPipeline, String endpoint, BlocklistServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -147,7 +147,7 @@ public BlocklistClientImpl(HttpPipeline httpPipeline, String endpoint, ContentSa * @param serviceVersion Service version. */ public BlocklistClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - ContentSafetyServiceVersion serviceVersion) { + BlocklistServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; diff --git a/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingAsyncClient.java b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingAsyncClient.java index a777b0a32bc3..6d0d131693db 100644 --- a/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingAsyncClient.java +++ b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingAsyncClient.java @@ -1535,7 +1535,8 @@ public Mono> updateDefaultsWithResponse(BinaryData updateDe * * @param analyzerId The unique identifier of the analyzer. * @param inputs Inputs to analyze. Currently, only pro mode supports multiple inputs. - * @param stringEncoding The string encoding format for content spans in the response. + * @param stringEncoding The string encoding format for content spans in + * the response. * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`."). * @param modelDeployments Specify the default mapping of model names to LLM/embedding deployments in Microsoft * Foundry. For details and current semantics, see https://aka.ms/cudoc-quickstart-rest. @@ -1569,7 +1570,8 @@ PollerFlux beginAnalyze(S * * @param analyzerId The unique identifier of the analyzer. * @param inputs Inputs to analyze. Currently, only pro mode supports multiple inputs. - * @param stringEncoding The string encoding format for content spans in the response. + * @param stringEncoding The string encoding format for content spans in + * the response. * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`."). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1596,7 +1598,8 @@ PollerFlux beginAnalyze(S * * @param analyzerId The unique identifier of the analyzer. * @param binaryInput The binary content of the document to analyze. - * @param stringEncoding The string encoding format for content spans in the response. + * @param stringEncoding The string encoding format for content spans in + * the response. * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`."). * @param contentType Request content type. * @param contentRange Range of the input to analyze (ex. `1-3,5,9-`). Document content uses 1-based page numbers, @@ -1632,7 +1635,8 @@ PollerFlux beginAnalyzeBi * * @param analyzerId The unique identifier of the analyzer. * @param binaryInput The binary content of the document to analyze. - * @param stringEncoding The string encoding format for content spans in the response. + * @param stringEncoding The string encoding format for content spans in + * the response. * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`."). * @param contentType Request content type. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingClient.java b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingClient.java index b68689cdf78b..8d571c97eda9 100644 --- a/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingClient.java +++ b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingClient.java @@ -1523,7 +1523,8 @@ public Response updateDefaultsWithResponse(BinaryData updateDefaults * * @param analyzerId The unique identifier of the analyzer. * @param inputs Inputs to analyze. Currently, only pro mode supports multiple inputs. - * @param stringEncoding The string encoding format for content spans in the response. + * @param stringEncoding The string encoding format for content spans in + * the response. * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`."). * @param modelDeployments Specify the default mapping of model names to LLM/embedding deployments in Microsoft * Foundry. For details and current semantics, see https://aka.ms/cudoc-quickstart-rest. @@ -1557,7 +1558,8 @@ SyncPoller beginAnalyze(S * * @param analyzerId The unique identifier of the analyzer. * @param inputs Inputs to analyze. Currently, only pro mode supports multiple inputs. - * @param stringEncoding The string encoding format for content spans in the response. + * @param stringEncoding The string encoding format for content spans in + * the response. * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`."). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1584,7 +1586,8 @@ SyncPoller beginAnalyze(S * * @param analyzerId The unique identifier of the analyzer. * @param binaryInput The binary content of the document to analyze. - * @param stringEncoding The string encoding format for content spans in the response. + * @param stringEncoding The string encoding format for content spans in + * the response. * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`."). * @param contentType Request content type. * @param contentRange Range of the input to analyze (ex. `1-3,5,9-`). Document content uses 1-based page numbers, @@ -1620,7 +1623,8 @@ SyncPoller beginAnalyzeBi * * @param analyzerId The unique identifier of the analyzer. * @param binaryInput The binary content of the document to analyze. - * @param stringEncoding The string encoding format for content spans in the response. + * @param stringEncoding The string encoding format for content spans in + * the response. * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`."). * @param contentType Request content type. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/models/AnalysisResult.java b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/models/AnalysisResult.java index abe73c72ad56..21308c5fe5a1 100644 --- a/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/models/AnalysisResult.java +++ b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/models/AnalysisResult.java @@ -47,7 +47,8 @@ public final class AnalysisResult implements JsonSerializable { private List warnings; /* - * The string encoding format for content spans in the response. + * The string encoding format for content spans in the + * response. * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.") */ @Generated @@ -110,7 +111,8 @@ public List getWarnings() { } /** - * Get the stringEncoding property: The string encoding format for content spans in the response. + * Get the stringEncoding property: The string encoding format for content spans in the + * response. * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`."). * * @return the stringEncoding value. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DeletedBackupInstancesClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DeletedBackupInstancesClient.java index 08d3bf4b71a5..92264da64466 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DeletedBackupInstancesClient.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DeletedBackupInstancesClient.java @@ -75,7 +75,7 @@ Response getWithResponse(String resourceGrou PagedIterable list(String resourceGroupName, String vaultName, Context context); /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -90,7 +90,7 @@ SyncPoller, Void> beginUndelete(String resourceGroupName, Strin String backupInstanceName); /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -106,7 +106,7 @@ SyncPoller, Void> beginUndelete(String resourceGroupName, Strin String backupInstanceName, Context context); /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -119,7 +119,7 @@ SyncPoller, Void> beginUndelete(String resourceGroupName, Strin void undelete(String resourceGroupName, String vaultName, String backupInstanceName); /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DeletedBackupInstancesClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DeletedBackupInstancesClientImpl.java index 18879f627f08..b404854d26b0 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DeletedBackupInstancesClientImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DeletedBackupInstancesClientImpl.java @@ -336,7 +336,7 @@ public PagedIterable list(String resourceGro } /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -356,7 +356,7 @@ private Mono>> undeleteWithResponseAsync(String resour } /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -374,7 +374,7 @@ private Response undeleteWithResponse(String resourceGroupName, Stri } /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -393,7 +393,7 @@ private Response undeleteWithResponse(String resourceGroupName, Stri } /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -413,7 +413,7 @@ private PollerFlux, Void> beginUndeleteAsync(String resourceGro } /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -431,7 +431,7 @@ public SyncPoller, Void> beginUndelete(String resourceGroupName } /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -450,7 +450,7 @@ public SyncPoller, Void> beginUndelete(String resourceGroupName } /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -467,7 +467,7 @@ private Mono undeleteAsync(String resourceGroupName, String vaultName, Str } /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -482,7 +482,7 @@ public void undelete(String resourceGroupName, String vaultName, String backupIn } /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstances.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstances.java index b1274849253f..e9abe22823fb 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstances.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstances.java @@ -66,7 +66,7 @@ Response getWithResponse(String resourceGroupName PagedIterable list(String resourceGroupName, String vaultName, Context context); /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -78,7 +78,7 @@ Response getWithResponse(String resourceGroupName void undelete(String resourceGroupName, String vaultName, String backupInstanceName); /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. diff --git a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DeploymentEnvironmentsClientBuilder.java b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DeploymentEnvironmentsClientBuilder.java index 8f8ab624e853..b739d100abd1 100644 --- a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DeploymentEnvironmentsClientBuilder.java +++ b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DeploymentEnvironmentsClientBuilder.java @@ -217,19 +217,7 @@ public DeploymentEnvironmentsClientBuilder endpoint(String endpoint) { * Service version */ @Generated - private DevCenterServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the DeploymentEnvironmentsClientBuilder. - */ - @Generated - public DeploymentEnvironmentsClientBuilder serviceVersion(DevCenterServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } + private DeploymentEnvironmentsServiceVersion serviceVersion; /* * The retry policy that will attempt to retry failed requests, if applicable. @@ -258,8 +246,8 @@ public DeploymentEnvironmentsClientBuilder retryPolicy(RetryPolicy retryPolicy) private DeploymentEnvironmentsClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - DevCenterServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : DevCenterServiceVersion.getLatest(); + DeploymentEnvironmentsServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : DeploymentEnvironmentsServiceVersion.getLatest(); DeploymentEnvironmentsClientImpl client = new DeploymentEnvironmentsClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; @@ -331,4 +319,16 @@ private void validateClient() { // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the DeploymentEnvironmentsClientBuilder. + */ + @Generated + public DeploymentEnvironmentsClientBuilder serviceVersion(DeploymentEnvironmentsServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } } diff --git a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DeploymentEnvironmentsServiceVersion.java b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DeploymentEnvironmentsServiceVersion.java new file mode 100644 index 000000000000..3a731eca4550 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DeploymentEnvironmentsServiceVersion.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.developer.devcenter; + +import com.azure.core.util.ServiceVersion; + +/** + * Service version of DeploymentEnvironmentsClient. + */ +public enum DeploymentEnvironmentsServiceVersion implements ServiceVersion { + /** + * Enum value 2023-04-01. + */ + V2023_04_01("2023-04-01"); + + private final String version; + + DeploymentEnvironmentsServiceVersion(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 DeploymentEnvironmentsServiceVersion}. + */ + public static DeploymentEnvironmentsServiceVersion getLatest() { + return V2023_04_01; + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DevBoxesClientBuilder.java b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DevBoxesClientBuilder.java index 9aab80b76b13..bf101c835fbd 100644 --- a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DevBoxesClientBuilder.java +++ b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DevBoxesClientBuilder.java @@ -217,19 +217,7 @@ public DevBoxesClientBuilder endpoint(String endpoint) { * Service version */ @Generated - private DevCenterServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the DevBoxesClientBuilder. - */ - @Generated - public DevBoxesClientBuilder serviceVersion(DevCenterServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } + private DevBoxesServiceVersion serviceVersion; /* * The retry policy that will attempt to retry failed requests, if applicable. @@ -258,8 +246,8 @@ public DevBoxesClientBuilder retryPolicy(RetryPolicy retryPolicy) { private DevBoxesClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - DevCenterServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : DevCenterServiceVersion.getLatest(); + DevBoxesServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : DevBoxesServiceVersion.getLatest(); DevBoxesClientImpl client = new DevBoxesClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; @@ -331,4 +319,16 @@ private void validateClient() { // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the DevBoxesClientBuilder. + */ + @Generated + public DevBoxesClientBuilder serviceVersion(DevBoxesServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } } diff --git a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DevBoxesServiceVersion.java b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DevBoxesServiceVersion.java new file mode 100644 index 000000000000..e4c0c583d732 --- /dev/null +++ b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DevBoxesServiceVersion.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.developer.devcenter; + +import com.azure.core.util.ServiceVersion; + +/** + * Service version of DevBoxesClient. + */ +public enum DevBoxesServiceVersion implements ServiceVersion { + /** + * Enum value 2023-04-01. + */ + V2023_04_01("2023-04-01"); + + private final String version; + + DevBoxesServiceVersion(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 DevBoxesServiceVersion}. + */ + public static DevBoxesServiceVersion getLatest() { + return V2023_04_01; + } +} diff --git a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DevCenterServiceVersion.java b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DevCenterServiceVersion.java index b3766e88082d..2917028faf02 100644 --- a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DevCenterServiceVersion.java +++ b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/DevCenterServiceVersion.java @@ -7,7 +7,7 @@ import com.azure.core.util.ServiceVersion; /** - * Service version of DevCenterServiceClient. + * Service version of DevCenterClient. */ public enum DevCenterServiceVersion implements ServiceVersion { /** diff --git a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DeploymentEnvironmentsClientImpl.java b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DeploymentEnvironmentsClientImpl.java index 344ec20856ea..ccace01604c2 100644 --- a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DeploymentEnvironmentsClientImpl.java +++ b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DeploymentEnvironmentsClientImpl.java @@ -44,7 +44,7 @@ import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.TypeReference; -import com.azure.developer.devcenter.DevCenterServiceVersion; +import com.azure.developer.devcenter.DeploymentEnvironmentsServiceVersion; import com.azure.developer.devcenter.models.DevCenterEnvironment; import com.azure.developer.devcenter.models.DevCenterOperationDetails; import java.time.Duration; @@ -79,14 +79,14 @@ public String getEndpoint() { /** * Service version. */ - private final DevCenterServiceVersion serviceVersion; + private final DeploymentEnvironmentsServiceVersion serviceVersion; /** * Gets Service version. * * @return the serviceVersion value. */ - public DevCenterServiceVersion getServiceVersion() { + public DeploymentEnvironmentsServiceVersion getServiceVersion() { return this.serviceVersion; } @@ -124,7 +124,7 @@ public SerializerAdapter getSerializerAdapter() { * @param endpoint The DevCenter-specific URI to operate on. * @param serviceVersion Service version. */ - public DeploymentEnvironmentsClientImpl(String endpoint, DevCenterServiceVersion serviceVersion) { + public DeploymentEnvironmentsClientImpl(String endpoint, DeploymentEnvironmentsServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -137,7 +137,7 @@ public DeploymentEnvironmentsClientImpl(String endpoint, DevCenterServiceVersion * @param serviceVersion Service version. */ public DeploymentEnvironmentsClientImpl(HttpPipeline httpPipeline, String endpoint, - DevCenterServiceVersion serviceVersion) { + DeploymentEnvironmentsServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -150,7 +150,7 @@ public DeploymentEnvironmentsClientImpl(HttpPipeline httpPipeline, String endpoi * @param serviceVersion Service version. */ public DeploymentEnvironmentsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, DevCenterServiceVersion serviceVersion) { + String endpoint, DeploymentEnvironmentsServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; diff --git a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DevBoxesClientImpl.java b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DevBoxesClientImpl.java index ac4daac3552d..3c5ae0fe458f 100644 --- a/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DevBoxesClientImpl.java +++ b/sdk/devcenter/azure-developer-devcenter/src/main/java/com/azure/developer/devcenter/implementation/DevBoxesClientImpl.java @@ -45,7 +45,7 @@ import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.TypeReference; -import com.azure.developer.devcenter.DevCenterServiceVersion; +import com.azure.developer.devcenter.DevBoxesServiceVersion; import com.azure.developer.devcenter.models.DevBox; import com.azure.developer.devcenter.models.DevCenterOperationDetails; import java.time.Duration; @@ -81,14 +81,14 @@ public String getEndpoint() { /** * Service version. */ - private final DevCenterServiceVersion serviceVersion; + private final DevBoxesServiceVersion serviceVersion; /** * Gets Service version. * * @return the serviceVersion value. */ - public DevCenterServiceVersion getServiceVersion() { + public DevBoxesServiceVersion getServiceVersion() { return this.serviceVersion; } @@ -126,7 +126,7 @@ public SerializerAdapter getSerializerAdapter() { * @param endpoint The DevCenter-specific URI to operate on. * @param serviceVersion Service version. */ - public DevBoxesClientImpl(String endpoint, DevCenterServiceVersion serviceVersion) { + public DevBoxesClientImpl(String endpoint, DevBoxesServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -138,7 +138,7 @@ public DevBoxesClientImpl(String endpoint, DevCenterServiceVersion serviceVersio * @param endpoint The DevCenter-specific URI to operate on. * @param serviceVersion Service version. */ - public DevBoxesClientImpl(HttpPipeline httpPipeline, String endpoint, DevCenterServiceVersion serviceVersion) { + public DevBoxesClientImpl(HttpPipeline httpPipeline, String endpoint, DevBoxesServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -151,7 +151,7 @@ public DevBoxesClientImpl(HttpPipeline httpPipeline, String endpoint, DevCenterS * @param serviceVersion Service version. */ public DevBoxesClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - DevCenterServiceVersion serviceVersion) { + DevBoxesServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/CredentialsClient.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/CredentialsClient.java index 64cbd6736a29..5506dc8e2049 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/CredentialsClient.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/CredentialsClient.java @@ -247,7 +247,7 @@ CredentialInner update(String resourceGroupName, String namespaceName, Credentia PagedIterable listByResourceGroup(String resourceGroupName, String namespaceName, Context context); /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -260,7 +260,7 @@ CredentialInner update(String resourceGroupName, String namespaceName, Credentia SyncPoller, Void> beginSynchronize(String resourceGroupName, String namespaceName); /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -275,7 +275,7 @@ SyncPoller, Void> beginSynchronize(String resourceGroupName, St Context context); /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -287,7 +287,7 @@ SyncPoller, Void> beginSynchronize(String resourceGroupName, St void synchronize(String resourceGroupName, String namespaceName); /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/NamespaceDevicesClient.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/NamespaceDevicesClient.java index 9fcbcc89b32a..daf8e8098383 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/NamespaceDevicesClient.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/NamespaceDevicesClient.java @@ -267,7 +267,7 @@ PagedIterable listByResourceGroup(String resourceGroupName Context context); /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -283,7 +283,7 @@ SyncPoller, Void> beginRevoke(String resourceGroupName, String DeviceCredentialsRevokeRequest body); /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -300,7 +300,7 @@ SyncPoller, Void> beginRevoke(String resourceGroupName, String DeviceCredentialsRevokeRequest body, Context context); /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -314,7 +314,7 @@ SyncPoller, Void> beginRevoke(String resourceGroupName, String void revoke(String resourceGroupName, String namespaceName, String deviceName, DeviceCredentialsRevokeRequest body); /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/PoliciesClient.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/PoliciesClient.java index 26447eb5f0a4..2e5e37935066 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/PoliciesClient.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/PoliciesClient.java @@ -264,7 +264,7 @@ PolicyInner update(String resourceGroupName, String namespaceName, String policy PagedIterable listByResourceGroup(String resourceGroupName, String namespaceName, Context context); /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -279,7 +279,7 @@ SyncPoller, Void> beginRevokeIssuer(String resourceGroupName, S String policyName); /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -295,7 +295,7 @@ SyncPoller, Void> beginRevokeIssuer(String resourceGroupName, S String policyName, Context context); /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -308,7 +308,7 @@ SyncPoller, Void> beginRevokeIssuer(String resourceGroupName, S void revokeIssuer(String resourceGroupName, String namespaceName, String policyName); /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/CredentialsClientImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/CredentialsClientImpl.java index 9a15962cada1..46fb6d54ac53 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/CredentialsClientImpl.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/CredentialsClientImpl.java @@ -881,7 +881,7 @@ public PagedIterable listByResourceGroup(String resourceGroupNa } /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -900,7 +900,7 @@ private Mono>> synchronizeWithResponseAsync(String res } /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -916,7 +916,7 @@ private Response synchronizeWithResponse(String resourceGroupName, S } /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -934,7 +934,7 @@ private Response synchronizeWithResponse(String resourceGroupName, S } /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -951,7 +951,7 @@ private PollerFlux, Void> beginSynchronizeAsync(String resource } /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -967,7 +967,7 @@ public SyncPoller, Void> beginSynchronize(String resourceGroupN } /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -985,7 +985,7 @@ public SyncPoller, Void> beginSynchronize(String resourceGroupN } /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1001,7 +1001,7 @@ private Mono synchronizeAsync(String resourceGroupName, String namespaceNa } /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1015,7 +1015,7 @@ public void synchronize(String resourceGroupName, String namespaceName) { } /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/NamespaceDevicesClientImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/NamespaceDevicesClientImpl.java index 4aff3afac66d..7436e363b218 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/NamespaceDevicesClientImpl.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/NamespaceDevicesClientImpl.java @@ -935,7 +935,7 @@ public PagedIterable listByResourceGroup(String resourceGr } /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -960,7 +960,7 @@ private Mono>> revokeWithResponseAsync(String resource } /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -982,7 +982,7 @@ private Response revokeWithResponse(String resourceGroupName, String } /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1005,7 +1005,7 @@ private Response revokeWithResponse(String resourceGroupName, String } /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1026,7 +1026,7 @@ private PollerFlux, Void> beginRevokeAsync(String resourceGroup } /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1045,7 +1045,7 @@ public SyncPoller, Void> beginRevoke(String resourceGroupName, } /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1065,7 +1065,7 @@ public SyncPoller, Void> beginRevoke(String resourceGroupName, } /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1084,7 +1084,7 @@ private Mono revokeAsync(String resourceGroupName, String namespaceName, S } /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1101,7 +1101,7 @@ public void revoke(String resourceGroupName, String namespaceName, String device } /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/PoliciesClientImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/PoliciesClientImpl.java index ccf7293599c7..cad68971ba79 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/PoliciesClientImpl.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/PoliciesClientImpl.java @@ -948,7 +948,7 @@ public PagedIterable listByResourceGroup(String resourceGroupName, } /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -968,7 +968,7 @@ private Mono>> revokeIssuerWithResponseAsync(String re } /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -986,7 +986,7 @@ private Response revokeIssuerWithResponse(String resourceGroupName, } /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1005,7 +1005,7 @@ private Response revokeIssuerWithResponse(String resourceGroupName, } /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1025,7 +1025,7 @@ private PollerFlux, Void> beginRevokeIssuerAsync(String resourc } /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1043,7 +1043,7 @@ public SyncPoller, Void> beginRevokeIssuer(String resourceGroup } /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1062,7 +1062,7 @@ public SyncPoller, Void> beginRevokeIssuer(String resourceGroup } /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1079,7 +1079,7 @@ private Mono revokeIssuerAsync(String resourceGroupName, String namespaceN } /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1094,7 +1094,7 @@ public void revokeIssuer(String resourceGroupName, String namespaceName, String } /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Credentials.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Credentials.java index d079717052dd..23845116ac0c 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Credentials.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Credentials.java @@ -142,7 +142,7 @@ Credential createOrUpdate(String resourceGroupName, String namespaceName, Creden PagedIterable listByResourceGroup(String resourceGroupName, String namespaceName, Context context); /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -153,7 +153,7 @@ Credential createOrUpdate(String resourceGroupName, String namespaceName, Creden void synchronize(String resourceGroupName, String namespaceName); /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/NamespaceDevice.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/NamespaceDevice.java index 788fecf29c37..c87641d5f65b 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/NamespaceDevice.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/NamespaceDevice.java @@ -293,7 +293,7 @@ interface WithProperties { NamespaceDevice refresh(Context context); /** - * A long-running resource action. + * The revoke operation. * * @param body The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -303,7 +303,7 @@ interface WithProperties { void revoke(DeviceCredentialsRevokeRequest body); /** - * A long-running resource action. + * The revoke operation. * * @param body The content of the action request. * @param context The context to associate with this operation. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/NamespaceDevices.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/NamespaceDevices.java index b8a1c5ed5e45..bafaa286daa0 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/NamespaceDevices.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/NamespaceDevices.java @@ -91,7 +91,7 @@ Response getWithResponse(String resourceGroupName, String names PagedIterable listByResourceGroup(String resourceGroupName, String namespaceName, Context context); /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -104,7 +104,7 @@ Response getWithResponse(String resourceGroupName, String names void revoke(String resourceGroupName, String namespaceName, String deviceName, DeviceCredentialsRevokeRequest body); /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Policies.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Policies.java index bba492bb4482..531303017ca0 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Policies.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Policies.java @@ -91,7 +91,7 @@ Response getWithResponse(String resourceGroupName, String namespaceName, PagedIterable listByResourceGroup(String resourceGroupName, String namespaceName, Context context); /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -103,7 +103,7 @@ Response getWithResponse(String resourceGroupName, String namespaceName, void revokeIssuer(String resourceGroupName, String namespaceName, String policyName); /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Policy.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Policy.java index ee71cf639bf8..6afdb32953c4 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Policy.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Policy.java @@ -188,7 +188,7 @@ interface WithProperties { Policy refresh(Context context); /** - * A long-running resource action. + * The revokeIssuer operation. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -196,7 +196,7 @@ interface WithProperties { void revokeIssuer(); /** - * A long-running resource action. + * The revokeIssuer operation. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasCreateOrUpdateSamples.java index 497ec70c614e..d6573e638887 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasCreateOrUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasCreateOrUpdateSamples.java @@ -44,7 +44,7 @@ public static void formulasCreateOrUpdate(com.azure.resourcemanager.devtestlabs. .withParameters(Arrays.asList()))) .withGalleryImageReference(new GalleryImageReference().withOffer("0001-com-ubuntu-server-groovy") .withPublisher("canonical") - .withSku("2010") + .withSku("20_10") .withOsType("Linux") .withVersion("latest")) .withNetworkInterface(new NetworkInterfaceProperties().withSharedPublicIpAddressConfiguration( diff --git a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceAdministrationClientBuilder.java b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceAdministrationClientBuilder.java index a6c61034a3db..e3ee17d82723 100644 --- a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceAdministrationClientBuilder.java +++ b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceAdministrationClientBuilder.java @@ -242,20 +242,7 @@ public DocumentIntelligenceAdministrationClientBuilder endpoint(String endpoint) * Service version */ @Generated - private DocumentIntelligenceServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the DocumentIntelligenceAdministrationClientBuilder. - */ - @Generated - public DocumentIntelligenceAdministrationClientBuilder - serviceVersion(DocumentIntelligenceServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } + private DocumentIntelligenceAdministrationServiceVersion serviceVersion; /* * The retry policy that will attempt to retry failed requests, if applicable. @@ -284,8 +271,8 @@ public DocumentIntelligenceAdministrationClientBuilder retryPolicy(RetryPolicy r private DocumentIntelligenceAdministrationClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - DocumentIntelligenceServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : DocumentIntelligenceServiceVersion.getLatest(); + DocumentIntelligenceAdministrationServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : DocumentIntelligenceAdministrationServiceVersion.getLatest(); DocumentIntelligenceAdministrationClientImpl client = new DocumentIntelligenceAdministrationClientImpl( localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; @@ -360,4 +347,17 @@ public DocumentIntelligenceAdministrationClient buildClient() { } private static final ClientLogger LOGGER = new ClientLogger(DocumentIntelligenceAdministrationClientBuilder.class); + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the DocumentIntelligenceAdministrationClientBuilder. + */ + @Generated + public DocumentIntelligenceAdministrationClientBuilder + serviceVersion(DocumentIntelligenceAdministrationServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } } diff --git a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceAdministrationServiceVersion.java b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceAdministrationServiceVersion.java new file mode 100644 index 000000000000..fe9dbd92d15a --- /dev/null +++ b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/DocumentIntelligenceAdministrationServiceVersion.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.documentintelligence; + +import com.azure.core.util.ServiceVersion; + +/** + * Service version of DocumentIntelligenceAdministrationClient. + */ +public enum DocumentIntelligenceAdministrationServiceVersion implements ServiceVersion { + /** + * Enum value 2024-11-30. + */ + V2024_11_30("2024-11-30"); + + private final String version; + + DocumentIntelligenceAdministrationServiceVersion(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 DocumentIntelligenceAdministrationServiceVersion}. + */ + public static DocumentIntelligenceAdministrationServiceVersion getLatest() { + return V2024_11_30; + } +} diff --git a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceAdministrationClientImpl.java b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceAdministrationClientImpl.java index 54d0a403774f..86d319e43256 100644 --- a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceAdministrationClientImpl.java +++ b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceAdministrationClientImpl.java @@ -4,7 +4,7 @@ package com.azure.ai.documentintelligence.implementation; -import com.azure.ai.documentintelligence.DocumentIntelligenceServiceVersion; +import com.azure.ai.documentintelligence.DocumentIntelligenceAdministrationServiceVersion; import com.azure.ai.documentintelligence.models.DocumentClassifierBuildOperationDetails; import com.azure.ai.documentintelligence.models.DocumentClassifierCopyToOperationDetails; import com.azure.ai.documentintelligence.models.DocumentClassifierDetails; @@ -82,14 +82,14 @@ public String getEndpoint() { /** * Service version. */ - private final DocumentIntelligenceServiceVersion serviceVersion; + private final DocumentIntelligenceAdministrationServiceVersion serviceVersion; /** * Gets Service version. * * @return the serviceVersion value. */ - public DocumentIntelligenceServiceVersion getServiceVersion() { + public DocumentIntelligenceAdministrationServiceVersion getServiceVersion() { return this.serviceVersion; } @@ -128,7 +128,7 @@ public SerializerAdapter getSerializerAdapter() { * @param serviceVersion Service version. */ public DocumentIntelligenceAdministrationClientImpl(String endpoint, - DocumentIntelligenceServiceVersion serviceVersion) { + DocumentIntelligenceAdministrationServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -141,7 +141,7 @@ public DocumentIntelligenceAdministrationClientImpl(String endpoint, * @param serviceVersion Service version. */ public DocumentIntelligenceAdministrationClientImpl(HttpPipeline httpPipeline, String endpoint, - DocumentIntelligenceServiceVersion serviceVersion) { + DocumentIntelligenceAdministrationServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -154,7 +154,7 @@ public DocumentIntelligenceAdministrationClientImpl(HttpPipeline httpPipeline, S * @param serviceVersion Service version. */ public DocumentIntelligenceAdministrationClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, DocumentIntelligenceServiceVersion serviceVersion) { + String endpoint, DocumentIntelligenceAdministrationServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionVersionsClient.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionVersionsClient.java index ab2a5f58387e..b6da58bd2096 100644 --- a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionVersionsClient.java +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionVersionsClient.java @@ -272,7 +272,7 @@ PagedIterable listByEdgeAction(String resourceGroupName, Context context); /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -288,7 +288,7 @@ PagedIterable listByEdgeAction(String resourceGroupName, beginDeployVersionCode(String resourceGroupName, String edgeActionName, String version, VersionCodeInner body); /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -305,7 +305,7 @@ SyncPoller, EdgeActionVersionProper String resourceGroupName, String edgeActionName, String version, VersionCodeInner body, Context context); /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -321,7 +321,7 @@ EdgeActionVersionPropertiesInner deployVersionCode(String resourceGroupName, Str VersionCodeInner body); /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionsClientImpl.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionsClientImpl.java index 3513ce7c2233..c23934f668fa 100644 --- a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionsClientImpl.java +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionsClientImpl.java @@ -990,7 +990,7 @@ public PagedIterable listByEdgeAction(String resourceGro } /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -1014,7 +1014,7 @@ private Mono>> deployVersionCodeWithResponseAsync(Stri } /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -1036,7 +1036,7 @@ private Response deployVersionCodeWithResponse(String resourceGroupN } /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -1059,7 +1059,7 @@ private Response deployVersionCodeWithResponse(String resourceGroupN } /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -1082,7 +1082,7 @@ private Response deployVersionCodeWithResponse(String resourceGroupN } /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -1102,7 +1102,7 @@ private Response deployVersionCodeWithResponse(String resourceGroupN } /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -1125,7 +1125,7 @@ private Response deployVersionCodeWithResponse(String resourceGroupN } /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -1144,7 +1144,7 @@ private Mono deployVersionCodeAsync(String res } /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -1162,7 +1162,7 @@ public EdgeActionVersionPropertiesInner deployVersionCode(String resourceGroupNa } /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersion.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersion.java index ecece901b645..8ad940c32a23 100644 --- a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersion.java +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersion.java @@ -267,7 +267,7 @@ interface WithProperties { EdgeActionVersion refresh(Context context); /** - * A long-running resource action. + * The deployVersionCode operation. * * @param body The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -278,7 +278,7 @@ interface WithProperties { EdgeActionVersionProperties deployVersionCode(VersionCodeInner body); /** - * A long-running resource action. + * The deployVersionCode operation. * * @param body The content of the action request. * @param context The context to associate with this operation. diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersions.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersions.java index 013fd1fd2a36..3e7b5ca7a536 100644 --- a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersions.java +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersions.java @@ -92,7 +92,7 @@ Response getWithResponse(String resourceGroupName, String edg PagedIterable listByEdgeAction(String resourceGroupName, String edgeActionName, Context context); /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -107,7 +107,7 @@ EdgeActionVersionProperties deployVersionCode(String resourceGroupName, String e VersionCodeInner body); /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. diff --git a/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridReceiverClientBuilder.java b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridReceiverClientBuilder.java index b0a2e232f84c..3c99a623d662 100644 --- a/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridReceiverClientBuilder.java +++ b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridReceiverClientBuilder.java @@ -236,19 +236,7 @@ public EventGridReceiverClientBuilder endpoint(String endpoint) { * Service version */ @Generated - private EventGridServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the EventGridReceiverClientBuilder. - */ - @Generated - public EventGridReceiverClientBuilder serviceVersion(EventGridServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } + private EventGridReceiverServiceVersion serviceVersion; /* * The retry policy that will attempt to retry failed requests, if applicable. @@ -303,8 +291,8 @@ public EventGridReceiverClientBuilder subscriptionName(String subscriptionName) private EventGridReceiverClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - EventGridServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : EventGridServiceVersion.getLatest(); + EventGridReceiverServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : EventGridReceiverServiceVersion.getLatest(); EventGridReceiverClientImpl client = new EventGridReceiverClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; @@ -389,4 +377,16 @@ private void validateClient() { // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the EventGridReceiverClientBuilder. + */ + @Generated + public EventGridReceiverClientBuilder serviceVersion(EventGridReceiverServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } } diff --git a/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridReceiverServiceVersion.java b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridReceiverServiceVersion.java new file mode 100644 index 000000000000..2c543d389abc --- /dev/null +++ b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridReceiverServiceVersion.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.messaging.eventgrid.namespaces; + +import com.azure.core.util.ServiceVersion; + +/** + * Service version of EventGridReceiverClient. + */ +public enum EventGridReceiverServiceVersion implements ServiceVersion { + + /** + * Enum value 2023-11-01. + */ + V2023_11_01("2023-11-01"), + /** + * Enum value 2024-06-01. + */ + V2024_06_01("2024-06-01"); + + private final String version; + + EventGridReceiverServiceVersion(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 EventGridReceiverServiceVersion}. + */ + public static EventGridReceiverServiceVersion getLatest() { + return V2024_06_01; + } +} diff --git a/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridSenderClientBuilder.java b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridSenderClientBuilder.java index 5208a9c581d2..410e802a0752 100644 --- a/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridSenderClientBuilder.java +++ b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridSenderClientBuilder.java @@ -236,19 +236,7 @@ public EventGridSenderClientBuilder endpoint(String endpoint) { * Service version */ @Generated - private EventGridServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the EventGridSenderClientBuilder. - */ - @Generated - public EventGridSenderClientBuilder serviceVersion(EventGridServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } + private EventGridSenderServiceVersion serviceVersion; /* * The retry policy that will attempt to retry failed requests, if applicable. @@ -290,8 +278,8 @@ public EventGridSenderClientBuilder topicName(String topicName) { private EventGridSenderClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - EventGridServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : EventGridServiceVersion.getLatest(); + EventGridSenderServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : EventGridSenderServiceVersion.getLatest(); EventGridSenderClientImpl client = new EventGridSenderClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; @@ -370,4 +358,16 @@ private void validateClient() { // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); } + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the EventGridSenderClientBuilder. + */ + @Generated + public EventGridSenderClientBuilder serviceVersion(EventGridSenderServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } } diff --git a/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridServiceVersion.java b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridSenderServiceVersion.java similarity index 71% rename from sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridServiceVersion.java rename to sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridSenderServiceVersion.java index 9ac628db2229..e01c6cf09dc3 100644 --- a/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridServiceVersion.java +++ b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/EventGridSenderServiceVersion.java @@ -6,9 +6,9 @@ import com.azure.core.util.ServiceVersion; /** - * Service version of EventGridClient. + * Service version of EventGridSenderClient. */ -public enum EventGridServiceVersion implements ServiceVersion { +public enum EventGridSenderServiceVersion implements ServiceVersion { /** * Enum value 2023-11-01. @@ -21,7 +21,7 @@ public enum EventGridServiceVersion implements ServiceVersion { private final String version; - EventGridServiceVersion(String version) { + EventGridSenderServiceVersion(String version) { this.version = version; } @@ -36,9 +36,9 @@ public String getVersion() { /** * Gets the latest service version supported by this client library. * - * @return The latest {@link EventGridServiceVersion}. + * @return The latest {@link EventGridSenderServiceVersion}. */ - public static EventGridServiceVersion getLatest() { + public static EventGridSenderServiceVersion getLatest() { return V2024_06_01; } } diff --git a/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/implementation/EventGridReceiverClientImpl.java b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/implementation/EventGridReceiverClientImpl.java index 896c64499348..b16abd3df590 100644 --- a/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/implementation/EventGridReceiverClientImpl.java +++ b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/implementation/EventGridReceiverClientImpl.java @@ -32,7 +32,7 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.messaging.eventgrid.namespaces.EventGridServiceVersion; +import com.azure.messaging.eventgrid.namespaces.EventGridReceiverServiceVersion; import reactor.core.publisher.Mono; /** @@ -61,14 +61,14 @@ public String getEndpoint() { /** * Service version. */ - private final EventGridServiceVersion serviceVersion; + private final EventGridReceiverServiceVersion serviceVersion; /** * Gets Service version. * * @return the serviceVersion value. */ - public EventGridServiceVersion getServiceVersion() { + public EventGridReceiverServiceVersion getServiceVersion() { return this.serviceVersion; } @@ -106,7 +106,7 @@ public SerializerAdapter getSerializerAdapter() { * @param endpoint The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. * @param serviceVersion Service version. */ - public EventGridReceiverClientImpl(String endpoint, EventGridServiceVersion serviceVersion) { + public EventGridReceiverClientImpl(String endpoint, EventGridReceiverServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -119,7 +119,7 @@ public EventGridReceiverClientImpl(String endpoint, EventGridServiceVersion serv * @param serviceVersion Service version. */ public EventGridReceiverClientImpl(HttpPipeline httpPipeline, String endpoint, - EventGridServiceVersion serviceVersion) { + EventGridReceiverServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -132,7 +132,7 @@ public EventGridReceiverClientImpl(HttpPipeline httpPipeline, String endpoint, * @param serviceVersion Service version. */ public EventGridReceiverClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - EventGridServiceVersion serviceVersion) { + EventGridReceiverServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; diff --git a/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/implementation/EventGridSenderClientImpl.java b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/implementation/EventGridSenderClientImpl.java index 797d6de9f0d4..d153745fee73 100644 --- a/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/implementation/EventGridSenderClientImpl.java +++ b/sdk/eventgrid/azure-messaging-eventgrid-namespaces/src/main/java/com/azure/messaging/eventgrid/namespaces/implementation/EventGridSenderClientImpl.java @@ -32,7 +32,7 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.messaging.eventgrid.namespaces.EventGridServiceVersion; +import com.azure.messaging.eventgrid.namespaces.EventGridSenderServiceVersion; import reactor.core.publisher.Mono; /** @@ -61,14 +61,14 @@ public String getEndpoint() { /** * Service version. */ - private final EventGridServiceVersion serviceVersion; + private final EventGridSenderServiceVersion serviceVersion; /** * Gets Service version. * * @return the serviceVersion value. */ - public EventGridServiceVersion getServiceVersion() { + public EventGridSenderServiceVersion getServiceVersion() { return this.serviceVersion; } @@ -106,7 +106,7 @@ public SerializerAdapter getSerializerAdapter() { * @param endpoint The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net. * @param serviceVersion Service version. */ - public EventGridSenderClientImpl(String endpoint, EventGridServiceVersion serviceVersion) { + public EventGridSenderClientImpl(String endpoint, EventGridSenderServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -119,7 +119,7 @@ public EventGridSenderClientImpl(String endpoint, EventGridServiceVersion servic * @param serviceVersion Service version. */ public EventGridSenderClientImpl(HttpPipeline httpPipeline, String endpoint, - EventGridServiceVersion serviceVersion) { + EventGridSenderServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -132,7 +132,7 @@ public EventGridSenderClientImpl(HttpPipeline httpPipeline, String endpoint, * @param serviceVersion Service version. */ public EventGridSenderClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - EventGridServiceVersion serviceVersion) { + EventGridSenderServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/PublicCloudConnectorsClient.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/PublicCloudConnectorsClient.java index 7a7b01a11a43..b71b9ffa08a5 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/PublicCloudConnectorsClient.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/PublicCloudConnectorsClient.java @@ -214,7 +214,7 @@ PublicCloudConnectorInner update(String resourceGroupName, String publicCloudCon PagedIterable list(Context context); /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -228,7 +228,7 @@ PublicCloudConnectorInner update(String resourceGroupName, String publicCloudCon beginTestPermissions(String resourceGroupName, String publicCloudConnector); /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -243,7 +243,7 @@ PublicCloudConnectorInner update(String resourceGroupName, String publicCloudCon beginTestPermissions(String resourceGroupName, String publicCloudConnector, Context context); /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -256,7 +256,7 @@ PublicCloudConnectorInner update(String resourceGroupName, String publicCloudCon OperationStatusResultInner testPermissions(String resourceGroupName, String publicCloudConnector); /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PublicCloudConnectorsClientImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PublicCloudConnectorsClientImpl.java index 1ebd1abc0093..a4090e2ff338 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PublicCloudConnectorsClientImpl.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PublicCloudConnectorsClientImpl.java @@ -835,7 +835,7 @@ public PagedIterable list(Context context) { } /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -856,7 +856,7 @@ private Mono>> testPermissionsWithResponseAsync(String } /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -873,7 +873,7 @@ private Response testPermissionsWithResponse(String resourceGroupNam } /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -892,7 +892,7 @@ private Response testPermissionsWithResponse(String resourceGroupNam } /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -912,7 +912,7 @@ private Response testPermissionsWithResponse(String resourceGroupNam } /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -930,7 +930,7 @@ private Response testPermissionsWithResponse(String resourceGroupNam } /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -949,7 +949,7 @@ private Response testPermissionsWithResponse(String resourceGroupNam } /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -966,7 +966,7 @@ private Mono testPermissionsAsync(String resourceGro } /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -981,7 +981,7 @@ public OperationStatusResultInner testPermissions(String resourceGroupName, Stri } /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnector.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnector.java index 10cb05922789..dbeb73cfc473 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnector.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnector.java @@ -264,7 +264,7 @@ interface WithProperties { PublicCloudConnector refresh(Context context); /** - * A long-running resource action. + * The testPermissions operation. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -273,7 +273,7 @@ interface WithProperties { OperationStatusResult testPermissions(); /** - * A long-running resource action. + * The testPermissions operation. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnectors.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnectors.java index ddadab694633..127cf637deb7 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnectors.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnectors.java @@ -107,7 +107,7 @@ Response deleteByResourceGroupWithResponse(String resourceGroupName, Strin PagedIterable list(Context context); /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -119,7 +119,7 @@ Response deleteByResourceGroupWithResponse(String resourceGroupName, Strin OperationStatusResult testPermissions(String resourceGroupName, String publicCloudConnector); /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/IotHubManager.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/IotHubManager.java deleted file mode 100644 index 3c03f2ec72e6..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/IotHubManager.java +++ /dev/null @@ -1,381 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -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.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.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.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.iothub.fluent.IotHubClient; -import com.azure.resourcemanager.iothub.implementation.CertificatesImpl; -import com.azure.resourcemanager.iothub.implementation.IotHubClientBuilder; -import com.azure.resourcemanager.iothub.implementation.IotHubResourcesImpl; -import com.azure.resourcemanager.iothub.implementation.IotHubsImpl; -import com.azure.resourcemanager.iothub.implementation.OperationsImpl; -import com.azure.resourcemanager.iothub.implementation.PrivateEndpointConnectionsImpl; -import com.azure.resourcemanager.iothub.implementation.PrivateLinkResourcesOperationsImpl; -import com.azure.resourcemanager.iothub.implementation.ResourceProviderCommonsImpl; -import com.azure.resourcemanager.iothub.models.Certificates; -import com.azure.resourcemanager.iothub.models.IotHubResources; -import com.azure.resourcemanager.iothub.models.IotHubs; -import com.azure.resourcemanager.iothub.models.Operations; -import com.azure.resourcemanager.iothub.models.PrivateEndpointConnections; -import com.azure.resourcemanager.iothub.models.PrivateLinkResourcesOperations; -import com.azure.resourcemanager.iothub.models.ResourceProviderCommons; -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; - -/** - * Entry point to IotHubManager. - * Use this API to manage the IoT hubs in your Azure subscription. - */ -public final class IotHubManager { - private Operations operations; - - private PrivateEndpointConnections privateEndpointConnections; - - private IotHubResources iotHubResources; - - private IotHubs iotHubs; - - private Certificates certificates; - - private PrivateLinkResourcesOperations privateLinkResourcesOperations; - - private ResourceProviderCommons resourceProviderCommons; - - private final IotHubClient clientObject; - - private IotHubManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = new IotHubClientBuilder().pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); - } - - /** - * Creates an instance of IotHub service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the IotHub service API instance. - */ - public static IotHubManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return configure().authenticate(credential, profile); - } - - /** - * Creates an instance of IotHub service API entry point. - * - * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. - * @param profile the Azure profile for client. - * @return the IotHub service API instance. - */ - public static IotHubManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new IotHubManager(httpPipeline, profile, null); - } - - /** - * Gets a Configurable instance that can be used to create IotHubManager with optional configuration. - * - * @return the Configurable instance allowing configurations. - */ - public static Configurable configure() { - return new IotHubManager.Configurable(); - } - - /** - * The Configurable allowing configurations to be set. - */ - 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-iothub.properties"); - - private HttpClient httpClient; - private HttpLogOptions httpLogOptions; - private final List policies = new ArrayList<>(); - private final List scopes = new ArrayList<>(); - private RetryPolicy retryPolicy; - private RetryOptions retryOptions; - private Duration defaultPollInterval; - - private Configurable() { - } - - /** - * Sets the http client. - * - * @param httpClient the HTTP client. - * @return the configurable object itself. - */ - public Configurable withHttpClient(HttpClient httpClient) { - this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); - return this; - } - - /** - * Sets the logging options to the HTTP pipeline. - * - * @param httpLogOptions the HTTP log options. - * @return the configurable object itself. - */ - public Configurable withLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); - return this; - } - - /** - * Adds the pipeline policy to the HTTP pipeline. - * - * @param policy the HTTP pipeline policy. - * @return the configurable object itself. - */ - public Configurable withPolicy(HttpPipelinePolicy policy) { - this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); - return this; - } - - /** - * Adds the scope to permission sets. - * - * @param scope the scope. - * @return the configurable object itself. - */ - public Configurable withScope(String scope) { - this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); - return this; - } - - /** - * Sets the retry policy to the HTTP pipeline. - * - * @param retryPolicy the HTTP pipeline retry policy. - * @return the configurable object itself. - */ - public Configurable withRetryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); - return this; - } - - /** - * Sets the retry options for the HTTP pipeline retry policy. - *

- * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. - * - * @param retryOptions the retry options for the HTTP pipeline retry policy. - * @return the configurable object itself. - */ - public Configurable withRetryOptions(RetryOptions retryOptions) { - this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); - return this; - } - - /** - * Sets the default poll interval, used when service does not provide "Retry-After" header. - * - * @param defaultPollInterval the default poll interval. - * @return the configurable object itself. - */ - public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval - = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); - if (this.defaultPollInterval.isNegative()) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); - } - return this; - } - - /** - * Creates an instance of IotHub service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the IotHub service API instance. - */ - public IotHubManager authenticate(TokenCredential credential, AzureProfile profile) { - 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.iothub") - .append("/") - .append(clientVersion); - if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder.append(" (") - .append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.name")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")) - .append("; auto-generated)"); - } else { - userAgentBuilder.append(" (auto-generated)"); - } - - if (scopes.isEmpty()) { - scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); - } - if (retryPolicy == null) { - if (retryOptions != null) { - retryPolicy = new RetryPolicy(retryOptions); - } else { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); - } - } - List policies = new ArrayList<>(); - policies.add(new UserAgentPolicy(userAgentBuilder.toString())); - policies.add(new AddHeadersFromContextPolicy()); - policies.add(new RequestIdPolicy()); - policies.addAll(this.policies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(retryPolicy); - policies.add(new AddDatePolicy()); - policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies.addAll(this.policies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); - return new IotHubManager(httpPipeline, profile, defaultPollInterval); - } - } - - /** - * Gets the resource collection API of Operations. - * - * @return Resource collection API of Operations. - */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); - } - return operations; - } - - /** - * Gets the resource collection API of PrivateEndpointConnections. - * - * @return Resource collection API of PrivateEndpointConnections. - */ - public PrivateEndpointConnections privateEndpointConnections() { - if (this.privateEndpointConnections == null) { - this.privateEndpointConnections - = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); - } - return privateEndpointConnections; - } - - /** - * Gets the resource collection API of IotHubResources. It manages IotHubDescription, EventHubConsumerGroupInfo. - * - * @return Resource collection API of IotHubResources. - */ - public IotHubResources iotHubResources() { - if (this.iotHubResources == null) { - this.iotHubResources = new IotHubResourcesImpl(clientObject.getIotHubResources(), this); - } - return iotHubResources; - } - - /** - * Gets the resource collection API of IotHubs. - * - * @return Resource collection API of IotHubs. - */ - public IotHubs iotHubs() { - if (this.iotHubs == null) { - this.iotHubs = new IotHubsImpl(clientObject.getIotHubs(), this); - } - return iotHubs; - } - - /** - * Gets the resource collection API of Certificates. It manages CertificateDescription. - * - * @return Resource collection API of Certificates. - */ - public Certificates certificates() { - if (this.certificates == null) { - this.certificates = new CertificatesImpl(clientObject.getCertificates(), this); - } - return certificates; - } - - /** - * Gets the resource collection API of PrivateLinkResourcesOperations. - * - * @return Resource collection API of PrivateLinkResourcesOperations. - */ - public PrivateLinkResourcesOperations privateLinkResourcesOperations() { - if (this.privateLinkResourcesOperations == null) { - this.privateLinkResourcesOperations - = new PrivateLinkResourcesOperationsImpl(clientObject.getPrivateLinkResourcesOperations(), this); - } - return privateLinkResourcesOperations; - } - - /** - * Gets the resource collection API of ResourceProviderCommons. - * - * @return Resource collection API of ResourceProviderCommons. - */ - public ResourceProviderCommons resourceProviderCommons() { - if (this.resourceProviderCommons == null) { - this.resourceProviderCommons - = new ResourceProviderCommonsImpl(clientObject.getResourceProviderCommons(), this); - } - return resourceProviderCommons; - } - - /** - * Gets wrapped service client IotHubClient providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. - * - * @return Wrapped service client IotHubClient. - */ - public IotHubClient serviceClient() { - return this.clientObject; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/CertificatesClient.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/CertificatesClient.java deleted file mode 100644 index bb3a6bd056fd..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/CertificatesClient.java +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.iothub.fluent.models.CertificateDescriptionInner; -import com.azure.resourcemanager.iothub.fluent.models.CertificateListDescriptionInner; -import com.azure.resourcemanager.iothub.fluent.models.CertificateWithNonceDescriptionInner; -import com.azure.resourcemanager.iothub.models.CertificateVerificationDescription; - -/** - * An instance of this class provides access to all the operations defined in CertificatesClient. - */ -public interface CertificatesClient { - /** - * Get the certificate. - * - * Returns the certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate. - * - * Returns the certificate along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String resourceName, - String certificateName, Context context); - - /** - * Get the certificate. - * - * Returns the certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate. - * - * Returns the certificate. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CertificateDescriptionInner get(String resourceGroupName, String resourceName, String certificateName); - - /** - * Upload the certificate to the IoT hub. - * - * Adds new or replaces existing certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param certificateDescription The certificate body. - * @param ifMatch ETag of the Certificate. Do not specify for creating a brand new certificate. Required to update - * an existing certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, - String certificateName, CertificateDescriptionInner certificateDescription, String ifMatch, Context context); - - /** - * Upload the certificate to the IoT hub. - * - * Adds new or replaces existing certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param certificateDescription The certificate body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CertificateDescriptionInner createOrUpdate(String resourceGroupName, String resourceName, String certificateName, - CertificateDescriptionInner certificateDescription); - - /** - * Delete an X509 certificate. - * - * Deletes an existing X509 certificate or does nothing if it does not exist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String resourceName, String certificateName, - String ifMatch, Context context); - - /** - * Delete an X509 certificate. - * - * Deletes an existing X509 certificate or does nothing if it does not exist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 resourceName, String certificateName, String ifMatch); - - /** - * Get the certificate list. - * - * Returns the list of certificates. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate list. - * - * Returns the list of certificates along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listByIotHubWithResponse(String resourceGroupName, String resourceName, - Context context); - - /** - * Get the certificate list. - * - * Returns the list of certificates. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate list. - * - * Returns the list of certificates. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CertificateListDescriptionInner listByIotHub(String resourceGroupName, String resourceName); - - /** - * Generate verification code for proof of possession flow. - * - * Generates verification code for proof of possession flow. The verification code will be used to generate a leaf - * certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response generateVerificationCodeWithResponse(String resourceGroupName, - String resourceName, String certificateName, String ifMatch, Context context); - - /** - * Generate verification code for proof of possession flow. - * - * Generates verification code for proof of possession flow. The verification code will be used to generate a leaf - * certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CertificateWithNonceDescriptionInner generateVerificationCode(String resourceGroupName, String resourceName, - String certificateName, String ifMatch); - - /** - * Verify certificate's private key possession. - * - * Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded - * certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @param certificateVerificationBody The name of the certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response verifyWithResponse(String resourceGroupName, String resourceName, - String certificateName, String ifMatch, CertificateVerificationDescription certificateVerificationBody, - Context context); - - /** - * Verify certificate's private key possession. - * - * Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded - * certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @param certificateVerificationBody The name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CertificateDescriptionInner verify(String resourceGroupName, String resourceName, String certificateName, - String ifMatch, CertificateVerificationDescription certificateVerificationBody); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubClient.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubClient.java deleted file mode 100644 index 6e5e1d542f77..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubClient.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** - * The interface for IotHubClient class. - */ -public interface IotHubClient { - /** - * Gets Service host. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * 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. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - PrivateEndpointConnectionsClient getPrivateEndpointConnections(); - - /** - * Gets the IotHubResourcesClient object to access its operations. - * - * @return the IotHubResourcesClient object. - */ - IotHubResourcesClient getIotHubResources(); - - /** - * Gets the IotHubsClient object to access its operations. - * - * @return the IotHubsClient object. - */ - IotHubsClient getIotHubs(); - - /** - * Gets the CertificatesClient object to access its operations. - * - * @return the CertificatesClient object. - */ - CertificatesClient getCertificates(); - - /** - * Gets the PrivateLinkResourcesOperationsClient object to access its operations. - * - * @return the PrivateLinkResourcesOperationsClient object. - */ - PrivateLinkResourcesOperationsClient getPrivateLinkResourcesOperations(); - - /** - * Gets the ResourceProviderCommonsClient object to access its operations. - * - * @return the ResourceProviderCommonsClient object. - */ - ResourceProviderCommonsClient getResourceProviderCommons(); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubResourcesClient.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubResourcesClient.java deleted file mode 100644 index 0a53bd640fa2..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubResourcesClient.java +++ /dev/null @@ -1,1037 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.iothub.fluent.models.EndpointHealthDataInner; -import com.azure.resourcemanager.iothub.fluent.models.EventHubConsumerGroupInfoInner; -import com.azure.resourcemanager.iothub.fluent.models.IotHubDescriptionInner; -import com.azure.resourcemanager.iothub.fluent.models.IotHubNameAvailabilityInfoInner; -import com.azure.resourcemanager.iothub.fluent.models.IotHubQuotaMetricInfoInner; -import com.azure.resourcemanager.iothub.fluent.models.IotHubSkuDescriptionInner; -import com.azure.resourcemanager.iothub.fluent.models.JobResponseInner; -import com.azure.resourcemanager.iothub.fluent.models.RegistryStatisticsInner; -import com.azure.resourcemanager.iothub.fluent.models.SharedAccessSignatureAuthorizationRuleInner; -import com.azure.resourcemanager.iothub.fluent.models.TestAllRoutesResultInner; -import com.azure.resourcemanager.iothub.fluent.models.TestRouteResultInner; -import com.azure.resourcemanager.iothub.models.EventHubConsumerGroupBodyDescription; -import com.azure.resourcemanager.iothub.models.ExportDevicesRequest; -import com.azure.resourcemanager.iothub.models.ImportDevicesRequest; -import com.azure.resourcemanager.iothub.models.OperationInputs; -import com.azure.resourcemanager.iothub.models.TagsResource; -import com.azure.resourcemanager.iothub.models.TestAllRoutesInput; -import com.azure.resourcemanager.iothub.models.TestRouteInput; - -/** - * An instance of this class provides access to all the operations defined in IotHubResourcesClient. - */ -public interface IotHubResourcesClient { - /** - * Get the non-security related metadata of an IoT hub - * - * Get the non-security related metadata of an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the non-security related metadata of an IoT hub - * - * Get the non-security related metadata of an IoT hub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, - Context context); - - /** - * Get the non-security related metadata of an IoT hub - * - * Get the non-security related metadata of an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the non-security related metadata of an IoT hub - * - * Get the non-security related metadata of an IoT hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotHubDescriptionInner getByResourceGroup(String resourceGroupName, String resourceName); - - /** - * Create or update the metadata of an IoT hub. - * - * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub - * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubDescription The IoT hub metadata and security metadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, IotHubDescriptionInner> beginCreateOrUpdate(String resourceGroupName, - String resourceName, IotHubDescriptionInner iotHubDescription); - - /** - * Create or update the metadata of an IoT hub. - * - * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub - * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubDescription The IoT hub metadata and security metadata. - * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an - * existing IoT Hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, IotHubDescriptionInner> beginCreateOrUpdate(String resourceGroupName, - String resourceName, IotHubDescriptionInner iotHubDescription, String ifMatch, Context context); - - /** - * Create or update the metadata of an IoT hub. - * - * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub - * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubDescription The IoT hub metadata and security metadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotHubDescriptionInner createOrUpdate(String resourceGroupName, String resourceName, - IotHubDescriptionInner iotHubDescription); - - /** - * Create or update the metadata of an IoT hub. - * - * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub - * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubDescription The IoT hub metadata and security metadata. - * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an - * existing IoT Hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotHubDescriptionInner createOrUpdate(String resourceGroupName, String resourceName, - IotHubDescriptionInner iotHubDescription, String ifMatch, Context context); - - /** - * Update an existing IoT Hubs tags. - * - * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubTags Updated tag information to set into the iot hub instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, IotHubDescriptionInner> beginUpdate(String resourceGroupName, - String resourceName, TagsResource iotHubTags); - - /** - * Update an existing IoT Hubs tags. - * - * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubTags Updated tag information to set into the iot hub instance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, IotHubDescriptionInner> beginUpdate(String resourceGroupName, - String resourceName, TagsResource iotHubTags, Context context); - - /** - * Update an existing IoT Hubs tags. - * - * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubTags Updated tag information to set into the iot hub instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotHubDescriptionInner update(String resourceGroupName, String resourceName, TagsResource iotHubTags); - - /** - * Update an existing IoT Hubs tags. - * - * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubTags Updated tag information to set into the iot hub instance. - * @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 description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotHubDescriptionInner update(String resourceGroupName, String resourceName, TagsResource iotHubTags, - Context context); - - /** - * Delete an IoT hub - * - * Delete an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by server - * on status code 404. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName); - - /** - * Delete an IoT hub - * - * Delete an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by server - * on status code 404. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, Context context); - - /** - * Delete an IoT hub - * - * Delete an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by server - * on status code 404. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String resourceName); - - /** - * Delete an IoT hub - * - * Delete an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by server - * on status code 404. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String resourceName, Context context); - - /** - * Get all the IoT hubs in a resource group - * - * Get all the IoT hubs in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 IoT hubs in a resource group - * - * Get all the IoT hubs in a resource group as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Get all the IoT hubs in a resource group - * - * Get all the IoT hubs 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 com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 IoT hubs in a resource group - * - * Get all the IoT hubs in a resource group as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Get all the IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription. - * - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get all the IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Get the list of valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getValidSkus(String resourceGroupName, String resourceName); - - /** - * Get the list of valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getValidSkus(String resourceGroupName, String resourceName, - Context context); - - /** - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 the jobs in an IoT hub as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listJobs(String resourceGroupName, String resourceName); - - /** - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 the jobs in an IoT hub as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listJobs(String resourceGroupName, String resourceName, Context context); - - /** - * Get the details of a job from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * - * Get the details of a job from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param jobId The job identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a job from an IoT hub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getJobWithResponse(String resourceGroupName, String resourceName, String jobId, - Context context); - - /** - * Get the details of a job from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * - * Get the details of a job from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param jobId The job identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a job from an IoT hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - JobResponseInner getJob(String resourceGroupName, String resourceName, String jobId); - - /** - * Get the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getQuotaMetrics(String resourceGroupName, String resourceName); - - /** - * Get the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getQuotaMetrics(String resourceGroupName, String resourceName, - Context context); - - /** - * Get the health for routing endpoints - * - * Get the health for routing endpoints. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param iotHubName The iotHubName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the health for routing endpoints - * - * Get the health for routing endpoints as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getEndpointHealth(String resourceGroupName, String iotHubName); - - /** - * Get the health for routing endpoints - * - * Get the health for routing endpoints. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param iotHubName The iotHubName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the health for routing endpoints - * - * Get the health for routing endpoints as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable getEndpointHealth(String resourceGroupName, String iotHubName, - Context context); - - /** - * Test all routes - * - * Test all routes configured in this Iot Hub. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param input Input for testing all routes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 testing all routes along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response testAllRoutesWithResponse(String iotHubName, String resourceGroupName, - TestAllRoutesInput input, Context context); - - /** - * Test all routes - * - * Test all routes configured in this Iot Hub. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param input Input for testing all routes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 testing all routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TestAllRoutesResultInner testAllRoutes(String iotHubName, String resourceGroupName, TestAllRoutesInput input); - - /** - * Test the new route - * - * Test the new route for this Iot Hub. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param input Route that needs to be tested. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 testing one route along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response testRouteWithResponse(String iotHubName, String resourceGroupName, - TestRouteInput input, Context context); - - /** - * Test the new route - * - * Test the new route for this Iot Hub. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param input Route that needs to be tested. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 testing one route. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TestRouteResultInner testRoute(String iotHubName, String resourceGroupName, TestRouteInput input); - - /** - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security metadata for an IoT hub as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listKeys(String resourceGroupName, String resourceName); - - /** - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security metadata for an IoT hub as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listKeys(String resourceGroupName, String resourceName, - Context context); - - /** - * Get a shared access policy by name from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * Get a shared access policy by name from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param keyName The name of the shared access policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a shared access policy by name from an IoT hub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getKeysForKeyNameWithResponse(String resourceGroupName, - String resourceName, String keyName, Context context); - - /** - * Get a shared access policy by name from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * Get a shared access policy by name from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param keyName The name of the shared access policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a shared access policy by name from an IoT hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SharedAccessSignatureAuthorizationRuleInner getKeysForKeyName(String resourceGroupName, String resourceName, - String keyName); - - /** - * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more - * information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities - * - * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more - * information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param exportDevicesParameters The parameters that specify the export devices operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response exportDevicesWithResponse(String resourceGroupName, String resourceName, - ExportDevicesRequest exportDevicesParameters, Context context); - - /** - * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more - * information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities - * - * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more - * information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param exportDevicesParameters The parameters that specify the export devices operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - JobResponseInner exportDevices(String resourceGroupName, String resourceName, - ExportDevicesRequest exportDevicesParameters); - - /** - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, - * see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities - * - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, - * see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param importDevicesParameters The parameters that specify the import devices operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response importDevicesWithResponse(String resourceGroupName, String resourceName, - ImportDevicesRequest importDevicesParameters, Context context); - - /** - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, - * see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities - * - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, - * see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param importDevicesParameters The parameters that specify the import devices operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - JobResponseInner importDevices(String resourceGroupName, String resourceName, - ImportDevicesRequest importDevicesParameters); - - /** - * Get the statistics from an IoT hub - * - * Get the statistics from an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The resourceName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the statistics from an IoT hub - * - * Get the statistics from an IoT hub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getStatsWithResponse(String resourceGroupName, String resourceName, - Context context); - - /** - * Get the statistics from an IoT hub - * - * Get the statistics from an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The resourceName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the statistics from an IoT hub - * - * Get the statistics from an IoT hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RegistryStatisticsInner getStats(String resourceGroupName, String resourceName); - - /** - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub - * - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub - * - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getEventHubConsumerGroupWithResponse(String resourceGroupName, - String resourceName, String eventHubEndpointName, String name, Context context); - - /** - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub - * - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub - * - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EventHubConsumerGroupInfoInner getEventHubConsumerGroup(String resourceGroupName, String resourceName, - String eventHubEndpointName, String name); - - /** - * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub - * - * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @param consumerGroupBody The consumer group to add. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the EventHubConsumerGroupInfo object along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createEventHubConsumerGroupWithResponse(String resourceGroupName, - String resourceName, String eventHubEndpointName, String name, - EventHubConsumerGroupBodyDescription consumerGroupBody, Context context); - - /** - * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub - * - * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @param consumerGroupBody The consumer group to add. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the EventHubConsumerGroupInfo object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EventHubConsumerGroupInfoInner createEventHubConsumerGroup(String resourceGroupName, String resourceName, - String eventHubEndpointName, String name, EventHubConsumerGroupBodyDescription consumerGroupBody); - - /** - * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub - * - * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 deleteEventHubConsumerGroupWithResponse(String resourceGroupName, String resourceName, - String eventHubEndpointName, String name, Context context); - - /** - * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub - * - * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 deleteEventHubConsumerGroup(String resourceGroupName, String resourceName, String eventHubEndpointName, - String name); - - /** - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listEventHubConsumerGroups(String resourceGroupName, - String resourceName, String eventHubEndpointName); - - /** - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listEventHubConsumerGroups(String resourceGroupName, - String resourceName, String eventHubEndpointName, Context context); - - /** - * Check if an IoT hub name is available - * - * Check if an IoT hub name is available. - * - * @param operationInputs The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT hub name is available along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse(OperationInputs operationInputs, - Context context); - - /** - * Check if an IoT hub name is available - * - * Check if an IoT hub name is available. - * - * @param operationInputs The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT hub name is available. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotHubNameAvailabilityInfoInner checkNameAvailability(OperationInputs operationInputs); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubsClient.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubsClient.java deleted file mode 100644 index ef4de9dd245b..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubsClient.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.iothub.models.FailoverInput; - -/** - * An instance of this class provides access to all the operations defined in IotHubsClient. - */ -public interface IotHubsClient { - /** - * Manually initiate a failover for the IoT Hub to its secondary region - * - * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see - * https://aka.ms/manualfailover. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param failoverInput Region to failover to. Must be the Azure paired region. Get the value from the secondary - * location in the locations property. To learn more, see https://aka.ms/manualfailover/region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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> beginManualFailover(String iotHubName, String resourceGroupName, - FailoverInput failoverInput); - - /** - * Manually initiate a failover for the IoT Hub to its secondary region - * - * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see - * https://aka.ms/manualfailover. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param failoverInput Region to failover to. Must be the Azure paired region. Get the value from the secondary - * location in the locations property. To learn more, see https://aka.ms/manualfailover/region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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> beginManualFailover(String iotHubName, String resourceGroupName, - FailoverInput failoverInput, Context context); - - /** - * Manually initiate a failover for the IoT Hub to its secondary region - * - * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see - * https://aka.ms/manualfailover. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param failoverInput Region to failover to. Must be the Azure paired region. Get the value from the secondary - * location in the locations property. To learn more, see https://aka.ms/manualfailover/region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 manualFailover(String iotHubName, String resourceGroupName, FailoverInput failoverInput); - - /** - * Manually initiate a failover for the IoT Hub to its secondary region - * - * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see - * https://aka.ms/manualfailover. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param failoverInput Region to failover to. Must be the Azure paired region. Get the value from the secondary - * location in the locations property. To learn more, see https://aka.ms/manualfailover/region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 manualFailover(String iotHubName, String resourceGroupName, FailoverInput failoverInput, Context context); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/OperationsClient.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/OperationsClient.java deleted file mode 100644 index 1468b1eda074..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/OperationsClient.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.iothub.fluent.models.OperationInner; - -/** - * An instance of this class provides access to all the operations defined in OperationsClient. - */ -public interface OperationsClient { - /** - * List the operations for the provider. - * - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 IoT Hub operations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List the operations for the provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 IoT Hub operations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/PrivateEndpointConnectionsClient.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/PrivateEndpointConnectionsClient.java deleted file mode 100644 index 8d72ca1adc8b..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/PrivateEndpointConnectionsClient.java +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.SyncPoller; -import com.azure.resourcemanager.iothub.fluent.models.PrivateEndpointConnectionInner; -import java.util.List; - -/** - * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. - */ -public interface PrivateEndpointConnectionsClient { - /** - * Get private endpoint connection - * - * Get private endpoint connection properties. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection - * - * Get private endpoint connection properties along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String resourceName, - String privateEndpointConnectionName, Context context); - - /** - * Get private endpoint connection - * - * Get private endpoint connection properties. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection - * - * Get private endpoint connection properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner get(String resourceGroupName, String resourceName, - String privateEndpointConnectionName); - - /** - * Update private endpoint connection - * - * Update the status of a private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param privateEndpointConnection The private endpoint connection with updated properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the private endpoint connection of an IotHub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, PrivateEndpointConnectionInner> beginUpdate( - String resourceGroupName, String resourceName, String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection); - - /** - * Update private endpoint connection - * - * Update the status of a private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param privateEndpointConnection The private endpoint connection with updated properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the private endpoint connection of an IotHub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, PrivateEndpointConnectionInner> beginUpdate( - String resourceGroupName, String resourceName, String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection, Context context); - - /** - * Update private endpoint connection - * - * Update the status of a private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param privateEndpointConnection The private endpoint connection with updated properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection of an IotHub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner update(String resourceGroupName, String resourceName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection); - - /** - * Update private endpoint connection - * - * Update the status of a private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param privateEndpointConnection The private endpoint connection with updated properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection of an IotHub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner update(String resourceGroupName, String resourceName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, - Context context); - - /** - * Delete private endpoint connection - * - * Delete private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the private endpoint connection of an IotHub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, - String privateEndpointConnectionName); - - /** - * Delete private endpoint connection - * - * Delete private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the private endpoint connection of an IotHub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, - String privateEndpointConnectionName, Context context); - - /** - * Delete private endpoint connection - * - * Delete private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 resourceName, String privateEndpointConnectionName); - - /** - * Delete private endpoint connection - * - * Delete private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 resourceName, String privateEndpointConnectionName, Context context); - - /** - * List private endpoint connections - * - * List private endpoint connection properties. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response> listWithResponse(String resourceGroupName, String resourceName, - Context context); - - /** - * List private endpoint connections - * - * List private endpoint connection properties. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - List list(String resourceGroupName, String resourceName); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/PrivateLinkResourcesOperationsClient.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/PrivateLinkResourcesOperationsClient.java deleted file mode 100644 index d33e4b1f29ad..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/PrivateLinkResourcesOperationsClient.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.iothub.fluent.models.GroupIdInformationInner; -import com.azure.resourcemanager.iothub.fluent.models.PrivateLinkResourcesInner; - -/** - * An instance of this class provides access to all the operations defined in PrivateLinkResourcesOperationsClient. - */ -public interface PrivateLinkResourcesOperationsClient { - /** - * Get the specified private link resource - * - * Get the specified private link resource for the given IotHub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param groupId The name of the private link resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 private link resource - * - * Get the specified private link resource for the given IotHub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String resourceName, String groupId, - Context context); - - /** - * Get the specified private link resource - * - * Get the specified private link resource for the given IotHub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param groupId The name of the private link resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 private link resource - * - * Get the specified private link resource for the given IotHub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupIdInformationInner get(String resourceGroupName, String resourceName, String groupId); - - /** - * List private link resources - * - * List private link resources for the given IotHub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 private link resources for an IotHub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String resourceGroupName, String resourceName, - Context context); - - /** - * List private link resources - * - * List private link resources for the given IotHub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 private link resources for an IotHub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkResourcesInner list(String resourceGroupName, String resourceName); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/ResourceProviderCommonsClient.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/ResourceProviderCommonsClient.java deleted file mode 100644 index 4a9ea536a64c..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/ResourceProviderCommonsClient.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.iothub.fluent.models.UserSubscriptionQuotaListResultInner; - -/** - * An instance of this class provides access to all the operations defined in ResourceProviderCommonsClient. - */ -public interface ResourceProviderCommonsClient { - /** - * Get the number of iot hubs in the subscription - * - * Get the number of free and paid iot hubs in the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the number of iot hubs in the subscription - * - * Get the number of free and paid iot hubs in the subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSubscriptionQuotaWithResponse(Context context); - - /** - * Get the number of iot hubs in the subscription - * - * Get the number of free and paid iot hubs in the subscription. - * - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the number of iot hubs in the subscription - * - * Get the number of free and paid iot hubs in the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - UserSubscriptionQuotaListResultInner getSubscriptionQuota(); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateDescriptionInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateDescriptionInner.java deleted file mode 100644 index 9dcbf6dac452..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateDescriptionInner.java +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.iothub.models.CertificateProperties; -import java.io.IOException; - -/** - * The X509 Certificate. - */ -@Fluent -public final class CertificateDescriptionInner extends ProxyResource { - /* - * The description of an X509 CA Certificate. - */ - private CertificateProperties properties; - - /* - * The entity tag. - */ - private String etag; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of CertificateDescriptionInner class. - */ - public CertificateDescriptionInner() { - } - - /** - * Get the properties property: The description of an X509 CA Certificate. - * - * @return the properties value. - */ - public CertificateProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The description of an X509 CA Certificate. - * - * @param properties the properties value to set. - * @return the CertificateDescriptionInner object itself. - */ - public CertificateDescriptionInner withProperties(CertificateProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the etag property: The entity tag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CertificateDescriptionInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CertificateDescriptionInner 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 CertificateDescriptionInner. - */ - public static CertificateDescriptionInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CertificateDescriptionInner deserializedCertificateDescriptionInner = new CertificateDescriptionInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedCertificateDescriptionInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedCertificateDescriptionInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedCertificateDescriptionInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedCertificateDescriptionInner.properties = CertificateProperties.fromJson(reader); - } else if ("etag".equals(fieldName)) { - deserializedCertificateDescriptionInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedCertificateDescriptionInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCertificateDescriptionInner; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateListDescriptionInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateListDescriptionInner.java deleted file mode 100644 index 9788e55ac284..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateListDescriptionInner.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; -import java.util.List; - -/** - * The JSON-serialized array of Certificate objects. - */ -@Immutable -public final class CertificateListDescriptionInner implements JsonSerializable { - /* - * The array of Certificate objects. - */ - private List value; - - /** - * Creates an instance of CertificateListDescriptionInner class. - */ - private CertificateListDescriptionInner() { - } - - /** - * Get the value property: The array of Certificate objects. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 CertificateListDescriptionInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CertificateListDescriptionInner 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 CertificateListDescriptionInner. - */ - public static CertificateListDescriptionInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CertificateListDescriptionInner deserializedCertificateListDescriptionInner - = new CertificateListDescriptionInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> CertificateDescriptionInner.fromJson(reader1)); - deserializedCertificateListDescriptionInner.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedCertificateListDescriptionInner; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateWithNonceDescriptionInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateWithNonceDescriptionInner.java deleted file mode 100644 index 6357f2e3c295..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateWithNonceDescriptionInner.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.iothub.models.CertificatePropertiesWithNonce; -import java.io.IOException; - -/** - * The X509 Certificate. - */ -@Immutable -public final class CertificateWithNonceDescriptionInner - implements JsonSerializable { - /* - * The description of an X509 CA Certificate including the challenge nonce issued for the Proof-Of-Possession flow. - */ - private CertificatePropertiesWithNonce properties; - - /* - * The resource identifier. - */ - private String id; - - /* - * The name of the certificate. - */ - private String name; - - /* - * The entity tag. - */ - private String etag; - - /* - * The resource type. - */ - private String type; - - /** - * Creates an instance of CertificateWithNonceDescriptionInner class. - */ - private CertificateWithNonceDescriptionInner() { - } - - /** - * Get the properties property: The description of an X509 CA Certificate including the challenge nonce issued for - * the Proof-Of-Possession flow. - * - * @return the properties value. - */ - public CertificatePropertiesWithNonce properties() { - return this.properties; - } - - /** - * Get the id property: The resource identifier. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the name property: The name of the certificate. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the etag property: The entity tag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the type property: The resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CertificateWithNonceDescriptionInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CertificateWithNonceDescriptionInner 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 CertificateWithNonceDescriptionInner. - */ - public static CertificateWithNonceDescriptionInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CertificateWithNonceDescriptionInner deserializedCertificateWithNonceDescriptionInner - = new CertificateWithNonceDescriptionInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedCertificateWithNonceDescriptionInner.properties - = CertificatePropertiesWithNonce.fromJson(reader); - } else if ("id".equals(fieldName)) { - deserializedCertificateWithNonceDescriptionInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedCertificateWithNonceDescriptionInner.name = reader.getString(); - } else if ("etag".equals(fieldName)) { - deserializedCertificateWithNonceDescriptionInner.etag = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedCertificateWithNonceDescriptionInner.type = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCertificateWithNonceDescriptionInner; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/EndpointHealthDataInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/EndpointHealthDataInner.java deleted file mode 100644 index 25f5ccfc1a78..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/EndpointHealthDataInner.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.DateTimeRfc1123; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.iothub.models.EndpointHealthStatus; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Objects; - -/** - * The health data for an endpoint. - */ -@Immutable -public final class EndpointHealthDataInner implements JsonSerializable { - /* - * Id of the endpoint - */ - private String endpointId; - - /* - * Health statuses have following meanings. The 'healthy' status shows that the endpoint is accepting messages as - * expected. The 'unhealthy' status shows that the endpoint is not accepting messages as expected and IoT Hub is - * retrying to send data to this endpoint. The status of an unhealthy endpoint will be updated to healthy when IoT - * Hub has established an eventually consistent state of health. The 'dead' status shows that the endpoint is not - * accepting messages, after IoT Hub retried sending messages for the retrial period. See IoT Hub metrics to - * identify errors and monitor issues with endpoints. The 'unknown' status shows that the IoT Hub has not - * established a connection with the endpoint. No messages have been delivered to or rejected from this endpoint - */ - private EndpointHealthStatus healthStatus; - - /* - * Last error obtained when a message failed to be delivered to iot hub - */ - private String lastKnownError; - - /* - * Time at which the last known error occurred - */ - private DateTimeRfc1123 lastKnownErrorTime; - - /* - * Last time iot hub successfully sent a message to the endpoint - */ - private DateTimeRfc1123 lastSuccessfulSendAttemptTime; - - /* - * Last time iot hub tried to send a message to the endpoint - */ - private DateTimeRfc1123 lastSendAttemptTime; - - /** - * Creates an instance of EndpointHealthDataInner class. - */ - private EndpointHealthDataInner() { - } - - /** - * Get the endpointId property: Id of the endpoint. - * - * @return the endpointId value. - */ - public String endpointId() { - return this.endpointId; - } - - /** - * Get the healthStatus property: Health statuses have following meanings. The 'healthy' status shows that the - * endpoint is accepting messages as expected. The 'unhealthy' status shows that the endpoint is not accepting - * messages as expected and IoT Hub is retrying to send data to this endpoint. The status of an unhealthy endpoint - * will be updated to healthy when IoT Hub has established an eventually consistent state of health. The 'dead' - * status shows that the endpoint is not accepting messages, after IoT Hub retried sending messages for the retrial - * period. See IoT Hub metrics to identify errors and monitor issues with endpoints. The 'unknown' status shows that - * the IoT Hub has not established a connection with the endpoint. No messages have been delivered to or rejected - * from this endpoint. - * - * @return the healthStatus value. - */ - public EndpointHealthStatus healthStatus() { - return this.healthStatus; - } - - /** - * Get the lastKnownError property: Last error obtained when a message failed to be delivered to iot hub. - * - * @return the lastKnownError value. - */ - public String lastKnownError() { - return this.lastKnownError; - } - - /** - * Get the lastKnownErrorTime property: Time at which the last known error occurred. - * - * @return the lastKnownErrorTime value. - */ - public OffsetDateTime lastKnownErrorTime() { - if (this.lastKnownErrorTime == null) { - return null; - } - return this.lastKnownErrorTime.getDateTime(); - } - - /** - * Get the lastSuccessfulSendAttemptTime property: Last time iot hub successfully sent a message to the endpoint. - * - * @return the lastSuccessfulSendAttemptTime value. - */ - public OffsetDateTime lastSuccessfulSendAttemptTime() { - if (this.lastSuccessfulSendAttemptTime == null) { - return null; - } - return this.lastSuccessfulSendAttemptTime.getDateTime(); - } - - /** - * Get the lastSendAttemptTime property: Last time iot hub tried to send a message to the endpoint. - * - * @return the lastSendAttemptTime value. - */ - public OffsetDateTime lastSendAttemptTime() { - if (this.lastSendAttemptTime == null) { - return null; - } - return this.lastSendAttemptTime.getDateTime(); - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("endpointId", this.endpointId); - jsonWriter.writeStringField("healthStatus", this.healthStatus == null ? null : this.healthStatus.toString()); - jsonWriter.writeStringField("lastKnownError", this.lastKnownError); - jsonWriter.writeStringField("lastKnownErrorTime", Objects.toString(this.lastKnownErrorTime, null)); - jsonWriter.writeStringField("lastSuccessfulSendAttemptTime", - Objects.toString(this.lastSuccessfulSendAttemptTime, null)); - jsonWriter.writeStringField("lastSendAttemptTime", Objects.toString(this.lastSendAttemptTime, null)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EndpointHealthDataInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EndpointHealthDataInner 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 EndpointHealthDataInner. - */ - public static EndpointHealthDataInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EndpointHealthDataInner deserializedEndpointHealthDataInner = new EndpointHealthDataInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("endpointId".equals(fieldName)) { - deserializedEndpointHealthDataInner.endpointId = reader.getString(); - } else if ("healthStatus".equals(fieldName)) { - deserializedEndpointHealthDataInner.healthStatus - = EndpointHealthStatus.fromString(reader.getString()); - } else if ("lastKnownError".equals(fieldName)) { - deserializedEndpointHealthDataInner.lastKnownError = reader.getString(); - } else if ("lastKnownErrorTime".equals(fieldName)) { - deserializedEndpointHealthDataInner.lastKnownErrorTime - = reader.getNullable(nonNullReader -> new DateTimeRfc1123(nonNullReader.getString())); - } else if ("lastSuccessfulSendAttemptTime".equals(fieldName)) { - deserializedEndpointHealthDataInner.lastSuccessfulSendAttemptTime - = reader.getNullable(nonNullReader -> new DateTimeRfc1123(nonNullReader.getString())); - } else if ("lastSendAttemptTime".equals(fieldName)) { - deserializedEndpointHealthDataInner.lastSendAttemptTime - = reader.getNullable(nonNullReader -> new DateTimeRfc1123(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedEndpointHealthDataInner; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/EventHubConsumerGroupInfoInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/EventHubConsumerGroupInfoInner.java deleted file mode 100644 index 7c275f32eaad..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/EventHubConsumerGroupInfoInner.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.Map; - -/** - * The properties of the EventHubConsumerGroupInfo object. - */ -@Immutable -public final class EventHubConsumerGroupInfoInner extends ProxyResource { - /* - * The tags. - */ - private Map properties; - - /* - * The etag. - */ - private String etag; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of EventHubConsumerGroupInfoInner class. - */ - private EventHubConsumerGroupInfoInner() { - } - - /** - * Get the properties property: The tags. - * - * @return the properties value. - */ - public Map properties() { - return this.properties; - } - - /** - * Get the etag property: The etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeMapField("properties", this.properties, (writer, element) -> writer.writeUntyped(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EventHubConsumerGroupInfoInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EventHubConsumerGroupInfoInner 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 EventHubConsumerGroupInfoInner. - */ - public static EventHubConsumerGroupInfoInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EventHubConsumerGroupInfoInner deserializedEventHubConsumerGroupInfoInner - = new EventHubConsumerGroupInfoInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedEventHubConsumerGroupInfoInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedEventHubConsumerGroupInfoInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedEventHubConsumerGroupInfoInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - Map properties = reader.readMap(reader1 -> reader1.readUntyped()); - deserializedEventHubConsumerGroupInfoInner.properties = properties; - } else if ("etag".equals(fieldName)) { - deserializedEventHubConsumerGroupInfoInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedEventHubConsumerGroupInfoInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedEventHubConsumerGroupInfoInner; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/GroupIdInformationInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/GroupIdInformationInner.java deleted file mode 100644 index 543e740e2f81..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/GroupIdInformationInner.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.iothub.models.GroupIdInformationProperties; -import java.io.IOException; - -/** - * The group information for creating a private endpoint on an IotHub. - */ -@Immutable -public final class GroupIdInformationInner implements JsonSerializable { - /* - * The resource identifier. - */ - private String id; - - /* - * The resource name. - */ - private String name; - - /* - * The resource type. - */ - private String type; - - /* - * The properties for a group information object - */ - private GroupIdInformationProperties properties; - - /** - * Creates an instance of GroupIdInformationInner class. - */ - private GroupIdInformationInner() { - } - - /** - * Get the id property: The resource identifier. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the name property: The resource name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the type property: The resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the properties property: The properties for a group information object. - * - * @return the properties value. - */ - public GroupIdInformationProperties properties() { - return this.properties; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupIdInformationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupIdInformationInner 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 GroupIdInformationInner. - */ - public static GroupIdInformationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupIdInformationInner deserializedGroupIdInformationInner = new GroupIdInformationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedGroupIdInformationInner.properties = GroupIdInformationProperties.fromJson(reader); - } else if ("id".equals(fieldName)) { - deserializedGroupIdInformationInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGroupIdInformationInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGroupIdInformationInner.type = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupIdInformationInner; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubDescriptionInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubDescriptionInner.java deleted file mode 100644 index 930e787a9b42..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubDescriptionInner.java +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.fluent.models; - -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.iothub.models.ArmIdentity; -import com.azure.resourcemanager.iothub.models.IotHubProperties; -import com.azure.resourcemanager.iothub.models.IotHubSkuInfo; -import java.io.IOException; -import java.util.Map; - -/** - * The description of the IoT hub. - */ -@Fluent -public final class IotHubDescriptionInner extends Resource { - /* - * IotHub properties - */ - private IotHubProperties properties; - - /* - * The Etag field is *not* required. If it is provided in the response body, it must also be provided as a header - * per the normal ETag convention. - */ - private String etag; - - /* - * IotHub SKU info - */ - private IotHubSkuInfo sku; - - /* - * The managed identities for the IotHub. - */ - private ArmIdentity identity; - - /* - * 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 IotHubDescriptionInner class. - */ - public IotHubDescriptionInner() { - } - - /** - * Get the properties property: IotHub properties. - * - * @return the properties value. - */ - public IotHubProperties properties() { - return this.properties; - } - - /** - * Set the properties property: IotHub properties. - * - * @param properties the properties value to set. - * @return the IotHubDescriptionInner object itself. - */ - public IotHubDescriptionInner withProperties(IotHubProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the etag property: The Etag field is *not* required. If it is provided in the response body, it must also be - * provided as a header per the normal ETag convention. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: The Etag field is *not* required. If it is provided in the response body, it must also be - * provided as a header per the normal ETag convention. - * - * @param etag the etag value to set. - * @return the IotHubDescriptionInner object itself. - */ - public IotHubDescriptionInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the sku property: IotHub SKU info. - * - * @return the sku value. - */ - public IotHubSkuInfo sku() { - return this.sku; - } - - /** - * Set the sku property: IotHub SKU info. - * - * @param sku the sku value to set. - * @return the IotHubDescriptionInner object itself. - */ - public IotHubDescriptionInner withSku(IotHubSkuInfo sku) { - this.sku = sku; - return this; - } - - /** - * Get the identity property: The managed identities for the IotHub. - * - * @return the identity value. - */ - public ArmIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: The managed identities for the IotHub. - * - * @param identity the identity value to set. - * @return the IotHubDescriptionInner object itself. - */ - public IotHubDescriptionInner withIdentity(ArmIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public IotHubDescriptionInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IotHubDescriptionInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("sku", this.sku); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeStringField("etag", this.etag); - jsonWriter.writeJsonField("identity", this.identity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IotHubDescriptionInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IotHubDescriptionInner 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 IotHubDescriptionInner. - */ - public static IotHubDescriptionInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IotHubDescriptionInner deserializedIotHubDescriptionInner = new IotHubDescriptionInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedIotHubDescriptionInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedIotHubDescriptionInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedIotHubDescriptionInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedIotHubDescriptionInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedIotHubDescriptionInner.withTags(tags); - } else if ("sku".equals(fieldName)) { - deserializedIotHubDescriptionInner.sku = IotHubSkuInfo.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedIotHubDescriptionInner.properties = IotHubProperties.fromJson(reader); - } else if ("etag".equals(fieldName)) { - deserializedIotHubDescriptionInner.etag = reader.getString(); - } else if ("identity".equals(fieldName)) { - deserializedIotHubDescriptionInner.identity = ArmIdentity.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedIotHubDescriptionInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedIotHubDescriptionInner; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubNameAvailabilityInfoInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubNameAvailabilityInfoInner.java deleted file mode 100644 index 8337e38be16b..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubNameAvailabilityInfoInner.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.iothub.models.IotHubNameUnavailabilityReason; -import java.io.IOException; - -/** - * The properties indicating whether a given IoT hub name is available. - */ -@Immutable -public final class IotHubNameAvailabilityInfoInner implements JsonSerializable { - /* - * The value which indicates whether the provided name is available. - */ - private Boolean nameAvailable; - - /* - * The reason for unavailability. - */ - private IotHubNameUnavailabilityReason reason; - - /* - * The detailed reason message. - */ - private String message; - - /** - * Creates an instance of IotHubNameAvailabilityInfoInner class. - */ - private IotHubNameAvailabilityInfoInner() { - } - - /** - * Get the nameAvailable property: The value which indicates whether the provided name is available. - * - * @return the nameAvailable value. - */ - public Boolean nameAvailable() { - return this.nameAvailable; - } - - /** - * Get the reason property: The reason for unavailability. - * - * @return the reason value. - */ - public IotHubNameUnavailabilityReason reason() { - return this.reason; - } - - /** - * Get the message property: The detailed reason message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("message", this.message); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IotHubNameAvailabilityInfoInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IotHubNameAvailabilityInfoInner 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 IotHubNameAvailabilityInfoInner. - */ - public static IotHubNameAvailabilityInfoInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IotHubNameAvailabilityInfoInner deserializedIotHubNameAvailabilityInfoInner - = new IotHubNameAvailabilityInfoInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nameAvailable".equals(fieldName)) { - deserializedIotHubNameAvailabilityInfoInner.nameAvailable - = reader.getNullable(JsonReader::getBoolean); - } else if ("reason".equals(fieldName)) { - deserializedIotHubNameAvailabilityInfoInner.reason - = IotHubNameUnavailabilityReason.fromString(reader.getString()); - } else if ("message".equals(fieldName)) { - deserializedIotHubNameAvailabilityInfoInner.message = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedIotHubNameAvailabilityInfoInner; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubQuotaMetricInfoInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubQuotaMetricInfoInner.java deleted file mode 100644 index a69388e52890..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubQuotaMetricInfoInner.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * Quota metrics properties. - */ -@Immutable -public final class IotHubQuotaMetricInfoInner implements JsonSerializable { - /* - * The name of the quota metric. - */ - private String name; - - /* - * The current value for the quota metric. - */ - private Long currentValue; - - /* - * The maximum value of the quota metric. - */ - private Long maxValue; - - /** - * Creates an instance of IotHubQuotaMetricInfoInner class. - */ - private IotHubQuotaMetricInfoInner() { - } - - /** - * Get the name property: The name of the quota metric. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the currentValue property: The current value for the quota metric. - * - * @return the currentValue value. - */ - public Long currentValue() { - return this.currentValue; - } - - /** - * Get the maxValue property: The maximum value of the quota metric. - * - * @return the maxValue value. - */ - public Long maxValue() { - return this.maxValue; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IotHubQuotaMetricInfoInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IotHubQuotaMetricInfoInner 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 IotHubQuotaMetricInfoInner. - */ - public static IotHubQuotaMetricInfoInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IotHubQuotaMetricInfoInner deserializedIotHubQuotaMetricInfoInner = new IotHubQuotaMetricInfoInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedIotHubQuotaMetricInfoInner.name = reader.getString(); - } else if ("currentValue".equals(fieldName)) { - deserializedIotHubQuotaMetricInfoInner.currentValue = reader.getNullable(JsonReader::getLong); - } else if ("maxValue".equals(fieldName)) { - deserializedIotHubQuotaMetricInfoInner.maxValue = reader.getNullable(JsonReader::getLong); - } else { - reader.skipChildren(); - } - } - - return deserializedIotHubQuotaMetricInfoInner; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubSkuDescriptionInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubSkuDescriptionInner.java deleted file mode 100644 index 1e761b6828c3..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubSkuDescriptionInner.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.iothub.models.IotHubCapacity; -import com.azure.resourcemanager.iothub.models.IotHubSkuInfo; -import java.io.IOException; - -/** - * SKU properties. - */ -@Immutable -public final class IotHubSkuDescriptionInner implements JsonSerializable { - /* - * The type of the resource. - */ - private String resourceType; - - /* - * The type of the resource. - */ - private IotHubSkuInfo sku; - - /* - * IotHub capacity - */ - private IotHubCapacity capacity; - - /** - * Creates an instance of IotHubSkuDescriptionInner class. - */ - private IotHubSkuDescriptionInner() { - } - - /** - * Get the resourceType property: The type of the resource. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Get the sku property: The type of the resource. - * - * @return the sku value. - */ - public IotHubSkuInfo sku() { - return this.sku; - } - - /** - * Get the capacity property: IotHub capacity. - * - * @return the capacity value. - */ - public IotHubCapacity capacity() { - return this.capacity; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("sku", this.sku); - jsonWriter.writeJsonField("capacity", this.capacity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IotHubSkuDescriptionInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IotHubSkuDescriptionInner 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 IotHubSkuDescriptionInner. - */ - public static IotHubSkuDescriptionInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IotHubSkuDescriptionInner deserializedIotHubSkuDescriptionInner = new IotHubSkuDescriptionInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sku".equals(fieldName)) { - deserializedIotHubSkuDescriptionInner.sku = IotHubSkuInfo.fromJson(reader); - } else if ("capacity".equals(fieldName)) { - deserializedIotHubSkuDescriptionInner.capacity = IotHubCapacity.fromJson(reader); - } else if ("resourceType".equals(fieldName)) { - deserializedIotHubSkuDescriptionInner.resourceType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedIotHubSkuDescriptionInner; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/JobResponseInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/JobResponseInner.java deleted file mode 100644 index 0bf1a374418d..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/JobResponseInner.java +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.DateTimeRfc1123; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.iothub.models.JobStatus; -import com.azure.resourcemanager.iothub.models.JobType; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * The properties of the Job Response object. - */ -@Immutable -public final class JobResponseInner implements JsonSerializable { - /* - * The job identifier. - */ - private String jobId; - - /* - * The start time of the job. - */ - private DateTimeRfc1123 startTimeUtc; - - /* - * The time the job stopped processing. - */ - private DateTimeRfc1123 endTimeUtc; - - /* - * The type of the job. - */ - private JobType type; - - /* - * The status of the job. - */ - private JobStatus status; - - /* - * If status == failed, this string containing the reason for the failure. - */ - private String failureReason; - - /* - * The status message for the job. - */ - private String statusMessage; - - /* - * The job identifier of the parent job, if any. - */ - private String parentJobId; - - /** - * Creates an instance of JobResponseInner class. - */ - private JobResponseInner() { - } - - /** - * Get the jobId property: The job identifier. - * - * @return the jobId value. - */ - public String jobId() { - return this.jobId; - } - - /** - * Get the startTimeUtc property: The start time of the job. - * - * @return the startTimeUtc value. - */ - public OffsetDateTime startTimeUtc() { - if (this.startTimeUtc == null) { - return null; - } - return this.startTimeUtc.getDateTime(); - } - - /** - * Get the endTimeUtc property: The time the job stopped processing. - * - * @return the endTimeUtc value. - */ - public OffsetDateTime endTimeUtc() { - if (this.endTimeUtc == null) { - return null; - } - return this.endTimeUtc.getDateTime(); - } - - /** - * Get the type property: The type of the job. - * - * @return the type value. - */ - public JobType type() { - return this.type; - } - - /** - * Get the status property: The status of the job. - * - * @return the status value. - */ - public JobStatus status() { - return this.status; - } - - /** - * Get the failureReason property: If status == failed, this string containing the reason for the failure. - * - * @return the failureReason value. - */ - public String failureReason() { - return this.failureReason; - } - - /** - * Get the statusMessage property: The status message for the job. - * - * @return the statusMessage value. - */ - public String statusMessage() { - return this.statusMessage; - } - - /** - * Get the parentJobId property: The job identifier of the parent job, if any. - * - * @return the parentJobId value. - */ - public String parentJobId() { - return this.parentJobId; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of JobResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of JobResponseInner 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 JobResponseInner. - */ - public static JobResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - JobResponseInner deserializedJobResponseInner = new JobResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("jobId".equals(fieldName)) { - deserializedJobResponseInner.jobId = reader.getString(); - } else if ("startTimeUtc".equals(fieldName)) { - deserializedJobResponseInner.startTimeUtc - = reader.getNullable(nonNullReader -> new DateTimeRfc1123(nonNullReader.getString())); - } else if ("endTimeUtc".equals(fieldName)) { - deserializedJobResponseInner.endTimeUtc - = reader.getNullable(nonNullReader -> new DateTimeRfc1123(nonNullReader.getString())); - } else if ("type".equals(fieldName)) { - deserializedJobResponseInner.type = JobType.fromString(reader.getString()); - } else if ("status".equals(fieldName)) { - deserializedJobResponseInner.status = JobStatus.fromString(reader.getString()); - } else if ("failureReason".equals(fieldName)) { - deserializedJobResponseInner.failureReason = reader.getString(); - } else if ("statusMessage".equals(fieldName)) { - deserializedJobResponseInner.statusMessage = reader.getString(); - } else if ("parentJobId".equals(fieldName)) { - deserializedJobResponseInner.parentJobId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedJobResponseInner; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/OperationInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/OperationInner.java deleted file mode 100644 index e14660b8b8d9..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/OperationInner.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.iothub.models.OperationDisplay; -import java.io.IOException; - -/** - * IoT Hub REST API operation. - */ -@Immutable -public final class OperationInner implements JsonSerializable { - /* - * Operation name: {provider}/{resource}/{read | write | action | delete} - */ - private String name; - - /* - * The object that represents the operation. - */ - private OperationDisplay display; - - /** - * Creates an instance of OperationInner class. - */ - private OperationInner() { - } - - /** - * Get the name property: Operation name: {provider}/{resource}/{read | write | action | delete}. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the display property: The object that represents the operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - 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 ("display".equals(fieldName)) { - deserializedOperationInner.display = OperationDisplay.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationInner; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/PrivateEndpointConnectionInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/PrivateEndpointConnectionInner.java deleted file mode 100644 index 198945b55e13..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/PrivateEndpointConnectionInner.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.iothub.models.PrivateEndpointConnectionProperties; -import java.io.IOException; - -/** - * The private endpoint connection of an IotHub. - */ -@Fluent -public final class PrivateEndpointConnectionInner extends ProxyResource { - /* - * The properties of a private endpoint connection - */ - private PrivateEndpointConnectionProperties 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 PrivateEndpointConnectionInner class. - */ - public PrivateEndpointConnectionInner() { - } - - /** - * Get the properties property: The properties of a private endpoint connection. - * - * @return the properties value. - */ - public PrivateEndpointConnectionProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The properties of a private endpoint connection. - * - * @param properties the properties value to set. - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner withProperties(PrivateEndpointConnectionProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateEndpointConnectionInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpointConnectionInner 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 PrivateEndpointConnectionInner. - */ - public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpointConnectionInner deserializedPrivateEndpointConnectionInner - = new PrivateEndpointConnectionInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.properties - = PrivateEndpointConnectionProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpointConnectionInner; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/PrivateLinkResourcesInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/PrivateLinkResourcesInner.java deleted file mode 100644 index ec9b3f60a749..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/PrivateLinkResourcesInner.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; -import java.util.List; - -/** - * The available private link resources for an IotHub. - */ -@Immutable -public final class PrivateLinkResourcesInner implements JsonSerializable { - /* - * The list of available private link resources for an IotHub - */ - private List value; - - /** - * Creates an instance of PrivateLinkResourcesInner class. - */ - private PrivateLinkResourcesInner() { - } - - /** - * Get the value property: The list of available private link resources for an IotHub. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 PrivateLinkResourcesInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateLinkResourcesInner 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 PrivateLinkResourcesInner. - */ - public static PrivateLinkResourcesInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateLinkResourcesInner deserializedPrivateLinkResourcesInner = new PrivateLinkResourcesInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> GroupIdInformationInner.fromJson(reader1)); - deserializedPrivateLinkResourcesInner.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateLinkResourcesInner; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/RegistryStatisticsInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/RegistryStatisticsInner.java deleted file mode 100644 index 8f1ccf9dcc55..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/RegistryStatisticsInner.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * Identity registry statistics. - */ -@Immutable -public final class RegistryStatisticsInner implements JsonSerializable { - /* - * The total count of devices in the identity registry. - */ - private Long totalDeviceCount; - - /* - * The count of enabled devices in the identity registry. - */ - private Long enabledDeviceCount; - - /* - * The count of disabled devices in the identity registry. - */ - private Long disabledDeviceCount; - - /** - * Creates an instance of RegistryStatisticsInner class. - */ - private RegistryStatisticsInner() { - } - - /** - * Get the totalDeviceCount property: The total count of devices in the identity registry. - * - * @return the totalDeviceCount value. - */ - public Long totalDeviceCount() { - return this.totalDeviceCount; - } - - /** - * Get the enabledDeviceCount property: The count of enabled devices in the identity registry. - * - * @return the enabledDeviceCount value. - */ - public Long enabledDeviceCount() { - return this.enabledDeviceCount; - } - - /** - * Get the disabledDeviceCount property: The count of disabled devices in the identity registry. - * - * @return the disabledDeviceCount value. - */ - public Long disabledDeviceCount() { - return this.disabledDeviceCount; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RegistryStatisticsInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RegistryStatisticsInner 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 RegistryStatisticsInner. - */ - public static RegistryStatisticsInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RegistryStatisticsInner deserializedRegistryStatisticsInner = new RegistryStatisticsInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("totalDeviceCount".equals(fieldName)) { - deserializedRegistryStatisticsInner.totalDeviceCount = reader.getNullable(JsonReader::getLong); - } else if ("enabledDeviceCount".equals(fieldName)) { - deserializedRegistryStatisticsInner.enabledDeviceCount = reader.getNullable(JsonReader::getLong); - } else if ("disabledDeviceCount".equals(fieldName)) { - deserializedRegistryStatisticsInner.disabledDeviceCount = reader.getNullable(JsonReader::getLong); - } else { - reader.skipChildren(); - } - } - - return deserializedRegistryStatisticsInner; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/SharedAccessSignatureAuthorizationRuleInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/SharedAccessSignatureAuthorizationRuleInner.java deleted file mode 100644 index 80aadb9b4233..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/SharedAccessSignatureAuthorizationRuleInner.java +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.iothub.models.AccessRights; -import java.io.IOException; - -/** - * The properties of an IoT hub shared access policy. - */ -@Fluent -public final class SharedAccessSignatureAuthorizationRuleInner - implements JsonSerializable { - /* - * The name of the shared access policy. - */ - private String keyName; - - /* - * The primary key. - */ - private String primaryKey; - - /* - * The secondary key. - */ - private String secondaryKey; - - /* - * The permissions assigned to the shared access policy. - */ - private AccessRights rights; - - /** - * Creates an instance of SharedAccessSignatureAuthorizationRuleInner class. - */ - public SharedAccessSignatureAuthorizationRuleInner() { - } - - /** - * Get the keyName property: The name of the shared access policy. - * - * @return the keyName value. - */ - public String keyName() { - return this.keyName; - } - - /** - * Set the keyName property: The name of the shared access policy. - * - * @param keyName the keyName value to set. - * @return the SharedAccessSignatureAuthorizationRuleInner object itself. - */ - public SharedAccessSignatureAuthorizationRuleInner withKeyName(String keyName) { - this.keyName = keyName; - return this; - } - - /** - * Get the primaryKey property: The primary key. - * - * @return the primaryKey value. - */ - public String primaryKey() { - return this.primaryKey; - } - - /** - * Set the primaryKey property: The primary key. - * - * @param primaryKey the primaryKey value to set. - * @return the SharedAccessSignatureAuthorizationRuleInner object itself. - */ - public SharedAccessSignatureAuthorizationRuleInner withPrimaryKey(String primaryKey) { - this.primaryKey = primaryKey; - return this; - } - - /** - * Get the secondaryKey property: The secondary key. - * - * @return the secondaryKey value. - */ - public String secondaryKey() { - return this.secondaryKey; - } - - /** - * Set the secondaryKey property: The secondary key. - * - * @param secondaryKey the secondaryKey value to set. - * @return the SharedAccessSignatureAuthorizationRuleInner object itself. - */ - public SharedAccessSignatureAuthorizationRuleInner withSecondaryKey(String secondaryKey) { - this.secondaryKey = secondaryKey; - return this; - } - - /** - * Get the rights property: The permissions assigned to the shared access policy. - * - * @return the rights value. - */ - public AccessRights rights() { - return this.rights; - } - - /** - * Set the rights property: The permissions assigned to the shared access policy. - * - * @param rights the rights value to set. - * @return the SharedAccessSignatureAuthorizationRuleInner object itself. - */ - public SharedAccessSignatureAuthorizationRuleInner withRights(AccessRights rights) { - this.rights = rights; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("keyName", this.keyName); - jsonWriter.writeStringField("rights", this.rights == null ? null : this.rights.toString()); - jsonWriter.writeStringField("primaryKey", this.primaryKey); - jsonWriter.writeStringField("secondaryKey", this.secondaryKey); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SharedAccessSignatureAuthorizationRuleInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SharedAccessSignatureAuthorizationRuleInner 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 SharedAccessSignatureAuthorizationRuleInner. - */ - public static SharedAccessSignatureAuthorizationRuleInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SharedAccessSignatureAuthorizationRuleInner deserializedSharedAccessSignatureAuthorizationRuleInner - = new SharedAccessSignatureAuthorizationRuleInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("keyName".equals(fieldName)) { - deserializedSharedAccessSignatureAuthorizationRuleInner.keyName = reader.getString(); - } else if ("rights".equals(fieldName)) { - deserializedSharedAccessSignatureAuthorizationRuleInner.rights - = AccessRights.fromString(reader.getString()); - } else if ("primaryKey".equals(fieldName)) { - deserializedSharedAccessSignatureAuthorizationRuleInner.primaryKey = reader.getString(); - } else if ("secondaryKey".equals(fieldName)) { - deserializedSharedAccessSignatureAuthorizationRuleInner.secondaryKey = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSharedAccessSignatureAuthorizationRuleInner; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/TestAllRoutesResultInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/TestAllRoutesResultInner.java deleted file mode 100644 index a7873ceb5135..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/TestAllRoutesResultInner.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.iothub.models.MatchedRoute; -import java.io.IOException; -import java.util.List; - -/** - * Result of testing all routes. - */ -@Immutable -public final class TestAllRoutesResultInner implements JsonSerializable { - /* - * JSON-serialized array of matched routes - */ - private List routes; - - /** - * Creates an instance of TestAllRoutesResultInner class. - */ - private TestAllRoutesResultInner() { - } - - /** - * Get the routes property: JSON-serialized array of matched routes. - * - * @return the routes value. - */ - public List routes() { - return this.routes; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("routes", this.routes, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of TestAllRoutesResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TestAllRoutesResultInner 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 TestAllRoutesResultInner. - */ - public static TestAllRoutesResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - TestAllRoutesResultInner deserializedTestAllRoutesResultInner = new TestAllRoutesResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("routes".equals(fieldName)) { - List routes = reader.readArray(reader1 -> MatchedRoute.fromJson(reader1)); - deserializedTestAllRoutesResultInner.routes = routes; - } else { - reader.skipChildren(); - } - } - - return deserializedTestAllRoutesResultInner; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/TestRouteResultInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/TestRouteResultInner.java deleted file mode 100644 index 6f4f623c0708..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/TestRouteResultInner.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.iothub.models.TestResultStatus; -import com.azure.resourcemanager.iothub.models.TestRouteResultDetails; -import java.io.IOException; - -/** - * Result of testing one route. - */ -@Immutable -public final class TestRouteResultInner implements JsonSerializable { - /* - * Result of testing route - */ - private TestResultStatus result; - - /* - * Detailed result of testing route - */ - private TestRouteResultDetails details; - - /** - * Creates an instance of TestRouteResultInner class. - */ - private TestRouteResultInner() { - } - - /** - * Get the result property: Result of testing route. - * - * @return the result value. - */ - public TestResultStatus result() { - return this.result; - } - - /** - * Get the details property: Detailed result of testing route. - * - * @return the details value. - */ - public TestRouteResultDetails details() { - return this.details; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("result", this.result == null ? null : this.result.toString()); - jsonWriter.writeJsonField("details", this.details); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of TestRouteResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TestRouteResultInner 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 TestRouteResultInner. - */ - public static TestRouteResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - TestRouteResultInner deserializedTestRouteResultInner = new TestRouteResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("result".equals(fieldName)) { - deserializedTestRouteResultInner.result = TestResultStatus.fromString(reader.getString()); - } else if ("details".equals(fieldName)) { - deserializedTestRouteResultInner.details = TestRouteResultDetails.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedTestRouteResultInner; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/UserSubscriptionQuotaListResultInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/UserSubscriptionQuotaListResultInner.java deleted file mode 100644 index 0b4ca12fdd20..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/UserSubscriptionQuotaListResultInner.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.iothub.models.UserSubscriptionQuota; -import java.io.IOException; -import java.util.List; - -/** - * Json-serialized array of User subscription quota response. - */ -@Immutable -public final class UserSubscriptionQuotaListResultInner - implements JsonSerializable { - /* - * The UserSubscriptionQuota items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of UserSubscriptionQuotaListResultInner class. - */ - private UserSubscriptionQuotaListResultInner() { - } - - /** - * Get the value property: The UserSubscriptionQuota items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of UserSubscriptionQuotaListResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of UserSubscriptionQuotaListResultInner 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 UserSubscriptionQuotaListResultInner. - */ - public static UserSubscriptionQuotaListResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - UserSubscriptionQuotaListResultInner deserializedUserSubscriptionQuotaListResultInner - = new UserSubscriptionQuotaListResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> UserSubscriptionQuota.fromJson(reader1)); - deserializedUserSubscriptionQuotaListResultInner.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedUserSubscriptionQuotaListResultInner.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedUserSubscriptionQuotaListResultInner; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/package-info.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/package-info.java deleted file mode 100644 index d50dc54c63ae..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -/** - * Package containing the inner data models for IotHub. - * Use this API to manage the IoT hubs in your Azure subscription. - */ -package com.azure.resourcemanager.iothub.fluent.models; diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/package-info.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/package-info.java deleted file mode 100644 index 2995008341ef..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -/** - * Package containing the service clients for IotHub. - * Use this API to manage the IoT hubs in your Azure subscription. - */ -package com.azure.resourcemanager.iothub.fluent; diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateDescriptionImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateDescriptionImpl.java deleted file mode 100644 index 4dbc096ca513..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateDescriptionImpl.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.iothub.fluent.models.CertificateDescriptionInner; -import com.azure.resourcemanager.iothub.models.CertificateDescription; -import com.azure.resourcemanager.iothub.models.CertificateProperties; - -public final class CertificateDescriptionImpl - implements CertificateDescription, CertificateDescription.Definition, CertificateDescription.Update { - private CertificateDescriptionInner innerObject; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public CertificateProperties properties() { - return this.innerModel().properties(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public CertificateDescriptionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String resourceName; - - private String certificateName; - - private String createIfMatch; - - private String updateIfMatch; - - public CertificateDescriptionImpl withExistingIotHub(String resourceGroupName, String resourceName) { - this.resourceGroupName = resourceGroupName; - this.resourceName = resourceName; - return this; - } - - public CertificateDescription create() { - this.innerObject = serviceManager.serviceClient() - .getCertificates() - .createOrUpdateWithResponse(resourceGroupName, resourceName, certificateName, this.innerModel(), - createIfMatch, Context.NONE) - .getValue(); - return this; - } - - public CertificateDescription create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getCertificates() - .createOrUpdateWithResponse(resourceGroupName, resourceName, certificateName, this.innerModel(), - createIfMatch, context) - .getValue(); - return this; - } - - CertificateDescriptionImpl(String name, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerObject = new CertificateDescriptionInner(); - this.serviceManager = serviceManager; - this.certificateName = name; - this.createIfMatch = null; - } - - public CertificateDescriptionImpl update() { - this.updateIfMatch = null; - return this; - } - - public CertificateDescription apply() { - this.innerObject = serviceManager.serviceClient() - .getCertificates() - .createOrUpdateWithResponse(resourceGroupName, resourceName, certificateName, this.innerModel(), - updateIfMatch, Context.NONE) - .getValue(); - return this; - } - - public CertificateDescription apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getCertificates() - .createOrUpdateWithResponse(resourceGroupName, resourceName, certificateName, this.innerModel(), - updateIfMatch, context) - .getValue(); - return this; - } - - CertificateDescriptionImpl(CertificateDescriptionInner innerObject, - com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.resourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "IotHubs"); - this.certificateName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "certificates"); - } - - public CertificateDescription refresh() { - this.innerObject = serviceManager.serviceClient() - .getCertificates() - .getWithResponse(resourceGroupName, resourceName, certificateName, Context.NONE) - .getValue(); - return this; - } - - public CertificateDescription refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getCertificates() - .getWithResponse(resourceGroupName, resourceName, certificateName, context) - .getValue(); - return this; - } - - public CertificateDescriptionImpl withProperties(CertificateProperties properties) { - this.innerModel().withProperties(properties); - return this; - } - - public CertificateDescriptionImpl withIfMatch(String ifMatch) { - if (isInCreateMode()) { - this.createIfMatch = ifMatch; - return this; - } else { - this.updateIfMatch = ifMatch; - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel() == null || this.innerModel().id() == null; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateListDescriptionImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateListDescriptionImpl.java deleted file mode 100644 index f37f46359c39..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateListDescriptionImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -import com.azure.resourcemanager.iothub.fluent.models.CertificateDescriptionInner; -import com.azure.resourcemanager.iothub.fluent.models.CertificateListDescriptionInner; -import com.azure.resourcemanager.iothub.models.CertificateDescription; -import com.azure.resourcemanager.iothub.models.CertificateListDescription; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class CertificateListDescriptionImpl implements CertificateListDescription { - private CertificateListDescriptionInner innerObject; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - CertificateListDescriptionImpl(CertificateListDescriptionInner innerObject, - com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new CertificateDescriptionImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public CertificateListDescriptionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateWithNonceDescriptionImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateWithNonceDescriptionImpl.java deleted file mode 100644 index fabe9823d059..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateWithNonceDescriptionImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -import com.azure.resourcemanager.iothub.fluent.models.CertificateWithNonceDescriptionInner; -import com.azure.resourcemanager.iothub.models.CertificatePropertiesWithNonce; -import com.azure.resourcemanager.iothub.models.CertificateWithNonceDescription; - -public final class CertificateWithNonceDescriptionImpl implements CertificateWithNonceDescription { - private CertificateWithNonceDescriptionInner innerObject; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - CertificateWithNonceDescriptionImpl(CertificateWithNonceDescriptionInner innerObject, - com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public CertificatePropertiesWithNonce properties() { - return this.innerModel().properties(); - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public String type() { - return this.innerModel().type(); - } - - public CertificateWithNonceDescriptionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesClientImpl.java deleted file mode 100644 index f125b0931d19..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesClientImpl.java +++ /dev/null @@ -1,749 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.iothub.fluent.CertificatesClient; -import com.azure.resourcemanager.iothub.fluent.models.CertificateDescriptionInner; -import com.azure.resourcemanager.iothub.fluent.models.CertificateListDescriptionInner; -import com.azure.resourcemanager.iothub.fluent.models.CertificateWithNonceDescriptionInner; -import com.azure.resourcemanager.iothub.models.CertificateVerificationDescription; -import com.azure.resourcemanager.iothub.models.ErrorDetailsException; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in CertificatesClient. - */ -public final class CertificatesClientImpl implements CertificatesClient { - /** - * The proxy service used to perform REST calls. - */ - private final CertificatesService service; - - /** - * The service client containing this operation class. - */ - private final IotHubClientImpl client; - - /** - * Initializes an instance of CertificatesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CertificatesClientImpl(IotHubClientImpl client) { - this.service - = RestProxy.create(CertificatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for IotHubClientCertificates to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "IotHubClientCertificates") - public interface CertificatesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("certificateName") String certificateName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("certificateName") String certificateName, @HeaderParam("Accept") String accept, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("certificateName") String certificateName, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") CertificateDescriptionInner certificateDescription, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("certificateName") String certificateName, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") CertificateDescriptionInner certificateDescription, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("certificateName") String certificateName, @HeaderParam("If-Match") String ifMatch, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("certificateName") String certificateName, @HeaderParam("If-Match") String ifMatch, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> listByIotHub(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response listByIotHubSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/generateVerificationCode") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> generateVerificationCode( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("certificateName") String certificateName, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/generateVerificationCode") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response generateVerificationCodeSync( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("certificateName") String certificateName, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("Accept") String accept, Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/verify") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> verify(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("certificateName") String certificateName, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") CertificateVerificationDescription certificateVerificationBody, - Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/verify") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response verifySync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("certificateName") String certificateName, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") CertificateVerificationDescription certificateVerificationBody, - Context context); - } - - /** - * Get the certificate. - * - * Returns the certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate. - * - * Returns the certificate along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String resourceName, String certificateName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, certificateName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the certificate. - * - * Returns the certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate. - * - * Returns the certificate on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String resourceName, - String certificateName) { - return getWithResponseAsync(resourceGroupName, resourceName, certificateName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the certificate. - * - * Returns the certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate. - * - * Returns the certificate along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String resourceName, - String certificateName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, certificateName, accept, context); - } - - /** - * Get the certificate. - * - * Returns the certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate. - * - * Returns the certificate. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CertificateDescriptionInner get(String resourceGroupName, String resourceName, String certificateName) { - return getWithResponse(resourceGroupName, resourceName, certificateName, Context.NONE).getValue(); - } - - /** - * Upload the certificate to the IoT hub. - * - * Adds new or replaces existing certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param certificateDescription The certificate body. - * @param ifMatch ETag of the Certificate. Do not specify for creating a brand new certificate. Required to update - * an existing certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceName, String certificateName, CertificateDescriptionInner certificateDescription, - String ifMatch) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, certificateName, ifMatch, contentType, - accept, certificateDescription, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Upload the certificate to the IoT hub. - * - * Adds new or replaces existing certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param certificateDescription The certificate body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, - String certificateName, CertificateDescriptionInner certificateDescription) { - final String ifMatch = null; - return createOrUpdateWithResponseAsync(resourceGroupName, resourceName, certificateName, certificateDescription, - ifMatch).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Upload the certificate to the IoT hub. - * - * Adds new or replaces existing certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param certificateDescription The certificate body. - * @param ifMatch ETag of the Certificate. Do not specify for creating a brand new certificate. Required to update - * an existing certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, - String resourceName, String certificateName, CertificateDescriptionInner certificateDescription, String ifMatch, - Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, certificateName, ifMatch, contentType, - accept, certificateDescription, context); - } - - /** - * Upload the certificate to the IoT hub. - * - * Adds new or replaces existing certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param certificateDescription The certificate body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CertificateDescriptionInner createOrUpdate(String resourceGroupName, String resourceName, - String certificateName, CertificateDescriptionInner certificateDescription) { - final String ifMatch = null; - return createOrUpdateWithResponse(resourceGroupName, resourceName, certificateName, certificateDescription, - ifMatch, Context.NONE).getValue(); - } - - /** - * Delete an X509 certificate. - * - * Deletes an existing X509 certificate or does nothing if it does not exist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 resourceName, - String certificateName, String ifMatch) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, certificateName, ifMatch, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete an X509 certificate. - * - * Deletes an existing X509 certificate or does nothing if it does not exist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 resourceName, String certificateName, - String ifMatch) { - return deleteWithResponseAsync(resourceGroupName, resourceName, certificateName, ifMatch) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Delete an X509 certificate. - * - * Deletes an existing X509 certificate or does nothing if it does not exist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String resourceName, String certificateName, - String ifMatch, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, certificateName, ifMatch, context); - } - - /** - * Delete an X509 certificate. - * - * Deletes an existing X509 certificate or does nothing if it does not exist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 resourceName, String certificateName, String ifMatch) { - deleteWithResponse(resourceGroupName, resourceName, certificateName, ifMatch, Context.NONE); - } - - /** - * Get the certificate list. - * - * Returns the list of certificates. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate list. - * - * Returns the list of certificates along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByIotHubWithResponseAsync(String resourceGroupName, - String resourceName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByIotHub(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the certificate list. - * - * Returns the list of certificates. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate list. - * - * Returns the list of certificates on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listByIotHubAsync(String resourceGroupName, String resourceName) { - return listByIotHubWithResponseAsync(resourceGroupName, resourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the certificate list. - * - * Returns the list of certificates. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate list. - * - * Returns the list of certificates along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listByIotHubWithResponse(String resourceGroupName, - String resourceName, Context context) { - final String accept = "application/json"; - return service.listByIotHubSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); - } - - /** - * Get the certificate list. - * - * Returns the list of certificates. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate list. - * - * Returns the list of certificates. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CertificateListDescriptionInner listByIotHub(String resourceGroupName, String resourceName) { - return listByIotHubWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); - } - - /** - * Generate verification code for proof of possession flow. - * - * Generates verification code for proof of possession flow. The verification code will be used to generate a leaf - * certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> generateVerificationCodeWithResponseAsync( - String resourceGroupName, String resourceName, String certificateName, String ifMatch) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.generateVerificationCode(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, resourceName, - certificateName, ifMatch, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Generate verification code for proof of possession flow. - * - * Generates verification code for proof of possession flow. The verification code will be used to generate a leaf - * certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono generateVerificationCodeAsync(String resourceGroupName, - String resourceName, String certificateName, String ifMatch) { - return generateVerificationCodeWithResponseAsync(resourceGroupName, resourceName, certificateName, ifMatch) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Generate verification code for proof of possession flow. - * - * Generates verification code for proof of possession flow. The verification code will be used to generate a leaf - * certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response generateVerificationCodeWithResponse(String resourceGroupName, - String resourceName, String certificateName, String ifMatch, Context context) { - final String accept = "application/json"; - return service.generateVerificationCodeSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, certificateName, ifMatch, accept, - context); - } - - /** - * Generate verification code for proof of possession flow. - * - * Generates verification code for proof of possession flow. The verification code will be used to generate a leaf - * certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CertificateWithNonceDescriptionInner generateVerificationCode(String resourceGroupName, String resourceName, - String certificateName, String ifMatch) { - return generateVerificationCodeWithResponse(resourceGroupName, resourceName, certificateName, ifMatch, - Context.NONE).getValue(); - } - - /** - * Verify certificate's private key possession. - * - * Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded - * certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @param certificateVerificationBody The name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> verifyWithResponseAsync(String resourceGroupName, - String resourceName, String certificateName, String ifMatch, - CertificateVerificationDescription certificateVerificationBody) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.verify(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, certificateName, ifMatch, contentType, - accept, certificateVerificationBody, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Verify certificate's private key possession. - * - * Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded - * certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @param certificateVerificationBody The name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono verifyAsync(String resourceGroupName, String resourceName, - String certificateName, String ifMatch, CertificateVerificationDescription certificateVerificationBody) { - return verifyWithResponseAsync(resourceGroupName, resourceName, certificateName, ifMatch, - certificateVerificationBody).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Verify certificate's private key possession. - * - * Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded - * certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @param certificateVerificationBody The name of the certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response verifyWithResponse(String resourceGroupName, String resourceName, - String certificateName, String ifMatch, CertificateVerificationDescription certificateVerificationBody, - Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.verifySync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, certificateName, ifMatch, contentType, - accept, certificateVerificationBody, context); - } - - /** - * Verify certificate's private key possession. - * - * Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded - * certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @param certificateVerificationBody The name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CertificateDescriptionInner verify(String resourceGroupName, String resourceName, String certificateName, - String ifMatch, CertificateVerificationDescription certificateVerificationBody) { - return verifyWithResponse(resourceGroupName, resourceName, certificateName, ifMatch, - certificateVerificationBody, Context.NONE).getValue(); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesImpl.java deleted file mode 100644 index 46eafc562af2..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesImpl.java +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.iothub.fluent.CertificatesClient; -import com.azure.resourcemanager.iothub.fluent.models.CertificateDescriptionInner; -import com.azure.resourcemanager.iothub.fluent.models.CertificateListDescriptionInner; -import com.azure.resourcemanager.iothub.fluent.models.CertificateWithNonceDescriptionInner; -import com.azure.resourcemanager.iothub.models.CertificateDescription; -import com.azure.resourcemanager.iothub.models.CertificateListDescription; -import com.azure.resourcemanager.iothub.models.CertificateVerificationDescription; -import com.azure.resourcemanager.iothub.models.CertificateWithNonceDescription; -import com.azure.resourcemanager.iothub.models.Certificates; - -public final class CertificatesImpl implements Certificates { - private static final ClientLogger LOGGER = new ClientLogger(CertificatesImpl.class); - - private final CertificatesClient innerClient; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - public CertificatesImpl(CertificatesClient innerClient, - com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String resourceName, - String certificateName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, resourceName, certificateName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CertificateDescriptionImpl(inner.getValue(), this.manager())); - } - - public CertificateDescription get(String resourceGroupName, String resourceName, String certificateName) { - CertificateDescriptionInner inner = this.serviceClient().get(resourceGroupName, resourceName, certificateName); - if (inner != null) { - return new CertificateDescriptionImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String resourceGroupName, String resourceName, String certificateName, - String ifMatch, Context context) { - return this.serviceClient() - .deleteWithResponse(resourceGroupName, resourceName, certificateName, ifMatch, context); - } - - public void delete(String resourceGroupName, String resourceName, String certificateName, String ifMatch) { - this.serviceClient().delete(resourceGroupName, resourceName, certificateName, ifMatch); - } - - public Response listByIotHubWithResponse(String resourceGroupName, String resourceName, - Context context) { - Response inner - = this.serviceClient().listByIotHubWithResponse(resourceGroupName, resourceName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CertificateListDescriptionImpl(inner.getValue(), this.manager())); - } - - public CertificateListDescription listByIotHub(String resourceGroupName, String resourceName) { - CertificateListDescriptionInner inner = this.serviceClient().listByIotHub(resourceGroupName, resourceName); - if (inner != null) { - return new CertificateListDescriptionImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response generateVerificationCodeWithResponse(String resourceGroupName, - String resourceName, String certificateName, String ifMatch, Context context) { - Response inner = this.serviceClient() - .generateVerificationCodeWithResponse(resourceGroupName, resourceName, certificateName, ifMatch, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CertificateWithNonceDescriptionImpl(inner.getValue(), this.manager())); - } - - public CertificateWithNonceDescription generateVerificationCode(String resourceGroupName, String resourceName, - String certificateName, String ifMatch) { - CertificateWithNonceDescriptionInner inner - = this.serviceClient().generateVerificationCode(resourceGroupName, resourceName, certificateName, ifMatch); - if (inner != null) { - return new CertificateWithNonceDescriptionImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response verifyWithResponse(String resourceGroupName, String resourceName, - String certificateName, String ifMatch, CertificateVerificationDescription certificateVerificationBody, - Context context) { - Response inner = this.serviceClient() - .verifyWithResponse(resourceGroupName, resourceName, certificateName, ifMatch, certificateVerificationBody, - context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CertificateDescriptionImpl(inner.getValue(), this.manager())); - } - - public CertificateDescription verify(String resourceGroupName, String resourceName, String certificateName, - String ifMatch, CertificateVerificationDescription certificateVerificationBody) { - CertificateDescriptionInner inner = this.serviceClient() - .verify(resourceGroupName, resourceName, certificateName, ifMatch, certificateVerificationBody); - if (inner != null) { - return new CertificateDescriptionImpl(inner, this.manager()); - } else { - return null; - } - } - - public CertificateDescription 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "IotHubs"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'IotHubs'.", id))); - } - String certificateName = ResourceManagerUtils.getValueFromIdByName(id, "certificates"); - if (certificateName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); - } - return this.getWithResponse(resourceGroupName, resourceName, certificateName, 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "IotHubs"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'IotHubs'.", id))); - } - String certificateName = ResourceManagerUtils.getValueFromIdByName(id, "certificates"); - if (certificateName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); - } - return this.getWithResponse(resourceGroupName, resourceName, certificateName, 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "IotHubs"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'IotHubs'.", id))); - } - String certificateName = ResourceManagerUtils.getValueFromIdByName(id, "certificates"); - if (certificateName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); - } - String localIfMatch = null; - this.deleteWithResponse(resourceGroupName, resourceName, certificateName, localIfMatch, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, String ifMatch, 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "IotHubs"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'IotHubs'.", id))); - } - String certificateName = ResourceManagerUtils.getValueFromIdByName(id, "certificates"); - if (certificateName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); - } - return this.deleteWithResponse(resourceGroupName, resourceName, certificateName, ifMatch, context); - } - - private CertificatesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } - - public CertificateDescriptionImpl define(String name) { - return new CertificateDescriptionImpl(name, this.manager()); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/EndpointHealthDataImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/EndpointHealthDataImpl.java deleted file mode 100644 index 334263a18f73..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/EndpointHealthDataImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -import com.azure.resourcemanager.iothub.fluent.models.EndpointHealthDataInner; -import com.azure.resourcemanager.iothub.models.EndpointHealthData; -import com.azure.resourcemanager.iothub.models.EndpointHealthStatus; -import java.time.OffsetDateTime; - -public final class EndpointHealthDataImpl implements EndpointHealthData { - private EndpointHealthDataInner innerObject; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - EndpointHealthDataImpl(EndpointHealthDataInner innerObject, - com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String endpointId() { - return this.innerModel().endpointId(); - } - - public EndpointHealthStatus healthStatus() { - return this.innerModel().healthStatus(); - } - - public String lastKnownError() { - return this.innerModel().lastKnownError(); - } - - public OffsetDateTime lastKnownErrorTime() { - return this.innerModel().lastKnownErrorTime(); - } - - public OffsetDateTime lastSuccessfulSendAttemptTime() { - return this.innerModel().lastSuccessfulSendAttemptTime(); - } - - public OffsetDateTime lastSendAttemptTime() { - return this.innerModel().lastSendAttemptTime(); - } - - public EndpointHealthDataInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/EventHubConsumerGroupInfoImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/EventHubConsumerGroupInfoImpl.java deleted file mode 100644 index 8453632fd578..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/EventHubConsumerGroupInfoImpl.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.iothub.fluent.models.EventHubConsumerGroupInfoInner; -import com.azure.resourcemanager.iothub.models.EventHubConsumerGroupBodyDescription; -import com.azure.resourcemanager.iothub.models.EventHubConsumerGroupInfo; -import com.azure.resourcemanager.iothub.models.EventHubConsumerGroupName; -import java.util.Collections; -import java.util.Map; - -public final class EventHubConsumerGroupInfoImpl - implements EventHubConsumerGroupInfo, EventHubConsumerGroupInfo.Definition { - private EventHubConsumerGroupInfoInner innerObject; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - EventHubConsumerGroupInfoImpl(EventHubConsumerGroupInfoInner innerObject, - com.azure.resourcemanager.iothub.IotHubManager 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 Map properties() { - Map inner = this.innerModel().properties(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public EventHubConsumerGroupInfoInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String resourceName; - - private String eventHubEndpointName; - - private String name; - - private EventHubConsumerGroupBodyDescription createConsumerGroupBody; - - public EventHubConsumerGroupInfoImpl withExistingEventHubEndpoint(String resourceGroupName, String resourceName, - String eventHubEndpointName) { - this.resourceGroupName = resourceGroupName; - this.resourceName = resourceName; - this.eventHubEndpointName = eventHubEndpointName; - return this; - } - - public EventHubConsumerGroupInfo create() { - this.innerObject = serviceManager.serviceClient() - .getIotHubResources() - .createEventHubConsumerGroupWithResponse(resourceGroupName, resourceName, eventHubEndpointName, name, - createConsumerGroupBody, Context.NONE) - .getValue(); - return this; - } - - public EventHubConsumerGroupInfo create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getIotHubResources() - .createEventHubConsumerGroupWithResponse(resourceGroupName, resourceName, eventHubEndpointName, name, - createConsumerGroupBody, context) - .getValue(); - return this; - } - - EventHubConsumerGroupInfoImpl(String name, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.serviceManager = serviceManager; - this.name = name; - this.createConsumerGroupBody = new EventHubConsumerGroupBodyDescription(); - } - - public EventHubConsumerGroupInfo refresh() { - this.innerObject = serviceManager.serviceClient() - .getIotHubResources() - .getEventHubConsumerGroupWithResponse(resourceGroupName, resourceName, eventHubEndpointName, name, - Context.NONE) - .getValue(); - return this; - } - - public EventHubConsumerGroupInfo refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getIotHubResources() - .getEventHubConsumerGroupWithResponse(resourceGroupName, resourceName, eventHubEndpointName, name, context) - .getValue(); - return this; - } - - public EventHubConsumerGroupInfoImpl withProperties(EventHubConsumerGroupName properties) { - this.createConsumerGroupBody.withProperties(properties); - return this; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/GroupIdInformationImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/GroupIdInformationImpl.java deleted file mode 100644 index 3610706a8280..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/GroupIdInformationImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -import com.azure.resourcemanager.iothub.fluent.models.GroupIdInformationInner; -import com.azure.resourcemanager.iothub.models.GroupIdInformation; -import com.azure.resourcemanager.iothub.models.GroupIdInformationProperties; - -public final class GroupIdInformationImpl implements GroupIdInformation { - private GroupIdInformationInner innerObject; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - GroupIdInformationImpl(GroupIdInformationInner innerObject, - com.azure.resourcemanager.iothub.IotHubManager 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 GroupIdInformationProperties properties() { - return this.innerModel().properties(); - } - - public GroupIdInformationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubClientBuilder.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubClientBuilder.java deleted file mode 100644 index d7a5358deb9b..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubClientBuilder.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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 IotHubClientImpl type. - */ -@ServiceClientBuilder(serviceClients = { IotHubClientImpl.class }) -public final class IotHubClientBuilder { - /* - * Service host - */ - private String endpoint; - - /** - * Sets Service host. - * - * @param endpoint the endpoint value. - * @return the IotHubClientBuilder. - */ - public IotHubClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The ID of the target subscription. The value must be an UUID. - */ - private String subscriptionId; - - /** - * Sets The ID of the target subscription. The value must be an UUID. - * - * @param subscriptionId the subscriptionId value. - * @return the IotHubClientBuilder. - */ - public IotHubClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the IotHubClientBuilder. - */ - public IotHubClientBuilder 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 IotHubClientBuilder. - */ - public IotHubClientBuilder 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 IotHubClientBuilder. - */ - public IotHubClientBuilder 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 IotHubClientBuilder. - */ - public IotHubClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of IotHubClientImpl with the provided parameters. - * - * @return an instance of IotHubClientImpl. - */ - public IotHubClientImpl 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(); - IotHubClientImpl client = new IotHubClientImpl(localPipeline, localSerializerAdapter, localDefaultPollInterval, - localEnvironment, localEndpoint, this.subscriptionId); - return client; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubClientImpl.java deleted file mode 100644 index 0536556f3185..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubClientImpl.java +++ /dev/null @@ -1,404 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.Response; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.exception.ManagementError; -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.iothub.fluent.CertificatesClient; -import com.azure.resourcemanager.iothub.fluent.IotHubClient; -import com.azure.resourcemanager.iothub.fluent.IotHubResourcesClient; -import com.azure.resourcemanager.iothub.fluent.IotHubsClient; -import com.azure.resourcemanager.iothub.fluent.OperationsClient; -import com.azure.resourcemanager.iothub.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.iothub.fluent.PrivateLinkResourcesOperationsClient; -import com.azure.resourcemanager.iothub.fluent.ResourceProviderCommonsClient; -import java.io.IOException; -import java.lang.reflect.Type; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the IotHubClientImpl type. - */ -@ServiceClient(builder = IotHubClientBuilder.class) -public final class IotHubClientImpl implements IotHubClient { - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - * Version parameter. - */ - private final String apiVersion; - - /** - * Gets Version parameter. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** - * The ID of the target subscription. The value must be an UUID. - */ - 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. - */ - 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 OperationsClient object to access its operations. - */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** - * The PrivateEndpointConnectionsClient object to access its operations. - */ - private final PrivateEndpointConnectionsClient privateEndpointConnections; - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** - * The IotHubResourcesClient object to access its operations. - */ - private final IotHubResourcesClient iotHubResources; - - /** - * Gets the IotHubResourcesClient object to access its operations. - * - * @return the IotHubResourcesClient object. - */ - public IotHubResourcesClient getIotHubResources() { - return this.iotHubResources; - } - - /** - * The IotHubsClient object to access its operations. - */ - private final IotHubsClient iotHubs; - - /** - * Gets the IotHubsClient object to access its operations. - * - * @return the IotHubsClient object. - */ - public IotHubsClient getIotHubs() { - return this.iotHubs; - } - - /** - * The CertificatesClient object to access its operations. - */ - private final CertificatesClient certificates; - - /** - * Gets the CertificatesClient object to access its operations. - * - * @return the CertificatesClient object. - */ - public CertificatesClient getCertificates() { - return this.certificates; - } - - /** - * The PrivateLinkResourcesOperationsClient object to access its operations. - */ - private final PrivateLinkResourcesOperationsClient privateLinkResourcesOperations; - - /** - * Gets the PrivateLinkResourcesOperationsClient object to access its operations. - * - * @return the PrivateLinkResourcesOperationsClient object. - */ - public PrivateLinkResourcesOperationsClient getPrivateLinkResourcesOperations() { - return this.privateLinkResourcesOperations; - } - - /** - * The ResourceProviderCommonsClient object to access its operations. - */ - private final ResourceProviderCommonsClient resourceProviderCommons; - - /** - * Gets the ResourceProviderCommonsClient object to access its operations. - * - * @return the ResourceProviderCommonsClient object. - */ - public ResourceProviderCommonsClient getResourceProviderCommons() { - return this.resourceProviderCommons; - } - - /** - * Initializes an instance of IotHubClient 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 endpoint Service host. - * @param subscriptionId The ID of the target subscription. The value must be an UUID. - */ - IotHubClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, - AzureEnvironment environment, String endpoint, String subscriptionId) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.endpoint = endpoint; - this.subscriptionId = subscriptionId; - this.apiVersion = "2025-08-01-preview"; - this.operations = new OperationsClientImpl(this); - this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); - this.iotHubResources = new IotHubResourcesClientImpl(this); - this.iotHubs = new IotHubsClientImpl(this); - this.certificates = new CertificatesClientImpl(this); - this.privateLinkResourcesOperations = new PrivateLinkResourcesOperationsClientImpl(this); - this.resourceProviderCommons = new ResourceProviderCommonsClientImpl(this); - } - - /** - * Gets default client context. - * - * @return the default client context. - */ - public Context getContext() { - return Context.NONE; - } - - /** - * Merges default client context with provided context. - * - * @param context the context to be merged with default client context. - * @return the merged context. - */ - public Context mergeContext(Context context) { - return CoreUtils.mergeContexts(this.getContext(), context); - } - - /** - * Gets long running operation result. - * - * @param activationResponse the response of activation operation. - * @param httpPipeline the http pipeline. - * @param pollResultType type of poll result. - * @param finalResultType type of final result. - * @param context the context shared by all requests. - * @param type of poll result. - * @param type of final result. - * @return poller flux for poll result and final result. - */ - public PollerFlux, U> getLroResult(Mono>> activationResponse, - HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { - return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, - defaultPollInterval, activationResponse, context); - } - - /** - * Gets long running operation result. - * - * @param activationResponse the response of activation operation. - * @param pollResultType type of poll result. - * @param finalResultType type of final result. - * @param context the context shared by all requests. - * @param 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. - * - * @param response the last async poll response. - * @param type of poll result. - * @param type of final result. - * @return the final result, or an error. - */ - public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { - if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { - String errorMessage; - ManagementError managementError = null; - HttpResponse errorResponse = null; - PollResult.Error lroError = response.getValue().getError(); - if (lroError != null) { - errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), - lroError.getResponseBody()); - - errorMessage = response.getValue().getError().getMessage(); - String errorBody = response.getValue().getError().getResponseBody(); - if (errorBody != null) { - // try to deserialize error body to ManagementError - try { - managementError = this.getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); - if (managementError.getCode() == null || managementError.getMessage() == null) { - managementError = null; - } - } catch (IOException | RuntimeException ioe) { - LOGGER.logThrowableAsWarning(ioe); - } - } - } else { - // fallback to default error message - errorMessage = "Long running operation failed."; - } - if (managementError == null) { - // fallback to default ManagementError - managementError = new ManagementError(response.getStatus().toString(), errorMessage); - } - return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); - } else { - return response.getFinalResult(); - } - } - - private static final class HttpResponseImpl extends HttpResponse { - private final int statusCode; - - private final byte[] responseBody; - - private final HttpHeaders httpHeaders; - - HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { - super(null); - this.statusCode = statusCode; - this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? new byte[0] : responseBody.getBytes(StandardCharsets.UTF_8); - } - - public int getStatusCode() { - return statusCode; - } - - public String getHeaderValue(String s) { - return httpHeaders.getValue(HttpHeaderName.fromString(s)); - } - - public HttpHeaders getHeaders() { - return httpHeaders; - } - - public Flux getBody() { - return Flux.just(ByteBuffer.wrap(responseBody)); - } - - public Mono getBodyAsByteArray() { - return Mono.just(responseBody); - } - - public Mono getBodyAsString() { - return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); - } - - public Mono getBodyAsString(Charset charset) { - return Mono.just(new String(responseBody, charset)); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(IotHubClientImpl.class); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubDescriptionImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubDescriptionImpl.java deleted file mode 100644 index 7d359e778c5b..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubDescriptionImpl.java +++ /dev/null @@ -1,249 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.iothub.fluent.models.IotHubDescriptionInner; -import com.azure.resourcemanager.iothub.models.ArmIdentity; -import com.azure.resourcemanager.iothub.models.ExportDevicesRequest; -import com.azure.resourcemanager.iothub.models.ImportDevicesRequest; -import com.azure.resourcemanager.iothub.models.IotHubDescription; -import com.azure.resourcemanager.iothub.models.IotHubProperties; -import com.azure.resourcemanager.iothub.models.IotHubSkuInfo; -import com.azure.resourcemanager.iothub.models.JobResponse; -import com.azure.resourcemanager.iothub.models.SharedAccessSignatureAuthorizationRule; -import com.azure.resourcemanager.iothub.models.TagsResource; -import java.util.Collections; -import java.util.Map; - -public final class IotHubDescriptionImpl - implements IotHubDescription, IotHubDescription.Definition, IotHubDescription.Update { - private IotHubDescriptionInner innerObject; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public IotHubProperties properties() { - return this.innerModel().properties(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public IotHubSkuInfo sku() { - return this.innerModel().sku(); - } - - public ArmIdentity identity() { - return this.innerModel().identity(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public IotHubDescriptionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String resourceName; - - private String createIfMatch; - - private TagsResource updateIotHubTags; - - public IotHubDescriptionImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public IotHubDescription create() { - this.innerObject = serviceManager.serviceClient() - .getIotHubResources() - .createOrUpdate(resourceGroupName, resourceName, this.innerModel(), createIfMatch, Context.NONE); - return this; - } - - public IotHubDescription create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getIotHubResources() - .createOrUpdate(resourceGroupName, resourceName, this.innerModel(), createIfMatch, context); - return this; - } - - IotHubDescriptionImpl(String name, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerObject = new IotHubDescriptionInner(); - this.serviceManager = serviceManager; - this.resourceName = name; - this.createIfMatch = null; - } - - public IotHubDescriptionImpl update() { - this.updateIotHubTags = new TagsResource(); - return this; - } - - public IotHubDescription apply() { - this.innerObject = serviceManager.serviceClient() - .getIotHubResources() - .update(resourceGroupName, resourceName, updateIotHubTags, Context.NONE); - return this; - } - - public IotHubDescription apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getIotHubResources() - .update(resourceGroupName, resourceName, updateIotHubTags, context); - return this; - } - - IotHubDescriptionImpl(IotHubDescriptionInner innerObject, - com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.resourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "IotHubs"); - } - - public IotHubDescription refresh() { - this.innerObject = serviceManager.serviceClient() - .getIotHubResources() - .getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE) - .getValue(); - return this; - } - - public IotHubDescription refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getIotHubResources() - .getByResourceGroupWithResponse(resourceGroupName, resourceName, context) - .getValue(); - return this; - } - - public PagedIterable listKeys() { - return serviceManager.iotHubResources().listKeys(resourceGroupName, resourceName); - } - - public PagedIterable listKeys(Context context) { - return serviceManager.iotHubResources().listKeys(resourceGroupName, resourceName, context); - } - - public Response exportDevicesWithResponse(ExportDevicesRequest exportDevicesParameters, - Context context) { - return serviceManager.iotHubResources() - .exportDevicesWithResponse(resourceGroupName, resourceName, exportDevicesParameters, context); - } - - public JobResponse exportDevices(ExportDevicesRequest exportDevicesParameters) { - return serviceManager.iotHubResources().exportDevices(resourceGroupName, resourceName, exportDevicesParameters); - } - - public Response importDevicesWithResponse(ImportDevicesRequest importDevicesParameters, - Context context) { - return serviceManager.iotHubResources() - .importDevicesWithResponse(resourceGroupName, resourceName, importDevicesParameters, context); - } - - public JobResponse importDevices(ImportDevicesRequest importDevicesParameters) { - return serviceManager.iotHubResources().importDevices(resourceGroupName, resourceName, importDevicesParameters); - } - - public IotHubDescriptionImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public IotHubDescriptionImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public IotHubDescriptionImpl withSku(IotHubSkuInfo sku) { - this.innerModel().withSku(sku); - return this; - } - - public IotHubDescriptionImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateIotHubTags.withTags(tags); - return this; - } - } - - public IotHubDescriptionImpl withProperties(IotHubProperties properties) { - this.innerModel().withProperties(properties); - return this; - } - - public IotHubDescriptionImpl withEtag(String etag) { - this.innerModel().withEtag(etag); - return this; - } - - public IotHubDescriptionImpl withIdentity(ArmIdentity identity) { - this.innerModel().withIdentity(identity); - return this; - } - - public IotHubDescriptionImpl withIfMatch(String ifMatch) { - this.createIfMatch = ifMatch; - return this; - } - - private boolean isInCreateMode() { - return this.innerModel() == null || this.innerModel().id() == null; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubNameAvailabilityInfoImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubNameAvailabilityInfoImpl.java deleted file mode 100644 index 52d87d6eefda..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubNameAvailabilityInfoImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -import com.azure.resourcemanager.iothub.fluent.models.IotHubNameAvailabilityInfoInner; -import com.azure.resourcemanager.iothub.models.IotHubNameAvailabilityInfo; -import com.azure.resourcemanager.iothub.models.IotHubNameUnavailabilityReason; - -public final class IotHubNameAvailabilityInfoImpl implements IotHubNameAvailabilityInfo { - private IotHubNameAvailabilityInfoInner innerObject; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - IotHubNameAvailabilityInfoImpl(IotHubNameAvailabilityInfoInner innerObject, - com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public Boolean nameAvailable() { - return this.innerModel().nameAvailable(); - } - - public IotHubNameUnavailabilityReason reason() { - return this.innerModel().reason(); - } - - public String message() { - return this.innerModel().message(); - } - - public IotHubNameAvailabilityInfoInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubQuotaMetricInfoImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubQuotaMetricInfoImpl.java deleted file mode 100644 index 7df22f51ccf4..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubQuotaMetricInfoImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -import com.azure.resourcemanager.iothub.fluent.models.IotHubQuotaMetricInfoInner; -import com.azure.resourcemanager.iothub.models.IotHubQuotaMetricInfo; - -public final class IotHubQuotaMetricInfoImpl implements IotHubQuotaMetricInfo { - private IotHubQuotaMetricInfoInner innerObject; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - IotHubQuotaMetricInfoImpl(IotHubQuotaMetricInfoInner innerObject, - com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public Long currentValue() { - return this.innerModel().currentValue(); - } - - public Long maxValue() { - return this.innerModel().maxValue(); - } - - public IotHubQuotaMetricInfoInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesClientImpl.java deleted file mode 100644 index 5c3d164be5a4..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesClientImpl.java +++ /dev/null @@ -1,4095 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.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; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.iothub.fluent.IotHubResourcesClient; -import com.azure.resourcemanager.iothub.fluent.models.EndpointHealthDataInner; -import com.azure.resourcemanager.iothub.fluent.models.EventHubConsumerGroupInfoInner; -import com.azure.resourcemanager.iothub.fluent.models.IotHubDescriptionInner; -import com.azure.resourcemanager.iothub.fluent.models.IotHubNameAvailabilityInfoInner; -import com.azure.resourcemanager.iothub.fluent.models.IotHubQuotaMetricInfoInner; -import com.azure.resourcemanager.iothub.fluent.models.IotHubSkuDescriptionInner; -import com.azure.resourcemanager.iothub.fluent.models.JobResponseInner; -import com.azure.resourcemanager.iothub.fluent.models.RegistryStatisticsInner; -import com.azure.resourcemanager.iothub.fluent.models.SharedAccessSignatureAuthorizationRuleInner; -import com.azure.resourcemanager.iothub.fluent.models.TestAllRoutesResultInner; -import com.azure.resourcemanager.iothub.fluent.models.TestRouteResultInner; -import com.azure.resourcemanager.iothub.implementation.models.EndpointHealthDataListResult; -import com.azure.resourcemanager.iothub.implementation.models.EventHubConsumerGroupsListResult; -import com.azure.resourcemanager.iothub.implementation.models.IotHubDescriptionListResult; -import com.azure.resourcemanager.iothub.implementation.models.IotHubQuotaMetricInfoListResult; -import com.azure.resourcemanager.iothub.implementation.models.IotHubSkuDescriptionListResult; -import com.azure.resourcemanager.iothub.implementation.models.JobResponseListResult; -import com.azure.resourcemanager.iothub.implementation.models.SharedAccessSignatureAuthorizationRuleListResult; -import com.azure.resourcemanager.iothub.models.ErrorDetailsException; -import com.azure.resourcemanager.iothub.models.EventHubConsumerGroupBodyDescription; -import com.azure.resourcemanager.iothub.models.ExportDevicesRequest; -import com.azure.resourcemanager.iothub.models.ImportDevicesRequest; -import com.azure.resourcemanager.iothub.models.OperationInputs; -import com.azure.resourcemanager.iothub.models.TagsResource; -import com.azure.resourcemanager.iothub.models.TestAllRoutesInput; -import com.azure.resourcemanager.iothub.models.TestRouteInput; -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 IotHubResourcesClient. - */ -public final class IotHubResourcesClientImpl implements IotHubResourcesClient { - /** - * The proxy service used to perform REST calls. - */ - private final IotHubResourcesService service; - - /** - * The service client containing this operation class. - */ - private final IotHubClientImpl client; - - /** - * Initializes an instance of IotHubResourcesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotHubResourcesClientImpl(IotHubClientImpl client) { - this.service - = RestProxy.create(IotHubResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for IotHubClientIotHubResources to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "IotHubClientIotHubResources") - public interface IotHubResourcesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") IotHubDescriptionInner iotHubDescription, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") IotHubDescriptionInner iotHubDescription, Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") TagsResource iotHubTags, Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") TagsResource iotHubTags, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(value = ErrorDetailsException.class, code = { 404 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(value = ErrorDetailsException.class, code = { 404 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - 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" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - 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" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Devices/IotHubs") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Devices/IotHubs") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - 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.Devices/IotHubs/{resourceName}/skus") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> getValidSkus(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/skus") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response getValidSkusSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> listJobs(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response listJobsSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> getJob(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs/{jobId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response getJobSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("jobId") String jobId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/quotaMetrics") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> getQuotaMetrics(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/quotaMetrics") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response getQuotaMetricsSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routingEndpointsHealth") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> getEndpointHealth(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("iotHubName") String iotHubName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routingEndpointsHealth") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response getEndpointHealthSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("iotHubName") String iotHubName, - @HeaderParam("Accept") String accept, Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testall") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> testAllRoutes(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("iotHubName") String iotHubName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") TestAllRoutesInput input, Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testall") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response testAllRoutesSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("iotHubName") String iotHubName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") TestAllRoutesInput input, Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testnew") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> testRoute(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("iotHubName") String iotHubName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") TestRouteInput input, Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testnew") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response testRouteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("iotHubName") String iotHubName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") TestRouteInput input, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/listkeys") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> listKeys( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/listkeys") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response listKeysSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubKeys/{keyName}/listkeys") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> getKeysForKeyName( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("keyName") String keyName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubKeys/{keyName}/listkeys") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response getKeysForKeyNameSync( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("keyName") String keyName, @HeaderParam("Accept") String accept, Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/exportDevices") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> exportDevices(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ExportDevicesRequest exportDevicesParameters, Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/exportDevices") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response exportDevicesSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ExportDevicesRequest exportDevicesParameters, Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/importDevices") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> importDevices(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ImportDevicesRequest importDevicesParameters, Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/importDevices") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response importDevicesSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ImportDevicesRequest importDevicesParameters, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubStats") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> getStats(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubStats") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response getStatsSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> getEventHubConsumerGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("eventHubEndpointName") String eventHubEndpointName, @PathParam("name") String name, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response getEventHubConsumerGroupSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("eventHubEndpointName") String eventHubEndpointName, @PathParam("name") String name, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> createEventHubConsumerGroup( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("eventHubEndpointName") String eventHubEndpointName, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") EventHubConsumerGroupBodyDescription consumerGroupBody, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response createEventHubConsumerGroupSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("eventHubEndpointName") String eventHubEndpointName, @PathParam("name") String name, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") EventHubConsumerGroupBodyDescription consumerGroupBody, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> deleteEventHubConsumerGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("eventHubEndpointName") String eventHubEndpointName, @PathParam("name") String name, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response deleteEventHubConsumerGroupSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("eventHubEndpointName") String eventHubEndpointName, @PathParam("name") String name, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> listEventHubConsumerGroups( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("eventHubEndpointName") String eventHubEndpointName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response listEventHubConsumerGroupsSync( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("eventHubEndpointName") String eventHubEndpointName, @HeaderParam("Accept") String accept, - Context context); - - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkNameAvailability") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> checkNameAvailability(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") OperationInputs operationInputs, Context context); - - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkNameAvailability") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response checkNameAvailabilitySync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") OperationInputs operationInputs, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response listByResourceGroupNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response listBySubscriptionNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> getValidSkusNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response getValidSkusNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> listJobsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response listJobsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> getQuotaMetricsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response getQuotaMetricsNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> getEndpointHealthNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response getEndpointHealthNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> listKeysNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response listKeysNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> listEventHubConsumerGroupsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response listEventHubConsumerGroupsNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get the non-security related metadata of an IoT hub - * - * Get the non-security related metadata of an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the non-security related metadata of an IoT hub - * - * Get the non-security related metadata of an IoT hub along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String resourceName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the non-security related metadata of an IoT hub - * - * Get the non-security related metadata of an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the non-security related metadata of an IoT hub - * - * Get the non-security related metadata of an IoT hub on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the non-security related metadata of an IoT hub - * - * Get the non-security related metadata of an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the non-security related metadata of an IoT hub - * - * Get the non-security related metadata of an IoT hub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String resourceName, Context context) { - final String accept = "application/json"; - return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); - } - - /** - * Get the non-security related metadata of an IoT hub - * - * Get the non-security related metadata of an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the non-security related metadata of an IoT hub - * - * Get the non-security related metadata of an IoT hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotHubDescriptionInner getByResourceGroup(String resourceGroupName, String resourceName) { - return getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); - } - - /** - * Create or update the metadata of an IoT hub. - * - * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub - * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubDescription The IoT hub metadata and security metadata. - * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an - * existing IoT Hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the IoT hub along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceName, IotHubDescriptionInner iotHubDescription, String ifMatch) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, ifMatch, contentType, accept, - iotHubDescription, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update the metadata of an IoT hub. - * - * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub - * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubDescription The IoT hub metadata and security metadata. - * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an - * existing IoT Hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the IoT hub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, - IotHubDescriptionInner iotHubDescription, String ifMatch) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, ifMatch, contentType, accept, - iotHubDescription, Context.NONE); - } - - /** - * Create or update the metadata of an IoT hub. - * - * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub - * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubDescription The IoT hub metadata and security metadata. - * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an - * existing IoT Hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the IoT hub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String resourceName, - IotHubDescriptionInner iotHubDescription, String ifMatch, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, ifMatch, contentType, accept, - iotHubDescription, context); - } - - /** - * Create or update the metadata of an IoT hub. - * - * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub - * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubDescription The IoT hub metadata and security metadata. - * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an - * existing IoT Hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, IotHubDescriptionInner> beginCreateOrUpdateAsync( - String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription, String ifMatch) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, iotHubDescription, ifMatch); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), IotHubDescriptionInner.class, IotHubDescriptionInner.class, - this.client.getContext()); - } - - /** - * Create or update the metadata of an IoT hub. - * - * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub - * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubDescription The IoT hub metadata and security metadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, IotHubDescriptionInner> beginCreateOrUpdateAsync( - String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription) { - final String ifMatch = null; - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, resourceName, iotHubDescription, ifMatch); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), IotHubDescriptionInner.class, IotHubDescriptionInner.class, - this.client.getContext()); - } - - /** - * Create or update the metadata of an IoT hub. - * - * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub - * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubDescription The IoT hub metadata and security metadata. - * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an - * existing IoT Hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, IotHubDescriptionInner> beginCreateOrUpdate( - String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription, String ifMatch) { - Response response - = createOrUpdateWithResponse(resourceGroupName, resourceName, iotHubDescription, ifMatch); - return this.client.getLroResult(response, - IotHubDescriptionInner.class, IotHubDescriptionInner.class, Context.NONE); - } - - /** - * Create or update the metadata of an IoT hub. - * - * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub - * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubDescription The IoT hub metadata and security metadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, IotHubDescriptionInner> - beginCreateOrUpdate(String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription) { - final String ifMatch = null; - Response response - = createOrUpdateWithResponse(resourceGroupName, resourceName, iotHubDescription, ifMatch); - return this.client.getLroResult(response, - IotHubDescriptionInner.class, IotHubDescriptionInner.class, Context.NONE); - } - - /** - * Create or update the metadata of an IoT hub. - * - * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub - * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubDescription The IoT hub metadata and security metadata. - * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an - * existing IoT Hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, IotHubDescriptionInner> beginCreateOrUpdate( - String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription, String ifMatch, - Context context) { - Response response - = createOrUpdateWithResponse(resourceGroupName, resourceName, iotHubDescription, ifMatch, context); - return this.client.getLroResult(response, - IotHubDescriptionInner.class, IotHubDescriptionInner.class, context); - } - - /** - * Create or update the metadata of an IoT hub. - * - * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub - * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubDescription The IoT hub metadata and security metadata. - * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an - * existing IoT Hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the IoT hub on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, - IotHubDescriptionInner iotHubDescription, String ifMatch) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, iotHubDescription, ifMatch).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update the metadata of an IoT hub. - * - * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub - * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubDescription The IoT hub metadata and security metadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the IoT hub on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, - IotHubDescriptionInner iotHubDescription) { - final String ifMatch = null; - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, iotHubDescription, ifMatch).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update the metadata of an IoT hub. - * - * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub - * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubDescription The IoT hub metadata and security metadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotHubDescriptionInner createOrUpdate(String resourceGroupName, String resourceName, - IotHubDescriptionInner iotHubDescription) { - final String ifMatch = null; - return beginCreateOrUpdate(resourceGroupName, resourceName, iotHubDescription, ifMatch).getFinalResult(); - } - - /** - * Create or update the metadata of an IoT hub. - * - * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub - * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubDescription The IoT hub metadata and security metadata. - * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an - * existing IoT Hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotHubDescriptionInner createOrUpdate(String resourceGroupName, String resourceName, - IotHubDescriptionInner iotHubDescription, String ifMatch, Context context) { - return beginCreateOrUpdate(resourceGroupName, resourceName, iotHubDescription, ifMatch, context) - .getFinalResult(); - } - - /** - * Update an existing IoT Hubs tags. - * - * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubTags Updated tag information to set into the iot hub instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the IoT hub along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String resourceName, - TagsResource iotHubTags) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, iotHubTags, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update an existing IoT Hubs tags. - * - * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubTags Updated tag information to set into the iot hub instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the IoT hub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String resourceName, - TagsResource iotHubTags) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, iotHubTags, - Context.NONE); - } - - /** - * Update an existing IoT Hubs tags. - * - * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubTags Updated tag information to set into the iot hub 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 the description of the IoT hub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String resourceName, - TagsResource iotHubTags, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, iotHubTags, context); - } - - /** - * Update an existing IoT Hubs tags. - * - * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubTags Updated tag information to set into the iot hub instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, IotHubDescriptionInner> - beginUpdateAsync(String resourceGroupName, String resourceName, TagsResource iotHubTags) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, resourceName, iotHubTags); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), IotHubDescriptionInner.class, IotHubDescriptionInner.class, - this.client.getContext()); - } - - /** - * Update an existing IoT Hubs tags. - * - * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubTags Updated tag information to set into the iot hub instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, IotHubDescriptionInner> beginUpdate(String resourceGroupName, - String resourceName, TagsResource iotHubTags) { - Response response = updateWithResponse(resourceGroupName, resourceName, iotHubTags); - return this.client.getLroResult(response, - IotHubDescriptionInner.class, IotHubDescriptionInner.class, Context.NONE); - } - - /** - * Update an existing IoT Hubs tags. - * - * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubTags Updated tag information to set into the iot hub 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 the {@link SyncPoller} for polling of the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, IotHubDescriptionInner> beginUpdate(String resourceGroupName, - String resourceName, TagsResource iotHubTags, Context context) { - Response response = updateWithResponse(resourceGroupName, resourceName, iotHubTags, context); - return this.client.getLroResult(response, - IotHubDescriptionInner.class, IotHubDescriptionInner.class, context); - } - - /** - * Update an existing IoT Hubs tags. - * - * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubTags Updated tag information to set into the iot hub instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the IoT hub on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String resourceName, - TagsResource iotHubTags) { - return beginUpdateAsync(resourceGroupName, resourceName, iotHubTags).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update an existing IoT Hubs tags. - * - * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubTags Updated tag information to set into the iot hub instance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotHubDescriptionInner update(String resourceGroupName, String resourceName, TagsResource iotHubTags) { - return beginUpdate(resourceGroupName, resourceName, iotHubTags).getFinalResult(); - } - - /** - * Update an existing IoT Hubs tags. - * - * Update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param iotHubTags Updated tag information to set into the iot hub 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 the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotHubDescriptionInner update(String resourceGroupName, String resourceName, TagsResource iotHubTags, - Context context) { - return beginUpdate(resourceGroupName, resourceName, iotHubTags, context).getFinalResult(); - } - - /** - * Delete an IoT hub - * - * Delete an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws ErrorDetailsException thrown if the request is rejected by server on status code 404. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the IoT hub along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete an IoT hub - * - * Delete an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws ErrorDetailsException thrown if the request is rejected by server on status code 404. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the IoT hub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String resourceName) { - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, Context.NONE); - } - - /** - * Delete an IoT hub - * - * Delete an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws ErrorDetailsException thrown if the request is rejected by server on status code 404. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the IoT hub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String resourceName, Context context) { - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); - } - - /** - * Delete an IoT hub - * - * Delete an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws ErrorDetailsException thrown if the request is rejected by server on status code 404. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Delete an IoT hub - * - * Delete an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws ErrorDetailsException thrown if the request is rejected by server on status code 404. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName) { - Response response = deleteWithResponse(resourceGroupName, resourceName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Delete an IoT hub - * - * Delete an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws ErrorDetailsException thrown if the request is rejected by server on status code 404. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, - Context context) { - Response response = deleteWithResponse(resourceGroupName, resourceName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Delete an IoT hub - * - * Delete an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws ErrorDetailsException thrown if the request is rejected by server on status code 404. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the IoT hub on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String resourceName) { - return beginDeleteAsync(resourceGroupName, resourceName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete an IoT hub - * - * Delete an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws ErrorDetailsException thrown if the request is rejected by server on status code 404. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName) { - beginDelete(resourceGroupName, resourceName).getFinalResult(); - } - - /** - * Delete an IoT hub - * - * Delete an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws ErrorDetailsException thrown if the request is rejected by server on status code 404. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName, Context context) { - beginDelete(resourceGroupName, resourceName, context).getFinalResult(); - } - - /** - * Get all the IoT hubs in a resource group - * - * Get all the IoT hubs in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 IoT hubs in a resource group - * - * Get all the IoT hubs in a resource group along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - final String accept = "application/json"; - return FluxUtil - .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())); - } - - /** - * Get all the IoT hubs in a resource group - * - * Get all the IoT hubs in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 IoT hubs in a resource group - * - * Get all the IoT hubs in a resource group as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Get all the IoT hubs in a resource group - * - * Get all the IoT hubs in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 IoT hubs in a resource group - * - * Get all the IoT hubs in a resource group along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { - final String accept = "application/json"; - 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); - } - - /** - * Get all the IoT hubs in a resource group - * - * Get all the IoT hubs 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 ErrorDetailsException 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 IoT hubs in a resource group - * - * Get all the IoT hubs in a resource group along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, - Context context) { - final String accept = "application/json"; - 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); - } - - /** - * Get all the IoT hubs in a resource group - * - * Get all the IoT hubs in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 IoT hubs in a resource group - * - * Get all the IoT hubs in a resource group as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePage(nextLink)); - } - - /** - * Get all the IoT hubs in a resource group - * - * Get all the IoT hubs 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 ErrorDetailsException 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 IoT hubs in a resource group - * - * Get all the IoT hubs in a resource group 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)); - } - - /** - * Get all the IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription. - * - * @throws ErrorDetailsException 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 IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - final String accept = "application/json"; - return FluxUtil - .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())); - } - - /** - * Get all the IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription. - * - * @throws ErrorDetailsException 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 IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Get all the IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription. - * - * @throws ErrorDetailsException 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 IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage() { - 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); - } - - /** - * Get all the IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(Context context) { - 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); - } - - /** - * Get all the IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription. - * - * @throws ErrorDetailsException 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 IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); - } - - /** - * Get all the IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(() -> listSinglePage(context), - nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); - } - - /** - * Get the list of valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getValidSkusSinglePageAsync(String resourceGroupName, - String resourceName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getValidSkus(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, 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 list of valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux getValidSkusAsync(String resourceGroupName, String resourceName) { - return new PagedFlux<>(() -> getValidSkusSinglePageAsync(resourceGroupName, resourceName), - nextLink -> getValidSkusNextSinglePageAsync(nextLink)); - } - - /** - * Get the list of valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse getValidSkusSinglePage(String resourceGroupName, - String resourceName) { - final String accept = "application/json"; - Response res - = service.getValidSkusSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the list of valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse getValidSkusSinglePage(String resourceGroupName, - String resourceName, Context context) { - final String accept = "application/json"; - Response res - = service.getValidSkusSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the list of valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getValidSkus(String resourceGroupName, String resourceName) { - return new PagedIterable<>(() -> getValidSkusSinglePage(resourceGroupName, resourceName), - nextLink -> getValidSkusNextSinglePage(nextLink)); - } - - /** - * Get the list of valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getValidSkus(String resourceGroupName, String resourceName, - Context context) { - return new PagedIterable<>(() -> getValidSkusSinglePage(resourceGroupName, resourceName, context), - nextLink -> getValidSkusNextSinglePage(nextLink, context)); - } - - /** - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 the jobs in an IoT hub along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listJobsSinglePageAsync(String resourceGroupName, - String resourceName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listJobs(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, 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 a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 the jobs in an IoT hub as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listJobsAsync(String resourceGroupName, String resourceName) { - return new PagedFlux<>(() -> listJobsSinglePageAsync(resourceGroupName, resourceName), - nextLink -> listJobsNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 the jobs in an IoT hub along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listJobsSinglePage(String resourceGroupName, String resourceName) { - final String accept = "application/json"; - Response res - = service.listJobsSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 the jobs in an IoT hub along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listJobsSinglePage(String resourceGroupName, String resourceName, - Context context) { - final String accept = "application/json"; - Response res - = service.listJobsSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 the jobs in an IoT hub as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listJobs(String resourceGroupName, String resourceName) { - return new PagedIterable<>(() -> listJobsSinglePage(resourceGroupName, resourceName), - nextLink -> listJobsNextSinglePage(nextLink)); - } - - /** - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 the jobs in an IoT hub as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listJobs(String resourceGroupName, String resourceName, Context context) { - return new PagedIterable<>(() -> listJobsSinglePage(resourceGroupName, resourceName, context), - nextLink -> listJobsNextSinglePage(nextLink, context)); - } - - /** - * Get the details of a job from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * - * Get the details of a job from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param jobId The job identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a job from an IoT hub along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getJobWithResponseAsync(String resourceGroupName, String resourceName, - String jobId) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getJob(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, jobId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the details of a job from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * - * Get the details of a job from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param jobId The job identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a job from an IoT hub on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getJobAsync(String resourceGroupName, String resourceName, String jobId) { - return getJobWithResponseAsync(resourceGroupName, resourceName, jobId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the details of a job from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * - * Get the details of a job from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param jobId The job identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a job from an IoT hub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getJobWithResponse(String resourceGroupName, String resourceName, String jobId, - Context context) { - final String accept = "application/json"; - return service.getJobSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, jobId, accept, context); - } - - /** - * Get the details of a job from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * - * Get the details of a job from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param jobId The job identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a job from an IoT hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public JobResponseInner getJob(String resourceGroupName, String resourceName, String jobId) { - return getJobWithResponse(resourceGroupName, resourceName, jobId, Context.NONE).getValue(); - } - - /** - * Get the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getQuotaMetricsSinglePageAsync(String resourceGroupName, - String resourceName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getQuotaMetrics(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, 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 quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux getQuotaMetricsAsync(String resourceGroupName, String resourceName) { - return new PagedFlux<>(() -> getQuotaMetricsSinglePageAsync(resourceGroupName, resourceName), - nextLink -> getQuotaMetricsNextSinglePageAsync(nextLink)); - } - - /** - * Get the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse getQuotaMetricsSinglePage(String resourceGroupName, - String resourceName) { - final String accept = "application/json"; - Response res - = service.getQuotaMetricsSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse getQuotaMetricsSinglePage(String resourceGroupName, - String resourceName, Context context) { - final String accept = "application/json"; - Response res - = service.getQuotaMetricsSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getQuotaMetrics(String resourceGroupName, String resourceName) { - return new PagedIterable<>(() -> getQuotaMetricsSinglePage(resourceGroupName, resourceName), - nextLink -> getQuotaMetricsNextSinglePage(nextLink)); - } - - /** - * Get the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getQuotaMetrics(String resourceGroupName, String resourceName, - Context context) { - return new PagedIterable<>(() -> getQuotaMetricsSinglePage(resourceGroupName, resourceName, context), - nextLink -> getQuotaMetricsNextSinglePage(nextLink, context)); - } - - /** - * Get the health for routing endpoints - * - * Get the health for routing endpoints. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param iotHubName The iotHubName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the health for routing endpoints - * - * Get the health for routing endpoints along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getEndpointHealthSinglePageAsync(String resourceGroupName, - String iotHubName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getEndpointHealth(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, iotHubName, 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 health for routing endpoints - * - * Get the health for routing endpoints. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param iotHubName The iotHubName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the health for routing endpoints - * - * Get the health for routing endpoints as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux getEndpointHealthAsync(String resourceGroupName, String iotHubName) { - return new PagedFlux<>(() -> getEndpointHealthSinglePageAsync(resourceGroupName, iotHubName), - nextLink -> getEndpointHealthNextSinglePageAsync(nextLink)); - } - - /** - * Get the health for routing endpoints - * - * Get the health for routing endpoints. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param iotHubName The iotHubName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the health for routing endpoints - * - * Get the health for routing endpoints along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse getEndpointHealthSinglePage(String resourceGroupName, - String iotHubName) { - final String accept = "application/json"; - Response res - = service.getEndpointHealthSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, iotHubName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the health for routing endpoints - * - * Get the health for routing endpoints. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param iotHubName The iotHubName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the health for routing endpoints - * - * Get the health for routing endpoints along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse getEndpointHealthSinglePage(String resourceGroupName, - String iotHubName, Context context) { - final String accept = "application/json"; - Response res - = service.getEndpointHealthSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, iotHubName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the health for routing endpoints - * - * Get the health for routing endpoints. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param iotHubName The iotHubName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the health for routing endpoints - * - * Get the health for routing endpoints as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getEndpointHealth(String resourceGroupName, String iotHubName) { - return new PagedIterable<>(() -> getEndpointHealthSinglePage(resourceGroupName, iotHubName), - nextLink -> getEndpointHealthNextSinglePage(nextLink)); - } - - /** - * Get the health for routing endpoints - * - * Get the health for routing endpoints. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param iotHubName The iotHubName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the health for routing endpoints - * - * Get the health for routing endpoints as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getEndpointHealth(String resourceGroupName, String iotHubName, - Context context) { - return new PagedIterable<>(() -> getEndpointHealthSinglePage(resourceGroupName, iotHubName, context), - nextLink -> getEndpointHealthNextSinglePage(nextLink, context)); - } - - /** - * Test all routes - * - * Test all routes configured in this Iot Hub. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param input Input for testing all routes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 testing all routes along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> testAllRoutesWithResponseAsync(String iotHubName, - String resourceGroupName, TestAllRoutesInput input) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.testAllRoutes(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, iotHubName, contentType, accept, input, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Test all routes - * - * Test all routes configured in this Iot Hub. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param input Input for testing all routes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 testing all routes on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono testAllRoutesAsync(String iotHubName, String resourceGroupName, - TestAllRoutesInput input) { - return testAllRoutesWithResponseAsync(iotHubName, resourceGroupName, input) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Test all routes - * - * Test all routes configured in this Iot Hub. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param input Input for testing all routes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 testing all routes along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response testAllRoutesWithResponse(String iotHubName, String resourceGroupName, - TestAllRoutesInput input, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.testAllRoutesSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, iotHubName, contentType, accept, input, context); - } - - /** - * Test all routes - * - * Test all routes configured in this Iot Hub. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param input Input for testing all routes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 testing all routes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TestAllRoutesResultInner testAllRoutes(String iotHubName, String resourceGroupName, - TestAllRoutesInput input) { - return testAllRoutesWithResponse(iotHubName, resourceGroupName, input, Context.NONE).getValue(); - } - - /** - * Test the new route - * - * Test the new route for this Iot Hub. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param input Route that needs to be tested. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 testing one route along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> testRouteWithResponseAsync(String iotHubName, String resourceGroupName, - TestRouteInput input) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.testRoute(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, iotHubName, contentType, accept, input, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Test the new route - * - * Test the new route for this Iot Hub. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param input Route that needs to be tested. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 testing one route on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono testRouteAsync(String iotHubName, String resourceGroupName, - TestRouteInput input) { - return testRouteWithResponseAsync(iotHubName, resourceGroupName, input) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Test the new route - * - * Test the new route for this Iot Hub. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param input Route that needs to be tested. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 testing one route along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response testRouteWithResponse(String iotHubName, String resourceGroupName, - TestRouteInput input, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.testRouteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, iotHubName, contentType, accept, input, context); - } - - /** - * Test the new route - * - * Test the new route for this Iot Hub. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param input Route that needs to be tested. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 testing one route. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TestRouteResultInner testRoute(String iotHubName, String resourceGroupName, TestRouteInput input) { - return testRouteWithResponse(iotHubName, resourceGroupName, input, Context.NONE).getValue(); - } - - /** - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security metadata for an IoT hub along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listKeysSinglePageAsync(String resourceGroupName, String resourceName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, 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 security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security metadata for an IoT hub as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listKeysAsync(String resourceGroupName, - String resourceName) { - return new PagedFlux<>(() -> listKeysSinglePageAsync(resourceGroupName, resourceName), - nextLink -> listKeysNextSinglePageAsync(nextLink)); - } - - /** - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security metadata for an IoT hub along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listKeysSinglePage(String resourceGroupName, - String resourceName) { - final String accept = "application/json"; - Response res - = service.listKeysSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security metadata for an IoT hub along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listKeysSinglePage(String resourceGroupName, - String resourceName, Context context) { - final String accept = "application/json"; - Response res - = service.listKeysSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security metadata for an IoT hub as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listKeys(String resourceGroupName, - String resourceName) { - return new PagedIterable<>(() -> listKeysSinglePage(resourceGroupName, resourceName), - nextLink -> listKeysNextSinglePage(nextLink)); - } - - /** - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security metadata for an IoT hub as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listKeys(String resourceGroupName, - String resourceName, Context context) { - return new PagedIterable<>(() -> listKeysSinglePage(resourceGroupName, resourceName, context), - nextLink -> listKeysNextSinglePage(nextLink, context)); - } - - /** - * Get a shared access policy by name from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * Get a shared access policy by name from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param keyName The name of the shared access policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a shared access policy by name from an IoT hub along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getKeysForKeyNameWithResponseAsync(String resourceGroupName, String resourceName, String keyName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getKeysForKeyName(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, keyName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a shared access policy by name from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * Get a shared access policy by name from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param keyName The name of the shared access policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a shared access policy by name from an IoT hub on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getKeysForKeyNameAsync(String resourceGroupName, - String resourceName, String keyName) { - return getKeysForKeyNameWithResponseAsync(resourceGroupName, resourceName, keyName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a shared access policy by name from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * Get a shared access policy by name from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param keyName The name of the shared access policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a shared access policy by name from an IoT hub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getKeysForKeyNameWithResponse(String resourceGroupName, - String resourceName, String keyName, Context context) { - final String accept = "application/json"; - return service.getKeysForKeyNameSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, keyName, accept, context); - } - - /** - * Get a shared access policy by name from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * Get a shared access policy by name from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param keyName The name of the shared access policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a shared access policy by name from an IoT hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SharedAccessSignatureAuthorizationRuleInner getKeysForKeyName(String resourceGroupName, String resourceName, - String keyName) { - return getKeysForKeyNameWithResponse(resourceGroupName, resourceName, keyName, Context.NONE).getValue(); - } - - /** - * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more - * information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities - * - * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more - * information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param exportDevicesParameters The parameters that specify the export devices operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> exportDevicesWithResponseAsync(String resourceGroupName, - String resourceName, ExportDevicesRequest exportDevicesParameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.exportDevices(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, - exportDevicesParameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more - * information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities - * - * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more - * information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param exportDevicesParameters The parameters that specify the export devices operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono exportDevicesAsync(String resourceGroupName, String resourceName, - ExportDevicesRequest exportDevicesParameters) { - return exportDevicesWithResponseAsync(resourceGroupName, resourceName, exportDevicesParameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more - * information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities - * - * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more - * information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param exportDevicesParameters The parameters that specify the export devices operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response exportDevicesWithResponse(String resourceGroupName, String resourceName, - ExportDevicesRequest exportDevicesParameters, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.exportDevicesSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, - exportDevicesParameters, context); - } - - /** - * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more - * information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities - * - * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more - * information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param exportDevicesParameters The parameters that specify the export devices operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public JobResponseInner exportDevices(String resourceGroupName, String resourceName, - ExportDevicesRequest exportDevicesParameters) { - return exportDevicesWithResponse(resourceGroupName, resourceName, exportDevicesParameters, Context.NONE) - .getValue(); - } - - /** - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, - * see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities - * - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, - * see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param importDevicesParameters The parameters that specify the import devices operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> importDevicesWithResponseAsync(String resourceGroupName, - String resourceName, ImportDevicesRequest importDevicesParameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.importDevices(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, - importDevicesParameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, - * see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities - * - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, - * see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param importDevicesParameters The parameters that specify the import devices operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono importDevicesAsync(String resourceGroupName, String resourceName, - ImportDevicesRequest importDevicesParameters) { - return importDevicesWithResponseAsync(resourceGroupName, resourceName, importDevicesParameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, - * see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities - * - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, - * see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param importDevicesParameters The parameters that specify the import devices operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response importDevicesWithResponse(String resourceGroupName, String resourceName, - ImportDevicesRequest importDevicesParameters, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.importDevicesSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, contentType, accept, - importDevicesParameters, context); - } - - /** - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, - * see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities - * - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, - * see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param importDevicesParameters The parameters that specify the import devices operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public JobResponseInner importDevices(String resourceGroupName, String resourceName, - ImportDevicesRequest importDevicesParameters) { - return importDevicesWithResponse(resourceGroupName, resourceName, importDevicesParameters, Context.NONE) - .getValue(); - } - - /** - * Get the statistics from an IoT hub - * - * Get the statistics from an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The resourceName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the statistics from an IoT hub - * - * Get the statistics from an IoT hub along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getStatsWithResponseAsync(String resourceGroupName, - String resourceName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getStats(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the statistics from an IoT hub - * - * Get the statistics from an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The resourceName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the statistics from an IoT hub - * - * Get the statistics from an IoT hub on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getStatsAsync(String resourceGroupName, String resourceName) { - return getStatsWithResponseAsync(resourceGroupName, resourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the statistics from an IoT hub - * - * Get the statistics from an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The resourceName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the statistics from an IoT hub - * - * Get the statistics from an IoT hub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStatsWithResponse(String resourceGroupName, String resourceName, - Context context) { - final String accept = "application/json"; - return service.getStatsSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context); - } - - /** - * Get the statistics from an IoT hub - * - * Get the statistics from an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The resourceName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the statistics from an IoT hub - * - * Get the statistics from an IoT hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RegistryStatisticsInner getStats(String resourceGroupName, String resourceName) { - return getStatsWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); - } - - /** - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub - * - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub - * - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getEventHubConsumerGroupWithResponseAsync( - String resourceGroupName, String resourceName, String eventHubEndpointName, String name) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getEventHubConsumerGroup(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, resourceName, - eventHubEndpointName, name, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub - * - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub - * - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getEventHubConsumerGroupAsync(String resourceGroupName, - String resourceName, String eventHubEndpointName, String name) { - return getEventHubConsumerGroupWithResponseAsync(resourceGroupName, resourceName, eventHubEndpointName, name) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub - * - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub - * - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getEventHubConsumerGroupWithResponse(String resourceGroupName, - String resourceName, String eventHubEndpointName, String name, Context context) { - final String accept = "application/json"; - return service.getEventHubConsumerGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, eventHubEndpointName, name, accept, - context); - } - - /** - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub - * - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub - * - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EventHubConsumerGroupInfoInner getEventHubConsumerGroup(String resourceGroupName, String resourceName, - String eventHubEndpointName, String name) { - return getEventHubConsumerGroupWithResponse(resourceGroupName, resourceName, eventHubEndpointName, name, - Context.NONE).getValue(); - } - - /** - * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub - * - * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @param consumerGroupBody The consumer group to add. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the EventHubConsumerGroupInfo object along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createEventHubConsumerGroupWithResponseAsync( - String resourceGroupName, String resourceName, String eventHubEndpointName, String name, - EventHubConsumerGroupBodyDescription consumerGroupBody) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createEventHubConsumerGroup(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, resourceName, - eventHubEndpointName, name, contentType, accept, consumerGroupBody, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub - * - * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @param consumerGroupBody The consumer group to add. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the EventHubConsumerGroupInfo object on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createEventHubConsumerGroupAsync(String resourceGroupName, - String resourceName, String eventHubEndpointName, String name, - EventHubConsumerGroupBodyDescription consumerGroupBody) { - return createEventHubConsumerGroupWithResponseAsync(resourceGroupName, resourceName, eventHubEndpointName, name, - consumerGroupBody).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub - * - * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @param consumerGroupBody The consumer group to add. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the EventHubConsumerGroupInfo object along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createEventHubConsumerGroupWithResponse(String resourceGroupName, - String resourceName, String eventHubEndpointName, String name, - EventHubConsumerGroupBodyDescription consumerGroupBody, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createEventHubConsumerGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, eventHubEndpointName, name, contentType, - accept, consumerGroupBody, context); - } - - /** - * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub - * - * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @param consumerGroupBody The consumer group to add. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the EventHubConsumerGroupInfo object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EventHubConsumerGroupInfoInner createEventHubConsumerGroup(String resourceGroupName, String resourceName, - String eventHubEndpointName, String name, EventHubConsumerGroupBodyDescription consumerGroupBody) { - return createEventHubConsumerGroupWithResponse(resourceGroupName, resourceName, eventHubEndpointName, name, - consumerGroupBody, Context.NONE).getValue(); - } - - /** - * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub - * - * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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> deleteEventHubConsumerGroupWithResponseAsync(String resourceGroupName, - String resourceName, String eventHubEndpointName, String name) { - return FluxUtil - .withContext(context -> service.deleteEventHubConsumerGroup(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, resourceName, - eventHubEndpointName, name, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub - * - * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 deleteEventHubConsumerGroupAsync(String resourceGroupName, String resourceName, - String eventHubEndpointName, String name) { - return deleteEventHubConsumerGroupWithResponseAsync(resourceGroupName, resourceName, eventHubEndpointName, name) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub - * - * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 deleteEventHubConsumerGroupWithResponse(String resourceGroupName, String resourceName, - String eventHubEndpointName, String name, Context context) { - return service.deleteEventHubConsumerGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, eventHubEndpointName, name, context); - } - - /** - * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub - * - * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 deleteEventHubConsumerGroup(String resourceGroupName, String resourceName, String eventHubEndpointName, - String name) { - deleteEventHubConsumerGroupWithResponse(resourceGroupName, resourceName, eventHubEndpointName, name, - Context.NONE); - } - - /** - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listEventHubConsumerGroupsSinglePageAsync( - String resourceGroupName, String resourceName, String eventHubEndpointName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listEventHubConsumerGroups(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, resourceName, - eventHubEndpointName, 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 a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listEventHubConsumerGroupsAsync(String resourceGroupName, - String resourceName, String eventHubEndpointName) { - return new PagedFlux<>( - () -> listEventHubConsumerGroupsSinglePageAsync(resourceGroupName, resourceName, eventHubEndpointName), - nextLink -> listEventHubConsumerGroupsNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listEventHubConsumerGroupsSinglePage(String resourceGroupName, - String resourceName, String eventHubEndpointName) { - final String accept = "application/json"; - Response res = service.listEventHubConsumerGroupsSync( - this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - resourceName, eventHubEndpointName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listEventHubConsumerGroupsSinglePage(String resourceGroupName, - String resourceName, String eventHubEndpointName, Context context) { - final String accept = "application/json"; - Response res = service.listEventHubConsumerGroupsSync( - this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, - resourceName, eventHubEndpointName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listEventHubConsumerGroups(String resourceGroupName, - String resourceName, String eventHubEndpointName) { - return new PagedIterable<>( - () -> listEventHubConsumerGroupsSinglePage(resourceGroupName, resourceName, eventHubEndpointName), - nextLink -> listEventHubConsumerGroupsNextSinglePage(nextLink)); - } - - /** - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listEventHubConsumerGroups(String resourceGroupName, - String resourceName, String eventHubEndpointName, Context context) { - return new PagedIterable<>( - () -> listEventHubConsumerGroupsSinglePage(resourceGroupName, resourceName, eventHubEndpointName, context), - nextLink -> listEventHubConsumerGroupsNextSinglePage(nextLink, context)); - } - - /** - * Check if an IoT hub name is available - * - * Check if an IoT hub name is available. - * - * @param operationInputs The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT hub name is available along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - checkNameAvailabilityWithResponseAsync(OperationInputs operationInputs) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), contentType, accept, operationInputs, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Check if an IoT hub name is available - * - * Check if an IoT hub name is available. - * - * @param operationInputs The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT hub name is available on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono checkNameAvailabilityAsync(OperationInputs operationInputs) { - return checkNameAvailabilityWithResponseAsync(operationInputs).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Check if an IoT hub name is available - * - * Check if an IoT hub name is available. - * - * @param operationInputs The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT hub name is available along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityWithResponse(OperationInputs operationInputs, - Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.checkNameAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), contentType, accept, operationInputs, context); - } - - /** - * Check if an IoT hub name is available - * - * Check if an IoT hub name is available. - * - * @param operationInputs The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT hub name is available. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotHubNameAvailabilityInfoInner checkNameAvailability(OperationInputs operationInputs) { - return checkNameAvailabilityWithResponse(operationInputs, Context.NONE).getValue(); - } - - /** - * Get all the IoT hubs in a resource group - * - * 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 ErrorDetailsException 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 IoT hubs in a resource group - * - * Get all the IoT hubs in a resource group along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all the IoT hubs in a resource group - * - * 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 ErrorDetailsException 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 IoT hubs in a resource group - * - * Get all the IoT hubs in a resource group along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { - 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 all the IoT hubs in a resource group - * - * 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 ErrorDetailsException 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 IoT hubs in a resource group - * - * Get all the IoT hubs in a resource group along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - 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); - } - - /** - * Get all the IoT hubs in a subscription - * - * 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 ErrorDetailsException 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 IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get all the IoT hubs in a subscription - * - * 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 ErrorDetailsException 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 IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get all the IoT hubs in a subscription - * - * 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 ErrorDetailsException 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 IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the list of valid SKUs for an IoT hub - * - * 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 ErrorDetailsException 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 valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getValidSkusNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getValidSkusNext(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 list of valid SKUs for an IoT hub - * - * 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 ErrorDetailsException 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 valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse getValidSkusNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.getValidSkusNextSync(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 list of valid SKUs for an IoT hub - * - * 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 ErrorDetailsException 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 valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse getValidSkusNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.getValidSkusNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * - * 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 ErrorDetailsException 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 the jobs in an IoT hub along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listJobsNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listJobsNext(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 a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * - * 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 ErrorDetailsException 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 the jobs in an IoT hub along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listJobsNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listJobsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * - * 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 ErrorDetailsException 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 the jobs in an IoT hub along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listJobsNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listJobsNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the quota metrics for an IoT hub - * - * 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 ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getQuotaMetricsNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getQuotaMetricsNext(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 quota metrics for an IoT hub - * - * 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 ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse getQuotaMetricsNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.getQuotaMetricsNextSync(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 quota metrics for an IoT hub - * - * 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 ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse getQuotaMetricsNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.getQuotaMetricsNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the health for routing endpoints - * - * 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 ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the health for routing endpoints - * - * Get the health for routing endpoints along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getEndpointHealthNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getEndpointHealthNext(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 health for routing endpoints - * - * 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 ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the health for routing endpoints - * - * Get the health for routing endpoints along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse getEndpointHealthNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.getEndpointHealthNextSync(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 health for routing endpoints - * - * 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 ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the health for routing endpoints - * - * Get the health for routing endpoints along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse getEndpointHealthNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.getEndpointHealthNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * 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 ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security metadata for an IoT hub along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listKeysNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listKeysNext(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 security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * 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 ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security metadata for an IoT hub along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listKeysNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listKeysNextSync(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 security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * 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 ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security metadata for an IoT hub along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listKeysNextSinglePage(String nextLink, - Context context) { - final String accept = "application/json"; - Response res - = service.listKeysNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * 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 ErrorDetailsException 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 the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listEventHubConsumerGroupsNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listEventHubConsumerGroupsNext(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 a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * 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 ErrorDetailsException 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 the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listEventHubConsumerGroupsNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listEventHubConsumerGroupsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * 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 ErrorDetailsException 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 the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub along with - * {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listEventHubConsumerGroupsNextSinglePage(String nextLink, - Context context) { - final String accept = "application/json"; - Response res - = service.listEventHubConsumerGroupsNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesImpl.java deleted file mode 100644 index dc6a006520e7..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesImpl.java +++ /dev/null @@ -1,526 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.iothub.fluent.IotHubResourcesClient; -import com.azure.resourcemanager.iothub.fluent.models.EndpointHealthDataInner; -import com.azure.resourcemanager.iothub.fluent.models.EventHubConsumerGroupInfoInner; -import com.azure.resourcemanager.iothub.fluent.models.IotHubDescriptionInner; -import com.azure.resourcemanager.iothub.fluent.models.IotHubNameAvailabilityInfoInner; -import com.azure.resourcemanager.iothub.fluent.models.IotHubQuotaMetricInfoInner; -import com.azure.resourcemanager.iothub.fluent.models.IotHubSkuDescriptionInner; -import com.azure.resourcemanager.iothub.fluent.models.JobResponseInner; -import com.azure.resourcemanager.iothub.fluent.models.RegistryStatisticsInner; -import com.azure.resourcemanager.iothub.fluent.models.SharedAccessSignatureAuthorizationRuleInner; -import com.azure.resourcemanager.iothub.fluent.models.TestAllRoutesResultInner; -import com.azure.resourcemanager.iothub.fluent.models.TestRouteResultInner; -import com.azure.resourcemanager.iothub.models.EndpointHealthData; -import com.azure.resourcemanager.iothub.models.EventHubConsumerGroupInfo; -import com.azure.resourcemanager.iothub.models.ExportDevicesRequest; -import com.azure.resourcemanager.iothub.models.ImportDevicesRequest; -import com.azure.resourcemanager.iothub.models.IotHubDescription; -import com.azure.resourcemanager.iothub.models.IotHubNameAvailabilityInfo; -import com.azure.resourcemanager.iothub.models.IotHubQuotaMetricInfo; -import com.azure.resourcemanager.iothub.models.IotHubResources; -import com.azure.resourcemanager.iothub.models.IotHubSkuDescription; -import com.azure.resourcemanager.iothub.models.JobResponse; -import com.azure.resourcemanager.iothub.models.OperationInputs; -import com.azure.resourcemanager.iothub.models.RegistryStatistics; -import com.azure.resourcemanager.iothub.models.SharedAccessSignatureAuthorizationRule; -import com.azure.resourcemanager.iothub.models.TestAllRoutesInput; -import com.azure.resourcemanager.iothub.models.TestAllRoutesResult; -import com.azure.resourcemanager.iothub.models.TestRouteInput; -import com.azure.resourcemanager.iothub.models.TestRouteResult; - -public final class IotHubResourcesImpl implements IotHubResources { - private static final ClientLogger LOGGER = new ClientLogger(IotHubResourcesImpl.class); - - private final IotHubResourcesClient innerClient; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - public IotHubResourcesImpl(IotHubResourcesClient innerClient, - com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, - Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, resourceName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new IotHubDescriptionImpl(inner.getValue(), this.manager())); - } - - public IotHubDescription getByResourceGroup(String resourceGroupName, String resourceName) { - IotHubDescriptionInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourceName); - if (inner != null) { - return new IotHubDescriptionImpl(inner, this.manager()); - } else { - return null; - } - } - - public void deleteByResourceGroup(String resourceGroupName, String resourceName) { - this.serviceClient().delete(resourceGroupName, resourceName); - } - - public void delete(String resourceGroupName, String resourceName, Context context) { - this.serviceClient().delete(resourceGroupName, resourceName, context); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new IotHubDescriptionImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new IotHubDescriptionImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new IotHubDescriptionImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new IotHubDescriptionImpl(inner1, this.manager())); - } - - public PagedIterable getValidSkus(String resourceGroupName, String resourceName) { - PagedIterable inner - = this.serviceClient().getValidSkus(resourceGroupName, resourceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new IotHubSkuDescriptionImpl(inner1, this.manager())); - } - - public PagedIterable getValidSkus(String resourceGroupName, String resourceName, - Context context) { - PagedIterable inner - = this.serviceClient().getValidSkus(resourceGroupName, resourceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new IotHubSkuDescriptionImpl(inner1, this.manager())); - } - - public PagedIterable listJobs(String resourceGroupName, String resourceName) { - PagedIterable inner = this.serviceClient().listJobs(resourceGroupName, resourceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new JobResponseImpl(inner1, this.manager())); - } - - public PagedIterable listJobs(String resourceGroupName, String resourceName, Context context) { - PagedIterable inner = this.serviceClient().listJobs(resourceGroupName, resourceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new JobResponseImpl(inner1, this.manager())); - } - - public Response getJobWithResponse(String resourceGroupName, String resourceName, String jobId, - Context context) { - Response inner - = this.serviceClient().getJobWithResponse(resourceGroupName, resourceName, jobId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new JobResponseImpl(inner.getValue(), this.manager())); - } - - public JobResponse getJob(String resourceGroupName, String resourceName, String jobId) { - JobResponseInner inner = this.serviceClient().getJob(resourceGroupName, resourceName, jobId); - if (inner != null) { - return new JobResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable getQuotaMetrics(String resourceGroupName, String resourceName) { - PagedIterable inner - = this.serviceClient().getQuotaMetrics(resourceGroupName, resourceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new IotHubQuotaMetricInfoImpl(inner1, this.manager())); - } - - public PagedIterable getQuotaMetrics(String resourceGroupName, String resourceName, - Context context) { - PagedIterable inner - = this.serviceClient().getQuotaMetrics(resourceGroupName, resourceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new IotHubQuotaMetricInfoImpl(inner1, this.manager())); - } - - public PagedIterable getEndpointHealth(String resourceGroupName, String iotHubName) { - PagedIterable inner - = this.serviceClient().getEndpointHealth(resourceGroupName, iotHubName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new EndpointHealthDataImpl(inner1, this.manager())); - } - - public PagedIterable getEndpointHealth(String resourceGroupName, String iotHubName, - Context context) { - PagedIterable inner - = this.serviceClient().getEndpointHealth(resourceGroupName, iotHubName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new EndpointHealthDataImpl(inner1, this.manager())); - } - - public Response testAllRoutesWithResponse(String iotHubName, String resourceGroupName, - TestAllRoutesInput input, Context context) { - Response inner - = this.serviceClient().testAllRoutesWithResponse(iotHubName, resourceGroupName, input, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new TestAllRoutesResultImpl(inner.getValue(), this.manager())); - } - - public TestAllRoutesResult testAllRoutes(String iotHubName, String resourceGroupName, TestAllRoutesInput input) { - TestAllRoutesResultInner inner = this.serviceClient().testAllRoutes(iotHubName, resourceGroupName, input); - if (inner != null) { - return new TestAllRoutesResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response testRouteWithResponse(String iotHubName, String resourceGroupName, - TestRouteInput input, Context context) { - Response inner - = this.serviceClient().testRouteWithResponse(iotHubName, resourceGroupName, input, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new TestRouteResultImpl(inner.getValue(), this.manager())); - } - - public TestRouteResult testRoute(String iotHubName, String resourceGroupName, TestRouteInput input) { - TestRouteResultInner inner = this.serviceClient().testRoute(iotHubName, resourceGroupName, input); - if (inner != null) { - return new TestRouteResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listKeys(String resourceGroupName, - String resourceName) { - PagedIterable inner - = this.serviceClient().listKeys(resourceGroupName, resourceName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new SharedAccessSignatureAuthorizationRuleImpl(inner1, this.manager())); - } - - public PagedIterable listKeys(String resourceGroupName, String resourceName, - Context context) { - PagedIterable inner - = this.serviceClient().listKeys(resourceGroupName, resourceName, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new SharedAccessSignatureAuthorizationRuleImpl(inner1, this.manager())); - } - - public Response getKeysForKeyNameWithResponse(String resourceGroupName, - String resourceName, String keyName, Context context) { - Response inner - = this.serviceClient().getKeysForKeyNameWithResponse(resourceGroupName, resourceName, keyName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SharedAccessSignatureAuthorizationRuleImpl(inner.getValue(), this.manager())); - } - - public SharedAccessSignatureAuthorizationRule getKeysForKeyName(String resourceGroupName, String resourceName, - String keyName) { - SharedAccessSignatureAuthorizationRuleInner inner - = this.serviceClient().getKeysForKeyName(resourceGroupName, resourceName, keyName); - if (inner != null) { - return new SharedAccessSignatureAuthorizationRuleImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response exportDevicesWithResponse(String resourceGroupName, String resourceName, - ExportDevicesRequest exportDevicesParameters, Context context) { - Response inner = this.serviceClient() - .exportDevicesWithResponse(resourceGroupName, resourceName, exportDevicesParameters, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new JobResponseImpl(inner.getValue(), this.manager())); - } - - public JobResponse exportDevices(String resourceGroupName, String resourceName, - ExportDevicesRequest exportDevicesParameters) { - JobResponseInner inner - = this.serviceClient().exportDevices(resourceGroupName, resourceName, exportDevicesParameters); - if (inner != null) { - return new JobResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response importDevicesWithResponse(String resourceGroupName, String resourceName, - ImportDevicesRequest importDevicesParameters, Context context) { - Response inner = this.serviceClient() - .importDevicesWithResponse(resourceGroupName, resourceName, importDevicesParameters, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new JobResponseImpl(inner.getValue(), this.manager())); - } - - public JobResponse importDevices(String resourceGroupName, String resourceName, - ImportDevicesRequest importDevicesParameters) { - JobResponseInner inner - = this.serviceClient().importDevices(resourceGroupName, resourceName, importDevicesParameters); - if (inner != null) { - return new JobResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getStatsWithResponse(String resourceGroupName, String resourceName, - Context context) { - Response inner - = this.serviceClient().getStatsWithResponse(resourceGroupName, resourceName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RegistryStatisticsImpl(inner.getValue(), this.manager())); - } - - public RegistryStatistics getStats(String resourceGroupName, String resourceName) { - RegistryStatisticsInner inner = this.serviceClient().getStats(resourceGroupName, resourceName); - if (inner != null) { - return new RegistryStatisticsImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getEventHubConsumerGroupWithResponse(String resourceGroupName, - String resourceName, String eventHubEndpointName, String name, Context context) { - Response inner = this.serviceClient() - .getEventHubConsumerGroupWithResponse(resourceGroupName, resourceName, eventHubEndpointName, name, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new EventHubConsumerGroupInfoImpl(inner.getValue(), this.manager())); - } - - public EventHubConsumerGroupInfo getEventHubConsumerGroup(String resourceGroupName, String resourceName, - String eventHubEndpointName, String name) { - EventHubConsumerGroupInfoInner inner = this.serviceClient() - .getEventHubConsumerGroup(resourceGroupName, resourceName, eventHubEndpointName, name); - if (inner != null) { - return new EventHubConsumerGroupInfoImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteEventHubConsumerGroupWithResponse(String resourceGroupName, String resourceName, - String eventHubEndpointName, String name, Context context) { - return this.serviceClient() - .deleteEventHubConsumerGroupWithResponse(resourceGroupName, resourceName, eventHubEndpointName, name, - context); - } - - public void deleteEventHubConsumerGroup(String resourceGroupName, String resourceName, String eventHubEndpointName, - String name) { - this.serviceClient().deleteEventHubConsumerGroup(resourceGroupName, resourceName, eventHubEndpointName, name); - } - - public PagedIterable listEventHubConsumerGroups(String resourceGroupName, - String resourceName, String eventHubEndpointName) { - PagedIterable inner - = this.serviceClient().listEventHubConsumerGroups(resourceGroupName, resourceName, eventHubEndpointName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new EventHubConsumerGroupInfoImpl(inner1, this.manager())); - } - - public PagedIterable listEventHubConsumerGroups(String resourceGroupName, - String resourceName, String eventHubEndpointName, Context context) { - PagedIterable inner = this.serviceClient() - .listEventHubConsumerGroups(resourceGroupName, resourceName, eventHubEndpointName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new EventHubConsumerGroupInfoImpl(inner1, this.manager())); - } - - public Response checkNameAvailabilityWithResponse(OperationInputs operationInputs, - Context context) { - Response inner - = this.serviceClient().checkNameAvailabilityWithResponse(operationInputs, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new IotHubNameAvailabilityInfoImpl(inner.getValue(), this.manager())); - } - - public IotHubNameAvailabilityInfo checkNameAvailability(OperationInputs operationInputs) { - IotHubNameAvailabilityInfoInner inner = this.serviceClient().checkNameAvailability(operationInputs); - if (inner != null) { - return new IotHubNameAvailabilityInfoImpl(inner, this.manager()); - } else { - return null; - } - } - - public IotHubDescription 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "IotHubs"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'IotHubs'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "IotHubs"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'IotHubs'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, context); - } - - public EventHubConsumerGroupInfo getEventHubConsumerGroupById(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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "IotHubs"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'IotHubs'.", id))); - } - String eventHubEndpointName = ResourceManagerUtils.getValueFromIdByName(id, "eventHubEndpoints"); - if (eventHubEndpointName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'eventHubEndpoints'.", id))); - } - String name = ResourceManagerUtils.getValueFromIdByName(id, "ConsumerGroups"); - if (name == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'ConsumerGroups'.", id))); - } - return this - .getEventHubConsumerGroupWithResponse(resourceGroupName, resourceName, eventHubEndpointName, name, - Context.NONE) - .getValue(); - } - - public Response getEventHubConsumerGroupByIdWithResponse(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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "IotHubs"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'IotHubs'.", id))); - } - String eventHubEndpointName = ResourceManagerUtils.getValueFromIdByName(id, "eventHubEndpoints"); - if (eventHubEndpointName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'eventHubEndpoints'.", id))); - } - String name = ResourceManagerUtils.getValueFromIdByName(id, "ConsumerGroups"); - if (name == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'ConsumerGroups'.", id))); - } - return this.getEventHubConsumerGroupWithResponse(resourceGroupName, resourceName, eventHubEndpointName, name, - 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "IotHubs"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'IotHubs'.", id))); - } - this.delete(resourceGroupName, resourceName, 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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "IotHubs"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'IotHubs'.", id))); - } - this.delete(resourceGroupName, resourceName, context); - } - - public void deleteEventHubConsumerGroupById(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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "IotHubs"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'IotHubs'.", id))); - } - String eventHubEndpointName = ResourceManagerUtils.getValueFromIdByName(id, "eventHubEndpoints"); - if (eventHubEndpointName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'eventHubEndpoints'.", id))); - } - String name = ResourceManagerUtils.getValueFromIdByName(id, "ConsumerGroups"); - if (name == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'ConsumerGroups'.", id))); - } - this.deleteEventHubConsumerGroupWithResponse(resourceGroupName, resourceName, eventHubEndpointName, name, - Context.NONE); - } - - public Response deleteEventHubConsumerGroupByIdWithResponse(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 resourceName = ResourceManagerUtils.getValueFromIdByName(id, "IotHubs"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'IotHubs'.", id))); - } - String eventHubEndpointName = ResourceManagerUtils.getValueFromIdByName(id, "eventHubEndpoints"); - if (eventHubEndpointName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'eventHubEndpoints'.", id))); - } - String name = ResourceManagerUtils.getValueFromIdByName(id, "ConsumerGroups"); - if (name == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'ConsumerGroups'.", id))); - } - return this.deleteEventHubConsumerGroupWithResponse(resourceGroupName, resourceName, eventHubEndpointName, name, - context); - } - - private IotHubResourcesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } - - public IotHubDescriptionImpl define(String name) { - return new IotHubDescriptionImpl(name, this.manager()); - } - - public EventHubConsumerGroupInfoImpl defineEventHubConsumerGroup(String name) { - return new EventHubConsumerGroupInfoImpl(name, this.manager()); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubSkuDescriptionImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubSkuDescriptionImpl.java deleted file mode 100644 index 1220a73242de..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubSkuDescriptionImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -import com.azure.resourcemanager.iothub.fluent.models.IotHubSkuDescriptionInner; -import com.azure.resourcemanager.iothub.models.IotHubCapacity; -import com.azure.resourcemanager.iothub.models.IotHubSkuDescription; -import com.azure.resourcemanager.iothub.models.IotHubSkuInfo; - -public final class IotHubSkuDescriptionImpl implements IotHubSkuDescription { - private IotHubSkuDescriptionInner innerObject; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - IotHubSkuDescriptionImpl(IotHubSkuDescriptionInner innerObject, - com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String resourceType() { - return this.innerModel().resourceType(); - } - - public IotHubSkuInfo sku() { - return this.innerModel().sku(); - } - - public IotHubCapacity capacity() { - return this.innerModel().capacity(); - } - - public IotHubSkuDescriptionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubsClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubsClientImpl.java deleted file mode 100644 index 9cd8eb64c911..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubsClientImpl.java +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.iothub.fluent.IotHubsClient; -import com.azure.resourcemanager.iothub.models.ErrorDetailsException; -import com.azure.resourcemanager.iothub.models.FailoverInput; -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 IotHubsClient. - */ -public final class IotHubsClientImpl implements IotHubsClient { - /** - * The proxy service used to perform REST calls. - */ - private final IotHubsService service; - - /** - * The service client containing this operation class. - */ - private final IotHubClientImpl client; - - /** - * Initializes an instance of IotHubsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotHubsClientImpl(IotHubClientImpl client) { - this.service = RestProxy.create(IotHubsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for IotHubClientIotHubs to be used by the proxy service to perform REST - * calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "IotHubClientIotHubs") - public interface IotHubsService { - @Headers({ "Accept: application/json;q=0.9" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/failover") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono>> manualFailover(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("iotHubName") String iotHubName, - @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") FailoverInput failoverInput, - Context context); - - @Headers({ "Accept: application/json;q=0.9" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/failover") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response manualFailoverSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("iotHubName") String iotHubName, - @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") FailoverInput failoverInput, - Context context); - } - - /** - * Manually initiate a failover for the IoT Hub to its secondary region - * - * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see - * https://aka.ms/manualfailover. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param failoverInput Region to failover to. Must be the Azure paired region. Get the value from the secondary - * location in the locations property. To learn more, see https://aka.ms/manualfailover/region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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>> manualFailoverWithResponseAsync(String iotHubName, - String resourceGroupName, FailoverInput failoverInput) { - final String contentType = "application/json"; - return FluxUtil - .withContext(context -> service.manualFailover(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, iotHubName, contentType, failoverInput, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Manually initiate a failover for the IoT Hub to its secondary region - * - * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see - * https://aka.ms/manualfailover. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param failoverInput Region to failover to. Must be the Azure paired region. Get the value from the secondary - * location in the locations property. To learn more, see https://aka.ms/manualfailover/region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 manualFailoverWithResponse(String iotHubName, String resourceGroupName, - FailoverInput failoverInput) { - final String contentType = "application/json"; - return service.manualFailoverSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, iotHubName, contentType, failoverInput, Context.NONE); - } - - /** - * Manually initiate a failover for the IoT Hub to its secondary region - * - * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see - * https://aka.ms/manualfailover. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param failoverInput Region to failover to. Must be the Azure paired region. Get the value from the secondary - * location in the locations property. To learn more, see https://aka.ms/manualfailover/region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 manualFailoverWithResponse(String iotHubName, String resourceGroupName, - FailoverInput failoverInput, Context context) { - final String contentType = "application/json"; - return service.manualFailoverSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, iotHubName, contentType, failoverInput, context); - } - - /** - * Manually initiate a failover for the IoT Hub to its secondary region - * - * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see - * https://aka.ms/manualfailover. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param failoverInput Region to failover to. Must be the Azure paired region. Get the value from the secondary - * location in the locations property. To learn more, see https://aka.ms/manualfailover/region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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> beginManualFailoverAsync(String iotHubName, String resourceGroupName, - FailoverInput failoverInput) { - Mono>> mono - = manualFailoverWithResponseAsync(iotHubName, resourceGroupName, failoverInput); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Manually initiate a failover for the IoT Hub to its secondary region - * - * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see - * https://aka.ms/manualfailover. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param failoverInput Region to failover to. Must be the Azure paired region. Get the value from the secondary - * location in the locations property. To learn more, see https://aka.ms/manualfailover/region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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> beginManualFailover(String iotHubName, String resourceGroupName, - FailoverInput failoverInput) { - Response response = manualFailoverWithResponse(iotHubName, resourceGroupName, failoverInput); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Manually initiate a failover for the IoT Hub to its secondary region - * - * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see - * https://aka.ms/manualfailover. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param failoverInput Region to failover to. Must be the Azure paired region. Get the value from the secondary - * location in the locations property. To learn more, see https://aka.ms/manualfailover/region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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> beginManualFailover(String iotHubName, String resourceGroupName, - FailoverInput failoverInput, Context context) { - Response response - = manualFailoverWithResponse(iotHubName, resourceGroupName, failoverInput, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Manually initiate a failover for the IoT Hub to its secondary region - * - * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see - * https://aka.ms/manualfailover. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param failoverInput Region to failover to. Must be the Azure paired region. Get the value from the secondary - * location in the locations property. To learn more, see https://aka.ms/manualfailover/region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 manualFailoverAsync(String iotHubName, String resourceGroupName, FailoverInput failoverInput) { - return beginManualFailoverAsync(iotHubName, resourceGroupName, failoverInput).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Manually initiate a failover for the IoT Hub to its secondary region - * - * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see - * https://aka.ms/manualfailover. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param failoverInput Region to failover to. Must be the Azure paired region. Get the value from the secondary - * location in the locations property. To learn more, see https://aka.ms/manualfailover/region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 manualFailover(String iotHubName, String resourceGroupName, FailoverInput failoverInput) { - beginManualFailover(iotHubName, resourceGroupName, failoverInput).getFinalResult(); - } - - /** - * Manually initiate a failover for the IoT Hub to its secondary region - * - * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see - * https://aka.ms/manualfailover. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param failoverInput Region to failover to. Must be the Azure paired region. Get the value from the secondary - * location in the locations property. To learn more, see https://aka.ms/manualfailover/region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 manualFailover(String iotHubName, String resourceGroupName, FailoverInput failoverInput, - Context context) { - beginManualFailover(iotHubName, resourceGroupName, failoverInput, context).getFinalResult(); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubsImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubsImpl.java deleted file mode 100644 index 02057bbc84de..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubsImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.iothub.fluent.IotHubsClient; -import com.azure.resourcemanager.iothub.models.FailoverInput; -import com.azure.resourcemanager.iothub.models.IotHubs; - -public final class IotHubsImpl implements IotHubs { - private static final ClientLogger LOGGER = new ClientLogger(IotHubsImpl.class); - - private final IotHubsClient innerClient; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - public IotHubsImpl(IotHubsClient innerClient, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public void manualFailover(String iotHubName, String resourceGroupName, FailoverInput failoverInput) { - this.serviceClient().manualFailover(iotHubName, resourceGroupName, failoverInput); - } - - public void manualFailover(String iotHubName, String resourceGroupName, FailoverInput failoverInput, - Context context) { - this.serviceClient().manualFailover(iotHubName, resourceGroupName, failoverInput, context); - } - - private IotHubsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/JobResponseImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/JobResponseImpl.java deleted file mode 100644 index 8cdf94806d11..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/JobResponseImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -import com.azure.resourcemanager.iothub.fluent.models.JobResponseInner; -import com.azure.resourcemanager.iothub.models.JobResponse; -import com.azure.resourcemanager.iothub.models.JobStatus; -import com.azure.resourcemanager.iothub.models.JobType; -import java.time.OffsetDateTime; - -public final class JobResponseImpl implements JobResponse { - private JobResponseInner innerObject; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - JobResponseImpl(JobResponseInner innerObject, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String jobId() { - return this.innerModel().jobId(); - } - - public OffsetDateTime startTimeUtc() { - return this.innerModel().startTimeUtc(); - } - - public OffsetDateTime endTimeUtc() { - return this.innerModel().endTimeUtc(); - } - - public JobType type() { - return this.innerModel().type(); - } - - public JobStatus status() { - return this.innerModel().status(); - } - - public String failureReason() { - return this.innerModel().failureReason(); - } - - public String statusMessage() { - return this.innerModel().statusMessage(); - } - - public String parentJobId() { - return this.innerModel().parentJobId(); - } - - public JobResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationImpl.java deleted file mode 100644 index bac99ad64dc7..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -import com.azure.resourcemanager.iothub.fluent.models.OperationInner; -import com.azure.resourcemanager.iothub.models.Operation; -import com.azure.resourcemanager.iothub.models.OperationDisplay; - -public final class OperationImpl implements Operation { - private OperationInner innerObject; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - OperationImpl(OperationInner innerObject, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public OperationDisplay display() { - return this.innerModel().display(); - } - - public OperationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationsClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationsClientImpl.java deleted file mode 100644 index 33926873f3d4..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.iothub.fluent.OperationsClient; -import com.azure.resourcemanager.iothub.fluent.models.OperationInner; -import com.azure.resourcemanager.iothub.implementation.models.OperationListResult; -import com.azure.resourcemanager.iothub.models.ErrorDetailsException; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in OperationsClient. - */ -public final class OperationsClientImpl implements OperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final OperationsService service; - - /** - * The service client containing this operation class. - */ - private final IotHubClientImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(IotHubClientImpl client) { - this.service - = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for IotHubClientOperations to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "IotHubClientOperations") - public interface OperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Devices/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - 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.Devices/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List the operations for the provider. - * - * @throws ErrorDetailsException 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 IoT Hub operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - final String accept = "application/json"; - 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())); - } - - /** - * List the operations for the provider. - * - * @throws ErrorDetailsException 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 IoT Hub operations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List the operations for the provider. - * - * @throws ErrorDetailsException 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 IoT Hub operations along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage() { - 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); - } - - /** - * List the operations for the provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 IoT Hub operations along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(Context context) { - 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); - } - - /** - * List the operations for the provider. - * - * @throws ErrorDetailsException 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 IoT Hub operations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); - } - - /** - * List the operations for the provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 IoT Hub 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 ErrorDetailsException 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 IoT Hub operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 IoT Hub operations along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 IoT Hub operations along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationsImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationsImpl.java deleted file mode 100644 index 763955d90a72..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationsImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.iothub.fluent.OperationsClient; -import com.azure.resourcemanager.iothub.fluent.models.OperationInner; -import com.azure.resourcemanager.iothub.models.Operation; -import com.azure.resourcemanager.iothub.models.Operations; - -public final class OperationsImpl implements Operations { - private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); - - private final OperationsClient innerClient; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - private OperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionImpl.java deleted file mode 100644 index 3b63ad85db01..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.iothub.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.iothub.models.PrivateEndpointConnection; -import com.azure.resourcemanager.iothub.models.PrivateEndpointConnectionProperties; - -public final class PrivateEndpointConnectionImpl implements PrivateEndpointConnection { - private PrivateEndpointConnectionInner innerObject; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, - com.azure.resourcemanager.iothub.IotHubManager 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 PrivateEndpointConnectionProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public PrivateEndpointConnectionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsClientImpl.java deleted file mode 100644 index 04f4c60fab8f..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsClientImpl.java +++ /dev/null @@ -1,725 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.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.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.iothub.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.iothub.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.iothub.models.ErrorDetailsException; -import java.nio.ByteBuffer; -import java.util.List; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. - */ -public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final PrivateEndpointConnectionsService service; - - /** - * The service client containing this operation class. - */ - private final IotHubClientImpl client; - - /** - * Initializes an instance of PrivateEndpointConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateEndpointConnectionsClientImpl(IotHubClientImpl client) { - this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for IotHubClientPrivateEndpointConnections to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "IotHubClientPrivateEndpointConnections") - public interface PrivateEndpointConnectionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") PrivateEndpointConnectionInner privateEndpointConnection, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response updateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") PrivateEndpointConnectionInner privateEndpointConnection, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono>> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response> listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get private endpoint connection - * - * Get private endpoint connection properties. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection - * - * Get private endpoint connection properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String resourceName, String privateEndpointConnectionName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get private endpoint connection - * - * Get private endpoint connection properties. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection - * - * Get private endpoint connection properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String resourceName, - String privateEndpointConnectionName) { - return getWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get private endpoint connection - * - * Get private endpoint connection properties. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection - * - * Get private endpoint connection properties along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String resourceName, - String privateEndpointConnectionName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, privateEndpointConnectionName, accept, context); - } - - /** - * Get private endpoint connection - * - * Get private endpoint connection properties. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection - * - * Get private endpoint connection properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner get(String resourceGroupName, String resourceName, - String privateEndpointConnectionName) { - return getWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, Context.NONE).getValue(); - } - - /** - * Update private endpoint connection - * - * Update the status of a private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param privateEndpointConnection The private endpoint connection with updated properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection of an IotHub along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String resourceName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, - contentType, accept, privateEndpointConnection, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update private endpoint connection - * - * Update the status of a private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param privateEndpointConnection The private endpoint connection with updated properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection of an IotHub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String resourceName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, - contentType, accept, privateEndpointConnection, Context.NONE); - } - - /** - * Update private endpoint connection - * - * Update the status of a private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param privateEndpointConnection The private endpoint connection with updated properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection of an IotHub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceGroupName, String resourceName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, - Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, - contentType, accept, privateEndpointConnection, context); - } - - /** - * Update private endpoint connection - * - * Update the status of a private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param privateEndpointConnection The private endpoint connection with updated properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 private endpoint connection of an IotHub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, PrivateEndpointConnectionInner> beginUpdateAsync( - String resourceGroupName, String resourceName, String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, resourceName, - privateEndpointConnectionName, privateEndpointConnection); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, - this.client.getContext()); - } - - /** - * Update private endpoint connection - * - * Update the status of a private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param privateEndpointConnection The private endpoint connection with updated properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the private endpoint connection of an IotHub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, PrivateEndpointConnectionInner> beginUpdate( - String resourceGroupName, String resourceName, String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection) { - Response response = updateWithResponse(resourceGroupName, resourceName, - privateEndpointConnectionName, privateEndpointConnection); - return this.client.getLroResult(response, - PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, Context.NONE); - } - - /** - * Update private endpoint connection - * - * Update the status of a private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param privateEndpointConnection The private endpoint connection with updated properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the private endpoint connection of an IotHub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, PrivateEndpointConnectionInner> beginUpdate( - String resourceGroupName, String resourceName, String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection, Context context) { - Response response = updateWithResponse(resourceGroupName, resourceName, - privateEndpointConnectionName, privateEndpointConnection, context); - return this.client.getLroResult(response, - PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, context); - } - - /** - * Update private endpoint connection - * - * Update the status of a private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param privateEndpointConnection The private endpoint connection with updated properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection of an IotHub on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String resourceName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { - return beginUpdateAsync(resourceGroupName, resourceName, privateEndpointConnectionName, - privateEndpointConnection).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update private endpoint connection - * - * Update the status of a private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param privateEndpointConnection The private endpoint connection with updated properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection of an IotHub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner update(String resourceGroupName, String resourceName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { - return beginUpdate(resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection) - .getFinalResult(); - } - - /** - * Update private endpoint connection - * - * Update the status of a private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param privateEndpointConnection The private endpoint connection with updated properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection of an IotHub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner update(String resourceGroupName, String resourceName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, - Context context) { - return beginUpdate(resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection, - context).getFinalResult(); - } - - /** - * Delete private endpoint connection - * - * Delete private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection of an IotHub along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName, - String privateEndpointConnectionName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete private endpoint connection - * - * Delete private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection of an IotHub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String resourceName, - String privateEndpointConnectionName) { - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, accept, - Context.NONE); - } - - /** - * Delete private endpoint connection - * - * Delete private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection of an IotHub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String resourceName, - String privateEndpointConnectionName, Context context) { - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, privateEndpointConnectionName, accept, - context); - } - - /** - * Delete private endpoint connection - * - * Delete private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 private endpoint connection of an IotHub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName, - String privateEndpointConnectionName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Delete private endpoint connection - * - * Delete private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the private endpoint connection of an IotHub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, - String privateEndpointConnectionName) { - Response response - = deleteWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Delete private endpoint connection - * - * Delete private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the private endpoint connection of an IotHub. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, - String privateEndpointConnectionName, Context context) { - Response response - = deleteWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Delete private endpoint connection - * - * Delete private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection of an IotHub on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String resourceName, - String privateEndpointConnectionName) { - return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete private endpoint connection - * - * Delete private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 resourceName, String privateEndpointConnectionName) { - beginDelete(resourceGroupName, resourceName, privateEndpointConnectionName).getFinalResult(); - } - - /** - * Delete private endpoint connection - * - * Delete private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 resourceName, String privateEndpointConnectionName, - Context context) { - beginDelete(resourceGroupName, resourceName, privateEndpointConnectionName, context).getFinalResult(); - } - - /** - * List private endpoint connections - * - * List private endpoint connection properties. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listWithResponseAsync(String resourceGroupName, - String resourceName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List private endpoint connections - * - * List private endpoint connection properties. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAsync(String resourceGroupName, String resourceName) { - return listWithResponseAsync(resourceGroupName, resourceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * List private endpoint connections - * - * List private endpoint connection properties. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response> listWithResponse(String resourceGroupName, - String resourceName, Context context) { - final String accept = "application/json"; - return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, accept, context); - } - - /** - * List private endpoint connections - * - * List private endpoint connection properties. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public List list(String resourceGroupName, String resourceName) { - return listWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsImpl.java deleted file mode 100644 index 9f0ec8ce6417..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.iothub.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.iothub.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.iothub.models.PrivateEndpointConnection; -import com.azure.resourcemanager.iothub.models.PrivateEndpointConnections; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { - private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); - - private final PrivateEndpointConnectionsClient innerClient; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClient, - com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String resourceName, - String privateEndpointConnectionName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); - } - - public PrivateEndpointConnection get(String resourceGroupName, String resourceName, - String privateEndpointConnectionName) { - PrivateEndpointConnectionInner inner - = this.serviceClient().get(resourceGroupName, resourceName, privateEndpointConnectionName); - if (inner != null) { - return new PrivateEndpointConnectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public PrivateEndpointConnection update(String resourceGroupName, String resourceName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { - PrivateEndpointConnectionInner inner = this.serviceClient() - .update(resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection); - if (inner != null) { - return new PrivateEndpointConnectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public PrivateEndpointConnection update(String resourceGroupName, String resourceName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, - Context context) { - PrivateEndpointConnectionInner inner = this.serviceClient() - .update(resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection, context); - if (inner != null) { - return new PrivateEndpointConnectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { - this.serviceClient().delete(resourceGroupName, resourceName, privateEndpointConnectionName); - } - - public void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName, - Context context) { - this.serviceClient().delete(resourceGroupName, resourceName, privateEndpointConnectionName, context); - } - - public Response> listWithResponse(String resourceGroupName, String resourceName, - Context context) { - Response> inner - = this.serviceClient().listWithResponse(resourceGroupName, resourceName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - inner.getValue() - .stream() - .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } - - public List list(String resourceGroupName, String resourceName) { - List inner = this.serviceClient().list(resourceGroupName, resourceName); - if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - private PrivateEndpointConnectionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesImpl.java deleted file mode 100644 index e78967e7b468..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -import com.azure.resourcemanager.iothub.fluent.models.GroupIdInformationInner; -import com.azure.resourcemanager.iothub.fluent.models.PrivateLinkResourcesInner; -import com.azure.resourcemanager.iothub.models.GroupIdInformation; -import com.azure.resourcemanager.iothub.models.PrivateLinkResources; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class PrivateLinkResourcesImpl implements PrivateLinkResources { - private PrivateLinkResourcesInner innerObject; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - PrivateLinkResourcesImpl(PrivateLinkResourcesInner innerObject, - com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new GroupIdInformationImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public PrivateLinkResourcesInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsClientImpl.java deleted file mode 100644 index 9fb8056458d8..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsClientImpl.java +++ /dev/null @@ -1,266 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.iothub.fluent.PrivateLinkResourcesOperationsClient; -import com.azure.resourcemanager.iothub.fluent.models.GroupIdInformationInner; -import com.azure.resourcemanager.iothub.fluent.models.PrivateLinkResourcesInner; -import com.azure.resourcemanager.iothub.models.ErrorDetailsException; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in PrivateLinkResourcesOperationsClient. - */ -public final class PrivateLinkResourcesOperationsClientImpl implements PrivateLinkResourcesOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final PrivateLinkResourcesOperationsService service; - - /** - * The service client containing this operation class. - */ - private final IotHubClientImpl client; - - /** - * Initializes an instance of PrivateLinkResourcesOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateLinkResourcesOperationsClientImpl(IotHubClientImpl client) { - this.service = RestProxy.create(PrivateLinkResourcesOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for IotHubClientPrivateLinkResourcesOperations to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "IotHubClientPrivateLinkResourcesOperations") - public interface PrivateLinkResourcesOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources/{groupId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("groupId") String groupId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources/{groupId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @PathParam("groupId") String groupId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get the specified private link resource - * - * Get the specified private link resource for the given IotHub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param groupId The name of the private link resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 private link resource - * - * Get the specified private link resource for the given IotHub along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String resourceName, - String groupId) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, groupId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the specified private link resource - * - * Get the specified private link resource for the given IotHub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param groupId The name of the private link resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 private link resource - * - * Get the specified private link resource for the given IotHub on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String resourceName, String groupId) { - return getWithResponseAsync(resourceGroupName, resourceName, groupId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the specified private link resource - * - * Get the specified private link resource for the given IotHub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param groupId The name of the private link resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 private link resource - * - * Get the specified private link resource for the given IotHub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String resourceName, - String groupId, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, groupId, accept, context); - } - - /** - * Get the specified private link resource - * - * Get the specified private link resource for the given IotHub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param groupId The name of the private link resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 private link resource - * - * Get the specified private link resource for the given IotHub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupIdInformationInner get(String resourceGroupName, String resourceName, String groupId) { - return getWithResponse(resourceGroupName, resourceName, groupId, Context.NONE).getValue(); - } - - /** - * List private link resources - * - * List private link resources for the given IotHub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 private link resources for an IotHub along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String resourceGroupName, - String resourceName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, resourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List private link resources - * - * List private link resources for the given IotHub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 private link resources for an IotHub on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String resourceGroupName, String resourceName) { - return listWithResponseAsync(resourceGroupName, resourceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * List private link resources - * - * List private link resources for the given IotHub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 private link resources for an IotHub along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String resourceGroupName, String resourceName, - Context context) { - final String accept = "application/json"; - return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, resourceName, accept, context); - } - - /** - * List private link resources - * - * List private link resources for the given IotHub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException 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 private link resources for an IotHub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkResourcesInner list(String resourceGroupName, String resourceName) { - return listWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsImpl.java deleted file mode 100644 index 6779a6748a49..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.iothub.fluent.PrivateLinkResourcesOperationsClient; -import com.azure.resourcemanager.iothub.fluent.models.GroupIdInformationInner; -import com.azure.resourcemanager.iothub.fluent.models.PrivateLinkResourcesInner; -import com.azure.resourcemanager.iothub.models.GroupIdInformation; -import com.azure.resourcemanager.iothub.models.PrivateLinkResources; -import com.azure.resourcemanager.iothub.models.PrivateLinkResourcesOperations; - -public final class PrivateLinkResourcesOperationsImpl implements PrivateLinkResourcesOperations { - private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesOperationsImpl.class); - - private final PrivateLinkResourcesOperationsClient innerClient; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - public PrivateLinkResourcesOperationsImpl(PrivateLinkResourcesOperationsClient innerClient, - com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String resourceName, String groupId, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, resourceName, groupId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GroupIdInformationImpl(inner.getValue(), this.manager())); - } - - public GroupIdInformation get(String resourceGroupName, String resourceName, String groupId) { - GroupIdInformationInner inner = this.serviceClient().get(resourceGroupName, resourceName, groupId); - if (inner != null) { - return new GroupIdInformationImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listWithResponse(String resourceGroupName, String resourceName, - Context context) { - Response inner - = this.serviceClient().listWithResponse(resourceGroupName, resourceName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PrivateLinkResourcesImpl(inner.getValue(), this.manager())); - } - - public PrivateLinkResources list(String resourceGroupName, String resourceName) { - PrivateLinkResourcesInner inner = this.serviceClient().list(resourceGroupName, resourceName); - if (inner != null) { - return new PrivateLinkResourcesImpl(inner, this.manager()); - } else { - return null; - } - } - - private PrivateLinkResourcesOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/RegistryStatisticsImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/RegistryStatisticsImpl.java deleted file mode 100644 index 3c1e73baf5cc..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/RegistryStatisticsImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -import com.azure.resourcemanager.iothub.fluent.models.RegistryStatisticsInner; -import com.azure.resourcemanager.iothub.models.RegistryStatistics; - -public final class RegistryStatisticsImpl implements RegistryStatistics { - private RegistryStatisticsInner innerObject; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - RegistryStatisticsImpl(RegistryStatisticsInner innerObject, - com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public Long totalDeviceCount() { - return this.innerModel().totalDeviceCount(); - } - - public Long enabledDeviceCount() { - return this.innerModel().enabledDeviceCount(); - } - - public Long disabledDeviceCount() { - return this.innerModel().disabledDeviceCount(); - } - - public RegistryStatisticsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceManagerUtils.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceManagerUtils.java deleted file mode 100644 index 352c02510ed8..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceManagerUtils.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -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.util.CoreUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import reactor.core.publisher.Flux; - -final class ResourceManagerUtils { - private ResourceManagerUtils() { - } - - static String getValueFromIdByName(String id, String name) { - if (id == null) { - return null; - } - Iterator itr = Arrays.stream(id.split("/")).iterator(); - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && !part.trim().isEmpty()) { - if (part.equalsIgnoreCase(name)) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } - } - } - } - return null; - } - - static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { - if (id == null || pathTemplate == null) { - return null; - } - String parameterNameParentheses = "{" + parameterName + "}"; - List idSegmentsReverted = Arrays.asList(id.split("/")); - List pathSegments = Arrays.asList(pathTemplate.split("/")); - Collections.reverse(idSegmentsReverted); - Iterator idItrReverted = idSegmentsReverted.iterator(); - int pathIndex = pathSegments.size(); - while (idItrReverted.hasNext() && pathIndex > 0) { - String idSegment = idItrReverted.next(); - String pathSegment = pathSegments.get(--pathIndex); - if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { - if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { - if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { - List segments = new ArrayList<>(); - segments.add(idSegment); - idItrReverted.forEachRemaining(segments::add); - Collections.reverse(segments); - if (!segments.isEmpty() && segments.get(0).isEmpty()) { - segments.remove(0); - } - return String.join("/", segments); - } else { - return idSegment; - } - } - } - } - return null; - } - - static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl<>(pageIterable, mapper); - } - - private static final class PagedIterableImpl extends PagedIterable { - - private final PagedIterable pagedIterable; - private final Function mapper; - private final Function, PagedResponse> pageMapper; - - private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux - .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); - this.pagedIterable = pagedIterable; - this.mapper = mapper; - this.pageMapper = getPageMapper(mapper); - } - - private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), - null); - } - - @Override - public Stream stream() { - return pagedIterable.stream().map(mapper); - } - - @Override - public Stream> streamByPage() { - return pagedIterable.streamByPage().map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken) { - return pagedIterable.streamByPage(continuationToken).map(pageMapper); - } - - @Override - public Stream> streamByPage(int preferredPageSize) { - return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken, int preferredPageSize) { - return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); - } - - @Override - public Iterator iterator() { - return new IteratorImpl<>(pagedIterable.iterator(), mapper); - } - - @Override - public Iterable> iterableByPage() { - return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); - } - - @Override - public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); - } - } - - private static final class IteratorImpl implements Iterator { - - private final Iterator iterator; - private final Function mapper; - - private IteratorImpl(Iterator iterator, Function mapper) { - this.iterator = iterator; - this.mapper = mapper; - } - - @Override - public boolean hasNext() { - return iterator.hasNext(); - } - - @Override - public S next() { - return mapper.apply(iterator.next()); - } - - @Override - public void remove() { - iterator.remove(); - } - } - - private static final class IterableImpl implements Iterable { - - private final Iterable iterable; - private final Function mapper; - - private IterableImpl(Iterable iterable, Function mapper) { - this.iterable = iterable; - this.mapper = mapper; - } - - @Override - public Iterator iterator() { - return new IteratorImpl<>(iterable.iterator(), mapper); - } - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsClientImpl.java deleted file mode 100644 index bed1be45da46..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsClientImpl.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.iothub.fluent.ResourceProviderCommonsClient; -import com.azure.resourcemanager.iothub.fluent.models.UserSubscriptionQuotaListResultInner; -import com.azure.resourcemanager.iothub.models.ErrorDetailsException; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ResourceProviderCommonsClient. - */ -public final class ResourceProviderCommonsClientImpl implements ResourceProviderCommonsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ResourceProviderCommonsService service; - - /** - * The service client containing this operation class. - */ - private final IotHubClientImpl client; - - /** - * Initializes an instance of ResourceProviderCommonsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ResourceProviderCommonsClientImpl(IotHubClientImpl client) { - this.service = RestProxy.create(ResourceProviderCommonsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for IotHubClientResourceProviderCommons to be used by the proxy service - * to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "IotHubClientResourceProviderCommons") - public interface ResourceProviderCommonsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Devices/usages") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Mono> getSubscriptionQuota( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Devices/usages") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorDetailsException.class) - Response getSubscriptionQuotaSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get the number of iot hubs in the subscription - * - * Get the number of free and paid iot hubs in the subscription. - * - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the number of iot hubs in the subscription - * - * Get the number of free and paid iot hubs in the subscription along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSubscriptionQuotaWithResponseAsync() { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getSubscriptionQuota(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the number of iot hubs in the subscription - * - * Get the number of free and paid iot hubs in the subscription. - * - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the number of iot hubs in the subscription - * - * Get the number of free and paid iot hubs in the subscription on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getSubscriptionQuotaAsync() { - return getSubscriptionQuotaWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the number of iot hubs in the subscription - * - * Get the number of free and paid iot hubs in the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the number of iot hubs in the subscription - * - * Get the number of free and paid iot hubs in the subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSubscriptionQuotaWithResponse(Context context) { - final String accept = "application/json"; - return service.getSubscriptionQuotaSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); - } - - /** - * Get the number of iot hubs in the subscription - * - * Get the number of free and paid iot hubs in the subscription. - * - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the number of iot hubs in the subscription - * - * Get the number of free and paid iot hubs in the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserSubscriptionQuotaListResultInner getSubscriptionQuota() { - return getSubscriptionQuotaWithResponse(Context.NONE).getValue(); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsImpl.java deleted file mode 100644 index 4e2245fdd759..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.iothub.fluent.ResourceProviderCommonsClient; -import com.azure.resourcemanager.iothub.fluent.models.UserSubscriptionQuotaListResultInner; -import com.azure.resourcemanager.iothub.models.ResourceProviderCommons; -import com.azure.resourcemanager.iothub.models.UserSubscriptionQuotaListResult; - -public final class ResourceProviderCommonsImpl implements ResourceProviderCommons { - private static final ClientLogger LOGGER = new ClientLogger(ResourceProviderCommonsImpl.class); - - private final ResourceProviderCommonsClient innerClient; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - public ResourceProviderCommonsImpl(ResourceProviderCommonsClient innerClient, - com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getSubscriptionQuotaWithResponse(Context context) { - Response inner - = this.serviceClient().getSubscriptionQuotaWithResponse(context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new UserSubscriptionQuotaListResultImpl(inner.getValue(), this.manager())); - } - - public UserSubscriptionQuotaListResult getSubscriptionQuota() { - UserSubscriptionQuotaListResultInner inner = this.serviceClient().getSubscriptionQuota(); - if (inner != null) { - return new UserSubscriptionQuotaListResultImpl(inner, this.manager()); - } else { - return null; - } - } - - private ResourceProviderCommonsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/SharedAccessSignatureAuthorizationRuleImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/SharedAccessSignatureAuthorizationRuleImpl.java deleted file mode 100644 index 1ca68c315064..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/SharedAccessSignatureAuthorizationRuleImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -import com.azure.resourcemanager.iothub.fluent.models.SharedAccessSignatureAuthorizationRuleInner; -import com.azure.resourcemanager.iothub.models.AccessRights; -import com.azure.resourcemanager.iothub.models.SharedAccessSignatureAuthorizationRule; - -public final class SharedAccessSignatureAuthorizationRuleImpl implements SharedAccessSignatureAuthorizationRule { - private SharedAccessSignatureAuthorizationRuleInner innerObject; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - SharedAccessSignatureAuthorizationRuleImpl(SharedAccessSignatureAuthorizationRuleInner innerObject, - com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String keyName() { - return this.innerModel().keyName(); - } - - public String primaryKey() { - return this.innerModel().primaryKey(); - } - - public String secondaryKey() { - return this.innerModel().secondaryKey(); - } - - public AccessRights rights() { - return this.innerModel().rights(); - } - - public SharedAccessSignatureAuthorizationRuleInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/TestAllRoutesResultImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/TestAllRoutesResultImpl.java deleted file mode 100644 index 447832e86748..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/TestAllRoutesResultImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -import com.azure.resourcemanager.iothub.fluent.models.TestAllRoutesResultInner; -import com.azure.resourcemanager.iothub.models.MatchedRoute; -import com.azure.resourcemanager.iothub.models.TestAllRoutesResult; -import java.util.Collections; -import java.util.List; - -public final class TestAllRoutesResultImpl implements TestAllRoutesResult { - private TestAllRoutesResultInner innerObject; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - TestAllRoutesResultImpl(TestAllRoutesResultInner innerObject, - com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List routes() { - List inner = this.innerModel().routes(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public TestAllRoutesResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/TestRouteResultImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/TestRouteResultImpl.java deleted file mode 100644 index c404c010186a..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/TestRouteResultImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -import com.azure.resourcemanager.iothub.fluent.models.TestRouteResultInner; -import com.azure.resourcemanager.iothub.models.TestResultStatus; -import com.azure.resourcemanager.iothub.models.TestRouteResult; -import com.azure.resourcemanager.iothub.models.TestRouteResultDetails; - -public final class TestRouteResultImpl implements TestRouteResult { - private TestRouteResultInner innerObject; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - TestRouteResultImpl(TestRouteResultInner innerObject, - com.azure.resourcemanager.iothub.IotHubManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public TestResultStatus result() { - return this.innerModel().result(); - } - - public TestRouteResultDetails details() { - return this.innerModel().details(); - } - - public TestRouteResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/UserSubscriptionQuotaListResultImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/UserSubscriptionQuotaListResultImpl.java deleted file mode 100644 index 1cdc91910722..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/UserSubscriptionQuotaListResultImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation; - -import com.azure.resourcemanager.iothub.fluent.models.UserSubscriptionQuotaListResultInner; -import com.azure.resourcemanager.iothub.models.UserSubscriptionQuota; -import com.azure.resourcemanager.iothub.models.UserSubscriptionQuotaListResult; -import java.util.Collections; -import java.util.List; - -public final class UserSubscriptionQuotaListResultImpl implements UserSubscriptionQuotaListResult { - private UserSubscriptionQuotaListResultInner innerObject; - - private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - - UserSubscriptionQuotaListResultImpl(UserSubscriptionQuotaListResultInner innerObject, - com.azure.resourcemanager.iothub.IotHubManager 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 nextLink() { - return this.innerModel().nextLink(); - } - - public UserSubscriptionQuotaListResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.iothub.IotHubManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/EndpointHealthDataListResult.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/EndpointHealthDataListResult.java deleted file mode 100644 index 9b73ac2cf3ef..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/EndpointHealthDataListResult.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.iothub.fluent.models.EndpointHealthDataInner; -import java.io.IOException; -import java.util.List; - -/** - * The JSON-serialized array of EndpointHealthData objects with a next link. - */ -@Immutable -public final class EndpointHealthDataListResult implements JsonSerializable { - /* - * The EndpointHealthData items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of EndpointHealthDataListResult class. - */ - private EndpointHealthDataListResult() { - } - - /** - * Get the value property: The EndpointHealthData items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EndpointHealthDataListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EndpointHealthDataListResult 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 EndpointHealthDataListResult. - */ - public static EndpointHealthDataListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EndpointHealthDataListResult deserializedEndpointHealthDataListResult = new EndpointHealthDataListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> EndpointHealthDataInner.fromJson(reader1)); - deserializedEndpointHealthDataListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedEndpointHealthDataListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedEndpointHealthDataListResult; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/EventHubConsumerGroupsListResult.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/EventHubConsumerGroupsListResult.java deleted file mode 100644 index c58253590515..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/EventHubConsumerGroupsListResult.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.iothub.fluent.models.EventHubConsumerGroupInfoInner; -import java.io.IOException; -import java.util.List; - -/** - * The JSON-serialized list of consumer groups for the Event Hub-compatible endpoint. - */ -@Immutable -public final class EventHubConsumerGroupsListResult implements JsonSerializable { - /* - * The EventHubConsumerGroupInfo items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of EventHubConsumerGroupsListResult class. - */ - private EventHubConsumerGroupsListResult() { - } - - /** - * Get the value property: The EventHubConsumerGroupInfo items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EventHubConsumerGroupsListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EventHubConsumerGroupsListResult 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 EventHubConsumerGroupsListResult. - */ - public static EventHubConsumerGroupsListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EventHubConsumerGroupsListResult deserializedEventHubConsumerGroupsListResult - = new EventHubConsumerGroupsListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> EventHubConsumerGroupInfoInner.fromJson(reader1)); - deserializedEventHubConsumerGroupsListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedEventHubConsumerGroupsListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedEventHubConsumerGroupsListResult; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/IotHubDescriptionListResult.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/IotHubDescriptionListResult.java deleted file mode 100644 index 8e5d14630d8d..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/IotHubDescriptionListResult.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.iothub.fluent.models.IotHubDescriptionInner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a IotHubDescription list operation. - */ -@Immutable -public final class IotHubDescriptionListResult implements JsonSerializable { - /* - * The IotHubDescription items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of IotHubDescriptionListResult class. - */ - private IotHubDescriptionListResult() { - } - - /** - * Get the value property: The IotHubDescription items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IotHubDescriptionListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IotHubDescriptionListResult 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 IotHubDescriptionListResult. - */ - public static IotHubDescriptionListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IotHubDescriptionListResult deserializedIotHubDescriptionListResult = new IotHubDescriptionListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> IotHubDescriptionInner.fromJson(reader1)); - deserializedIotHubDescriptionListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedIotHubDescriptionListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedIotHubDescriptionListResult; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/IotHubQuotaMetricInfoListResult.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/IotHubQuotaMetricInfoListResult.java deleted file mode 100644 index 7ed46f19468d..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/IotHubQuotaMetricInfoListResult.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.iothub.fluent.models.IotHubQuotaMetricInfoInner; -import java.io.IOException; -import java.util.List; - -/** - * The JSON-serialized array of IotHubQuotaMetricInfo objects with a next link. - */ -@Immutable -public final class IotHubQuotaMetricInfoListResult implements JsonSerializable { - /* - * The IotHubQuotaMetricInfo items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of IotHubQuotaMetricInfoListResult class. - */ - private IotHubQuotaMetricInfoListResult() { - } - - /** - * Get the value property: The IotHubQuotaMetricInfo items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IotHubQuotaMetricInfoListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IotHubQuotaMetricInfoListResult 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 IotHubQuotaMetricInfoListResult. - */ - public static IotHubQuotaMetricInfoListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IotHubQuotaMetricInfoListResult deserializedIotHubQuotaMetricInfoListResult - = new IotHubQuotaMetricInfoListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> IotHubQuotaMetricInfoInner.fromJson(reader1)); - deserializedIotHubQuotaMetricInfoListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedIotHubQuotaMetricInfoListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedIotHubQuotaMetricInfoListResult; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/IotHubSkuDescriptionListResult.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/IotHubSkuDescriptionListResult.java deleted file mode 100644 index 581960ce3e8b..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/IotHubSkuDescriptionListResult.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.iothub.fluent.models.IotHubSkuDescriptionInner; -import java.io.IOException; -import java.util.List; - -/** - * The JSON-serialized array of IotHubSkuDescription objects with a next link. - */ -@Immutable -public final class IotHubSkuDescriptionListResult implements JsonSerializable { - /* - * The IotHubSkuDescription items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of IotHubSkuDescriptionListResult class. - */ - private IotHubSkuDescriptionListResult() { - } - - /** - * Get the value property: The IotHubSkuDescription items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IotHubSkuDescriptionListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IotHubSkuDescriptionListResult 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 IotHubSkuDescriptionListResult. - */ - public static IotHubSkuDescriptionListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IotHubSkuDescriptionListResult deserializedIotHubSkuDescriptionListResult - = new IotHubSkuDescriptionListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> IotHubSkuDescriptionInner.fromJson(reader1)); - deserializedIotHubSkuDescriptionListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedIotHubSkuDescriptionListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedIotHubSkuDescriptionListResult; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/JobResponseListResult.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/JobResponseListResult.java deleted file mode 100644 index 1cc6e2cccf66..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/JobResponseListResult.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.iothub.fluent.models.JobResponseInner; -import java.io.IOException; -import java.util.List; - -/** - * The JSON-serialized array of JobResponse objects with a next link. - */ -@Immutable -public final class JobResponseListResult implements JsonSerializable { - /* - * The JobResponse items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of JobResponseListResult class. - */ - private JobResponseListResult() { - } - - /** - * Get the value property: The JobResponse items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of JobResponseListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of JobResponseListResult 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 JobResponseListResult. - */ - public static JobResponseListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - JobResponseListResult deserializedJobResponseListResult = new JobResponseListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> JobResponseInner.fromJson(reader1)); - deserializedJobResponseListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedJobResponseListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedJobResponseListResult; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/OperationListResult.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/OperationListResult.java deleted file mode 100644 index 37685865130b..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/OperationListResult.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.iothub.fluent.models.OperationInner; -import java.io.IOException; -import java.util.List; - -/** - * Result of the request to list IoT Hub operations. It contains a list of operations and a URL link to get the next set - * of results. - */ -@Immutable -public final class OperationListResult implements JsonSerializable { - /* - * List of IoT Hub operations supported by the Microsoft.Devices resource provider. - */ - 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. - */ - private OperationListResult() { - } - - /** - * Get the value property: List of IoT Hub operations supported by the Microsoft.Devices resource provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * 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; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationListResult from the JsonReader. - * - * @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. - */ - 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/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/SharedAccessSignatureAuthorizationRuleListResult.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/SharedAccessSignatureAuthorizationRuleListResult.java deleted file mode 100644 index a89e40bf7f73..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/models/SharedAccessSignatureAuthorizationRuleListResult.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.iothub.fluent.models.SharedAccessSignatureAuthorizationRuleInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of shared access policies with a next link. - */ -@Immutable -public final class SharedAccessSignatureAuthorizationRuleListResult - implements JsonSerializable { - /* - * The SharedAccessSignatureAuthorizationRule items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of SharedAccessSignatureAuthorizationRuleListResult class. - */ - private SharedAccessSignatureAuthorizationRuleListResult() { - } - - /** - * Get the value property: The SharedAccessSignatureAuthorizationRule items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SharedAccessSignatureAuthorizationRuleListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SharedAccessSignatureAuthorizationRuleListResult 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 SharedAccessSignatureAuthorizationRuleListResult. - */ - public static SharedAccessSignatureAuthorizationRuleListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SharedAccessSignatureAuthorizationRuleListResult deserializedSharedAccessSignatureAuthorizationRuleListResult - = new SharedAccessSignatureAuthorizationRuleListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SharedAccessSignatureAuthorizationRuleInner.fromJson(reader1)); - deserializedSharedAccessSignatureAuthorizationRuleListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSharedAccessSignatureAuthorizationRuleListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSharedAccessSignatureAuthorizationRuleListResult; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/package-info.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/package-info.java deleted file mode 100644 index 5f08144e24d3..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// 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 IotHub. - * Use this API to manage the IoT hubs in your Azure subscription. - */ -package com.azure.resourcemanager.iothub.implementation; diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/AccessRights.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/AccessRights.java deleted file mode 100644 index ffb1527c07af..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/AccessRights.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -/** - * The permissions assigned to the shared access policy. - */ -public enum AccessRights { - /** - * RegistryRead. - */ - REGISTRY_READ("RegistryRead"), - - /** - * RegistryWrite. - */ - REGISTRY_WRITE("RegistryWrite"), - - /** - * ServiceConnect. - */ - SERVICE_CONNECT("ServiceConnect"), - - /** - * DeviceConnect. - */ - DEVICE_CONNECT("DeviceConnect"), - - /** - * RegistryRead, RegistryWrite. - */ - REGISTRY_READ_REGISTRY_WRITE("RegistryRead, RegistryWrite"), - - /** - * RegistryRead, ServiceConnect. - */ - REGISTRY_READ_SERVICE_CONNECT("RegistryRead, ServiceConnect"), - - /** - * RegistryRead, DeviceConnect. - */ - REGISTRY_READ_DEVICE_CONNECT("RegistryRead, DeviceConnect"), - - /** - * RegistryWrite, ServiceConnect. - */ - REGISTRY_WRITE_SERVICE_CONNECT("RegistryWrite, ServiceConnect"), - - /** - * RegistryWrite, DeviceConnect. - */ - REGISTRY_WRITE_DEVICE_CONNECT("RegistryWrite, DeviceConnect"), - - /** - * ServiceConnect, DeviceConnect. - */ - SERVICE_CONNECT_DEVICE_CONNECT("ServiceConnect, DeviceConnect"), - - /** - * RegistryRead, RegistryWrite, ServiceConnect. - */ - REGISTRY_READ_REGISTRY_WRITE_SERVICE_CONNECT("RegistryRead, RegistryWrite, ServiceConnect"), - - /** - * RegistryRead, RegistryWrite, DeviceConnect. - */ - REGISTRY_READ_REGISTRY_WRITE_DEVICE_CONNECT("RegistryRead, RegistryWrite, DeviceConnect"), - - /** - * RegistryRead, ServiceConnect, DeviceConnect. - */ - REGISTRY_READ_SERVICE_CONNECT_DEVICE_CONNECT("RegistryRead, ServiceConnect, DeviceConnect"), - - /** - * RegistryWrite, ServiceConnect, DeviceConnect. - */ - REGISTRY_WRITE_SERVICE_CONNECT_DEVICE_CONNECT("RegistryWrite, ServiceConnect, DeviceConnect"), - - /** - * RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect. - */ - REGISTRY_READ_REGISTRY_WRITE_SERVICE_CONNECT_DEVICE_CONNECT( - "RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect"); - - /** - * The actual serialized value for a AccessRights instance. - */ - private final String value; - - AccessRights(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a AccessRights instance. - * - * @param value the serialized value to parse. - * @return the parsed AccessRights object, or null if unable to parse. - */ - public static AccessRights fromString(String value) { - if (value == null) { - return null; - } - AccessRights[] items = AccessRights.values(); - for (AccessRights item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ArmIdentity.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ArmIdentity.java deleted file mode 100644 index 6efec3fba176..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ArmIdentity.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * The ArmIdentity model. - */ -@Fluent -public final class ArmIdentity implements JsonSerializable { - /* - * Principal Id - */ - private String principalId; - - /* - * Tenant Id - */ - private String tenantId; - - /* - * The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly - * created identity and a set of user assigned identities. The type 'None' will remove any identities from the - * service. - */ - private ResourceIdentityType type; - - /* - * Dictionary of - */ - private Map userAssignedIdentities; - - /** - * Creates an instance of ArmIdentity class. - */ - public ArmIdentity() { - } - - /** - * Get the principalId property: Principal Id. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the tenantId property: Tenant Id. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the type property: The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' - * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove - * any identities from the service. - * - * @return the type value. - */ - public ResourceIdentityType type() { - return this.type; - } - - /** - * Set the type property: The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' - * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove - * any identities from the service. - * - * @param type the type value to set. - * @return the ArmIdentity object itself. - */ - public ArmIdentity withType(ResourceIdentityType type) { - this.type = type; - return this; - } - - /** - * Get the userAssignedIdentities property: Dictionary of <ArmUserIdentity>. - * - * @return the userAssignedIdentities value. - */ - public Map userAssignedIdentities() { - return this.userAssignedIdentities; - } - - /** - * Set the userAssignedIdentities property: Dictionary of <ArmUserIdentity>. - * - * @param userAssignedIdentities the userAssignedIdentities value to set. - * @return the ArmIdentity object itself. - */ - public ArmIdentity withUserAssignedIdentities(Map userAssignedIdentities) { - this.userAssignedIdentities = userAssignedIdentities; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ArmIdentity from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ArmIdentity 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 ArmIdentity. - */ - public static ArmIdentity fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ArmIdentity deserializedArmIdentity = new ArmIdentity(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("principalId".equals(fieldName)) { - deserializedArmIdentity.principalId = reader.getString(); - } else if ("tenantId".equals(fieldName)) { - deserializedArmIdentity.tenantId = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedArmIdentity.type = ResourceIdentityType.fromString(reader.getString()); - } else if ("userAssignedIdentities".equals(fieldName)) { - Map userAssignedIdentities - = reader.readMap(reader1 -> ArmUserIdentity.fromJson(reader1)); - deserializedArmIdentity.userAssignedIdentities = userAssignedIdentities; - } else { - reader.skipChildren(); - } - } - - return deserializedArmIdentity; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ArmUserIdentity.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ArmUserIdentity.java deleted file mode 100644 index 6f2c08cca453..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ArmUserIdentity.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ArmUserIdentity model. - */ -@Immutable -public final class ArmUserIdentity implements JsonSerializable { - /* - * The principalId property. - */ - private String principalId; - - /* - * The clientId property. - */ - private String clientId; - - /** - * Creates an instance of ArmUserIdentity class. - */ - public ArmUserIdentity() { - } - - /** - * Get the principalId property: The principalId property. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the clientId property: The clientId property. - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ArmUserIdentity from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ArmUserIdentity 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 ArmUserIdentity. - */ - public static ArmUserIdentity fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ArmUserIdentity deserializedArmUserIdentity = new ArmUserIdentity(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("principalId".equals(fieldName)) { - deserializedArmUserIdentity.principalId = reader.getString(); - } else if ("clientId".equals(fieldName)) { - deserializedArmUserIdentity.clientId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedArmUserIdentity; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/AuthenticationType.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/AuthenticationType.java deleted file mode 100644 index 1b08c5c3b4d8..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/AuthenticationType.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Specifies authentication type being used for connecting to the storage account. - */ -public final class AuthenticationType extends ExpandableStringEnum { - /** - * keyBased. - */ - public static final AuthenticationType KEY_BASED = fromString("keyBased"); - - /** - * identityBased. - */ - public static final AuthenticationType IDENTITY_BASED = fromString("identityBased"); - - /** - * Creates a new instance of AuthenticationType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AuthenticationType() { - } - - /** - * Creates or finds a AuthenticationType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AuthenticationType. - */ - public static AuthenticationType fromString(String name) { - return fromString(name, AuthenticationType.class); - } - - /** - * Gets known AuthenticationType values. - * - * @return known AuthenticationType values. - */ - public static Collection values() { - return values(AuthenticationType.class); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Capabilities.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Capabilities.java deleted file mode 100644 index 0971d4b2d1db..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Capabilities.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The capabilities and features enabled for the IoT hub. - */ -public final class Capabilities extends ExpandableStringEnum { - /** - * None. - */ - public static final Capabilities NONE = fromString("None"); - - /** - * DeviceManagement. - */ - public static final Capabilities DEVICE_MANAGEMENT = fromString("DeviceManagement"); - - /** - * Creates a new instance of Capabilities value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Capabilities() { - } - - /** - * Creates or finds a Capabilities from its string representation. - * - * @param name a name to look for. - * @return the corresponding Capabilities. - */ - public static Capabilities fromString(String name) { - return fromString(name, Capabilities.class); - } - - /** - * Gets known Capabilities values. - * - * @return known Capabilities values. - */ - public static Collection values() { - return values(Capabilities.class); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateDescription.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateDescription.java deleted file mode 100644 index 9e9b9372cbc4..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateDescription.java +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.iothub.fluent.models.CertificateDescriptionInner; - -/** - * An immutable client-side representation of CertificateDescription. - */ -public interface CertificateDescription { - /** - * 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: The description of an X509 CA Certificate. - * - * @return the properties value. - */ - CertificateProperties properties(); - - /** - * Gets the etag property: The entity tag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.iothub.fluent.models.CertificateDescriptionInner object. - * - * @return the inner object. - */ - CertificateDescriptionInner innerModel(); - - /** - * The entirety of the CertificateDescription definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The CertificateDescription definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the CertificateDescription definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the CertificateDescription definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, resourceName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @return the next definition stage. - */ - WithCreate withExistingIotHub(String resourceGroupName, String resourceName); - } - - /** - * The stage of the CertificateDescription definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithProperties, DefinitionStages.WithIfMatch { - /** - * Executes the create request. - * - * @return the created resource. - */ - CertificateDescription create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - CertificateDescription create(Context context); - } - - /** - * The stage of the CertificateDescription definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: The description of an X509 CA Certificate.. - * - * @param properties The description of an X509 CA Certificate. - * @return the next definition stage. - */ - WithCreate withProperties(CertificateProperties properties); - } - - /** - * The stage of the CertificateDescription definition allowing to specify ifMatch. - */ - interface WithIfMatch { - /** - * Specifies the ifMatch property: ETag of the Certificate. Do not specify for creating a brand new - * certificate. Required to update an existing certificate.. - * - * @param ifMatch ETag of the Certificate. Do not specify for creating a brand new certificate. Required to - * update an existing certificate. - * @return the next definition stage. - */ - WithCreate withIfMatch(String ifMatch); - } - } - - /** - * Begins update for the CertificateDescription resource. - * - * @return the stage of resource update. - */ - CertificateDescription.Update update(); - - /** - * The template for CertificateDescription update. - */ - interface Update extends UpdateStages.WithProperties, UpdateStages.WithIfMatch { - /** - * Executes the update request. - * - * @return the updated resource. - */ - CertificateDescription apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - CertificateDescription apply(Context context); - } - - /** - * The CertificateDescription update stages. - */ - interface UpdateStages { - /** - * The stage of the CertificateDescription update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: The description of an X509 CA Certificate.. - * - * @param properties The description of an X509 CA Certificate. - * @return the next definition stage. - */ - Update withProperties(CertificateProperties properties); - } - - /** - * The stage of the CertificateDescription update allowing to specify ifMatch. - */ - interface WithIfMatch { - /** - * Specifies the ifMatch property: ETag of the Certificate. Do not specify for creating a brand new - * certificate. Required to update an existing certificate.. - * - * @param ifMatch ETag of the Certificate. Do not specify for creating a brand new certificate. Required to - * update an existing certificate. - * @return the next definition stage. - */ - Update withIfMatch(String ifMatch); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - CertificateDescription refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - CertificateDescription refresh(Context context); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateListDescription.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateListDescription.java deleted file mode 100644 index e4ffcc15f8c6..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateListDescription.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.resourcemanager.iothub.fluent.models.CertificateListDescriptionInner; -import java.util.List; - -/** - * An immutable client-side representation of CertificateListDescription. - */ -public interface CertificateListDescription { - /** - * Gets the value property: The array of Certificate objects. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.iothub.fluent.models.CertificateListDescriptionInner object. - * - * @return the inner object. - */ - CertificateListDescriptionInner innerModel(); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateProperties.java deleted file mode 100644 index b7249f061a36..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateProperties.java +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.DateTimeRfc1123; -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 description of an X509 CA Certificate. - */ -@Fluent -public final class CertificateProperties implements JsonSerializable { - /* - * The certificate's subject name. - */ - private String subject; - - /* - * The certificate's expiration date and time. - */ - private DateTimeRfc1123 expiry; - - /* - * The certificate's thumbprint. - */ - private String thumbprint; - - /* - * Determines whether certificate has been verified. - */ - private Boolean isVerified; - - /* - * The certificate's create date and time. - */ - private DateTimeRfc1123 created; - - /* - * The certificate's last update date and time. - */ - private DateTimeRfc1123 updated; - - /* - * The certificate content - */ - private String certificate; - - /* - * The reference to policy stored in Azure Device Registry (ADR). - */ - private String policyResourceId; - - /** - * Creates an instance of CertificateProperties class. - */ - public CertificateProperties() { - } - - /** - * Get the subject property: The certificate's subject name. - * - * @return the subject value. - */ - public String subject() { - return this.subject; - } - - /** - * Get the expiry property: The certificate's expiration date and time. - * - * @return the expiry value. - */ - public OffsetDateTime expiry() { - if (this.expiry == null) { - return null; - } - return this.expiry.getDateTime(); - } - - /** - * Get the thumbprint property: The certificate's thumbprint. - * - * @return the thumbprint value. - */ - public String thumbprint() { - return this.thumbprint; - } - - /** - * Get the isVerified property: Determines whether certificate has been verified. - * - * @return the isVerified value. - */ - public Boolean isVerified() { - return this.isVerified; - } - - /** - * Set the isVerified property: Determines whether certificate has been verified. - * - * @param isVerified the isVerified value to set. - * @return the CertificateProperties object itself. - */ - public CertificateProperties withIsVerified(Boolean isVerified) { - this.isVerified = isVerified; - return this; - } - - /** - * Get the created property: The certificate's create date and time. - * - * @return the created value. - */ - public OffsetDateTime created() { - if (this.created == null) { - return null; - } - return this.created.getDateTime(); - } - - /** - * Get the updated property: The certificate's last update date and time. - * - * @return the updated value. - */ - public OffsetDateTime updated() { - if (this.updated == null) { - return null; - } - return this.updated.getDateTime(); - } - - /** - * Get the certificate property: The certificate content. - * - * @return the certificate value. - */ - public String certificate() { - return this.certificate; - } - - /** - * Set the certificate property: The certificate content. - * - * @param certificate the certificate value to set. - * @return the CertificateProperties object itself. - */ - public CertificateProperties withCertificate(String certificate) { - this.certificate = certificate; - return this; - } - - /** - * Get the policyResourceId property: The reference to policy stored in Azure Device Registry (ADR). - * - * @return the policyResourceId value. - */ - public String policyResourceId() { - return this.policyResourceId; - } - - /** - * Set the policyResourceId property: The reference to policy stored in Azure Device Registry (ADR). - * - * @param policyResourceId the policyResourceId value to set. - * @return the CertificateProperties object itself. - */ - public CertificateProperties withPolicyResourceId(String policyResourceId) { - this.policyResourceId = policyResourceId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("isVerified", this.isVerified); - jsonWriter.writeStringField("certificate", this.certificate); - jsonWriter.writeStringField("policyResourceId", this.policyResourceId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CertificateProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CertificateProperties 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 CertificateProperties. - */ - public static CertificateProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CertificateProperties deserializedCertificateProperties = new CertificateProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("subject".equals(fieldName)) { - deserializedCertificateProperties.subject = reader.getString(); - } else if ("expiry".equals(fieldName)) { - deserializedCertificateProperties.expiry - = reader.getNullable(nonNullReader -> new DateTimeRfc1123(nonNullReader.getString())); - } else if ("thumbprint".equals(fieldName)) { - deserializedCertificateProperties.thumbprint = reader.getString(); - } else if ("isVerified".equals(fieldName)) { - deserializedCertificateProperties.isVerified = reader.getNullable(JsonReader::getBoolean); - } else if ("created".equals(fieldName)) { - deserializedCertificateProperties.created - = reader.getNullable(nonNullReader -> new DateTimeRfc1123(nonNullReader.getString())); - } else if ("updated".equals(fieldName)) { - deserializedCertificateProperties.updated - = reader.getNullable(nonNullReader -> new DateTimeRfc1123(nonNullReader.getString())); - } else if ("certificate".equals(fieldName)) { - deserializedCertificateProperties.certificate = reader.getString(); - } else if ("policyResourceId".equals(fieldName)) { - deserializedCertificateProperties.policyResourceId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCertificateProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificatePropertiesWithNonce.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificatePropertiesWithNonce.java deleted file mode 100644 index 27994881a0bd..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificatePropertiesWithNonce.java +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.DateTimeRfc1123; -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 description of an X509 CA Certificate including the challenge nonce issued for the Proof-Of-Possession flow. - */ -@Immutable -public final class CertificatePropertiesWithNonce implements JsonSerializable { - /* - * The certificate's subject name. - */ - private String subject; - - /* - * The certificate's expiration date and time. - */ - private DateTimeRfc1123 expiry; - - /* - * The certificate's thumbprint. - */ - private String thumbprint; - - /* - * Determines whether certificate has been verified. - */ - private Boolean isVerified; - - /* - * The certificate's create date and time. - */ - private DateTimeRfc1123 created; - - /* - * The certificate's last update date and time. - */ - private DateTimeRfc1123 updated; - - /* - * The certificate's verification code that will be used for proof of possession. - */ - private String verificationCode; - - /* - * The certificate content - */ - private String certificate; - - /* - * The reference to policy stored in Azure Device Registry (ADR). - */ - private String policyResourceId; - - /** - * Creates an instance of CertificatePropertiesWithNonce class. - */ - private CertificatePropertiesWithNonce() { - } - - /** - * Get the subject property: The certificate's subject name. - * - * @return the subject value. - */ - public String subject() { - return this.subject; - } - - /** - * Get the expiry property: The certificate's expiration date and time. - * - * @return the expiry value. - */ - public OffsetDateTime expiry() { - if (this.expiry == null) { - return null; - } - return this.expiry.getDateTime(); - } - - /** - * Get the thumbprint property: The certificate's thumbprint. - * - * @return the thumbprint value. - */ - public String thumbprint() { - return this.thumbprint; - } - - /** - * Get the isVerified property: Determines whether certificate has been verified. - * - * @return the isVerified value. - */ - public Boolean isVerified() { - return this.isVerified; - } - - /** - * Get the created property: The certificate's create date and time. - * - * @return the created value. - */ - public OffsetDateTime created() { - if (this.created == null) { - return null; - } - return this.created.getDateTime(); - } - - /** - * Get the updated property: The certificate's last update date and time. - * - * @return the updated value. - */ - public OffsetDateTime updated() { - if (this.updated == null) { - return null; - } - return this.updated.getDateTime(); - } - - /** - * Get the verificationCode property: The certificate's verification code that will be used for proof of possession. - * - * @return the verificationCode value. - */ - public String verificationCode() { - return this.verificationCode; - } - - /** - * Get the certificate property: The certificate content. - * - * @return the certificate value. - */ - public String certificate() { - return this.certificate; - } - - /** - * Get the policyResourceId property: The reference to policy stored in Azure Device Registry (ADR). - * - * @return the policyResourceId value. - */ - public String policyResourceId() { - return this.policyResourceId; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("policyResourceId", this.policyResourceId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CertificatePropertiesWithNonce from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CertificatePropertiesWithNonce 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 CertificatePropertiesWithNonce. - */ - public static CertificatePropertiesWithNonce fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CertificatePropertiesWithNonce deserializedCertificatePropertiesWithNonce - = new CertificatePropertiesWithNonce(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("subject".equals(fieldName)) { - deserializedCertificatePropertiesWithNonce.subject = reader.getString(); - } else if ("expiry".equals(fieldName)) { - deserializedCertificatePropertiesWithNonce.expiry - = reader.getNullable(nonNullReader -> new DateTimeRfc1123(nonNullReader.getString())); - } else if ("thumbprint".equals(fieldName)) { - deserializedCertificatePropertiesWithNonce.thumbprint = reader.getString(); - } else if ("isVerified".equals(fieldName)) { - deserializedCertificatePropertiesWithNonce.isVerified = reader.getNullable(JsonReader::getBoolean); - } else if ("created".equals(fieldName)) { - deserializedCertificatePropertiesWithNonce.created - = reader.getNullable(nonNullReader -> new DateTimeRfc1123(nonNullReader.getString())); - } else if ("updated".equals(fieldName)) { - deserializedCertificatePropertiesWithNonce.updated - = reader.getNullable(nonNullReader -> new DateTimeRfc1123(nonNullReader.getString())); - } else if ("verificationCode".equals(fieldName)) { - deserializedCertificatePropertiesWithNonce.verificationCode = reader.getString(); - } else if ("certificate".equals(fieldName)) { - deserializedCertificatePropertiesWithNonce.certificate = reader.getString(); - } else if ("policyResourceId".equals(fieldName)) { - deserializedCertificatePropertiesWithNonce.policyResourceId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCertificatePropertiesWithNonce; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateVerificationDescription.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateVerificationDescription.java deleted file mode 100644 index f7d4aab37230..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateVerificationDescription.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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 JSON-serialized leaf certificate. - */ -@Fluent -public final class CertificateVerificationDescription implements JsonSerializable { - /* - * base-64 representation of X509 certificate .cer file or just .pem file content. - */ - private String certificate; - - /** - * Creates an instance of CertificateVerificationDescription class. - */ - public CertificateVerificationDescription() { - } - - /** - * Get the certificate property: base-64 representation of X509 certificate .cer file or just .pem file content. - * - * @return the certificate value. - */ - public String certificate() { - return this.certificate; - } - - /** - * Set the certificate property: base-64 representation of X509 certificate .cer file or just .pem file content. - * - * @param certificate the certificate value to set. - * @return the CertificateVerificationDescription object itself. - */ - public CertificateVerificationDescription withCertificate(String certificate) { - this.certificate = certificate; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("certificate", this.certificate); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CertificateVerificationDescription from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CertificateVerificationDescription 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 CertificateVerificationDescription. - */ - public static CertificateVerificationDescription fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CertificateVerificationDescription deserializedCertificateVerificationDescription - = new CertificateVerificationDescription(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("certificate".equals(fieldName)) { - deserializedCertificateVerificationDescription.certificate = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCertificateVerificationDescription; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateWithNonceDescription.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateWithNonceDescription.java deleted file mode 100644 index 9eff5b5ef1c4..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateWithNonceDescription.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.resourcemanager.iothub.fluent.models.CertificateWithNonceDescriptionInner; - -/** - * An immutable client-side representation of CertificateWithNonceDescription. - */ -public interface CertificateWithNonceDescription { - /** - * Gets the properties property: The description of an X509 CA Certificate including the challenge nonce issued for - * the Proof-Of-Possession flow. - * - * @return the properties value. - */ - CertificatePropertiesWithNonce properties(); - - /** - * Gets the id property: The resource identifier. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the certificate. - * - * @return the name value. - */ - String name(); - - /** - * Gets the etag property: The entity tag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the type property: The resource type. - * - * @return the type value. - */ - String type(); - - /** - * Gets the inner com.azure.resourcemanager.iothub.fluent.models.CertificateWithNonceDescriptionInner object. - * - * @return the inner object. - */ - CertificateWithNonceDescriptionInner innerModel(); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Certificates.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Certificates.java deleted file mode 100644 index 864252511f2a..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Certificates.java +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of Certificates. - */ -public interface Certificates { - /** - * Get the certificate. - * - * Returns the certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate. - * - * Returns the certificate along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String resourceName, - String certificateName, Context context); - - /** - * Get the certificate. - * - * Returns the certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate. - * - * Returns the certificate. - */ - CertificateDescription get(String resourceGroupName, String resourceName, String certificateName); - - /** - * Delete an X509 certificate. - * - * Deletes an existing X509 certificate or does nothing if it does not exist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String resourceGroupName, String resourceName, String certificateName, - String ifMatch, Context context); - - /** - * Delete an X509 certificate. - * - * Deletes an existing X509 certificate or does nothing if it does not exist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 resourceName, String certificateName, String ifMatch); - - /** - * Get the certificate list. - * - * Returns the list of certificates. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate list. - * - * Returns the list of certificates along with {@link Response}. - */ - Response listByIotHubWithResponse(String resourceGroupName, String resourceName, - Context context); - - /** - * Get the certificate list. - * - * Returns the list of certificates. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate list. - * - * Returns the list of certificates. - */ - CertificateListDescription listByIotHub(String resourceGroupName, String resourceName); - - /** - * Generate verification code for proof of possession flow. - * - * Generates verification code for proof of possession flow. The verification code will be used to generate a leaf - * certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response}. - */ - Response generateVerificationCodeWithResponse(String resourceGroupName, - String resourceName, String certificateName, String ifMatch, Context context); - - /** - * Generate verification code for proof of possession flow. - * - * Generates verification code for proof of possession flow. The verification code will be used to generate a leaf - * certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. - */ - CertificateWithNonceDescription generateVerificationCode(String resourceGroupName, String resourceName, - String certificateName, String ifMatch); - - /** - * Verify certificate's private key possession. - * - * Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded - * certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @param certificateVerificationBody The name of the certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response}. - */ - Response verifyWithResponse(String resourceGroupName, String resourceName, - String certificateName, String ifMatch, CertificateVerificationDescription certificateVerificationBody, - Context context); - - /** - * Verify certificate's private key possession. - * - * Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded - * certificate. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param ifMatch ETag of the Certificate. - * @param certificateVerificationBody The name of the certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. - */ - CertificateDescription verify(String resourceGroupName, String resourceName, String certificateName, String ifMatch, - CertificateVerificationDescription certificateVerificationBody); - - /** - * Get the certificate. - * - * Returns the certificate. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate. - * - * Returns the certificate along with {@link Response}. - */ - CertificateDescription getById(String id); - - /** - * Get the certificate. - * - * Returns the certificate. - * - * @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.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate. - * - * Returns the certificate along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete an X509 certificate. - * - * Deletes an existing X509 certificate or does nothing if it does not exist. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete an X509 certificate. - * - * Deletes an existing X509 certificate or does nothing if it does not exist. - * - * @param id the resource ID. - * @param ifMatch ETag of the Certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, String ifMatch, Context context); - - /** - * Begins definition for a new CertificateDescription resource. - * - * @param name resource name. - * @return the first stage of the new CertificateDescription definition. - */ - CertificateDescription.DefinitionStages.Blank define(String name); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CloudToDeviceProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CloudToDeviceProperties.java deleted file mode 100644 index e7194b66aa90..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CloudToDeviceProperties.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.Duration; - -/** - * The IoT hub cloud-to-device messaging properties. - */ -@Fluent -public final class CloudToDeviceProperties implements JsonSerializable { - /* - * The max delivery count for cloud-to-device messages in the device queue. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. - */ - private Integer maxDeliveryCount; - - /* - * The default time to live for cloud-to-device messages in the device queue. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. - */ - private Duration defaultTtlAsIso8601; - - /* - * The properties of the feedback queue for cloud-to-device messages. - */ - private FeedbackProperties feedback; - - /** - * Creates an instance of CloudToDeviceProperties class. - */ - public CloudToDeviceProperties() { - } - - /** - * Get the maxDeliveryCount property: The max delivery count for cloud-to-device messages in the device queue. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. - * - * @return the maxDeliveryCount value. - */ - public Integer maxDeliveryCount() { - return this.maxDeliveryCount; - } - - /** - * Set the maxDeliveryCount property: The max delivery count for cloud-to-device messages in the device queue. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. - * - * @param maxDeliveryCount the maxDeliveryCount value to set. - * @return the CloudToDeviceProperties object itself. - */ - public CloudToDeviceProperties withMaxDeliveryCount(Integer maxDeliveryCount) { - this.maxDeliveryCount = maxDeliveryCount; - return this; - } - - /** - * Get the defaultTtlAsIso8601 property: The default time to live for cloud-to-device messages in the device queue. - * See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. - * - * @return the defaultTtlAsIso8601 value. - */ - public Duration defaultTtlAsIso8601() { - return this.defaultTtlAsIso8601; - } - - /** - * Set the defaultTtlAsIso8601 property: The default time to live for cloud-to-device messages in the device queue. - * See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. - * - * @param defaultTtlAsIso8601 the defaultTtlAsIso8601 value to set. - * @return the CloudToDeviceProperties object itself. - */ - public CloudToDeviceProperties withDefaultTtlAsIso8601(Duration defaultTtlAsIso8601) { - this.defaultTtlAsIso8601 = defaultTtlAsIso8601; - return this; - } - - /** - * Get the feedback property: The properties of the feedback queue for cloud-to-device messages. - * - * @return the feedback value. - */ - public FeedbackProperties feedback() { - return this.feedback; - } - - /** - * Set the feedback property: The properties of the feedback queue for cloud-to-device messages. - * - * @param feedback the feedback value to set. - * @return the CloudToDeviceProperties object itself. - */ - public CloudToDeviceProperties withFeedback(FeedbackProperties feedback) { - this.feedback = feedback; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("maxDeliveryCount", this.maxDeliveryCount); - jsonWriter.writeStringField("defaultTtlAsIso8601", - CoreUtils.durationToStringWithDays(this.defaultTtlAsIso8601)); - jsonWriter.writeJsonField("feedback", this.feedback); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CloudToDeviceProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CloudToDeviceProperties 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 CloudToDeviceProperties. - */ - public static CloudToDeviceProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CloudToDeviceProperties deserializedCloudToDeviceProperties = new CloudToDeviceProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("maxDeliveryCount".equals(fieldName)) { - deserializedCloudToDeviceProperties.maxDeliveryCount = reader.getNullable(JsonReader::getInt); - } else if ("defaultTtlAsIso8601".equals(fieldName)) { - deserializedCloudToDeviceProperties.defaultTtlAsIso8601 - = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); - } else if ("feedback".equals(fieldName)) { - deserializedCloudToDeviceProperties.feedback = FeedbackProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCloudToDeviceProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/DefaultAction.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/DefaultAction.java deleted file mode 100644 index 97de2d703654..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/DefaultAction.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Default Action for Network Rule Set. - */ -public final class DefaultAction extends ExpandableStringEnum { - /** - * Deny. - */ - public static final DefaultAction DENY = fromString("Deny"); - - /** - * Allow. - */ - public static final DefaultAction ALLOW = fromString("Allow"); - - /** - * Creates a new instance of DefaultAction value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DefaultAction() { - } - - /** - * Creates or finds a DefaultAction from its string representation. - * - * @param name a name to look for. - * @return the corresponding DefaultAction. - */ - public static DefaultAction fromString(String name) { - return fromString(name, DefaultAction.class); - } - - /** - * Gets known DefaultAction values. - * - * @return known DefaultAction values. - */ - public static Collection values() { - return values(DefaultAction.class); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/DeviceRegistry.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/DeviceRegistry.java deleted file mode 100644 index 72a4cd810da8..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/DeviceRegistry.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * Represents properties related to the Azure Device Registry (ADR). - */ -@Fluent -public final class DeviceRegistry implements JsonSerializable { - /* - * The identifier of the Azure Device Registry namespace associated with the GEN2 SKU hub. - */ - private String namespaceResourceId; - - /* - * The identity used to manage the ADR namespace from the data plane. - */ - private String identityResourceId; - - /** - * Creates an instance of DeviceRegistry class. - */ - public DeviceRegistry() { - } - - /** - * Get the namespaceResourceId property: The identifier of the Azure Device Registry namespace associated with the - * GEN2 SKU hub. - * - * @return the namespaceResourceId value. - */ - public String namespaceResourceId() { - return this.namespaceResourceId; - } - - /** - * Set the namespaceResourceId property: The identifier of the Azure Device Registry namespace associated with the - * GEN2 SKU hub. - * - * @param namespaceResourceId the namespaceResourceId value to set. - * @return the DeviceRegistry object itself. - */ - public DeviceRegistry withNamespaceResourceId(String namespaceResourceId) { - this.namespaceResourceId = namespaceResourceId; - return this; - } - - /** - * Get the identityResourceId property: The identity used to manage the ADR namespace from the data plane. - * - * @return the identityResourceId value. - */ - public String identityResourceId() { - return this.identityResourceId; - } - - /** - * Set the identityResourceId property: The identity used to manage the ADR namespace from the data plane. - * - * @param identityResourceId the identityResourceId value to set. - * @return the DeviceRegistry object itself. - */ - public DeviceRegistry withIdentityResourceId(String identityResourceId) { - this.identityResourceId = identityResourceId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("namespaceResourceId", this.namespaceResourceId); - jsonWriter.writeStringField("identityResourceId", this.identityResourceId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeviceRegistry from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeviceRegistry 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 DeviceRegistry. - */ - public static DeviceRegistry fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DeviceRegistry deserializedDeviceRegistry = new DeviceRegistry(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("namespaceResourceId".equals(fieldName)) { - deserializedDeviceRegistry.namespaceResourceId = reader.getString(); - } else if ("identityResourceId".equals(fieldName)) { - deserializedDeviceRegistry.identityResourceId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDeviceRegistry; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EncryptionPropertiesDescription.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EncryptionPropertiesDescription.java deleted file mode 100644 index 7ea009199d50..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EncryptionPropertiesDescription.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * The encryption properties for the IoT hub. - */ -@Fluent -public final class EncryptionPropertiesDescription implements JsonSerializable { - /* - * The source of the key. - */ - private String keySource; - - /* - * The properties of the KeyVault key. - */ - private List keyVaultProperties; - - /** - * Creates an instance of EncryptionPropertiesDescription class. - */ - public EncryptionPropertiesDescription() { - } - - /** - * Get the keySource property: The source of the key. - * - * @return the keySource value. - */ - public String keySource() { - return this.keySource; - } - - /** - * Set the keySource property: The source of the key. - * - * @param keySource the keySource value to set. - * @return the EncryptionPropertiesDescription object itself. - */ - public EncryptionPropertiesDescription withKeySource(String keySource) { - this.keySource = keySource; - return this; - } - - /** - * Get the keyVaultProperties property: The properties of the KeyVault key. - * - * @return the keyVaultProperties value. - */ - public List keyVaultProperties() { - return this.keyVaultProperties; - } - - /** - * Set the keyVaultProperties property: The properties of the KeyVault key. - * - * @param keyVaultProperties the keyVaultProperties value to set. - * @return the EncryptionPropertiesDescription object itself. - */ - public EncryptionPropertiesDescription withKeyVaultProperties(List keyVaultProperties) { - this.keyVaultProperties = keyVaultProperties; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("keySource", this.keySource); - jsonWriter.writeArrayField("keyVaultProperties", this.keyVaultProperties, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EncryptionPropertiesDescription from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EncryptionPropertiesDescription 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 EncryptionPropertiesDescription. - */ - public static EncryptionPropertiesDescription fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EncryptionPropertiesDescription deserializedEncryptionPropertiesDescription - = new EncryptionPropertiesDescription(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("keySource".equals(fieldName)) { - deserializedEncryptionPropertiesDescription.keySource = reader.getString(); - } else if ("keyVaultProperties".equals(fieldName)) { - List keyVaultProperties - = reader.readArray(reader1 -> KeyVaultKeyProperties.fromJson(reader1)); - deserializedEncryptionPropertiesDescription.keyVaultProperties = keyVaultProperties; - } else { - reader.skipChildren(); - } - } - - return deserializedEncryptionPropertiesDescription; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EndpointHealthData.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EndpointHealthData.java deleted file mode 100644 index 2541a7e8a8f7..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EndpointHealthData.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.resourcemanager.iothub.fluent.models.EndpointHealthDataInner; -import java.time.OffsetDateTime; - -/** - * An immutable client-side representation of EndpointHealthData. - */ -public interface EndpointHealthData { - /** - * Gets the endpointId property: Id of the endpoint. - * - * @return the endpointId value. - */ - String endpointId(); - - /** - * Gets the healthStatus property: Health statuses have following meanings. The 'healthy' status shows that the - * endpoint is accepting messages as expected. The 'unhealthy' status shows that the endpoint is not accepting - * messages as expected and IoT Hub is retrying to send data to this endpoint. The status of an unhealthy endpoint - * will be updated to healthy when IoT Hub has established an eventually consistent state of health. The 'dead' - * status shows that the endpoint is not accepting messages, after IoT Hub retried sending messages for the retrial - * period. See IoT Hub metrics to identify errors and monitor issues with endpoints. The 'unknown' status shows that - * the IoT Hub has not established a connection with the endpoint. No messages have been delivered to or rejected - * from this endpoint. - * - * @return the healthStatus value. - */ - EndpointHealthStatus healthStatus(); - - /** - * Gets the lastKnownError property: Last error obtained when a message failed to be delivered to iot hub. - * - * @return the lastKnownError value. - */ - String lastKnownError(); - - /** - * Gets the lastKnownErrorTime property: Time at which the last known error occurred. - * - * @return the lastKnownErrorTime value. - */ - OffsetDateTime lastKnownErrorTime(); - - /** - * Gets the lastSuccessfulSendAttemptTime property: Last time iot hub successfully sent a message to the endpoint. - * - * @return the lastSuccessfulSendAttemptTime value. - */ - OffsetDateTime lastSuccessfulSendAttemptTime(); - - /** - * Gets the lastSendAttemptTime property: Last time iot hub tried to send a message to the endpoint. - * - * @return the lastSendAttemptTime value. - */ - OffsetDateTime lastSendAttemptTime(); - - /** - * Gets the inner com.azure.resourcemanager.iothub.fluent.models.EndpointHealthDataInner object. - * - * @return the inner object. - */ - EndpointHealthDataInner innerModel(); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EndpointHealthStatus.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EndpointHealthStatus.java deleted file mode 100644 index b661bc81989a..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EndpointHealthStatus.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Health statuses have following meanings. The 'healthy' status shows that the endpoint is accepting messages as - * expected. The 'unhealthy' status shows that the endpoint is not accepting messages as expected and IoT Hub is - * retrying to send data to this endpoint. The status of an unhealthy endpoint will be updated to healthy when IoT Hub - * has established an eventually consistent state of health. The 'dead' status shows that the endpoint is not accepting - * messages, after IoT Hub retried sending messages for the retrial period. See IoT Hub metrics to identify errors and - * monitor issues with endpoints. The 'unknown' status shows that the IoT Hub has not established a connection with the - * endpoint. No messages have been delivered to or rejected from this endpoint. - */ -public final class EndpointHealthStatus extends ExpandableStringEnum { - /** - * unknown. - */ - public static final EndpointHealthStatus UNKNOWN = fromString("unknown"); - - /** - * healthy. - */ - public static final EndpointHealthStatus HEALTHY = fromString("healthy"); - - /** - * degraded. - */ - public static final EndpointHealthStatus DEGRADED = fromString("degraded"); - - /** - * unhealthy. - */ - public static final EndpointHealthStatus UNHEALTHY = fromString("unhealthy"); - - /** - * dead. - */ - public static final EndpointHealthStatus DEAD = fromString("dead"); - - /** - * Creates a new instance of EndpointHealthStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public EndpointHealthStatus() { - } - - /** - * Creates or finds a EndpointHealthStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding EndpointHealthStatus. - */ - public static EndpointHealthStatus fromString(String name) { - return fromString(name, EndpointHealthStatus.class); - } - - /** - * Gets known EndpointHealthStatus values. - * - * @return known EndpointHealthStatus values. - */ - public static Collection values() { - return values(EndpointHealthStatus.class); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EnrichmentProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EnrichmentProperties.java deleted file mode 100644 index 67df140cc40c..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EnrichmentProperties.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * The properties of an enrichment that your IoT hub applies to messages delivered to endpoints. - */ -@Fluent -public final class EnrichmentProperties implements JsonSerializable { - /* - * The key or name for the enrichment property. - */ - private String key; - - /* - * The value for the enrichment property. - */ - private String value; - - /* - * The list of endpoints for which the enrichment is applied to the message. - */ - private List endpointNames; - - /** - * Creates an instance of EnrichmentProperties class. - */ - public EnrichmentProperties() { - } - - /** - * Get the key property: The key or name for the enrichment property. - * - * @return the key value. - */ - public String key() { - return this.key; - } - - /** - * Set the key property: The key or name for the enrichment property. - * - * @param key the key value to set. - * @return the EnrichmentProperties object itself. - */ - public EnrichmentProperties withKey(String key) { - this.key = key; - return this; - } - - /** - * Get the value property: The value for the enrichment property. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: The value for the enrichment property. - * - * @param value the value value to set. - * @return the EnrichmentProperties object itself. - */ - public EnrichmentProperties withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the endpointNames property: The list of endpoints for which the enrichment is applied to the message. - * - * @return the endpointNames value. - */ - public List endpointNames() { - return this.endpointNames; - } - - /** - * Set the endpointNames property: The list of endpoints for which the enrichment is applied to the message. - * - * @param endpointNames the endpointNames value to set. - * @return the EnrichmentProperties object itself. - */ - public EnrichmentProperties withEndpointNames(List endpointNames) { - this.endpointNames = endpointNames; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("key", this.key); - jsonWriter.writeStringField("value", this.value); - jsonWriter.writeArrayField("endpointNames", this.endpointNames, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EnrichmentProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EnrichmentProperties 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 EnrichmentProperties. - */ - public static EnrichmentProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EnrichmentProperties deserializedEnrichmentProperties = new EnrichmentProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("key".equals(fieldName)) { - deserializedEnrichmentProperties.key = reader.getString(); - } else if ("value".equals(fieldName)) { - deserializedEnrichmentProperties.value = reader.getString(); - } else if ("endpointNames".equals(fieldName)) { - List endpointNames = reader.readArray(reader1 -> reader1.getString()); - deserializedEnrichmentProperties.endpointNames = endpointNames; - } else { - reader.skipChildren(); - } - } - - return deserializedEnrichmentProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ErrorDetails.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ErrorDetails.java deleted file mode 100644 index 2a377b98a69a..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ErrorDetails.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.exception.AdditionalInfo; -import com.azure.core.management.exception.ManagementError; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Error details. - */ -@Immutable -public final class ErrorDetails extends ManagementError { - /* - * The HTTP status code. - */ - private String httpStatusCode; - - /* - * Additional info for the error. - */ - private List additionalInfo; - - /* - * Details for the error. - */ - private List details; - - /* - * The target of the error. - */ - private String target; - - /* - * The error message parsed from the body of the http error response. - */ - private String message; - - /* - * The error code parsed from the body of the http error response. - */ - private String code; - - /** - * Creates an instance of ErrorDetails class. - */ - private ErrorDetails() { - } - - /** - * Get the httpStatusCode property: The HTTP status code. - * - * @return the httpStatusCode value. - */ - public String getHttpStatusCode() { - return this.httpStatusCode; - } - - /** - * Get the additionalInfo property: Additional info for the error. - * - * @return the additionalInfo value. - */ - @Override - public List getAdditionalInfo() { - return this.additionalInfo; - } - - /** - * Get the details property: Details for the error. - * - * @return the details value. - */ - @Override - public List getDetails() { - return this.details; - } - - /** - * Get the target property: The target of the error. - * - * @return the target value. - */ - @Override - public String getTarget() { - return this.target; - } - - /** - * Get the message property: The error message parsed from the body of the http error response. - * - * @return the message value. - */ - @Override - public String getMessage() { - return this.message; - } - - /** - * Get the code property: The error code parsed from the body of the http error response. - * - * @return the code value. - */ - @Override - public String getCode() { - return this.code; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ErrorDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ErrorDetails 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 ErrorDetails. - */ - public static ErrorDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - JsonReader bufferedReader = reader.bufferObject(); - bufferedReader.nextToken(); - while (bufferedReader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = bufferedReader.getFieldName(); - bufferedReader.nextToken(); - - if ("error".equals(fieldName)) { - return readManagementError(bufferedReader); - } else { - bufferedReader.skipChildren(); - } - } - return readManagementError(bufferedReader.reset()); - }); - } - - private static ErrorDetails readManagementError(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ErrorDetails deserializedErrorDetails = new ErrorDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("code".equals(fieldName)) { - deserializedErrorDetails.code = reader.getString(); - } else if ("message".equals(fieldName)) { - deserializedErrorDetails.message = reader.getString(); - } else if ("target".equals(fieldName)) { - deserializedErrorDetails.target = reader.getString(); - } else if ("details".equals(fieldName)) { - List details = reader.readArray(reader1 -> ManagementError.fromJson(reader1)); - deserializedErrorDetails.details = details; - } else if ("additionalInfo".equals(fieldName)) { - List additionalInfo = reader.readArray(reader1 -> AdditionalInfo.fromJson(reader1)); - deserializedErrorDetails.additionalInfo = additionalInfo; - } else if ("httpStatusCode".equals(fieldName)) { - deserializedErrorDetails.httpStatusCode = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedErrorDetails; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ErrorDetailsException.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ErrorDetailsException.java deleted file mode 100644 index 20dcb2a912ee..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ErrorDetailsException.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.http.HttpResponse; -import com.azure.core.management.exception.ManagementException; - -/** - * Exception thrown for an invalid response with ErrorDetails information. - */ -public final class ErrorDetailsException extends ManagementException { - /** - * Initializes a new instance of the ErrorDetailsException class. - * - * @param message the exception message or the response content if a message is not available. - * @param response the HTTP response. - */ - public ErrorDetailsException(String message, HttpResponse response) { - super(message, response); - } - - /** - * Initializes a new instance of the ErrorDetailsException class. - * - * @param message the exception message or the response content if a message is not available. - * @param response the HTTP response. - * @param value the deserialized response value. - */ - public ErrorDetailsException(String message, HttpResponse response, ErrorDetails value) { - super(message, response, value); - } - - /** - * {@inheritDoc} - */ - @Override - public ErrorDetails getValue() { - return (ErrorDetails) super.getValue(); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupBodyDescription.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupBodyDescription.java deleted file mode 100644 index 2ccc783bcd7e..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupBodyDescription.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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 EventHub consumer group. - */ -@Fluent -public final class EventHubConsumerGroupBodyDescription - implements JsonSerializable { - /* - * The EventHub consumer group name. - */ - private EventHubConsumerGroupName properties; - - /** - * Creates an instance of EventHubConsumerGroupBodyDescription class. - */ - public EventHubConsumerGroupBodyDescription() { - } - - /** - * Get the properties property: The EventHub consumer group name. - * - * @return the properties value. - */ - public EventHubConsumerGroupName properties() { - return this.properties; - } - - /** - * Set the properties property: The EventHub consumer group name. - * - * @param properties the properties value to set. - * @return the EventHubConsumerGroupBodyDescription object itself. - */ - public EventHubConsumerGroupBodyDescription withProperties(EventHubConsumerGroupName properties) { - this.properties = properties; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EventHubConsumerGroupBodyDescription from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EventHubConsumerGroupBodyDescription 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 EventHubConsumerGroupBodyDescription. - */ - public static EventHubConsumerGroupBodyDescription fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EventHubConsumerGroupBodyDescription deserializedEventHubConsumerGroupBodyDescription - = new EventHubConsumerGroupBodyDescription(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedEventHubConsumerGroupBodyDescription.properties - = EventHubConsumerGroupName.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedEventHubConsumerGroupBodyDescription; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupInfo.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupInfo.java deleted file mode 100644 index 78a2abd9c0e2..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupInfo.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.iothub.fluent.models.EventHubConsumerGroupInfoInner; -import java.util.Map; - -/** - * An immutable client-side representation of EventHubConsumerGroupInfo. - */ -public interface EventHubConsumerGroupInfo { - /** - * 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: The tags. - * - * @return the properties value. - */ - Map properties(); - - /** - * Gets the etag property: The etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the inner com.azure.resourcemanager.iothub.fluent.models.EventHubConsumerGroupInfoInner object. - * - * @return the inner object. - */ - EventHubConsumerGroupInfoInner innerModel(); - - /** - * The entirety of the EventHubConsumerGroupInfo definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, DefinitionStages.WithCreate { - } - - /** - * The EventHubConsumerGroupInfo definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the EventHubConsumerGroupInfo definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the EventHubConsumerGroupInfo definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, resourceName, eventHubEndpointName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @return the next definition stage. - */ - WithProperties withExistingEventHubEndpoint(String resourceGroupName, String resourceName, - String eventHubEndpointName); - } - - /** - * The stage of the EventHubConsumerGroupInfo definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: The EventHub consumer group name.. - * - * @param properties The EventHub consumer group name. - * @return the next definition stage. - */ - WithCreate withProperties(EventHubConsumerGroupName properties); - } - - /** - * The stage of the EventHubConsumerGroupInfo 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 { - /** - * Executes the create request. - * - * @return the created resource. - */ - EventHubConsumerGroupInfo create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - EventHubConsumerGroupInfo create(Context context); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - EventHubConsumerGroupInfo refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - EventHubConsumerGroupInfo refresh(Context context); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupName.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupName.java deleted file mode 100644 index 70a3c23740fb..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupName.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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 EventHub consumer group name. - */ -@Fluent -public final class EventHubConsumerGroupName implements JsonSerializable { - /* - * EventHub consumer group name - */ - private String name; - - /** - * Creates an instance of EventHubConsumerGroupName class. - */ - public EventHubConsumerGroupName() { - } - - /** - * Get the name property: EventHub consumer group name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: EventHub consumer group name. - * - * @param name the name value to set. - * @return the EventHubConsumerGroupName object itself. - */ - public EventHubConsumerGroupName withName(String name) { - this.name = name; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EventHubConsumerGroupName from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EventHubConsumerGroupName 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 EventHubConsumerGroupName. - */ - public static EventHubConsumerGroupName fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EventHubConsumerGroupName deserializedEventHubConsumerGroupName = new EventHubConsumerGroupName(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedEventHubConsumerGroupName.name = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedEventHubConsumerGroupName; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubProperties.java deleted file mode 100644 index ec9bf8c07278..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubProperties.java +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * The properties of the provisioned Event Hub-compatible endpoint used by the IoT hub. - */ -@Fluent -public final class EventHubProperties implements JsonSerializable { - /* - * The retention time for device-to-cloud messages in days. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages - */ - private Long retentionTimeInDays; - - /* - * The number of partitions for receiving device-to-cloud messages in the Event Hub-compatible endpoint. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages. - */ - private Integer partitionCount; - - /* - * The partition ids in the Event Hub-compatible endpoint. - */ - private List partitionIds; - - /* - * The Event Hub-compatible name. - */ - private String path; - - /* - * The Event Hub-compatible endpoint. - */ - private String endpoint; - - /** - * Creates an instance of EventHubProperties class. - */ - public EventHubProperties() { - } - - /** - * Get the retentionTimeInDays property: The retention time for device-to-cloud messages in days. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages. - * - * @return the retentionTimeInDays value. - */ - public Long retentionTimeInDays() { - return this.retentionTimeInDays; - } - - /** - * Set the retentionTimeInDays property: The retention time for device-to-cloud messages in days. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages. - * - * @param retentionTimeInDays the retentionTimeInDays value to set. - * @return the EventHubProperties object itself. - */ - public EventHubProperties withRetentionTimeInDays(Long retentionTimeInDays) { - this.retentionTimeInDays = retentionTimeInDays; - return this; - } - - /** - * Get the partitionCount property: The number of partitions for receiving device-to-cloud messages in the Event - * Hub-compatible endpoint. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages. - * - * @return the partitionCount value. - */ - public Integer partitionCount() { - return this.partitionCount; - } - - /** - * Set the partitionCount property: The number of partitions for receiving device-to-cloud messages in the Event - * Hub-compatible endpoint. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages. - * - * @param partitionCount the partitionCount value to set. - * @return the EventHubProperties object itself. - */ - public EventHubProperties withPartitionCount(Integer partitionCount) { - this.partitionCount = partitionCount; - return this; - } - - /** - * Get the partitionIds property: The partition ids in the Event Hub-compatible endpoint. - * - * @return the partitionIds value. - */ - public List partitionIds() { - return this.partitionIds; - } - - /** - * Get the path property: The Event Hub-compatible name. - * - * @return the path value. - */ - public String path() { - return this.path; - } - - /** - * Get the endpoint property: The Event Hub-compatible endpoint. - * - * @return the endpoint value. - */ - public String endpoint() { - return this.endpoint; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("retentionTimeInDays", this.retentionTimeInDays); - jsonWriter.writeNumberField("partitionCount", this.partitionCount); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EventHubProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EventHubProperties 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 EventHubProperties. - */ - public static EventHubProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EventHubProperties deserializedEventHubProperties = new EventHubProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("retentionTimeInDays".equals(fieldName)) { - deserializedEventHubProperties.retentionTimeInDays = reader.getNullable(JsonReader::getLong); - } else if ("partitionCount".equals(fieldName)) { - deserializedEventHubProperties.partitionCount = reader.getNullable(JsonReader::getInt); - } else if ("partitionIds".equals(fieldName)) { - List partitionIds = reader.readArray(reader1 -> reader1.getString()); - deserializedEventHubProperties.partitionIds = partitionIds; - } else if ("path".equals(fieldName)) { - deserializedEventHubProperties.path = reader.getString(); - } else if ("endpoint".equals(fieldName)) { - deserializedEventHubProperties.endpoint = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedEventHubProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ExportDevicesRequest.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ExportDevicesRequest.java deleted file mode 100644 index d5290ec4c88c..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ExportDevicesRequest.java +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * Use to provide parameters when requesting an export of all devices in the IoT hub. - */ -@Fluent -public final class ExportDevicesRequest implements JsonSerializable { - /* - * The export blob container URI. - */ - private String exportBlobContainerUri; - - /* - * The value indicating whether keys should be excluded during export. - */ - private boolean excludeKeys; - - /* - * The name of the blob that will be created in the provided output blob container. This blob will contain the - * exported device registry information for the IoT Hub. - */ - private String exportBlobName; - - /* - * Specifies authentication type being used for connecting to the storage account. - */ - private AuthenticationType authenticationType; - - /* - * Managed identity properties of storage endpoint for export devices. - */ - private ManagedIdentity identity; - - /* - * The value indicating whether configurations should be exported. - */ - private Boolean includeConfigurations; - - /* - * The name of the blob that will be created in the provided output blob container. This blob will contain the - * exported configurations for the Iot Hub. - */ - private String configurationsBlobName; - - /** - * Creates an instance of ExportDevicesRequest class. - */ - public ExportDevicesRequest() { - } - - /** - * Get the exportBlobContainerUri property: The export blob container URI. - * - * @return the exportBlobContainerUri value. - */ - public String exportBlobContainerUri() { - return this.exportBlobContainerUri; - } - - /** - * Set the exportBlobContainerUri property: The export blob container URI. - * - * @param exportBlobContainerUri the exportBlobContainerUri value to set. - * @return the ExportDevicesRequest object itself. - */ - public ExportDevicesRequest withExportBlobContainerUri(String exportBlobContainerUri) { - this.exportBlobContainerUri = exportBlobContainerUri; - return this; - } - - /** - * Get the excludeKeys property: The value indicating whether keys should be excluded during export. - * - * @return the excludeKeys value. - */ - public boolean excludeKeys() { - return this.excludeKeys; - } - - /** - * Set the excludeKeys property: The value indicating whether keys should be excluded during export. - * - * @param excludeKeys the excludeKeys value to set. - * @return the ExportDevicesRequest object itself. - */ - public ExportDevicesRequest withExcludeKeys(boolean excludeKeys) { - this.excludeKeys = excludeKeys; - return this; - } - - /** - * Get the exportBlobName property: The name of the blob that will be created in the provided output blob container. - * This blob will contain the exported device registry information for the IoT Hub. - * - * @return the exportBlobName value. - */ - public String exportBlobName() { - return this.exportBlobName; - } - - /** - * Set the exportBlobName property: The name of the blob that will be created in the provided output blob container. - * This blob will contain the exported device registry information for the IoT Hub. - * - * @param exportBlobName the exportBlobName value to set. - * @return the ExportDevicesRequest object itself. - */ - public ExportDevicesRequest withExportBlobName(String exportBlobName) { - this.exportBlobName = exportBlobName; - return this; - } - - /** - * Get the authenticationType property: Specifies authentication type being used for connecting to the storage - * account. - * - * @return the authenticationType value. - */ - public AuthenticationType authenticationType() { - return this.authenticationType; - } - - /** - * Set the authenticationType property: Specifies authentication type being used for connecting to the storage - * account. - * - * @param authenticationType the authenticationType value to set. - * @return the ExportDevicesRequest object itself. - */ - public ExportDevicesRequest withAuthenticationType(AuthenticationType authenticationType) { - this.authenticationType = authenticationType; - return this; - } - - /** - * Get the identity property: Managed identity properties of storage endpoint for export devices. - * - * @return the identity value. - */ - public ManagedIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: Managed identity properties of storage endpoint for export devices. - * - * @param identity the identity value to set. - * @return the ExportDevicesRequest object itself. - */ - public ExportDevicesRequest withIdentity(ManagedIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the includeConfigurations property: The value indicating whether configurations should be exported. - * - * @return the includeConfigurations value. - */ - public Boolean includeConfigurations() { - return this.includeConfigurations; - } - - /** - * Set the includeConfigurations property: The value indicating whether configurations should be exported. - * - * @param includeConfigurations the includeConfigurations value to set. - * @return the ExportDevicesRequest object itself. - */ - public ExportDevicesRequest withIncludeConfigurations(Boolean includeConfigurations) { - this.includeConfigurations = includeConfigurations; - return this; - } - - /** - * Get the configurationsBlobName property: The name of the blob that will be created in the provided output blob - * container. This blob will contain the exported configurations for the Iot Hub. - * - * @return the configurationsBlobName value. - */ - public String configurationsBlobName() { - return this.configurationsBlobName; - } - - /** - * Set the configurationsBlobName property: The name of the blob that will be created in the provided output blob - * container. This blob will contain the exported configurations for the Iot Hub. - * - * @param configurationsBlobName the configurationsBlobName value to set. - * @return the ExportDevicesRequest object itself. - */ - public ExportDevicesRequest withConfigurationsBlobName(String configurationsBlobName) { - this.configurationsBlobName = configurationsBlobName; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("exportBlobContainerUri", this.exportBlobContainerUri); - jsonWriter.writeBooleanField("excludeKeys", this.excludeKeys); - jsonWriter.writeStringField("exportBlobName", this.exportBlobName); - jsonWriter.writeStringField("authenticationType", - this.authenticationType == null ? null : this.authenticationType.toString()); - jsonWriter.writeJsonField("identity", this.identity); - jsonWriter.writeBooleanField("includeConfigurations", this.includeConfigurations); - jsonWriter.writeStringField("configurationsBlobName", this.configurationsBlobName); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ExportDevicesRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ExportDevicesRequest 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 ExportDevicesRequest. - */ - public static ExportDevicesRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ExportDevicesRequest deserializedExportDevicesRequest = new ExportDevicesRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("exportBlobContainerUri".equals(fieldName)) { - deserializedExportDevicesRequest.exportBlobContainerUri = reader.getString(); - } else if ("excludeKeys".equals(fieldName)) { - deserializedExportDevicesRequest.excludeKeys = reader.getBoolean(); - } else if ("exportBlobName".equals(fieldName)) { - deserializedExportDevicesRequest.exportBlobName = reader.getString(); - } else if ("authenticationType".equals(fieldName)) { - deserializedExportDevicesRequest.authenticationType - = AuthenticationType.fromString(reader.getString()); - } else if ("identity".equals(fieldName)) { - deserializedExportDevicesRequest.identity = ManagedIdentity.fromJson(reader); - } else if ("includeConfigurations".equals(fieldName)) { - deserializedExportDevicesRequest.includeConfigurations = reader.getNullable(JsonReader::getBoolean); - } else if ("configurationsBlobName".equals(fieldName)) { - deserializedExportDevicesRequest.configurationsBlobName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedExportDevicesRequest; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FailoverInput.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FailoverInput.java deleted file mode 100644 index 66551ee231e9..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FailoverInput.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * Use to provide failover region when requesting manual Failover for a hub. - */ -@Fluent -public final class FailoverInput implements JsonSerializable { - /* - * Region the hub will be failed over to - */ - private String failoverRegion; - - /** - * Creates an instance of FailoverInput class. - */ - public FailoverInput() { - } - - /** - * Get the failoverRegion property: Region the hub will be failed over to. - * - * @return the failoverRegion value. - */ - public String failoverRegion() { - return this.failoverRegion; - } - - /** - * Set the failoverRegion property: Region the hub will be failed over to. - * - * @param failoverRegion the failoverRegion value to set. - * @return the FailoverInput object itself. - */ - public FailoverInput withFailoverRegion(String failoverRegion) { - this.failoverRegion = failoverRegion; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("failoverRegion", this.failoverRegion); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FailoverInput from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FailoverInput 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 FailoverInput. - */ - public static FailoverInput fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FailoverInput deserializedFailoverInput = new FailoverInput(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("failoverRegion".equals(fieldName)) { - deserializedFailoverInput.failoverRegion = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedFailoverInput; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FallbackRouteProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FallbackRouteProperties.java deleted file mode 100644 index 32fe571ee735..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FallbackRouteProperties.java +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * The properties of the fallback route. IoT Hub uses these properties when it routes messages to the fallback endpoint. - */ -@Fluent -public final class FallbackRouteProperties implements JsonSerializable { - /* - * The name of the route. The name can only include alphanumeric characters, periods, underscores, hyphens, has a - * maximum length of 64 characters, and must be unique. - */ - private String name; - - /* - * The source to which the routing rule is to be applied to. For example, DeviceMessages - */ - private RoutingSource source; - - /* - * The condition which is evaluated in order to apply the fallback route. If the condition is not provided it will - * evaluate to true by default. For grammar, See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language - */ - private String condition; - - /* - * The list of endpoints to which the messages that satisfy the condition are routed to. Currently only 1 endpoint - * is allowed. - */ - private List endpointNames; - - /* - * Used to specify whether the fallback route is enabled. - */ - private boolean isEnabled; - - /** - * Creates an instance of FallbackRouteProperties class. - */ - public FallbackRouteProperties() { - } - - /** - * Get the name property: The name of the route. The name can only include alphanumeric characters, periods, - * underscores, hyphens, has a maximum length of 64 characters, and must be unique. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the route. The name can only include alphanumeric characters, periods, - * underscores, hyphens, has a maximum length of 64 characters, and must be unique. - * - * @param name the name value to set. - * @return the FallbackRouteProperties object itself. - */ - public FallbackRouteProperties withName(String name) { - this.name = name; - return this; - } - - /** - * Get the source property: The source to which the routing rule is to be applied to. For example, DeviceMessages. - * - * @return the source value. - */ - public RoutingSource source() { - return this.source; - } - - /** - * Set the source property: The source to which the routing rule is to be applied to. For example, DeviceMessages. - * - * @param source the source value to set. - * @return the FallbackRouteProperties object itself. - */ - public FallbackRouteProperties withSource(RoutingSource source) { - this.source = source; - return this; - } - - /** - * Get the condition property: The condition which is evaluated in order to apply the fallback route. If the - * condition is not provided it will evaluate to true by default. For grammar, See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language. - * - * @return the condition value. - */ - public String condition() { - return this.condition; - } - - /** - * Set the condition property: The condition which is evaluated in order to apply the fallback route. If the - * condition is not provided it will evaluate to true by default. For grammar, See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language. - * - * @param condition the condition value to set. - * @return the FallbackRouteProperties object itself. - */ - public FallbackRouteProperties withCondition(String condition) { - this.condition = condition; - return this; - } - - /** - * Get the endpointNames property: The list of endpoints to which the messages that satisfy the condition are routed - * to. Currently only 1 endpoint is allowed. - * - * @return the endpointNames value. - */ - public List endpointNames() { - return this.endpointNames; - } - - /** - * Set the endpointNames property: The list of endpoints to which the messages that satisfy the condition are routed - * to. Currently only 1 endpoint is allowed. - * - * @param endpointNames the endpointNames value to set. - * @return the FallbackRouteProperties object itself. - */ - public FallbackRouteProperties withEndpointNames(List endpointNames) { - this.endpointNames = endpointNames; - return this; - } - - /** - * Get the isEnabled property: Used to specify whether the fallback route is enabled. - * - * @return the isEnabled value. - */ - public boolean isEnabled() { - return this.isEnabled; - } - - /** - * Set the isEnabled property: Used to specify whether the fallback route is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the FallbackRouteProperties object itself. - */ - public FallbackRouteProperties withIsEnabled(boolean isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("source", this.source == null ? null : this.source.toString()); - jsonWriter.writeArrayField("endpointNames", this.endpointNames, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("isEnabled", this.isEnabled); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("condition", this.condition); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FallbackRouteProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FallbackRouteProperties 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 FallbackRouteProperties. - */ - public static FallbackRouteProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FallbackRouteProperties deserializedFallbackRouteProperties = new FallbackRouteProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("source".equals(fieldName)) { - deserializedFallbackRouteProperties.source = RoutingSource.fromString(reader.getString()); - } else if ("endpointNames".equals(fieldName)) { - List endpointNames = reader.readArray(reader1 -> reader1.getString()); - deserializedFallbackRouteProperties.endpointNames = endpointNames; - } else if ("isEnabled".equals(fieldName)) { - deserializedFallbackRouteProperties.isEnabled = reader.getBoolean(); - } else if ("name".equals(fieldName)) { - deserializedFallbackRouteProperties.name = reader.getString(); - } else if ("condition".equals(fieldName)) { - deserializedFallbackRouteProperties.condition = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedFallbackRouteProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FeedbackProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FeedbackProperties.java deleted file mode 100644 index b9accf32614c..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FeedbackProperties.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.Duration; - -/** - * The properties of the feedback queue for cloud-to-device messages. - */ -@Fluent -public final class FeedbackProperties implements JsonSerializable { - /* - * The lock duration for the feedback queue. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. - */ - private Duration lockDurationAsIso8601; - - /* - * The period of time for which a message is available to consume before it is expired by the IoT hub. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. - */ - private Duration ttlAsIso8601; - - /* - * The number of times the IoT hub attempts to deliver a message on the feedback queue. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. - */ - private Integer maxDeliveryCount; - - /** - * Creates an instance of FeedbackProperties class. - */ - public FeedbackProperties() { - } - - /** - * Get the lockDurationAsIso8601 property: The lock duration for the feedback queue. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. - * - * @return the lockDurationAsIso8601 value. - */ - public Duration lockDurationAsIso8601() { - return this.lockDurationAsIso8601; - } - - /** - * Set the lockDurationAsIso8601 property: The lock duration for the feedback queue. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. - * - * @param lockDurationAsIso8601 the lockDurationAsIso8601 value to set. - * @return the FeedbackProperties object itself. - */ - public FeedbackProperties withLockDurationAsIso8601(Duration lockDurationAsIso8601) { - this.lockDurationAsIso8601 = lockDurationAsIso8601; - return this; - } - - /** - * Get the ttlAsIso8601 property: The period of time for which a message is available to consume before it is - * expired by the IoT hub. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. - * - * @return the ttlAsIso8601 value. - */ - public Duration ttlAsIso8601() { - return this.ttlAsIso8601; - } - - /** - * Set the ttlAsIso8601 property: The period of time for which a message is available to consume before it is - * expired by the IoT hub. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. - * - * @param ttlAsIso8601 the ttlAsIso8601 value to set. - * @return the FeedbackProperties object itself. - */ - public FeedbackProperties withTtlAsIso8601(Duration ttlAsIso8601) { - this.ttlAsIso8601 = ttlAsIso8601; - return this; - } - - /** - * Get the maxDeliveryCount property: The number of times the IoT hub attempts to deliver a message on the feedback - * queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. - * - * @return the maxDeliveryCount value. - */ - public Integer maxDeliveryCount() { - return this.maxDeliveryCount; - } - - /** - * Set the maxDeliveryCount property: The number of times the IoT hub attempts to deliver a message on the feedback - * queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. - * - * @param maxDeliveryCount the maxDeliveryCount value to set. - * @return the FeedbackProperties object itself. - */ - public FeedbackProperties withMaxDeliveryCount(Integer maxDeliveryCount) { - this.maxDeliveryCount = maxDeliveryCount; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("lockDurationAsIso8601", - CoreUtils.durationToStringWithDays(this.lockDurationAsIso8601)); - jsonWriter.writeStringField("ttlAsIso8601", CoreUtils.durationToStringWithDays(this.ttlAsIso8601)); - jsonWriter.writeNumberField("maxDeliveryCount", this.maxDeliveryCount); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FeedbackProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FeedbackProperties 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 FeedbackProperties. - */ - public static FeedbackProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FeedbackProperties deserializedFeedbackProperties = new FeedbackProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("lockDurationAsIso8601".equals(fieldName)) { - deserializedFeedbackProperties.lockDurationAsIso8601 - = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); - } else if ("ttlAsIso8601".equals(fieldName)) { - deserializedFeedbackProperties.ttlAsIso8601 - = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); - } else if ("maxDeliveryCount".equals(fieldName)) { - deserializedFeedbackProperties.maxDeliveryCount = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedFeedbackProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/GroupIdInformation.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/GroupIdInformation.java deleted file mode 100644 index 2832f9768778..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/GroupIdInformation.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.resourcemanager.iothub.fluent.models.GroupIdInformationInner; - -/** - * An immutable client-side representation of GroupIdInformation. - */ -public interface GroupIdInformation { - /** - * Gets the id property: The resource identifier. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The resource name. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The resource type. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: The properties for a group information object. - * - * @return the properties value. - */ - GroupIdInformationProperties properties(); - - /** - * Gets the inner com.azure.resourcemanager.iothub.fluent.models.GroupIdInformationInner object. - * - * @return the inner object. - */ - GroupIdInformationInner innerModel(); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/GroupIdInformationProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/GroupIdInformationProperties.java deleted file mode 100644 index cdc62c997613..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/GroupIdInformationProperties.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The properties for a group information object. - */ -@Immutable -public final class GroupIdInformationProperties implements JsonSerializable { - /* - * The group id - */ - private String groupId; - - /* - * The required members for a specific group id - */ - private List requiredMembers; - - /* - * The required DNS zones for a specific group id - */ - private List requiredZoneNames; - - /** - * Creates an instance of GroupIdInformationProperties class. - */ - private GroupIdInformationProperties() { - } - - /** - * Get the groupId property: The group id. - * - * @return the groupId value. - */ - public String groupId() { - return this.groupId; - } - - /** - * Get the requiredMembers property: The required members for a specific group id. - * - * @return the requiredMembers value. - */ - public List requiredMembers() { - return this.requiredMembers; - } - - /** - * Get the requiredZoneNames property: The required DNS zones for a specific group id. - * - * @return the requiredZoneNames value. - */ - public List requiredZoneNames() { - return this.requiredZoneNames; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("groupId", this.groupId); - jsonWriter.writeArrayField("requiredMembers", this.requiredMembers, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeArrayField("requiredZoneNames", this.requiredZoneNames, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupIdInformationProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupIdInformationProperties 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 GroupIdInformationProperties. - */ - public static GroupIdInformationProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupIdInformationProperties deserializedGroupIdInformationProperties = new GroupIdInformationProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("groupId".equals(fieldName)) { - deserializedGroupIdInformationProperties.groupId = reader.getString(); - } else if ("requiredMembers".equals(fieldName)) { - List requiredMembers = reader.readArray(reader1 -> reader1.getString()); - deserializedGroupIdInformationProperties.requiredMembers = requiredMembers; - } else if ("requiredZoneNames".equals(fieldName)) { - List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); - deserializedGroupIdInformationProperties.requiredZoneNames = requiredZoneNames; - } else { - reader.skipChildren(); - } - } - - return deserializedGroupIdInformationProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ImportDevicesRequest.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ImportDevicesRequest.java deleted file mode 100644 index fb5191149730..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ImportDevicesRequest.java +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * Use to provide parameters when requesting an import of all devices in the hub. - */ -@Fluent -public final class ImportDevicesRequest implements JsonSerializable { - /* - * The input blob container URI. - */ - private String inputBlobContainerUri; - - /* - * The output blob container URI. - */ - private String outputBlobContainerUri; - - /* - * The blob name to be used when importing from the provided input blob container. - */ - private String inputBlobName; - - /* - * The blob name to use for storing the status of the import job. - */ - private String outputBlobName; - - /* - * Specifies authentication type being used for connecting to the storage account. - */ - private AuthenticationType authenticationType; - - /* - * Managed identity properties of storage endpoint for import devices. - */ - private ManagedIdentity identity; - - /* - * The value indicating whether configurations should be imported. - */ - private Boolean includeConfigurations; - - /* - * The blob name to be used when importing configurations from the provided input blob container. - */ - private String configurationsBlobName; - - /** - * Creates an instance of ImportDevicesRequest class. - */ - public ImportDevicesRequest() { - } - - /** - * Get the inputBlobContainerUri property: The input blob container URI. - * - * @return the inputBlobContainerUri value. - */ - public String inputBlobContainerUri() { - return this.inputBlobContainerUri; - } - - /** - * Set the inputBlobContainerUri property: The input blob container URI. - * - * @param inputBlobContainerUri the inputBlobContainerUri value to set. - * @return the ImportDevicesRequest object itself. - */ - public ImportDevicesRequest withInputBlobContainerUri(String inputBlobContainerUri) { - this.inputBlobContainerUri = inputBlobContainerUri; - return this; - } - - /** - * Get the outputBlobContainerUri property: The output blob container URI. - * - * @return the outputBlobContainerUri value. - */ - public String outputBlobContainerUri() { - return this.outputBlobContainerUri; - } - - /** - * Set the outputBlobContainerUri property: The output blob container URI. - * - * @param outputBlobContainerUri the outputBlobContainerUri value to set. - * @return the ImportDevicesRequest object itself. - */ - public ImportDevicesRequest withOutputBlobContainerUri(String outputBlobContainerUri) { - this.outputBlobContainerUri = outputBlobContainerUri; - return this; - } - - /** - * Get the inputBlobName property: The blob name to be used when importing from the provided input blob container. - * - * @return the inputBlobName value. - */ - public String inputBlobName() { - return this.inputBlobName; - } - - /** - * Set the inputBlobName property: The blob name to be used when importing from the provided input blob container. - * - * @param inputBlobName the inputBlobName value to set. - * @return the ImportDevicesRequest object itself. - */ - public ImportDevicesRequest withInputBlobName(String inputBlobName) { - this.inputBlobName = inputBlobName; - return this; - } - - /** - * Get the outputBlobName property: The blob name to use for storing the status of the import job. - * - * @return the outputBlobName value. - */ - public String outputBlobName() { - return this.outputBlobName; - } - - /** - * Set the outputBlobName property: The blob name to use for storing the status of the import job. - * - * @param outputBlobName the outputBlobName value to set. - * @return the ImportDevicesRequest object itself. - */ - public ImportDevicesRequest withOutputBlobName(String outputBlobName) { - this.outputBlobName = outputBlobName; - return this; - } - - /** - * Get the authenticationType property: Specifies authentication type being used for connecting to the storage - * account. - * - * @return the authenticationType value. - */ - public AuthenticationType authenticationType() { - return this.authenticationType; - } - - /** - * Set the authenticationType property: Specifies authentication type being used for connecting to the storage - * account. - * - * @param authenticationType the authenticationType value to set. - * @return the ImportDevicesRequest object itself. - */ - public ImportDevicesRequest withAuthenticationType(AuthenticationType authenticationType) { - this.authenticationType = authenticationType; - return this; - } - - /** - * Get the identity property: Managed identity properties of storage endpoint for import devices. - * - * @return the identity value. - */ - public ManagedIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: Managed identity properties of storage endpoint for import devices. - * - * @param identity the identity value to set. - * @return the ImportDevicesRequest object itself. - */ - public ImportDevicesRequest withIdentity(ManagedIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the includeConfigurations property: The value indicating whether configurations should be imported. - * - * @return the includeConfigurations value. - */ - public Boolean includeConfigurations() { - return this.includeConfigurations; - } - - /** - * Set the includeConfigurations property: The value indicating whether configurations should be imported. - * - * @param includeConfigurations the includeConfigurations value to set. - * @return the ImportDevicesRequest object itself. - */ - public ImportDevicesRequest withIncludeConfigurations(Boolean includeConfigurations) { - this.includeConfigurations = includeConfigurations; - return this; - } - - /** - * Get the configurationsBlobName property: The blob name to be used when importing configurations from the provided - * input blob container. - * - * @return the configurationsBlobName value. - */ - public String configurationsBlobName() { - return this.configurationsBlobName; - } - - /** - * Set the configurationsBlobName property: The blob name to be used when importing configurations from the provided - * input blob container. - * - * @param configurationsBlobName the configurationsBlobName value to set. - * @return the ImportDevicesRequest object itself. - */ - public ImportDevicesRequest withConfigurationsBlobName(String configurationsBlobName) { - this.configurationsBlobName = configurationsBlobName; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("inputBlobContainerUri", this.inputBlobContainerUri); - jsonWriter.writeStringField("outputBlobContainerUri", this.outputBlobContainerUri); - jsonWriter.writeStringField("inputBlobName", this.inputBlobName); - jsonWriter.writeStringField("outputBlobName", this.outputBlobName); - jsonWriter.writeStringField("authenticationType", - this.authenticationType == null ? null : this.authenticationType.toString()); - jsonWriter.writeJsonField("identity", this.identity); - jsonWriter.writeBooleanField("includeConfigurations", this.includeConfigurations); - jsonWriter.writeStringField("configurationsBlobName", this.configurationsBlobName); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ImportDevicesRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ImportDevicesRequest 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 ImportDevicesRequest. - */ - public static ImportDevicesRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ImportDevicesRequest deserializedImportDevicesRequest = new ImportDevicesRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("inputBlobContainerUri".equals(fieldName)) { - deserializedImportDevicesRequest.inputBlobContainerUri = reader.getString(); - } else if ("outputBlobContainerUri".equals(fieldName)) { - deserializedImportDevicesRequest.outputBlobContainerUri = reader.getString(); - } else if ("inputBlobName".equals(fieldName)) { - deserializedImportDevicesRequest.inputBlobName = reader.getString(); - } else if ("outputBlobName".equals(fieldName)) { - deserializedImportDevicesRequest.outputBlobName = reader.getString(); - } else if ("authenticationType".equals(fieldName)) { - deserializedImportDevicesRequest.authenticationType - = AuthenticationType.fromString(reader.getString()); - } else if ("identity".equals(fieldName)) { - deserializedImportDevicesRequest.identity = ManagedIdentity.fromJson(reader); - } else if ("includeConfigurations".equals(fieldName)) { - deserializedImportDevicesRequest.includeConfigurations = reader.getNullable(JsonReader::getBoolean); - } else if ("configurationsBlobName".equals(fieldName)) { - deserializedImportDevicesRequest.configurationsBlobName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedImportDevicesRequest; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubCapacity.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubCapacity.java deleted file mode 100644 index 954e5e584052..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubCapacity.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * IoT Hub capacity information. - */ -@Immutable -public final class IotHubCapacity implements JsonSerializable { - /* - * The minimum number of units. - */ - private Long minimum; - - /* - * The maximum number of units. - */ - private Long maximum; - - /* - * The default number of units. - */ - private Long defaultProperty; - - /* - * The type of the scaling enabled. - */ - private IotHubScaleType scaleType; - - /** - * Creates an instance of IotHubCapacity class. - */ - private IotHubCapacity() { - } - - /** - * Get the minimum property: The minimum number of units. - * - * @return the minimum value. - */ - public Long minimum() { - return this.minimum; - } - - /** - * Get the maximum property: The maximum number of units. - * - * @return the maximum value. - */ - public Long maximum() { - return this.maximum; - } - - /** - * Get the defaultProperty property: The default number of units. - * - * @return the defaultProperty value. - */ - public Long defaultProperty() { - return this.defaultProperty; - } - - /** - * Get the scaleType property: The type of the scaling enabled. - * - * @return the scaleType value. - */ - public IotHubScaleType scaleType() { - return this.scaleType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IotHubCapacity from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IotHubCapacity 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 IotHubCapacity. - */ - public static IotHubCapacity fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IotHubCapacity deserializedIotHubCapacity = new IotHubCapacity(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("minimum".equals(fieldName)) { - deserializedIotHubCapacity.minimum = reader.getNullable(JsonReader::getLong); - } else if ("maximum".equals(fieldName)) { - deserializedIotHubCapacity.maximum = reader.getNullable(JsonReader::getLong); - } else if ("default".equals(fieldName)) { - deserializedIotHubCapacity.defaultProperty = reader.getNullable(JsonReader::getLong); - } else if ("scaleType".equals(fieldName)) { - deserializedIotHubCapacity.scaleType = IotHubScaleType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedIotHubCapacity; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubDescription.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubDescription.java deleted file mode 100644 index 8338e0d9bee2..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubDescription.java +++ /dev/null @@ -1,437 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.iothub.fluent.models.IotHubDescriptionInner; -import java.util.Map; - -/** - * An immutable client-side representation of IotHubDescription. - */ -public interface IotHubDescription { - /** - * 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 location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the properties property: IotHub properties. - * - * @return the properties value. - */ - IotHubProperties properties(); - - /** - * Gets the etag property: The Etag field is *not* required. If it is provided in the response body, it must also be - * provided as a header per the normal ETag convention. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the sku property: IotHub SKU info. - * - * @return the sku value. - */ - IotHubSkuInfo sku(); - - /** - * Gets the identity property: The managed identities for the IotHub. - * - * @return the identity value. - */ - ArmIdentity identity(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.iothub.fluent.models.IotHubDescriptionInner object. - * - * @return the inner object. - */ - IotHubDescriptionInner innerModel(); - - /** - * The entirety of the IotHubDescription definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, DefinitionStages.WithSku, DefinitionStages.WithCreate { - } - - /** - * The IotHubDescription definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the IotHubDescription definition. - */ - interface Blank extends WithLocation { - } - - /** - * The stage of the IotHubDescription definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(String location); - } - - /** - * The stage of the IotHubDescription definition allowing to specify parent resource. - */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @return the next definition stage. - */ - WithSku withExistingResourceGroup(String resourceGroupName); - } - - /** - * The stage of the IotHubDescription definition allowing to specify sku. - */ - interface WithSku { - /** - * Specifies the sku property: IotHub SKU info. - * - * @param sku IotHub SKU info. - * @return the next definition stage. - */ - WithCreate withSku(IotHubSkuInfo sku); - } - - /** - * The stage of the IotHubDescription 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.WithTags, DefinitionStages.WithProperties, - DefinitionStages.WithEtag, DefinitionStages.WithIdentity, DefinitionStages.WithIfMatch { - /** - * Executes the create request. - * - * @return the created resource. - */ - IotHubDescription create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - IotHubDescription create(Context context); - } - - /** - * The stage of the IotHubDescription definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the IotHubDescription definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: IotHub properties. - * - * @param properties IotHub properties. - * @return the next definition stage. - */ - WithCreate withProperties(IotHubProperties properties); - } - - /** - * The stage of the IotHubDescription definition allowing to specify etag. - */ - interface WithEtag { - /** - * Specifies the etag property: The Etag field is *not* required. If it is provided in the response body, it - * must also be provided as a header per the normal ETag convention.. - * - * @param etag The Etag field is *not* required. If it is provided in the response body, it must also be - * provided as a header per the normal ETag convention. - * @return the next definition stage. - */ - WithCreate withEtag(String etag); - } - - /** - * The stage of the IotHubDescription definition allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: The managed identities for the IotHub.. - * - * @param identity The managed identities for the IotHub. - * @return the next definition stage. - */ - WithCreate withIdentity(ArmIdentity identity); - } - - /** - * The stage of the IotHubDescription definition allowing to specify ifMatch. - */ - interface WithIfMatch { - /** - * Specifies the ifMatch property: ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. - * Required to update an existing IoT Hub.. - * - * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update - * an existing IoT Hub. - * @return the next definition stage. - */ - WithCreate withIfMatch(String ifMatch); - } - } - - /** - * Begins update for the IotHubDescription resource. - * - * @return the stage of resource update. - */ - IotHubDescription.Update update(); - - /** - * The template for IotHubDescription update. - */ - interface Update extends UpdateStages.WithTags { - /** - * Executes the update request. - * - * @return the updated resource. - */ - IotHubDescription apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - IotHubDescription apply(Context context); - } - - /** - * The IotHubDescription update stages. - */ - interface UpdateStages { - /** - * The stage of the IotHubDescription update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - IotHubDescription refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - IotHubDescription refresh(Context context); - - /** - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security metadata for an IoT hub as paginated response with {@link PagedIterable}. - */ - PagedIterable listKeys(); - - /** - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security metadata for an IoT hub as paginated response with {@link PagedIterable}. - */ - PagedIterable listKeys(Context context); - - /** - * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more - * information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities - * - * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more - * information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * - * @param exportDevicesParameters The parameters that specify the export devices operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object along with {@link Response}. - */ - Response exportDevicesWithResponse(ExportDevicesRequest exportDevicesParameters, Context context); - - /** - * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more - * information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities - * - * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more - * information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * - * @param exportDevicesParameters The parameters that specify the export devices operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object. - */ - JobResponse exportDevices(ExportDevicesRequest exportDevicesParameters); - - /** - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, - * see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities - * - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, - * see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * - * @param importDevicesParameters The parameters that specify the import devices operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object along with {@link Response}. - */ - Response importDevicesWithResponse(ImportDevicesRequest importDevicesParameters, Context context); - - /** - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, - * see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities - * - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, - * see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * - * @param importDevicesParameters The parameters that specify the import devices operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object. - */ - JobResponse importDevices(ImportDevicesRequest importDevicesParameters); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubLocationDescription.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubLocationDescription.java deleted file mode 100644 index 2a94ad0d9f3a..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubLocationDescription.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Public representation of one of the locations where a resource is provisioned. - */ -@Immutable -public final class IotHubLocationDescription implements JsonSerializable { - /* - * The name of the Azure region - */ - private String location; - - /* - * The role of the region, can be either primary or secondary. The primary region is where the IoT hub is currently - * provisioned. The secondary region is the Azure disaster recovery (DR) paired region and also the region where the - * IoT hub can failover to. - */ - private IotHubReplicaRoleType role; - - /** - * Creates an instance of IotHubLocationDescription class. - */ - private IotHubLocationDescription() { - } - - /** - * Get the location property: The name of the Azure region. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the role property: The role of the region, can be either primary or secondary. The primary region is where - * the IoT hub is currently provisioned. The secondary region is the Azure disaster recovery (DR) paired region and - * also the region where the IoT hub can failover to. - * - * @return the role value. - */ - public IotHubReplicaRoleType role() { - return this.role; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IotHubLocationDescription from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IotHubLocationDescription 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 IotHubLocationDescription. - */ - public static IotHubLocationDescription fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IotHubLocationDescription deserializedIotHubLocationDescription = new IotHubLocationDescription(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("location".equals(fieldName)) { - deserializedIotHubLocationDescription.location = reader.getString(); - } else if ("role".equals(fieldName)) { - deserializedIotHubLocationDescription.role = IotHubReplicaRoleType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedIotHubLocationDescription; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubNameAvailabilityInfo.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubNameAvailabilityInfo.java deleted file mode 100644 index d07dc12bcb3a..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubNameAvailabilityInfo.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.resourcemanager.iothub.fluent.models.IotHubNameAvailabilityInfoInner; - -/** - * An immutable client-side representation of IotHubNameAvailabilityInfo. - */ -public interface IotHubNameAvailabilityInfo { - /** - * Gets the nameAvailable property: The value which indicates whether the provided name is available. - * - * @return the nameAvailable value. - */ - Boolean nameAvailable(); - - /** - * Gets the reason property: The reason for unavailability. - * - * @return the reason value. - */ - IotHubNameUnavailabilityReason reason(); - - /** - * Gets the message property: The detailed reason message. - * - * @return the message value. - */ - String message(); - - /** - * Gets the inner com.azure.resourcemanager.iothub.fluent.models.IotHubNameAvailabilityInfoInner object. - * - * @return the inner object. - */ - IotHubNameAvailabilityInfoInner innerModel(); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubNameUnavailabilityReason.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubNameUnavailabilityReason.java deleted file mode 100644 index 6215199764f0..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubNameUnavailabilityReason.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -/** - * The reason for unavailability. - */ -public enum IotHubNameUnavailabilityReason { - /** - * Invalid. - */ - INVALID("Invalid"), - - /** - * AlreadyExists. - */ - ALREADY_EXISTS("AlreadyExists"); - - /** - * The actual serialized value for a IotHubNameUnavailabilityReason instance. - */ - private final String value; - - IotHubNameUnavailabilityReason(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a IotHubNameUnavailabilityReason instance. - * - * @param value the serialized value to parse. - * @return the parsed IotHubNameUnavailabilityReason object, or null if unable to parse. - */ - public static IotHubNameUnavailabilityReason fromString(String value) { - if (value == null) { - return null; - } - IotHubNameUnavailabilityReason[] items = IotHubNameUnavailabilityReason.values(); - for (IotHubNameUnavailabilityReason item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubProperties.java deleted file mode 100644 index 3b744a35072d..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubProperties.java +++ /dev/null @@ -1,882 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.iothub.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.iothub.fluent.models.SharedAccessSignatureAuthorizationRuleInner; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * The properties of an IoT hub. - */ -@Fluent -public final class IotHubProperties implements JsonSerializable { - /* - * The shared access policies you can use to secure a connection to the IoT hub. - */ - private List authorizationPolicies; - - /* - * If true, SAS tokens with Iot hub scoped SAS keys cannot be used for authentication. - */ - private Boolean disableLocalAuth; - - /* - * If true, all device(including Edge devices but excluding modules) scoped SAS keys cannot be used for - * authentication. - */ - private Boolean disableDeviceSas; - - /* - * If true, all module scoped SAS keys cannot be used for authentication. - */ - private Boolean disableModuleSas; - - /* - * If true, egress from IotHub will be restricted to only the allowed FQDNs that are configured via allowedFqdnList. - */ - private Boolean restrictOutboundNetworkAccess; - - /* - * List of allowed FQDNs(Fully Qualified Domain Name) for egress from Iot Hub. - */ - private List allowedFqdnList; - - /* - * Whether requests from Public Network are allowed - */ - private PublicNetworkAccess publicNetworkAccess; - - /* - * The IP filter rules. - */ - private List ipFilterRules; - - /* - * Network Rule Set Properties of IotHub - */ - private NetworkRuleSetProperties networkRuleSets; - - /* - * Specifies the minimum TLS version to support for this hub. Can be set to "1.2" to have clients that use a TLS - * version below 1.2 to be rejected. - */ - private String minTlsVersion; - - /* - * Private endpoint connections created on this IotHub - */ - private List privateEndpointConnections; - - /* - * The provisioning state. - */ - private String provisioningState; - - /* - * The hub state. - */ - private String state; - - /* - * The name of the host. - */ - private String hostname; - - /* - * The Event Hub-compatible endpoint properties. The only possible keys to this dictionary is events. This key has - * to be present in the dictionary while making create or update calls for the IoT hub. - */ - private Map eventHubEndpoints; - - /* - * The routing related properties of the IoT hub. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging - */ - private RoutingProperties routing; - - /* - * The list of Azure Storage endpoints where you can upload files. Currently you can configure only one Azure - * Storage account and that MUST have its key as $default. Specifying more than one storage account causes an error - * to be thrown. Not specifying a value for this property when the enableFileUploadNotifications property is set to - * True, causes an error to be thrown. - */ - private Map storageEndpoints; - - /* - * The messaging endpoint properties for the file upload notification queue. - */ - private Map messagingEndpoints; - - /* - * If True, file upload notifications are enabled. - */ - private Boolean enableFileUploadNotifications; - - /* - * The IoT hub cloud-to-device messaging properties. - */ - private CloudToDeviceProperties cloudToDevice; - - /* - * IoT hub comments. - */ - private String comments; - - /* - * The device streams properties of iothub. - */ - private IotHubPropertiesDeviceStreams deviceStreams; - - /* - * The capabilities and features enabled for the IoT hub. - */ - private Capabilities features; - - /* - * The encryption properties for the IoT hub. - */ - private EncryptionPropertiesDescription encryption; - - /* - * Primary and secondary location for iot hub - */ - private List locations; - - /* - * This property when set to true, will enable data residency, thus, disabling disaster recovery. - */ - private Boolean enableDataResidency; - - /* - * This property store root certificate related information - */ - private RootCertificateProperties rootCertificate; - - /* - * This property specifies the IP Version the hub is currently utilizing. - */ - private IpVersion ipVersion; - - /* - * Represents properties related to the Azure Device Registry (ADR). - */ - private DeviceRegistry deviceRegistry; - - /** - * Creates an instance of IotHubProperties class. - */ - public IotHubProperties() { - } - - /** - * Get the authorizationPolicies property: The shared access policies you can use to secure a connection to the IoT - * hub. - * - * @return the authorizationPolicies value. - */ - public List authorizationPolicies() { - return this.authorizationPolicies; - } - - /** - * Set the authorizationPolicies property: The shared access policies you can use to secure a connection to the IoT - * hub. - * - * @param authorizationPolicies the authorizationPolicies value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties - withAuthorizationPolicies(List authorizationPolicies) { - this.authorizationPolicies = authorizationPolicies; - return this; - } - - /** - * Get the disableLocalAuth property: If true, SAS tokens with Iot hub scoped SAS keys cannot be used for - * authentication. - * - * @return the disableLocalAuth value. - */ - public Boolean disableLocalAuth() { - return this.disableLocalAuth; - } - - /** - * Set the disableLocalAuth property: If true, SAS tokens with Iot hub scoped SAS keys cannot be used for - * authentication. - * - * @param disableLocalAuth the disableLocalAuth value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withDisableLocalAuth(Boolean disableLocalAuth) { - this.disableLocalAuth = disableLocalAuth; - return this; - } - - /** - * Get the disableDeviceSas property: If true, all device(including Edge devices but excluding modules) scoped SAS - * keys cannot be used for authentication. - * - * @return the disableDeviceSas value. - */ - public Boolean disableDeviceSas() { - return this.disableDeviceSas; - } - - /** - * Set the disableDeviceSas property: If true, all device(including Edge devices but excluding modules) scoped SAS - * keys cannot be used for authentication. - * - * @param disableDeviceSas the disableDeviceSas value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withDisableDeviceSas(Boolean disableDeviceSas) { - this.disableDeviceSas = disableDeviceSas; - return this; - } - - /** - * Get the disableModuleSas property: If true, all module scoped SAS keys cannot be used for authentication. - * - * @return the disableModuleSas value. - */ - public Boolean disableModuleSas() { - return this.disableModuleSas; - } - - /** - * Set the disableModuleSas property: If true, all module scoped SAS keys cannot be used for authentication. - * - * @param disableModuleSas the disableModuleSas value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withDisableModuleSas(Boolean disableModuleSas) { - this.disableModuleSas = disableModuleSas; - return this; - } - - /** - * Get the restrictOutboundNetworkAccess property: If true, egress from IotHub will be restricted to only the - * allowed FQDNs that are configured via allowedFqdnList. - * - * @return the restrictOutboundNetworkAccess value. - */ - public Boolean restrictOutboundNetworkAccess() { - return this.restrictOutboundNetworkAccess; - } - - /** - * Set the restrictOutboundNetworkAccess property: If true, egress from IotHub will be restricted to only the - * allowed FQDNs that are configured via allowedFqdnList. - * - * @param restrictOutboundNetworkAccess the restrictOutboundNetworkAccess value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withRestrictOutboundNetworkAccess(Boolean restrictOutboundNetworkAccess) { - this.restrictOutboundNetworkAccess = restrictOutboundNetworkAccess; - return this; - } - - /** - * Get the allowedFqdnList property: List of allowed FQDNs(Fully Qualified Domain Name) for egress from Iot Hub. - * - * @return the allowedFqdnList value. - */ - public List allowedFqdnList() { - return this.allowedFqdnList; - } - - /** - * Set the allowedFqdnList property: List of allowed FQDNs(Fully Qualified Domain Name) for egress from Iot Hub. - * - * @param allowedFqdnList the allowedFqdnList value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withAllowedFqdnList(List allowedFqdnList) { - this.allowedFqdnList = allowedFqdnList; - return this; - } - - /** - * Get the publicNetworkAccess property: Whether requests from Public Network are allowed. - * - * @return the publicNetworkAccess value. - */ - public PublicNetworkAccess publicNetworkAccess() { - return this.publicNetworkAccess; - } - - /** - * Set the publicNetworkAccess property: Whether requests from Public Network are allowed. - * - * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { - this.publicNetworkAccess = publicNetworkAccess; - return this; - } - - /** - * Get the ipFilterRules property: The IP filter rules. - * - * @return the ipFilterRules value. - */ - public List ipFilterRules() { - return this.ipFilterRules; - } - - /** - * Set the ipFilterRules property: The IP filter rules. - * - * @param ipFilterRules the ipFilterRules value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withIpFilterRules(List ipFilterRules) { - this.ipFilterRules = ipFilterRules; - return this; - } - - /** - * Get the networkRuleSets property: Network Rule Set Properties of IotHub. - * - * @return the networkRuleSets value. - */ - public NetworkRuleSetProperties networkRuleSets() { - return this.networkRuleSets; - } - - /** - * Set the networkRuleSets property: Network Rule Set Properties of IotHub. - * - * @param networkRuleSets the networkRuleSets value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withNetworkRuleSets(NetworkRuleSetProperties networkRuleSets) { - this.networkRuleSets = networkRuleSets; - return this; - } - - /** - * Get the minTlsVersion property: Specifies the minimum TLS version to support for this hub. Can be set to "1.2" to - * have clients that use a TLS version below 1.2 to be rejected. - * - * @return the minTlsVersion value. - */ - public String minTlsVersion() { - return this.minTlsVersion; - } - - /** - * Set the minTlsVersion property: Specifies the minimum TLS version to support for this hub. Can be set to "1.2" to - * have clients that use a TLS version below 1.2 to be rejected. - * - * @param minTlsVersion the minTlsVersion value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withMinTlsVersion(String minTlsVersion) { - this.minTlsVersion = minTlsVersion; - return this; - } - - /** - * Get the privateEndpointConnections property: Private endpoint connections created on this IotHub. - * - * @return the privateEndpointConnections value. - */ - public List privateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** - * Set the privateEndpointConnections property: Private endpoint connections created on this IotHub. - * - * @param privateEndpointConnections the privateEndpointConnections value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties - withPrivateEndpointConnections(List privateEndpointConnections) { - this.privateEndpointConnections = privateEndpointConnections; - return this; - } - - /** - * Get the provisioningState property: The provisioning state. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Get the state property: The hub state. - * - * @return the state value. - */ - public String state() { - return this.state; - } - - /** - * Get the hostname property: The name of the host. - * - * @return the hostname value. - */ - public String hostname() { - return this.hostname; - } - - /** - * Get the eventHubEndpoints property: The Event Hub-compatible endpoint properties. The only possible keys to this - * dictionary is events. This key has to be present in the dictionary while making create or update calls for the - * IoT hub. - * - * @return the eventHubEndpoints value. - */ - public Map eventHubEndpoints() { - return this.eventHubEndpoints; - } - - /** - * Set the eventHubEndpoints property: The Event Hub-compatible endpoint properties. The only possible keys to this - * dictionary is events. This key has to be present in the dictionary while making create or update calls for the - * IoT hub. - * - * @param eventHubEndpoints the eventHubEndpoints value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withEventHubEndpoints(Map eventHubEndpoints) { - this.eventHubEndpoints = eventHubEndpoints; - return this; - } - - /** - * Get the routing property: The routing related properties of the IoT hub. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging. - * - * @return the routing value. - */ - public RoutingProperties routing() { - return this.routing; - } - - /** - * Set the routing property: The routing related properties of the IoT hub. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging. - * - * @param routing the routing value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withRouting(RoutingProperties routing) { - this.routing = routing; - return this; - } - - /** - * Get the storageEndpoints property: The list of Azure Storage endpoints where you can upload files. Currently you - * can configure only one Azure Storage account and that MUST have its key as $default. Specifying more than one - * storage account causes an error to be thrown. Not specifying a value for this property when the - * enableFileUploadNotifications property is set to True, causes an error to be thrown. - * - * @return the storageEndpoints value. - */ - public Map storageEndpoints() { - return this.storageEndpoints; - } - - /** - * Set the storageEndpoints property: The list of Azure Storage endpoints where you can upload files. Currently you - * can configure only one Azure Storage account and that MUST have its key as $default. Specifying more than one - * storage account causes an error to be thrown. Not specifying a value for this property when the - * enableFileUploadNotifications property is set to True, causes an error to be thrown. - * - * @param storageEndpoints the storageEndpoints value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withStorageEndpoints(Map storageEndpoints) { - this.storageEndpoints = storageEndpoints; - return this; - } - - /** - * Get the messagingEndpoints property: The messaging endpoint properties for the file upload notification queue. - * - * @return the messagingEndpoints value. - */ - public Map messagingEndpoints() { - return this.messagingEndpoints; - } - - /** - * Set the messagingEndpoints property: The messaging endpoint properties for the file upload notification queue. - * - * @param messagingEndpoints the messagingEndpoints value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withMessagingEndpoints(Map messagingEndpoints) { - this.messagingEndpoints = messagingEndpoints; - return this; - } - - /** - * Get the enableFileUploadNotifications property: If True, file upload notifications are enabled. - * - * @return the enableFileUploadNotifications value. - */ - public Boolean enableFileUploadNotifications() { - return this.enableFileUploadNotifications; - } - - /** - * Set the enableFileUploadNotifications property: If True, file upload notifications are enabled. - * - * @param enableFileUploadNotifications the enableFileUploadNotifications value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withEnableFileUploadNotifications(Boolean enableFileUploadNotifications) { - this.enableFileUploadNotifications = enableFileUploadNotifications; - return this; - } - - /** - * Get the cloudToDevice property: The IoT hub cloud-to-device messaging properties. - * - * @return the cloudToDevice value. - */ - public CloudToDeviceProperties cloudToDevice() { - return this.cloudToDevice; - } - - /** - * Set the cloudToDevice property: The IoT hub cloud-to-device messaging properties. - * - * @param cloudToDevice the cloudToDevice value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withCloudToDevice(CloudToDeviceProperties cloudToDevice) { - this.cloudToDevice = cloudToDevice; - return this; - } - - /** - * Get the comments property: IoT hub comments. - * - * @return the comments value. - */ - public String comments() { - return this.comments; - } - - /** - * Set the comments property: IoT hub comments. - * - * @param comments the comments value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withComments(String comments) { - this.comments = comments; - return this; - } - - /** - * Get the deviceStreams property: The device streams properties of iothub. - * - * @return the deviceStreams value. - */ - public IotHubPropertiesDeviceStreams deviceStreams() { - return this.deviceStreams; - } - - /** - * Set the deviceStreams property: The device streams properties of iothub. - * - * @param deviceStreams the deviceStreams value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withDeviceStreams(IotHubPropertiesDeviceStreams deviceStreams) { - this.deviceStreams = deviceStreams; - return this; - } - - /** - * Get the features property: The capabilities and features enabled for the IoT hub. - * - * @return the features value. - */ - public Capabilities features() { - return this.features; - } - - /** - * Set the features property: The capabilities and features enabled for the IoT hub. - * - * @param features the features value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withFeatures(Capabilities features) { - this.features = features; - return this; - } - - /** - * Get the encryption property: The encryption properties for the IoT hub. - * - * @return the encryption value. - */ - public EncryptionPropertiesDescription encryption() { - return this.encryption; - } - - /** - * Set the encryption property: The encryption properties for the IoT hub. - * - * @param encryption the encryption value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withEncryption(EncryptionPropertiesDescription encryption) { - this.encryption = encryption; - return this; - } - - /** - * Get the locations property: Primary and secondary location for iot hub. - * - * @return the locations value. - */ - public List locations() { - return this.locations; - } - - /** - * Get the enableDataResidency property: This property when set to true, will enable data residency, thus, disabling - * disaster recovery. - * - * @return the enableDataResidency value. - */ - public Boolean enableDataResidency() { - return this.enableDataResidency; - } - - /** - * Set the enableDataResidency property: This property when set to true, will enable data residency, thus, disabling - * disaster recovery. - * - * @param enableDataResidency the enableDataResidency value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withEnableDataResidency(Boolean enableDataResidency) { - this.enableDataResidency = enableDataResidency; - return this; - } - - /** - * Get the rootCertificate property: This property store root certificate related information. - * - * @return the rootCertificate value. - */ - public RootCertificateProperties rootCertificate() { - return this.rootCertificate; - } - - /** - * Set the rootCertificate property: This property store root certificate related information. - * - * @param rootCertificate the rootCertificate value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withRootCertificate(RootCertificateProperties rootCertificate) { - this.rootCertificate = rootCertificate; - return this; - } - - /** - * Get the ipVersion property: This property specifies the IP Version the hub is currently utilizing. - * - * @return the ipVersion value. - */ - public IpVersion ipVersion() { - return this.ipVersion; - } - - /** - * Set the ipVersion property: This property specifies the IP Version the hub is currently utilizing. - * - * @param ipVersion the ipVersion value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withIpVersion(IpVersion ipVersion) { - this.ipVersion = ipVersion; - return this; - } - - /** - * Get the deviceRegistry property: Represents properties related to the Azure Device Registry (ADR). - * - * @return the deviceRegistry value. - */ - public DeviceRegistry deviceRegistry() { - return this.deviceRegistry; - } - - /** - * Set the deviceRegistry property: Represents properties related to the Azure Device Registry (ADR). - * - * @param deviceRegistry the deviceRegistry value to set. - * @return the IotHubProperties object itself. - */ - public IotHubProperties withDeviceRegistry(DeviceRegistry deviceRegistry) { - this.deviceRegistry = deviceRegistry; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("authorizationPolicies", this.authorizationPolicies, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeBooleanField("disableLocalAuth", this.disableLocalAuth); - jsonWriter.writeBooleanField("disableDeviceSAS", this.disableDeviceSas); - jsonWriter.writeBooleanField("disableModuleSAS", this.disableModuleSas); - jsonWriter.writeBooleanField("restrictOutboundNetworkAccess", this.restrictOutboundNetworkAccess); - jsonWriter.writeArrayField("allowedFqdnList", this.allowedFqdnList, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("publicNetworkAccess", - this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); - jsonWriter.writeArrayField("ipFilterRules", this.ipFilterRules, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("networkRuleSets", this.networkRuleSets); - jsonWriter.writeStringField("minTlsVersion", this.minTlsVersion); - jsonWriter.writeArrayField("privateEndpointConnections", this.privateEndpointConnections, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeMapField("eventHubEndpoints", this.eventHubEndpoints, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("routing", this.routing); - jsonWriter.writeMapField("storageEndpoints", this.storageEndpoints, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeMapField("messagingEndpoints", this.messagingEndpoints, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeBooleanField("enableFileUploadNotifications", this.enableFileUploadNotifications); - jsonWriter.writeJsonField("cloudToDevice", this.cloudToDevice); - jsonWriter.writeStringField("comments", this.comments); - jsonWriter.writeJsonField("deviceStreams", this.deviceStreams); - jsonWriter.writeStringField("features", this.features == null ? null : this.features.toString()); - jsonWriter.writeJsonField("encryption", this.encryption); - jsonWriter.writeBooleanField("enableDataResidency", this.enableDataResidency); - jsonWriter.writeJsonField("rootCertificate", this.rootCertificate); - jsonWriter.writeStringField("ipVersion", this.ipVersion == null ? null : this.ipVersion.toString()); - jsonWriter.writeJsonField("deviceRegistry", this.deviceRegistry); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IotHubProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IotHubProperties 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 IotHubProperties. - */ - public static IotHubProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IotHubProperties deserializedIotHubProperties = new IotHubProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("authorizationPolicies".equals(fieldName)) { - List authorizationPolicies - = reader.readArray(reader1 -> SharedAccessSignatureAuthorizationRuleInner.fromJson(reader1)); - deserializedIotHubProperties.authorizationPolicies = authorizationPolicies; - } else if ("disableLocalAuth".equals(fieldName)) { - deserializedIotHubProperties.disableLocalAuth = reader.getNullable(JsonReader::getBoolean); - } else if ("disableDeviceSAS".equals(fieldName)) { - deserializedIotHubProperties.disableDeviceSas = reader.getNullable(JsonReader::getBoolean); - } else if ("disableModuleSAS".equals(fieldName)) { - deserializedIotHubProperties.disableModuleSas = reader.getNullable(JsonReader::getBoolean); - } else if ("restrictOutboundNetworkAccess".equals(fieldName)) { - deserializedIotHubProperties.restrictOutboundNetworkAccess - = reader.getNullable(JsonReader::getBoolean); - } else if ("allowedFqdnList".equals(fieldName)) { - List allowedFqdnList = reader.readArray(reader1 -> reader1.getString()); - deserializedIotHubProperties.allowedFqdnList = allowedFqdnList; - } else if ("publicNetworkAccess".equals(fieldName)) { - deserializedIotHubProperties.publicNetworkAccess - = PublicNetworkAccess.fromString(reader.getString()); - } else if ("ipFilterRules".equals(fieldName)) { - List ipFilterRules = reader.readArray(reader1 -> IpFilterRule.fromJson(reader1)); - deserializedIotHubProperties.ipFilterRules = ipFilterRules; - } else if ("networkRuleSets".equals(fieldName)) { - deserializedIotHubProperties.networkRuleSets = NetworkRuleSetProperties.fromJson(reader); - } else if ("minTlsVersion".equals(fieldName)) { - deserializedIotHubProperties.minTlsVersion = reader.getString(); - } else if ("privateEndpointConnections".equals(fieldName)) { - List privateEndpointConnections - = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); - deserializedIotHubProperties.privateEndpointConnections = privateEndpointConnections; - } else if ("provisioningState".equals(fieldName)) { - deserializedIotHubProperties.provisioningState = reader.getString(); - } else if ("state".equals(fieldName)) { - deserializedIotHubProperties.state = reader.getString(); - } else if ("hostName".equals(fieldName)) { - deserializedIotHubProperties.hostname = reader.getString(); - } else if ("eventHubEndpoints".equals(fieldName)) { - Map eventHubEndpoints - = reader.readMap(reader1 -> EventHubProperties.fromJson(reader1)); - deserializedIotHubProperties.eventHubEndpoints = eventHubEndpoints; - } else if ("routing".equals(fieldName)) { - deserializedIotHubProperties.routing = RoutingProperties.fromJson(reader); - } else if ("storageEndpoints".equals(fieldName)) { - Map storageEndpoints - = reader.readMap(reader1 -> StorageEndpointProperties.fromJson(reader1)); - deserializedIotHubProperties.storageEndpoints = storageEndpoints; - } else if ("messagingEndpoints".equals(fieldName)) { - Map messagingEndpoints - = reader.readMap(reader1 -> MessagingEndpointProperties.fromJson(reader1)); - deserializedIotHubProperties.messagingEndpoints = messagingEndpoints; - } else if ("enableFileUploadNotifications".equals(fieldName)) { - deserializedIotHubProperties.enableFileUploadNotifications - = reader.getNullable(JsonReader::getBoolean); - } else if ("cloudToDevice".equals(fieldName)) { - deserializedIotHubProperties.cloudToDevice = CloudToDeviceProperties.fromJson(reader); - } else if ("comments".equals(fieldName)) { - deserializedIotHubProperties.comments = reader.getString(); - } else if ("deviceStreams".equals(fieldName)) { - deserializedIotHubProperties.deviceStreams = IotHubPropertiesDeviceStreams.fromJson(reader); - } else if ("features".equals(fieldName)) { - deserializedIotHubProperties.features = Capabilities.fromString(reader.getString()); - } else if ("encryption".equals(fieldName)) { - deserializedIotHubProperties.encryption = EncryptionPropertiesDescription.fromJson(reader); - } else if ("locations".equals(fieldName)) { - List locations - = reader.readArray(reader1 -> IotHubLocationDescription.fromJson(reader1)); - deserializedIotHubProperties.locations = locations; - } else if ("enableDataResidency".equals(fieldName)) { - deserializedIotHubProperties.enableDataResidency = reader.getNullable(JsonReader::getBoolean); - } else if ("rootCertificate".equals(fieldName)) { - deserializedIotHubProperties.rootCertificate = RootCertificateProperties.fromJson(reader); - } else if ("ipVersion".equals(fieldName)) { - deserializedIotHubProperties.ipVersion = IpVersion.fromString(reader.getString()); - } else if ("deviceRegistry".equals(fieldName)) { - deserializedIotHubProperties.deviceRegistry = DeviceRegistry.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedIotHubProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubPropertiesDeviceStreams.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubPropertiesDeviceStreams.java deleted file mode 100644 index 002032ba2044..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubPropertiesDeviceStreams.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * The device streams properties of iothub. - */ -@Fluent -public final class IotHubPropertiesDeviceStreams implements JsonSerializable { - /* - * List of Device Streams Endpoints. - */ - private List streamingEndpoints; - - /** - * Creates an instance of IotHubPropertiesDeviceStreams class. - */ - public IotHubPropertiesDeviceStreams() { - } - - /** - * Get the streamingEndpoints property: List of Device Streams Endpoints. - * - * @return the streamingEndpoints value. - */ - public List streamingEndpoints() { - return this.streamingEndpoints; - } - - /** - * Set the streamingEndpoints property: List of Device Streams Endpoints. - * - * @param streamingEndpoints the streamingEndpoints value to set. - * @return the IotHubPropertiesDeviceStreams object itself. - */ - public IotHubPropertiesDeviceStreams withStreamingEndpoints(List streamingEndpoints) { - this.streamingEndpoints = streamingEndpoints; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("streamingEndpoints", this.streamingEndpoints, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IotHubPropertiesDeviceStreams from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IotHubPropertiesDeviceStreams 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 IotHubPropertiesDeviceStreams. - */ - public static IotHubPropertiesDeviceStreams fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IotHubPropertiesDeviceStreams deserializedIotHubPropertiesDeviceStreams - = new IotHubPropertiesDeviceStreams(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("streamingEndpoints".equals(fieldName)) { - List streamingEndpoints = reader.readArray(reader1 -> reader1.getString()); - deserializedIotHubPropertiesDeviceStreams.streamingEndpoints = streamingEndpoints; - } else { - reader.skipChildren(); - } - } - - return deserializedIotHubPropertiesDeviceStreams; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubQuotaMetricInfo.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubQuotaMetricInfo.java deleted file mode 100644 index 895a2e13a5ba..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubQuotaMetricInfo.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.resourcemanager.iothub.fluent.models.IotHubQuotaMetricInfoInner; - -/** - * An immutable client-side representation of IotHubQuotaMetricInfo. - */ -public interface IotHubQuotaMetricInfo { - /** - * Gets the name property: The name of the quota metric. - * - * @return the name value. - */ - String name(); - - /** - * Gets the currentValue property: The current value for the quota metric. - * - * @return the currentValue value. - */ - Long currentValue(); - - /** - * Gets the maxValue property: The maximum value of the quota metric. - * - * @return the maxValue value. - */ - Long maxValue(); - - /** - * Gets the inner com.azure.resourcemanager.iothub.fluent.models.IotHubQuotaMetricInfoInner object. - * - * @return the inner object. - */ - IotHubQuotaMetricInfoInner innerModel(); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubReplicaRoleType.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubReplicaRoleType.java deleted file mode 100644 index 1aaa152874f7..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubReplicaRoleType.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The role of the region, can be either primary or secondary. The primary region is where the IoT hub is currently - * provisioned. The secondary region is the Azure disaster recovery (DR) paired region and also the region where the IoT - * hub can failover to. - */ -public final class IotHubReplicaRoleType extends ExpandableStringEnum { - /** - * primary. - */ - public static final IotHubReplicaRoleType PRIMARY = fromString("primary"); - - /** - * secondary. - */ - public static final IotHubReplicaRoleType SECONDARY = fromString("secondary"); - - /** - * Creates a new instance of IotHubReplicaRoleType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public IotHubReplicaRoleType() { - } - - /** - * Creates or finds a IotHubReplicaRoleType from its string representation. - * - * @param name a name to look for. - * @return the corresponding IotHubReplicaRoleType. - */ - public static IotHubReplicaRoleType fromString(String name) { - return fromString(name, IotHubReplicaRoleType.class); - } - - /** - * Gets known IotHubReplicaRoleType values. - * - * @return known IotHubReplicaRoleType values. - */ - public static Collection values() { - return values(IotHubReplicaRoleType.class); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubResources.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubResources.java deleted file mode 100644 index c6293b79b292..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubResources.java +++ /dev/null @@ -1,881 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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 IotHubResources. - */ -public interface IotHubResources { - /** - * Get the non-security related metadata of an IoT hub - * - * Get the non-security related metadata of an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the non-security related metadata of an IoT hub - * - * Get the non-security related metadata of an IoT hub along with {@link Response}. - */ - Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, - Context context); - - /** - * Get the non-security related metadata of an IoT hub - * - * Get the non-security related metadata of an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the non-security related metadata of an IoT hub - * - * Get the non-security related metadata of an IoT hub. - */ - IotHubDescription getByResourceGroup(String resourceGroupName, String resourceName); - - /** - * Delete an IoT hub - * - * Delete an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by server - * on status code 404. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String resourceGroupName, String resourceName); - - /** - * Delete an IoT hub - * - * Delete an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by server - * on status code 404. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String resourceName, Context context); - - /** - * Get all the IoT hubs in a resource group - * - * Get all the IoT hubs in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 IoT hubs in a resource group - * - * Get all the IoT hubs in a resource group as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Get all the IoT hubs in a resource group - * - * Get all the IoT hubs 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 com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 IoT hubs in a resource group - * - * Get all the IoT hubs in a resource group as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Get all the IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription. - * - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Get all the IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 IoT hubs in a subscription - * - * Get all the IoT hubs in a subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Get the list of valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub as paginated response with {@link PagedIterable}. - */ - PagedIterable getValidSkus(String resourceGroupName, String resourceName); - - /** - * Get the list of valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 valid SKUs for an IoT hub - * - * Get the list of valid SKUs for an IoT hub as paginated response with {@link PagedIterable}. - */ - PagedIterable getValidSkus(String resourceGroupName, String resourceName, Context context); - - /** - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 the jobs in an IoT hub as paginated response with {@link PagedIterable}. - */ - PagedIterable listJobs(String resourceGroupName, String resourceName); - - /** - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * - * Get a list of all the jobs in an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 the jobs in an IoT hub as paginated response with {@link PagedIterable}. - */ - PagedIterable listJobs(String resourceGroupName, String resourceName, Context context); - - /** - * Get the details of a job from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * - * Get the details of a job from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param jobId The job identifier. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a job from an IoT hub along with {@link Response}. - */ - Response getJobWithResponse(String resourceGroupName, String resourceName, String jobId, - Context context); - - /** - * Get the details of a job from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry - * - * Get the details of a job from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param jobId The job identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a job from an IoT hub. - */ - JobResponse getJob(String resourceGroupName, String resourceName, String jobId); - - /** - * Get the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub as paginated response with {@link PagedIterable}. - */ - PagedIterable getQuotaMetrics(String resourceGroupName, String resourceName); - - /** - * Get the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota metrics for an IoT hub - * - * Get the quota metrics for an IoT hub as paginated response with {@link PagedIterable}. - */ - PagedIterable getQuotaMetrics(String resourceGroupName, String resourceName, - Context context); - - /** - * Get the health for routing endpoints - * - * Get the health for routing endpoints. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param iotHubName The iotHubName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the health for routing endpoints - * - * Get the health for routing endpoints as paginated response with {@link PagedIterable}. - */ - PagedIterable getEndpointHealth(String resourceGroupName, String iotHubName); - - /** - * Get the health for routing endpoints - * - * Get the health for routing endpoints. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param iotHubName The iotHubName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the health for routing endpoints - * - * Get the health for routing endpoints as paginated response with {@link PagedIterable}. - */ - PagedIterable getEndpointHealth(String resourceGroupName, String iotHubName, Context context); - - /** - * Test all routes - * - * Test all routes configured in this Iot Hub. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param input Input for testing all routes. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 testing all routes along with {@link Response}. - */ - Response testAllRoutesWithResponse(String iotHubName, String resourceGroupName, - TestAllRoutesInput input, Context context); - - /** - * Test all routes - * - * Test all routes configured in this Iot Hub. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param input Input for testing all routes. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 testing all routes. - */ - TestAllRoutesResult testAllRoutes(String iotHubName, String resourceGroupName, TestAllRoutesInput input); - - /** - * Test the new route - * - * Test the new route for this Iot Hub. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param input Route that needs to be tested. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 testing one route along with {@link Response}. - */ - Response testRouteWithResponse(String iotHubName, String resourceGroupName, TestRouteInput input, - Context context); - - /** - * Test the new route - * - * Test the new route for this Iot Hub. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param input Route that needs to be tested. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 testing one route. - */ - TestRouteResult testRoute(String iotHubName, String resourceGroupName, TestRouteInput input); - - /** - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security metadata for an IoT hub as paginated response with {@link PagedIterable}. - */ - PagedIterable listKeys(String resourceGroupName, String resourceName); - - /** - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * Get the security metadata for an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security metadata for an IoT hub as paginated response with {@link PagedIterable}. - */ - PagedIterable listKeys(String resourceGroupName, String resourceName, - Context context); - - /** - * Get a shared access policy by name from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * Get a shared access policy by name from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param keyName The name of the shared access policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a shared access policy by name from an IoT hub along with {@link Response}. - */ - Response getKeysForKeyNameWithResponse(String resourceGroupName, - String resourceName, String keyName, Context context); - - /** - * Get a shared access policy by name from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security - * - * Get a shared access policy by name from an IoT hub. For more information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param keyName The name of the shared access policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a shared access policy by name from an IoT hub. - */ - SharedAccessSignatureAuthorizationRule getKeysForKeyName(String resourceGroupName, String resourceName, - String keyName); - - /** - * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more - * information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities - * - * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more - * information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param exportDevicesParameters The parameters that specify the export devices operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object along with {@link Response}. - */ - Response exportDevicesWithResponse(String resourceGroupName, String resourceName, - ExportDevicesRequest exportDevicesParameters, Context context); - - /** - * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more - * information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities - * - * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more - * information, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param exportDevicesParameters The parameters that specify the export devices operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object. - */ - JobResponse exportDevices(String resourceGroupName, String resourceName, - ExportDevicesRequest exportDevicesParameters); - - /** - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, - * see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities - * - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, - * see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param importDevicesParameters The parameters that specify the import devices operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object along with {@link Response}. - */ - Response importDevicesWithResponse(String resourceGroupName, String resourceName, - ImportDevicesRequest importDevicesParameters, Context context); - - /** - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, - * see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities - * - * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, - * see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param importDevicesParameters The parameters that specify the import devices operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object. - */ - JobResponse importDevices(String resourceGroupName, String resourceName, - ImportDevicesRequest importDevicesParameters); - - /** - * Get the statistics from an IoT hub - * - * Get the statistics from an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The resourceName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the statistics from an IoT hub - * - * Get the statistics from an IoT hub along with {@link Response}. - */ - Response getStatsWithResponse(String resourceGroupName, String resourceName, Context context); - - /** - * Get the statistics from an IoT hub - * - * Get the statistics from an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The resourceName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the statistics from an IoT hub - * - * Get the statistics from an IoT hub. - */ - RegistryStatistics getStats(String resourceGroupName, String resourceName); - - /** - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub - * - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub - * - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub along with - * {@link Response}. - */ - Response getEventHubConsumerGroupWithResponse(String resourceGroupName, - String resourceName, String eventHubEndpointName, String name, Context context); - - /** - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub - * - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub - * - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. - */ - EventHubConsumerGroupInfo getEventHubConsumerGroup(String resourceGroupName, String resourceName, - String eventHubEndpointName, String name); - - /** - * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub - * - * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 deleteEventHubConsumerGroupWithResponse(String resourceGroupName, String resourceName, - String eventHubEndpointName, String name, Context context); - - /** - * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub - * - * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param name The name of the consumer group to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteEventHubConsumerGroup(String resourceGroupName, String resourceName, String eventHubEndpointName, - String name); - - /** - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub as paginated - * response with {@link PagedIterable}. - */ - PagedIterable listEventHubConsumerGroups(String resourceGroupName, String resourceName, - String eventHubEndpointName); - - /** - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT hub. - * @param eventHubEndpointName The name of the EventHubEndpoint. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub - * - * Get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in an IoT hub as paginated - * response with {@link PagedIterable}. - */ - PagedIterable listEventHubConsumerGroups(String resourceGroupName, String resourceName, - String eventHubEndpointName, Context context); - - /** - * Check if an IoT hub name is available - * - * Check if an IoT hub name is available. - * - * @param operationInputs The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT hub name is available along with {@link Response}. - */ - Response checkNameAvailabilityWithResponse(OperationInputs operationInputs, - Context context); - - /** - * Check if an IoT hub name is available - * - * Check if an IoT hub name is available. - * - * @param operationInputs The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT hub name is available. - */ - IotHubNameAvailabilityInfo checkNameAvailability(OperationInputs operationInputs); - - /** - * Get the non-security related metadata of an IoT hub - * - * Get the non-security related metadata of an IoT hub. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the non-security related metadata of an IoT hub - * - * Get the non-security related metadata of an IoT hub along with {@link Response}. - */ - IotHubDescription getById(String id); - - /** - * Get the non-security related metadata of an IoT hub - * - * Get the non-security related metadata of an IoT hub. - * - * @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.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the non-security related metadata of an IoT hub - * - * Get the non-security related metadata of an IoT hub along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub - * - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub - * - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub along with - * {@link Response}. - */ - EventHubConsumerGroupInfo getEventHubConsumerGroupById(String id); - - /** - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub - * - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. - * - * @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.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub - * - * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub along with - * {@link Response}. - */ - Response getEventHubConsumerGroupByIdWithResponse(String id, Context context); - - /** - * Delete an IoT hub - * - * Delete an IoT hub. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by server - * on status code 404. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete an IoT hub - * - * Delete an IoT hub. - * - * @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.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by server - * on status code 404. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub - * - * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteEventHubConsumerGroupById(String id); - - /** - * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub - * - * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. - * - * @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.resourcemanager.iothub.models.ErrorDetailsException 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 deleteEventHubConsumerGroupByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new IotHubDescription resource. - * - * @param name resource name. - * @return the first stage of the new IotHubDescription definition. - */ - IotHubDescription.DefinitionStages.Blank define(String name); - - /** - * Begins definition for a new EventHubConsumerGroupInfo resource. - * - * @param name resource name. - * @return the first stage of the new EventHubConsumerGroupInfo definition. - */ - EventHubConsumerGroupInfo.DefinitionStages.Blank defineEventHubConsumerGroup(String name); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubScaleType.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubScaleType.java deleted file mode 100644 index 8edff66cecee..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubScaleType.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -/** - * The type of the scaling enabled. - */ -public enum IotHubScaleType { - /** - * Automatic. - */ - AUTOMATIC("Automatic"), - - /** - * Manual. - */ - MANUAL("Manual"), - - /** - * None. - */ - NONE("None"); - - /** - * The actual serialized value for a IotHubScaleType instance. - */ - private final String value; - - IotHubScaleType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a IotHubScaleType instance. - * - * @param value the serialized value to parse. - * @return the parsed IotHubScaleType object, or null if unable to parse. - */ - public static IotHubScaleType fromString(String value) { - if (value == null) { - return null; - } - IotHubScaleType[] items = IotHubScaleType.values(); - for (IotHubScaleType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSku.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSku.java deleted file mode 100644 index ad5746381a56..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSku.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The name of the SKU. - */ -public final class IotHubSku extends ExpandableStringEnum { - /** - * F1. - */ - public static final IotHubSku F1 = fromString("F1"); - - /** - * S1. - */ - public static final IotHubSku S1 = fromString("S1"); - - /** - * S2. - */ - public static final IotHubSku S2 = fromString("S2"); - - /** - * S3. - */ - public static final IotHubSku S3 = fromString("S3"); - - /** - * B1. - */ - public static final IotHubSku B1 = fromString("B1"); - - /** - * B2. - */ - public static final IotHubSku B2 = fromString("B2"); - - /** - * B3. - */ - public static final IotHubSku B3 = fromString("B3"); - - /** - * GEN2. - */ - public static final IotHubSku GEN2 = fromString("GEN2"); - - /** - * Creates a new instance of IotHubSku value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public IotHubSku() { - } - - /** - * Creates or finds a IotHubSku from its string representation. - * - * @param name a name to look for. - * @return the corresponding IotHubSku. - */ - public static IotHubSku fromString(String name) { - return fromString(name, IotHubSku.class); - } - - /** - * Gets known IotHubSku values. - * - * @return known IotHubSku values. - */ - public static Collection values() { - return values(IotHubSku.class); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSkuDescription.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSkuDescription.java deleted file mode 100644 index 0aecdab1a97e..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSkuDescription.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.resourcemanager.iothub.fluent.models.IotHubSkuDescriptionInner; - -/** - * An immutable client-side representation of IotHubSkuDescription. - */ -public interface IotHubSkuDescription { - /** - * Gets the resourceType property: The type of the resource. - * - * @return the resourceType value. - */ - String resourceType(); - - /** - * Gets the sku property: The type of the resource. - * - * @return the sku value. - */ - IotHubSkuInfo sku(); - - /** - * Gets the capacity property: IotHub capacity. - * - * @return the capacity value. - */ - IotHubCapacity capacity(); - - /** - * Gets the inner com.azure.resourcemanager.iothub.fluent.models.IotHubSkuDescriptionInner object. - * - * @return the inner object. - */ - IotHubSkuDescriptionInner innerModel(); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSkuInfo.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSkuInfo.java deleted file mode 100644 index f01de285ea96..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSkuInfo.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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 the SKU of the IoT hub. - */ -@Fluent -public final class IotHubSkuInfo implements JsonSerializable { - /* - * The name of the SKU. - */ - private IotHubSku name; - - /* - * The billing tier for the IoT hub. - */ - private IotHubSkuTier tier; - - /* - * The number of provisioned IoT Hub units. See: - * https://docs.microsoft.com/azure/azure-subscription-service-limits#iot-hub-limits. - */ - private Long capacity; - - /** - * Creates an instance of IotHubSkuInfo class. - */ - public IotHubSkuInfo() { - } - - /** - * Get the name property: The name of the SKU. - * - * @return the name value. - */ - public IotHubSku name() { - return this.name; - } - - /** - * Set the name property: The name of the SKU. - * - * @param name the name value to set. - * @return the IotHubSkuInfo object itself. - */ - public IotHubSkuInfo withName(IotHubSku name) { - this.name = name; - return this; - } - - /** - * Get the tier property: The billing tier for the IoT hub. - * - * @return the tier value. - */ - public IotHubSkuTier tier() { - return this.tier; - } - - /** - * Get the capacity property: The number of provisioned IoT Hub units. See: - * https://docs.microsoft.com/azure/azure-subscription-service-limits#iot-hub-limits. - * - * @return the capacity value. - */ - public Long capacity() { - return this.capacity; - } - - /** - * Set the capacity property: The number of provisioned IoT Hub units. See: - * https://docs.microsoft.com/azure/azure-subscription-service-limits#iot-hub-limits. - * - * @param capacity the capacity value to set. - * @return the IotHubSkuInfo object itself. - */ - public IotHubSkuInfo withCapacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); - jsonWriter.writeNumberField("capacity", this.capacity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IotHubSkuInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IotHubSkuInfo 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 IotHubSkuInfo. - */ - public static IotHubSkuInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IotHubSkuInfo deserializedIotHubSkuInfo = new IotHubSkuInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedIotHubSkuInfo.name = IotHubSku.fromString(reader.getString()); - } else if ("tier".equals(fieldName)) { - deserializedIotHubSkuInfo.tier = IotHubSkuTier.fromString(reader.getString()); - } else if ("capacity".equals(fieldName)) { - deserializedIotHubSkuInfo.capacity = reader.getNullable(JsonReader::getLong); - } else { - reader.skipChildren(); - } - } - - return deserializedIotHubSkuInfo; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSkuTier.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSkuTier.java deleted file mode 100644 index 72586f10eee1..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSkuTier.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -/** - * The billing tier for the IoT hub. - */ -public enum IotHubSkuTier { - /** - * Free. - */ - FREE("Free"), - - /** - * Standard. - */ - STANDARD("Standard"), - - /** - * Basic. - */ - BASIC("Basic"), - - /** - * Generation2. - */ - GENERATION2("Generation2"); - - /** - * The actual serialized value for a IotHubSkuTier instance. - */ - private final String value; - - IotHubSkuTier(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a IotHubSkuTier instance. - * - * @param value the serialized value to parse. - * @return the parsed IotHubSkuTier object, or null if unable to parse. - */ - public static IotHubSkuTier fromString(String value) { - if (value == null) { - return null; - } - IotHubSkuTier[] items = IotHubSkuTier.values(); - for (IotHubSkuTier item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubs.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubs.java deleted file mode 100644 index d10ff503b974..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubs.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.util.Context; - -/** - * Resource collection API of IotHubs. - */ -public interface IotHubs { - /** - * Manually initiate a failover for the IoT Hub to its secondary region - * - * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see - * https://aka.ms/manualfailover. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param failoverInput Region to failover to. Must be the Azure paired region. Get the value from the secondary - * location in the locations property. To learn more, see https://aka.ms/manualfailover/region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void manualFailover(String iotHubName, String resourceGroupName, FailoverInput failoverInput); - - /** - * Manually initiate a failover for the IoT Hub to its secondary region - * - * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see - * https://aka.ms/manualfailover. - * - * @param iotHubName The iotHubName parameter. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param failoverInput Region to failover to. Must be the Azure paired region. Get the value from the secondary - * location in the locations property. To learn more, see https://aka.ms/manualfailover/region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void manualFailover(String iotHubName, String resourceGroupName, FailoverInput failoverInput, Context context); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IpFilterActionType.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IpFilterActionType.java deleted file mode 100644 index 5f7bfc350a36..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IpFilterActionType.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -/** - * The desired action for requests captured by this rule. - */ -public enum IpFilterActionType { - /** - * Accept. - */ - ACCEPT("Accept"), - - /** - * Reject. - */ - REJECT("Reject"); - - /** - * The actual serialized value for a IpFilterActionType instance. - */ - private final String value; - - IpFilterActionType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a IpFilterActionType instance. - * - * @param value the serialized value to parse. - * @return the parsed IpFilterActionType object, or null if unable to parse. - */ - public static IpFilterActionType fromString(String value) { - if (value == null) { - return null; - } - IpFilterActionType[] items = IpFilterActionType.values(); - for (IpFilterActionType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IpFilterRule.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IpFilterRule.java deleted file mode 100644 index d8b9ad66c5ab..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IpFilterRule.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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 IP filter rules for the IoT hub. - */ -@Fluent -public final class IpFilterRule implements JsonSerializable { - /* - * The name of the IP filter rule. - */ - private String filterName; - - /* - * The desired action for requests captured by this rule. - */ - private IpFilterActionType action; - - /* - * A string that contains the IP address range in CIDR notation for the rule. - */ - private String ipMask; - - /** - * Creates an instance of IpFilterRule class. - */ - public IpFilterRule() { - } - - /** - * Get the filterName property: The name of the IP filter rule. - * - * @return the filterName value. - */ - public String filterName() { - return this.filterName; - } - - /** - * Set the filterName property: The name of the IP filter rule. - * - * @param filterName the filterName value to set. - * @return the IpFilterRule object itself. - */ - public IpFilterRule withFilterName(String filterName) { - this.filterName = filterName; - return this; - } - - /** - * Get the action property: The desired action for requests captured by this rule. - * - * @return the action value. - */ - public IpFilterActionType action() { - return this.action; - } - - /** - * Set the action property: The desired action for requests captured by this rule. - * - * @param action the action value to set. - * @return the IpFilterRule object itself. - */ - public IpFilterRule withAction(IpFilterActionType action) { - this.action = action; - return this; - } - - /** - * Get the ipMask property: A string that contains the IP address range in CIDR notation for the rule. - * - * @return the ipMask value. - */ - public String ipMask() { - return this.ipMask; - } - - /** - * Set the ipMask property: A string that contains the IP address range in CIDR notation for the rule. - * - * @param ipMask the ipMask value to set. - * @return the IpFilterRule object itself. - */ - public IpFilterRule withIpMask(String ipMask) { - this.ipMask = ipMask; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("filterName", this.filterName); - jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); - jsonWriter.writeStringField("ipMask", this.ipMask); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IpFilterRule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IpFilterRule 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 IpFilterRule. - */ - public static IpFilterRule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IpFilterRule deserializedIpFilterRule = new IpFilterRule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("filterName".equals(fieldName)) { - deserializedIpFilterRule.filterName = reader.getString(); - } else if ("action".equals(fieldName)) { - deserializedIpFilterRule.action = IpFilterActionType.fromString(reader.getString()); - } else if ("ipMask".equals(fieldName)) { - deserializedIpFilterRule.ipMask = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedIpFilterRule; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IpVersion.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IpVersion.java deleted file mode 100644 index 742d420be109..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IpVersion.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * This property specifies the IP Version the hub is currently utilizing. - */ -public final class IpVersion extends ExpandableStringEnum { - /** - * ipv4. - */ - public static final IpVersion IPV4 = fromString("ipv4"); - - /** - * ipv6. - */ - public static final IpVersion IPV6 = fromString("ipv6"); - - /** - * ipv4ipv6. - */ - public static final IpVersion IPV4IPV6 = fromString("ipv4ipv6"); - - /** - * Creates a new instance of IpVersion value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public IpVersion() { - } - - /** - * Creates or finds a IpVersion from its string representation. - * - * @param name a name to look for. - * @return the corresponding IpVersion. - */ - public static IpVersion fromString(String name) { - return fromString(name, IpVersion.class); - } - - /** - * Gets known IpVersion values. - * - * @return known IpVersion values. - */ - public static Collection values() { - return values(IpVersion.class); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/JobResponse.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/JobResponse.java deleted file mode 100644 index bf70ce8ac425..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/JobResponse.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.resourcemanager.iothub.fluent.models.JobResponseInner; -import java.time.OffsetDateTime; - -/** - * An immutable client-side representation of JobResponse. - */ -public interface JobResponse { - /** - * Gets the jobId property: The job identifier. - * - * @return the jobId value. - */ - String jobId(); - - /** - * Gets the startTimeUtc property: The start time of the job. - * - * @return the startTimeUtc value. - */ - OffsetDateTime startTimeUtc(); - - /** - * Gets the endTimeUtc property: The time the job stopped processing. - * - * @return the endTimeUtc value. - */ - OffsetDateTime endTimeUtc(); - - /** - * Gets the type property: The type of the job. - * - * @return the type value. - */ - JobType type(); - - /** - * Gets the status property: The status of the job. - * - * @return the status value. - */ - JobStatus status(); - - /** - * Gets the failureReason property: If status == failed, this string containing the reason for the failure. - * - * @return the failureReason value. - */ - String failureReason(); - - /** - * Gets the statusMessage property: The status message for the job. - * - * @return the statusMessage value. - */ - String statusMessage(); - - /** - * Gets the parentJobId property: The job identifier of the parent job, if any. - * - * @return the parentJobId value. - */ - String parentJobId(); - - /** - * Gets the inner com.azure.resourcemanager.iothub.fluent.models.JobResponseInner object. - * - * @return the inner object. - */ - JobResponseInner innerModel(); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/JobStatus.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/JobStatus.java deleted file mode 100644 index 7149050604ea..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/JobStatus.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -/** - * The status of the job. - */ -public enum JobStatus { - /** - * unknown. - */ - UNKNOWN("unknown"), - - /** - * enqueued. - */ - ENQUEUED("enqueued"), - - /** - * running. - */ - RUNNING("running"), - - /** - * completed. - */ - COMPLETED("completed"), - - /** - * failed. - */ - FAILED("failed"), - - /** - * cancelled. - */ - CANCELLED("cancelled"); - - /** - * The actual serialized value for a JobStatus instance. - */ - private final String value; - - JobStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a JobStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed JobStatus object, or null if unable to parse. - */ - public static JobStatus fromString(String value) { - if (value == null) { - return null; - } - JobStatus[] items = JobStatus.values(); - for (JobStatus item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/JobType.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/JobType.java deleted file mode 100644 index b02c31eafec7..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/JobType.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The type of the job. - */ -public final class JobType extends ExpandableStringEnum { - /** - * unknown. - */ - public static final JobType UNKNOWN = fromString("unknown"); - - /** - * export. - */ - public static final JobType EXPORT = fromString("export"); - - /** - * import. - */ - public static final JobType IMPORT = fromString("import"); - - /** - * backup. - */ - public static final JobType BACKUP = fromString("backup"); - - /** - * readDeviceProperties. - */ - public static final JobType READ_DEVICE_PROPERTIES = fromString("readDeviceProperties"); - - /** - * writeDeviceProperties. - */ - public static final JobType WRITE_DEVICE_PROPERTIES = fromString("writeDeviceProperties"); - - /** - * updateDeviceConfiguration. - */ - public static final JobType UPDATE_DEVICE_CONFIGURATION = fromString("updateDeviceConfiguration"); - - /** - * rebootDevice. - */ - public static final JobType REBOOT_DEVICE = fromString("rebootDevice"); - - /** - * factoryResetDevice. - */ - public static final JobType FACTORY_RESET_DEVICE = fromString("factoryResetDevice"); - - /** - * firmwareUpdate. - */ - public static final JobType FIRMWARE_UPDATE = fromString("firmwareUpdate"); - - /** - * Creates a new instance of JobType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public JobType() { - } - - /** - * Creates or finds a JobType from its string representation. - * - * @param name a name to look for. - * @return the corresponding JobType. - */ - public static JobType fromString(String name) { - return fromString(name, JobType.class); - } - - /** - * Gets known JobType values. - * - * @return known JobType values. - */ - public static Collection values() { - return values(JobType.class); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/KeyVaultKeyProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/KeyVaultKeyProperties.java deleted file mode 100644 index ec3044300a4d..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/KeyVaultKeyProperties.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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 properties of the KeyVault key. - */ -@Fluent -public final class KeyVaultKeyProperties implements JsonSerializable { - /* - * The identifier of the key. - */ - private String keyIdentifier; - - /* - * Managed identity properties of KeyVault Key. - */ - private ManagedIdentity identity; - - /** - * Creates an instance of KeyVaultKeyProperties class. - */ - public KeyVaultKeyProperties() { - } - - /** - * Get the keyIdentifier property: The identifier of the key. - * - * @return the keyIdentifier value. - */ - public String keyIdentifier() { - return this.keyIdentifier; - } - - /** - * Set the keyIdentifier property: The identifier of the key. - * - * @param keyIdentifier the keyIdentifier value to set. - * @return the KeyVaultKeyProperties object itself. - */ - public KeyVaultKeyProperties withKeyIdentifier(String keyIdentifier) { - this.keyIdentifier = keyIdentifier; - return this; - } - - /** - * Get the identity property: Managed identity properties of KeyVault Key. - * - * @return the identity value. - */ - public ManagedIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: Managed identity properties of KeyVault Key. - * - * @param identity the identity value to set. - * @return the KeyVaultKeyProperties object itself. - */ - public KeyVaultKeyProperties withIdentity(ManagedIdentity identity) { - this.identity = identity; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("keyIdentifier", this.keyIdentifier); - jsonWriter.writeJsonField("identity", this.identity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of KeyVaultKeyProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of KeyVaultKeyProperties 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 KeyVaultKeyProperties. - */ - public static KeyVaultKeyProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - KeyVaultKeyProperties deserializedKeyVaultKeyProperties = new KeyVaultKeyProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("keyIdentifier".equals(fieldName)) { - deserializedKeyVaultKeyProperties.keyIdentifier = reader.getString(); - } else if ("identity".equals(fieldName)) { - deserializedKeyVaultKeyProperties.identity = ManagedIdentity.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedKeyVaultKeyProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ManagedIdentity.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ManagedIdentity.java deleted file mode 100644 index 303c7661e819..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ManagedIdentity.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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 properties of the Managed identity. - */ -@Fluent -public final class ManagedIdentity implements JsonSerializable { - /* - * The user assigned identity. - */ - private String userAssignedIdentity; - - /** - * Creates an instance of ManagedIdentity class. - */ - public ManagedIdentity() { - } - - /** - * Get the userAssignedIdentity property: The user assigned identity. - * - * @return the userAssignedIdentity value. - */ - public String userAssignedIdentity() { - return this.userAssignedIdentity; - } - - /** - * Set the userAssignedIdentity property: The user assigned identity. - * - * @param userAssignedIdentity the userAssignedIdentity value to set. - * @return the ManagedIdentity object itself. - */ - public ManagedIdentity withUserAssignedIdentity(String userAssignedIdentity) { - this.userAssignedIdentity = userAssignedIdentity; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("userAssignedIdentity", this.userAssignedIdentity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ManagedIdentity from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ManagedIdentity 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 ManagedIdentity. - */ - public static ManagedIdentity fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ManagedIdentity deserializedManagedIdentity = new ManagedIdentity(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("userAssignedIdentity".equals(fieldName)) { - deserializedManagedIdentity.userAssignedIdentity = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedManagedIdentity; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/MatchedRoute.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/MatchedRoute.java deleted file mode 100644 index d8477aef7aba..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/MatchedRoute.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Routes that matched. - */ -@Immutable -public final class MatchedRoute implements JsonSerializable { - /* - * Properties of routes that matched - */ - private RouteProperties properties; - - /** - * Creates an instance of MatchedRoute class. - */ - private MatchedRoute() { - } - - /** - * Get the properties property: Properties of routes that matched. - * - * @return the properties value. - */ - public RouteProperties properties() { - return this.properties; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MatchedRoute from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MatchedRoute 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 MatchedRoute. - */ - public static MatchedRoute fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MatchedRoute deserializedMatchedRoute = new MatchedRoute(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedMatchedRoute.properties = RouteProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedMatchedRoute; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/MessagingEndpointProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/MessagingEndpointProperties.java deleted file mode 100644 index 7508a9555db3..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/MessagingEndpointProperties.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.Duration; - -/** - * The properties of the messaging endpoints used by this IoT hub. - */ -@Fluent -public final class MessagingEndpointProperties implements JsonSerializable { - /* - * The lock duration. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. - */ - private Duration lockDurationAsIso8601; - - /* - * The period of time for which a message is available to consume before it is expired by the IoT hub. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. - */ - private Duration ttlAsIso8601; - - /* - * The number of times the IoT hub attempts to deliver a message. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. - */ - private Integer maxDeliveryCount; - - /** - * Creates an instance of MessagingEndpointProperties class. - */ - public MessagingEndpointProperties() { - } - - /** - * Get the lockDurationAsIso8601 property: The lock duration. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. - * - * @return the lockDurationAsIso8601 value. - */ - public Duration lockDurationAsIso8601() { - return this.lockDurationAsIso8601; - } - - /** - * Set the lockDurationAsIso8601 property: The lock duration. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. - * - * @param lockDurationAsIso8601 the lockDurationAsIso8601 value to set. - * @return the MessagingEndpointProperties object itself. - */ - public MessagingEndpointProperties withLockDurationAsIso8601(Duration lockDurationAsIso8601) { - this.lockDurationAsIso8601 = lockDurationAsIso8601; - return this; - } - - /** - * Get the ttlAsIso8601 property: The period of time for which a message is available to consume before it is - * expired by the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. - * - * @return the ttlAsIso8601 value. - */ - public Duration ttlAsIso8601() { - return this.ttlAsIso8601; - } - - /** - * Set the ttlAsIso8601 property: The period of time for which a message is available to consume before it is - * expired by the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. - * - * @param ttlAsIso8601 the ttlAsIso8601 value to set. - * @return the MessagingEndpointProperties object itself. - */ - public MessagingEndpointProperties withTtlAsIso8601(Duration ttlAsIso8601) { - this.ttlAsIso8601 = ttlAsIso8601; - return this; - } - - /** - * Get the maxDeliveryCount property: The number of times the IoT hub attempts to deliver a message. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. - * - * @return the maxDeliveryCount value. - */ - public Integer maxDeliveryCount() { - return this.maxDeliveryCount; - } - - /** - * Set the maxDeliveryCount property: The number of times the IoT hub attempts to deliver a message. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. - * - * @param maxDeliveryCount the maxDeliveryCount value to set. - * @return the MessagingEndpointProperties object itself. - */ - public MessagingEndpointProperties withMaxDeliveryCount(Integer maxDeliveryCount) { - this.maxDeliveryCount = maxDeliveryCount; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("lockDurationAsIso8601", - CoreUtils.durationToStringWithDays(this.lockDurationAsIso8601)); - jsonWriter.writeStringField("ttlAsIso8601", CoreUtils.durationToStringWithDays(this.ttlAsIso8601)); - jsonWriter.writeNumberField("maxDeliveryCount", this.maxDeliveryCount); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MessagingEndpointProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MessagingEndpointProperties 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 MessagingEndpointProperties. - */ - public static MessagingEndpointProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MessagingEndpointProperties deserializedMessagingEndpointProperties = new MessagingEndpointProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("lockDurationAsIso8601".equals(fieldName)) { - deserializedMessagingEndpointProperties.lockDurationAsIso8601 - = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); - } else if ("ttlAsIso8601".equals(fieldName)) { - deserializedMessagingEndpointProperties.ttlAsIso8601 - = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); - } else if ("maxDeliveryCount".equals(fieldName)) { - deserializedMessagingEndpointProperties.maxDeliveryCount = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedMessagingEndpointProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Name.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Name.java deleted file mode 100644 index 4bced94fb501..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Name.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Name of Iot Hub type. - */ -@Immutable -public final class Name implements JsonSerializable { - /* - * IotHub type - */ - private String value; - - /* - * Localized value of name - */ - private String localizedValue; - - /** - * Creates an instance of Name class. - */ - private Name() { - } - - /** - * Get the value property: IotHub type. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Get the localizedValue property: Localized value of name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.localizedValue; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("value", this.value); - jsonWriter.writeStringField("localizedValue", this.localizedValue); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Name from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Name 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 Name. - */ - public static Name fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Name deserializedName = new Name(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - deserializedName.value = reader.getString(); - } else if ("localizedValue".equals(fieldName)) { - deserializedName.localizedValue = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedName; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/NetworkRuleIpAction.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/NetworkRuleIpAction.java deleted file mode 100644 index b106f62a63e4..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/NetworkRuleIpAction.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * IP Filter Action. - */ -public final class NetworkRuleIpAction extends ExpandableStringEnum { - /** - * Allow. - */ - public static final NetworkRuleIpAction ALLOW = fromString("Allow"); - - /** - * Creates a new instance of NetworkRuleIpAction value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public NetworkRuleIpAction() { - } - - /** - * Creates or finds a NetworkRuleIpAction from its string representation. - * - * @param name a name to look for. - * @return the corresponding NetworkRuleIpAction. - */ - public static NetworkRuleIpAction fromString(String name) { - return fromString(name, NetworkRuleIpAction.class); - } - - /** - * Gets known NetworkRuleIpAction values. - * - * @return known NetworkRuleIpAction values. - */ - public static Collection values() { - return values(NetworkRuleIpAction.class); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/NetworkRuleSetIpRule.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/NetworkRuleSetIpRule.java deleted file mode 100644 index c594acdfdda4..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/NetworkRuleSetIpRule.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * IP Rule to be applied as part of Network Rule Set. - */ -@Fluent -public final class NetworkRuleSetIpRule implements JsonSerializable { - /* - * Name of the IP filter rule. - */ - private String filterName; - - /* - * IP Filter Action - */ - private NetworkRuleIpAction action; - - /* - * A string that contains the IP address range in CIDR notation for the rule. - */ - private String ipMask; - - /** - * Creates an instance of NetworkRuleSetIpRule class. - */ - public NetworkRuleSetIpRule() { - } - - /** - * Get the filterName property: Name of the IP filter rule. - * - * @return the filterName value. - */ - public String filterName() { - return this.filterName; - } - - /** - * Set the filterName property: Name of the IP filter rule. - * - * @param filterName the filterName value to set. - * @return the NetworkRuleSetIpRule object itself. - */ - public NetworkRuleSetIpRule withFilterName(String filterName) { - this.filterName = filterName; - return this; - } - - /** - * Get the action property: IP Filter Action. - * - * @return the action value. - */ - public NetworkRuleIpAction action() { - return this.action; - } - - /** - * Set the action property: IP Filter Action. - * - * @param action the action value to set. - * @return the NetworkRuleSetIpRule object itself. - */ - public NetworkRuleSetIpRule withAction(NetworkRuleIpAction action) { - this.action = action; - return this; - } - - /** - * Get the ipMask property: A string that contains the IP address range in CIDR notation for the rule. - * - * @return the ipMask value. - */ - public String ipMask() { - return this.ipMask; - } - - /** - * Set the ipMask property: A string that contains the IP address range in CIDR notation for the rule. - * - * @param ipMask the ipMask value to set. - * @return the NetworkRuleSetIpRule object itself. - */ - public NetworkRuleSetIpRule withIpMask(String ipMask) { - this.ipMask = ipMask; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("filterName", this.filterName); - jsonWriter.writeStringField("ipMask", this.ipMask); - jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of NetworkRuleSetIpRule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of NetworkRuleSetIpRule 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 NetworkRuleSetIpRule. - */ - public static NetworkRuleSetIpRule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - NetworkRuleSetIpRule deserializedNetworkRuleSetIpRule = new NetworkRuleSetIpRule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("filterName".equals(fieldName)) { - deserializedNetworkRuleSetIpRule.filterName = reader.getString(); - } else if ("ipMask".equals(fieldName)) { - deserializedNetworkRuleSetIpRule.ipMask = reader.getString(); - } else if ("action".equals(fieldName)) { - deserializedNetworkRuleSetIpRule.action = NetworkRuleIpAction.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedNetworkRuleSetIpRule; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/NetworkRuleSetProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/NetworkRuleSetProperties.java deleted file mode 100644 index d8a840866305..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/NetworkRuleSetProperties.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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 Rule Set Properties of IotHub. - */ -@Fluent -public final class NetworkRuleSetProperties implements JsonSerializable { - /* - * Default Action for Network Rule Set - */ - private DefaultAction defaultAction; - - /* - * If True, then Network Rule Set is also applied to BuiltIn EventHub EndPoint of IotHub - */ - private boolean applyToBuiltInEventHubEndpoint; - - /* - * List of IP Rules - */ - private List ipRules; - - /** - * Creates an instance of NetworkRuleSetProperties class. - */ - public NetworkRuleSetProperties() { - } - - /** - * Get the defaultAction property: Default Action for Network Rule Set. - * - * @return the defaultAction value. - */ - public DefaultAction defaultAction() { - return this.defaultAction; - } - - /** - * Set the defaultAction property: Default Action for Network Rule Set. - * - * @param defaultAction the defaultAction value to set. - * @return the NetworkRuleSetProperties object itself. - */ - public NetworkRuleSetProperties withDefaultAction(DefaultAction defaultAction) { - this.defaultAction = defaultAction; - return this; - } - - /** - * Get the applyToBuiltInEventHubEndpoint property: If True, then Network Rule Set is also applied to BuiltIn - * EventHub EndPoint of IotHub. - * - * @return the applyToBuiltInEventHubEndpoint value. - */ - public boolean applyToBuiltInEventHubEndpoint() { - return this.applyToBuiltInEventHubEndpoint; - } - - /** - * Set the applyToBuiltInEventHubEndpoint property: If True, then Network Rule Set is also applied to BuiltIn - * EventHub EndPoint of IotHub. - * - * @param applyToBuiltInEventHubEndpoint the applyToBuiltInEventHubEndpoint value to set. - * @return the NetworkRuleSetProperties object itself. - */ - public NetworkRuleSetProperties withApplyToBuiltInEventHubEndpoint(boolean applyToBuiltInEventHubEndpoint) { - this.applyToBuiltInEventHubEndpoint = applyToBuiltInEventHubEndpoint; - return this; - } - - /** - * Get the ipRules property: List of IP Rules. - * - * @return the ipRules value. - */ - public List ipRules() { - return this.ipRules; - } - - /** - * Set the ipRules property: List of IP Rules. - * - * @param ipRules the ipRules value to set. - * @return the NetworkRuleSetProperties object itself. - */ - public NetworkRuleSetProperties withIpRules(List ipRules) { - this.ipRules = ipRules; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("applyToBuiltInEventHubEndpoint", this.applyToBuiltInEventHubEndpoint); - jsonWriter.writeArrayField("ipRules", this.ipRules, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("defaultAction", this.defaultAction == null ? null : this.defaultAction.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of NetworkRuleSetProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of NetworkRuleSetProperties 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 NetworkRuleSetProperties. - */ - public static NetworkRuleSetProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - NetworkRuleSetProperties deserializedNetworkRuleSetProperties = new NetworkRuleSetProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("applyToBuiltInEventHubEndpoint".equals(fieldName)) { - deserializedNetworkRuleSetProperties.applyToBuiltInEventHubEndpoint = reader.getBoolean(); - } else if ("ipRules".equals(fieldName)) { - List ipRules - = reader.readArray(reader1 -> NetworkRuleSetIpRule.fromJson(reader1)); - deserializedNetworkRuleSetProperties.ipRules = ipRules; - } else if ("defaultAction".equals(fieldName)) { - deserializedNetworkRuleSetProperties.defaultAction = DefaultAction.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedNetworkRuleSetProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Operation.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Operation.java deleted file mode 100644 index c45914918b7d..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Operation.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.resourcemanager.iothub.fluent.models.OperationInner; - -/** - * An immutable client-side representation of Operation. - */ -public interface Operation { - /** - * Gets the name property: Operation name: {provider}/{resource}/{read | write | action | delete}. - * - * @return the name value. - */ - String name(); - - /** - * Gets the display property: The object that represents the operation. - * - * @return the display value. - */ - OperationDisplay display(); - - /** - * Gets the inner com.azure.resourcemanager.iothub.fluent.models.OperationInner object. - * - * @return the inner object. - */ - OperationInner innerModel(); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/OperationDisplay.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/OperationDisplay.java deleted file mode 100644 index b22af1196068..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/OperationDisplay.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The object that represents the operation. - */ -@Immutable -public final class OperationDisplay implements JsonSerializable { - /* - * Service provider: Microsoft Devices - */ - private String provider; - - /* - * Resource Type: IotHubs - */ - private String resource; - - /* - * Name of the operation - */ - private String operation; - - /* - * Description of the operation - */ - private String description; - - /** - * Creates an instance of OperationDisplay class. - */ - private OperationDisplay() { - } - - /** - * Get the provider property: Service provider: Microsoft Devices. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Get the resource property: Resource Type: IotHubs. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Get the operation property: Name of the operation. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Get the description property: Description of the operation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationDisplay from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationDisplay 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 OperationDisplay. - */ - public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationDisplay deserializedOperationDisplay = new OperationDisplay(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provider".equals(fieldName)) { - deserializedOperationDisplay.provider = reader.getString(); - } else if ("resource".equals(fieldName)) { - deserializedOperationDisplay.resource = reader.getString(); - } else if ("operation".equals(fieldName)) { - deserializedOperationDisplay.operation = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedOperationDisplay.description = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationDisplay; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/OperationInputs.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/OperationInputs.java deleted file mode 100644 index 375de0a23276..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/OperationInputs.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * Input values. - */ -@Fluent -public final class OperationInputs implements JsonSerializable { - /* - * The name of the IoT hub to check. - */ - private String name; - - /** - * Creates an instance of OperationInputs class. - */ - public OperationInputs() { - } - - /** - * Get the name property: The name of the IoT hub to check. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the IoT hub to check. - * - * @param name the name value to set. - * @return the OperationInputs object itself. - */ - public OperationInputs withName(String name) { - this.name = name; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationInputs from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationInputs 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 OperationInputs. - */ - public static OperationInputs fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationInputs deserializedOperationInputs = new OperationInputs(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedOperationInputs.name = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationInputs; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Operations.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Operations.java deleted file mode 100644 index 146097c16776..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Operations.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of Operations. - */ -public interface Operations { - /** - * List the operations for the provider. - * - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 IoT Hub operations as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List the operations for the provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 IoT Hub operations as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpoint.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpoint.java deleted file mode 100644 index 3a971b402605..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpoint.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The private endpoint property of a private endpoint connection. - */ -@Immutable -public final class PrivateEndpoint implements JsonSerializable { - /* - * The resource identifier. - */ - private String id; - - /** - * Creates an instance of PrivateEndpoint class. - */ - public PrivateEndpoint() { - } - - /** - * Get the id property: The resource identifier. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateEndpoint from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpoint 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 PrivateEndpoint. - */ - public static PrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpoint deserializedPrivateEndpoint = new PrivateEndpoint(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedPrivateEndpoint.id = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpoint; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpointConnection.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpointConnection.java deleted file mode 100644 index c242755583bf..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpointConnection.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.iothub.fluent.models.PrivateEndpointConnectionInner; - -/** - * An immutable client-side representation of PrivateEndpointConnection. - */ -public interface PrivateEndpointConnection { - /** - * 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: The properties of a private endpoint connection. - * - * @return the properties value. - */ - PrivateEndpointConnectionProperties 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.iothub.fluent.models.PrivateEndpointConnectionInner object. - * - * @return the inner object. - */ - PrivateEndpointConnectionInner innerModel(); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpointConnectionProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpointConnectionProperties.java deleted file mode 100644 index b192fef5caca..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpointConnectionProperties.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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 properties of a private endpoint connection. - */ -@Fluent -public final class PrivateEndpointConnectionProperties - implements JsonSerializable { - /* - * The private endpoint property of a private endpoint connection - */ - private PrivateEndpoint privateEndpoint; - - /* - * The current state of a private endpoint connection - */ - private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; - - /** - * Creates an instance of PrivateEndpointConnectionProperties class. - */ - public PrivateEndpointConnectionProperties() { - } - - /** - * Get the privateEndpoint property: The private endpoint property of a private endpoint connection. - * - * @return the privateEndpoint value. - */ - public PrivateEndpoint privateEndpoint() { - return this.privateEndpoint; - } - - /** - * Set the privateEndpoint property: The private endpoint property of a private endpoint connection. - * - * @param privateEndpoint the privateEndpoint value to set. - * @return the PrivateEndpointConnectionProperties object itself. - */ - public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - this.privateEndpoint = privateEndpoint; - return this; - } - - /** - * Get the privateLinkServiceConnectionState property: The current state of a private endpoint connection. - * - * @return the privateLinkServiceConnectionState value. - */ - public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { - return this.privateLinkServiceConnectionState; - } - - /** - * Set the privateLinkServiceConnectionState property: The current state of a private endpoint connection. - * - * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. - * @return the PrivateEndpointConnectionProperties object itself. - */ - public PrivateEndpointConnectionProperties - withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { - this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); - jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateEndpointConnectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpointConnectionProperties 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 PrivateEndpointConnectionProperties. - */ - public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpointConnectionProperties deserializedPrivateEndpointConnectionProperties - = new PrivateEndpointConnectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("privateLinkServiceConnectionState".equals(fieldName)) { - deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState - = PrivateLinkServiceConnectionState.fromJson(reader); - } else if ("privateEndpoint".equals(fieldName)) { - deserializedPrivateEndpointConnectionProperties.privateEndpoint = PrivateEndpoint.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpointConnectionProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpointConnections.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpointConnections.java deleted file mode 100644 index 39c5fbeb7a86..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpointConnections.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.iothub.fluent.models.PrivateEndpointConnectionInner; -import java.util.List; - -/** - * Resource collection API of PrivateEndpointConnections. - */ -public interface PrivateEndpointConnections { - /** - * Get private endpoint connection - * - * Get private endpoint connection properties. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection - * - * Get private endpoint connection properties along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String resourceName, - String privateEndpointConnectionName, Context context); - - /** - * Get private endpoint connection - * - * Get private endpoint connection properties. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection - * - * Get private endpoint connection properties. - */ - PrivateEndpointConnection get(String resourceGroupName, String resourceName, String privateEndpointConnectionName); - - /** - * Update private endpoint connection - * - * Update the status of a private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param privateEndpointConnection The private endpoint connection with updated properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection of an IotHub. - */ - PrivateEndpointConnection update(String resourceGroupName, String resourceName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection); - - /** - * Update private endpoint connection - * - * Update the status of a private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param privateEndpointConnection The private endpoint connection with updated properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection of an IotHub. - */ - PrivateEndpointConnection update(String resourceGroupName, String resourceName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, - Context context); - - /** - * Delete private endpoint connection - * - * Delete private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 resourceName, String privateEndpointConnectionName); - - /** - * Delete private endpoint connection - * - * Delete private endpoint connection with the specified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 resourceName, String privateEndpointConnectionName, Context context); - - /** - * List private endpoint connections - * - * List private endpoint connection properties. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - Response> listWithResponse(String resourceGroupName, String resourceName, - Context context); - - /** - * List private endpoint connections - * - * List private endpoint connection properties. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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. - */ - List list(String resourceGroupName, String resourceName); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkResources.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkResources.java deleted file mode 100644 index 3e979915157f..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkResources.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.resourcemanager.iothub.fluent.models.PrivateLinkResourcesInner; -import java.util.List; - -/** - * An immutable client-side representation of PrivateLinkResources. - */ -public interface PrivateLinkResources { - /** - * Gets the value property: The list of available private link resources for an IotHub. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.iothub.fluent.models.PrivateLinkResourcesInner object. - * - * @return the inner object. - */ - PrivateLinkResourcesInner innerModel(); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkResourcesOperations.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkResourcesOperations.java deleted file mode 100644 index d310e5612b70..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkResourcesOperations.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of PrivateLinkResourcesOperations. - */ -public interface PrivateLinkResourcesOperations { - /** - * Get the specified private link resource - * - * Get the specified private link resource for the given IotHub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param groupId The name of the private link resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 private link resource - * - * Get the specified private link resource for the given IotHub along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String resourceName, String groupId, - Context context); - - /** - * Get the specified private link resource - * - * Get the specified private link resource for the given IotHub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param groupId The name of the private link resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 private link resource - * - * Get the specified private link resource for the given IotHub. - */ - GroupIdInformation get(String resourceGroupName, String resourceName, String groupId); - - /** - * List private link resources - * - * List private link resources for the given IotHub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 private link resources for an IotHub along with {@link Response}. - */ - Response listWithResponse(String resourceGroupName, String resourceName, Context context); - - /** - * List private link resources - * - * List private link resources for the given IotHub. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceName The name of the IoT Hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException 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 private link resources for an IotHub. - */ - PrivateLinkResources list(String resourceGroupName, String resourceName); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkServiceConnectionState.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkServiceConnectionState.java deleted file mode 100644 index ca290367cc33..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkServiceConnectionState.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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 current state of a private endpoint connection. - */ -@Fluent -public final class PrivateLinkServiceConnectionState implements JsonSerializable { - /* - * The status of a private endpoint connection - */ - private PrivateLinkServiceConnectionStatus status; - - /* - * The description for the current state of a private endpoint connection - */ - private String description; - - /* - * Actions required for a private endpoint connection - */ - private String actionsRequired; - - /** - * Creates an instance of PrivateLinkServiceConnectionState class. - */ - public PrivateLinkServiceConnectionState() { - } - - /** - * Get the status property: The status of a private endpoint connection. - * - * @return the status value. - */ - public PrivateLinkServiceConnectionStatus status() { - return this.status; - } - - /** - * Set the status property: The status of a private endpoint connection. - * - * @param status the status value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withStatus(PrivateLinkServiceConnectionStatus status) { - this.status = status; - return this; - } - - /** - * Get the description property: The description for the current state of a private endpoint connection. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description for the current state of a private endpoint connection. - * - * @param description the description value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the actionsRequired property: Actions required for a private endpoint connection. - * - * @return the actionsRequired value. - */ - public String actionsRequired() { - return this.actionsRequired; - } - - /** - * Set the actionsRequired property: Actions required for a private endpoint connection. - * - * @param actionsRequired the actionsRequired value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { - this.actionsRequired = actionsRequired; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeStringField("actionsRequired", this.actionsRequired); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateLinkServiceConnectionState from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateLinkServiceConnectionState 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 PrivateLinkServiceConnectionState. - */ - public static PrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateLinkServiceConnectionState deserializedPrivateLinkServiceConnectionState - = new PrivateLinkServiceConnectionState(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedPrivateLinkServiceConnectionState.status - = PrivateLinkServiceConnectionStatus.fromString(reader.getString()); - } else if ("description".equals(fieldName)) { - deserializedPrivateLinkServiceConnectionState.description = reader.getString(); - } else if ("actionsRequired".equals(fieldName)) { - deserializedPrivateLinkServiceConnectionState.actionsRequired = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateLinkServiceConnectionState; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkServiceConnectionStatus.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkServiceConnectionStatus.java deleted file mode 100644 index 29cb2682b3dc..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkServiceConnectionStatus.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The status of a private endpoint connection. - */ -public final class PrivateLinkServiceConnectionStatus extends ExpandableStringEnum { - /** - * Pending. - */ - public static final PrivateLinkServiceConnectionStatus PENDING = fromString("Pending"); - - /** - * Approved. - */ - public static final PrivateLinkServiceConnectionStatus APPROVED = fromString("Approved"); - - /** - * Rejected. - */ - public static final PrivateLinkServiceConnectionStatus REJECTED = fromString("Rejected"); - - /** - * Disconnected. - */ - public static final PrivateLinkServiceConnectionStatus DISCONNECTED = fromString("Disconnected"); - - /** - * Creates a new instance of PrivateLinkServiceConnectionStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public PrivateLinkServiceConnectionStatus() { - } - - /** - * Creates or finds a PrivateLinkServiceConnectionStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding PrivateLinkServiceConnectionStatus. - */ - public static PrivateLinkServiceConnectionStatus fromString(String name) { - return fromString(name, PrivateLinkServiceConnectionStatus.class); - } - - /** - * Gets known PrivateLinkServiceConnectionStatus values. - * - * @return known PrivateLinkServiceConnectionStatus values. - */ - public static Collection values() { - return values(PrivateLinkServiceConnectionStatus.class); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PublicNetworkAccess.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PublicNetworkAccess.java deleted file mode 100644 index 48e5f19c90d4..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PublicNetworkAccess.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Whether requests from Public Network are allowed. - */ -public final class PublicNetworkAccess extends ExpandableStringEnum { - /** - * Enabled. - */ - public static final PublicNetworkAccess ENABLED = fromString("Enabled"); - - /** - * Disabled. - */ - public static final PublicNetworkAccess DISABLED = fromString("Disabled"); - - /** - * Creates a new instance of PublicNetworkAccess value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public PublicNetworkAccess() { - } - - /** - * Creates or finds a PublicNetworkAccess from its string representation. - * - * @param name a name to look for. - * @return the corresponding PublicNetworkAccess. - */ - public static PublicNetworkAccess fromString(String name) { - return fromString(name, PublicNetworkAccess.class); - } - - /** - * Gets known PublicNetworkAccess values. - * - * @return known PublicNetworkAccess values. - */ - public static Collection values() { - return values(PublicNetworkAccess.class); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RegistryStatistics.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RegistryStatistics.java deleted file mode 100644 index 080ebddd7d98..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RegistryStatistics.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.resourcemanager.iothub.fluent.models.RegistryStatisticsInner; - -/** - * An immutable client-side representation of RegistryStatistics. - */ -public interface RegistryStatistics { - /** - * Gets the totalDeviceCount property: The total count of devices in the identity registry. - * - * @return the totalDeviceCount value. - */ - Long totalDeviceCount(); - - /** - * Gets the enabledDeviceCount property: The count of enabled devices in the identity registry. - * - * @return the enabledDeviceCount value. - */ - Long enabledDeviceCount(); - - /** - * Gets the disabledDeviceCount property: The count of disabled devices in the identity registry. - * - * @return the disabledDeviceCount value. - */ - Long disabledDeviceCount(); - - /** - * Gets the inner com.azure.resourcemanager.iothub.fluent.models.RegistryStatisticsInner object. - * - * @return the inner object. - */ - RegistryStatisticsInner innerModel(); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ResourceIdentityType.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ResourceIdentityType.java deleted file mode 100644 index a284443e8bc4..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ResourceIdentityType.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -/** - * The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly - * created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. - */ -public enum ResourceIdentityType { - /** - * SystemAssigned. - */ - SYSTEM_ASSIGNED("SystemAssigned"), - - /** - * UserAssigned. - */ - USER_ASSIGNED("UserAssigned"), - - /** - * SystemAssigned, UserAssigned. - */ - SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), - - /** - * None. - */ - NONE("None"); - - /** - * The actual serialized value for a ResourceIdentityType instance. - */ - private final String value; - - ResourceIdentityType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ResourceIdentityType instance. - * - * @param value the serialized value to parse. - * @return the parsed ResourceIdentityType object, or null if unable to parse. - */ - public static ResourceIdentityType fromString(String value) { - if (value == null) { - return null; - } - ResourceIdentityType[] items = ResourceIdentityType.values(); - for (ResourceIdentityType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ResourceProviderCommons.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ResourceProviderCommons.java deleted file mode 100644 index 55e4e8b2cb80..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ResourceProviderCommons.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ResourceProviderCommons. - */ -public interface ResourceProviderCommons { - /** - * Get the number of iot hubs in the subscription - * - * Get the number of free and paid iot hubs in the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the number of iot hubs in the subscription - * - * Get the number of free and paid iot hubs in the subscription along with {@link Response}. - */ - Response getSubscriptionQuotaWithResponse(Context context); - - /** - * Get the number of iot hubs in the subscription - * - * Get the number of free and paid iot hubs in the subscription. - * - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the number of iot hubs in the subscription - * - * Get the number of free and paid iot hubs in the subscription. - */ - UserSubscriptionQuotaListResult getSubscriptionQuota(); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RootCertificateProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RootCertificateProperties.java deleted file mode 100644 index 1e8ee349df37..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RootCertificateProperties.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * This property store root certificate related information. - */ -@Fluent -public final class RootCertificateProperties implements JsonSerializable { - /* - * This property when set to true, hub will use G2 cert; while it's set to false, hub uses Baltimore Cert. - */ - private Boolean enableRootCertificateV2; - - /* - * the last update time to root certificate flag. - */ - private OffsetDateTime lastUpdatedTimeUtc; - - /** - * Creates an instance of RootCertificateProperties class. - */ - public RootCertificateProperties() { - } - - /** - * Get the enableRootCertificateV2 property: This property when set to true, hub will use G2 cert; while it's set to - * false, hub uses Baltimore Cert. - * - * @return the enableRootCertificateV2 value. - */ - public Boolean enableRootCertificateV2() { - return this.enableRootCertificateV2; - } - - /** - * Set the enableRootCertificateV2 property: This property when set to true, hub will use G2 cert; while it's set to - * false, hub uses Baltimore Cert. - * - * @param enableRootCertificateV2 the enableRootCertificateV2 value to set. - * @return the RootCertificateProperties object itself. - */ - public RootCertificateProperties withEnableRootCertificateV2(Boolean enableRootCertificateV2) { - this.enableRootCertificateV2 = enableRootCertificateV2; - return this; - } - - /** - * Get the lastUpdatedTimeUtc property: the last update time to root certificate flag. - * - * @return the lastUpdatedTimeUtc value. - */ - public OffsetDateTime lastUpdatedTimeUtc() { - return this.lastUpdatedTimeUtc; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enableRootCertificateV2", this.enableRootCertificateV2); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RootCertificateProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RootCertificateProperties 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 RootCertificateProperties. - */ - public static RootCertificateProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RootCertificateProperties deserializedRootCertificateProperties = new RootCertificateProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enableRootCertificateV2".equals(fieldName)) { - deserializedRootCertificateProperties.enableRootCertificateV2 - = reader.getNullable(JsonReader::getBoolean); - } else if ("lastUpdatedTimeUtc".equals(fieldName)) { - deserializedRootCertificateProperties.lastUpdatedTimeUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedRootCertificateProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteCompilationError.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteCompilationError.java deleted file mode 100644 index 7e7f4d541dc7..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteCompilationError.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Compilation error when evaluating route. - */ -@Immutable -public final class RouteCompilationError implements JsonSerializable { - /* - * Route error message - */ - private String message; - - /* - * Severity of the route error - */ - private RouteErrorSeverity severity; - - /* - * Location where the route error happened - */ - private RouteErrorRange location; - - /** - * Creates an instance of RouteCompilationError class. - */ - private RouteCompilationError() { - } - - /** - * Get the message property: Route error message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Get the severity property: Severity of the route error. - * - * @return the severity value. - */ - public RouteErrorSeverity severity() { - return this.severity; - } - - /** - * Get the location property: Location where the route error happened. - * - * @return the location value. - */ - public RouteErrorRange location() { - return this.location; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("message", this.message); - jsonWriter.writeStringField("severity", this.severity == null ? null : this.severity.toString()); - jsonWriter.writeJsonField("location", this.location); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RouteCompilationError from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RouteCompilationError 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 RouteCompilationError. - */ - public static RouteCompilationError fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RouteCompilationError deserializedRouteCompilationError = new RouteCompilationError(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("message".equals(fieldName)) { - deserializedRouteCompilationError.message = reader.getString(); - } else if ("severity".equals(fieldName)) { - deserializedRouteCompilationError.severity = RouteErrorSeverity.fromString(reader.getString()); - } else if ("location".equals(fieldName)) { - deserializedRouteCompilationError.location = RouteErrorRange.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRouteCompilationError; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorPosition.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorPosition.java deleted file mode 100644 index ff87682335a0..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorPosition.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Position where the route error happened. - */ -@Immutable -public final class RouteErrorPosition implements JsonSerializable { - /* - * Line where the route error happened - */ - private Integer line; - - /* - * Column where the route error happened - */ - private Integer column; - - /** - * Creates an instance of RouteErrorPosition class. - */ - private RouteErrorPosition() { - } - - /** - * Get the line property: Line where the route error happened. - * - * @return the line value. - */ - public Integer line() { - return this.line; - } - - /** - * Get the column property: Column where the route error happened. - * - * @return the column value. - */ - public Integer column() { - return this.column; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("line", this.line); - jsonWriter.writeNumberField("column", this.column); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RouteErrorPosition from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RouteErrorPosition 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 RouteErrorPosition. - */ - public static RouteErrorPosition fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RouteErrorPosition deserializedRouteErrorPosition = new RouteErrorPosition(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("line".equals(fieldName)) { - deserializedRouteErrorPosition.line = reader.getNullable(JsonReader::getInt); - } else if ("column".equals(fieldName)) { - deserializedRouteErrorPosition.column = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedRouteErrorPosition; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorRange.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorRange.java deleted file mode 100644 index afb8fc1a9d84..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorRange.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Range of route errors. - */ -@Immutable -public final class RouteErrorRange implements JsonSerializable { - /* - * Start where the route error happened - */ - private RouteErrorPosition start; - - /* - * End where the route error happened - */ - private RouteErrorPosition end; - - /** - * Creates an instance of RouteErrorRange class. - */ - private RouteErrorRange() { - } - - /** - * Get the start property: Start where the route error happened. - * - * @return the start value. - */ - public RouteErrorPosition start() { - return this.start; - } - - /** - * Get the end property: End where the route error happened. - * - * @return the end value. - */ - public RouteErrorPosition end() { - return this.end; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("start", this.start); - jsonWriter.writeJsonField("end", this.end); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RouteErrorRange from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RouteErrorRange 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 RouteErrorRange. - */ - public static RouteErrorRange fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RouteErrorRange deserializedRouteErrorRange = new RouteErrorRange(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("start".equals(fieldName)) { - deserializedRouteErrorRange.start = RouteErrorPosition.fromJson(reader); - } else if ("end".equals(fieldName)) { - deserializedRouteErrorRange.end = RouteErrorPosition.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRouteErrorRange; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorSeverity.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorSeverity.java deleted file mode 100644 index c2fda350c79f..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorSeverity.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Severity of the route error. - */ -public final class RouteErrorSeverity extends ExpandableStringEnum { - /** - * error. - */ - public static final RouteErrorSeverity ERROR = fromString("error"); - - /** - * warning. - */ - public static final RouteErrorSeverity WARNING = fromString("warning"); - - /** - * Creates a new instance of RouteErrorSeverity value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RouteErrorSeverity() { - } - - /** - * Creates or finds a RouteErrorSeverity from its string representation. - * - * @param name a name to look for. - * @return the corresponding RouteErrorSeverity. - */ - public static RouteErrorSeverity fromString(String name) { - return fromString(name, RouteErrorSeverity.class); - } - - /** - * Gets known RouteErrorSeverity values. - * - * @return known RouteErrorSeverity values. - */ - public static Collection values() { - return values(RouteErrorSeverity.class); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteProperties.java deleted file mode 100644 index 68d4dd530514..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteProperties.java +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * The properties of a routing rule that your IoT hub uses to route messages to endpoints. - */ -@Fluent -public final class RouteProperties implements JsonSerializable { - /* - * The name of the route. The name can only include alphanumeric characters, periods, underscores, hyphens, has a - * maximum length of 64 characters, and must be unique. - */ - private String name; - - /* - * The source that the routing rule is to be applied to, such as DeviceMessages. - */ - private RoutingSource source; - - /* - * The condition that is evaluated to apply the routing rule. If no condition is provided, it evaluates to true by - * default. For grammar, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language - */ - private String condition; - - /* - * The list of endpoints to which messages that satisfy the condition are routed. Currently only one endpoint is - * allowed. - */ - private List endpointNames; - - /* - * Used to specify whether a route is enabled. - */ - private boolean isEnabled; - - /** - * Creates an instance of RouteProperties class. - */ - public RouteProperties() { - } - - /** - * Get the name property: The name of the route. The name can only include alphanumeric characters, periods, - * underscores, hyphens, has a maximum length of 64 characters, and must be unique. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the route. The name can only include alphanumeric characters, periods, - * underscores, hyphens, has a maximum length of 64 characters, and must be unique. - * - * @param name the name value to set. - * @return the RouteProperties object itself. - */ - public RouteProperties withName(String name) { - this.name = name; - return this; - } - - /** - * Get the source property: The source that the routing rule is to be applied to, such as DeviceMessages. - * - * @return the source value. - */ - public RoutingSource source() { - return this.source; - } - - /** - * Set the source property: The source that the routing rule is to be applied to, such as DeviceMessages. - * - * @param source the source value to set. - * @return the RouteProperties object itself. - */ - public RouteProperties withSource(RoutingSource source) { - this.source = source; - return this; - } - - /** - * Get the condition property: The condition that is evaluated to apply the routing rule. If no condition is - * provided, it evaluates to true by default. For grammar, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language. - * - * @return the condition value. - */ - public String condition() { - return this.condition; - } - - /** - * Set the condition property: The condition that is evaluated to apply the routing rule. If no condition is - * provided, it evaluates to true by default. For grammar, see: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language. - * - * @param condition the condition value to set. - * @return the RouteProperties object itself. - */ - public RouteProperties withCondition(String condition) { - this.condition = condition; - return this; - } - - /** - * Get the endpointNames property: The list of endpoints to which messages that satisfy the condition are routed. - * Currently only one endpoint is allowed. - * - * @return the endpointNames value. - */ - public List endpointNames() { - return this.endpointNames; - } - - /** - * Set the endpointNames property: The list of endpoints to which messages that satisfy the condition are routed. - * Currently only one endpoint is allowed. - * - * @param endpointNames the endpointNames value to set. - * @return the RouteProperties object itself. - */ - public RouteProperties withEndpointNames(List endpointNames) { - this.endpointNames = endpointNames; - return this; - } - - /** - * Get the isEnabled property: Used to specify whether a route is enabled. - * - * @return the isEnabled value. - */ - public boolean isEnabled() { - return this.isEnabled; - } - - /** - * Set the isEnabled property: Used to specify whether a route is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the RouteProperties object itself. - */ - public RouteProperties withIsEnabled(boolean isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("source", this.source == null ? null : this.source.toString()); - jsonWriter.writeArrayField("endpointNames", this.endpointNames, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("isEnabled", this.isEnabled); - jsonWriter.writeStringField("condition", this.condition); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RouteProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RouteProperties 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 RouteProperties. - */ - public static RouteProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RouteProperties deserializedRouteProperties = new RouteProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedRouteProperties.name = reader.getString(); - } else if ("source".equals(fieldName)) { - deserializedRouteProperties.source = RoutingSource.fromString(reader.getString()); - } else if ("endpointNames".equals(fieldName)) { - List endpointNames = reader.readArray(reader1 -> reader1.getString()); - deserializedRouteProperties.endpointNames = endpointNames; - } else if ("isEnabled".equals(fieldName)) { - deserializedRouteProperties.isEnabled = reader.getBoolean(); - } else if ("condition".equals(fieldName)) { - deserializedRouteProperties.condition = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRouteProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingCosmosDBSqlApiProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingCosmosDBSqlApiProperties.java deleted file mode 100644 index f4f64c1e73d9..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingCosmosDBSqlApiProperties.java +++ /dev/null @@ -1,431 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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 properties related to a cosmos DB sql container endpoint. - */ -@Fluent -public final class RoutingCosmosDBSqlApiProperties implements JsonSerializable { - /* - * The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, - * hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, - * $default. Endpoint names must be unique across endpoint types. - */ - private String name; - - /* - * Id of the cosmos DB sql container endpoint - */ - private String id; - - /* - * The subscription identifier of the cosmos DB account. - */ - private String subscriptionId; - - /* - * The name of the resource group of the cosmos DB account. - */ - private String resourceGroup; - - /* - * The url of the cosmos DB account. It must include the protocol https:// - */ - private String endpointUri; - - /* - * Method used to authenticate against the cosmos DB sql container endpoint - */ - private AuthenticationType authenticationType; - - /* - * Managed identity properties of routing cosmos DB container endpoint. - */ - private ManagedIdentity identity; - - /* - * The primary key of the cosmos DB account. - */ - private String primaryKey; - - /* - * The secondary key of the cosmos DB account. - */ - private String secondaryKey; - - /* - * The name of the cosmos DB database in the cosmos DB account. - */ - private String databaseName; - - /* - * The name of the cosmos DB sql container in the cosmos DB database. - */ - private String containerName; - - /* - * The name of the partition key associated with this cosmos DB sql container if one exists. This is an optional - * parameter. - */ - private String partitionKeyName; - - /* - * The template for generating a synthetic partition key value for use with this cosmos DB sql container. The - * template must include at least one of the following placeholders: {iothub}, {deviceid}, {DD}, {MM}, and {YYYY}. - * Any one placeholder may be specified at most once, but order and non-placeholder components are arbitrary. This - * parameter is only required if PartitionKeyName is specified. - */ - private String partitionKeyTemplate; - - /** - * Creates an instance of RoutingCosmosDBSqlApiProperties class. - */ - public RoutingCosmosDBSqlApiProperties() { - } - - /** - * Get the name property: The name that identifies this endpoint. The name can only include alphanumeric characters, - * periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: - * events, fileNotifications, $default. Endpoint names must be unique across endpoint types. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name that identifies this endpoint. The name can only include alphanumeric characters, - * periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: - * events, fileNotifications, $default. Endpoint names must be unique across endpoint types. - * - * @param name the name value to set. - * @return the RoutingCosmosDBSqlApiProperties object itself. - */ - public RoutingCosmosDBSqlApiProperties withName(String name) { - this.name = name; - return this; - } - - /** - * Get the id property: Id of the cosmos DB sql container endpoint. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the subscriptionId property: The subscription identifier of the cosmos DB account. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Set the subscriptionId property: The subscription identifier of the cosmos DB account. - * - * @param subscriptionId the subscriptionId value to set. - * @return the RoutingCosmosDBSqlApiProperties object itself. - */ - public RoutingCosmosDBSqlApiProperties withSubscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /** - * Get the resourceGroup property: The name of the resource group of the cosmos DB account. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.resourceGroup; - } - - /** - * Set the resourceGroup property: The name of the resource group of the cosmos DB account. - * - * @param resourceGroup the resourceGroup value to set. - * @return the RoutingCosmosDBSqlApiProperties object itself. - */ - public RoutingCosmosDBSqlApiProperties withResourceGroup(String resourceGroup) { - this.resourceGroup = resourceGroup; - return this; - } - - /** - * Get the endpointUri property: The url of the cosmos DB account. It must include the protocol https://. - * - * @return the endpointUri value. - */ - public String endpointUri() { - return this.endpointUri; - } - - /** - * Set the endpointUri property: The url of the cosmos DB account. It must include the protocol https://. - * - * @param endpointUri the endpointUri value to set. - * @return the RoutingCosmosDBSqlApiProperties object itself. - */ - public RoutingCosmosDBSqlApiProperties withEndpointUri(String endpointUri) { - this.endpointUri = endpointUri; - return this; - } - - /** - * Get the authenticationType property: Method used to authenticate against the cosmos DB sql container endpoint. - * - * @return the authenticationType value. - */ - public AuthenticationType authenticationType() { - return this.authenticationType; - } - - /** - * Set the authenticationType property: Method used to authenticate against the cosmos DB sql container endpoint. - * - * @param authenticationType the authenticationType value to set. - * @return the RoutingCosmosDBSqlApiProperties object itself. - */ - public RoutingCosmosDBSqlApiProperties withAuthenticationType(AuthenticationType authenticationType) { - this.authenticationType = authenticationType; - return this; - } - - /** - * Get the identity property: Managed identity properties of routing cosmos DB container endpoint. - * - * @return the identity value. - */ - public ManagedIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: Managed identity properties of routing cosmos DB container endpoint. - * - * @param identity the identity value to set. - * @return the RoutingCosmosDBSqlApiProperties object itself. - */ - public RoutingCosmosDBSqlApiProperties withIdentity(ManagedIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the primaryKey property: The primary key of the cosmos DB account. - * - * @return the primaryKey value. - */ - public String primaryKey() { - return this.primaryKey; - } - - /** - * Set the primaryKey property: The primary key of the cosmos DB account. - * - * @param primaryKey the primaryKey value to set. - * @return the RoutingCosmosDBSqlApiProperties object itself. - */ - public RoutingCosmosDBSqlApiProperties withPrimaryKey(String primaryKey) { - this.primaryKey = primaryKey; - return this; - } - - /** - * Get the secondaryKey property: The secondary key of the cosmos DB account. - * - * @return the secondaryKey value. - */ - public String secondaryKey() { - return this.secondaryKey; - } - - /** - * Set the secondaryKey property: The secondary key of the cosmos DB account. - * - * @param secondaryKey the secondaryKey value to set. - * @return the RoutingCosmosDBSqlApiProperties object itself. - */ - public RoutingCosmosDBSqlApiProperties withSecondaryKey(String secondaryKey) { - this.secondaryKey = secondaryKey; - return this; - } - - /** - * Get the databaseName property: The name of the cosmos DB database in the cosmos DB account. - * - * @return the databaseName value. - */ - public String databaseName() { - return this.databaseName; - } - - /** - * Set the databaseName property: The name of the cosmos DB database in the cosmos DB account. - * - * @param databaseName the databaseName value to set. - * @return the RoutingCosmosDBSqlApiProperties object itself. - */ - public RoutingCosmosDBSqlApiProperties withDatabaseName(String databaseName) { - this.databaseName = databaseName; - return this; - } - - /** - * Get the containerName property: The name of the cosmos DB sql container in the cosmos DB database. - * - * @return the containerName value. - */ - public String containerName() { - return this.containerName; - } - - /** - * Set the containerName property: The name of the cosmos DB sql container in the cosmos DB database. - * - * @param containerName the containerName value to set. - * @return the RoutingCosmosDBSqlApiProperties object itself. - */ - public RoutingCosmosDBSqlApiProperties withContainerName(String containerName) { - this.containerName = containerName; - return this; - } - - /** - * Get the partitionKeyName property: The name of the partition key associated with this cosmos DB sql container if - * one exists. This is an optional parameter. - * - * @return the partitionKeyName value. - */ - public String partitionKeyName() { - return this.partitionKeyName; - } - - /** - * Set the partitionKeyName property: The name of the partition key associated with this cosmos DB sql container if - * one exists. This is an optional parameter. - * - * @param partitionKeyName the partitionKeyName value to set. - * @return the RoutingCosmosDBSqlApiProperties object itself. - */ - public RoutingCosmosDBSqlApiProperties withPartitionKeyName(String partitionKeyName) { - this.partitionKeyName = partitionKeyName; - return this; - } - - /** - * Get the partitionKeyTemplate property: The template for generating a synthetic partition key value for use with - * this cosmos DB sql container. The template must include at least one of the following placeholders: {iothub}, - * {deviceid}, {DD}, {MM}, and {YYYY}. Any one placeholder may be specified at most once, but order and - * non-placeholder components are arbitrary. This parameter is only required if PartitionKeyName is specified. - * - * @return the partitionKeyTemplate value. - */ - public String partitionKeyTemplate() { - return this.partitionKeyTemplate; - } - - /** - * Set the partitionKeyTemplate property: The template for generating a synthetic partition key value for use with - * this cosmos DB sql container. The template must include at least one of the following placeholders: {iothub}, - * {deviceid}, {DD}, {MM}, and {YYYY}. Any one placeholder may be specified at most once, but order and - * non-placeholder components are arbitrary. This parameter is only required if PartitionKeyName is specified. - * - * @param partitionKeyTemplate the partitionKeyTemplate value to set. - * @return the RoutingCosmosDBSqlApiProperties object itself. - */ - public RoutingCosmosDBSqlApiProperties withPartitionKeyTemplate(String partitionKeyTemplate) { - this.partitionKeyTemplate = partitionKeyTemplate; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("endpointUri", this.endpointUri); - jsonWriter.writeStringField("databaseName", this.databaseName); - jsonWriter.writeStringField("containerName", this.containerName); - jsonWriter.writeStringField("subscriptionId", this.subscriptionId); - jsonWriter.writeStringField("resourceGroup", this.resourceGroup); - jsonWriter.writeStringField("authenticationType", - this.authenticationType == null ? null : this.authenticationType.toString()); - jsonWriter.writeJsonField("identity", this.identity); - jsonWriter.writeStringField("primaryKey", this.primaryKey); - jsonWriter.writeStringField("secondaryKey", this.secondaryKey); - jsonWriter.writeStringField("partitionKeyName", this.partitionKeyName); - jsonWriter.writeStringField("partitionKeyTemplate", this.partitionKeyTemplate); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RoutingCosmosDBSqlApiProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RoutingCosmosDBSqlApiProperties 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 RoutingCosmosDBSqlApiProperties. - */ - public static RoutingCosmosDBSqlApiProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RoutingCosmosDBSqlApiProperties deserializedRoutingCosmosDBSqlApiProperties - = new RoutingCosmosDBSqlApiProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedRoutingCosmosDBSqlApiProperties.name = reader.getString(); - } else if ("endpointUri".equals(fieldName)) { - deserializedRoutingCosmosDBSqlApiProperties.endpointUri = reader.getString(); - } else if ("databaseName".equals(fieldName)) { - deserializedRoutingCosmosDBSqlApiProperties.databaseName = reader.getString(); - } else if ("containerName".equals(fieldName)) { - deserializedRoutingCosmosDBSqlApiProperties.containerName = reader.getString(); - } else if ("id".equals(fieldName)) { - deserializedRoutingCosmosDBSqlApiProperties.id = reader.getString(); - } else if ("subscriptionId".equals(fieldName)) { - deserializedRoutingCosmosDBSqlApiProperties.subscriptionId = reader.getString(); - } else if ("resourceGroup".equals(fieldName)) { - deserializedRoutingCosmosDBSqlApiProperties.resourceGroup = reader.getString(); - } else if ("authenticationType".equals(fieldName)) { - deserializedRoutingCosmosDBSqlApiProperties.authenticationType - = AuthenticationType.fromString(reader.getString()); - } else if ("identity".equals(fieldName)) { - deserializedRoutingCosmosDBSqlApiProperties.identity = ManagedIdentity.fromJson(reader); - } else if ("primaryKey".equals(fieldName)) { - deserializedRoutingCosmosDBSqlApiProperties.primaryKey = reader.getString(); - } else if ("secondaryKey".equals(fieldName)) { - deserializedRoutingCosmosDBSqlApiProperties.secondaryKey = reader.getString(); - } else if ("partitionKeyName".equals(fieldName)) { - deserializedRoutingCosmosDBSqlApiProperties.partitionKeyName = reader.getString(); - } else if ("partitionKeyTemplate".equals(fieldName)) { - deserializedRoutingCosmosDBSqlApiProperties.partitionKeyTemplate = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRoutingCosmosDBSqlApiProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingEndpoints.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingEndpoints.java deleted file mode 100644 index 83727b58cb3b..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingEndpoints.java +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * The properties related to the custom endpoints to which your IoT hub routes messages based on the routing rules. A - * maximum of 10 custom endpoints are allowed across all endpoint types for paid hubs and only 1 custom endpoint is - * allowed across all endpoint types for free hubs. - */ -@Fluent -public final class RoutingEndpoints implements JsonSerializable { - /* - * The list of Service Bus queue endpoints that IoT hub routes the messages to, based on the routing rules. - */ - private List serviceBusQueues; - - /* - * The list of Service Bus topic endpoints that the IoT hub routes the messages to, based on the routing rules. - */ - private List serviceBusTopics; - - /* - * The list of Event Hubs endpoints that IoT hub routes messages to, based on the routing rules. This list does not - * include the built-in Event Hubs endpoint. - */ - private List eventHubs; - - /* - * The list of storage container endpoints that IoT hub routes messages to, based on the routing rules. - */ - private List storageContainers; - - /* - * The list of Cosmos DB container endpoints that IoT hub routes messages to, based on the routing rules. - */ - private List cosmosDBSqlContainers; - - /** - * Creates an instance of RoutingEndpoints class. - */ - public RoutingEndpoints() { - } - - /** - * Get the serviceBusQueues property: The list of Service Bus queue endpoints that IoT hub routes the messages to, - * based on the routing rules. - * - * @return the serviceBusQueues value. - */ - public List serviceBusQueues() { - return this.serviceBusQueues; - } - - /** - * Set the serviceBusQueues property: The list of Service Bus queue endpoints that IoT hub routes the messages to, - * based on the routing rules. - * - * @param serviceBusQueues the serviceBusQueues value to set. - * @return the RoutingEndpoints object itself. - */ - public RoutingEndpoints withServiceBusQueues(List serviceBusQueues) { - this.serviceBusQueues = serviceBusQueues; - return this; - } - - /** - * Get the serviceBusTopics property: The list of Service Bus topic endpoints that the IoT hub routes the messages - * to, based on the routing rules. - * - * @return the serviceBusTopics value. - */ - public List serviceBusTopics() { - return this.serviceBusTopics; - } - - /** - * Set the serviceBusTopics property: The list of Service Bus topic endpoints that the IoT hub routes the messages - * to, based on the routing rules. - * - * @param serviceBusTopics the serviceBusTopics value to set. - * @return the RoutingEndpoints object itself. - */ - public RoutingEndpoints withServiceBusTopics(List serviceBusTopics) { - this.serviceBusTopics = serviceBusTopics; - return this; - } - - /** - * Get the eventHubs property: The list of Event Hubs endpoints that IoT hub routes messages to, based on the - * routing rules. This list does not include the built-in Event Hubs endpoint. - * - * @return the eventHubs value. - */ - public List eventHubs() { - return this.eventHubs; - } - - /** - * Set the eventHubs property: The list of Event Hubs endpoints that IoT hub routes messages to, based on the - * routing rules. This list does not include the built-in Event Hubs endpoint. - * - * @param eventHubs the eventHubs value to set. - * @return the RoutingEndpoints object itself. - */ - public RoutingEndpoints withEventHubs(List eventHubs) { - this.eventHubs = eventHubs; - return this; - } - - /** - * Get the storageContainers property: The list of storage container endpoints that IoT hub routes messages to, - * based on the routing rules. - * - * @return the storageContainers value. - */ - public List storageContainers() { - return this.storageContainers; - } - - /** - * Set the storageContainers property: The list of storage container endpoints that IoT hub routes messages to, - * based on the routing rules. - * - * @param storageContainers the storageContainers value to set. - * @return the RoutingEndpoints object itself. - */ - public RoutingEndpoints withStorageContainers(List storageContainers) { - this.storageContainers = storageContainers; - return this; - } - - /** - * Get the cosmosDBSqlContainers property: The list of Cosmos DB container endpoints that IoT hub routes messages - * to, based on the routing rules. - * - * @return the cosmosDBSqlContainers value. - */ - public List cosmosDBSqlContainers() { - return this.cosmosDBSqlContainers; - } - - /** - * Set the cosmosDBSqlContainers property: The list of Cosmos DB container endpoints that IoT hub routes messages - * to, based on the routing rules. - * - * @param cosmosDBSqlContainers the cosmosDBSqlContainers value to set. - * @return the RoutingEndpoints object itself. - */ - public RoutingEndpoints withCosmosDBSqlContainers(List cosmosDBSqlContainers) { - this.cosmosDBSqlContainers = cosmosDBSqlContainers; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("serviceBusQueues", this.serviceBusQueues, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("serviceBusTopics", this.serviceBusTopics, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("eventHubs", this.eventHubs, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("storageContainers", this.storageContainers, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("cosmosDBSqlContainers", this.cosmosDBSqlContainers, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RoutingEndpoints from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RoutingEndpoints 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 RoutingEndpoints. - */ - public static RoutingEndpoints fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RoutingEndpoints deserializedRoutingEndpoints = new RoutingEndpoints(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("serviceBusQueues".equals(fieldName)) { - List serviceBusQueues - = reader.readArray(reader1 -> RoutingServiceBusQueueEndpointProperties.fromJson(reader1)); - deserializedRoutingEndpoints.serviceBusQueues = serviceBusQueues; - } else if ("serviceBusTopics".equals(fieldName)) { - List serviceBusTopics - = reader.readArray(reader1 -> RoutingServiceBusTopicEndpointProperties.fromJson(reader1)); - deserializedRoutingEndpoints.serviceBusTopics = serviceBusTopics; - } else if ("eventHubs".equals(fieldName)) { - List eventHubs - = reader.readArray(reader1 -> RoutingEventHubProperties.fromJson(reader1)); - deserializedRoutingEndpoints.eventHubs = eventHubs; - } else if ("storageContainers".equals(fieldName)) { - List storageContainers - = reader.readArray(reader1 -> RoutingStorageContainerProperties.fromJson(reader1)); - deserializedRoutingEndpoints.storageContainers = storageContainers; - } else if ("cosmosDBSqlContainers".equals(fieldName)) { - List cosmosDBSqlContainers - = reader.readArray(reader1 -> RoutingCosmosDBSqlApiProperties.fromJson(reader1)); - deserializedRoutingEndpoints.cosmosDBSqlContainers = cosmosDBSqlContainers; - } else { - reader.skipChildren(); - } - } - - return deserializedRoutingEndpoints; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingEventHubProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingEventHubProperties.java deleted file mode 100644 index b5c840884297..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingEventHubProperties.java +++ /dev/null @@ -1,318 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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 properties related to an event hub endpoint. - */ -@Fluent -public final class RoutingEventHubProperties implements JsonSerializable { - /* - * Id of the event hub endpoint - */ - private String id; - - /* - * The connection string of the event hub endpoint. - */ - private String connectionString; - - /* - * The url of the event hub endpoint. It must include the protocol sb:// - */ - private String endpointUri; - - /* - * Event hub name on the event hub namespace - */ - private String entityPath; - - /* - * Method used to authenticate against the event hub endpoint - */ - private AuthenticationType authenticationType; - - /* - * Managed identity properties of routing event hub endpoint. - */ - private ManagedIdentity identity; - - /* - * The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, - * hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, - * $default. Endpoint names must be unique across endpoint types. - */ - private String name; - - /* - * The subscription identifier of the event hub endpoint. - */ - private String subscriptionId; - - /* - * The name of the resource group of the event hub endpoint. - */ - private String resourceGroup; - - /** - * Creates an instance of RoutingEventHubProperties class. - */ - public RoutingEventHubProperties() { - } - - /** - * Get the id property: Id of the event hub endpoint. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Id of the event hub endpoint. - * - * @param id the id value to set. - * @return the RoutingEventHubProperties object itself. - */ - public RoutingEventHubProperties withId(String id) { - this.id = id; - return this; - } - - /** - * Get the connectionString property: The connection string of the event hub endpoint. - * - * @return the connectionString value. - */ - public String connectionString() { - return this.connectionString; - } - - /** - * Set the connectionString property: The connection string of the event hub endpoint. - * - * @param connectionString the connectionString value to set. - * @return the RoutingEventHubProperties object itself. - */ - public RoutingEventHubProperties withConnectionString(String connectionString) { - this.connectionString = connectionString; - return this; - } - - /** - * Get the endpointUri property: The url of the event hub endpoint. It must include the protocol sb://. - * - * @return the endpointUri value. - */ - public String endpointUri() { - return this.endpointUri; - } - - /** - * Set the endpointUri property: The url of the event hub endpoint. It must include the protocol sb://. - * - * @param endpointUri the endpointUri value to set. - * @return the RoutingEventHubProperties object itself. - */ - public RoutingEventHubProperties withEndpointUri(String endpointUri) { - this.endpointUri = endpointUri; - return this; - } - - /** - * Get the entityPath property: Event hub name on the event hub namespace. - * - * @return the entityPath value. - */ - public String entityPath() { - return this.entityPath; - } - - /** - * Set the entityPath property: Event hub name on the event hub namespace. - * - * @param entityPath the entityPath value to set. - * @return the RoutingEventHubProperties object itself. - */ - public RoutingEventHubProperties withEntityPath(String entityPath) { - this.entityPath = entityPath; - return this; - } - - /** - * Get the authenticationType property: Method used to authenticate against the event hub endpoint. - * - * @return the authenticationType value. - */ - public AuthenticationType authenticationType() { - return this.authenticationType; - } - - /** - * Set the authenticationType property: Method used to authenticate against the event hub endpoint. - * - * @param authenticationType the authenticationType value to set. - * @return the RoutingEventHubProperties object itself. - */ - public RoutingEventHubProperties withAuthenticationType(AuthenticationType authenticationType) { - this.authenticationType = authenticationType; - return this; - } - - /** - * Get the identity property: Managed identity properties of routing event hub endpoint. - * - * @return the identity value. - */ - public ManagedIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: Managed identity properties of routing event hub endpoint. - * - * @param identity the identity value to set. - * @return the RoutingEventHubProperties object itself. - */ - public RoutingEventHubProperties withIdentity(ManagedIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the name property: The name that identifies this endpoint. The name can only include alphanumeric characters, - * periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: - * events, fileNotifications, $default. Endpoint names must be unique across endpoint types. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name that identifies this endpoint. The name can only include alphanumeric characters, - * periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: - * events, fileNotifications, $default. Endpoint names must be unique across endpoint types. - * - * @param name the name value to set. - * @return the RoutingEventHubProperties object itself. - */ - public RoutingEventHubProperties withName(String name) { - this.name = name; - return this; - } - - /** - * Get the subscriptionId property: The subscription identifier of the event hub endpoint. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Set the subscriptionId property: The subscription identifier of the event hub endpoint. - * - * @param subscriptionId the subscriptionId value to set. - * @return the RoutingEventHubProperties object itself. - */ - public RoutingEventHubProperties withSubscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /** - * Get the resourceGroup property: The name of the resource group of the event hub endpoint. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.resourceGroup; - } - - /** - * Set the resourceGroup property: The name of the resource group of the event hub endpoint. - * - * @param resourceGroup the resourceGroup value to set. - * @return the RoutingEventHubProperties object itself. - */ - public RoutingEventHubProperties withResourceGroup(String resourceGroup) { - this.resourceGroup = resourceGroup; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("connectionString", this.connectionString); - jsonWriter.writeStringField("endpointUri", this.endpointUri); - jsonWriter.writeStringField("entityPath", this.entityPath); - jsonWriter.writeStringField("authenticationType", - this.authenticationType == null ? null : this.authenticationType.toString()); - jsonWriter.writeJsonField("identity", this.identity); - jsonWriter.writeStringField("subscriptionId", this.subscriptionId); - jsonWriter.writeStringField("resourceGroup", this.resourceGroup); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RoutingEventHubProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RoutingEventHubProperties 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 RoutingEventHubProperties. - */ - public static RoutingEventHubProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RoutingEventHubProperties deserializedRoutingEventHubProperties = new RoutingEventHubProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedRoutingEventHubProperties.name = reader.getString(); - } else if ("id".equals(fieldName)) { - deserializedRoutingEventHubProperties.id = reader.getString(); - } else if ("connectionString".equals(fieldName)) { - deserializedRoutingEventHubProperties.connectionString = reader.getString(); - } else if ("endpointUri".equals(fieldName)) { - deserializedRoutingEventHubProperties.endpointUri = reader.getString(); - } else if ("entityPath".equals(fieldName)) { - deserializedRoutingEventHubProperties.entityPath = reader.getString(); - } else if ("authenticationType".equals(fieldName)) { - deserializedRoutingEventHubProperties.authenticationType - = AuthenticationType.fromString(reader.getString()); - } else if ("identity".equals(fieldName)) { - deserializedRoutingEventHubProperties.identity = ManagedIdentity.fromJson(reader); - } else if ("subscriptionId".equals(fieldName)) { - deserializedRoutingEventHubProperties.subscriptionId = reader.getString(); - } else if ("resourceGroup".equals(fieldName)) { - deserializedRoutingEventHubProperties.resourceGroup = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRoutingEventHubProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingMessage.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingMessage.java deleted file mode 100644 index 7b608a4d97ed..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingMessage.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * Routing message. - */ -@Fluent -public final class RoutingMessage implements JsonSerializable { - /* - * Body of routing message - */ - private String body; - - /* - * App properties - */ - private Map appProperties; - - /* - * System properties - */ - private Map systemProperties; - - /** - * Creates an instance of RoutingMessage class. - */ - public RoutingMessage() { - } - - /** - * Get the body property: Body of routing message. - * - * @return the body value. - */ - public String body() { - return this.body; - } - - /** - * Set the body property: Body of routing message. - * - * @param body the body value to set. - * @return the RoutingMessage object itself. - */ - public RoutingMessage withBody(String body) { - this.body = body; - return this; - } - - /** - * Get the appProperties property: App properties. - * - * @return the appProperties value. - */ - public Map appProperties() { - return this.appProperties; - } - - /** - * Set the appProperties property: App properties. - * - * @param appProperties the appProperties value to set. - * @return the RoutingMessage object itself. - */ - public RoutingMessage withAppProperties(Map appProperties) { - this.appProperties = appProperties; - return this; - } - - /** - * Get the systemProperties property: System properties. - * - * @return the systemProperties value. - */ - public Map systemProperties() { - return this.systemProperties; - } - - /** - * Set the systemProperties property: System properties. - * - * @param systemProperties the systemProperties value to set. - * @return the RoutingMessage object itself. - */ - public RoutingMessage withSystemProperties(Map systemProperties) { - this.systemProperties = systemProperties; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("body", this.body); - jsonWriter.writeMapField("appProperties", this.appProperties, (writer, element) -> writer.writeString(element)); - jsonWriter.writeMapField("systemProperties", this.systemProperties, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RoutingMessage from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RoutingMessage 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 RoutingMessage. - */ - public static RoutingMessage fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RoutingMessage deserializedRoutingMessage = new RoutingMessage(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("body".equals(fieldName)) { - deserializedRoutingMessage.body = reader.getString(); - } else if ("appProperties".equals(fieldName)) { - Map appProperties = reader.readMap(reader1 -> reader1.getString()); - deserializedRoutingMessage.appProperties = appProperties; - } else if ("systemProperties".equals(fieldName)) { - Map systemProperties = reader.readMap(reader1 -> reader1.getString()); - deserializedRoutingMessage.systemProperties = systemProperties; - } else { - reader.skipChildren(); - } - } - - return deserializedRoutingMessage; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingProperties.java deleted file mode 100644 index dd6a9f66b548..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingProperties.java +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * The routing related properties of the IoT hub. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging. - */ -@Fluent -public final class RoutingProperties implements JsonSerializable { - /* - * The properties related to the custom endpoints to which your IoT hub routes messages based on the routing rules. - * A maximum of 10 custom endpoints are allowed across all endpoint types for paid hubs and only 1 custom endpoint - * is allowed across all endpoint types for free hubs. - */ - private RoutingEndpoints endpoints; - - /* - * The list of user-provided routing rules that the IoT hub uses to route messages to built-in and custom endpoints. - * A maximum of 100 routing rules are allowed for paid hubs and a maximum of 5 routing rules are allowed for free - * hubs. - */ - private List routes; - - /* - * The properties of the route that is used as a fall-back route when none of the conditions specified in the - * 'routes' section are met. This is an optional parameter. When this property is not set, the messages which do not - * meet any of the conditions specified in the 'routes' section get routed to the built-in eventhub endpoint. - */ - private FallbackRouteProperties fallbackRoute; - - /* - * The list of user-provided enrichments that the IoT hub applies to messages to be delivered to built-in and custom - * endpoints. See: https://aka.ms/telemetryoneventgrid - */ - private List enrichments; - - /** - * Creates an instance of RoutingProperties class. - */ - public RoutingProperties() { - } - - /** - * Get the endpoints property: The properties related to the custom endpoints to which your IoT hub routes messages - * based on the routing rules. A maximum of 10 custom endpoints are allowed across all endpoint types for paid hubs - * and only 1 custom endpoint is allowed across all endpoint types for free hubs. - * - * @return the endpoints value. - */ - public RoutingEndpoints endpoints() { - return this.endpoints; - } - - /** - * Set the endpoints property: The properties related to the custom endpoints to which your IoT hub routes messages - * based on the routing rules. A maximum of 10 custom endpoints are allowed across all endpoint types for paid hubs - * and only 1 custom endpoint is allowed across all endpoint types for free hubs. - * - * @param endpoints the endpoints value to set. - * @return the RoutingProperties object itself. - */ - public RoutingProperties withEndpoints(RoutingEndpoints endpoints) { - this.endpoints = endpoints; - return this; - } - - /** - * Get the routes property: The list of user-provided routing rules that the IoT hub uses to route messages to - * built-in and custom endpoints. A maximum of 100 routing rules are allowed for paid hubs and a maximum of 5 - * routing rules are allowed for free hubs. - * - * @return the routes value. - */ - public List routes() { - return this.routes; - } - - /** - * Set the routes property: The list of user-provided routing rules that the IoT hub uses to route messages to - * built-in and custom endpoints. A maximum of 100 routing rules are allowed for paid hubs and a maximum of 5 - * routing rules are allowed for free hubs. - * - * @param routes the routes value to set. - * @return the RoutingProperties object itself. - */ - public RoutingProperties withRoutes(List routes) { - this.routes = routes; - return this; - } - - /** - * Get the fallbackRoute property: The properties of the route that is used as a fall-back route when none of the - * conditions specified in the 'routes' section are met. This is an optional parameter. When this property is not - * set, the messages which do not meet any of the conditions specified in the 'routes' section get routed to the - * built-in eventhub endpoint. - * - * @return the fallbackRoute value. - */ - public FallbackRouteProperties fallbackRoute() { - return this.fallbackRoute; - } - - /** - * Set the fallbackRoute property: The properties of the route that is used as a fall-back route when none of the - * conditions specified in the 'routes' section are met. This is an optional parameter. When this property is not - * set, the messages which do not meet any of the conditions specified in the 'routes' section get routed to the - * built-in eventhub endpoint. - * - * @param fallbackRoute the fallbackRoute value to set. - * @return the RoutingProperties object itself. - */ - public RoutingProperties withFallbackRoute(FallbackRouteProperties fallbackRoute) { - this.fallbackRoute = fallbackRoute; - return this; - } - - /** - * Get the enrichments property: The list of user-provided enrichments that the IoT hub applies to messages to be - * delivered to built-in and custom endpoints. See: https://aka.ms/telemetryoneventgrid. - * - * @return the enrichments value. - */ - public List enrichments() { - return this.enrichments; - } - - /** - * Set the enrichments property: The list of user-provided enrichments that the IoT hub applies to messages to be - * delivered to built-in and custom endpoints. See: https://aka.ms/telemetryoneventgrid. - * - * @param enrichments the enrichments value to set. - * @return the RoutingProperties object itself. - */ - public RoutingProperties withEnrichments(List enrichments) { - this.enrichments = enrichments; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("endpoints", this.endpoints); - jsonWriter.writeArrayField("routes", this.routes, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("fallbackRoute", this.fallbackRoute); - jsonWriter.writeArrayField("enrichments", this.enrichments, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RoutingProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RoutingProperties 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 RoutingProperties. - */ - public static RoutingProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RoutingProperties deserializedRoutingProperties = new RoutingProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("endpoints".equals(fieldName)) { - deserializedRoutingProperties.endpoints = RoutingEndpoints.fromJson(reader); - } else if ("routes".equals(fieldName)) { - List routes = reader.readArray(reader1 -> RouteProperties.fromJson(reader1)); - deserializedRoutingProperties.routes = routes; - } else if ("fallbackRoute".equals(fieldName)) { - deserializedRoutingProperties.fallbackRoute = FallbackRouteProperties.fromJson(reader); - } else if ("enrichments".equals(fieldName)) { - List enrichments - = reader.readArray(reader1 -> EnrichmentProperties.fromJson(reader1)); - deserializedRoutingProperties.enrichments = enrichments; - } else { - reader.skipChildren(); - } - } - - return deserializedRoutingProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingServiceBusQueueEndpointProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingServiceBusQueueEndpointProperties.java deleted file mode 100644 index 81f9bf989c4f..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingServiceBusQueueEndpointProperties.java +++ /dev/null @@ -1,323 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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 properties related to service bus queue endpoint types. - */ -@Fluent -public final class RoutingServiceBusQueueEndpointProperties - implements JsonSerializable { - /* - * Id of the service bus queue endpoint - */ - private String id; - - /* - * The connection string of the service bus queue endpoint. - */ - private String connectionString; - - /* - * The url of the service bus queue endpoint. It must include the protocol sb:// - */ - private String endpointUri; - - /* - * Queue name on the service bus namespace - */ - private String entityPath; - - /* - * Method used to authenticate against the service bus queue endpoint - */ - private AuthenticationType authenticationType; - - /* - * Managed identity properties of routing service bus queue endpoint. - */ - private ManagedIdentity identity; - - /* - * The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, - * hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, - * $default. Endpoint names must be unique across endpoint types. The name need not be the same as the actual queue - * name. - */ - private String name; - - /* - * The subscription identifier of the service bus queue endpoint. - */ - private String subscriptionId; - - /* - * The name of the resource group of the service bus queue endpoint. - */ - private String resourceGroup; - - /** - * Creates an instance of RoutingServiceBusQueueEndpointProperties class. - */ - public RoutingServiceBusQueueEndpointProperties() { - } - - /** - * Get the id property: Id of the service bus queue endpoint. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Id of the service bus queue endpoint. - * - * @param id the id value to set. - * @return the RoutingServiceBusQueueEndpointProperties object itself. - */ - public RoutingServiceBusQueueEndpointProperties withId(String id) { - this.id = id; - return this; - } - - /** - * Get the connectionString property: The connection string of the service bus queue endpoint. - * - * @return the connectionString value. - */ - public String connectionString() { - return this.connectionString; - } - - /** - * Set the connectionString property: The connection string of the service bus queue endpoint. - * - * @param connectionString the connectionString value to set. - * @return the RoutingServiceBusQueueEndpointProperties object itself. - */ - public RoutingServiceBusQueueEndpointProperties withConnectionString(String connectionString) { - this.connectionString = connectionString; - return this; - } - - /** - * Get the endpointUri property: The url of the service bus queue endpoint. It must include the protocol sb://. - * - * @return the endpointUri value. - */ - public String endpointUri() { - return this.endpointUri; - } - - /** - * Set the endpointUri property: The url of the service bus queue endpoint. It must include the protocol sb://. - * - * @param endpointUri the endpointUri value to set. - * @return the RoutingServiceBusQueueEndpointProperties object itself. - */ - public RoutingServiceBusQueueEndpointProperties withEndpointUri(String endpointUri) { - this.endpointUri = endpointUri; - return this; - } - - /** - * Get the entityPath property: Queue name on the service bus namespace. - * - * @return the entityPath value. - */ - public String entityPath() { - return this.entityPath; - } - - /** - * Set the entityPath property: Queue name on the service bus namespace. - * - * @param entityPath the entityPath value to set. - * @return the RoutingServiceBusQueueEndpointProperties object itself. - */ - public RoutingServiceBusQueueEndpointProperties withEntityPath(String entityPath) { - this.entityPath = entityPath; - return this; - } - - /** - * Get the authenticationType property: Method used to authenticate against the service bus queue endpoint. - * - * @return the authenticationType value. - */ - public AuthenticationType authenticationType() { - return this.authenticationType; - } - - /** - * Set the authenticationType property: Method used to authenticate against the service bus queue endpoint. - * - * @param authenticationType the authenticationType value to set. - * @return the RoutingServiceBusQueueEndpointProperties object itself. - */ - public RoutingServiceBusQueueEndpointProperties withAuthenticationType(AuthenticationType authenticationType) { - this.authenticationType = authenticationType; - return this; - } - - /** - * Get the identity property: Managed identity properties of routing service bus queue endpoint. - * - * @return the identity value. - */ - public ManagedIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: Managed identity properties of routing service bus queue endpoint. - * - * @param identity the identity value to set. - * @return the RoutingServiceBusQueueEndpointProperties object itself. - */ - public RoutingServiceBusQueueEndpointProperties withIdentity(ManagedIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the name property: The name that identifies this endpoint. The name can only include alphanumeric characters, - * periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: - * events, fileNotifications, $default. Endpoint names must be unique across endpoint types. The name need not be - * the same as the actual queue name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name that identifies this endpoint. The name can only include alphanumeric characters, - * periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: - * events, fileNotifications, $default. Endpoint names must be unique across endpoint types. The name need not be - * the same as the actual queue name. - * - * @param name the name value to set. - * @return the RoutingServiceBusQueueEndpointProperties object itself. - */ - public RoutingServiceBusQueueEndpointProperties withName(String name) { - this.name = name; - return this; - } - - /** - * Get the subscriptionId property: The subscription identifier of the service bus queue endpoint. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Set the subscriptionId property: The subscription identifier of the service bus queue endpoint. - * - * @param subscriptionId the subscriptionId value to set. - * @return the RoutingServiceBusQueueEndpointProperties object itself. - */ - public RoutingServiceBusQueueEndpointProperties withSubscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /** - * Get the resourceGroup property: The name of the resource group of the service bus queue endpoint. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.resourceGroup; - } - - /** - * Set the resourceGroup property: The name of the resource group of the service bus queue endpoint. - * - * @param resourceGroup the resourceGroup value to set. - * @return the RoutingServiceBusQueueEndpointProperties object itself. - */ - public RoutingServiceBusQueueEndpointProperties withResourceGroup(String resourceGroup) { - this.resourceGroup = resourceGroup; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("connectionString", this.connectionString); - jsonWriter.writeStringField("endpointUri", this.endpointUri); - jsonWriter.writeStringField("entityPath", this.entityPath); - jsonWriter.writeStringField("authenticationType", - this.authenticationType == null ? null : this.authenticationType.toString()); - jsonWriter.writeJsonField("identity", this.identity); - jsonWriter.writeStringField("subscriptionId", this.subscriptionId); - jsonWriter.writeStringField("resourceGroup", this.resourceGroup); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RoutingServiceBusQueueEndpointProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RoutingServiceBusQueueEndpointProperties 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 RoutingServiceBusQueueEndpointProperties. - */ - public static RoutingServiceBusQueueEndpointProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RoutingServiceBusQueueEndpointProperties deserializedRoutingServiceBusQueueEndpointProperties - = new RoutingServiceBusQueueEndpointProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedRoutingServiceBusQueueEndpointProperties.name = reader.getString(); - } else if ("id".equals(fieldName)) { - deserializedRoutingServiceBusQueueEndpointProperties.id = reader.getString(); - } else if ("connectionString".equals(fieldName)) { - deserializedRoutingServiceBusQueueEndpointProperties.connectionString = reader.getString(); - } else if ("endpointUri".equals(fieldName)) { - deserializedRoutingServiceBusQueueEndpointProperties.endpointUri = reader.getString(); - } else if ("entityPath".equals(fieldName)) { - deserializedRoutingServiceBusQueueEndpointProperties.entityPath = reader.getString(); - } else if ("authenticationType".equals(fieldName)) { - deserializedRoutingServiceBusQueueEndpointProperties.authenticationType - = AuthenticationType.fromString(reader.getString()); - } else if ("identity".equals(fieldName)) { - deserializedRoutingServiceBusQueueEndpointProperties.identity = ManagedIdentity.fromJson(reader); - } else if ("subscriptionId".equals(fieldName)) { - deserializedRoutingServiceBusQueueEndpointProperties.subscriptionId = reader.getString(); - } else if ("resourceGroup".equals(fieldName)) { - deserializedRoutingServiceBusQueueEndpointProperties.resourceGroup = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRoutingServiceBusQueueEndpointProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingServiceBusTopicEndpointProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingServiceBusTopicEndpointProperties.java deleted file mode 100644 index a7e8bdf70dfb..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingServiceBusTopicEndpointProperties.java +++ /dev/null @@ -1,323 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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 properties related to service bus topic endpoint types. - */ -@Fluent -public final class RoutingServiceBusTopicEndpointProperties - implements JsonSerializable { - /* - * Id of the service bus topic endpoint - */ - private String id; - - /* - * The connection string of the service bus topic endpoint. - */ - private String connectionString; - - /* - * The url of the service bus topic endpoint. It must include the protocol sb:// - */ - private String endpointUri; - - /* - * Queue name on the service bus topic - */ - private String entityPath; - - /* - * Method used to authenticate against the service bus topic endpoint - */ - private AuthenticationType authenticationType; - - /* - * Managed identity properties of routing service bus topic endpoint. - */ - private ManagedIdentity identity; - - /* - * The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, - * hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, - * $default. Endpoint names must be unique across endpoint types. The name need not be the same as the actual topic - * name. - */ - private String name; - - /* - * The subscription identifier of the service bus topic endpoint. - */ - private String subscriptionId; - - /* - * The name of the resource group of the service bus topic endpoint. - */ - private String resourceGroup; - - /** - * Creates an instance of RoutingServiceBusTopicEndpointProperties class. - */ - public RoutingServiceBusTopicEndpointProperties() { - } - - /** - * Get the id property: Id of the service bus topic endpoint. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Id of the service bus topic endpoint. - * - * @param id the id value to set. - * @return the RoutingServiceBusTopicEndpointProperties object itself. - */ - public RoutingServiceBusTopicEndpointProperties withId(String id) { - this.id = id; - return this; - } - - /** - * Get the connectionString property: The connection string of the service bus topic endpoint. - * - * @return the connectionString value. - */ - public String connectionString() { - return this.connectionString; - } - - /** - * Set the connectionString property: The connection string of the service bus topic endpoint. - * - * @param connectionString the connectionString value to set. - * @return the RoutingServiceBusTopicEndpointProperties object itself. - */ - public RoutingServiceBusTopicEndpointProperties withConnectionString(String connectionString) { - this.connectionString = connectionString; - return this; - } - - /** - * Get the endpointUri property: The url of the service bus topic endpoint. It must include the protocol sb://. - * - * @return the endpointUri value. - */ - public String endpointUri() { - return this.endpointUri; - } - - /** - * Set the endpointUri property: The url of the service bus topic endpoint. It must include the protocol sb://. - * - * @param endpointUri the endpointUri value to set. - * @return the RoutingServiceBusTopicEndpointProperties object itself. - */ - public RoutingServiceBusTopicEndpointProperties withEndpointUri(String endpointUri) { - this.endpointUri = endpointUri; - return this; - } - - /** - * Get the entityPath property: Queue name on the service bus topic. - * - * @return the entityPath value. - */ - public String entityPath() { - return this.entityPath; - } - - /** - * Set the entityPath property: Queue name on the service bus topic. - * - * @param entityPath the entityPath value to set. - * @return the RoutingServiceBusTopicEndpointProperties object itself. - */ - public RoutingServiceBusTopicEndpointProperties withEntityPath(String entityPath) { - this.entityPath = entityPath; - return this; - } - - /** - * Get the authenticationType property: Method used to authenticate against the service bus topic endpoint. - * - * @return the authenticationType value. - */ - public AuthenticationType authenticationType() { - return this.authenticationType; - } - - /** - * Set the authenticationType property: Method used to authenticate against the service bus topic endpoint. - * - * @param authenticationType the authenticationType value to set. - * @return the RoutingServiceBusTopicEndpointProperties object itself. - */ - public RoutingServiceBusTopicEndpointProperties withAuthenticationType(AuthenticationType authenticationType) { - this.authenticationType = authenticationType; - return this; - } - - /** - * Get the identity property: Managed identity properties of routing service bus topic endpoint. - * - * @return the identity value. - */ - public ManagedIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: Managed identity properties of routing service bus topic endpoint. - * - * @param identity the identity value to set. - * @return the RoutingServiceBusTopicEndpointProperties object itself. - */ - public RoutingServiceBusTopicEndpointProperties withIdentity(ManagedIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the name property: The name that identifies this endpoint. The name can only include alphanumeric characters, - * periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: - * events, fileNotifications, $default. Endpoint names must be unique across endpoint types. The name need not be - * the same as the actual topic name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name that identifies this endpoint. The name can only include alphanumeric characters, - * periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: - * events, fileNotifications, $default. Endpoint names must be unique across endpoint types. The name need not be - * the same as the actual topic name. - * - * @param name the name value to set. - * @return the RoutingServiceBusTopicEndpointProperties object itself. - */ - public RoutingServiceBusTopicEndpointProperties withName(String name) { - this.name = name; - return this; - } - - /** - * Get the subscriptionId property: The subscription identifier of the service bus topic endpoint. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Set the subscriptionId property: The subscription identifier of the service bus topic endpoint. - * - * @param subscriptionId the subscriptionId value to set. - * @return the RoutingServiceBusTopicEndpointProperties object itself. - */ - public RoutingServiceBusTopicEndpointProperties withSubscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /** - * Get the resourceGroup property: The name of the resource group of the service bus topic endpoint. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.resourceGroup; - } - - /** - * Set the resourceGroup property: The name of the resource group of the service bus topic endpoint. - * - * @param resourceGroup the resourceGroup value to set. - * @return the RoutingServiceBusTopicEndpointProperties object itself. - */ - public RoutingServiceBusTopicEndpointProperties withResourceGroup(String resourceGroup) { - this.resourceGroup = resourceGroup; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("connectionString", this.connectionString); - jsonWriter.writeStringField("endpointUri", this.endpointUri); - jsonWriter.writeStringField("entityPath", this.entityPath); - jsonWriter.writeStringField("authenticationType", - this.authenticationType == null ? null : this.authenticationType.toString()); - jsonWriter.writeJsonField("identity", this.identity); - jsonWriter.writeStringField("subscriptionId", this.subscriptionId); - jsonWriter.writeStringField("resourceGroup", this.resourceGroup); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RoutingServiceBusTopicEndpointProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RoutingServiceBusTopicEndpointProperties 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 RoutingServiceBusTopicEndpointProperties. - */ - public static RoutingServiceBusTopicEndpointProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RoutingServiceBusTopicEndpointProperties deserializedRoutingServiceBusTopicEndpointProperties - = new RoutingServiceBusTopicEndpointProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedRoutingServiceBusTopicEndpointProperties.name = reader.getString(); - } else if ("id".equals(fieldName)) { - deserializedRoutingServiceBusTopicEndpointProperties.id = reader.getString(); - } else if ("connectionString".equals(fieldName)) { - deserializedRoutingServiceBusTopicEndpointProperties.connectionString = reader.getString(); - } else if ("endpointUri".equals(fieldName)) { - deserializedRoutingServiceBusTopicEndpointProperties.endpointUri = reader.getString(); - } else if ("entityPath".equals(fieldName)) { - deserializedRoutingServiceBusTopicEndpointProperties.entityPath = reader.getString(); - } else if ("authenticationType".equals(fieldName)) { - deserializedRoutingServiceBusTopicEndpointProperties.authenticationType - = AuthenticationType.fromString(reader.getString()); - } else if ("identity".equals(fieldName)) { - deserializedRoutingServiceBusTopicEndpointProperties.identity = ManagedIdentity.fromJson(reader); - } else if ("subscriptionId".equals(fieldName)) { - deserializedRoutingServiceBusTopicEndpointProperties.subscriptionId = reader.getString(); - } else if ("resourceGroup".equals(fieldName)) { - deserializedRoutingServiceBusTopicEndpointProperties.resourceGroup = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRoutingServiceBusTopicEndpointProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingSource.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingSource.java deleted file mode 100644 index 6d32d4f90d49..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingSource.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The source that the routing rule is to be applied to, such as DeviceMessages. - */ -public final class RoutingSource extends ExpandableStringEnum { - /** - * Invalid. - */ - public static final RoutingSource INVALID = fromString("Invalid"); - - /** - * DeviceMessages. - */ - public static final RoutingSource DEVICE_MESSAGES = fromString("DeviceMessages"); - - /** - * TwinChangeEvents. - */ - public static final RoutingSource TWIN_CHANGE_EVENTS = fromString("TwinChangeEvents"); - - /** - * DeviceLifecycleEvents. - */ - public static final RoutingSource DEVICE_LIFECYCLE_EVENTS = fromString("DeviceLifecycleEvents"); - - /** - * DeviceJobLifecycleEvents. - */ - public static final RoutingSource DEVICE_JOB_LIFECYCLE_EVENTS = fromString("DeviceJobLifecycleEvents"); - - /** - * DigitalTwinChangeEvents. - */ - public static final RoutingSource DIGITAL_TWIN_CHANGE_EVENTS = fromString("DigitalTwinChangeEvents"); - - /** - * DeviceConnectionStateEvents. - */ - public static final RoutingSource DEVICE_CONNECTION_STATE_EVENTS = fromString("DeviceConnectionStateEvents"); - - /** - * MqttBrokerMessages. - */ - public static final RoutingSource MQTT_BROKER_MESSAGES = fromString("MqttBrokerMessages"); - - /** - * Creates a new instance of RoutingSource value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RoutingSource() { - } - - /** - * Creates or finds a RoutingSource from its string representation. - * - * @param name a name to look for. - * @return the corresponding RoutingSource. - */ - public static RoutingSource fromString(String name) { - return fromString(name, RoutingSource.class); - } - - /** - * Gets known RoutingSource values. - * - * @return known RoutingSource values. - */ - public static Collection values() { - return values(RoutingSource.class); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingStorageContainerProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingStorageContainerProperties.java deleted file mode 100644 index d30de808a0ae..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingStorageContainerProperties.java +++ /dev/null @@ -1,446 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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 properties related to a storage container endpoint. - */ -@Fluent -public final class RoutingStorageContainerProperties implements JsonSerializable { - /* - * Id of the storage container endpoint - */ - private String id; - - /* - * The connection string of the storage account. - */ - private String connectionString; - - /* - * The url of the storage endpoint. It must include the protocol https:// - */ - private String endpointUri; - - /* - * Method used to authenticate against the storage endpoint - */ - private AuthenticationType authenticationType; - - /* - * Managed identity properties of routing storage endpoint. - */ - private ManagedIdentity identity; - - /* - * The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, - * hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, - * $default. Endpoint names must be unique across endpoint types. - */ - private String name; - - /* - * The subscription identifier of the storage account. - */ - private String subscriptionId; - - /* - * The name of the resource group of the storage account. - */ - private String resourceGroup; - - /* - * The name of storage container in the storage account. - */ - private String containerName; - - /* - * File name format for the blob. Default format is {iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}. All parameters - * are mandatory but can be reordered. - */ - private String fileNameFormat; - - /* - * Time interval at which blobs are written to storage. Value should be between 60 and 720 seconds. Default value is - * 300 seconds. - */ - private Integer batchFrequencyInSeconds; - - /* - * Maximum number of bytes for each blob written to storage. Value should be between 10485760(10MB) and - * 524288000(500MB). Default value is 314572800(300MB). - */ - private Integer maxChunkSizeInBytes; - - /* - * Encoding that is used to serialize messages to blobs. Supported values are 'avro', 'avrodeflate', and 'JSON'. - * Default value is 'avro'. - */ - private RoutingStorageContainerPropertiesEncoding encoding; - - /** - * Creates an instance of RoutingStorageContainerProperties class. - */ - public RoutingStorageContainerProperties() { - } - - /** - * Get the id property: Id of the storage container endpoint. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Id of the storage container endpoint. - * - * @param id the id value to set. - * @return the RoutingStorageContainerProperties object itself. - */ - public RoutingStorageContainerProperties withId(String id) { - this.id = id; - return this; - } - - /** - * Get the connectionString property: The connection string of the storage account. - * - * @return the connectionString value. - */ - public String connectionString() { - return this.connectionString; - } - - /** - * Set the connectionString property: The connection string of the storage account. - * - * @param connectionString the connectionString value to set. - * @return the RoutingStorageContainerProperties object itself. - */ - public RoutingStorageContainerProperties withConnectionString(String connectionString) { - this.connectionString = connectionString; - return this; - } - - /** - * Get the endpointUri property: The url of the storage endpoint. It must include the protocol https://. - * - * @return the endpointUri value. - */ - public String endpointUri() { - return this.endpointUri; - } - - /** - * Set the endpointUri property: The url of the storage endpoint. It must include the protocol https://. - * - * @param endpointUri the endpointUri value to set. - * @return the RoutingStorageContainerProperties object itself. - */ - public RoutingStorageContainerProperties withEndpointUri(String endpointUri) { - this.endpointUri = endpointUri; - return this; - } - - /** - * Get the authenticationType property: Method used to authenticate against the storage endpoint. - * - * @return the authenticationType value. - */ - public AuthenticationType authenticationType() { - return this.authenticationType; - } - - /** - * Set the authenticationType property: Method used to authenticate against the storage endpoint. - * - * @param authenticationType the authenticationType value to set. - * @return the RoutingStorageContainerProperties object itself. - */ - public RoutingStorageContainerProperties withAuthenticationType(AuthenticationType authenticationType) { - this.authenticationType = authenticationType; - return this; - } - - /** - * Get the identity property: Managed identity properties of routing storage endpoint. - * - * @return the identity value. - */ - public ManagedIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: Managed identity properties of routing storage endpoint. - * - * @param identity the identity value to set. - * @return the RoutingStorageContainerProperties object itself. - */ - public RoutingStorageContainerProperties withIdentity(ManagedIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the name property: The name that identifies this endpoint. The name can only include alphanumeric characters, - * periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: - * events, fileNotifications, $default. Endpoint names must be unique across endpoint types. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name that identifies this endpoint. The name can only include alphanumeric characters, - * periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: - * events, fileNotifications, $default. Endpoint names must be unique across endpoint types. - * - * @param name the name value to set. - * @return the RoutingStorageContainerProperties object itself. - */ - public RoutingStorageContainerProperties withName(String name) { - this.name = name; - return this; - } - - /** - * Get the subscriptionId property: The subscription identifier of the storage account. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Set the subscriptionId property: The subscription identifier of the storage account. - * - * @param subscriptionId the subscriptionId value to set. - * @return the RoutingStorageContainerProperties object itself. - */ - public RoutingStorageContainerProperties withSubscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /** - * Get the resourceGroup property: The name of the resource group of the storage account. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.resourceGroup; - } - - /** - * Set the resourceGroup property: The name of the resource group of the storage account. - * - * @param resourceGroup the resourceGroup value to set. - * @return the RoutingStorageContainerProperties object itself. - */ - public RoutingStorageContainerProperties withResourceGroup(String resourceGroup) { - this.resourceGroup = resourceGroup; - return this; - } - - /** - * Get the containerName property: The name of storage container in the storage account. - * - * @return the containerName value. - */ - public String containerName() { - return this.containerName; - } - - /** - * Set the containerName property: The name of storage container in the storage account. - * - * @param containerName the containerName value to set. - * @return the RoutingStorageContainerProperties object itself. - */ - public RoutingStorageContainerProperties withContainerName(String containerName) { - this.containerName = containerName; - return this; - } - - /** - * Get the fileNameFormat property: File name format for the blob. Default format is - * {iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}. All parameters are mandatory but can be reordered. - * - * @return the fileNameFormat value. - */ - public String fileNameFormat() { - return this.fileNameFormat; - } - - /** - * Set the fileNameFormat property: File name format for the blob. Default format is - * {iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}. All parameters are mandatory but can be reordered. - * - * @param fileNameFormat the fileNameFormat value to set. - * @return the RoutingStorageContainerProperties object itself. - */ - public RoutingStorageContainerProperties withFileNameFormat(String fileNameFormat) { - this.fileNameFormat = fileNameFormat; - return this; - } - - /** - * Get the batchFrequencyInSeconds property: Time interval at which blobs are written to storage. Value should be - * between 60 and 720 seconds. Default value is 300 seconds. - * - * @return the batchFrequencyInSeconds value. - */ - public Integer batchFrequencyInSeconds() { - return this.batchFrequencyInSeconds; - } - - /** - * Set the batchFrequencyInSeconds property: Time interval at which blobs are written to storage. Value should be - * between 60 and 720 seconds. Default value is 300 seconds. - * - * @param batchFrequencyInSeconds the batchFrequencyInSeconds value to set. - * @return the RoutingStorageContainerProperties object itself. - */ - public RoutingStorageContainerProperties withBatchFrequencyInSeconds(Integer batchFrequencyInSeconds) { - this.batchFrequencyInSeconds = batchFrequencyInSeconds; - return this; - } - - /** - * Get the maxChunkSizeInBytes property: Maximum number of bytes for each blob written to storage. Value should be - * between 10485760(10MB) and 524288000(500MB). Default value is 314572800(300MB). - * - * @return the maxChunkSizeInBytes value. - */ - public Integer maxChunkSizeInBytes() { - return this.maxChunkSizeInBytes; - } - - /** - * Set the maxChunkSizeInBytes property: Maximum number of bytes for each blob written to storage. Value should be - * between 10485760(10MB) and 524288000(500MB). Default value is 314572800(300MB). - * - * @param maxChunkSizeInBytes the maxChunkSizeInBytes value to set. - * @return the RoutingStorageContainerProperties object itself. - */ - public RoutingStorageContainerProperties withMaxChunkSizeInBytes(Integer maxChunkSizeInBytes) { - this.maxChunkSizeInBytes = maxChunkSizeInBytes; - return this; - } - - /** - * Get the encoding property: Encoding that is used to serialize messages to blobs. Supported values are 'avro', - * 'avrodeflate', and 'JSON'. Default value is 'avro'. - * - * @return the encoding value. - */ - public RoutingStorageContainerPropertiesEncoding encoding() { - return this.encoding; - } - - /** - * Set the encoding property: Encoding that is used to serialize messages to blobs. Supported values are 'avro', - * 'avrodeflate', and 'JSON'. Default value is 'avro'. - * - * @param encoding the encoding value to set. - * @return the RoutingStorageContainerProperties object itself. - */ - public RoutingStorageContainerProperties withEncoding(RoutingStorageContainerPropertiesEncoding encoding) { - this.encoding = encoding; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("containerName", this.containerName); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("connectionString", this.connectionString); - jsonWriter.writeStringField("endpointUri", this.endpointUri); - jsonWriter.writeStringField("authenticationType", - this.authenticationType == null ? null : this.authenticationType.toString()); - jsonWriter.writeJsonField("identity", this.identity); - jsonWriter.writeStringField("subscriptionId", this.subscriptionId); - jsonWriter.writeStringField("resourceGroup", this.resourceGroup); - jsonWriter.writeStringField("fileNameFormat", this.fileNameFormat); - jsonWriter.writeNumberField("batchFrequencyInSeconds", this.batchFrequencyInSeconds); - jsonWriter.writeNumberField("maxChunkSizeInBytes", this.maxChunkSizeInBytes); - jsonWriter.writeStringField("encoding", this.encoding == null ? null : this.encoding.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RoutingStorageContainerProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RoutingStorageContainerProperties 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 RoutingStorageContainerProperties. - */ - public static RoutingStorageContainerProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RoutingStorageContainerProperties deserializedRoutingStorageContainerProperties - = new RoutingStorageContainerProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedRoutingStorageContainerProperties.name = reader.getString(); - } else if ("containerName".equals(fieldName)) { - deserializedRoutingStorageContainerProperties.containerName = reader.getString(); - } else if ("id".equals(fieldName)) { - deserializedRoutingStorageContainerProperties.id = reader.getString(); - } else if ("connectionString".equals(fieldName)) { - deserializedRoutingStorageContainerProperties.connectionString = reader.getString(); - } else if ("endpointUri".equals(fieldName)) { - deserializedRoutingStorageContainerProperties.endpointUri = reader.getString(); - } else if ("authenticationType".equals(fieldName)) { - deserializedRoutingStorageContainerProperties.authenticationType - = AuthenticationType.fromString(reader.getString()); - } else if ("identity".equals(fieldName)) { - deserializedRoutingStorageContainerProperties.identity = ManagedIdentity.fromJson(reader); - } else if ("subscriptionId".equals(fieldName)) { - deserializedRoutingStorageContainerProperties.subscriptionId = reader.getString(); - } else if ("resourceGroup".equals(fieldName)) { - deserializedRoutingStorageContainerProperties.resourceGroup = reader.getString(); - } else if ("fileNameFormat".equals(fieldName)) { - deserializedRoutingStorageContainerProperties.fileNameFormat = reader.getString(); - } else if ("batchFrequencyInSeconds".equals(fieldName)) { - deserializedRoutingStorageContainerProperties.batchFrequencyInSeconds - = reader.getNullable(JsonReader::getInt); - } else if ("maxChunkSizeInBytes".equals(fieldName)) { - deserializedRoutingStorageContainerProperties.maxChunkSizeInBytes - = reader.getNullable(JsonReader::getInt); - } else if ("encoding".equals(fieldName)) { - deserializedRoutingStorageContainerProperties.encoding - = RoutingStorageContainerPropertiesEncoding.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedRoutingStorageContainerProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingStorageContainerPropertiesEncoding.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingStorageContainerPropertiesEncoding.java deleted file mode 100644 index 233b271c0e78..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingStorageContainerPropertiesEncoding.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Encoding that is used to serialize messages to blobs. Supported values are 'avro', 'avrodeflate', and 'JSON'. Default - * value is 'avro'. - */ -public final class RoutingStorageContainerPropertiesEncoding - extends ExpandableStringEnum { - /** - * Avro. - */ - public static final RoutingStorageContainerPropertiesEncoding AVRO = fromString("Avro"); - - /** - * AvroDeflate. - */ - public static final RoutingStorageContainerPropertiesEncoding AVRO_DEFLATE = fromString("AvroDeflate"); - - /** - * JSON. - */ - public static final RoutingStorageContainerPropertiesEncoding JSON = fromString("JSON"); - - /** - * Creates a new instance of RoutingStorageContainerPropertiesEncoding value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RoutingStorageContainerPropertiesEncoding() { - } - - /** - * Creates or finds a RoutingStorageContainerPropertiesEncoding from its string representation. - * - * @param name a name to look for. - * @return the corresponding RoutingStorageContainerPropertiesEncoding. - */ - public static RoutingStorageContainerPropertiesEncoding fromString(String name) { - return fromString(name, RoutingStorageContainerPropertiesEncoding.class); - } - - /** - * Gets known RoutingStorageContainerPropertiesEncoding values. - * - * @return known RoutingStorageContainerPropertiesEncoding values. - */ - public static Collection values() { - return values(RoutingStorageContainerPropertiesEncoding.class); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwin.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwin.java deleted file mode 100644 index 610d2796e27a..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwin.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * Twin reference input parameter. This is an optional parameter. - */ -@Fluent -public final class RoutingTwin implements JsonSerializable { - /* - * Twin Tags - */ - private Object tags; - - /* - * The properties property. - */ - private RoutingTwinProperties properties; - - /** - * Creates an instance of RoutingTwin class. - */ - public RoutingTwin() { - } - - /** - * Get the tags property: Twin Tags. - * - * @return the tags value. - */ - public Object tags() { - return this.tags; - } - - /** - * Set the tags property: Twin Tags. - * - * @param tags the tags value to set. - * @return the RoutingTwin object itself. - */ - public RoutingTwin withTags(Object tags) { - this.tags = tags; - return this; - } - - /** - * Get the properties property: The properties property. - * - * @return the properties value. - */ - public RoutingTwinProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The properties property. - * - * @param properties the properties value to set. - * @return the RoutingTwin object itself. - */ - public RoutingTwin withProperties(RoutingTwinProperties properties) { - this.properties = properties; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - if (this.tags != null) { - jsonWriter.writeUntypedField("tags", this.tags); - } - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RoutingTwin from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RoutingTwin 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 RoutingTwin. - */ - public static RoutingTwin fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RoutingTwin deserializedRoutingTwin = new RoutingTwin(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("tags".equals(fieldName)) { - deserializedRoutingTwin.tags = reader.readUntyped(); - } else if ("properties".equals(fieldName)) { - deserializedRoutingTwin.properties = RoutingTwinProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRoutingTwin; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwinProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwinProperties.java deleted file mode 100644 index 3951828034ae..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwinProperties.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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 RoutingTwinProperties model. - */ -@Fluent -public final class RoutingTwinProperties implements JsonSerializable { - /* - * Twin desired properties - */ - private Object desired; - - /* - * Twin desired properties - */ - private Object reported; - - /** - * Creates an instance of RoutingTwinProperties class. - */ - public RoutingTwinProperties() { - } - - /** - * Get the desired property: Twin desired properties. - * - * @return the desired value. - */ - public Object desired() { - return this.desired; - } - - /** - * Set the desired property: Twin desired properties. - * - * @param desired the desired value to set. - * @return the RoutingTwinProperties object itself. - */ - public RoutingTwinProperties withDesired(Object desired) { - this.desired = desired; - return this; - } - - /** - * Get the reported property: Twin desired properties. - * - * @return the reported value. - */ - public Object reported() { - return this.reported; - } - - /** - * Set the reported property: Twin desired properties. - * - * @param reported the reported value to set. - * @return the RoutingTwinProperties object itself. - */ - public RoutingTwinProperties withReported(Object reported) { - this.reported = reported; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - if (this.desired != null) { - jsonWriter.writeUntypedField("desired", this.desired); - } - if (this.reported != null) { - jsonWriter.writeUntypedField("reported", this.reported); - } - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RoutingTwinProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RoutingTwinProperties 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 RoutingTwinProperties. - */ - public static RoutingTwinProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RoutingTwinProperties deserializedRoutingTwinProperties = new RoutingTwinProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("desired".equals(fieldName)) { - deserializedRoutingTwinProperties.desired = reader.readUntyped(); - } else if ("reported".equals(fieldName)) { - deserializedRoutingTwinProperties.reported = reader.readUntyped(); - } else { - reader.skipChildren(); - } - } - - return deserializedRoutingTwinProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/SharedAccessSignatureAuthorizationRule.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/SharedAccessSignatureAuthorizationRule.java deleted file mode 100644 index 4d8e27b02835..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/SharedAccessSignatureAuthorizationRule.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.resourcemanager.iothub.fluent.models.SharedAccessSignatureAuthorizationRuleInner; - -/** - * An immutable client-side representation of SharedAccessSignatureAuthorizationRule. - */ -public interface SharedAccessSignatureAuthorizationRule { - /** - * Gets the keyName property: The name of the shared access policy. - * - * @return the keyName value. - */ - String keyName(); - - /** - * Gets the primaryKey property: The primary key. - * - * @return the primaryKey value. - */ - String primaryKey(); - - /** - * Gets the secondaryKey property: The secondary key. - * - * @return the secondaryKey value. - */ - String secondaryKey(); - - /** - * Gets the rights property: The permissions assigned to the shared access policy. - * - * @return the rights value. - */ - AccessRights rights(); - - /** - * Gets the inner com.azure.resourcemanager.iothub.fluent.models.SharedAccessSignatureAuthorizationRuleInner object. - * - * @return the inner object. - */ - SharedAccessSignatureAuthorizationRuleInner innerModel(); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/StorageEndpointProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/StorageEndpointProperties.java deleted file mode 100644 index cc47a433f2a0..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/StorageEndpointProperties.java +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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.Duration; - -/** - * The properties of the Azure Storage endpoint for file upload. - */ -@Fluent -public final class StorageEndpointProperties implements JsonSerializable { - /* - * The period of time for which the SAS URI generated by IoT Hub for file upload is valid. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-notification-configuration- - * options. - */ - private Duration sasTtlAsIso8601; - - /* - * The connection string for the Azure Storage account to which files are uploaded. - */ - private String connectionString; - - /* - * The name of the root container where you upload files. The container need not exist but should be creatable using - * the connectionString specified. - */ - private String containerName; - - /* - * Specifies authentication type being used for connecting to the storage account. - */ - private AuthenticationType authenticationType; - - /* - * Managed identity properties of storage endpoint for file upload. - */ - private ManagedIdentity identity; - - /** - * Creates an instance of StorageEndpointProperties class. - */ - public StorageEndpointProperties() { - } - - /** - * Get the sasTtlAsIso8601 property: The period of time for which the SAS URI generated by IoT Hub for file upload - * is valid. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-notification-configuration-options. - * - * @return the sasTtlAsIso8601 value. - */ - public Duration sasTtlAsIso8601() { - return this.sasTtlAsIso8601; - } - - /** - * Set the sasTtlAsIso8601 property: The period of time for which the SAS URI generated by IoT Hub for file upload - * is valid. See: - * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-notification-configuration-options. - * - * @param sasTtlAsIso8601 the sasTtlAsIso8601 value to set. - * @return the StorageEndpointProperties object itself. - */ - public StorageEndpointProperties withSasTtlAsIso8601(Duration sasTtlAsIso8601) { - this.sasTtlAsIso8601 = sasTtlAsIso8601; - return this; - } - - /** - * Get the connectionString property: The connection string for the Azure Storage account to which files are - * uploaded. - * - * @return the connectionString value. - */ - public String connectionString() { - return this.connectionString; - } - - /** - * Set the connectionString property: The connection string for the Azure Storage account to which files are - * uploaded. - * - * @param connectionString the connectionString value to set. - * @return the StorageEndpointProperties object itself. - */ - public StorageEndpointProperties withConnectionString(String connectionString) { - this.connectionString = connectionString; - return this; - } - - /** - * Get the containerName property: The name of the root container where you upload files. The container need not - * exist but should be creatable using the connectionString specified. - * - * @return the containerName value. - */ - public String containerName() { - return this.containerName; - } - - /** - * Set the containerName property: The name of the root container where you upload files. The container need not - * exist but should be creatable using the connectionString specified. - * - * @param containerName the containerName value to set. - * @return the StorageEndpointProperties object itself. - */ - public StorageEndpointProperties withContainerName(String containerName) { - this.containerName = containerName; - return this; - } - - /** - * Get the authenticationType property: Specifies authentication type being used for connecting to the storage - * account. - * - * @return the authenticationType value. - */ - public AuthenticationType authenticationType() { - return this.authenticationType; - } - - /** - * Set the authenticationType property: Specifies authentication type being used for connecting to the storage - * account. - * - * @param authenticationType the authenticationType value to set. - * @return the StorageEndpointProperties object itself. - */ - public StorageEndpointProperties withAuthenticationType(AuthenticationType authenticationType) { - this.authenticationType = authenticationType; - return this; - } - - /** - * Get the identity property: Managed identity properties of storage endpoint for file upload. - * - * @return the identity value. - */ - public ManagedIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: Managed identity properties of storage endpoint for file upload. - * - * @param identity the identity value to set. - * @return the StorageEndpointProperties object itself. - */ - public StorageEndpointProperties withIdentity(ManagedIdentity identity) { - this.identity = identity; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("connectionString", this.connectionString); - jsonWriter.writeStringField("containerName", this.containerName); - jsonWriter.writeStringField("sasTtlAsIso8601", CoreUtils.durationToStringWithDays(this.sasTtlAsIso8601)); - jsonWriter.writeStringField("authenticationType", - this.authenticationType == null ? null : this.authenticationType.toString()); - jsonWriter.writeJsonField("identity", this.identity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of StorageEndpointProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of StorageEndpointProperties 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 StorageEndpointProperties. - */ - public static StorageEndpointProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - StorageEndpointProperties deserializedStorageEndpointProperties = new StorageEndpointProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("connectionString".equals(fieldName)) { - deserializedStorageEndpointProperties.connectionString = reader.getString(); - } else if ("containerName".equals(fieldName)) { - deserializedStorageEndpointProperties.containerName = reader.getString(); - } else if ("sasTtlAsIso8601".equals(fieldName)) { - deserializedStorageEndpointProperties.sasTtlAsIso8601 - = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); - } else if ("authenticationType".equals(fieldName)) { - deserializedStorageEndpointProperties.authenticationType - = AuthenticationType.fromString(reader.getString()); - } else if ("identity".equals(fieldName)) { - deserializedStorageEndpointProperties.identity = ManagedIdentity.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedStorageEndpointProperties; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TagsResource.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TagsResource.java deleted file mode 100644 index 578c9f3f68c0..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TagsResource.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * A container holding only the Tags for a resource, allowing the user to update the tags on an IoT Hub instance. - */ -@Fluent -public final class TagsResource implements JsonSerializable { - /* - * Resource tags - */ - private Map tags; - - /** - * Creates an instance of TagsResource class. - */ - public TagsResource() { - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the TagsResource object itself. - */ - public TagsResource withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of TagsResource from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TagsResource 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 TagsResource. - */ - public static TagsResource fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - TagsResource deserializedTagsResource = new TagsResource(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedTagsResource.tags = tags; - } else { - reader.skipChildren(); - } - } - - return deserializedTagsResource; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestAllRoutesInput.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestAllRoutesInput.java deleted file mode 100644 index ad11472c3a36..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestAllRoutesInput.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * Input for testing all routes. - */ -@Fluent -public final class TestAllRoutesInput implements JsonSerializable { - /* - * Routing source - */ - private RoutingSource routingSource; - - /* - * Routing message - */ - private RoutingMessage message; - - /* - * Routing Twin Reference - */ - private RoutingTwin twin; - - /** - * Creates an instance of TestAllRoutesInput class. - */ - public TestAllRoutesInput() { - } - - /** - * Get the routingSource property: Routing source. - * - * @return the routingSource value. - */ - public RoutingSource routingSource() { - return this.routingSource; - } - - /** - * Set the routingSource property: Routing source. - * - * @param routingSource the routingSource value to set. - * @return the TestAllRoutesInput object itself. - */ - public TestAllRoutesInput withRoutingSource(RoutingSource routingSource) { - this.routingSource = routingSource; - return this; - } - - /** - * Get the message property: Routing message. - * - * @return the message value. - */ - public RoutingMessage message() { - return this.message; - } - - /** - * Set the message property: Routing message. - * - * @param message the message value to set. - * @return the TestAllRoutesInput object itself. - */ - public TestAllRoutesInput withMessage(RoutingMessage message) { - this.message = message; - return this; - } - - /** - * Get the twin property: Routing Twin Reference. - * - * @return the twin value. - */ - public RoutingTwin twin() { - return this.twin; - } - - /** - * Set the twin property: Routing Twin Reference. - * - * @param twin the twin value to set. - * @return the TestAllRoutesInput object itself. - */ - public TestAllRoutesInput withTwin(RoutingTwin twin) { - this.twin = twin; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("routingSource", this.routingSource == null ? null : this.routingSource.toString()); - jsonWriter.writeJsonField("message", this.message); - jsonWriter.writeJsonField("twin", this.twin); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of TestAllRoutesInput from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TestAllRoutesInput 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 TestAllRoutesInput. - */ - public static TestAllRoutesInput fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - TestAllRoutesInput deserializedTestAllRoutesInput = new TestAllRoutesInput(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("routingSource".equals(fieldName)) { - deserializedTestAllRoutesInput.routingSource = RoutingSource.fromString(reader.getString()); - } else if ("message".equals(fieldName)) { - deserializedTestAllRoutesInput.message = RoutingMessage.fromJson(reader); - } else if ("twin".equals(fieldName)) { - deserializedTestAllRoutesInput.twin = RoutingTwin.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedTestAllRoutesInput; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestAllRoutesResult.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestAllRoutesResult.java deleted file mode 100644 index 8fc68df89737..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestAllRoutesResult.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.resourcemanager.iothub.fluent.models.TestAllRoutesResultInner; -import java.util.List; - -/** - * An immutable client-side representation of TestAllRoutesResult. - */ -public interface TestAllRoutesResult { - /** - * Gets the routes property: JSON-serialized array of matched routes. - * - * @return the routes value. - */ - List routes(); - - /** - * Gets the inner com.azure.resourcemanager.iothub.fluent.models.TestAllRoutesResultInner object. - * - * @return the inner object. - */ - TestAllRoutesResultInner innerModel(); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestResultStatus.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestResultStatus.java deleted file mode 100644 index a5ff8fdbbe46..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestResultStatus.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Result of testing route. - */ -public final class TestResultStatus extends ExpandableStringEnum { - /** - * undefined. - */ - public static final TestResultStatus UNDEFINED = fromString("undefined"); - - /** - * false. - */ - public static final TestResultStatus FALSE = fromString("false"); - - /** - * true. - */ - public static final TestResultStatus TRUE = fromString("true"); - - /** - * Creates a new instance of TestResultStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public TestResultStatus() { - } - - /** - * Creates or finds a TestResultStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding TestResultStatus. - */ - public static TestResultStatus fromString(String name) { - return fromString(name, TestResultStatus.class); - } - - /** - * Gets known TestResultStatus values. - * - * @return known TestResultStatus values. - */ - public static Collection values() { - return values(TestResultStatus.class); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestRouteInput.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestRouteInput.java deleted file mode 100644 index 891dbfa9a29b..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestRouteInput.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.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; - -/** - * Input for testing route. - */ -@Fluent -public final class TestRouteInput implements JsonSerializable { - /* - * Routing message - */ - private RoutingMessage message; - - /* - * Route properties - */ - private RouteProperties route; - - /* - * Routing Twin Reference - */ - private RoutingTwin twin; - - /** - * Creates an instance of TestRouteInput class. - */ - public TestRouteInput() { - } - - /** - * Get the message property: Routing message. - * - * @return the message value. - */ - public RoutingMessage message() { - return this.message; - } - - /** - * Set the message property: Routing message. - * - * @param message the message value to set. - * @return the TestRouteInput object itself. - */ - public TestRouteInput withMessage(RoutingMessage message) { - this.message = message; - return this; - } - - /** - * Get the route property: Route properties. - * - * @return the route value. - */ - public RouteProperties route() { - return this.route; - } - - /** - * Set the route property: Route properties. - * - * @param route the route value to set. - * @return the TestRouteInput object itself. - */ - public TestRouteInput withRoute(RouteProperties route) { - this.route = route; - return this; - } - - /** - * Get the twin property: Routing Twin Reference. - * - * @return the twin value. - */ - public RoutingTwin twin() { - return this.twin; - } - - /** - * Set the twin property: Routing Twin Reference. - * - * @param twin the twin value to set. - * @return the TestRouteInput object itself. - */ - public TestRouteInput withTwin(RoutingTwin twin) { - this.twin = twin; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("route", this.route); - jsonWriter.writeJsonField("message", this.message); - jsonWriter.writeJsonField("twin", this.twin); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of TestRouteInput from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TestRouteInput 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 TestRouteInput. - */ - public static TestRouteInput fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - TestRouteInput deserializedTestRouteInput = new TestRouteInput(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("route".equals(fieldName)) { - deserializedTestRouteInput.route = RouteProperties.fromJson(reader); - } else if ("message".equals(fieldName)) { - deserializedTestRouteInput.message = RoutingMessage.fromJson(reader); - } else if ("twin".equals(fieldName)) { - deserializedTestRouteInput.twin = RoutingTwin.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedTestRouteInput; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestRouteResult.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestRouteResult.java deleted file mode 100644 index a4a94d73dd19..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestRouteResult.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.resourcemanager.iothub.fluent.models.TestRouteResultInner; - -/** - * An immutable client-side representation of TestRouteResult. - */ -public interface TestRouteResult { - /** - * Gets the result property: Result of testing route. - * - * @return the result value. - */ - TestResultStatus result(); - - /** - * Gets the details property: Detailed result of testing route. - * - * @return the details value. - */ - TestRouteResultDetails details(); - - /** - * Gets the inner com.azure.resourcemanager.iothub.fluent.models.TestRouteResultInner object. - * - * @return the inner object. - */ - TestRouteResultInner innerModel(); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestRouteResultDetails.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestRouteResultDetails.java deleted file mode 100644 index 0bd8831260a3..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestRouteResultDetails.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Detailed result of testing a route. - */ -@Immutable -public final class TestRouteResultDetails implements JsonSerializable { - /* - * JSON-serialized list of route compilation errors - */ - private List compilationErrors; - - /** - * Creates an instance of TestRouteResultDetails class. - */ - private TestRouteResultDetails() { - } - - /** - * Get the compilationErrors property: JSON-serialized list of route compilation errors. - * - * @return the compilationErrors value. - */ - public List compilationErrors() { - return this.compilationErrors; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("compilationErrors", this.compilationErrors, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of TestRouteResultDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TestRouteResultDetails 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 TestRouteResultDetails. - */ - public static TestRouteResultDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - TestRouteResultDetails deserializedTestRouteResultDetails = new TestRouteResultDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("compilationErrors".equals(fieldName)) { - List compilationErrors - = reader.readArray(reader1 -> RouteCompilationError.fromJson(reader1)); - deserializedTestRouteResultDetails.compilationErrors = compilationErrors; - } else { - reader.skipChildren(); - } - } - - return deserializedTestRouteResultDetails; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/UserSubscriptionQuota.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/UserSubscriptionQuota.java deleted file mode 100644 index 3c40c791c701..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/UserSubscriptionQuota.java +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * User subscription quota response. - */ -@Immutable -public final class UserSubscriptionQuota implements JsonSerializable { - /* - * IotHub type id - */ - private String id; - - /* - * Response type - */ - private String type; - - /* - * Unit of IotHub type - */ - private String unit; - - /* - * Current number of IotHub type - */ - private Integer currentValue; - - /* - * Numerical limit on IotHub type - */ - private Integer limit; - - /* - * IotHub type - */ - private Name name; - - /** - * Creates an instance of UserSubscriptionQuota class. - */ - private UserSubscriptionQuota() { - } - - /** - * Get the id property: IotHub type id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the type property: Response type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the unit property: Unit of IotHub type. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Get the currentValue property: Current number of IotHub type. - * - * @return the currentValue value. - */ - public Integer currentValue() { - return this.currentValue; - } - - /** - * Get the limit property: Numerical limit on IotHub type. - * - * @return the limit value. - */ - public Integer limit() { - return this.limit; - } - - /** - * Get the name property: IotHub type. - * - * @return the name value. - */ - public Name name() { - return this.name; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("type", this.type); - jsonWriter.writeStringField("unit", this.unit); - jsonWriter.writeNumberField("currentValue", this.currentValue); - jsonWriter.writeNumberField("limit", this.limit); - jsonWriter.writeJsonField("name", this.name); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of UserSubscriptionQuota from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of UserSubscriptionQuota 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 UserSubscriptionQuota. - */ - public static UserSubscriptionQuota fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - UserSubscriptionQuota deserializedUserSubscriptionQuota = new UserSubscriptionQuota(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedUserSubscriptionQuota.id = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedUserSubscriptionQuota.type = reader.getString(); - } else if ("unit".equals(fieldName)) { - deserializedUserSubscriptionQuota.unit = reader.getString(); - } else if ("currentValue".equals(fieldName)) { - deserializedUserSubscriptionQuota.currentValue = reader.getNullable(JsonReader::getInt); - } else if ("limit".equals(fieldName)) { - deserializedUserSubscriptionQuota.limit = reader.getNullable(JsonReader::getInt); - } else if ("name".equals(fieldName)) { - deserializedUserSubscriptionQuota.name = Name.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedUserSubscriptionQuota; - }); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/UserSubscriptionQuotaListResult.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/UserSubscriptionQuotaListResult.java deleted file mode 100644 index 17ab73385d4c..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/UserSubscriptionQuotaListResult.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.iothub.models; - -import com.azure.resourcemanager.iothub.fluent.models.UserSubscriptionQuotaListResultInner; -import java.util.List; - -/** - * An immutable client-side representation of UserSubscriptionQuotaListResult. - */ -public interface UserSubscriptionQuotaListResult { - /** - * Gets the value property: The UserSubscriptionQuota items on this page. - * - * @return the value value. - */ - List value(); - - /** - * Gets the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - String nextLink(); - - /** - * Gets the inner com.azure.resourcemanager.iothub.fluent.models.UserSubscriptionQuotaListResultInner object. - * - * @return the inner object. - */ - UserSubscriptionQuotaListResultInner innerModel(); -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/package-info.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/package-info.java deleted file mode 100644 index 4c88a2da41f8..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// 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 IotHub. - * Use this API to manage the IoT hubs in your Azure subscription. - */ -package com.azure.resourcemanager.iothub.models; diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/package-info.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/package-info.java deleted file mode 100644 index 73f0ff3ce18d..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// 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 IotHub. - * Use this API to manage the IoT hubs in your Azure subscription. - */ -package com.azure.resourcemanager.iothub; diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/module-info.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/module-info.java deleted file mode 100644 index 14f02d9e71a2..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/module-info.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -module com.azure.resourcemanager.iothub { - requires transitive com.azure.core.management; - - exports com.azure.resourcemanager.iothub; - exports com.azure.resourcemanager.iothub.fluent; - exports com.azure.resourcemanager.iothub.fluent.models; - exports com.azure.resourcemanager.iothub.models; - - opens com.azure.resourcemanager.iothub.fluent.models to com.azure.core; - opens com.azure.resourcemanager.iothub.models to com.azure.core; - opens com.azure.resourcemanager.iothub.implementation.models to com.azure.core; -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-iothub/proxy-config.json b/sdk/iothub/azure-resourcemanager-iothub/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-iothub/proxy-config.json deleted file mode 100644 index 12ac449538fe..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-iothub/proxy-config.json +++ /dev/null @@ -1 +0,0 @@ -[["com.azure.resourcemanager.iothub.implementation.CertificatesClientImpl$CertificatesService"],["com.azure.resourcemanager.iothub.implementation.IotHubResourcesClientImpl$IotHubResourcesService"],["com.azure.resourcemanager.iothub.implementation.IotHubsClientImpl$IotHubsService"],["com.azure.resourcemanager.iothub.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.iothub.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.iothub.implementation.PrivateLinkResourcesOperationsClientImpl$PrivateLinkResourcesOperationsService"],["com.azure.resourcemanager.iothub.implementation.ResourceProviderCommonsClientImpl$ResourceProviderCommonsService"]] \ No newline at end of file diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-iothub/reflect-config.json b/sdk/iothub/azure-resourcemanager-iothub/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-iothub/reflect-config.json deleted file mode 100644 index d9bd9aa7e0e4..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-iothub/reflect-config.json +++ /dev/null @@ -1 +0,0 @@ -[{"name":"com.azure.resourcemanager.iothub.models.ErrorDetails","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"com.azure.resourcemanager.iothub.models.ErrorDetailsException","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true}] \ No newline at end of file diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/resources/azure-resourcemanager-iothub.properties b/sdk/iothub/azure-resourcemanager-iothub/src/main/resources/azure-resourcemanager-iothub.properties deleted file mode 100644 index defbd48204e4..000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/resources/azure-resourcemanager-iothub.properties +++ /dev/null @@ -1 +0,0 @@ -version=${project.version} diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensions/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensions/models/ResourceIdentityType.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensions/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensions/models/ResourceIdentityType.java index fd933fa907c9..003ff2d64711 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensions/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensions/models/ResourceIdentityType.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensions/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensions/models/ResourceIdentityType.java @@ -5,7 +5,7 @@ package com.azure.resourcemanager.kubernetesconfiguration.extensions.models; /** - * Defines values for ResourceIdentityType. + * Resource Identity Type. */ public enum ResourceIdentityType { /** diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClientBuilder.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClientBuilder.java index 1fcee3b6845b..b3ee7f3e41f6 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClientBuilder.java +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationClientBuilder.java @@ -217,19 +217,7 @@ public LoadTestAdministrationClientBuilder endpoint(String endpoint) { * Service version */ @Generated - private LoadTestingServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the LoadTestAdministrationClientBuilder. - */ - @Generated - public LoadTestAdministrationClientBuilder serviceVersion(LoadTestingServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } + private LoadTestAdministrationServiceVersion serviceVersion; /* * The retry policy that will attempt to retry failed requests, if applicable. @@ -258,8 +246,8 @@ public LoadTestAdministrationClientBuilder retryPolicy(RetryPolicy retryPolicy) private LoadTestAdministrationClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - LoadTestingServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : LoadTestingServiceVersion.getLatest(); + LoadTestAdministrationServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : LoadTestAdministrationServiceVersion.getLatest(); LoadTestAdministrationClientImpl client = new LoadTestAdministrationClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; @@ -331,4 +319,16 @@ public LoadTestAdministrationClient buildClient() { } private static final ClientLogger LOGGER = new ClientLogger(LoadTestAdministrationClientBuilder.class); + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the LoadTestAdministrationClientBuilder. + */ + @Generated + public LoadTestAdministrationClientBuilder serviceVersion(LoadTestAdministrationServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } } diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationServiceVersion.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationServiceVersion.java new file mode 100644 index 000000000000..5c04ee196273 --- /dev/null +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestAdministrationServiceVersion.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.developer.loadtesting; + +import com.azure.core.util.ServiceVersion; + +/** + * Service version of LoadTestAdministrationClient. + */ +public enum LoadTestAdministrationServiceVersion implements ServiceVersion { + /** + * Enum value 2022-11-01. + */ + V2022_11_01("2022-11-01"), + + /** + * Enum value 2023-04-01-preview. + */ + V2023_04_01_PREVIEW("2023-04-01-preview"), + + /** + * Enum value 2024-03-01-preview. + */ + V2024_03_01_PREVIEW("2024-03-01-preview"), + + /** + * Enum value 2024-05-01-preview. + */ + V2024_05_01_PREVIEW("2024-05-01-preview"), + + /** + * Enum value 2024-07-01-preview. + */ + V2024_07_01_PREVIEW("2024-07-01-preview"), + + /** + * Enum value 2024-12-01-preview. + */ + V2024_12_01_PREVIEW("2024-12-01-preview"), + + /** + * Enum value 2025-03-01-preview. + */ + V2025_03_01_PREVIEW("2025-03-01-preview"), + + /** + * Enum value 2025-11-01-preview. + */ + V2025_11_01_PREVIEW("2025-11-01-preview"); + + private final String version; + + LoadTestAdministrationServiceVersion(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 LoadTestAdministrationServiceVersion}. + */ + public static LoadTestAdministrationServiceVersion getLatest() { + return V2025_11_01_PREVIEW; + } +} diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunClientBuilder.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunClientBuilder.java index 208282ea96b3..48a4f457c375 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunClientBuilder.java +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunClientBuilder.java @@ -217,19 +217,7 @@ public LoadTestRunClientBuilder endpoint(String endpoint) { * Service version */ @Generated - private LoadTestingServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the LoadTestRunClientBuilder. - */ - @Generated - public LoadTestRunClientBuilder serviceVersion(LoadTestingServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } + private LoadTestRunServiceVersion serviceVersion; /* * The retry policy that will attempt to retry failed requests, if applicable. @@ -258,8 +246,8 @@ public LoadTestRunClientBuilder retryPolicy(RetryPolicy retryPolicy) { private LoadTestRunClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - LoadTestingServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : LoadTestingServiceVersion.getLatest(); + LoadTestRunServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : LoadTestRunServiceVersion.getLatest(); LoadTestRunClientImpl client = new LoadTestRunClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; @@ -331,4 +319,16 @@ public LoadTestRunClient buildClient() { } private static final ClientLogger LOGGER = new ClientLogger(LoadTestRunClientBuilder.class); + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the LoadTestRunClientBuilder. + */ + @Generated + public LoadTestRunClientBuilder serviceVersion(LoadTestRunServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } } diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingServiceVersion.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunServiceVersion.java similarity index 83% rename from sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingServiceVersion.java rename to sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunServiceVersion.java index 04ed2a9ed79e..fc8caa122597 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestingServiceVersion.java +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/LoadTestRunServiceVersion.java @@ -7,9 +7,9 @@ import com.azure.core.util.ServiceVersion; /** - * Service version of Load TestingClient. + * Service version of LoadTestRunClient. */ -public enum LoadTestingServiceVersion implements ServiceVersion { +public enum LoadTestRunServiceVersion implements ServiceVersion { /** * Enum value 2022-11-01. */ @@ -52,7 +52,7 @@ public enum LoadTestingServiceVersion implements ServiceVersion { private final String version; - LoadTestingServiceVersion(String version) { + LoadTestRunServiceVersion(String version) { this.version = version; } @@ -67,9 +67,9 @@ public String getVersion() { /** * Gets the latest service version supported by this client library. * - * @return The latest {@link LoadTestingServiceVersion}. + * @return The latest {@link LoadTestRunServiceVersion}. */ - public static LoadTestingServiceVersion getLatest() { + public static LoadTestRunServiceVersion getLatest() { return V2025_11_01_PREVIEW; } } diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestAdministrationClientImpl.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestAdministrationClientImpl.java index d3e3908f5149..4e5b9795aaa2 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestAdministrationClientImpl.java +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestAdministrationClientImpl.java @@ -47,7 +47,7 @@ import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.TypeReference; -import com.azure.developer.loadtesting.LoadTestingServiceVersion; +import com.azure.developer.loadtesting.LoadTestAdministrationServiceVersion; import com.azure.developer.loadtesting.models.LoadTest; import com.azure.developer.loadtesting.models.OperationStatus; import java.time.Duration; @@ -81,14 +81,14 @@ public String getEndpoint() { /** * Service version. */ - private final LoadTestingServiceVersion serviceVersion; + private final LoadTestAdministrationServiceVersion serviceVersion; /** * Gets Service version. * * @return the serviceVersion value. */ - public LoadTestingServiceVersion getServiceVersion() { + public LoadTestAdministrationServiceVersion getServiceVersion() { return this.serviceVersion; } @@ -126,7 +126,7 @@ public SerializerAdapter getSerializerAdapter() { * @param endpoint * @param serviceVersion Service version. */ - public LoadTestAdministrationClientImpl(String endpoint, LoadTestingServiceVersion serviceVersion) { + public LoadTestAdministrationClientImpl(String endpoint, LoadTestAdministrationServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -139,7 +139,7 @@ public LoadTestAdministrationClientImpl(String endpoint, LoadTestingServiceVersi * @param serviceVersion Service version. */ public LoadTestAdministrationClientImpl(HttpPipeline httpPipeline, String endpoint, - LoadTestingServiceVersion serviceVersion) { + LoadTestAdministrationServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -152,7 +152,7 @@ public LoadTestAdministrationClientImpl(HttpPipeline httpPipeline, String endpoi * @param serviceVersion Service version. */ public LoadTestAdministrationClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, LoadTestingServiceVersion serviceVersion) { + String endpoint, LoadTestAdministrationServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; diff --git a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestRunClientImpl.java b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestRunClientImpl.java index 67719d03a1c7..cb0ee1cfd5ad 100644 --- a/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestRunClientImpl.java +++ b/sdk/loadtesting/azure-developer-loadtesting/src/main/java/com/azure/developer/loadtesting/implementation/LoadTestRunClientImpl.java @@ -47,7 +47,7 @@ import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.TypeReference; -import com.azure.developer.loadtesting.LoadTestingServiceVersion; +import com.azure.developer.loadtesting.LoadTestRunServiceVersion; import com.azure.developer.loadtesting.models.TestRunInsights; import java.time.Duration; import java.util.List; @@ -80,14 +80,14 @@ public String getEndpoint() { /** * Service version. */ - private final LoadTestingServiceVersion serviceVersion; + private final LoadTestRunServiceVersion serviceVersion; /** * Gets Service version. * * @return the serviceVersion value. */ - public LoadTestingServiceVersion getServiceVersion() { + public LoadTestRunServiceVersion getServiceVersion() { return this.serviceVersion; } @@ -125,7 +125,7 @@ public SerializerAdapter getSerializerAdapter() { * @param endpoint * @param serviceVersion Service version. */ - public LoadTestRunClientImpl(String endpoint, LoadTestingServiceVersion serviceVersion) { + public LoadTestRunClientImpl(String endpoint, LoadTestRunServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -137,7 +137,7 @@ public LoadTestRunClientImpl(String endpoint, LoadTestingServiceVersion serviceV * @param endpoint * @param serviceVersion Service version. */ - public LoadTestRunClientImpl(HttpPipeline httpPipeline, String endpoint, LoadTestingServiceVersion serviceVersion) { + public LoadTestRunClientImpl(HttpPipeline httpPipeline, String endpoint, LoadTestRunServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -150,7 +150,7 @@ public LoadTestRunClientImpl(HttpPipeline httpPipeline, String endpoint, LoadTes * @param serviceVersion Service version. */ public LoadTestRunClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - LoadTestingServiceVersion serviceVersion) { + LoadTestRunServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/samples/java/com/azure/resourcemanager/netapp/generated/NetAppResourceUpdateNetworkSiblingSetSamples.java b/sdk/netapp/azure-resourcemanager-netapp/src/samples/java/com/azure/resourcemanager/netapp/generated/NetAppResourceUpdateNetworkSiblingSetSamples.java index b1b9b0cd1ea2..9895725ad88d 100644 --- a/sdk/netapp/azure-resourcemanager-netapp/src/samples/java/com/azure/resourcemanager/netapp/generated/NetAppResourceUpdateNetworkSiblingSetSamples.java +++ b/sdk/netapp/azure-resourcemanager-netapp/src/samples/java/com/azure/resourcemanager/netapp/generated/NetAppResourceUpdateNetworkSiblingSetSamples.java @@ -25,7 +25,7 @@ public static void networkFeaturesUpdate(com.azure.resourcemanager.netapp.NetApp .withNetworkSiblingSetId("9760acf5-4638-11e7-9bdb-020073ca3333") .withSubnetId( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/testSubnet") - .withNetworkSiblingSetStateId("1.2345444208001578E9") + .withNetworkSiblingSetStateId("12345_44420.8001578125") .withNetworkFeatures(NetworkFeatures.STANDARD), com.azure.core.util.Context.NONE); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitorsClient.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitorsClient.java index dfa69634c7b2..3d1b0c52bc28 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitorsClient.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitorsClient.java @@ -672,9 +672,7 @@ Response latestLinkedSaaSWithResponse(String reso NewRelicMonitorResourceInner linkSaaS(String resourceGroupName, String monitorName, SaaSData body, Context context); /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -688,9 +686,7 @@ Response latestLinkedSaaSWithResponse(String reso beginResubscribe(String resourceGroupName, String monitorName); /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -706,9 +702,7 @@ Response latestLinkedSaaSWithResponse(String reso beginResubscribe(String resourceGroupName, String monitorName, ResubscribeProperties body, Context context); /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -721,9 +715,7 @@ Response latestLinkedSaaSWithResponse(String reso NewRelicMonitorResourceInner resubscribe(String resourceGroupName, String monitorName); /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsClientImpl.java index d4f181e6cbc2..8eab5a28c398 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsClientImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsClientImpl.java @@ -2461,9 +2461,7 @@ public NewRelicMonitorResourceInner linkSaaS(String resourceGroupName, String mo } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2484,9 +2482,7 @@ private Mono>> resubscribeWithResponseAsync(String res } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2505,9 +2501,7 @@ private Response resubscribeWithResponse(String resourceGroupName, S } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2527,9 +2521,7 @@ private Response resubscribeWithResponse(String resourceGroupName, S } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2549,9 +2541,7 @@ private Response resubscribeWithResponse(String resourceGroupName, S } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2571,9 +2561,7 @@ private Response resubscribeWithResponse(String resourceGroupName, S } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2592,9 +2580,7 @@ private Response resubscribeWithResponse(String resourceGroupName, S } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2613,9 +2599,7 @@ private Response resubscribeWithResponse(String resourceGroupName, S } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2635,9 +2619,7 @@ private Response resubscribeWithResponse(String resourceGroupName, S } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2655,9 +2637,7 @@ private Mono resubscribeAsync(String resourceGroup } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2674,9 +2654,7 @@ private Mono resubscribeAsync(String resourceGroup } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2692,9 +2670,7 @@ public NewRelicMonitorResourceInner resubscribe(String resourceGroupName, String } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Monitors.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Monitors.java index 8470b0991f1e..b02451a4d513 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Monitors.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Monitors.java @@ -422,9 +422,7 @@ Response latestLinkedSaaSWithResponse(String resourceG NewRelicMonitorResource linkSaaS(String resourceGroupName, String monitorName, SaaSData body, Context context); /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -436,9 +434,7 @@ Response latestLinkedSaaSWithResponse(String resourceG NewRelicMonitorResource resubscribe(String resourceGroupName, String monitorName); /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResource.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResource.java index 5b04d3b11c81..55ec484da29c 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResource.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResource.java @@ -803,9 +803,7 @@ interface WithAccountCreationSource { NewRelicMonitorResource linkSaaS(SaaSData body, Context context); /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -814,9 +812,7 @@ interface WithAccountCreationSource { NewRelicMonitorResource resubscribe(); /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param body Resubscribe Properties. * @param context The context to associate with this operation. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionConfiguration.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionConfiguration.java index cc5dfd1dbbeb..26534273ac5f 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionConfiguration.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionConfiguration.java @@ -12,7 +12,8 @@ import java.io.IOException; /** - * A representation of configuration data for a single Azure OpenAI chat extension. This will be used by a chat + * A representation of configuration data for a single Azure + * OpenAI chat extension. This will be used by a chat * completions request that should use Azure OpenAI chat extensions to augment the response behavior. * The use of this configuration is compatible only with Azure OpenAI. */ @@ -27,15 +28,16 @@ public AzureChatExtensionConfiguration() { } /* - * The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. + * The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. */ @Generated private AzureChatExtensionType type = AzureChatExtensionType.fromString("AzureChatExtensionConfiguration"); /** - * Get the type property: The label for the type of an Azure chat extension. This typically corresponds to a - * matching Azure resource. + * Get the type property: The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. * * @return the type value. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionType.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionType.java index defa41fc578c..7f47687717cc 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionType.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionType.java @@ -8,7 +8,8 @@ import java.util.Collection; /** - * A representation of configuration data for a single Azure OpenAI chat extension. This will be used by a chat + * A representation of configuration data for a single + * Azure OpenAI chat extension. This will be used by a chat * completions request that should use Azure OpenAI chat extensions to augment the response behavior. * The use of this configuration is compatible only with Azure OpenAI. */ diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionsMessageContext.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionsMessageContext.java index d61b26fd7b61..bac1e8d968e5 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionsMessageContext.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionsMessageContext.java @@ -13,7 +13,8 @@ import java.util.List; /** - * A representation of the additional context information available when Azure OpenAI chat extensions are involved + * A representation of the additional context + * information available when Azure OpenAI chat extensions are involved * in the generation of a corresponding chat completions response. This context information is only populated when * using an Azure OpenAI request configured to use a matching extension. */ @@ -28,7 +29,8 @@ private AzureChatExtensionsMessageContext() { } /* - * The contextual information associated with the Azure chat extensions used for a chat completions request. + * The contextual information associated with + * the Azure chat extensions used for a chat completions request. * These messages describe the data source retrievals, plugin invocations, and other intermediate steps taken in the * course of generating a chat completions response that was augmented by capabilities from Azure OpenAI chat * extensions. @@ -43,8 +45,8 @@ private AzureChatExtensionsMessageContext() { private String intent; /** - * Get the citations property: The contextual information associated with the Azure chat extensions used for a chat - * completions request. + * Get the citations property: The contextual information associated with + * the Azure chat extensions used for a chat completions request. * These messages describe the data source retrievals, plugin invocations, and other intermediate steps taken in the * course of generating a chat completions response that was augmented by capabilities from Azure OpenAI chat * extensions. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureCosmosDBChatExtensionConfiguration.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureCosmosDBChatExtensionConfiguration.java index aad6eaf7259c..33ef0588b5a7 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureCosmosDBChatExtensionConfiguration.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureCosmosDBChatExtensionConfiguration.java @@ -44,15 +44,16 @@ public AzureCosmosDBChatExtensionConfiguration(AzureCosmosDBChatExtensionParamet } /* - * The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. + * The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. */ @Generated private AzureChatExtensionType type = AzureChatExtensionType.AZURE_COSMOS_DB; /** - * Get the type property: The label for the type of an Azure chat extension. This typically corresponds to a - * matching Azure resource. + * Get the type property: The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. * * @return the type value. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureSearchChatExtensionConfiguration.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureSearchChatExtensionConfiguration.java index cd90945f61e0..1ec296eba568 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureSearchChatExtensionConfiguration.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureSearchChatExtensionConfiguration.java @@ -44,15 +44,16 @@ public AzureSearchChatExtensionParameters getParameters() { } /* - * The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. + * The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. */ @Generated private AzureChatExtensionType type = AzureChatExtensionType.AZURE_SEARCH; /** - * Get the type property: The label for the type of an Azure chat extension. This typically corresponds to a - * matching Azure resource. + * Get the type property: The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. * * @return the type value. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatCompletionsOptions.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatCompletionsOptions.java index e1e5f6dc20a6..45743cd435d8 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatCompletionsOptions.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatCompletionsOptions.java @@ -154,7 +154,8 @@ public final class ChatCompletionsOptions implements JsonSerializable getDataSources() { } /** - * Set the dataSources property: The configuration entries for Azure OpenAI chat extensions that use them. + * Set the dataSources property: The configuration entries for Azure OpenAI chat extensions + * that use them. * This additional specification is only compatible with Azure OpenAI. * * @param dataSources the dataSources value to set. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatMessageImageUrl.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatMessageImageUrl.java index 3dedd61fce2a..5fc4e88b2766 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatMessageImageUrl.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatMessageImageUrl.java @@ -44,6 +44,7 @@ public String getUrl() { } /* + * * The evaluation quality setting to use, which controls relative prioritization of speed, token consumption, and * accuracy. */ @@ -51,8 +52,8 @@ public String getUrl() { private ChatMessageImageDetailLevel detail; /** - * Get the detail property: The evaluation quality setting to use, which controls relative prioritization of speed, - * token consumption, and + * Get the detail property: + * The evaluation quality setting to use, which controls relative prioritization of speed, token consumption, and * accuracy. * * @return the detail value. @@ -63,8 +64,8 @@ public ChatMessageImageDetailLevel getDetail() { } /** - * Set the detail property: The evaluation quality setting to use, which controls relative prioritization of speed, - * token consumption, and + * Set the detail property: + * The evaluation quality setting to use, which controls relative prioritization of speed, token consumption, and * accuracy. * * @param detail the detail value to set. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ElasticsearchChatExtensionConfiguration.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ElasticsearchChatExtensionConfiguration.java index d567e4b46ec7..0da14dc7cecb 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ElasticsearchChatExtensionConfiguration.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ElasticsearchChatExtensionConfiguration.java @@ -44,15 +44,16 @@ public ElasticsearchChatExtensionConfiguration(ElasticsearchChatExtensionParamet } /* - * The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. + * The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. */ @Generated private AzureChatExtensionType type = AzureChatExtensionType.ELASTICSEARCH; /** - * Get the type property: The label for the type of an Azure chat extension. This typically corresponds to a - * matching Azure resource. + * Get the type property: The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. * * @return the type value. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/MongoDBChatExtensionConfiguration.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/MongoDBChatExtensionConfiguration.java index dd35a05e079d..d6c5476cdf86 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/MongoDBChatExtensionConfiguration.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/MongoDBChatExtensionConfiguration.java @@ -17,7 +17,8 @@ public final class MongoDBChatExtensionConfiguration extends AzureChatExtensionConfiguration { /* - * The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. + * The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. */ @Generated @@ -40,8 +41,8 @@ public MongoDBChatExtensionConfiguration(MongoDBChatExtensionParameters paramete } /** - * Get the type property: The label for the type of an Azure chat extension. This typically corresponds to a - * matching Azure resource. + * Get the type property: The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. * * @return the type value. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/PineconeChatExtensionConfiguration.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/PineconeChatExtensionConfiguration.java index 5be07634e49c..0f1f1e8344c2 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/PineconeChatExtensionConfiguration.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/PineconeChatExtensionConfiguration.java @@ -44,15 +44,16 @@ public PineconeChatExtensionConfiguration(PineconeChatExtensionParameters parame } /* - * The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. + * The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. */ @Generated private AzureChatExtensionType type = AzureChatExtensionType.PINECONE; /** - * Get the type property: The label for the type of an Azure chat extension. This typically corresponds to a - * matching Azure resource. + * Get the type property: The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. * * @return the type value. diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/QuotaManager.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/QuotaManager.java deleted file mode 100644 index 23c340fd0f79..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/QuotaManager.java +++ /dev/null @@ -1,480 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -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.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.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.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.quota.fluent.QuotaManagementClient; -import com.azure.resourcemanager.quota.implementation.GroupQuotaLimitsImpl; -import com.azure.resourcemanager.quota.implementation.GroupQuotaLimitsRequestsImpl; -import com.azure.resourcemanager.quota.implementation.GroupQuotaLocationSettingsImpl; -import com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionAllocationRequestsImpl; -import com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionAllocationsImpl; -import com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionRequestsImpl; -import com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionsImpl; -import com.azure.resourcemanager.quota.implementation.GroupQuotaUsagesImpl; -import com.azure.resourcemanager.quota.implementation.GroupQuotasImpl; -import com.azure.resourcemanager.quota.implementation.QuotaManagementClientBuilder; -import com.azure.resourcemanager.quota.implementation.QuotaOperationsImpl; -import com.azure.resourcemanager.quota.implementation.QuotaRequestStatusImpl; -import com.azure.resourcemanager.quota.implementation.QuotasImpl; -import com.azure.resourcemanager.quota.implementation.UsagesImpl; -import com.azure.resourcemanager.quota.models.GroupQuotaLimits; -import com.azure.resourcemanager.quota.models.GroupQuotaLimitsRequests; -import com.azure.resourcemanager.quota.models.GroupQuotaLocationSettings; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionAllocationRequests; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionAllocations; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionRequests; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptions; -import com.azure.resourcemanager.quota.models.GroupQuotaUsages; -import com.azure.resourcemanager.quota.models.GroupQuotas; -import com.azure.resourcemanager.quota.models.QuotaOperations; -import com.azure.resourcemanager.quota.models.QuotaRequestStatus; -import com.azure.resourcemanager.quota.models.Quotas; -import com.azure.resourcemanager.quota.models.Usages; -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; - -/** - * Entry point to QuotaManager. - * Microsoft Azure Quota Resource Provider. - */ -public final class QuotaManager { - private QuotaOperations quotaOperations; - - private QuotaRequestStatus quotaRequestStatus; - - private GroupQuotas groupQuotas; - - private GroupQuotaLimitsRequests groupQuotaLimitsRequests; - - private GroupQuotaUsages groupQuotaUsages; - - private GroupQuotaSubscriptions groupQuotaSubscriptions; - - private GroupQuotaSubscriptionRequests groupQuotaSubscriptionRequests; - - private GroupQuotaLimits groupQuotaLimits; - - private GroupQuotaSubscriptionAllocations groupQuotaSubscriptionAllocations; - - private GroupQuotaSubscriptionAllocationRequests groupQuotaSubscriptionAllocationRequests; - - private GroupQuotaLocationSettings groupQuotaLocationSettings; - - private Usages usages; - - private Quotas quotas; - - private final QuotaManagementClient clientObject; - - private QuotaManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = new QuotaManagementClientBuilder().pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); - } - - /** - * Creates an instance of Quota service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the Quota service API instance. - */ - public static QuotaManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return configure().authenticate(credential, profile); - } - - /** - * Creates an instance of Quota service API entry point. - * - * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. - * @param profile the Azure profile for client. - * @return the Quota service API instance. - */ - public static QuotaManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new QuotaManager(httpPipeline, profile, null); - } - - /** - * Gets a Configurable instance that can be used to create QuotaManager with optional configuration. - * - * @return the Configurable instance allowing configurations. - */ - public static Configurable configure() { - return new QuotaManager.Configurable(); - } - - /** - * The Configurable allowing configurations to be set. - */ - 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-quota.properties"); - - private HttpClient httpClient; - private HttpLogOptions httpLogOptions; - private final List policies = new ArrayList<>(); - private final List scopes = new ArrayList<>(); - private RetryPolicy retryPolicy; - private RetryOptions retryOptions; - private Duration defaultPollInterval; - - private Configurable() { - } - - /** - * Sets the http client. - * - * @param httpClient the HTTP client. - * @return the configurable object itself. - */ - public Configurable withHttpClient(HttpClient httpClient) { - this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); - return this; - } - - /** - * Sets the logging options to the HTTP pipeline. - * - * @param httpLogOptions the HTTP log options. - * @return the configurable object itself. - */ - public Configurable withLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); - return this; - } - - /** - * Adds the pipeline policy to the HTTP pipeline. - * - * @param policy the HTTP pipeline policy. - * @return the configurable object itself. - */ - public Configurable withPolicy(HttpPipelinePolicy policy) { - this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); - return this; - } - - /** - * Adds the scope to permission sets. - * - * @param scope the scope. - * @return the configurable object itself. - */ - public Configurable withScope(String scope) { - this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); - return this; - } - - /** - * Sets the retry policy to the HTTP pipeline. - * - * @param retryPolicy the HTTP pipeline retry policy. - * @return the configurable object itself. - */ - public Configurable withRetryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); - return this; - } - - /** - * Sets the retry options for the HTTP pipeline retry policy. - *

- * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. - * - * @param retryOptions the retry options for the HTTP pipeline retry policy. - * @return the configurable object itself. - */ - public Configurable withRetryOptions(RetryOptions retryOptions) { - this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); - return this; - } - - /** - * Sets the default poll interval, used when service does not provide "Retry-After" header. - * - * @param defaultPollInterval the default poll interval. - * @return the configurable object itself. - */ - public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval - = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); - if (this.defaultPollInterval.isNegative()) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); - } - return this; - } - - /** - * Creates an instance of Quota service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the Quota service API instance. - */ - public QuotaManager authenticate(TokenCredential credential, AzureProfile profile) { - 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.quota") - .append("/") - .append(clientVersion); - if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder.append(" (") - .append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.name")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")) - .append("; auto-generated)"); - } else { - userAgentBuilder.append(" (auto-generated)"); - } - - if (scopes.isEmpty()) { - scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); - } - if (retryPolicy == null) { - if (retryOptions != null) { - retryPolicy = new RetryPolicy(retryOptions); - } else { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); - } - } - List policies = new ArrayList<>(); - policies.add(new UserAgentPolicy(userAgentBuilder.toString())); - policies.add(new AddHeadersFromContextPolicy()); - policies.add(new RequestIdPolicy()); - policies.addAll(this.policies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(retryPolicy); - policies.add(new AddDatePolicy()); - policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies.addAll(this.policies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); - return new QuotaManager(httpPipeline, profile, defaultPollInterval); - } - } - - /** - * Gets the resource collection API of QuotaOperations. - * - * @return Resource collection API of QuotaOperations. - */ - public QuotaOperations quotaOperations() { - if (this.quotaOperations == null) { - this.quotaOperations = new QuotaOperationsImpl(clientObject.getQuotaOperations(), this); - } - return quotaOperations; - } - - /** - * Gets the resource collection API of QuotaRequestStatus. - * - * @return Resource collection API of QuotaRequestStatus. - */ - public QuotaRequestStatus quotaRequestStatus() { - if (this.quotaRequestStatus == null) { - this.quotaRequestStatus = new QuotaRequestStatusImpl(clientObject.getQuotaRequestStatus(), this); - } - return quotaRequestStatus; - } - - /** - * Gets the resource collection API of GroupQuotas. - * - * @return Resource collection API of GroupQuotas. - */ - public GroupQuotas groupQuotas() { - if (this.groupQuotas == null) { - this.groupQuotas = new GroupQuotasImpl(clientObject.getGroupQuotas(), this); - } - return groupQuotas; - } - - /** - * Gets the resource collection API of GroupQuotaLimitsRequests. - * - * @return Resource collection API of GroupQuotaLimitsRequests. - */ - public GroupQuotaLimitsRequests groupQuotaLimitsRequests() { - if (this.groupQuotaLimitsRequests == null) { - this.groupQuotaLimitsRequests - = new GroupQuotaLimitsRequestsImpl(clientObject.getGroupQuotaLimitsRequests(), this); - } - return groupQuotaLimitsRequests; - } - - /** - * Gets the resource collection API of GroupQuotaUsages. - * - * @return Resource collection API of GroupQuotaUsages. - */ - public GroupQuotaUsages groupQuotaUsages() { - if (this.groupQuotaUsages == null) { - this.groupQuotaUsages = new GroupQuotaUsagesImpl(clientObject.getGroupQuotaUsages(), this); - } - return groupQuotaUsages; - } - - /** - * Gets the resource collection API of GroupQuotaSubscriptions. - * - * @return Resource collection API of GroupQuotaSubscriptions. - */ - public GroupQuotaSubscriptions groupQuotaSubscriptions() { - if (this.groupQuotaSubscriptions == null) { - this.groupQuotaSubscriptions - = new GroupQuotaSubscriptionsImpl(clientObject.getGroupQuotaSubscriptions(), this); - } - return groupQuotaSubscriptions; - } - - /** - * Gets the resource collection API of GroupQuotaSubscriptionRequests. - * - * @return Resource collection API of GroupQuotaSubscriptionRequests. - */ - public GroupQuotaSubscriptionRequests groupQuotaSubscriptionRequests() { - if (this.groupQuotaSubscriptionRequests == null) { - this.groupQuotaSubscriptionRequests - = new GroupQuotaSubscriptionRequestsImpl(clientObject.getGroupQuotaSubscriptionRequests(), this); - } - return groupQuotaSubscriptionRequests; - } - - /** - * Gets the resource collection API of GroupQuotaLimits. - * - * @return Resource collection API of GroupQuotaLimits. - */ - public GroupQuotaLimits groupQuotaLimits() { - if (this.groupQuotaLimits == null) { - this.groupQuotaLimits = new GroupQuotaLimitsImpl(clientObject.getGroupQuotaLimits(), this); - } - return groupQuotaLimits; - } - - /** - * Gets the resource collection API of GroupQuotaSubscriptionAllocations. - * - * @return Resource collection API of GroupQuotaSubscriptionAllocations. - */ - public GroupQuotaSubscriptionAllocations groupQuotaSubscriptionAllocations() { - if (this.groupQuotaSubscriptionAllocations == null) { - this.groupQuotaSubscriptionAllocations - = new GroupQuotaSubscriptionAllocationsImpl(clientObject.getGroupQuotaSubscriptionAllocations(), this); - } - return groupQuotaSubscriptionAllocations; - } - - /** - * Gets the resource collection API of GroupQuotaSubscriptionAllocationRequests. - * - * @return Resource collection API of GroupQuotaSubscriptionAllocationRequests. - */ - public GroupQuotaSubscriptionAllocationRequests groupQuotaSubscriptionAllocationRequests() { - if (this.groupQuotaSubscriptionAllocationRequests == null) { - this.groupQuotaSubscriptionAllocationRequests = new GroupQuotaSubscriptionAllocationRequestsImpl( - clientObject.getGroupQuotaSubscriptionAllocationRequests(), this); - } - return groupQuotaSubscriptionAllocationRequests; - } - - /** - * Gets the resource collection API of GroupQuotaLocationSettings. - * - * @return Resource collection API of GroupQuotaLocationSettings. - */ - public GroupQuotaLocationSettings groupQuotaLocationSettings() { - if (this.groupQuotaLocationSettings == null) { - this.groupQuotaLocationSettings - = new GroupQuotaLocationSettingsImpl(clientObject.getGroupQuotaLocationSettings(), this); - } - return groupQuotaLocationSettings; - } - - /** - * Gets the resource collection API of Usages. - * - * @return Resource collection API of Usages. - */ - public Usages usages() { - if (this.usages == null) { - this.usages = new UsagesImpl(clientObject.getUsages(), this); - } - return usages; - } - - /** - * Gets the resource collection API of Quotas. It manages CurrentQuotaLimitBase. - * - * @return Resource collection API of Quotas. - */ - public Quotas quotas() { - if (this.quotas == null) { - this.quotas = new QuotasImpl(clientObject.getQuotas(), this); - } - return quotas; - } - - /** - * Gets wrapped service client QuotaManagementClient providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. - * - * @return Wrapped service client QuotaManagementClient. - */ - public QuotaManagementClient serviceClient() { - return this.clientObject; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLimitsClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLimitsClient.java deleted file mode 100644 index 69068f5120c3..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLimitsClient.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitListInner; - -/** - * An instance of this class provides access to all the operations defined in GroupQuotaLimitsClient. - */ -public interface GroupQuotaLimitsClient { - /** - * Gets the GroupQuotaLimits for the specified resource provider and location for resource names passed in - * $filter=resourceName eq {SKU}. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @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 GroupQuotaLimits for the specified resource provider and location for resource names passed in - * $filter=resourceName eq {SKU} along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context); - - /** - * Gets the GroupQuotaLimits for the specified resource provider and location for resource names passed in - * $filter=resourceName eq {SKU}. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotaLimits for the specified resource provider and location for resource names passed in - * $filter=resourceName eq {SKU}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotaLimitListInner list(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLimitsRequestsClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLimitsRequestsClient.java deleted file mode 100644 index f91d6128a63e..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLimitsRequestsClient.java +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitListInner; -import com.azure.resourcemanager.quota.fluent.models.SubmittedResourceRequestStatusInner; - -/** - * An instance of this class provides access to all the operations defined in GroupQuotaLimitsRequestsClient. - */ -public interface GroupQuotaLimitsRequestsClient { - /** - * Get API to check the status of a GroupQuota request by requestId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators \r\n|---------------------|------------------------\n\r\n location eq - * {location} and resource eq {resourceName}\n Example: $filter=location eq eastus and resourceName eq cores. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return aPI to check the status of a GroupQuota request by requestId as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter); - - /** - * Get API to check the status of a GroupQuota request by requestId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators \r\n|---------------------|------------------------\n\r\n location eq - * {location} and resource eq {resourceName}\n Example: $filter=location eq eastus and resourceName eq cores. - * @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 aPI to check the status of a GroupQuota request by requestId as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter, Context context); - - /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are - * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a - * new groupQuota request. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 list of Group Quota Limit details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GroupQuotaLimitListInner> beginUpdate(String managementGroupId, - String groupQuotaName, String resourceProviderName, String location); - - /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are - * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a - * new groupQuota request. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @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 list of Group Quota Limit details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GroupQuotaLimitListInner> beginUpdate(String managementGroupId, - String groupQuotaName, String resourceProviderName, String location, GroupQuotaLimitListInner groupQuotaRequest, - Context context); - - /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are - * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a - * new groupQuota request. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Group Quota Limit details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotaLimitListInner update(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location); - - /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are - * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a - * new groupQuota request. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Group Quota Limit details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotaLimitListInner update(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location, GroupQuotaLimitListInner groupQuotaRequest, Context context); - - /** - * Get API to check the status of a GroupQuota request by requestId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param requestId Request 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 aPI to check the status of a GroupQuota request by requestId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String managementGroupId, String groupQuotaName, - String requestId, Context context); - - /** - * Get API to check the status of a GroupQuota request by requestId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param requestId Request 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 aPI to check the status of a GroupQuota request by requestId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SubmittedResourceRequestStatusInner get(String managementGroupId, String groupQuotaName, String requestId); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLocationSettingsClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLocationSettingsClient.java deleted file mode 100644 index 253db0d188a7..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaLocationSettingsClient.java +++ /dev/null @@ -1,275 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.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.SyncPoller; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEnforcementStatusInner; - -/** - * An instance of this class provides access to all the operations defined in GroupQuotaLocationSettingsClient. - */ -public interface GroupQuotaLocationSettingsClient { - /** - * Gets the GroupQuotas enforcement settings for the ResourceProvider/location. The locations, where GroupQuota - * enforcement is not enabled will return Not Found. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @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 GroupQuotas enforcement settings for the ResourceProvider/location along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context); - - /** - * Gets the GroupQuotas enforcement settings for the ResourceProvider/location. The locations, where GroupQuota - * enforcement is not enabled will return Not Found. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas enforcement settings for the ResourceProvider/location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotasEnforcementStatusInner get(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location); - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Then delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GroupQuotasEnforcementStatusInner> beginCreateOrUpdate( - String managementGroupId, String groupQuotaName, String resourceProviderName, String location); - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Then delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GroupQuotasEnforcementStatusInner> beginCreateOrUpdate( - String managementGroupId, String groupQuotaName, String resourceProviderName, String location, - GroupQuotasEnforcementStatusInner locationSettings, Context context); - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Then delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotasEnforcementStatusInner createOrUpdate(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location); - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Then delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @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 GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotasEnforcementStatusInner createOrUpdate(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementStatusInner locationSettings, - Context context); - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GroupQuotasEnforcementStatusInner> - beginUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, String location); - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GroupQuotasEnforcementStatusInner> beginUpdate( - String managementGroupId, String groupQuotaName, String resourceProviderName, String location, - GroupQuotasEnforcementStatusInner locationSettings, Context context); - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotasEnforcementStatusInner update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location); - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @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 GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotasEnforcementStatusInner update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementStatusInner locationSettings, - Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionAllocationRequestsClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionAllocationRequestsClient.java deleted file mode 100644 index 8995f5210bae..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionAllocationRequestsClient.java +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.quota.fluent.models.QuotaAllocationRequestStatusInner; -import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsListInner; - -/** - * An instance of this class provides access to all the operations defined in - * GroupQuotaSubscriptionAllocationRequestsClient. - */ -public interface GroupQuotaSubscriptionAllocationRequestsClient { - /** - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param allocateQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 subscription quota list. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SubscriptionQuotaAllocationsListInner> beginUpdate( - String managementGroupId, String groupQuotaName, String resourceProviderName, String location, - SubscriptionQuotaAllocationsListInner allocateQuotaRequest); - - /** - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param allocateQuotaRequest Quota requests payload. - * @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 subscription quota list. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SubscriptionQuotaAllocationsListInner> beginUpdate( - String managementGroupId, String groupQuotaName, String resourceProviderName, String location, - SubscriptionQuotaAllocationsListInner allocateQuotaRequest, Context context); - - /** - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param allocateQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 quota list. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SubscriptionQuotaAllocationsListInner update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest); - - /** - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param allocateQuotaRequest Quota requests payload. - * @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 quota list. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SubscriptionQuotaAllocationsListInner update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest, - Context context); - - /** - * Get the quota allocation request status for the subscriptionId by allocationId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param allocationId Request 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 quota allocation request status for the subscriptionId by allocationId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String allocationId, Context context); - - /** - * Get the quota allocation request status for the subscriptionId by allocationId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param allocationId Request 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 quota allocation request status for the subscriptionId by allocationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - QuotaAllocationRequestStatusInner get(String managementGroupId, String groupQuotaName, String resourceProviderName, - String allocationId); - - /** - * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is - * required. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 quotaAllocationRequests for a resourceProvider/location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter); - - /** - * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is - * required. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @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 the quotaAllocationRequests for a resourceProvider/location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter, Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionAllocationsClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionAllocationsClient.java deleted file mode 100644 index a7a25cc4ace4..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionAllocationsClient.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsListInner; - -/** - * An instance of this class provides access to all the operations defined in GroupQuotaSubscriptionAllocationsClient. - */ -public interface GroupQuotaSubscriptionAllocationsClient { - /** - * Gets all the quota allocated to a subscription for the specified resource provider and location for resource - * names passed in $filter=resourceName eq {SKU}. This will include the GroupQuota and total quota allocated to the - * subscription. Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @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 the quota allocated to a subscription for the specified resource provider and location for resource - * names passed in $filter=resourceName eq {SKU} along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context); - - /** - * Gets all the quota allocated to a subscription for the specified resource provider and location for resource - * names passed in $filter=resourceName eq {SKU}. This will include the GroupQuota and total quota allocated to the - * subscription. Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 quota allocated to a subscription for the specified resource provider and location for resource - * names passed in $filter=resourceName eq {SKU}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SubscriptionQuotaAllocationsListInner list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionRequestsClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionRequestsClient.java deleted file mode 100644 index a372df6ad06b..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionRequestsClient.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaSubscriptionRequestStatusInner; - -/** - * An instance of this class provides access to all the operations defined in GroupQuotaSubscriptionRequestsClient. - */ -public interface GroupQuotaSubscriptionRequestsClient { - /** - * Get API to check the status of a subscriptionIds request by requestId. Use the polling API - OperationsStatus URI - * specified in Azure-AsyncOperation header field, with retry-after duration in seconds to check the intermediate - * status. This API provides the finals status with the request details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param requestId Request 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 aPI to check the status of a subscriptionIds request by requestId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String managementGroupId, String groupQuotaName, - String requestId, Context context); - - /** - * Get API to check the status of a subscriptionIds request by requestId. Use the polling API - OperationsStatus URI - * specified in Azure-AsyncOperation header field, with retry-after duration in seconds to check the intermediate - * status. This API provides the finals status with the request details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param requestId Request 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 aPI to check the status of a subscriptionIds request by requestId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotaSubscriptionRequestStatusInner get(String managementGroupId, String groupQuotaName, String requestId); - - /** - * List API to check the status of a subscriptionId requests by requestId. Request history is maintained for 1 year. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionRequests Status as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId, String groupQuotaName); - - /** - * List API to check the status of a subscriptionId requests by requestId. Request history is maintained for 1 year. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionRequests Status as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId, String groupQuotaName, - Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionsClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionsClient.java deleted file mode 100644 index dd6d2ea7e695..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaSubscriptionsClient.java +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaSubscriptionIdInner; - -/** - * An instance of this class provides access to all the operations defined in GroupQuotaSubscriptionsClient. - */ -public interface GroupQuotaSubscriptionsClient { - /** - * Returns the subscriptionIds along with its provisioning state for being associated with the GroupQuota. If the - * subscription is not a member of GroupQuota, it will return 404, else 200. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @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 this represents a Azure subscriptionId that is associated with a GroupQuotasEntity along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String managementGroupId, String groupQuotaName, - Context context); - - /** - * Returns the subscriptionIds along with its provisioning state for being associated with the GroupQuota. If the - * subscription is not a member of GroupQuota, it will return 404, else 200. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotaSubscriptionIdInner get(String managementGroupId, String groupQuotaName); - - /** - * Adds a subscription to GroupQuotas. The subscriptions will be validated based on the additionalAttributes defined - * in the GroupQuota. The additionalAttributes works as filter for the subscriptions, which can be included in the - * GroupQuotas. The request's TenantId is validated against the subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 this represents a Azure subscriptionId that is associated with a - * GroupQuotasEntity. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GroupQuotaSubscriptionIdInner> - beginCreateOrUpdate(String managementGroupId, String groupQuotaName); - - /** - * Adds a subscription to GroupQuotas. The subscriptions will be validated based on the additionalAttributes defined - * in the GroupQuota. The additionalAttributes works as filter for the subscriptions, which can be included in the - * GroupQuotas. The request's TenantId is validated against the subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @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 this represents a Azure subscriptionId that is associated with a - * GroupQuotasEntity. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GroupQuotaSubscriptionIdInner> - beginCreateOrUpdate(String managementGroupId, String groupQuotaName, Context context); - - /** - * Adds a subscription to GroupQuotas. The subscriptions will be validated based on the additionalAttributes defined - * in the GroupQuota. The additionalAttributes works as filter for the subscriptions, which can be included in the - * GroupQuotas. The request's TenantId is validated against the subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotaSubscriptionIdInner createOrUpdate(String managementGroupId, String groupQuotaName); - - /** - * Adds a subscription to GroupQuotas. The subscriptions will be validated based on the additionalAttributes defined - * in the GroupQuota. The additionalAttributes works as filter for the subscriptions, which can be included in the - * GroupQuotas. The request's TenantId is validated against the subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @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 this represents a Azure subscriptionId that is associated with a GroupQuotasEntity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotaSubscriptionIdInner createOrUpdate(String managementGroupId, String groupQuotaName, Context context); - - /** - * Updates the GroupQuotas with the subscription to add to the subscriptions list. The subscriptions will be - * validated if additionalAttributes are defined in the GroupQuota. The request's TenantId is validated against the - * subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 this represents a Azure subscriptionId that is associated with a - * GroupQuotasEntity. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GroupQuotaSubscriptionIdInner> - beginUpdate(String managementGroupId, String groupQuotaName); - - /** - * Updates the GroupQuotas with the subscription to add to the subscriptions list. The subscriptions will be - * validated if additionalAttributes are defined in the GroupQuota. The request's TenantId is validated against the - * subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @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 this represents a Azure subscriptionId that is associated with a - * GroupQuotasEntity. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GroupQuotaSubscriptionIdInner> - beginUpdate(String managementGroupId, String groupQuotaName, Context context); - - /** - * Updates the GroupQuotas with the subscription to add to the subscriptions list. The subscriptions will be - * validated if additionalAttributes are defined in the GroupQuota. The request's TenantId is validated against the - * subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotaSubscriptionIdInner update(String managementGroupId, String groupQuotaName); - - /** - * Updates the GroupQuotas with the subscription to add to the subscriptions list. The subscriptions will be - * validated if additionalAttributes are defined in the GroupQuota. The request's TenantId is validated against the - * subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @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 this represents a Azure subscriptionId that is associated with a GroupQuotasEntity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotaSubscriptionIdInner update(String managementGroupId, String groupQuotaName, Context context); - - /** - * Removes the subscription from GroupQuotas. The request's TenantId is validated against the subscription's - * TenantId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 managementGroupId, String groupQuotaName); - - /** - * Removes the subscription from GroupQuotas. The request's TenantId is validated against the subscription's - * TenantId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @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 managementGroupId, String groupQuotaName, Context context); - - /** - * Removes the subscription from GroupQuotas. The request's TenantId is validated against the subscription's - * TenantId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 managementGroupId, String groupQuotaName); - - /** - * Removes the subscription from GroupQuotas. The request's TenantId is validated against the subscription's - * TenantId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @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 managementGroupId, String groupQuotaName, Context context); - - /** - * Returns a list of the subscriptionIds associated with the GroupQuotas. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionIds as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId, String groupQuotaName); - - /** - * Returns a list of the subscriptionIds associated with the GroupQuotas. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionIds as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId, String groupQuotaName, Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaUsagesClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaUsagesClient.java deleted file mode 100644 index 64f86435c1bb..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotaUsagesClient.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.quota.fluent.models.ResourceUsagesInner; - -/** - * An instance of this class provides access to all the operations defined in GroupQuotaUsagesClient. - */ -public interface GroupQuotaUsagesClient { - /** - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas usages and limits(quota) as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location); - - /** - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @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 GroupQuotas usages and limits(quota) as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotasClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotasClient.java deleted file mode 100644 index e104c84aa8e0..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/GroupQuotasClient.java +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEntityInner; -import com.azure.resourcemanager.quota.models.GroupQuotasEntityPatch; - -/** - * An instance of this class provides access to all the operations defined in GroupQuotasClient. - */ -public interface GroupQuotasClient { - /** - * Gets the GroupQuotas for the name passed. It will return the GroupQuotas properties only. The details on group - * quota can be access from the group quota APIs. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @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 GroupQuotas for the name passed along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String managementGroupId, String groupQuotaName, Context context); - - /** - * Gets the GroupQuotas for the name passed. It will return the GroupQuotas properties only. The details on group - * quota can be access from the group quota APIs. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas for the name passed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotasEntityInner get(String managementGroupId, String groupQuotaName); - - /** - * Creates a new GroupQuota for the name passed. A RequestId will be returned by the Service. The status can be - * polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GroupQuotasEntityInner> beginCreateOrUpdate(String managementGroupId, - String groupQuotaName); - - /** - * Creates a new GroupQuota for the name passed. A RequestId will be returned by the Service. The status can be - * polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotaPutRequestBody The GroupQuota body details for creation or update of a GroupQuota entity. - * @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 properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GroupQuotasEntityInner> beginCreateOrUpdate(String managementGroupId, - String groupQuotaName, GroupQuotasEntityInner groupQuotaPutRequestBody, Context context); - - /** - * Creates a new GroupQuota for the name passed. A RequestId will be returned by the Service. The status can be - * polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotasEntityInner createOrUpdate(String managementGroupId, String groupQuotaName); - - /** - * Creates a new GroupQuota for the name passed. A RequestId will be returned by the Service. The status can be - * polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotaPutRequestBody The GroupQuota body details for creation or update of a GroupQuota entity. - * @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 properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotasEntityInner createOrUpdate(String managementGroupId, String groupQuotaName, - GroupQuotasEntityInner groupQuotaPutRequestBody, Context context); - - /** - * Updates the GroupQuotas for the name passed. A GroupQuotas RequestId will be returned by the Service. The status - * can be polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * Any change in the filters will be applicable to the future quota assignments, existing quota allocated to - * subscriptions from the GroupQuotas remains unchanged. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GroupQuotasEntityInner> beginUpdate(String managementGroupId, - String groupQuotaName); - - /** - * Updates the GroupQuotas for the name passed. A GroupQuotas RequestId will be returned by the Service. The status - * can be polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * Any change in the filters will be applicable to the future quota assignments, existing quota allocated to - * subscriptions from the GroupQuotas remains unchanged. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotasPatchRequestBody The GroupQuotas Patch Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GroupQuotasEntityInner> beginUpdate(String managementGroupId, - String groupQuotaName, GroupQuotasEntityPatch groupQuotasPatchRequestBody, Context context); - - /** - * Updates the GroupQuotas for the name passed. A GroupQuotas RequestId will be returned by the Service. The status - * can be polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * Any change in the filters will be applicable to the future quota assignments, existing quota allocated to - * subscriptions from the GroupQuotas remains unchanged. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotasEntityInner update(String managementGroupId, String groupQuotaName); - - /** - * Updates the GroupQuotas for the name passed. A GroupQuotas RequestId will be returned by the Service. The status - * can be polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * Any change in the filters will be applicable to the future quota assignments, existing quota allocated to - * subscriptions from the GroupQuotas remains unchanged. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotasPatchRequestBody The GroupQuotas Patch Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GroupQuotasEntityInner update(String managementGroupId, String groupQuotaName, - GroupQuotasEntityPatch groupQuotasPatchRequestBody, Context context); - - /** - * Deletes the GroupQuotas for the name passed. All the remaining shareQuota in the GroupQuotas will be lost. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 managementGroupId, String groupQuotaName); - - /** - * Deletes the GroupQuotas for the name passed. All the remaining shareQuota in the GroupQuotas will be lost. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @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 managementGroupId, String groupQuotaName, Context context); - - /** - * Deletes the GroupQuotas for the name passed. All the remaining shareQuota in the GroupQuotas will be lost. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 managementGroupId, String groupQuotaName); - - /** - * Deletes the GroupQuotas for the name passed. All the remaining shareQuota in the GroupQuotas will be lost. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @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 managementGroupId, String groupQuotaName, Context context); - - /** - * Lists GroupQuotas for the scope passed. It will return the GroupQuotas QuotaEntity properties only.The details on - * group quota can be access from the group quota APIs. - * - * @param managementGroupId The management group 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 list of Group Quotas at MG level as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId); - - /** - * Lists GroupQuotas for the scope passed. It will return the GroupQuotas QuotaEntity properties only.The details on - * group quota can be access from the group quota APIs. - * - * @param managementGroupId The management group 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 list of Group Quotas at MG level as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String managementGroupId, Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaManagementClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaManagementClient.java deleted file mode 100644 index 3861cc6fb62c..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaManagementClient.java +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** - * The interface for QuotaManagementClient class. - */ -public interface QuotaManagementClient { - /** - * Gets Service host. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * 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. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the QuotaOperationsClient object to access its operations. - * - * @return the QuotaOperationsClient object. - */ - QuotaOperationsClient getQuotaOperations(); - - /** - * Gets the QuotaRequestStatusClient object to access its operations. - * - * @return the QuotaRequestStatusClient object. - */ - QuotaRequestStatusClient getQuotaRequestStatus(); - - /** - * Gets the GroupQuotasClient object to access its operations. - * - * @return the GroupQuotasClient object. - */ - GroupQuotasClient getGroupQuotas(); - - /** - * Gets the GroupQuotaLimitsRequestsClient object to access its operations. - * - * @return the GroupQuotaLimitsRequestsClient object. - */ - GroupQuotaLimitsRequestsClient getGroupQuotaLimitsRequests(); - - /** - * Gets the GroupQuotaUsagesClient object to access its operations. - * - * @return the GroupQuotaUsagesClient object. - */ - GroupQuotaUsagesClient getGroupQuotaUsages(); - - /** - * Gets the GroupQuotaSubscriptionsClient object to access its operations. - * - * @return the GroupQuotaSubscriptionsClient object. - */ - GroupQuotaSubscriptionsClient getGroupQuotaSubscriptions(); - - /** - * Gets the GroupQuotaSubscriptionRequestsClient object to access its operations. - * - * @return the GroupQuotaSubscriptionRequestsClient object. - */ - GroupQuotaSubscriptionRequestsClient getGroupQuotaSubscriptionRequests(); - - /** - * Gets the GroupQuotaLimitsClient object to access its operations. - * - * @return the GroupQuotaLimitsClient object. - */ - GroupQuotaLimitsClient getGroupQuotaLimits(); - - /** - * Gets the GroupQuotaSubscriptionAllocationsClient object to access its operations. - * - * @return the GroupQuotaSubscriptionAllocationsClient object. - */ - GroupQuotaSubscriptionAllocationsClient getGroupQuotaSubscriptionAllocations(); - - /** - * Gets the GroupQuotaSubscriptionAllocationRequestsClient object to access its operations. - * - * @return the GroupQuotaSubscriptionAllocationRequestsClient object. - */ - GroupQuotaSubscriptionAllocationRequestsClient getGroupQuotaSubscriptionAllocationRequests(); - - /** - * Gets the GroupQuotaLocationSettingsClient object to access its operations. - * - * @return the GroupQuotaLocationSettingsClient object. - */ - GroupQuotaLocationSettingsClient getGroupQuotaLocationSettings(); - - /** - * Gets the UsagesClient object to access its operations. - * - * @return the UsagesClient object. - */ - UsagesClient getUsages(); - - /** - * Gets the QuotasClient object to access its operations. - * - * @return the QuotasClient object. - */ - QuotasClient getQuotas(); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaOperationsClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaOperationsClient.java deleted file mode 100644 index b263131e08ea..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaOperationsClient.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.quota.fluent.models.OperationResponseInner; - -/** - * An instance of this class provides access to all the operations defined in QuotaOperationsClient. - */ -public interface QuotaOperationsClient { - /** - * List the operations for the provider. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of connected cluster API operations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List the operations for the provider. - * - * @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 paginated list of connected cluster API operations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaRequestStatusClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaRequestStatusClient.java deleted file mode 100644 index 426db174ca05..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaRequestStatusClient.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.quota.fluent.models.QuotaRequestDetailsInner; - -/** - * An instance of this class provides access to all the operations defined in QuotaRequestStatusClient. - */ -public interface QuotaRequestStatusClient { - /** - * Get the quota request details and status by quota request ID for the resources of the resource provider at a - * specific location. The quota request ID **id** is returned in the response of the PUT operation. - * - * @param id Quota request ID. - * @param scope The fully qualified Azure Resource manager identifier of the 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 quota request details and status by quota request ID for the resources of the resource provider at a - * specific location along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String id, String scope, Context context); - - /** - * Get the quota request details and status by quota request ID for the resources of the resource provider at a - * specific location. The quota request ID **id** is returned in the response of the PUT operation. - * - * @param id Quota request ID. - * @param scope The fully qualified Azure Resource manager identifier of the 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 quota request details and status by quota request ID for the resources of the resource provider at a - * specific location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - QuotaRequestDetailsInner get(String id, String scope); - - /** - * For the specified scope, get the current quota requests for a one year period ending at the time is made. Use the - * **oData** filter to select quota requests. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 quota request information as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * For the specified scope, get the current quota requests for a one year period ending at the time is made. Use the - * **oData** filter to select quota requests. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * |requestSubmitTime | ge, le, eq, gt, lt - * |provisioningState eq {QuotaRequestState} - * |resourceName eq {resourceName}. - * @param top Number of records to return. - * @param skiptoken The **Skiptoken** parameter is used only if a previous operation returned a partial result. If a - * previous response contains a **nextLink** element, its value includes a **skiptoken** parameter that specifies a - * starting point to use for subsequent calls. - * @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 quota request information as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, String filter, Integer top, String skiptoken, - Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotasClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotasClient.java deleted file mode 100644 index cf5bf1b3d87e..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotasClient.java +++ /dev/null @@ -1,274 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.quota.fluent.models.CurrentQuotaLimitBaseInner; -import com.azure.resourcemanager.quota.models.QuotasGetResponse; - -/** - * An instance of this class provides access to all the operations defined in QuotasClient. - */ -public interface QuotasClient { - /** - * Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new - * quota limit that can be submitted with a PUT request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the 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 quota limit of a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - QuotasGetResponse getWithResponse(String resourceName, String scope, Context context); - - /** - * Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new - * quota limit that can be submitted with a PUT request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the 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 quota limit of a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CurrentQuotaLimitBaseInner get(String resourceName, String scope); - - /** - * Create or update the quota limit for the specified resource with the requested value. To update the quota, follow - * these steps: - * 1. Use the GET operation for quotas and usages to determine how much quota remains for the specific resource and - * to calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 quota limit. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CurrentQuotaLimitBaseInner> - beginCreateOrUpdate(String resourceName, String scope, CurrentQuotaLimitBaseInner createQuotaRequest); - - /** - * Create or update the quota limit for the specified resource with the requested value. To update the quota, follow - * these steps: - * 1. Use the GET operation for quotas and usages to determine how much quota remains for the specific resource and - * to calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota request payload. - * @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 quota limit. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CurrentQuotaLimitBaseInner> beginCreateOrUpdate( - String resourceName, String scope, CurrentQuotaLimitBaseInner createQuotaRequest, Context context); - - /** - * Create or update the quota limit for the specified resource with the requested value. To update the quota, follow - * these steps: - * 1. Use the GET operation for quotas and usages to determine how much quota remains for the specific resource and - * to calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CurrentQuotaLimitBaseInner createOrUpdate(String resourceName, String scope, - CurrentQuotaLimitBaseInner createQuotaRequest); - - /** - * Create or update the quota limit for the specified resource with the requested value. To update the quota, follow - * these steps: - * 1. Use the GET operation for quotas and usages to determine how much quota remains for the specific resource and - * to calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota request payload. - * @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 quota limit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CurrentQuotaLimitBaseInner createOrUpdate(String resourceName, String scope, - CurrentQuotaLimitBaseInner createQuotaRequest, Context context); - - /** - * Update the quota limit for a specific resource to the specified value: - * 1. Use the Usages-GET and Quota-GET operations to determine the remaining quota for the specific resource and to - * calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 quota limit. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CurrentQuotaLimitBaseInner> beginUpdate(String resourceName, - String scope, CurrentQuotaLimitBaseInner createQuotaRequest); - - /** - * Update the quota limit for a specific resource to the specified value: - * 1. Use the Usages-GET and Quota-GET operations to determine the remaining quota for the specific resource and to - * calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota requests payload. - * @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 quota limit. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CurrentQuotaLimitBaseInner> beginUpdate(String resourceName, - String scope, CurrentQuotaLimitBaseInner createQuotaRequest, Context context); - - /** - * Update the quota limit for a specific resource to the specified value: - * 1. Use the Usages-GET and Quota-GET operations to determine the remaining quota for the specific resource and to - * calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CurrentQuotaLimitBaseInner update(String resourceName, String scope, CurrentQuotaLimitBaseInner createQuotaRequest); - - /** - * Update the quota limit for a specific resource to the specified value: - * 1. Use the Usages-GET and Quota-GET operations to determine the remaining quota for the specific resource and to - * calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota requests payload. - * @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 quota limit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CurrentQuotaLimitBaseInner update(String resourceName, String scope, CurrentQuotaLimitBaseInner createQuotaRequest, - Context context); - - /** - * Get a list of current quota limits of all resources for the specified scope. The response from this GET operation - * can be leveraged to submit requests to update a quota. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of current quota limits of all resources for the specified scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * Get a list of current quota limits of all resources for the specified scope. The response from this GET operation - * can be leveraged to submit requests to update a quota. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of current quota limits of all resources for the specified scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/UsagesClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/UsagesClient.java deleted file mode 100644 index ce8788bed548..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/UsagesClient.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.quota.fluent.models.CurrentUsagesBaseInner; -import com.azure.resourcemanager.quota.models.UsagesGetResponse; - -/** - * An instance of this class provides access to all the operations defined in UsagesClient. - */ -public interface UsagesClient { - /** - * Get the current usage of a resource. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the 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 current usage of a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - UsagesGetResponse getWithResponse(String resourceName, String scope, Context context); - - /** - * Get the current usage of a resource. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the 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 current usage of a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CurrentUsagesBaseInner get(String resourceName, String scope); - - /** - * Get a list of current usage for all resources for the scope specified. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of current usage for all resources for the scope specified as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * Get a list of current usage for all resources for the scope specified. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of current usage for all resources for the scope specified as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/CurrentQuotaLimitBaseInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/CurrentQuotaLimitBaseInner.java deleted file mode 100644 index 2302177ad026..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/CurrentQuotaLimitBaseInner.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.models.QuotaProperties; -import java.io.IOException; - -/** - * Quota limit. - */ -@Fluent -public final class CurrentQuotaLimitBaseInner extends ProxyResource { - /* - * Quota properties for the specified resource, based on the API called, Quotas or Usages. - */ - private QuotaProperties 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 CurrentQuotaLimitBaseInner class. - */ - public CurrentQuotaLimitBaseInner() { - } - - /** - * Get the properties property: Quota properties for the specified resource, based on the API called, Quotas or - * Usages. - * - * @return the properties value. - */ - public QuotaProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Quota properties for the specified resource, based on the API called, Quotas or - * Usages. - * - * @param properties the properties value to set. - * @return the CurrentQuotaLimitBaseInner object itself. - */ - public CurrentQuotaLimitBaseInner withProperties(QuotaProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CurrentQuotaLimitBaseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CurrentQuotaLimitBaseInner 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 CurrentQuotaLimitBaseInner. - */ - public static CurrentQuotaLimitBaseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CurrentQuotaLimitBaseInner deserializedCurrentQuotaLimitBaseInner = new CurrentQuotaLimitBaseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedCurrentQuotaLimitBaseInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedCurrentQuotaLimitBaseInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedCurrentQuotaLimitBaseInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedCurrentQuotaLimitBaseInner.properties = QuotaProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedCurrentQuotaLimitBaseInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCurrentQuotaLimitBaseInner; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/CurrentUsagesBaseInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/CurrentUsagesBaseInner.java deleted file mode 100644 index a9c1dd20850e..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/CurrentUsagesBaseInner.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.models.UsagesProperties; -import java.io.IOException; - -/** - * Resource usage. - */ -@Immutable -public final class CurrentUsagesBaseInner extends ProxyResource { - /* - * Usage properties for the specified resource. - */ - private UsagesProperties 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 CurrentUsagesBaseInner class. - */ - private CurrentUsagesBaseInner() { - } - - /** - * Get the properties property: Usage properties for the specified resource. - * - * @return the properties value. - */ - public UsagesProperties properties() { - return this.properties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CurrentUsagesBaseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CurrentUsagesBaseInner 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 CurrentUsagesBaseInner. - */ - public static CurrentUsagesBaseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CurrentUsagesBaseInner deserializedCurrentUsagesBaseInner = new CurrentUsagesBaseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedCurrentUsagesBaseInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedCurrentUsagesBaseInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedCurrentUsagesBaseInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedCurrentUsagesBaseInner.properties = UsagesProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedCurrentUsagesBaseInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCurrentUsagesBaseInner; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaDetailsName.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaDetailsName.java deleted file mode 100644 index 282c8fd6d760..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaDetailsName.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.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; - -/** - * Name of the resource provided by the resource provider. This property is already included in the request URI, so it - * is a readonly property returned in the response. - */ -@Immutable -public final class GroupQuotaDetailsName implements JsonSerializable { - /* - * Resource name. - */ - private String value; - - /* - * Resource display name. - */ - private String localizedValue; - - /** - * Creates an instance of GroupQuotaDetailsName class. - */ - private GroupQuotaDetailsName() { - } - - /** - * Get the value property: Resource name. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Get the localizedValue property: Resource display name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.localizedValue; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotaDetailsName from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaDetailsName 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 GroupQuotaDetailsName. - */ - public static GroupQuotaDetailsName fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaDetailsName deserializedGroupQuotaDetailsName = new GroupQuotaDetailsName(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - deserializedGroupQuotaDetailsName.value = reader.getString(); - } else if ("localizedValue".equals(fieldName)) { - deserializedGroupQuotaDetailsName.localizedValue = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaDetailsName; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaLimitListInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaLimitListInner.java deleted file mode 100644 index f4d088a8bbac..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaLimitListInner.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.models.GroupQuotaLimitListProperties; -import java.io.IOException; - -/** - * List of Group Quota Limit details. - */ -@Fluent -public final class GroupQuotaLimitListInner extends ProxyResource { - /* - * The properties property. - */ - private GroupQuotaLimitListProperties 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 GroupQuotaLimitListInner class. - */ - public GroupQuotaLimitListInner() { - } - - /** - * Get the properties property: The properties property. - * - * @return the properties value. - */ - public GroupQuotaLimitListProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The properties property. - * - * @param properties the properties value to set. - * @return the GroupQuotaLimitListInner object itself. - */ - public GroupQuotaLimitListInner withProperties(GroupQuotaLimitListProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotaLimitListInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaLimitListInner 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 GroupQuotaLimitListInner. - */ - public static GroupQuotaLimitListInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaLimitListInner deserializedGroupQuotaLimitListInner = new GroupQuotaLimitListInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGroupQuotaLimitListInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGroupQuotaLimitListInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGroupQuotaLimitListInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedGroupQuotaLimitListInner.properties = GroupQuotaLimitListProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedGroupQuotaLimitListInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaLimitListInner; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaRequestBaseProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaRequestBaseProperties.java deleted file mode 100644 index 77320b00c28a..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaRequestBaseProperties.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.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; - -/** - * The GroupQuotaRequestBaseProperties model. - */ -@Immutable -public final class GroupQuotaRequestBaseProperties implements JsonSerializable { - /* - * The new quota limit for the subscription. The incremental quota will be allocated from pre-approved group quota. - */ - private Long limit; - - /* - * Name of the resource provided by the resource provider. This property is already included in the request URI, so - * it is a readonly property returned in the response. - */ - private GroupQuotaRequestBasePropertiesName innerName; - - /* - * Location/Azure region for the quota requested for resource. - */ - private String region; - - /* - * GroupQuota Request comments and details for request. This is optional paramter to provide more details related to - * the requested resource. - */ - private String comments; - - /** - * Creates an instance of GroupQuotaRequestBaseProperties class. - */ - private GroupQuotaRequestBaseProperties() { - } - - /** - * Get the limit property: The new quota limit for the subscription. The incremental quota will be allocated from - * pre-approved group quota. - * - * @return the limit value. - */ - public Long limit() { - return this.limit; - } - - /** - * Get the innerName property: Name of the resource provided by the resource provider. This property is already - * included in the request URI, so it is a readonly property returned in the response. - * - * @return the innerName value. - */ - private GroupQuotaRequestBasePropertiesName innerName() { - return this.innerName; - } - - /** - * Get the region property: Location/Azure region for the quota requested for resource. - * - * @return the region value. - */ - public String region() { - return this.region; - } - - /** - * Get the comments property: GroupQuota Request comments and details for request. This is optional paramter to - * provide more details related to the requested resource. - * - * @return the comments value. - */ - public String comments() { - return this.comments; - } - - /** - * Get the value property: Resource name. - * - * @return the value value. - */ - public String value() { - return this.innerName() == null ? null : this.innerName().value(); - } - - /** - * Get the localizedValue property: Resource display name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.innerName() == null ? null : this.innerName().localizedValue(); - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("limit", this.limit); - jsonWriter.writeStringField("region", this.region); - jsonWriter.writeStringField("comments", this.comments); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotaRequestBaseProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaRequestBaseProperties 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 GroupQuotaRequestBaseProperties. - */ - public static GroupQuotaRequestBaseProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaRequestBaseProperties deserializedGroupQuotaRequestBaseProperties - = new GroupQuotaRequestBaseProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("limit".equals(fieldName)) { - deserializedGroupQuotaRequestBaseProperties.limit = reader.getNullable(JsonReader::getLong); - } else if ("name".equals(fieldName)) { - deserializedGroupQuotaRequestBaseProperties.innerName - = GroupQuotaRequestBasePropertiesName.fromJson(reader); - } else if ("region".equals(fieldName)) { - deserializedGroupQuotaRequestBaseProperties.region = reader.getString(); - } else if ("comments".equals(fieldName)) { - deserializedGroupQuotaRequestBaseProperties.comments = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaRequestBaseProperties; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaRequestBasePropertiesName.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaRequestBasePropertiesName.java deleted file mode 100644 index f752d3992e72..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaRequestBasePropertiesName.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.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; - -/** - * Name of the resource provided by the resource provider. This property is already included in the request URI, so it - * is a readonly property returned in the response. - */ -@Immutable -public final class GroupQuotaRequestBasePropertiesName - implements JsonSerializable { - /* - * Resource name. - */ - private String value; - - /* - * Resource display name. - */ - private String localizedValue; - - /** - * Creates an instance of GroupQuotaRequestBasePropertiesName class. - */ - private GroupQuotaRequestBasePropertiesName() { - } - - /** - * Get the value property: Resource name. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Get the localizedValue property: Resource display name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.localizedValue; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotaRequestBasePropertiesName from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaRequestBasePropertiesName 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 GroupQuotaRequestBasePropertiesName. - */ - public static GroupQuotaRequestBasePropertiesName fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaRequestBasePropertiesName deserializedGroupQuotaRequestBasePropertiesName - = new GroupQuotaRequestBasePropertiesName(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - deserializedGroupQuotaRequestBasePropertiesName.value = reader.getString(); - } else if ("localizedValue".equals(fieldName)) { - deserializedGroupQuotaRequestBasePropertiesName.localizedValue = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaRequestBasePropertiesName; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaSubscriptionIdInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaSubscriptionIdInner.java deleted file mode 100644 index f2e3d1da227b..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaSubscriptionIdInner.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionIdProperties; -import java.io.IOException; - -/** - * This represents a Azure subscriptionId that is associated with a GroupQuotasEntity. - */ -@Immutable -public final class GroupQuotaSubscriptionIdInner extends ProxyResource { - /* - * The properties property. - */ - private GroupQuotaSubscriptionIdProperties 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 GroupQuotaSubscriptionIdInner class. - */ - private GroupQuotaSubscriptionIdInner() { - } - - /** - * Get the properties property: The properties property. - * - * @return the properties value. - */ - public GroupQuotaSubscriptionIdProperties properties() { - return this.properties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotaSubscriptionIdInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaSubscriptionIdInner 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 GroupQuotaSubscriptionIdInner. - */ - public static GroupQuotaSubscriptionIdInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaSubscriptionIdInner deserializedGroupQuotaSubscriptionIdInner - = new GroupQuotaSubscriptionIdInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGroupQuotaSubscriptionIdInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGroupQuotaSubscriptionIdInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGroupQuotaSubscriptionIdInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedGroupQuotaSubscriptionIdInner.properties - = GroupQuotaSubscriptionIdProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedGroupQuotaSubscriptionIdInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaSubscriptionIdInner; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaSubscriptionRequestStatusInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaSubscriptionRequestStatusInner.java deleted file mode 100644 index d9c77c9ea4f5..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaSubscriptionRequestStatusInner.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionRequestStatusProperties; -import java.io.IOException; - -/** - * The new quota limit request status. - */ -@Immutable -public final class GroupQuotaSubscriptionRequestStatusInner extends ProxyResource { - /* - * The properties property. - */ - private GroupQuotaSubscriptionRequestStatusProperties 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 GroupQuotaSubscriptionRequestStatusInner class. - */ - private GroupQuotaSubscriptionRequestStatusInner() { - } - - /** - * Get the properties property: The properties property. - * - * @return the properties value. - */ - public GroupQuotaSubscriptionRequestStatusProperties properties() { - return this.properties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotaSubscriptionRequestStatusInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaSubscriptionRequestStatusInner 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 GroupQuotaSubscriptionRequestStatusInner. - */ - public static GroupQuotaSubscriptionRequestStatusInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaSubscriptionRequestStatusInner deserializedGroupQuotaSubscriptionRequestStatusInner - = new GroupQuotaSubscriptionRequestStatusInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGroupQuotaSubscriptionRequestStatusInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGroupQuotaSubscriptionRequestStatusInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGroupQuotaSubscriptionRequestStatusInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedGroupQuotaSubscriptionRequestStatusInner.properties - = GroupQuotaSubscriptionRequestStatusProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedGroupQuotaSubscriptionRequestStatusInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaSubscriptionRequestStatusInner; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaUsagesBaseName.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaUsagesBaseName.java deleted file mode 100644 index b3dd72b481df..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotaUsagesBaseName.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.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; - -/** - * Name of the resource provided by the resource provider. This property is already included in the request URI, so it - * is a readonly property returned in the response. - */ -@Immutable -public final class GroupQuotaUsagesBaseName implements JsonSerializable { - /* - * Resource name. - */ - private String value; - - /* - * Resource display name. - */ - private String localizedValue; - - /** - * Creates an instance of GroupQuotaUsagesBaseName class. - */ - private GroupQuotaUsagesBaseName() { - } - - /** - * Get the value property: Resource name. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Get the localizedValue property: Resource display name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.localizedValue; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("value", this.value); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotaUsagesBaseName from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaUsagesBaseName 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 GroupQuotaUsagesBaseName. - */ - public static GroupQuotaUsagesBaseName fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaUsagesBaseName deserializedGroupQuotaUsagesBaseName = new GroupQuotaUsagesBaseName(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - deserializedGroupQuotaUsagesBaseName.value = reader.getString(); - } else if ("localizedValue".equals(fieldName)) { - deserializedGroupQuotaUsagesBaseName.localizedValue = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaUsagesBaseName; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotasEnforcementStatusInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotasEnforcementStatusInner.java deleted file mode 100644 index 6316e581cc3c..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotasEnforcementStatusInner.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.models.GroupQuotasEnforcementStatusProperties; -import java.io.IOException; - -/** - * The GroupQuota Enforcement status for a Azure Location/Region. - */ -@Fluent -public final class GroupQuotasEnforcementStatusInner extends ProxyResource { - /* - * The properties property. - */ - private GroupQuotasEnforcementStatusProperties 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 GroupQuotasEnforcementStatusInner class. - */ - public GroupQuotasEnforcementStatusInner() { - } - - /** - * Get the properties property: The properties property. - * - * @return the properties value. - */ - public GroupQuotasEnforcementStatusProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The properties property. - * - * @param properties the properties value to set. - * @return the GroupQuotasEnforcementStatusInner object itself. - */ - public GroupQuotasEnforcementStatusInner withProperties(GroupQuotasEnforcementStatusProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotasEnforcementStatusInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotasEnforcementStatusInner 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 GroupQuotasEnforcementStatusInner. - */ - public static GroupQuotasEnforcementStatusInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotasEnforcementStatusInner deserializedGroupQuotasEnforcementStatusInner - = new GroupQuotasEnforcementStatusInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGroupQuotasEnforcementStatusInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGroupQuotasEnforcementStatusInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGroupQuotasEnforcementStatusInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedGroupQuotasEnforcementStatusInner.properties - = GroupQuotasEnforcementStatusProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedGroupQuotasEnforcementStatusInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotasEnforcementStatusInner; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotasEntityInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotasEntityInner.java deleted file mode 100644 index 8d30bc60dfb4..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/GroupQuotasEntityInner.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.models.GroupQuotasEntityProperties; -import java.io.IOException; - -/** - * Properties and filters for ShareQuota. The request parameter is optional, if there are no filters specified. - */ -@Fluent -public final class GroupQuotasEntityInner extends ProxyResource { - /* - * Properties - */ - private GroupQuotasEntityProperties 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 GroupQuotasEntityInner class. - */ - public GroupQuotasEntityInner() { - } - - /** - * Get the properties property: Properties. - * - * @return the properties value. - */ - public GroupQuotasEntityProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties. - * - * @param properties the properties value to set. - * @return the GroupQuotasEntityInner object itself. - */ - public GroupQuotasEntityInner withProperties(GroupQuotasEntityProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotasEntityInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotasEntityInner 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 GroupQuotasEntityInner. - */ - public static GroupQuotasEntityInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotasEntityInner deserializedGroupQuotasEntityInner = new GroupQuotasEntityInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGroupQuotasEntityInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGroupQuotasEntityInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGroupQuotasEntityInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedGroupQuotasEntityInner.properties = GroupQuotasEntityProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedGroupQuotasEntityInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotasEntityInner; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/OperationResponseInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/OperationResponseInner.java deleted file mode 100644 index cd41dc73ba74..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/OperationResponseInner.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.models.OperationDisplay; -import java.io.IOException; - -/** - * The OperationResponse model. - */ -@Immutable -public final class OperationResponseInner implements JsonSerializable { - /* - * The name property. - */ - private String name; - - /* - * The display property. - */ - private OperationDisplay display; - - /* - * The origin property. - */ - private String origin; - - /** - * Creates an instance of OperationResponseInner class. - */ - private OperationResponseInner() { - } - - /** - * Get the name property: The name property. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the display property: The display property. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Get the origin property: The origin property. - * - * @return the origin value. - */ - public String origin() { - return this.origin; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeJsonField("display", this.display); - jsonWriter.writeStringField("origin", this.origin); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationResponseInner 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 OperationResponseInner. - */ - public static OperationResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationResponseInner deserializedOperationResponseInner = new OperationResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedOperationResponseInner.name = reader.getString(); - } else if ("display".equals(fieldName)) { - deserializedOperationResponseInner.display = OperationDisplay.fromJson(reader); - } else if ("origin".equals(fieldName)) { - deserializedOperationResponseInner.origin = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationResponseInner; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaAllocationRequestBaseProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaAllocationRequestBaseProperties.java deleted file mode 100644 index f449c8af7baa..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaAllocationRequestBaseProperties.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.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; - -/** - * The QuotaAllocationRequestBaseProperties model. - */ -@Immutable -public final class QuotaAllocationRequestBaseProperties - implements JsonSerializable { - /* - * The new quota limit for the subscription. The incremental quota will be allocated from pre-approved group quota. - */ - private Long limit; - - /* - * Name of the resource provided by the resource provider. This property is already included in the request URI, so - * it is a readonly property returned in the response. - */ - private QuotaAllocationRequestBasePropertiesName innerName; - - /* - * The location for which the subscription is allocated - */ - private String region; - - /** - * Creates an instance of QuotaAllocationRequestBaseProperties class. - */ - private QuotaAllocationRequestBaseProperties() { - } - - /** - * Get the limit property: The new quota limit for the subscription. The incremental quota will be allocated from - * pre-approved group quota. - * - * @return the limit value. - */ - public Long limit() { - return this.limit; - } - - /** - * Get the innerName property: Name of the resource provided by the resource provider. This property is already - * included in the request URI, so it is a readonly property returned in the response. - * - * @return the innerName value. - */ - private QuotaAllocationRequestBasePropertiesName innerName() { - return this.innerName; - } - - /** - * Get the region property: The location for which the subscription is allocated. - * - * @return the region value. - */ - public String region() { - return this.region; - } - - /** - * Get the value property: Resource name. - * - * @return the value value. - */ - public String value() { - return this.innerName() == null ? null : this.innerName().value(); - } - - /** - * Get the localizedValue property: Resource display name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.innerName() == null ? null : this.innerName().localizedValue(); - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("limit", this.limit); - jsonWriter.writeStringField("region", this.region); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QuotaAllocationRequestBaseProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QuotaAllocationRequestBaseProperties 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 QuotaAllocationRequestBaseProperties. - */ - public static QuotaAllocationRequestBaseProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QuotaAllocationRequestBaseProperties deserializedQuotaAllocationRequestBaseProperties - = new QuotaAllocationRequestBaseProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("limit".equals(fieldName)) { - deserializedQuotaAllocationRequestBaseProperties.limit = reader.getNullable(JsonReader::getLong); - } else if ("name".equals(fieldName)) { - deserializedQuotaAllocationRequestBaseProperties.innerName - = QuotaAllocationRequestBasePropertiesName.fromJson(reader); - } else if ("region".equals(fieldName)) { - deserializedQuotaAllocationRequestBaseProperties.region = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedQuotaAllocationRequestBaseProperties; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaAllocationRequestBasePropertiesName.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaAllocationRequestBasePropertiesName.java deleted file mode 100644 index e4efe253df1e..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaAllocationRequestBasePropertiesName.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.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; - -/** - * Name of the resource provided by the resource provider. This property is already included in the request URI, so it - * is a readonly property returned in the response. - */ -@Immutable -public final class QuotaAllocationRequestBasePropertiesName - implements JsonSerializable { - /* - * Resource name. - */ - private String value; - - /* - * Resource display name. - */ - private String localizedValue; - - /** - * Creates an instance of QuotaAllocationRequestBasePropertiesName class. - */ - private QuotaAllocationRequestBasePropertiesName() { - } - - /** - * Get the value property: Resource name. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Get the localizedValue property: Resource display name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.localizedValue; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QuotaAllocationRequestBasePropertiesName from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QuotaAllocationRequestBasePropertiesName 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 QuotaAllocationRequestBasePropertiesName. - */ - public static QuotaAllocationRequestBasePropertiesName fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QuotaAllocationRequestBasePropertiesName deserializedQuotaAllocationRequestBasePropertiesName - = new QuotaAllocationRequestBasePropertiesName(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - deserializedQuotaAllocationRequestBasePropertiesName.value = reader.getString(); - } else if ("localizedValue".equals(fieldName)) { - deserializedQuotaAllocationRequestBasePropertiesName.localizedValue = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedQuotaAllocationRequestBasePropertiesName; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaAllocationRequestStatusInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaAllocationRequestStatusInner.java deleted file mode 100644 index 677f47e42cc4..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaAllocationRequestStatusInner.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.models.QuotaAllocationRequestBase; -import com.azure.resourcemanager.quota.models.RequestState; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * The subscription quota allocation status. - */ -@Immutable -public final class QuotaAllocationRequestStatusInner extends ProxyResource { - /* - * The properties property. - */ - private QuotaAllocationRequestStatusProperties 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 QuotaAllocationRequestStatusInner class. - */ - private QuotaAllocationRequestStatusInner() { - } - - /** - * Get the innerProperties property: The properties property. - * - * @return the innerProperties value. - */ - private QuotaAllocationRequestStatusProperties 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 requestedResource property: The new quota request allocated to subscription. - * - * @return the requestedResource value. - */ - public QuotaAllocationRequestBase requestedResource() { - return this.innerProperties() == null ? null : this.innerProperties().requestedResource(); - } - - /** - * Get the requestSubmitTime property: The request submission time. The date conforms to the following format - * specified by the ISO 8601 standard: yyyy-MM-ddTHH:mm:ssZ. - * - * @return the requestSubmitTime value. - */ - public OffsetDateTime requestSubmitTime() { - return this.innerProperties() == null ? null : this.innerProperties().requestSubmitTime(); - } - - /** - * Get the provisioningState property: Request status. - * - * @return the provisioningState value. - */ - public RequestState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the faultCode property: Details of the failure. - * - * @return the faultCode value. - */ - public String faultCode() { - return this.innerProperties() == null ? null : this.innerProperties().faultCode(); - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QuotaAllocationRequestStatusInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QuotaAllocationRequestStatusInner 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 QuotaAllocationRequestStatusInner. - */ - public static QuotaAllocationRequestStatusInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QuotaAllocationRequestStatusInner deserializedQuotaAllocationRequestStatusInner - = new QuotaAllocationRequestStatusInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedQuotaAllocationRequestStatusInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedQuotaAllocationRequestStatusInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedQuotaAllocationRequestStatusInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedQuotaAllocationRequestStatusInner.innerProperties - = QuotaAllocationRequestStatusProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedQuotaAllocationRequestStatusInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedQuotaAllocationRequestStatusInner; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaAllocationRequestStatusProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaAllocationRequestStatusProperties.java deleted file mode 100644 index b1f20bee9e78..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaAllocationRequestStatusProperties.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent.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 com.azure.resourcemanager.quota.models.QuotaAllocationRequestBase; -import com.azure.resourcemanager.quota.models.RequestState; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * The QuotaAllocationRequestStatusProperties model. - */ -@Immutable -public final class QuotaAllocationRequestStatusProperties - implements JsonSerializable { - /* - * The new quota request allocated to subscription. - */ - private QuotaAllocationRequestBase requestedResource; - - /* - * The request submission time. The date conforms to the following format specified by the ISO 8601 standard: - * yyyy-MM-ddTHH:mm:ssZ - */ - private OffsetDateTime requestSubmitTime; - - /* - * Request status. - */ - private RequestState provisioningState; - - /* - * Details of the failure. - */ - private String faultCode; - - /** - * Creates an instance of QuotaAllocationRequestStatusProperties class. - */ - private QuotaAllocationRequestStatusProperties() { - } - - /** - * Get the requestedResource property: The new quota request allocated to subscription. - * - * @return the requestedResource value. - */ - public QuotaAllocationRequestBase requestedResource() { - return this.requestedResource; - } - - /** - * Get the requestSubmitTime property: The request submission time. The date conforms to the following format - * specified by the ISO 8601 standard: yyyy-MM-ddTHH:mm:ssZ. - * - * @return the requestSubmitTime value. - */ - public OffsetDateTime requestSubmitTime() { - return this.requestSubmitTime; - } - - /** - * Get the provisioningState property: Request status. - * - * @return the provisioningState value. - */ - public RequestState provisioningState() { - return this.provisioningState; - } - - /** - * Get the faultCode property: Details of the failure. - * - * @return the faultCode value. - */ - public String faultCode() { - return this.faultCode; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("requestedResource", this.requestedResource); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QuotaAllocationRequestStatusProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QuotaAllocationRequestStatusProperties 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 QuotaAllocationRequestStatusProperties. - */ - public static QuotaAllocationRequestStatusProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QuotaAllocationRequestStatusProperties deserializedQuotaAllocationRequestStatusProperties - = new QuotaAllocationRequestStatusProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("requestedResource".equals(fieldName)) { - deserializedQuotaAllocationRequestStatusProperties.requestedResource - = QuotaAllocationRequestBase.fromJson(reader); - } else if ("requestSubmitTime".equals(fieldName)) { - deserializedQuotaAllocationRequestStatusProperties.requestSubmitTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("provisioningState".equals(fieldName)) { - deserializedQuotaAllocationRequestStatusProperties.provisioningState - = RequestState.fromString(reader.getString()); - } else if ("faultCode".equals(fieldName)) { - deserializedQuotaAllocationRequestStatusProperties.faultCode = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedQuotaAllocationRequestStatusProperties; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaRequestDetailsInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaRequestDetailsInner.java deleted file mode 100644 index 43c18569f112..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaRequestDetailsInner.java +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.models.QuotaRequestState; -import com.azure.resourcemanager.quota.models.ServiceErrorDetail; -import com.azure.resourcemanager.quota.models.SubRequest; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * List of quota requests with details. - */ -@Immutable -public final class QuotaRequestDetailsInner extends ProxyResource { - /* - * Quota request details. - */ - private QuotaRequestProperties 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 QuotaRequestDetailsInner class. - */ - private QuotaRequestDetailsInner() { - } - - /** - * Get the innerProperties property: Quota request details. - * - * @return the innerProperties value. - */ - private QuotaRequestProperties 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 provisioningState property: The quota request status. - * - * @return the provisioningState value. - */ - public QuotaRequestState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the message property: User-friendly status message. - * - * @return the message value. - */ - public String message() { - return this.innerProperties() == null ? null : this.innerProperties().message(); - } - - /** - * Get the error property: Error details of the quota request. - * - * @return the error value. - */ - public ServiceErrorDetail error() { - return this.innerProperties() == null ? null : this.innerProperties().error(); - } - - /** - * Get the requestSubmitTime property: The quota request submission time. The date conforms to the following format - * specified by the ISO 8601 standard: yyyy-MM-ddTHH:mm:ssZ. - * - * @return the requestSubmitTime value. - */ - public OffsetDateTime requestSubmitTime() { - return this.innerProperties() == null ? null : this.innerProperties().requestSubmitTime(); - } - - /** - * Get the value property: Quota request details. - * - * @return the value value. - */ - public List value() { - return this.innerProperties() == null ? null : this.innerProperties().value(); - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QuotaRequestDetailsInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QuotaRequestDetailsInner 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 QuotaRequestDetailsInner. - */ - public static QuotaRequestDetailsInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QuotaRequestDetailsInner deserializedQuotaRequestDetailsInner = new QuotaRequestDetailsInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedQuotaRequestDetailsInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedQuotaRequestDetailsInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedQuotaRequestDetailsInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedQuotaRequestDetailsInner.innerProperties = QuotaRequestProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedQuotaRequestDetailsInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedQuotaRequestDetailsInner; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaRequestProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaRequestProperties.java deleted file mode 100644 index c549e035566d..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaRequestProperties.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent.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 com.azure.resourcemanager.quota.models.QuotaRequestState; -import com.azure.resourcemanager.quota.models.ServiceErrorDetail; -import com.azure.resourcemanager.quota.models.SubRequest; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * Quota request properties. - */ -@Immutable -public final class QuotaRequestProperties implements JsonSerializable { - /* - * The quota request status. - */ - private QuotaRequestState provisioningState; - - /* - * User-friendly status message. - */ - private String message; - - /* - * Error details of the quota request. - */ - private ServiceErrorDetail error; - - /* - * The quota request submission time. The date conforms to the following format specified by the ISO 8601 standard: - * yyyy-MM-ddTHH:mm:ssZ - */ - private OffsetDateTime requestSubmitTime; - - /* - * Quota request details. - */ - private List value; - - /** - * Creates an instance of QuotaRequestProperties class. - */ - private QuotaRequestProperties() { - } - - /** - * Get the provisioningState property: The quota request status. - * - * @return the provisioningState value. - */ - public QuotaRequestState provisioningState() { - return this.provisioningState; - } - - /** - * Get the message property: User-friendly status message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Get the error property: Error details of the quota request. - * - * @return the error value. - */ - public ServiceErrorDetail error() { - return this.error; - } - - /** - * Get the requestSubmitTime property: The quota request submission time. The date conforms to the following format - * specified by the ISO 8601 standard: yyyy-MM-ddTHH:mm:ssZ. - * - * @return the requestSubmitTime value. - */ - public OffsetDateTime requestSubmitTime() { - return this.requestSubmitTime; - } - - /** - * Get the value property: Quota request details. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("error", this.error); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QuotaRequestProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QuotaRequestProperties 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 QuotaRequestProperties. - */ - public static QuotaRequestProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QuotaRequestProperties deserializedQuotaRequestProperties = new QuotaRequestProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningState".equals(fieldName)) { - deserializedQuotaRequestProperties.provisioningState - = QuotaRequestState.fromString(reader.getString()); - } else if ("message".equals(fieldName)) { - deserializedQuotaRequestProperties.message = reader.getString(); - } else if ("error".equals(fieldName)) { - deserializedQuotaRequestProperties.error = ServiceErrorDetail.fromJson(reader); - } else if ("requestSubmitTime".equals(fieldName)) { - deserializedQuotaRequestProperties.requestSubmitTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> SubRequest.fromJson(reader1)); - deserializedQuotaRequestProperties.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedQuotaRequestProperties; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/ResourceUsagesInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/ResourceUsagesInner.java deleted file mode 100644 index c814029247c2..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/ResourceUsagesInner.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.models.GroupQuotaUsagesBase; -import java.io.IOException; - -/** - * Resource details with usages and GroupQuota. - */ -@Immutable -public final class ResourceUsagesInner extends ProxyResource { - /* - * Resource details with usages and GroupQuota. - */ - private GroupQuotaUsagesBase 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 ResourceUsagesInner class. - */ - private ResourceUsagesInner() { - } - - /** - * Get the properties property: Resource details with usages and GroupQuota. - * - * @return the properties value. - */ - public GroupQuotaUsagesBase properties() { - return this.properties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceUsagesInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceUsagesInner 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 ResourceUsagesInner. - */ - public static ResourceUsagesInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceUsagesInner deserializedResourceUsagesInner = new ResourceUsagesInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedResourceUsagesInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedResourceUsagesInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedResourceUsagesInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedResourceUsagesInner.properties = GroupQuotaUsagesBase.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedResourceUsagesInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedResourceUsagesInner; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/SubmittedResourceRequestStatusInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/SubmittedResourceRequestStatusInner.java deleted file mode 100644 index 31f7752ed7cc..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/SubmittedResourceRequestStatusInner.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.models.SubmittedResourceRequestStatusProperties; -import java.io.IOException; - -/** - * Status of a single GroupQuota request. - */ -@Immutable -public final class SubmittedResourceRequestStatusInner extends ProxyResource { - /* - * The properties property. - */ - private SubmittedResourceRequestStatusProperties 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 SubmittedResourceRequestStatusInner class. - */ - private SubmittedResourceRequestStatusInner() { - } - - /** - * Get the properties property: The properties property. - * - * @return the properties value. - */ - public SubmittedResourceRequestStatusProperties properties() { - return this.properties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SubmittedResourceRequestStatusInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SubmittedResourceRequestStatusInner 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 SubmittedResourceRequestStatusInner. - */ - public static SubmittedResourceRequestStatusInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SubmittedResourceRequestStatusInner deserializedSubmittedResourceRequestStatusInner - = new SubmittedResourceRequestStatusInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSubmittedResourceRequestStatusInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSubmittedResourceRequestStatusInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSubmittedResourceRequestStatusInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSubmittedResourceRequestStatusInner.properties - = SubmittedResourceRequestStatusProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSubmittedResourceRequestStatusInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSubmittedResourceRequestStatusInner; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/SubscriptionQuotaAllocationsListInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/SubscriptionQuotaAllocationsListInner.java deleted file mode 100644 index 8c0c1b2b2f72..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/SubscriptionQuotaAllocationsListInner.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocationsListProperties; -import java.io.IOException; - -/** - * Subscription quota list. - */ -@Fluent -public final class SubscriptionQuotaAllocationsListInner extends ProxyResource { - /* - * The properties property. - */ - private SubscriptionQuotaAllocationsListProperties 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 SubscriptionQuotaAllocationsListInner class. - */ - public SubscriptionQuotaAllocationsListInner() { - } - - /** - * Get the properties property: The properties property. - * - * @return the properties value. - */ - public SubscriptionQuotaAllocationsListProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The properties property. - * - * @param properties the properties value to set. - * @return the SubscriptionQuotaAllocationsListInner object itself. - */ - public SubscriptionQuotaAllocationsListInner withProperties(SubscriptionQuotaAllocationsListProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SubscriptionQuotaAllocationsListInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SubscriptionQuotaAllocationsListInner 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 SubscriptionQuotaAllocationsListInner. - */ - public static SubscriptionQuotaAllocationsListInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SubscriptionQuotaAllocationsListInner deserializedSubscriptionQuotaAllocationsListInner - = new SubscriptionQuotaAllocationsListInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSubscriptionQuotaAllocationsListInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSubscriptionQuotaAllocationsListInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSubscriptionQuotaAllocationsListInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSubscriptionQuotaAllocationsListInner.properties - = SubscriptionQuotaAllocationsListProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSubscriptionQuotaAllocationsListInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSubscriptionQuotaAllocationsListInner; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/SubscriptionQuotaDetailsName.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/SubscriptionQuotaDetailsName.java deleted file mode 100644 index 74d14ca1c323..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/SubscriptionQuotaDetailsName.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.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; - -/** - * Name of the resource provided by the resource provider. This property is already included in the request URI, so it - * is a readonly property returned in the response. - */ -@Immutable -public final class SubscriptionQuotaDetailsName implements JsonSerializable { - /* - * Resource name. - */ - private String value; - - /* - * Resource display name. - */ - private String localizedValue; - - /** - * Creates an instance of SubscriptionQuotaDetailsName class. - */ - private SubscriptionQuotaDetailsName() { - } - - /** - * Get the value property: Resource name. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Get the localizedValue property: Resource display name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.localizedValue; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SubscriptionQuotaDetailsName from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SubscriptionQuotaDetailsName 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 SubscriptionQuotaDetailsName. - */ - public static SubscriptionQuotaDetailsName fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SubscriptionQuotaDetailsName deserializedSubscriptionQuotaDetailsName = new SubscriptionQuotaDetailsName(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - deserializedSubscriptionQuotaDetailsName.value = reader.getString(); - } else if ("localizedValue".equals(fieldName)) { - deserializedSubscriptionQuotaDetailsName.localizedValue = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSubscriptionQuotaDetailsName; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/package-info.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/package-info.java deleted file mode 100644 index b9f1ea12703b..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -/** - * Package containing the inner data models for Quota. - * Microsoft Azure Quota Resource Provider. - */ -package com.azure.resourcemanager.quota.fluent.models; diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/package-info.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/package-info.java deleted file mode 100644 index 64ab5403ded3..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -/** - * Package containing the service clients for Quota. - * Microsoft Azure Quota Resource Provider. - */ -package com.azure.resourcemanager.quota.fluent; diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/CurrentQuotaLimitBaseImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/CurrentQuotaLimitBaseImpl.java deleted file mode 100644 index 4ffce9a84e9f..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/CurrentQuotaLimitBaseImpl.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.quota.fluent.models.CurrentQuotaLimitBaseInner; -import com.azure.resourcemanager.quota.models.CurrentQuotaLimitBase; -import com.azure.resourcemanager.quota.models.QuotaProperties; - -public final class CurrentQuotaLimitBaseImpl - implements CurrentQuotaLimitBase, CurrentQuotaLimitBase.Definition, CurrentQuotaLimitBase.Update { - private CurrentQuotaLimitBaseInner innerObject; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public QuotaProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public CurrentQuotaLimitBaseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } - - private String resourceName; - - private String scope; - - public CurrentQuotaLimitBaseImpl withExistingScope(String scope) { - this.scope = scope; - return this; - } - - public CurrentQuotaLimitBase create() { - this.innerObject = serviceManager.serviceClient() - .getQuotas() - .createOrUpdate(resourceName, scope, this.innerModel(), Context.NONE); - return this; - } - - public CurrentQuotaLimitBase create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getQuotas() - .createOrUpdate(resourceName, scope, this.innerModel(), context); - return this; - } - - CurrentQuotaLimitBaseImpl(String name, com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerObject = new CurrentQuotaLimitBaseInner(); - this.serviceManager = serviceManager; - this.resourceName = name; - } - - public CurrentQuotaLimitBaseImpl update() { - return this; - } - - public CurrentQuotaLimitBase apply() { - this.innerObject - = serviceManager.serviceClient().getQuotas().update(resourceName, scope, this.innerModel(), Context.NONE); - return this; - } - - public CurrentQuotaLimitBase apply(Context context) { - this.innerObject - = serviceManager.serviceClient().getQuotas().update(resourceName, scope, this.innerModel(), context); - return this; - } - - CurrentQuotaLimitBaseImpl(CurrentQuotaLimitBaseInner innerObject, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}", "resourceName"); - this.scope = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}", "scope"); - } - - public CurrentQuotaLimitBase refresh() { - this.innerObject - = serviceManager.serviceClient().getQuotas().getWithResponse(resourceName, scope, Context.NONE).getValue(); - return this; - } - - public CurrentQuotaLimitBase refresh(Context context) { - this.innerObject - = serviceManager.serviceClient().getQuotas().getWithResponse(resourceName, scope, context).getValue(); - return this; - } - - public CurrentQuotaLimitBaseImpl withProperties(QuotaProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/CurrentUsagesBaseImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/CurrentUsagesBaseImpl.java deleted file mode 100644 index d0b33c94b748..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/CurrentUsagesBaseImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.CurrentUsagesBaseInner; -import com.azure.resourcemanager.quota.models.CurrentUsagesBase; -import com.azure.resourcemanager.quota.models.UsagesProperties; - -public final class CurrentUsagesBaseImpl implements CurrentUsagesBase { - private CurrentUsagesBaseInner innerObject; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - CurrentUsagesBaseImpl(CurrentUsagesBaseInner innerObject, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public UsagesProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public CurrentUsagesBaseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitListImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitListImpl.java deleted file mode 100644 index aa840d388434..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitListImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitListInner; -import com.azure.resourcemanager.quota.models.GroupQuotaLimitList; -import com.azure.resourcemanager.quota.models.GroupQuotaLimitListProperties; - -public final class GroupQuotaLimitListImpl implements GroupQuotaLimitList { - private GroupQuotaLimitListInner innerObject; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - GroupQuotaLimitListImpl(GroupQuotaLimitListInner innerObject, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public GroupQuotaLimitListProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public GroupQuotaLimitListInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsClientImpl.java deleted file mode 100644 index 525ee6a9a5ad..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsClientImpl.java +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.quota.fluent.GroupQuotaLimitsClient; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitListInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in GroupQuotaLimitsClient. - */ -public final class GroupQuotaLimitsClientImpl implements GroupQuotaLimitsClient { - /** - * The proxy service used to perform REST calls. - */ - private final GroupQuotaLimitsService service; - - /** - * The service client containing this operation class. - */ - private final QuotaManagementClientImpl client; - - /** - * Initializes an instance of GroupQuotaLimitsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GroupQuotaLimitsClientImpl(QuotaManagementClientImpl client) { - this.service - = RestProxy.create(GroupQuotaLimitsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for QuotaManagementClientGroupQuotaLimits to be used by the proxy service - * to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "QuotaManagementClientGroupQuotaLimits") - public interface GroupQuotaLimitsService { - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaLimits/{location}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaLimits/{location}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the GroupQuotaLimits for the specified resource provider and location for resource names passed in - * $filter=resourceName eq {SKU}. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotaLimits for the specified resource provider and location for resource names passed in - * $filter=resourceName eq {SKU} along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String location) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, groupQuotaName, resourceProviderName, location, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the GroupQuotaLimits for the specified resource provider and location for resource names passed in - * $filter=resourceName eq {SKU}. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotaLimits for the specified resource provider and location for resource names passed in - * $filter=resourceName eq {SKU} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - return listWithResponseAsync(managementGroupId, groupQuotaName, resourceProviderName, location) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the GroupQuotaLimits for the specified resource provider and location for resource names passed in - * $filter=resourceName eq {SKU}. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotaLimits for the specified resource provider and location for resource names passed in - * $filter=resourceName eq {SKU} along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context) { - final String accept = "application/json"; - return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, resourceProviderName, location, accept, context); - } - - /** - * Gets the GroupQuotaLimits for the specified resource provider and location for resource names passed in - * $filter=resourceName eq {SKU}. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotaLimits for the specified resource provider and location for resource names passed in - * $filter=resourceName eq {SKU}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotaLimitListInner list(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location) { - return listWithResponse(managementGroupId, groupQuotaName, resourceProviderName, location, Context.NONE) - .getValue(); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsImpl.java deleted file mode 100644 index 8d6e7550ba35..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.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.quota.fluent.GroupQuotaLimitsClient; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitListInner; -import com.azure.resourcemanager.quota.models.GroupQuotaLimitList; -import com.azure.resourcemanager.quota.models.GroupQuotaLimits; - -public final class GroupQuotaLimitsImpl implements GroupQuotaLimits { - private static final ClientLogger LOGGER = new ClientLogger(GroupQuotaLimitsImpl.class); - - private final GroupQuotaLimitsClient innerClient; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - public GroupQuotaLimitsImpl(GroupQuotaLimitsClient innerClient, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response listWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context) { - Response inner = this.serviceClient() - .listWithResponse(managementGroupId, groupQuotaName, resourceProviderName, location, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GroupQuotaLimitListImpl(inner.getValue(), this.manager())); - } - - public GroupQuotaLimitList list(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location) { - GroupQuotaLimitListInner inner - = this.serviceClient().list(managementGroupId, groupQuotaName, resourceProviderName, location); - if (inner != null) { - return new GroupQuotaLimitListImpl(inner, this.manager()); - } else { - return null; - } - } - - private GroupQuotaLimitsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsRequestsClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsRequestsClientImpl.java deleted file mode 100644 index 7d070da16b31..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsRequestsClientImpl.java +++ /dev/null @@ -1,767 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -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.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.quota.fluent.GroupQuotaLimitsRequestsClient; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitListInner; -import com.azure.resourcemanager.quota.fluent.models.SubmittedResourceRequestStatusInner; -import com.azure.resourcemanager.quota.implementation.models.SubmittedResourceRequestStatusList; -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 GroupQuotaLimitsRequestsClient. - */ -public final class GroupQuotaLimitsRequestsClientImpl implements GroupQuotaLimitsRequestsClient { - /** - * The proxy service used to perform REST calls. - */ - private final GroupQuotaLimitsRequestsService service; - - /** - * The service client containing this operation class. - */ - private final QuotaManagementClientImpl client; - - /** - * Initializes an instance of GroupQuotaLimitsRequestsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GroupQuotaLimitsRequestsClientImpl(QuotaManagementClientImpl client) { - this.service = RestProxy.create(GroupQuotaLimitsRequestsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for QuotaManagementClientGroupQuotaLimitsRequests to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "QuotaManagementClientGroupQuotaLimitsRequests") - public interface GroupQuotaLimitsRequestsService { - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaRequests") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaRequests") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaLimits/{location}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") GroupQuotaLimitListInner groupQuotaRequest, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaLimits/{location}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") GroupQuotaLimitListInner groupQuotaRequest, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/groupQuotaRequests/{requestId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @PathParam("requestId") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/groupQuotaRequests/{requestId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @PathParam("requestId") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get API to check the status of a GroupQuota request by requestId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators \r\n|---------------------|------------------------\n\r\n location eq - * {location} and resource eq {resourceName}\n Example: $filter=location eq eastus and resourceName eq cores. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return aPI to check the status of a GroupQuota request by requestId along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String filter) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, groupQuotaName, resourceProviderName, 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())); - } - - /** - * Get API to check the status of a GroupQuota request by requestId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators \r\n|---------------------|------------------------\n\r\n location eq - * {location} and resource eq {resourceName}\n Example: $filter=location eq eastus and resourceName eq cores. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return aPI to check the status of a GroupQuota request by requestId as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(managementGroupId, groupQuotaName, resourceProviderName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get API to check the status of a GroupQuota request by requestId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators \r\n|---------------------|------------------------\n\r\n location eq - * {location} and resource eq {resourceName}\n Example: $filter=location eq eastus and resourceName eq cores. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return aPI to check the status of a GroupQuota request by requestId along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String managementGroupId, - String groupQuotaName, String resourceProviderName, String filter) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, resourceProviderName, filter, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get API to check the status of a GroupQuota request by requestId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators \r\n|---------------------|------------------------\n\r\n location eq - * {location} and resource eq {resourceName}\n Example: $filter=location eq eastus and resourceName eq cores. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return aPI to check the status of a GroupQuota request by requestId along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String managementGroupId, - String groupQuotaName, String resourceProviderName, String filter, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, resourceProviderName, filter, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get API to check the status of a GroupQuota request by requestId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators \r\n|---------------------|------------------------\n\r\n location eq - * {location} and resource eq {resourceName}\n Example: $filter=location eq eastus and resourceName eq cores. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return aPI to check the status of a GroupQuota request by requestId as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter) { - return new PagedIterable<>( - () -> listSinglePage(managementGroupId, groupQuotaName, resourceProviderName, filter), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Get API to check the status of a GroupQuota request by requestId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators \r\n|---------------------|------------------------\n\r\n location eq - * {location} and resource eq {resourceName}\n Example: $filter=location eq eastus and resourceName eq cores. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return aPI to check the status of a GroupQuota request by requestId as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter, Context context) { - return new PagedIterable<>( - () -> listSinglePage(managementGroupId, groupQuotaName, resourceProviderName, filter, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are - * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a - * new groupQuota request. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Group Quota Limit details along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotaLimitListInner groupQuotaRequest) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, groupQuotaName, resourceProviderName, location, accept, groupQuotaRequest, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are - * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a - * new groupQuota request. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Group Quota Limit details along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotaLimitListInner groupQuotaRequest) { - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, resourceProviderName, location, accept, groupQuotaRequest, Context.NONE); - } - - /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are - * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a - * new groupQuota request. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Group Quota Limit details along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotaLimitListInner groupQuotaRequest, Context context) { - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, resourceProviderName, location, accept, groupQuotaRequest, context); - } - - /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are - * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a - * new groupQuota request. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list of Group Quota Limit details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GroupQuotaLimitListInner> beginUpdateAsync( - String managementGroupId, String groupQuotaName, String resourceProviderName, String location, - GroupQuotaLimitListInner groupQuotaRequest) { - Mono>> mono = updateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, location, groupQuotaRequest); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), GroupQuotaLimitListInner.class, GroupQuotaLimitListInner.class, - this.client.getContext()); - } - - /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are - * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a - * new groupQuota request. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list of Group Quota Limit details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GroupQuotaLimitListInner> beginUpdateAsync( - String managementGroupId, String groupQuotaName, String resourceProviderName, String location) { - final GroupQuotaLimitListInner groupQuotaRequest = null; - Mono>> mono = updateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, location, groupQuotaRequest); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), GroupQuotaLimitListInner.class, GroupQuotaLimitListInner.class, - this.client.getContext()); - } - - /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are - * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a - * new groupQuota request. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list of Group Quota Limit details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupQuotaLimitListInner> beginUpdate( - String managementGroupId, String groupQuotaName, String resourceProviderName, String location, - GroupQuotaLimitListInner groupQuotaRequest) { - Response response - = updateWithResponse(managementGroupId, groupQuotaName, resourceProviderName, location, groupQuotaRequest); - return this.client.getLroResult(response, - GroupQuotaLimitListInner.class, GroupQuotaLimitListInner.class, Context.NONE); - } - - /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are - * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a - * new groupQuota request. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list of Group Quota Limit details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupQuotaLimitListInner> - beginUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, String location) { - final GroupQuotaLimitListInner groupQuotaRequest = null; - Response response - = updateWithResponse(managementGroupId, groupQuotaName, resourceProviderName, location, groupQuotaRequest); - return this.client.getLroResult(response, - GroupQuotaLimitListInner.class, GroupQuotaLimitListInner.class, Context.NONE); - } - - /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are - * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a - * new groupQuota request. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 list of Group Quota Limit details. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupQuotaLimitListInner> beginUpdate( - String managementGroupId, String groupQuotaName, String resourceProviderName, String location, - GroupQuotaLimitListInner groupQuotaRequest, Context context) { - Response response = updateWithResponse(managementGroupId, groupQuotaName, resourceProviderName, - location, groupQuotaRequest, context); - return this.client.getLroResult(response, - GroupQuotaLimitListInner.class, GroupQuotaLimitListInner.class, context); - } - - /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are - * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a - * new groupQuota request. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Group Quota Limit details on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotaLimitListInner groupQuotaRequest) { - return beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, groupQuotaRequest) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are - * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a - * new groupQuota request. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Group Quota Limit details on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - final GroupQuotaLimitListInner groupQuotaRequest = null; - return beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, groupQuotaRequest) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are - * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a - * new groupQuota request. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Group Quota Limit details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotaLimitListInner update(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location) { - final GroupQuotaLimitListInner groupQuotaRequest = null; - return beginUpdate(managementGroupId, groupQuotaName, resourceProviderName, location, groupQuotaRequest) - .getFinalResult(); - } - - /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are - * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a - * new groupQuota request. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Group Quota Limit details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotaLimitListInner update(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location, GroupQuotaLimitListInner groupQuotaRequest, Context context) { - return beginUpdate(managementGroupId, groupQuotaName, resourceProviderName, location, groupQuotaRequest, - context).getFinalResult(); - } - - /** - * Get API to check the status of a GroupQuota request by requestId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param requestId Request 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 aPI to check the status of a GroupQuota request by requestId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String managementGroupId, - String groupQuotaName, String requestId) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, groupQuotaName, requestId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get API to check the status of a GroupQuota request by requestId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param requestId Request 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 aPI to check the status of a GroupQuota request by requestId on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String managementGroupId, String groupQuotaName, - String requestId) { - return getWithResponseAsync(managementGroupId, groupQuotaName, requestId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get API to check the status of a GroupQuota request by requestId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param requestId Request 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 aPI to check the status of a GroupQuota request by requestId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String managementGroupId, - String groupQuotaName, String requestId, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, requestId, accept, context); - } - - /** - * Get API to check the status of a GroupQuota request by requestId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param requestId Request 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 aPI to check the status of a GroupQuota request by requestId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SubmittedResourceRequestStatusInner get(String managementGroupId, String groupQuotaName, String requestId) { - return getWithResponse(managementGroupId, groupQuotaName, requestId, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return aPI to check the status of a GroupQuota request by requestId along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return aPI to check the status of a GroupQuota request by requestId along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return aPI to check the status of a GroupQuota request by requestId along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsRequestsImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsRequestsImpl.java deleted file mode 100644 index 85c9e91b4887..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLimitsRequestsImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.quota.fluent.GroupQuotaLimitsRequestsClient; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitListInner; -import com.azure.resourcemanager.quota.fluent.models.SubmittedResourceRequestStatusInner; -import com.azure.resourcemanager.quota.models.GroupQuotaLimitList; -import com.azure.resourcemanager.quota.models.GroupQuotaLimitsRequests; -import com.azure.resourcemanager.quota.models.SubmittedResourceRequestStatus; - -public final class GroupQuotaLimitsRequestsImpl implements GroupQuotaLimitsRequests { - private static final ClientLogger LOGGER = new ClientLogger(GroupQuotaLimitsRequestsImpl.class); - - private final GroupQuotaLimitsRequestsClient innerClient; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - public GroupQuotaLimitsRequestsImpl(GroupQuotaLimitsRequestsClient innerClient, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter) { - PagedIterable inner - = this.serviceClient().list(managementGroupId, groupQuotaName, resourceProviderName, filter); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new SubmittedResourceRequestStatusImpl(inner1, this.manager())); - } - - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter, Context context) { - PagedIterable inner - = this.serviceClient().list(managementGroupId, groupQuotaName, resourceProviderName, filter, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new SubmittedResourceRequestStatusImpl(inner1, this.manager())); - } - - public GroupQuotaLimitList update(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location) { - GroupQuotaLimitListInner inner - = this.serviceClient().update(managementGroupId, groupQuotaName, resourceProviderName, location); - if (inner != null) { - return new GroupQuotaLimitListImpl(inner, this.manager()); - } else { - return null; - } - } - - public GroupQuotaLimitList update(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location, GroupQuotaLimitListInner groupQuotaRequest, Context context) { - GroupQuotaLimitListInner inner = this.serviceClient() - .update(managementGroupId, groupQuotaName, resourceProviderName, location, groupQuotaRequest, context); - if (inner != null) { - return new GroupQuotaLimitListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String managementGroupId, String groupQuotaName, - String requestId, Context context) { - Response inner - = this.serviceClient().getWithResponse(managementGroupId, groupQuotaName, requestId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SubmittedResourceRequestStatusImpl(inner.getValue(), this.manager())); - } - - public SubmittedResourceRequestStatus get(String managementGroupId, String groupQuotaName, String requestId) { - SubmittedResourceRequestStatusInner inner - = this.serviceClient().get(managementGroupId, groupQuotaName, requestId); - if (inner != null) { - return new SubmittedResourceRequestStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - private GroupQuotaLimitsRequestsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLocationSettingsClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLocationSettingsClientImpl.java deleted file mode 100644 index a04435d85eac..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLocationSettingsClientImpl.java +++ /dev/null @@ -1,1002 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -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.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.quota.fluent.GroupQuotaLocationSettingsClient; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEnforcementStatusInner; -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 GroupQuotaLocationSettingsClient. - */ -public final class GroupQuotaLocationSettingsClientImpl implements GroupQuotaLocationSettingsClient { - /** - * The proxy service used to perform REST calls. - */ - private final GroupQuotaLocationSettingsService service; - - /** - * The service client containing this operation class. - */ - private final QuotaManagementClientImpl client; - - /** - * Initializes an instance of GroupQuotaLocationSettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GroupQuotaLocationSettingsClientImpl(QuotaManagementClientImpl client) { - this.service = RestProxy.create(GroupQuotaLocationSettingsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for QuotaManagementClientGroupQuotaLocationSettings to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "QuotaManagementClientGroupQuotaLocationSettings") - public interface GroupQuotaLocationSettingsService { - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/locationSettings/{location}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/locationSettings/{location}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/locationSettings/{location}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") GroupQuotasEnforcementStatusInner locationSettings, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/locationSettings/{location}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") GroupQuotasEnforcementStatusInner locationSettings, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/locationSettings/{location}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") GroupQuotasEnforcementStatusInner locationSettings, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/locationSettings/{location}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") GroupQuotasEnforcementStatusInner locationSettings, Context context); - } - - /** - * Gets the GroupQuotas enforcement settings for the ResourceProvider/location. The locations, where GroupQuota - * enforcement is not enabled will return Not Found. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas enforcement settings for the ResourceProvider/location along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String location) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, groupQuotaName, resourceProviderName, location, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the GroupQuotas enforcement settings for the ResourceProvider/location. The locations, where GroupQuota - * enforcement is not enabled will return Not Found. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas enforcement settings for the ResourceProvider/location on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - return getWithResponseAsync(managementGroupId, groupQuotaName, resourceProviderName, location) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the GroupQuotas enforcement settings for the ResourceProvider/location. The locations, where GroupQuota - * enforcement is not enabled will return Not Found. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas enforcement settings for the ResourceProvider/location along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, resourceProviderName, location, accept, context); - } - - /** - * Gets the GroupQuotas enforcement settings for the ResourceProvider/location. The locations, where GroupQuota - * enforcement is not enabled will return Not Found. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas enforcement settings for the ResourceProvider/location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotasEnforcementStatusInner get(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - return getWithResponse(managementGroupId, groupQuotaName, resourceProviderName, location, Context.NONE) - .getValue(); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Then delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String location, - GroupQuotasEnforcementStatusInner locationSettings) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, groupQuotaName, resourceProviderName, location, accept, locationSettings, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Then delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementStatusInner locationSettings) { - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, resourceProviderName, location, accept, locationSettings, Context.NONE); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Then delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementStatusInner locationSettings, - Context context) { - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, resourceProviderName, location, accept, locationSettings, context); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Then delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GroupQuotasEnforcementStatusInner> - beginCreateOrUpdateAsync(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location, GroupQuotasEnforcementStatusInner locationSettings) { - Mono>> mono = createOrUpdateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, location, locationSettings); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), GroupQuotasEnforcementStatusInner.class, - GroupQuotasEnforcementStatusInner.class, this.client.getContext()); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Then delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GroupQuotasEnforcementStatusInner> - beginCreateOrUpdateAsync(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location) { - final GroupQuotasEnforcementStatusInner locationSettings = null; - Mono>> mono = createOrUpdateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, location, locationSettings); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), GroupQuotasEnforcementStatusInner.class, - GroupQuotasEnforcementStatusInner.class, this.client.getContext()); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Then delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupQuotasEnforcementStatusInner> - beginCreateOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location, GroupQuotasEnforcementStatusInner locationSettings) { - Response response = createOrUpdateWithResponse(managementGroupId, groupQuotaName, - resourceProviderName, location, locationSettings); - return this.client.getLroResult(response, - GroupQuotasEnforcementStatusInner.class, GroupQuotasEnforcementStatusInner.class, Context.NONE); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Then delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupQuotasEnforcementStatusInner> - beginCreateOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location) { - final GroupQuotasEnforcementStatusInner locationSettings = null; - Response response = createOrUpdateWithResponse(managementGroupId, groupQuotaName, - resourceProviderName, location, locationSettings); - return this.client.getLroResult(response, - GroupQuotasEnforcementStatusInner.class, GroupQuotasEnforcementStatusInner.class, Context.NONE); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Then delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupQuotasEnforcementStatusInner> - beginCreateOrUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location, GroupQuotasEnforcementStatusInner locationSettings, Context context) { - Response response = createOrUpdateWithResponse(managementGroupId, groupQuotaName, - resourceProviderName, location, locationSettings, context); - return this.client.getLroResult(response, - GroupQuotasEnforcementStatusInner.class, GroupQuotasEnforcementStatusInner.class, context); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Then delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementStatusInner locationSettings) { - return beginCreateOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, - locationSettings).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Then delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - final GroupQuotasEnforcementStatusInner locationSettings = null; - return beginCreateOrUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, - locationSettings).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Then delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotasEnforcementStatusInner createOrUpdate(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - final GroupQuotasEnforcementStatusInner locationSettings = null; - return beginCreateOrUpdate(managementGroupId, groupQuotaName, resourceProviderName, location, locationSettings) - .getFinalResult(); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Then delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotasEnforcementStatusInner createOrUpdate(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementStatusInner locationSettings, - Context context) { - return beginCreateOrUpdate(managementGroupId, groupQuotaName, resourceProviderName, location, locationSettings, - context).getFinalResult(); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementStatusInner locationSettings) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, groupQuotaName, resourceProviderName, location, accept, locationSettings, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementStatusInner locationSettings) { - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, resourceProviderName, location, accept, locationSettings, Context.NONE); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementStatusInner locationSettings, - Context context) { - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, resourceProviderName, location, accept, locationSettings, context); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GroupQuotasEnforcementStatusInner> - beginUpdateAsync(String managementGroupId, String groupQuotaName, String resourceProviderName, String location, - GroupQuotasEnforcementStatusInner locationSettings) { - Mono>> mono = updateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, location, locationSettings); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), GroupQuotasEnforcementStatusInner.class, - GroupQuotasEnforcementStatusInner.class, this.client.getContext()); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GroupQuotasEnforcementStatusInner> - beginUpdateAsync(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location) { - final GroupQuotasEnforcementStatusInner locationSettings = null; - Mono>> mono = updateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, location, locationSettings); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), GroupQuotasEnforcementStatusInner.class, - GroupQuotasEnforcementStatusInner.class, this.client.getContext()); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupQuotasEnforcementStatusInner> beginUpdate( - String managementGroupId, String groupQuotaName, String resourceProviderName, String location, - GroupQuotasEnforcementStatusInner locationSettings) { - Response response - = updateWithResponse(managementGroupId, groupQuotaName, resourceProviderName, location, locationSettings); - return this.client.getLroResult(response, - GroupQuotasEnforcementStatusInner.class, GroupQuotasEnforcementStatusInner.class, Context.NONE); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupQuotasEnforcementStatusInner> - beginUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, String location) { - final GroupQuotasEnforcementStatusInner locationSettings = null; - Response response - = updateWithResponse(managementGroupId, groupQuotaName, resourceProviderName, location, locationSettings); - return this.client.getLroResult(response, - GroupQuotasEnforcementStatusInner.class, GroupQuotasEnforcementStatusInner.class, Context.NONE); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupQuotasEnforcementStatusInner> beginUpdate( - String managementGroupId, String groupQuotaName, String resourceProviderName, String location, - GroupQuotasEnforcementStatusInner locationSettings, Context context) { - Response response = updateWithResponse(managementGroupId, groupQuotaName, resourceProviderName, - location, locationSettings, context); - return this.client.getLroResult(response, - GroupQuotasEnforcementStatusInner.class, GroupQuotasEnforcementStatusInner.class, context); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementStatusInner locationSettings) { - return beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, locationSettings) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - final GroupQuotasEnforcementStatusInner locationSettings = null; - return beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, locationSettings) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotasEnforcementStatusInner update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - final GroupQuotasEnforcementStatusInner locationSettings = null; - return beginUpdate(managementGroupId, groupQuotaName, resourceProviderName, location, locationSettings) - .getFinalResult(); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotasEnforcementStatusInner update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementStatusInner locationSettings, - Context context) { - return beginUpdate(managementGroupId, groupQuotaName, resourceProviderName, location, locationSettings, context) - .getFinalResult(); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLocationSettingsImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLocationSettingsImpl.java deleted file mode 100644 index 3d58449a4697..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaLocationSettingsImpl.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.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.quota.fluent.GroupQuotaLocationSettingsClient; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEnforcementStatusInner; -import com.azure.resourcemanager.quota.models.GroupQuotaLocationSettings; -import com.azure.resourcemanager.quota.models.GroupQuotasEnforcementStatus; - -public final class GroupQuotaLocationSettingsImpl implements GroupQuotaLocationSettings { - private static final ClientLogger LOGGER = new ClientLogger(GroupQuotaLocationSettingsImpl.class); - - private final GroupQuotaLocationSettingsClient innerClient; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - public GroupQuotaLocationSettingsImpl(GroupQuotaLocationSettingsClient innerClient, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context) { - Response inner = this.serviceClient() - .getWithResponse(managementGroupId, groupQuotaName, resourceProviderName, location, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GroupQuotasEnforcementStatusImpl(inner.getValue(), this.manager())); - } - - public GroupQuotasEnforcementStatus get(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - GroupQuotasEnforcementStatusInner inner - = this.serviceClient().get(managementGroupId, groupQuotaName, resourceProviderName, location); - if (inner != null) { - return new GroupQuotasEnforcementStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - public GroupQuotasEnforcementStatus createOrUpdate(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - GroupQuotasEnforcementStatusInner inner - = this.serviceClient().createOrUpdate(managementGroupId, groupQuotaName, resourceProviderName, location); - if (inner != null) { - return new GroupQuotasEnforcementStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - public GroupQuotasEnforcementStatus createOrUpdate(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementStatusInner locationSettings, - Context context) { - GroupQuotasEnforcementStatusInner inner = this.serviceClient() - .createOrUpdate(managementGroupId, groupQuotaName, resourceProviderName, location, locationSettings, - context); - if (inner != null) { - return new GroupQuotasEnforcementStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - public GroupQuotasEnforcementStatus update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - GroupQuotasEnforcementStatusInner inner - = this.serviceClient().update(managementGroupId, groupQuotaName, resourceProviderName, location); - if (inner != null) { - return new GroupQuotasEnforcementStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - public GroupQuotasEnforcementStatus update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementStatusInner locationSettings, - Context context) { - GroupQuotasEnforcementStatusInner inner = this.serviceClient() - .update(managementGroupId, groupQuotaName, resourceProviderName, location, locationSettings, context); - if (inner != null) { - return new GroupQuotasEnforcementStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - private GroupQuotaLocationSettingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationRequestsClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationRequestsClientImpl.java deleted file mode 100644 index b277a35c2a07..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationRequestsClientImpl.java +++ /dev/null @@ -1,723 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -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.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.quota.fluent.GroupQuotaSubscriptionAllocationRequestsClient; -import com.azure.resourcemanager.quota.fluent.models.QuotaAllocationRequestStatusInner; -import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsListInner; -import com.azure.resourcemanager.quota.implementation.models.QuotaAllocationRequestStatusList; -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 - * GroupQuotaSubscriptionAllocationRequestsClient. - */ -public final class GroupQuotaSubscriptionAllocationRequestsClientImpl - implements GroupQuotaSubscriptionAllocationRequestsClient { - /** - * The proxy service used to perform REST calls. - */ - private final GroupQuotaSubscriptionAllocationRequestsService service; - - /** - * The service client containing this operation class. - */ - private final QuotaManagementClientImpl client; - - /** - * Initializes an instance of GroupQuotaSubscriptionAllocationRequestsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GroupQuotaSubscriptionAllocationRequestsClientImpl(QuotaManagementClientImpl client) { - this.service = RestProxy.create(GroupQuotaSubscriptionAllocationRequestsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for QuotaManagementClientGroupQuotaSubscriptionAllocationRequests to be - * used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "QuotaManagementClientGroupQuotaSubscriptionAllocationRequests") - public interface GroupQuotaSubscriptionAllocationRequestsService { - @Patch("/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocations/{location}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("subscriptionId") String subscriptionId, @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") SubscriptionQuotaAllocationsListInner allocateQuotaRequest, Context context); - - @Patch("/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocations/{location}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("subscriptionId") String subscriptionId, @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") SubscriptionQuotaAllocationsListInner allocateQuotaRequest, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocationRequests/{allocationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("subscriptionId") String subscriptionId, @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, - @PathParam("allocationId") String allocationId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocationRequests/{allocationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("subscriptionId") String subscriptionId, @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, - @PathParam("allocationId") String allocationId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocationRequests") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("subscriptionId") String subscriptionId, @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocationRequests") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("subscriptionId") String subscriptionId, @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param allocateQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 quota list along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, this.client.getSubscriptionId(), groupQuotaName, resourceProviderName, location, - contentType, accept, allocateQuotaRequest, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param allocateQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 quota list along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - this.client.getSubscriptionId(), groupQuotaName, resourceProviderName, location, contentType, accept, - allocateQuotaRequest, Context.NONE); - } - - /** - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param allocateQuotaRequest Quota requests payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 quota list along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest, - Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - this.client.getSubscriptionId(), groupQuotaName, resourceProviderName, location, contentType, accept, - allocateQuotaRequest, context); - } - - /** - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param allocateQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 quota list. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SubscriptionQuotaAllocationsListInner> - beginUpdateAsync(String managementGroupId, String groupQuotaName, String resourceProviderName, String location, - SubscriptionQuotaAllocationsListInner allocateQuotaRequest) { - Mono>> mono = updateWithResponseAsync(managementGroupId, groupQuotaName, - resourceProviderName, location, allocateQuotaRequest); - return this.client.getLroResult( - mono, this.client.getHttpPipeline(), SubscriptionQuotaAllocationsListInner.class, - SubscriptionQuotaAllocationsListInner.class, this.client.getContext()); - } - - /** - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param allocateQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 subscription quota list. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SubscriptionQuotaAllocationsListInner> - beginUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, String location, - SubscriptionQuotaAllocationsListInner allocateQuotaRequest) { - Response response = updateWithResponse(managementGroupId, groupQuotaName, resourceProviderName, - location, allocateQuotaRequest); - return this.client.getLroResult( - response, SubscriptionQuotaAllocationsListInner.class, SubscriptionQuotaAllocationsListInner.class, - Context.NONE); - } - - /** - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param allocateQuotaRequest Quota requests payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 subscription quota list. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SubscriptionQuotaAllocationsListInner> - beginUpdate(String managementGroupId, String groupQuotaName, String resourceProviderName, String location, - SubscriptionQuotaAllocationsListInner allocateQuotaRequest, Context context) { - Response response = updateWithResponse(managementGroupId, groupQuotaName, resourceProviderName, - location, allocateQuotaRequest, context); - return this.client.getLroResult( - response, SubscriptionQuotaAllocationsListInner.class, SubscriptionQuotaAllocationsListInner.class, - context); - } - - /** - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param allocateQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 quota list on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest) { - return beginUpdateAsync(managementGroupId, groupQuotaName, resourceProviderName, location, allocateQuotaRequest) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param allocateQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 quota list. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SubscriptionQuotaAllocationsListInner update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest) { - return beginUpdate(managementGroupId, groupQuotaName, resourceProviderName, location, allocateQuotaRequest) - .getFinalResult(); - } - - /** - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param allocateQuotaRequest Quota requests payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 quota list. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SubscriptionQuotaAllocationsListInner update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest, - Context context) { - return beginUpdate(managementGroupId, groupQuotaName, resourceProviderName, location, allocateQuotaRequest, - context).getFinalResult(); - } - - /** - * Get the quota allocation request status for the subscriptionId by allocationId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param allocationId Request 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 quota allocation request status for the subscriptionId by allocationId along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String allocationId) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, this.client.getSubscriptionId(), groupQuotaName, resourceProviderName, allocationId, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the quota allocation request status for the subscriptionId by allocationId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param allocationId Request 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 quota allocation request status for the subscriptionId by allocationId on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String allocationId) { - return getWithResponseAsync(managementGroupId, groupQuotaName, resourceProviderName, allocationId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the quota allocation request status for the subscriptionId by allocationId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param allocationId Request 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 quota allocation request status for the subscriptionId by allocationId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String allocationId, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - this.client.getSubscriptionId(), groupQuotaName, resourceProviderName, allocationId, accept, context); - } - - /** - * Get the quota allocation request status for the subscriptionId by allocationId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param allocationId Request 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 quota allocation request status for the subscriptionId by allocationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public QuotaAllocationRequestStatusInner get(String managementGroupId, String groupQuotaName, - String resourceProviderName, String allocationId) { - return getWithResponse(managementGroupId, groupQuotaName, resourceProviderName, allocationId, Context.NONE) - .getValue(); - } - - /** - * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is - * required. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 quotaAllocationRequests for a resourceProvider/location along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String filter) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - this.client.getSubscriptionId(), groupQuotaName, resourceProviderName, 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())); - } - - /** - * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is - * required. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 quotaAllocationRequests for a resourceProvider/location as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(managementGroupId, groupQuotaName, resourceProviderName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is - * required. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 quotaAllocationRequests for a resourceProvider/location along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String managementGroupId, - String groupQuotaName, String resourceProviderName, String filter) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - this.client.getSubscriptionId(), groupQuotaName, resourceProviderName, filter, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is - * required. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 quotaAllocationRequests for a resourceProvider/location along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String managementGroupId, - String groupQuotaName, String resourceProviderName, String filter, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - this.client.getSubscriptionId(), groupQuotaName, resourceProviderName, filter, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is - * required. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 quotaAllocationRequests for a resourceProvider/location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter) { - return new PagedIterable<>( - () -> listSinglePage(managementGroupId, groupQuotaName, resourceProviderName, filter), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is - * required. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 quotaAllocationRequests for a resourceProvider/location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter, Context context) { - return new PagedIterable<>( - () -> listSinglePage(managementGroupId, groupQuotaName, resourceProviderName, filter, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the quotaAllocationRequests for a resourceProvider/location along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the quotaAllocationRequests for a resourceProvider/location along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the quotaAllocationRequests for a resourceProvider/location along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationRequestsImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationRequestsImpl.java deleted file mode 100644 index 968e48db64c2..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationRequestsImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.quota.fluent.GroupQuotaSubscriptionAllocationRequestsClient; -import com.azure.resourcemanager.quota.fluent.models.QuotaAllocationRequestStatusInner; -import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsListInner; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionAllocationRequests; -import com.azure.resourcemanager.quota.models.QuotaAllocationRequestStatus; -import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocationsList; - -public final class GroupQuotaSubscriptionAllocationRequestsImpl implements GroupQuotaSubscriptionAllocationRequests { - private static final ClientLogger LOGGER = new ClientLogger(GroupQuotaSubscriptionAllocationRequestsImpl.class); - - private final GroupQuotaSubscriptionAllocationRequestsClient innerClient; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - public GroupQuotaSubscriptionAllocationRequestsImpl(GroupQuotaSubscriptionAllocationRequestsClient innerClient, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public SubscriptionQuotaAllocationsList update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest) { - SubscriptionQuotaAllocationsListInner inner = this.serviceClient() - .update(managementGroupId, groupQuotaName, resourceProviderName, location, allocateQuotaRequest); - if (inner != null) { - return new SubscriptionQuotaAllocationsListImpl(inner, this.manager()); - } else { - return null; - } - } - - public SubscriptionQuotaAllocationsList update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest, - Context context) { - SubscriptionQuotaAllocationsListInner inner = this.serviceClient() - .update(managementGroupId, groupQuotaName, resourceProviderName, location, allocateQuotaRequest, context); - if (inner != null) { - return new SubscriptionQuotaAllocationsListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String allocationId, Context context) { - Response inner = this.serviceClient() - .getWithResponse(managementGroupId, groupQuotaName, resourceProviderName, allocationId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new QuotaAllocationRequestStatusImpl(inner.getValue(), this.manager())); - } - - public QuotaAllocationRequestStatus get(String managementGroupId, String groupQuotaName, - String resourceProviderName, String allocationId) { - QuotaAllocationRequestStatusInner inner - = this.serviceClient().get(managementGroupId, groupQuotaName, resourceProviderName, allocationId); - if (inner != null) { - return new QuotaAllocationRequestStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter) { - PagedIterable inner - = this.serviceClient().list(managementGroupId, groupQuotaName, resourceProviderName, filter); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new QuotaAllocationRequestStatusImpl(inner1, this.manager())); - } - - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter, Context context) { - PagedIterable inner - = this.serviceClient().list(managementGroupId, groupQuotaName, resourceProviderName, filter, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new QuotaAllocationRequestStatusImpl(inner1, this.manager())); - } - - private GroupQuotaSubscriptionAllocationRequestsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationsClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationsClientImpl.java deleted file mode 100644 index 72047e03d0ef..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationsClientImpl.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.quota.fluent.GroupQuotaSubscriptionAllocationsClient; -import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsListInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in GroupQuotaSubscriptionAllocationsClient. - */ -public final class GroupQuotaSubscriptionAllocationsClientImpl implements GroupQuotaSubscriptionAllocationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final GroupQuotaSubscriptionAllocationsService service; - - /** - * The service client containing this operation class. - */ - private final QuotaManagementClientImpl client; - - /** - * Initializes an instance of GroupQuotaSubscriptionAllocationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GroupQuotaSubscriptionAllocationsClientImpl(QuotaManagementClientImpl client) { - this.service = RestProxy.create(GroupQuotaSubscriptionAllocationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for QuotaManagementClientGroupQuotaSubscriptionAllocations to be used by - * the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "QuotaManagementClientGroupQuotaSubscriptionAllocations") - public interface GroupQuotaSubscriptionAllocationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocations/{location}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("subscriptionId") String subscriptionId, @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocations/{location}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("subscriptionId") String subscriptionId, @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets all the quota allocated to a subscription for the specified resource provider and location for resource - * names passed in $filter=resourceName eq {SKU}. This will include the GroupQuota and total quota allocated to the - * subscription. Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 quota allocated to a subscription for the specified resource provider and location for resource - * names passed in $filter=resourceName eq {SKU} along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String location) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - this.client.getSubscriptionId(), groupQuotaName, resourceProviderName, location, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets all the quota allocated to a subscription for the specified resource provider and location for resource - * names passed in $filter=resourceName eq {SKU}. This will include the GroupQuota and total quota allocated to the - * subscription. Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 quota allocated to a subscription for the specified resource provider and location for resource - * names passed in $filter=resourceName eq {SKU} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - return listWithResponseAsync(managementGroupId, groupQuotaName, resourceProviderName, location) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets all the quota allocated to a subscription for the specified resource provider and location for resource - * names passed in $filter=resourceName eq {SKU}. This will include the GroupQuota and total quota allocated to the - * subscription. Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 quota allocated to a subscription for the specified resource provider and location for resource - * names passed in $filter=resourceName eq {SKU} along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String managementGroupId, - String groupQuotaName, String resourceProviderName, String location, Context context) { - final String accept = "application/json"; - return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - this.client.getSubscriptionId(), groupQuotaName, resourceProviderName, location, accept, context); - } - - /** - * Gets all the quota allocated to a subscription for the specified resource provider and location for resource - * names passed in $filter=resourceName eq {SKU}. This will include the GroupQuota and total quota allocated to the - * subscription. Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 quota allocated to a subscription for the specified resource provider and location for resource - * names passed in $filter=resourceName eq {SKU}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SubscriptionQuotaAllocationsListInner list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - return listWithResponse(managementGroupId, groupQuotaName, resourceProviderName, location, Context.NONE) - .getValue(); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationsImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationsImpl.java deleted file mode 100644 index 74b42b38a7bd..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionAllocationsImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.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.quota.fluent.GroupQuotaSubscriptionAllocationsClient; -import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsListInner; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionAllocations; -import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocationsList; - -public final class GroupQuotaSubscriptionAllocationsImpl implements GroupQuotaSubscriptionAllocations { - private static final ClientLogger LOGGER = new ClientLogger(GroupQuotaSubscriptionAllocationsImpl.class); - - private final GroupQuotaSubscriptionAllocationsClient innerClient; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - public GroupQuotaSubscriptionAllocationsImpl(GroupQuotaSubscriptionAllocationsClient innerClient, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response listWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context) { - Response inner = this.serviceClient() - .listWithResponse(managementGroupId, groupQuotaName, resourceProviderName, location, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SubscriptionQuotaAllocationsListImpl(inner.getValue(), this.manager())); - } - - public SubscriptionQuotaAllocationsList list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - SubscriptionQuotaAllocationsListInner inner - = this.serviceClient().list(managementGroupId, groupQuotaName, resourceProviderName, location); - if (inner != null) { - return new SubscriptionQuotaAllocationsListImpl(inner, this.manager()); - } else { - return null; - } - } - - private GroupQuotaSubscriptionAllocationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionIdImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionIdImpl.java deleted file mode 100644 index 68886abb990b..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionIdImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaSubscriptionIdInner; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionId; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionIdProperties; - -public final class GroupQuotaSubscriptionIdImpl implements GroupQuotaSubscriptionId { - private GroupQuotaSubscriptionIdInner innerObject; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - GroupQuotaSubscriptionIdImpl(GroupQuotaSubscriptionIdInner innerObject, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public GroupQuotaSubscriptionIdProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public GroupQuotaSubscriptionIdInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionRequestStatusImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionRequestStatusImpl.java deleted file mode 100644 index 952b7c154b04..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionRequestStatusImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaSubscriptionRequestStatusInner; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionRequestStatus; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionRequestStatusProperties; - -public final class GroupQuotaSubscriptionRequestStatusImpl implements GroupQuotaSubscriptionRequestStatus { - private GroupQuotaSubscriptionRequestStatusInner innerObject; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - GroupQuotaSubscriptionRequestStatusImpl(GroupQuotaSubscriptionRequestStatusInner innerObject, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public GroupQuotaSubscriptionRequestStatusProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public GroupQuotaSubscriptionRequestStatusInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionRequestsClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionRequestsClientImpl.java deleted file mode 100644 index 73b9c4676db0..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionRequestsClientImpl.java +++ /dev/null @@ -1,376 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.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.quota.fluent.GroupQuotaSubscriptionRequestsClient; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaSubscriptionRequestStatusInner; -import com.azure.resourcemanager.quota.implementation.models.GroupQuotaSubscriptionRequestStatusList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in GroupQuotaSubscriptionRequestsClient. - */ -public final class GroupQuotaSubscriptionRequestsClientImpl implements GroupQuotaSubscriptionRequestsClient { - /** - * The proxy service used to perform REST calls. - */ - private final GroupQuotaSubscriptionRequestsService service; - - /** - * The service client containing this operation class. - */ - private final QuotaManagementClientImpl client; - - /** - * Initializes an instance of GroupQuotaSubscriptionRequestsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GroupQuotaSubscriptionRequestsClientImpl(QuotaManagementClientImpl client) { - this.service = RestProxy.create(GroupQuotaSubscriptionRequestsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for QuotaManagementClientGroupQuotaSubscriptionRequests to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "QuotaManagementClientGroupQuotaSubscriptionRequests") - public interface GroupQuotaSubscriptionRequestsService { - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/subscriptionRequests/{requestId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @PathParam("requestId") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/subscriptionRequests/{requestId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @PathParam("requestId") String requestId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/subscriptionRequests") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/subscriptionRequests") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get API to check the status of a subscriptionIds request by requestId. Use the polling API - OperationsStatus URI - * specified in Azure-AsyncOperation header field, with retry-after duration in seconds to check the intermediate - * status. This API provides the finals status with the request details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param requestId Request 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 aPI to check the status of a subscriptionIds request by requestId along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String managementGroupId, - String groupQuotaName, String requestId) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, groupQuotaName, requestId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get API to check the status of a subscriptionIds request by requestId. Use the polling API - OperationsStatus URI - * specified in Azure-AsyncOperation header field, with retry-after duration in seconds to check the intermediate - * status. This API provides the finals status with the request details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param requestId Request 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 aPI to check the status of a subscriptionIds request by requestId on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String managementGroupId, String groupQuotaName, - String requestId) { - return getWithResponseAsync(managementGroupId, groupQuotaName, requestId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get API to check the status of a subscriptionIds request by requestId. Use the polling API - OperationsStatus URI - * specified in Azure-AsyncOperation header field, with retry-after duration in seconds to check the intermediate - * status. This API provides the finals status with the request details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param requestId Request 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 aPI to check the status of a subscriptionIds request by requestId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String managementGroupId, - String groupQuotaName, String requestId, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, requestId, accept, context); - } - - /** - * Get API to check the status of a subscriptionIds request by requestId. Use the polling API - OperationsStatus URI - * specified in Azure-AsyncOperation header field, with retry-after duration in seconds to check the intermediate - * status. This API provides the finals status with the request details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param requestId Request 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 aPI to check the status of a subscriptionIds request by requestId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotaSubscriptionRequestStatusInner get(String managementGroupId, String groupQuotaName, - String requestId) { - return getWithResponse(managementGroupId, groupQuotaName, requestId, Context.NONE).getValue(); - } - - /** - * List API to check the status of a subscriptionId requests by requestId. Request history is maintained for 1 year. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionRequests Status along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String managementGroupId, - String groupQuotaName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, groupQuotaName, 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 API to check the status of a subscriptionId requests by requestId. Request history is maintained for 1 year. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionRequests Status as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String managementGroupId, - String groupQuotaName) { - return new PagedFlux<>(() -> listSinglePageAsync(managementGroupId, groupQuotaName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List API to check the status of a subscriptionId requests by requestId. Request history is maintained for 1 year. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionRequests Status along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String managementGroupId, - String groupQuotaName) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getApiVersion(), managementGroupId, groupQuotaName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List API to check the status of a subscriptionId requests by requestId. Request history is maintained for 1 year. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionRequests Status along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String managementGroupId, - String groupQuotaName, Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getApiVersion(), managementGroupId, groupQuotaName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List API to check the status of a subscriptionId requests by requestId. Request history is maintained for 1 year. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionRequests Status as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId, - String groupQuotaName) { - return new PagedIterable<>(() -> listSinglePage(managementGroupId, groupQuotaName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * List API to check the status of a subscriptionId requests by requestId. Request history is maintained for 1 year. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionRequests Status as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId, String groupQuotaName, - Context context) { - return new PagedIterable<>(() -> listSinglePage(managementGroupId, groupQuotaName, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionRequests Status along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionRequests Status along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionRequests Status along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, - Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionRequestsImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionRequestsImpl.java deleted file mode 100644 index 4f7c9e79cd3f..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionRequestsImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.quota.fluent.GroupQuotaSubscriptionRequestsClient; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaSubscriptionRequestStatusInner; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionRequestStatus; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionRequests; - -public final class GroupQuotaSubscriptionRequestsImpl implements GroupQuotaSubscriptionRequests { - private static final ClientLogger LOGGER = new ClientLogger(GroupQuotaSubscriptionRequestsImpl.class); - - private final GroupQuotaSubscriptionRequestsClient innerClient; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - public GroupQuotaSubscriptionRequestsImpl(GroupQuotaSubscriptionRequestsClient innerClient, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String managementGroupId, - String groupQuotaName, String requestId, Context context) { - Response inner - = this.serviceClient().getWithResponse(managementGroupId, groupQuotaName, requestId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GroupQuotaSubscriptionRequestStatusImpl(inner.getValue(), this.manager())); - } - - public GroupQuotaSubscriptionRequestStatus get(String managementGroupId, String groupQuotaName, String requestId) { - GroupQuotaSubscriptionRequestStatusInner inner - = this.serviceClient().get(managementGroupId, groupQuotaName, requestId); - if (inner != null) { - return new GroupQuotaSubscriptionRequestStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String managementGroupId, String groupQuotaName) { - PagedIterable inner - = this.serviceClient().list(managementGroupId, groupQuotaName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new GroupQuotaSubscriptionRequestStatusImpl(inner1, this.manager())); - } - - public PagedIterable list(String managementGroupId, String groupQuotaName, - Context context) { - PagedIterable inner - = this.serviceClient().list(managementGroupId, groupQuotaName, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new GroupQuotaSubscriptionRequestStatusImpl(inner1, this.manager())); - } - - private GroupQuotaSubscriptionRequestsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionsClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionsClientImpl.java deleted file mode 100644 index b3f195ecb41c..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionsClientImpl.java +++ /dev/null @@ -1,947 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -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.Patch; -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.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.quota.fluent.GroupQuotaSubscriptionsClient; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaSubscriptionIdInner; -import com.azure.resourcemanager.quota.implementation.models.GroupQuotaSubscriptionIdList; -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 GroupQuotaSubscriptionsClient. - */ -public final class GroupQuotaSubscriptionsClientImpl implements GroupQuotaSubscriptionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final GroupQuotaSubscriptionsService service; - - /** - * The service client containing this operation class. - */ - private final QuotaManagementClientImpl client; - - /** - * Initializes an instance of GroupQuotaSubscriptionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GroupQuotaSubscriptionsClientImpl(QuotaManagementClientImpl client) { - this.service = RestProxy.create(GroupQuotaSubscriptionsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for QuotaManagementClientGroupQuotaSubscriptions to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "QuotaManagementClientGroupQuotaSubscriptions") - public interface GroupQuotaSubscriptionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/subscriptions/{subscriptionId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/subscriptions/{subscriptionId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/subscriptions/{subscriptionId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/subscriptions/{subscriptionId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/subscriptions/{subscriptionId}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/subscriptions/{subscriptionId}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/subscriptions/{subscriptionId}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/subscriptions/{subscriptionId}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/subscriptions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/subscriptions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Returns the subscriptionIds along with its provisioning state for being associated with the GroupQuota. If the - * subscription is not a member of GroupQuota, it will return 404, else 200. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String managementGroupId, - String groupQuotaName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, groupQuotaName, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns the subscriptionIds along with its provisioning state for being associated with the GroupQuota. If the - * subscription is not a member of GroupQuota, it will return 404, else 200. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String managementGroupId, String groupQuotaName) { - return getWithResponseAsync(managementGroupId, groupQuotaName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns the subscriptionIds along with its provisioning state for being associated with the GroupQuota. If the - * subscription is not a member of GroupQuota, it will return 404, else 200. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String managementGroupId, String groupQuotaName, - Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, this.client.getSubscriptionId(), accept, context); - } - - /** - * Returns the subscriptionIds along with its provisioning state for being associated with the GroupQuota. If the - * subscription is not a member of GroupQuota, it will return 404, else 200. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotaSubscriptionIdInner get(String managementGroupId, String groupQuotaName) { - return getWithResponse(managementGroupId, groupQuotaName, Context.NONE).getValue(); - } - - /** - * Adds a subscription to GroupQuotas. The subscriptions will be validated based on the additionalAttributes defined - * in the GroupQuota. The additionalAttributes works as filter for the subscriptions, which can be included in the - * GroupQuotas. The request's TenantId is validated against the subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String managementGroupId, - String groupQuotaName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, groupQuotaName, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Adds a subscription to GroupQuotas. The subscriptions will be validated based on the additionalAttributes defined - * in the GroupQuota. The additionalAttributes works as filter for the subscriptions, which can be included in the - * GroupQuotas. The request's TenantId is validated against the subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String managementGroupId, String groupQuotaName) { - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, this.client.getSubscriptionId(), accept, Context.NONE); - } - - /** - * Adds a subscription to GroupQuotas. The subscriptions will be validated based on the additionalAttributes defined - * in the GroupQuota. The additionalAttributes works as filter for the subscriptions, which can be included in the - * GroupQuotas. The request's TenantId is validated against the subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String managementGroupId, String groupQuotaName, - Context context) { - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, this.client.getSubscriptionId(), accept, context); - } - - /** - * Adds a subscription to GroupQuotas. The subscriptions will be validated based on the additionalAttributes defined - * in the GroupQuota. The additionalAttributes works as filter for the subscriptions, which can be included in the - * GroupQuotas. The request's TenantId is validated against the subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 this represents a Azure subscriptionId that is associated with a - * GroupQuotasEntity. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GroupQuotaSubscriptionIdInner> - beginCreateOrUpdateAsync(String managementGroupId, String groupQuotaName) { - Mono>> mono = createOrUpdateWithResponseAsync(managementGroupId, groupQuotaName); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), GroupQuotaSubscriptionIdInner.class, GroupQuotaSubscriptionIdInner.class, - this.client.getContext()); - } - - /** - * Adds a subscription to GroupQuotas. The subscriptions will be validated based on the additionalAttributes defined - * in the GroupQuota. The additionalAttributes works as filter for the subscriptions, which can be included in the - * GroupQuotas. The request's TenantId is validated against the subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 this represents a Azure subscriptionId that is associated with a - * GroupQuotasEntity. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupQuotaSubscriptionIdInner> - beginCreateOrUpdate(String managementGroupId, String groupQuotaName) { - Response response = createOrUpdateWithResponse(managementGroupId, groupQuotaName); - return this.client.getLroResult(response, - GroupQuotaSubscriptionIdInner.class, GroupQuotaSubscriptionIdInner.class, Context.NONE); - } - - /** - * Adds a subscription to GroupQuotas. The subscriptions will be validated based on the additionalAttributes defined - * in the GroupQuota. The additionalAttributes works as filter for the subscriptions, which can be included in the - * GroupQuotas. The request's TenantId is validated against the subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 this represents a Azure subscriptionId that is associated with a - * GroupQuotasEntity. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupQuotaSubscriptionIdInner> - beginCreateOrUpdate(String managementGroupId, String groupQuotaName, Context context) { - Response response = createOrUpdateWithResponse(managementGroupId, groupQuotaName, context); - return this.client.getLroResult(response, - GroupQuotaSubscriptionIdInner.class, GroupQuotaSubscriptionIdInner.class, context); - } - - /** - * Adds a subscription to GroupQuotas. The subscriptions will be validated based on the additionalAttributes defined - * in the GroupQuota. The additionalAttributes works as filter for the subscriptions, which can be included in the - * GroupQuotas. The request's TenantId is validated against the subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String managementGroupId, String groupQuotaName) { - return beginCreateOrUpdateAsync(managementGroupId, groupQuotaName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Adds a subscription to GroupQuotas. The subscriptions will be validated based on the additionalAttributes defined - * in the GroupQuota. The additionalAttributes works as filter for the subscriptions, which can be included in the - * GroupQuotas. The request's TenantId is validated against the subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotaSubscriptionIdInner createOrUpdate(String managementGroupId, String groupQuotaName) { - return beginCreateOrUpdate(managementGroupId, groupQuotaName).getFinalResult(); - } - - /** - * Adds a subscription to GroupQuotas. The subscriptions will be validated based on the additionalAttributes defined - * in the GroupQuota. The additionalAttributes works as filter for the subscriptions, which can be included in the - * GroupQuotas. The request's TenantId is validated against the subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotaSubscriptionIdInner createOrUpdate(String managementGroupId, String groupQuotaName, - Context context) { - return beginCreateOrUpdate(managementGroupId, groupQuotaName, context).getFinalResult(); - } - - /** - * Updates the GroupQuotas with the subscription to add to the subscriptions list. The subscriptions will be - * validated if additionalAttributes are defined in the GroupQuota. The request's TenantId is validated against the - * subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String managementGroupId, String groupQuotaName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, groupQuotaName, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the GroupQuotas with the subscription to add to the subscriptions list. The subscriptions will be - * validated if additionalAttributes are defined in the GroupQuota. The request's TenantId is validated against the - * subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String managementGroupId, String groupQuotaName) { - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, this.client.getSubscriptionId(), accept, Context.NONE); - } - - /** - * Updates the GroupQuotas with the subscription to add to the subscriptions list. The subscriptions will be - * validated if additionalAttributes are defined in the GroupQuota. The request's TenantId is validated against the - * subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String managementGroupId, String groupQuotaName, Context context) { - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, this.client.getSubscriptionId(), accept, context); - } - - /** - * Updates the GroupQuotas with the subscription to add to the subscriptions list. The subscriptions will be - * validated if additionalAttributes are defined in the GroupQuota. The request's TenantId is validated against the - * subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 this represents a Azure subscriptionId that is associated with a - * GroupQuotasEntity. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GroupQuotaSubscriptionIdInner> - beginUpdateAsync(String managementGroupId, String groupQuotaName) { - Mono>> mono = updateWithResponseAsync(managementGroupId, groupQuotaName); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), GroupQuotaSubscriptionIdInner.class, GroupQuotaSubscriptionIdInner.class, - this.client.getContext()); - } - - /** - * Updates the GroupQuotas with the subscription to add to the subscriptions list. The subscriptions will be - * validated if additionalAttributes are defined in the GroupQuota. The request's TenantId is validated against the - * subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 this represents a Azure subscriptionId that is associated with a - * GroupQuotasEntity. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupQuotaSubscriptionIdInner> - beginUpdate(String managementGroupId, String groupQuotaName) { - Response response = updateWithResponse(managementGroupId, groupQuotaName); - return this.client.getLroResult(response, - GroupQuotaSubscriptionIdInner.class, GroupQuotaSubscriptionIdInner.class, Context.NONE); - } - - /** - * Updates the GroupQuotas with the subscription to add to the subscriptions list. The subscriptions will be - * validated if additionalAttributes are defined in the GroupQuota. The request's TenantId is validated against the - * subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 this represents a Azure subscriptionId that is associated with a - * GroupQuotasEntity. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupQuotaSubscriptionIdInner> - beginUpdate(String managementGroupId, String groupQuotaName, Context context) { - Response response = updateWithResponse(managementGroupId, groupQuotaName, context); - return this.client.getLroResult(response, - GroupQuotaSubscriptionIdInner.class, GroupQuotaSubscriptionIdInner.class, context); - } - - /** - * Updates the GroupQuotas with the subscription to add to the subscriptions list. The subscriptions will be - * validated if additionalAttributes are defined in the GroupQuota. The request's TenantId is validated against the - * subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String managementGroupId, String groupQuotaName) { - return beginUpdateAsync(managementGroupId, groupQuotaName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the GroupQuotas with the subscription to add to the subscriptions list. The subscriptions will be - * validated if additionalAttributes are defined in the GroupQuota. The request's TenantId is validated against the - * subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotaSubscriptionIdInner update(String managementGroupId, String groupQuotaName) { - return beginUpdate(managementGroupId, groupQuotaName).getFinalResult(); - } - - /** - * Updates the GroupQuotas with the subscription to add to the subscriptions list. The subscriptions will be - * validated if additionalAttributes are defined in the GroupQuota. The request's TenantId is validated against the - * subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotaSubscriptionIdInner update(String managementGroupId, String groupQuotaName, Context context) { - return beginUpdate(managementGroupId, groupQuotaName, context).getFinalResult(); - } - - /** - * Removes the subscription from GroupQuotas. The request's TenantId is validated against the subscription's - * TenantId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 managementGroupId, String groupQuotaName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, groupQuotaName, this.client.getSubscriptionId(), context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Removes the subscription from GroupQuotas. The request's TenantId is validated against the subscription's - * TenantId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 managementGroupId, String groupQuotaName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, this.client.getSubscriptionId(), Context.NONE); - } - - /** - * Removes the subscription from GroupQuotas. The request's TenantId is validated against the subscription's - * TenantId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 managementGroupId, String groupQuotaName, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, this.client.getSubscriptionId(), context); - } - - /** - * Removes the subscription from GroupQuotas. The request's TenantId is validated against the subscription's - * TenantId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 managementGroupId, String groupQuotaName) { - Mono>> mono = deleteWithResponseAsync(managementGroupId, groupQuotaName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Removes the subscription from GroupQuotas. The request's TenantId is validated against the subscription's - * TenantId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 managementGroupId, String groupQuotaName) { - Response response = deleteWithResponse(managementGroupId, groupQuotaName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Removes the subscription from GroupQuotas. The request's TenantId is validated against the subscription's - * TenantId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 managementGroupId, String groupQuotaName, - Context context) { - Response response = deleteWithResponse(managementGroupId, groupQuotaName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Removes the subscription from GroupQuotas. The request's TenantId is validated against the subscription's - * TenantId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 managementGroupId, String groupQuotaName) { - return beginDeleteAsync(managementGroupId, groupQuotaName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Removes the subscription from GroupQuotas. The request's TenantId is validated against the subscription's - * TenantId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 managementGroupId, String groupQuotaName) { - beginDelete(managementGroupId, groupQuotaName).getFinalResult(); - } - - /** - * Removes the subscription from GroupQuotas. The request's TenantId is validated against the subscription's - * TenantId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 managementGroupId, String groupQuotaName, Context context) { - beginDelete(managementGroupId, groupQuotaName, context).getFinalResult(); - } - - /** - * Returns a list of the subscriptionIds associated with the GroupQuotas. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionIds along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String managementGroupId, - String groupQuotaName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, groupQuotaName, 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 a list of the subscriptionIds associated with the GroupQuotas. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionIds as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String managementGroupId, String groupQuotaName) { - return new PagedFlux<>(() -> listSinglePageAsync(managementGroupId, groupQuotaName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of the subscriptionIds associated with the GroupQuotas. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionIds along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String managementGroupId, - String groupQuotaName) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getApiVersion(), managementGroupId, groupQuotaName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Returns a list of the subscriptionIds associated with the GroupQuotas. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionIds along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String managementGroupId, String groupQuotaName, - Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getApiVersion(), managementGroupId, groupQuotaName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Returns a list of the subscriptionIds associated with the GroupQuotas. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionIds as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId, String groupQuotaName) { - return new PagedIterable<>(() -> listSinglePage(managementGroupId, groupQuotaName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Returns a list of the subscriptionIds associated with the GroupQuotas. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionIds as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId, String groupQuotaName, - Context context) { - return new PagedIterable<>(() -> listSinglePage(managementGroupId, groupQuotaName, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionIds along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionIds along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionIds along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionsImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionsImpl.java deleted file mode 100644 index bc58734867b7..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaSubscriptionsImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.quota.fluent.GroupQuotaSubscriptionsClient; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaSubscriptionIdInner; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptionId; -import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptions; - -public final class GroupQuotaSubscriptionsImpl implements GroupQuotaSubscriptions { - private static final ClientLogger LOGGER = new ClientLogger(GroupQuotaSubscriptionsImpl.class); - - private final GroupQuotaSubscriptionsClient innerClient; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - public GroupQuotaSubscriptionsImpl(GroupQuotaSubscriptionsClient innerClient, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String managementGroupId, String groupQuotaName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(managementGroupId, groupQuotaName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GroupQuotaSubscriptionIdImpl(inner.getValue(), this.manager())); - } - - public GroupQuotaSubscriptionId get(String managementGroupId, String groupQuotaName) { - GroupQuotaSubscriptionIdInner inner = this.serviceClient().get(managementGroupId, groupQuotaName); - if (inner != null) { - return new GroupQuotaSubscriptionIdImpl(inner, this.manager()); - } else { - return null; - } - } - - public GroupQuotaSubscriptionId createOrUpdate(String managementGroupId, String groupQuotaName) { - GroupQuotaSubscriptionIdInner inner = this.serviceClient().createOrUpdate(managementGroupId, groupQuotaName); - if (inner != null) { - return new GroupQuotaSubscriptionIdImpl(inner, this.manager()); - } else { - return null; - } - } - - public GroupQuotaSubscriptionId createOrUpdate(String managementGroupId, String groupQuotaName, Context context) { - GroupQuotaSubscriptionIdInner inner - = this.serviceClient().createOrUpdate(managementGroupId, groupQuotaName, context); - if (inner != null) { - return new GroupQuotaSubscriptionIdImpl(inner, this.manager()); - } else { - return null; - } - } - - public GroupQuotaSubscriptionId update(String managementGroupId, String groupQuotaName) { - GroupQuotaSubscriptionIdInner inner = this.serviceClient().update(managementGroupId, groupQuotaName); - if (inner != null) { - return new GroupQuotaSubscriptionIdImpl(inner, this.manager()); - } else { - return null; - } - } - - public GroupQuotaSubscriptionId update(String managementGroupId, String groupQuotaName, Context context) { - GroupQuotaSubscriptionIdInner inner = this.serviceClient().update(managementGroupId, groupQuotaName, context); - if (inner != null) { - return new GroupQuotaSubscriptionIdImpl(inner, this.manager()); - } else { - return null; - } - } - - public void deleteByResourceGroup(String managementGroupId, String groupQuotaName) { - this.serviceClient().delete(managementGroupId, groupQuotaName); - } - - public void delete(String managementGroupId, String groupQuotaName, Context context) { - this.serviceClient().delete(managementGroupId, groupQuotaName, context); - } - - public PagedIterable list(String managementGroupId, String groupQuotaName) { - PagedIterable inner - = this.serviceClient().list(managementGroupId, groupQuotaName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GroupQuotaSubscriptionIdImpl(inner1, this.manager())); - } - - public PagedIterable list(String managementGroupId, String groupQuotaName, - Context context) { - PagedIterable inner - = this.serviceClient().list(managementGroupId, groupQuotaName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GroupQuotaSubscriptionIdImpl(inner1, this.manager())); - } - - private GroupQuotaSubscriptionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaUsagesClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaUsagesClientImpl.java deleted file mode 100644 index 4b9fa774d4b9..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaUsagesClientImpl.java +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.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.quota.fluent.GroupQuotaUsagesClient; -import com.azure.resourcemanager.quota.fluent.models.ResourceUsagesInner; -import com.azure.resourcemanager.quota.implementation.models.ResourceUsageList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in GroupQuotaUsagesClient. - */ -public final class GroupQuotaUsagesClientImpl implements GroupQuotaUsagesClient { - /** - * The proxy service used to perform REST calls. - */ - private final GroupQuotaUsagesService service; - - /** - * The service client containing this operation class. - */ - private final QuotaManagementClientImpl client; - - /** - * Initializes an instance of GroupQuotaUsagesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GroupQuotaUsagesClientImpl(QuotaManagementClientImpl client) { - this.service - = RestProxy.create(GroupQuotaUsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for QuotaManagementClientGroupQuotaUsages to be used by the proxy service - * to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "QuotaManagementClientGroupQuotaUsages") - public interface GroupQuotaUsagesService { - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/locationUsages/{location}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/locationUsages/{location}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, - @PathParam("resourceProviderName") String resourceProviderName, @PathParam("location") String location, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas usages and limits(quota) along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String managementGroupId, - String groupQuotaName, String resourceProviderName, String location) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, groupQuotaName, resourceProviderName, location, 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 GroupQuotas usages and limits(quota). Location is required paramter. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas usages and limits(quota) as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - return new PagedFlux<>( - () -> listSinglePageAsync(managementGroupId, groupQuotaName, resourceProviderName, location), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas usages and limits(quota) along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, groupQuotaName, resourceProviderName, location, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas usages and limits(quota) along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, groupQuotaName, resourceProviderName, location, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas usages and limits(quota) as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - return new PagedIterable<>( - () -> listSinglePage(managementGroupId, groupQuotaName, resourceProviderName, location), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas usages and limits(quota) as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context) { - return new PagedIterable<>( - () -> listSinglePage(managementGroupId, groupQuotaName, resourceProviderName, location, 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 the GroupQuotas usages and limits(quota) along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas usages and limits(quota) along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas usages and limits(quota) along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaUsagesImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaUsagesImpl.java deleted file mode 100644 index b55be9bf2587..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotaUsagesImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.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.quota.fluent.GroupQuotaUsagesClient; -import com.azure.resourcemanager.quota.fluent.models.ResourceUsagesInner; -import com.azure.resourcemanager.quota.models.GroupQuotaUsages; -import com.azure.resourcemanager.quota.models.ResourceUsages; - -public final class GroupQuotaUsagesImpl implements GroupQuotaUsages { - private static final ClientLogger LOGGER = new ClientLogger(GroupQuotaUsagesImpl.class); - - private final GroupQuotaUsagesClient innerClient; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - public GroupQuotaUsagesImpl(GroupQuotaUsagesClient innerClient, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location) { - PagedIterable inner - = this.serviceClient().list(managementGroupId, groupQuotaName, resourceProviderName, location); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceUsagesImpl(inner1, this.manager())); - } - - public PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context) { - PagedIterable inner - = this.serviceClient().list(managementGroupId, groupQuotaName, resourceProviderName, location, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ResourceUsagesImpl(inner1, this.manager())); - } - - private GroupQuotaUsagesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasClientImpl.java deleted file mode 100644 index 2965be20fe34..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasClientImpl.java +++ /dev/null @@ -1,1169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -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.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.quota.fluent.GroupQuotasClient; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEntityInner; -import com.azure.resourcemanager.quota.implementation.models.GroupQuotaList; -import com.azure.resourcemanager.quota.models.GroupQuotasEntityPatch; -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 GroupQuotasClient. - */ -public final class GroupQuotasClientImpl implements GroupQuotasClient { - /** - * The proxy service used to perform REST calls. - */ - private final GroupQuotasService service; - - /** - * The service client containing this operation class. - */ - private final QuotaManagementClientImpl client; - - /** - * Initializes an instance of GroupQuotasClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GroupQuotasClientImpl(QuotaManagementClientImpl client) { - this.service - = RestProxy.create(GroupQuotasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for QuotaManagementClientGroupQuotas to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "QuotaManagementClientGroupQuotas") - public interface GroupQuotasService { - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @HeaderParam("Accept") String accept, - @BodyParam("application/json") GroupQuotasEntityInner groupQuotaPutRequestBody, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @HeaderParam("Accept") String accept, - @BodyParam("application/json") GroupQuotasEntityInner groupQuotaPutRequestBody, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @HeaderParam("Accept") String accept, - @BodyParam("application/json") GroupQuotasEntityPatch groupQuotasPatchRequestBody, Context context); - - @Headers({ "Content-Type: application/json" }) - @Patch("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, @HeaderParam("Accept") String accept, - @BodyParam("application/json") GroupQuotasEntityPatch groupQuotasPatchRequestBody, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @PathParam("groupQuotaName") String groupQuotaName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("managementGroupId") String managementGroupId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the GroupQuotas for the name passed. It will return the GroupQuotas properties only. The details on group - * quota can be access from the group quota APIs. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas for the name passed along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String managementGroupId, - String groupQuotaName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, groupQuotaName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the GroupQuotas for the name passed. It will return the GroupQuotas properties only. The details on group - * quota can be access from the group quota APIs. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas for the name passed on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String managementGroupId, String groupQuotaName) { - return getWithResponseAsync(managementGroupId, groupQuotaName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the GroupQuotas for the name passed. It will return the GroupQuotas properties only. The details on group - * quota can be access from the group quota APIs. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas for the name passed along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String managementGroupId, String groupQuotaName, - Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, accept, context); - } - - /** - * Gets the GroupQuotas for the name passed. It will return the GroupQuotas properties only. The details on group - * quota can be access from the group quota APIs. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas for the name passed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotasEntityInner get(String managementGroupId, String groupQuotaName) { - return getWithResponse(managementGroupId, groupQuotaName, Context.NONE).getValue(); - } - - /** - * Creates a new GroupQuota for the name passed. A RequestId will be returned by the Service. The status can be - * polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotaPutRequestBody The GroupQuota body details for creation or update of a GroupQuota entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties and filters for ShareQuota along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String managementGroupId, - String groupQuotaName, GroupQuotasEntityInner groupQuotaPutRequestBody) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, groupQuotaName, accept, groupQuotaPutRequestBody, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new GroupQuota for the name passed. A RequestId will be returned by the Service. The status can be - * polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotaPutRequestBody The GroupQuota body details for creation or update of a GroupQuota entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties and filters for ShareQuota along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String managementGroupId, String groupQuotaName, - GroupQuotasEntityInner groupQuotaPutRequestBody) { - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, accept, groupQuotaPutRequestBody, Context.NONE); - } - - /** - * Creates a new GroupQuota for the name passed. A RequestId will be returned by the Service. The status can be - * polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotaPutRequestBody The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties and filters for ShareQuota along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String managementGroupId, String groupQuotaName, - GroupQuotasEntityInner groupQuotaPutRequestBody, Context context) { - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, accept, groupQuotaPutRequestBody, context); - } - - /** - * Creates a new GroupQuota for the name passed. A RequestId will be returned by the Service. The status can be - * polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotaPutRequestBody The GroupQuota body details for creation or update of a GroupQuota entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GroupQuotasEntityInner> beginCreateOrUpdateAsync( - String managementGroupId, String groupQuotaName, GroupQuotasEntityInner groupQuotaPutRequestBody) { - Mono>> mono - = createOrUpdateWithResponseAsync(managementGroupId, groupQuotaName, groupQuotaPutRequestBody); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), GroupQuotasEntityInner.class, GroupQuotasEntityInner.class, - this.client.getContext()); - } - - /** - * Creates a new GroupQuota for the name passed. A RequestId will be returned by the Service. The status can be - * polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GroupQuotasEntityInner> - beginCreateOrUpdateAsync(String managementGroupId, String groupQuotaName) { - final GroupQuotasEntityInner groupQuotaPutRequestBody = null; - Mono>> mono - = createOrUpdateWithResponseAsync(managementGroupId, groupQuotaName, groupQuotaPutRequestBody); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), GroupQuotasEntityInner.class, GroupQuotasEntityInner.class, - this.client.getContext()); - } - - /** - * Creates a new GroupQuota for the name passed. A RequestId will be returned by the Service. The status can be - * polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotaPutRequestBody The GroupQuota body details for creation or update of a GroupQuota entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupQuotasEntityInner> beginCreateOrUpdate( - String managementGroupId, String groupQuotaName, GroupQuotasEntityInner groupQuotaPutRequestBody) { - Response response - = createOrUpdateWithResponse(managementGroupId, groupQuotaName, groupQuotaPutRequestBody); - return this.client.getLroResult(response, - GroupQuotasEntityInner.class, GroupQuotasEntityInner.class, Context.NONE); - } - - /** - * Creates a new GroupQuota for the name passed. A RequestId will be returned by the Service. The status can be - * polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupQuotasEntityInner> - beginCreateOrUpdate(String managementGroupId, String groupQuotaName) { - final GroupQuotasEntityInner groupQuotaPutRequestBody = null; - Response response - = createOrUpdateWithResponse(managementGroupId, groupQuotaName, groupQuotaPutRequestBody); - return this.client.getLroResult(response, - GroupQuotasEntityInner.class, GroupQuotasEntityInner.class, Context.NONE); - } - - /** - * Creates a new GroupQuota for the name passed. A RequestId will be returned by the Service. The status can be - * polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotaPutRequestBody The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupQuotasEntityInner> beginCreateOrUpdate( - String managementGroupId, String groupQuotaName, GroupQuotasEntityInner groupQuotaPutRequestBody, - Context context) { - Response response - = createOrUpdateWithResponse(managementGroupId, groupQuotaName, groupQuotaPutRequestBody, context); - return this.client.getLroResult(response, - GroupQuotasEntityInner.class, GroupQuotasEntityInner.class, context); - } - - /** - * Creates a new GroupQuota for the name passed. A RequestId will be returned by the Service. The status can be - * polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotaPutRequestBody The GroupQuota body details for creation or update of a GroupQuota entity. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties and filters for ShareQuota on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String managementGroupId, String groupQuotaName, - GroupQuotasEntityInner groupQuotaPutRequestBody) { - return beginCreateOrUpdateAsync(managementGroupId, groupQuotaName, groupQuotaPutRequestBody).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a new GroupQuota for the name passed. A RequestId will be returned by the Service. The status can be - * polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties and filters for ShareQuota on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String managementGroupId, String groupQuotaName) { - final GroupQuotasEntityInner groupQuotaPutRequestBody = null; - return beginCreateOrUpdateAsync(managementGroupId, groupQuotaName, groupQuotaPutRequestBody).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a new GroupQuota for the name passed. A RequestId will be returned by the Service. The status can be - * polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotasEntityInner createOrUpdate(String managementGroupId, String groupQuotaName) { - final GroupQuotasEntityInner groupQuotaPutRequestBody = null; - return beginCreateOrUpdate(managementGroupId, groupQuotaName, groupQuotaPutRequestBody).getFinalResult(); - } - - /** - * Creates a new GroupQuota for the name passed. A RequestId will be returned by the Service. The status can be - * polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotaPutRequestBody The GroupQuota body details for creation or update of a GroupQuota entity. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotasEntityInner createOrUpdate(String managementGroupId, String groupQuotaName, - GroupQuotasEntityInner groupQuotaPutRequestBody, Context context) { - return beginCreateOrUpdate(managementGroupId, groupQuotaName, groupQuotaPutRequestBody, context) - .getFinalResult(); - } - - /** - * Updates the GroupQuotas for the name passed. A GroupQuotas RequestId will be returned by the Service. The status - * can be polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * Any change in the filters will be applicable to the future quota assignments, existing quota allocated to - * subscriptions from the GroupQuotas remains unchanged. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotasPatchRequestBody The GroupQuotas Patch Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties and filters for ShareQuota along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String managementGroupId, String groupQuotaName, - GroupQuotasEntityPatch groupQuotasPatchRequestBody) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, groupQuotaName, accept, groupQuotasPatchRequestBody, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates the GroupQuotas for the name passed. A GroupQuotas RequestId will be returned by the Service. The status - * can be polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * Any change in the filters will be applicable to the future quota assignments, existing quota allocated to - * subscriptions from the GroupQuotas remains unchanged. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotasPatchRequestBody The GroupQuotas Patch Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties and filters for ShareQuota along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String managementGroupId, String groupQuotaName, - GroupQuotasEntityPatch groupQuotasPatchRequestBody) { - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, accept, groupQuotasPatchRequestBody, Context.NONE); - } - - /** - * Updates the GroupQuotas for the name passed. A GroupQuotas RequestId will be returned by the Service. The status - * can be polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * Any change in the filters will be applicable to the future quota assignments, existing quota allocated to - * subscriptions from the GroupQuotas remains unchanged. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotasPatchRequestBody The GroupQuotas Patch Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties and filters for ShareQuota along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String managementGroupId, String groupQuotaName, - GroupQuotasEntityPatch groupQuotasPatchRequestBody, Context context) { - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, accept, groupQuotasPatchRequestBody, context); - } - - /** - * Updates the GroupQuotas for the name passed. A GroupQuotas RequestId will be returned by the Service. The status - * can be polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * Any change in the filters will be applicable to the future quota assignments, existing quota allocated to - * subscriptions from the GroupQuotas remains unchanged. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotasPatchRequestBody The GroupQuotas Patch Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GroupQuotasEntityInner> beginUpdateAsync( - String managementGroupId, String groupQuotaName, GroupQuotasEntityPatch groupQuotasPatchRequestBody) { - Mono>> mono - = updateWithResponseAsync(managementGroupId, groupQuotaName, groupQuotasPatchRequestBody); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), GroupQuotasEntityInner.class, GroupQuotasEntityInner.class, - this.client.getContext()); - } - - /** - * Updates the GroupQuotas for the name passed. A GroupQuotas RequestId will be returned by the Service. The status - * can be polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * Any change in the filters will be applicable to the future quota assignments, existing quota allocated to - * subscriptions from the GroupQuotas remains unchanged. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GroupQuotasEntityInner> - beginUpdateAsync(String managementGroupId, String groupQuotaName) { - final GroupQuotasEntityPatch groupQuotasPatchRequestBody = null; - Mono>> mono - = updateWithResponseAsync(managementGroupId, groupQuotaName, groupQuotasPatchRequestBody); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), GroupQuotasEntityInner.class, GroupQuotasEntityInner.class, - this.client.getContext()); - } - - /** - * Updates the GroupQuotas for the name passed. A GroupQuotas RequestId will be returned by the Service. The status - * can be polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * Any change in the filters will be applicable to the future quota assignments, existing quota allocated to - * subscriptions from the GroupQuotas remains unchanged. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotasPatchRequestBody The GroupQuotas Patch Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupQuotasEntityInner> beginUpdate(String managementGroupId, - String groupQuotaName, GroupQuotasEntityPatch groupQuotasPatchRequestBody) { - Response response - = updateWithResponse(managementGroupId, groupQuotaName, groupQuotasPatchRequestBody); - return this.client.getLroResult(response, - GroupQuotasEntityInner.class, GroupQuotasEntityInner.class, Context.NONE); - } - - /** - * Updates the GroupQuotas for the name passed. A GroupQuotas RequestId will be returned by the Service. The status - * can be polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * Any change in the filters will be applicable to the future quota assignments, existing quota allocated to - * subscriptions from the GroupQuotas remains unchanged. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupQuotasEntityInner> beginUpdate(String managementGroupId, - String groupQuotaName) { - final GroupQuotasEntityPatch groupQuotasPatchRequestBody = null; - Response response - = updateWithResponse(managementGroupId, groupQuotaName, groupQuotasPatchRequestBody); - return this.client.getLroResult(response, - GroupQuotasEntityInner.class, GroupQuotasEntityInner.class, Context.NONE); - } - - /** - * Updates the GroupQuotas for the name passed. A GroupQuotas RequestId will be returned by the Service. The status - * can be polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * Any change in the filters will be applicable to the future quota assignments, existing quota allocated to - * subscriptions from the GroupQuotas remains unchanged. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotasPatchRequestBody The GroupQuotas Patch Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GroupQuotasEntityInner> beginUpdate(String managementGroupId, - String groupQuotaName, GroupQuotasEntityPatch groupQuotasPatchRequestBody, Context context) { - Response response - = updateWithResponse(managementGroupId, groupQuotaName, groupQuotasPatchRequestBody, context); - return this.client.getLroResult(response, - GroupQuotasEntityInner.class, GroupQuotasEntityInner.class, context); - } - - /** - * Updates the GroupQuotas for the name passed. A GroupQuotas RequestId will be returned by the Service. The status - * can be polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * Any change in the filters will be applicable to the future quota assignments, existing quota allocated to - * subscriptions from the GroupQuotas remains unchanged. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotasPatchRequestBody The GroupQuotas Patch Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties and filters for ShareQuota on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String managementGroupId, String groupQuotaName, - GroupQuotasEntityPatch groupQuotasPatchRequestBody) { - return beginUpdateAsync(managementGroupId, groupQuotaName, groupQuotasPatchRequestBody).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the GroupQuotas for the name passed. A GroupQuotas RequestId will be returned by the Service. The status - * can be polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * Any change in the filters will be applicable to the future quota assignments, existing quota allocated to - * subscriptions from the GroupQuotas remains unchanged. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties and filters for ShareQuota on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String managementGroupId, String groupQuotaName) { - final GroupQuotasEntityPatch groupQuotasPatchRequestBody = null; - return beginUpdateAsync(managementGroupId, groupQuotaName, groupQuotasPatchRequestBody).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates the GroupQuotas for the name passed. A GroupQuotas RequestId will be returned by the Service. The status - * can be polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * Any change in the filters will be applicable to the future quota assignments, existing quota allocated to - * subscriptions from the GroupQuotas remains unchanged. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotasEntityInner update(String managementGroupId, String groupQuotaName) { - final GroupQuotasEntityPatch groupQuotasPatchRequestBody = null; - return beginUpdate(managementGroupId, groupQuotaName, groupQuotasPatchRequestBody).getFinalResult(); - } - - /** - * Updates the GroupQuotas for the name passed. A GroupQuotas RequestId will be returned by the Service. The status - * can be polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * Any change in the filters will be applicable to the future quota assignments, existing quota allocated to - * subscriptions from the GroupQuotas remains unchanged. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotasPatchRequestBody The GroupQuotas Patch Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties and filters for ShareQuota. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GroupQuotasEntityInner update(String managementGroupId, String groupQuotaName, - GroupQuotasEntityPatch groupQuotasPatchRequestBody, Context context) { - return beginUpdate(managementGroupId, groupQuotaName, groupQuotasPatchRequestBody, context).getFinalResult(); - } - - /** - * Deletes the GroupQuotas for the name passed. All the remaining shareQuota in the GroupQuotas will be lost. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 managementGroupId, String groupQuotaName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, groupQuotaName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the GroupQuotas for the name passed. All the remaining shareQuota in the GroupQuotas will be lost. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 managementGroupId, String groupQuotaName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, Context.NONE); - } - - /** - * Deletes the GroupQuotas for the name passed. All the remaining shareQuota in the GroupQuotas will be lost. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 managementGroupId, String groupQuotaName, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), managementGroupId, - groupQuotaName, context); - } - - /** - * Deletes the GroupQuotas for the name passed. All the remaining shareQuota in the GroupQuotas will be lost. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 managementGroupId, String groupQuotaName) { - Mono>> mono = deleteWithResponseAsync(managementGroupId, groupQuotaName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes the GroupQuotas for the name passed. All the remaining shareQuota in the GroupQuotas will be lost. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 managementGroupId, String groupQuotaName) { - Response response = deleteWithResponse(managementGroupId, groupQuotaName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Deletes the GroupQuotas for the name passed. All the remaining shareQuota in the GroupQuotas will be lost. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 managementGroupId, String groupQuotaName, - Context context) { - Response response = deleteWithResponse(managementGroupId, groupQuotaName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Deletes the GroupQuotas for the name passed. All the remaining shareQuota in the GroupQuotas will be lost. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 managementGroupId, String groupQuotaName) { - return beginDeleteAsync(managementGroupId, groupQuotaName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the GroupQuotas for the name passed. All the remaining shareQuota in the GroupQuotas will be lost. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 managementGroupId, String groupQuotaName) { - beginDelete(managementGroupId, groupQuotaName).getFinalResult(); - } - - /** - * Deletes the GroupQuotas for the name passed. All the remaining shareQuota in the GroupQuotas will be lost. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 managementGroupId, String groupQuotaName, Context context) { - beginDelete(managementGroupId, groupQuotaName, context).getFinalResult(); - } - - /** - * Lists GroupQuotas for the scope passed. It will return the GroupQuotas QuotaEntity properties only.The details on - * group quota can be access from the group quota APIs. - * - * @param managementGroupId The management group 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 list of Group Quotas at MG level along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String managementGroupId) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, 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 GroupQuotas for the scope passed. It will return the GroupQuotas QuotaEntity properties only.The details on - * group quota can be access from the group quota APIs. - * - * @param managementGroupId The management group 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 list of Group Quotas at MG level as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String managementGroupId) { - return new PagedFlux<>(() -> listSinglePageAsync(managementGroupId), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists GroupQuotas for the scope passed. It will return the GroupQuotas QuotaEntity properties only.The details on - * group quota can be access from the group quota APIs. - * - * @param managementGroupId The management group 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 list of Group Quotas at MG level along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String managementGroupId) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists GroupQuotas for the scope passed. It will return the GroupQuotas QuotaEntity properties only.The details on - * group quota can be access from the group quota APIs. - * - * @param managementGroupId The management group 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 list of Group Quotas at MG level along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String managementGroupId, Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - managementGroupId, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists GroupQuotas for the scope passed. It will return the GroupQuotas QuotaEntity properties only.The details on - * group quota can be access from the group quota APIs. - * - * @param managementGroupId The management group 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 list of Group Quotas at MG level as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId) { - return new PagedIterable<>(() -> listSinglePage(managementGroupId), nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Lists GroupQuotas for the scope passed. It will return the GroupQuotas QuotaEntity properties only.The details on - * group quota can be access from the group quota APIs. - * - * @param managementGroupId The management group 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 list of Group Quotas at MG level as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String managementGroupId, Context context) { - return new PagedIterable<>(() -> listSinglePage(managementGroupId, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Group Quotas at MG level along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Group Quotas at MG level along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Group Quotas at MG level along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasEnforcementStatusImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasEnforcementStatusImpl.java deleted file mode 100644 index 1e8aee231239..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasEnforcementStatusImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEnforcementStatusInner; -import com.azure.resourcemanager.quota.models.GroupQuotasEnforcementStatus; -import com.azure.resourcemanager.quota.models.GroupQuotasEnforcementStatusProperties; - -public final class GroupQuotasEnforcementStatusImpl implements GroupQuotasEnforcementStatus { - private GroupQuotasEnforcementStatusInner innerObject; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - GroupQuotasEnforcementStatusImpl(GroupQuotasEnforcementStatusInner innerObject, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public GroupQuotasEnforcementStatusProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public GroupQuotasEnforcementStatusInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasEntityImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasEntityImpl.java deleted file mode 100644 index 09e0f8862dc8..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasEntityImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEntityInner; -import com.azure.resourcemanager.quota.models.GroupQuotasEntity; -import com.azure.resourcemanager.quota.models.GroupQuotasEntityProperties; - -public final class GroupQuotasEntityImpl implements GroupQuotasEntity { - private GroupQuotasEntityInner innerObject; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - GroupQuotasEntityImpl(GroupQuotasEntityInner innerObject, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public GroupQuotasEntityProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public GroupQuotasEntityInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasImpl.java deleted file mode 100644 index 0dd5497640fd..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/GroupQuotasImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.quota.fluent.GroupQuotasClient; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEntityInner; -import com.azure.resourcemanager.quota.models.GroupQuotas; -import com.azure.resourcemanager.quota.models.GroupQuotasEntity; -import com.azure.resourcemanager.quota.models.GroupQuotasEntityPatch; - -public final class GroupQuotasImpl implements GroupQuotas { - private static final ClientLogger LOGGER = new ClientLogger(GroupQuotasImpl.class); - - private final GroupQuotasClient innerClient; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - public GroupQuotasImpl(GroupQuotasClient innerClient, com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String managementGroupId, String groupQuotaName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(managementGroupId, groupQuotaName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GroupQuotasEntityImpl(inner.getValue(), this.manager())); - } - - public GroupQuotasEntity get(String managementGroupId, String groupQuotaName) { - GroupQuotasEntityInner inner = this.serviceClient().get(managementGroupId, groupQuotaName); - if (inner != null) { - return new GroupQuotasEntityImpl(inner, this.manager()); - } else { - return null; - } - } - - public GroupQuotasEntity createOrUpdate(String managementGroupId, String groupQuotaName) { - GroupQuotasEntityInner inner = this.serviceClient().createOrUpdate(managementGroupId, groupQuotaName); - if (inner != null) { - return new GroupQuotasEntityImpl(inner, this.manager()); - } else { - return null; - } - } - - public GroupQuotasEntity createOrUpdate(String managementGroupId, String groupQuotaName, - GroupQuotasEntityInner groupQuotaPutRequestBody, Context context) { - GroupQuotasEntityInner inner - = this.serviceClient().createOrUpdate(managementGroupId, groupQuotaName, groupQuotaPutRequestBody, context); - if (inner != null) { - return new GroupQuotasEntityImpl(inner, this.manager()); - } else { - return null; - } - } - - public GroupQuotasEntity update(String managementGroupId, String groupQuotaName) { - GroupQuotasEntityInner inner = this.serviceClient().update(managementGroupId, groupQuotaName); - if (inner != null) { - return new GroupQuotasEntityImpl(inner, this.manager()); - } else { - return null; - } - } - - public GroupQuotasEntity update(String managementGroupId, String groupQuotaName, - GroupQuotasEntityPatch groupQuotasPatchRequestBody, Context context) { - GroupQuotasEntityInner inner - = this.serviceClient().update(managementGroupId, groupQuotaName, groupQuotasPatchRequestBody, context); - if (inner != null) { - return new GroupQuotasEntityImpl(inner, this.manager()); - } else { - return null; - } - } - - public void deleteByResourceGroup(String managementGroupId, String groupQuotaName) { - this.serviceClient().delete(managementGroupId, groupQuotaName); - } - - public void delete(String managementGroupId, String groupQuotaName, Context context) { - this.serviceClient().delete(managementGroupId, groupQuotaName, context); - } - - public PagedIterable list(String managementGroupId) { - PagedIterable inner = this.serviceClient().list(managementGroupId); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GroupQuotasEntityImpl(inner1, this.manager())); - } - - public PagedIterable list(String managementGroupId, Context context) { - PagedIterable inner = this.serviceClient().list(managementGroupId, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GroupQuotasEntityImpl(inner1, this.manager())); - } - - private GroupQuotasClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/OperationResponseImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/OperationResponseImpl.java deleted file mode 100644 index 6ea4c804277d..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/OperationResponseImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.resourcemanager.quota.fluent.models.OperationResponseInner; -import com.azure.resourcemanager.quota.models.OperationDisplay; -import com.azure.resourcemanager.quota.models.OperationResponse; - -public final class OperationResponseImpl implements OperationResponse { - private OperationResponseInner innerObject; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - OperationResponseImpl(OperationResponseInner innerObject, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public OperationDisplay display() { - return this.innerModel().display(); - } - - public String origin() { - return this.innerModel().origin(); - } - - public OperationResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaAllocationRequestStatusImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaAllocationRequestStatusImpl.java deleted file mode 100644 index fe21e42366a2..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaAllocationRequestStatusImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.QuotaAllocationRequestStatusInner; -import com.azure.resourcemanager.quota.models.QuotaAllocationRequestBase; -import com.azure.resourcemanager.quota.models.QuotaAllocationRequestStatus; -import com.azure.resourcemanager.quota.models.RequestState; -import java.time.OffsetDateTime; - -public final class QuotaAllocationRequestStatusImpl implements QuotaAllocationRequestStatus { - private QuotaAllocationRequestStatusInner innerObject; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - QuotaAllocationRequestStatusImpl(QuotaAllocationRequestStatusInner innerObject, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public QuotaAllocationRequestBase requestedResource() { - return this.innerModel().requestedResource(); - } - - public OffsetDateTime requestSubmitTime() { - return this.innerModel().requestSubmitTime(); - } - - public RequestState provisioningState() { - return this.innerModel().provisioningState(); - } - - public String faultCode() { - return this.innerModel().faultCode(); - } - - public QuotaAllocationRequestStatusInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaManagementClientBuilder.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaManagementClientBuilder.java deleted file mode 100644 index dfeda6a74eea..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaManagementClientBuilder.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.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 QuotaManagementClientImpl type. - */ -@ServiceClientBuilder(serviceClients = { QuotaManagementClientImpl.class }) -public final class QuotaManagementClientBuilder { - /* - * Service host - */ - private String endpoint; - - /** - * Sets Service host. - * - * @param endpoint the endpoint value. - * @return the QuotaManagementClientBuilder. - */ - public QuotaManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The ID of the target subscription. The value must be an UUID. - */ - private String subscriptionId; - - /** - * Sets The ID of the target subscription. The value must be an UUID. - * - * @param subscriptionId the subscriptionId value. - * @return the QuotaManagementClientBuilder. - */ - public QuotaManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the QuotaManagementClientBuilder. - */ - public QuotaManagementClientBuilder 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 QuotaManagementClientBuilder. - */ - public QuotaManagementClientBuilder 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 QuotaManagementClientBuilder. - */ - public QuotaManagementClientBuilder 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 QuotaManagementClientBuilder. - */ - public QuotaManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of QuotaManagementClientImpl with the provided parameters. - * - * @return an instance of QuotaManagementClientImpl. - */ - public QuotaManagementClientImpl 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(); - QuotaManagementClientImpl client = new QuotaManagementClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); - return client; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaManagementClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaManagementClientImpl.java deleted file mode 100644 index cac82fc026e1..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaManagementClientImpl.java +++ /dev/null @@ -1,500 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.Response; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.exception.ManagementError; -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.quota.fluent.GroupQuotaLimitsClient; -import com.azure.resourcemanager.quota.fluent.GroupQuotaLimitsRequestsClient; -import com.azure.resourcemanager.quota.fluent.GroupQuotaLocationSettingsClient; -import com.azure.resourcemanager.quota.fluent.GroupQuotaSubscriptionAllocationRequestsClient; -import com.azure.resourcemanager.quota.fluent.GroupQuotaSubscriptionAllocationsClient; -import com.azure.resourcemanager.quota.fluent.GroupQuotaSubscriptionRequestsClient; -import com.azure.resourcemanager.quota.fluent.GroupQuotaSubscriptionsClient; -import com.azure.resourcemanager.quota.fluent.GroupQuotaUsagesClient; -import com.azure.resourcemanager.quota.fluent.GroupQuotasClient; -import com.azure.resourcemanager.quota.fluent.QuotaManagementClient; -import com.azure.resourcemanager.quota.fluent.QuotaOperationsClient; -import com.azure.resourcemanager.quota.fluent.QuotaRequestStatusClient; -import com.azure.resourcemanager.quota.fluent.QuotasClient; -import com.azure.resourcemanager.quota.fluent.UsagesClient; -import java.io.IOException; -import java.lang.reflect.Type; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the QuotaManagementClientImpl type. - */ -@ServiceClient(builder = QuotaManagementClientBuilder.class) -public final class QuotaManagementClientImpl implements QuotaManagementClient { - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - * Version parameter. - */ - private final String apiVersion; - - /** - * Gets Version parameter. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** - * The ID of the target subscription. The value must be an UUID. - */ - 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. - */ - 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 QuotaOperationsClient object to access its operations. - */ - private final QuotaOperationsClient quotaOperations; - - /** - * Gets the QuotaOperationsClient object to access its operations. - * - * @return the QuotaOperationsClient object. - */ - public QuotaOperationsClient getQuotaOperations() { - return this.quotaOperations; - } - - /** - * The QuotaRequestStatusClient object to access its operations. - */ - private final QuotaRequestStatusClient quotaRequestStatus; - - /** - * Gets the QuotaRequestStatusClient object to access its operations. - * - * @return the QuotaRequestStatusClient object. - */ - public QuotaRequestStatusClient getQuotaRequestStatus() { - return this.quotaRequestStatus; - } - - /** - * The GroupQuotasClient object to access its operations. - */ - private final GroupQuotasClient groupQuotas; - - /** - * Gets the GroupQuotasClient object to access its operations. - * - * @return the GroupQuotasClient object. - */ - public GroupQuotasClient getGroupQuotas() { - return this.groupQuotas; - } - - /** - * The GroupQuotaLimitsRequestsClient object to access its operations. - */ - private final GroupQuotaLimitsRequestsClient groupQuotaLimitsRequests; - - /** - * Gets the GroupQuotaLimitsRequestsClient object to access its operations. - * - * @return the GroupQuotaLimitsRequestsClient object. - */ - public GroupQuotaLimitsRequestsClient getGroupQuotaLimitsRequests() { - return this.groupQuotaLimitsRequests; - } - - /** - * The GroupQuotaUsagesClient object to access its operations. - */ - private final GroupQuotaUsagesClient groupQuotaUsages; - - /** - * Gets the GroupQuotaUsagesClient object to access its operations. - * - * @return the GroupQuotaUsagesClient object. - */ - public GroupQuotaUsagesClient getGroupQuotaUsages() { - return this.groupQuotaUsages; - } - - /** - * The GroupQuotaSubscriptionsClient object to access its operations. - */ - private final GroupQuotaSubscriptionsClient groupQuotaSubscriptions; - - /** - * Gets the GroupQuotaSubscriptionsClient object to access its operations. - * - * @return the GroupQuotaSubscriptionsClient object. - */ - public GroupQuotaSubscriptionsClient getGroupQuotaSubscriptions() { - return this.groupQuotaSubscriptions; - } - - /** - * The GroupQuotaSubscriptionRequestsClient object to access its operations. - */ - private final GroupQuotaSubscriptionRequestsClient groupQuotaSubscriptionRequests; - - /** - * Gets the GroupQuotaSubscriptionRequestsClient object to access its operations. - * - * @return the GroupQuotaSubscriptionRequestsClient object. - */ - public GroupQuotaSubscriptionRequestsClient getGroupQuotaSubscriptionRequests() { - return this.groupQuotaSubscriptionRequests; - } - - /** - * The GroupQuotaLimitsClient object to access its operations. - */ - private final GroupQuotaLimitsClient groupQuotaLimits; - - /** - * Gets the GroupQuotaLimitsClient object to access its operations. - * - * @return the GroupQuotaLimitsClient object. - */ - public GroupQuotaLimitsClient getGroupQuotaLimits() { - return this.groupQuotaLimits; - } - - /** - * The GroupQuotaSubscriptionAllocationsClient object to access its operations. - */ - private final GroupQuotaSubscriptionAllocationsClient groupQuotaSubscriptionAllocations; - - /** - * Gets the GroupQuotaSubscriptionAllocationsClient object to access its operations. - * - * @return the GroupQuotaSubscriptionAllocationsClient object. - */ - public GroupQuotaSubscriptionAllocationsClient getGroupQuotaSubscriptionAllocations() { - return this.groupQuotaSubscriptionAllocations; - } - - /** - * The GroupQuotaSubscriptionAllocationRequestsClient object to access its operations. - */ - private final GroupQuotaSubscriptionAllocationRequestsClient groupQuotaSubscriptionAllocationRequests; - - /** - * Gets the GroupQuotaSubscriptionAllocationRequestsClient object to access its operations. - * - * @return the GroupQuotaSubscriptionAllocationRequestsClient object. - */ - public GroupQuotaSubscriptionAllocationRequestsClient getGroupQuotaSubscriptionAllocationRequests() { - return this.groupQuotaSubscriptionAllocationRequests; - } - - /** - * The GroupQuotaLocationSettingsClient object to access its operations. - */ - private final GroupQuotaLocationSettingsClient groupQuotaLocationSettings; - - /** - * Gets the GroupQuotaLocationSettingsClient object to access its operations. - * - * @return the GroupQuotaLocationSettingsClient object. - */ - public GroupQuotaLocationSettingsClient getGroupQuotaLocationSettings() { - return this.groupQuotaLocationSettings; - } - - /** - * The UsagesClient object to access its operations. - */ - private final UsagesClient usages; - - /** - * Gets the UsagesClient object to access its operations. - * - * @return the UsagesClient object. - */ - public UsagesClient getUsages() { - return this.usages; - } - - /** - * The QuotasClient object to access its operations. - */ - private final QuotasClient quotas; - - /** - * Gets the QuotasClient object to access its operations. - * - * @return the QuotasClient object. - */ - public QuotasClient getQuotas() { - return this.quotas; - } - - /** - * Initializes an instance of QuotaManagementClient 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 endpoint Service host. - * @param subscriptionId The ID of the target subscription. The value must be an UUID. - */ - QuotaManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.endpoint = endpoint; - this.subscriptionId = subscriptionId; - this.apiVersion = "2025-09-01"; - this.quotaOperations = new QuotaOperationsClientImpl(this); - this.quotaRequestStatus = new QuotaRequestStatusClientImpl(this); - this.groupQuotas = new GroupQuotasClientImpl(this); - this.groupQuotaLimitsRequests = new GroupQuotaLimitsRequestsClientImpl(this); - this.groupQuotaUsages = new GroupQuotaUsagesClientImpl(this); - this.groupQuotaSubscriptions = new GroupQuotaSubscriptionsClientImpl(this); - this.groupQuotaSubscriptionRequests = new GroupQuotaSubscriptionRequestsClientImpl(this); - this.groupQuotaLimits = new GroupQuotaLimitsClientImpl(this); - this.groupQuotaSubscriptionAllocations = new GroupQuotaSubscriptionAllocationsClientImpl(this); - this.groupQuotaSubscriptionAllocationRequests = new GroupQuotaSubscriptionAllocationRequestsClientImpl(this); - this.groupQuotaLocationSettings = new GroupQuotaLocationSettingsClientImpl(this); - this.usages = new UsagesClientImpl(this); - this.quotas = new QuotasClientImpl(this); - } - - /** - * Gets default client context. - * - * @return the default client context. - */ - public Context getContext() { - return Context.NONE; - } - - /** - * Merges default client context with provided context. - * - * @param context the context to be merged with default client context. - * @return the merged context. - */ - public Context mergeContext(Context context) { - return CoreUtils.mergeContexts(this.getContext(), context); - } - - /** - * Gets long running operation result. - * - * @param activationResponse the response of activation operation. - * @param httpPipeline the http pipeline. - * @param pollResultType type of poll result. - * @param finalResultType type of final result. - * @param context the context shared by all requests. - * @param type of poll result. - * @param type of final result. - * @return poller flux for poll result and final result. - */ - public PollerFlux, U> getLroResult(Mono>> activationResponse, - HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { - return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, - defaultPollInterval, activationResponse, context); - } - - /** - * Gets long running operation result. - * - * @param activationResponse the response of activation operation. - * @param pollResultType type of poll result. - * @param finalResultType type of final result. - * @param context the context shared by all requests. - * @param 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. - * - * @param response the last async poll response. - * @param type of poll result. - * @param type of final result. - * @return the final result, or an error. - */ - public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { - if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { - String errorMessage; - ManagementError managementError = null; - HttpResponse errorResponse = null; - PollResult.Error lroError = response.getValue().getError(); - if (lroError != null) { - errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), - lroError.getResponseBody()); - - errorMessage = response.getValue().getError().getMessage(); - String errorBody = response.getValue().getError().getResponseBody(); - if (errorBody != null) { - // try to deserialize error body to ManagementError - try { - managementError = this.getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); - if (managementError.getCode() == null || managementError.getMessage() == null) { - managementError = null; - } - } catch (IOException | RuntimeException ioe) { - LOGGER.logThrowableAsWarning(ioe); - } - } - } else { - // fallback to default error message - errorMessage = "Long running operation failed."; - } - if (managementError == null) { - // fallback to default ManagementError - managementError = new ManagementError(response.getStatus().toString(), errorMessage); - } - return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); - } else { - return response.getFinalResult(); - } - } - - private static final class HttpResponseImpl extends HttpResponse { - private final int statusCode; - - private final byte[] responseBody; - - private final HttpHeaders httpHeaders; - - HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { - super(null); - this.statusCode = statusCode; - this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? new byte[0] : responseBody.getBytes(StandardCharsets.UTF_8); - } - - public int getStatusCode() { - return statusCode; - } - - public String getHeaderValue(String s) { - return httpHeaders.getValue(HttpHeaderName.fromString(s)); - } - - public HttpHeaders getHeaders() { - return httpHeaders; - } - - public Flux getBody() { - return Flux.just(ByteBuffer.wrap(responseBody)); - } - - public Mono getBodyAsByteArray() { - return Mono.just(responseBody); - } - - public Mono getBodyAsString() { - return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); - } - - public Mono getBodyAsString(Charset charset) { - return Mono.just(new String(responseBody, charset)); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(QuotaManagementClientImpl.class); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaOperationsClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaOperationsClientImpl.java deleted file mode 100644 index c01a664e2326..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaOperationsClientImpl.java +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.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.quota.fluent.QuotaOperationsClient; -import com.azure.resourcemanager.quota.fluent.models.OperationResponseInner; -import com.azure.resourcemanager.quota.implementation.models.OperationList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in QuotaOperationsClient. - */ -public final class QuotaOperationsClientImpl implements QuotaOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final QuotaOperationsService service; - - /** - * The service client containing this operation class. - */ - private final QuotaManagementClientImpl client; - - /** - * Initializes an instance of QuotaOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - QuotaOperationsClientImpl(QuotaManagementClientImpl client) { - this.service - = RestProxy.create(QuotaOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for QuotaManagementClientQuotaOperations to be used by the proxy service - * to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "QuotaManagementClientQuotaOperations") - public interface QuotaOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Quota/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - 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.Quota/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List the operations for the provider. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of connected cluster API operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - final String accept = "application/json"; - 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())); - } - - /** - * List the operations for the provider. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of connected cluster API operations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List the operations for the provider. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of connected cluster API operations along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage() { - 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); - } - - /** - * List the operations for the provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of connected cluster API operations along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(Context context) { - 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); - } - - /** - * List the operations for the provider. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of connected cluster API operations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); - } - - /** - * List the operations for the provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of connected cluster API 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 the paginated list of connected cluster API operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of connected cluster API operations along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of connected cluster API operations along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaOperationsImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaOperationsImpl.java deleted file mode 100644 index 9447a8124e55..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaOperationsImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.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.quota.fluent.QuotaOperationsClient; -import com.azure.resourcemanager.quota.fluent.models.OperationResponseInner; -import com.azure.resourcemanager.quota.models.OperationResponse; -import com.azure.resourcemanager.quota.models.QuotaOperations; - -public final class QuotaOperationsImpl implements QuotaOperations { - private static final ClientLogger LOGGER = new ClientLogger(QuotaOperationsImpl.class); - - private final QuotaOperationsClient innerClient; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - public QuotaOperationsImpl(QuotaOperationsClient innerClient, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationResponseImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationResponseImpl(inner1, this.manager())); - } - - private QuotaOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaRequestDetailsImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaRequestDetailsImpl.java deleted file mode 100644 index 5972141c6b19..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaRequestDetailsImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.QuotaRequestDetailsInner; -import com.azure.resourcemanager.quota.models.QuotaRequestDetails; -import com.azure.resourcemanager.quota.models.QuotaRequestState; -import com.azure.resourcemanager.quota.models.ServiceErrorDetail; -import com.azure.resourcemanager.quota.models.SubRequest; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class QuotaRequestDetailsImpl implements QuotaRequestDetails { - private QuotaRequestDetailsInner innerObject; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - QuotaRequestDetailsImpl(QuotaRequestDetailsInner innerObject, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public QuotaRequestState provisioningState() { - return this.innerModel().provisioningState(); - } - - public String message() { - return this.innerModel().message(); - } - - public ServiceErrorDetail error() { - return this.innerModel().error(); - } - - public OffsetDateTime requestSubmitTime() { - return this.innerModel().requestSubmitTime(); - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public QuotaRequestDetailsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaRequestStatusClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaRequestStatusClientImpl.java deleted file mode 100644 index db9a20e6e9f8..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaRequestStatusClientImpl.java +++ /dev/null @@ -1,426 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.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.quota.fluent.QuotaRequestStatusClient; -import com.azure.resourcemanager.quota.fluent.models.QuotaRequestDetailsInner; -import com.azure.resourcemanager.quota.implementation.models.QuotaRequestDetailsList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in QuotaRequestStatusClient. - */ -public final class QuotaRequestStatusClientImpl implements QuotaRequestStatusClient { - /** - * The proxy service used to perform REST calls. - */ - private final QuotaRequestStatusService service; - - /** - * The service client containing this operation class. - */ - private final QuotaManagementClientImpl client; - - /** - * Initializes an instance of QuotaRequestStatusClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - QuotaRequestStatusClientImpl(QuotaManagementClientImpl client) { - this.service = RestProxy.create(QuotaRequestStatusService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for QuotaManagementClientQuotaRequestStatus to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "QuotaManagementClientQuotaRequestStatus") - public interface QuotaRequestStatusService { - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Quota/quotaRequests/{id}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("id") String id, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Quota/quotaRequests/{id}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("id") String id, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Quota/quotaRequests") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$skiptoken") String skiptoken, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Quota/quotaRequests") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, - @QueryParam("$skiptoken") String skiptoken, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get the quota request details and status by quota request ID for the resources of the resource provider at a - * specific location. The quota request ID **id** is returned in the response of the PUT operation. - * - * @param id Quota request ID. - * @param scope The fully qualified Azure Resource manager identifier of the 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 quota request details and status by quota request ID for the resources of the resource provider at a - * specific location along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String id, String scope) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), scope, id, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the quota request details and status by quota request ID for the resources of the resource provider at a - * specific location. The quota request ID **id** is returned in the response of the PUT operation. - * - * @param id Quota request ID. - * @param scope The fully qualified Azure Resource manager identifier of the 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 quota request details and status by quota request ID for the resources of the resource provider at a - * specific location on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String id, String scope) { - return getWithResponseAsync(id, scope).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the quota request details and status by quota request ID for the resources of the resource provider at a - * specific location. The quota request ID **id** is returned in the response of the PUT operation. - * - * @param id Quota request ID. - * @param scope The fully qualified Azure Resource manager identifier of the 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 quota request details and status by quota request ID for the resources of the resource provider at a - * specific location along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String id, String scope, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, id, accept, context); - } - - /** - * Get the quota request details and status by quota request ID for the resources of the resource provider at a - * specific location. The quota request ID **id** is returned in the response of the PUT operation. - * - * @param id Quota request ID. - * @param scope The fully qualified Azure Resource manager identifier of the 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 quota request details and status by quota request ID for the resources of the resource provider at a - * specific location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public QuotaRequestDetailsInner get(String id, String scope) { - return getWithResponse(id, scope, Context.NONE).getValue(); - } - - /** - * For the specified scope, get the current quota requests for a one year period ending at the time is made. Use the - * **oData** filter to select quota requests. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * |requestSubmitTime | ge, le, eq, gt, lt - * |provisioningState eq {QuotaRequestState} - * |resourceName eq {resourceName}. - * @param top Number of records to return. - * @param skiptoken The **Skiptoken** parameter is used only if a previous operation returned a partial result. If a - * previous response contains a **nextLink** element, its value includes a **skiptoken** parameter that specifies a - * starting point to use for subsequent calls. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request information along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, String filter, Integer top, - String skiptoken) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), scope, filter, - top, 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())); - } - - /** - * For the specified scope, get the current quota requests for a one year period ending at the time is made. Use the - * **oData** filter to select quota requests. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * |requestSubmitTime | ge, le, eq, gt, lt - * |provisioningState eq {QuotaRequestState} - * |resourceName eq {resourceName}. - * @param top Number of records to return. - * @param skiptoken The **Skiptoken** parameter is used only if a previous operation returned a partial result. If a - * previous response contains a **nextLink** element, its value includes a **skiptoken** parameter that specifies a - * starting point to use for subsequent calls. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request information as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, String filter, Integer top, String skiptoken) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, filter, top, skiptoken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * For the specified scope, get the current quota requests for a one year period ending at the time is made. Use the - * **oData** filter to select quota requests. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 quota request information as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - final String filter = null; - final Integer top = null; - final String skiptoken = null; - return new PagedFlux<>(() -> listSinglePageAsync(scope, filter, top, skiptoken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * For the specified scope, get the current quota requests for a one year period ending at the time is made. Use the - * **oData** filter to select quota requests. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * |requestSubmitTime | ge, le, eq, gt, lt - * |provisioningState eq {QuotaRequestState} - * |resourceName eq {resourceName}. - * @param top Number of records to return. - * @param skiptoken The **Skiptoken** parameter is used only if a previous operation returned a partial result. If a - * previous response contains a **nextLink** element, its value includes a **skiptoken** parameter that specifies a - * starting point to use for subsequent calls. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request information along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String scope, String filter, Integer top, - String skiptoken) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - scope, filter, top, skiptoken, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * For the specified scope, get the current quota requests for a one year period ending at the time is made. Use the - * **oData** filter to select quota requests. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * |requestSubmitTime | ge, le, eq, gt, lt - * |provisioningState eq {QuotaRequestState} - * |resourceName eq {resourceName}. - * @param top Number of records to return. - * @param skiptoken The **Skiptoken** parameter is used only if a previous operation returned a partial result. If a - * previous response contains a **nextLink** element, its value includes a **skiptoken** parameter that specifies a - * starting point to use for subsequent calls. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request information along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String scope, String filter, Integer top, - String skiptoken, Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - scope, filter, top, skiptoken, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * For the specified scope, get the current quota requests for a one year period ending at the time is made. Use the - * **oData** filter to select quota requests. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 quota request information as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - final String filter = null; - final Integer top = null; - final String skiptoken = null; - return new PagedIterable<>(() -> listSinglePage(scope, filter, top, skiptoken), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * For the specified scope, get the current quota requests for a one year period ending at the time is made. Use the - * **oData** filter to select quota requests. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * |requestSubmitTime | ge, le, eq, gt, lt - * |provisioningState eq {QuotaRequestState} - * |resourceName eq {resourceName}. - * @param top Number of records to return. - * @param skiptoken The **Skiptoken** parameter is used only if a previous operation returned a partial result. If a - * previous response contains a **nextLink** element, its value includes a **skiptoken** parameter that specifies a - * starting point to use for subsequent calls. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request information as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, String filter, Integer top, String skiptoken, - Context context) { - return new PagedIterable<>(() -> listSinglePage(scope, filter, top, skiptoken, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request information along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request information along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request information along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaRequestStatusImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaRequestStatusImpl.java deleted file mode 100644 index 550026ed4eba..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaRequestStatusImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.quota.fluent.QuotaRequestStatusClient; -import com.azure.resourcemanager.quota.fluent.models.QuotaRequestDetailsInner; -import com.azure.resourcemanager.quota.models.QuotaRequestDetails; -import com.azure.resourcemanager.quota.models.QuotaRequestStatus; - -public final class QuotaRequestStatusImpl implements QuotaRequestStatus { - private static final ClientLogger LOGGER = new ClientLogger(QuotaRequestStatusImpl.class); - - private final QuotaRequestStatusClient innerClient; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - public QuotaRequestStatusImpl(QuotaRequestStatusClient innerClient, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String id, String scope, Context context) { - Response inner = this.serviceClient().getWithResponse(id, scope, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new QuotaRequestDetailsImpl(inner.getValue(), this.manager())); - } - - public QuotaRequestDetails get(String id, String scope) { - QuotaRequestDetailsInner inner = this.serviceClient().get(id, scope); - if (inner != null) { - return new QuotaRequestDetailsImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return ResourceManagerUtils.mapPage(inner, inner1 -> new QuotaRequestDetailsImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, String filter, Integer top, String skiptoken, - Context context) { - PagedIterable inner - = this.serviceClient().list(scope, filter, top, skiptoken, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new QuotaRequestDetailsImpl(inner1, this.manager())); - } - - private QuotaRequestStatusClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotasClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotasClientImpl.java deleted file mode 100644 index f54ffe55fd6a..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotasClientImpl.java +++ /dev/null @@ -1,908 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -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.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.quota.fluent.QuotasClient; -import com.azure.resourcemanager.quota.fluent.models.CurrentQuotaLimitBaseInner; -import com.azure.resourcemanager.quota.implementation.models.QuotaLimits; -import com.azure.resourcemanager.quota.models.QuotasGetResponse; -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 QuotasClient. - */ -public final class QuotasClientImpl implements QuotasClient { - /** - * The proxy service used to perform REST calls. - */ - private final QuotasService service; - - /** - * The service client containing this operation class. - */ - private final QuotaManagementClientImpl client; - - /** - * Initializes an instance of QuotasClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - QuotasClientImpl(QuotaManagementClientImpl client) { - this.service = RestProxy.create(QuotasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for QuotaManagementClientQuotas to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "QuotaManagementClientQuotas") - public interface QuotasService { - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Quota/quotas/{resourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Quota/quotas/{resourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - QuotasGetResponse getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{scope}/providers/Microsoft.Quota/quotas/{resourceName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("resourceName") String resourceName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") CurrentQuotaLimitBaseInner createQuotaRequest, Context context); - - @Put("/{scope}/providers/Microsoft.Quota/quotas/{resourceName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("resourceName") String resourceName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") CurrentQuotaLimitBaseInner createQuotaRequest, Context context); - - @Patch("/{scope}/providers/Microsoft.Quota/quotas/{resourceName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("resourceName") String resourceName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") CurrentQuotaLimitBaseInner createQuotaRequest, Context context); - - @Patch("/{scope}/providers/Microsoft.Quota/quotas/{resourceName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("resourceName") String resourceName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") CurrentQuotaLimitBaseInner createQuotaRequest, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Quota/quotas") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Quota/quotas") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new - * quota limit that can be submitted with a PUT request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the 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 quota limit of a resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getWithResponseAsync(String resourceName, String scope) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), scope, - resourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new - * quota limit that can be submitted with a PUT request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the 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 quota limit of a resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceName, String scope) { - return getWithResponseAsync(resourceName, scope).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new - * quota limit that can be submitted with a PUT request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the 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 quota limit of a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public QuotasGetResponse getWithResponse(String resourceName, String scope, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, resourceName, accept, - context); - } - - /** - * Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new - * quota limit that can be submitted with a PUT request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the 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 quota limit of a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CurrentQuotaLimitBaseInner get(String resourceName, String scope) { - return getWithResponse(resourceName, scope, Context.NONE).getValue(); - } - - /** - * Create or update the quota limit for the specified resource with the requested value. To update the quota, follow - * these steps: - * 1. Use the GET operation for quotas and usages to determine how much quota remains for the specific resource and - * to calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceName, String scope, - CurrentQuotaLimitBaseInner createQuotaRequest) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - scope, resourceName, contentType, accept, createQuotaRequest, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update the quota limit for the specified resource with the requested value. To update the quota, follow - * these steps: - * 1. Use the GET operation for quotas and usages to determine how much quota remains for the specific resource and - * to calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceName, String scope, - CurrentQuotaLimitBaseInner createQuotaRequest) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, resourceName, - contentType, accept, createQuotaRequest, Context.NONE); - } - - /** - * Create or update the quota limit for the specified resource with the requested value. To update the quota, follow - * these steps: - * 1. Use the GET operation for quotas and usages to determine how much quota remains for the specific resource and - * to calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota request payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceName, String scope, - CurrentQuotaLimitBaseInner createQuotaRequest, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, resourceName, - contentType, accept, createQuotaRequest, context); - } - - /** - * Create or update the quota limit for the specified resource with the requested value. To update the quota, follow - * these steps: - * 1. Use the GET operation for quotas and usages to determine how much quota remains for the specific resource and - * to calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 quota limit. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CurrentQuotaLimitBaseInner> - beginCreateOrUpdateAsync(String resourceName, String scope, CurrentQuotaLimitBaseInner createQuotaRequest) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceName, scope, createQuotaRequest); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CurrentQuotaLimitBaseInner.class, CurrentQuotaLimitBaseInner.class, - this.client.getContext()); - } - - /** - * Create or update the quota limit for the specified resource with the requested value. To update the quota, follow - * these steps: - * 1. Use the GET operation for quotas and usages to determine how much quota remains for the specific resource and - * to calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 quota limit. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CurrentQuotaLimitBaseInner> - beginCreateOrUpdate(String resourceName, String scope, CurrentQuotaLimitBaseInner createQuotaRequest) { - Response response = createOrUpdateWithResponse(resourceName, scope, createQuotaRequest); - return this.client.getLroResult(response, - CurrentQuotaLimitBaseInner.class, CurrentQuotaLimitBaseInner.class, Context.NONE); - } - - /** - * Create or update the quota limit for the specified resource with the requested value. To update the quota, follow - * these steps: - * 1. Use the GET operation for quotas and usages to determine how much quota remains for the specific resource and - * to calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota request payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 quota limit. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CurrentQuotaLimitBaseInner> beginCreateOrUpdate( - String resourceName, String scope, CurrentQuotaLimitBaseInner createQuotaRequest, Context context) { - Response response = createOrUpdateWithResponse(resourceName, scope, createQuotaRequest, context); - return this.client.getLroResult(response, - CurrentQuotaLimitBaseInner.class, CurrentQuotaLimitBaseInner.class, context); - } - - /** - * Create or update the quota limit for the specified resource with the requested value. To update the quota, follow - * these steps: - * 1. Use the GET operation for quotas and usages to determine how much quota remains for the specific resource and - * to calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceName, String scope, - CurrentQuotaLimitBaseInner createQuotaRequest) { - return beginCreateOrUpdateAsync(resourceName, scope, createQuotaRequest).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update the quota limit for the specified resource with the requested value. To update the quota, follow - * these steps: - * 1. Use the GET operation for quotas and usages to determine how much quota remains for the specific resource and - * to calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CurrentQuotaLimitBaseInner createOrUpdate(String resourceName, String scope, - CurrentQuotaLimitBaseInner createQuotaRequest) { - return beginCreateOrUpdate(resourceName, scope, createQuotaRequest).getFinalResult(); - } - - /** - * Create or update the quota limit for the specified resource with the requested value. To update the quota, follow - * these steps: - * 1. Use the GET operation for quotas and usages to determine how much quota remains for the specific resource and - * to calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota request payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CurrentQuotaLimitBaseInner createOrUpdate(String resourceName, String scope, - CurrentQuotaLimitBaseInner createQuotaRequest, Context context) { - return beginCreateOrUpdate(resourceName, scope, createQuotaRequest, context).getFinalResult(); - } - - /** - * Update the quota limit for a specific resource to the specified value: - * 1. Use the Usages-GET and Quota-GET operations to determine the remaining quota for the specific resource and to - * calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceName, String scope, - CurrentQuotaLimitBaseInner createQuotaRequest) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), scope, - resourceName, contentType, accept, createQuotaRequest, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the quota limit for a specific resource to the specified value: - * 1. Use the Usages-GET and Quota-GET operations to determine the remaining quota for the specific resource and to - * calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceName, String scope, - CurrentQuotaLimitBaseInner createQuotaRequest) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, resourceName, - contentType, accept, createQuotaRequest, Context.NONE); - } - - /** - * Update the quota limit for a specific resource to the specified value: - * 1. Use the Usages-GET and Quota-GET operations to determine the remaining quota for the specific resource and to - * calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota requests payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response updateWithResponse(String resourceName, String scope, - CurrentQuotaLimitBaseInner createQuotaRequest, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, resourceName, - contentType, accept, createQuotaRequest, context); - } - - /** - * Update the quota limit for a specific resource to the specified value: - * 1. Use the Usages-GET and Quota-GET operations to determine the remaining quota for the specific resource and to - * calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 quota limit. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CurrentQuotaLimitBaseInner> - beginUpdateAsync(String resourceName, String scope, CurrentQuotaLimitBaseInner createQuotaRequest) { - Mono>> mono = updateWithResponseAsync(resourceName, scope, createQuotaRequest); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CurrentQuotaLimitBaseInner.class, CurrentQuotaLimitBaseInner.class, - this.client.getContext()); - } - - /** - * Update the quota limit for a specific resource to the specified value: - * 1. Use the Usages-GET and Quota-GET operations to determine the remaining quota for the specific resource and to - * calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 quota limit. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CurrentQuotaLimitBaseInner> - beginUpdate(String resourceName, String scope, CurrentQuotaLimitBaseInner createQuotaRequest) { - Response response = updateWithResponse(resourceName, scope, createQuotaRequest); - return this.client.getLroResult(response, - CurrentQuotaLimitBaseInner.class, CurrentQuotaLimitBaseInner.class, Context.NONE); - } - - /** - * Update the quota limit for a specific resource to the specified value: - * 1. Use the Usages-GET and Quota-GET operations to determine the remaining quota for the specific resource and to - * calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota requests payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 quota limit. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CurrentQuotaLimitBaseInner> - beginUpdate(String resourceName, String scope, CurrentQuotaLimitBaseInner createQuotaRequest, Context context) { - Response response = updateWithResponse(resourceName, scope, createQuotaRequest, context); - return this.client.getLroResult(response, - CurrentQuotaLimitBaseInner.class, CurrentQuotaLimitBaseInner.class, context); - } - - /** - * Update the quota limit for a specific resource to the specified value: - * 1. Use the Usages-GET and Quota-GET operations to determine the remaining quota for the specific resource and to - * calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceName, String scope, - CurrentQuotaLimitBaseInner createQuotaRequest) { - return beginUpdateAsync(resourceName, scope, createQuotaRequest).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update the quota limit for a specific resource to the specified value: - * 1. Use the Usages-GET and Quota-GET operations to determine the remaining quota for the specific resource and to - * calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CurrentQuotaLimitBaseInner update(String resourceName, String scope, - CurrentQuotaLimitBaseInner createQuotaRequest) { - return beginUpdate(resourceName, scope, createQuotaRequest).getFinalResult(); - } - - /** - * Update the quota limit for a specific resource to the specified value: - * 1. Use the Usages-GET and Quota-GET operations to determine the remaining quota for the specific resource and to - * calculate the new quota limit. These steps are detailed in [this - * example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). - * 2. Use this PUT operation to update the quota limit. Please check the URI in location header for the detailed - * status of the request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param createQuotaRequest Quota requests payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CurrentQuotaLimitBaseInner update(String resourceName, String scope, - CurrentQuotaLimitBaseInner createQuotaRequest, Context context) { - return beginUpdate(resourceName, scope, createQuotaRequest, context).getFinalResult(); - } - - /** - * Get a list of current quota limits of all resources for the specified scope. The response from this GET operation - * can be leveraged to submit requests to update a quota. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of current quota limits of all resources for the specified scope along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), scope, 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 a list of current quota limits of all resources for the specified scope. The response from this GET operation - * can be leveraged to submit requests to update a quota. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of current quota limits of all resources for the specified scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of current quota limits of all resources for the specified scope. The response from this GET operation - * can be leveraged to submit requests to update a quota. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of current quota limits of all resources for the specified scope along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String scope) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get a list of current quota limits of all resources for the specified scope. The response from this GET operation - * can be leveraged to submit requests to update a quota. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of current quota limits of all resources for the specified scope along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String scope, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get a list of current quota limits of all resources for the specified scope. The response from this GET operation - * can be leveraged to submit requests to update a quota. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of current quota limits of all resources for the specified scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(() -> listSinglePage(scope), nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Get a list of current quota limits of all resources for the specified scope. The response from this GET operation - * can be leveraged to submit requests to update a quota. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of current quota limits of all resources for the specified scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(() -> listSinglePage(scope, 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 a list of current quota limits of all resources for the specified scope along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of current quota limits of all resources for the specified scope along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of current quota limits of all resources for the specified scope along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotasImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotasImpl.java deleted file mode 100644 index cd6d0f1b0a20..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotasImpl.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.quota.fluent.QuotasClient; -import com.azure.resourcemanager.quota.fluent.models.CurrentQuotaLimitBaseInner; -import com.azure.resourcemanager.quota.models.CurrentQuotaLimitBase; -import com.azure.resourcemanager.quota.models.Quotas; -import com.azure.resourcemanager.quota.models.QuotasGetResponse; - -public final class QuotasImpl implements Quotas { - private static final ClientLogger LOGGER = new ClientLogger(QuotasImpl.class); - - private final QuotasClient innerClient; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - public QuotasImpl(QuotasClient innerClient, com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceName, String scope, Context context) { - QuotasGetResponse inner = this.serviceClient().getWithResponse(resourceName, scope, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CurrentQuotaLimitBaseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public CurrentQuotaLimitBase get(String resourceName, String scope) { - CurrentQuotaLimitBaseInner inner = this.serviceClient().get(resourceName, scope); - if (inner != null) { - return new CurrentQuotaLimitBaseImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CurrentQuotaLimitBaseImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CurrentQuotaLimitBaseImpl(inner1, this.manager())); - } - - public CurrentQuotaLimitBase getById(String id) { - String resourceName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}", "resourceName"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'quotas'.", id))); - } - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}", "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - return this.getWithResponse(resourceName, scope, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}", "resourceName"); - if (resourceName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'quotas'.", id))); - } - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}", "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - return this.getWithResponse(resourceName, scope, context); - } - - private QuotasClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } - - public CurrentQuotaLimitBaseImpl define(String name) { - return new CurrentQuotaLimitBaseImpl(name, this.manager()); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/ResourceManagerUtils.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/ResourceManagerUtils.java deleted file mode 100644 index eb42064a973c..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/ResourceManagerUtils.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -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.util.CoreUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import reactor.core.publisher.Flux; - -final class ResourceManagerUtils { - private ResourceManagerUtils() { - } - - static String getValueFromIdByName(String id, String name) { - if (id == null) { - return null; - } - Iterator itr = Arrays.stream(id.split("/")).iterator(); - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && !part.trim().isEmpty()) { - if (part.equalsIgnoreCase(name)) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } - } - } - } - return null; - } - - static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { - if (id == null || pathTemplate == null) { - return null; - } - String parameterNameParentheses = "{" + parameterName + "}"; - List idSegmentsReverted = Arrays.asList(id.split("/")); - List pathSegments = Arrays.asList(pathTemplate.split("/")); - Collections.reverse(idSegmentsReverted); - Iterator idItrReverted = idSegmentsReverted.iterator(); - int pathIndex = pathSegments.size(); - while (idItrReverted.hasNext() && pathIndex > 0) { - String idSegment = idItrReverted.next(); - String pathSegment = pathSegments.get(--pathIndex); - if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { - if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { - if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { - List segments = new ArrayList<>(); - segments.add(idSegment); - idItrReverted.forEachRemaining(segments::add); - Collections.reverse(segments); - if (!segments.isEmpty() && segments.get(0).isEmpty()) { - segments.remove(0); - } - return String.join("/", segments); - } else { - return idSegment; - } - } - } - } - return null; - } - - static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl<>(pageIterable, mapper); - } - - private static final class PagedIterableImpl extends PagedIterable { - - private final PagedIterable pagedIterable; - private final Function mapper; - private final Function, PagedResponse> pageMapper; - - private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux - .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); - this.pagedIterable = pagedIterable; - this.mapper = mapper; - this.pageMapper = getPageMapper(mapper); - } - - private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), - null); - } - - @Override - public Stream stream() { - return pagedIterable.stream().map(mapper); - } - - @Override - public Stream> streamByPage() { - return pagedIterable.streamByPage().map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken) { - return pagedIterable.streamByPage(continuationToken).map(pageMapper); - } - - @Override - public Stream> streamByPage(int preferredPageSize) { - return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken, int preferredPageSize) { - return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); - } - - @Override - public Iterator iterator() { - return new IteratorImpl<>(pagedIterable.iterator(), mapper); - } - - @Override - public Iterable> iterableByPage() { - return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); - } - - @Override - public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); - } - } - - private static final class IteratorImpl implements Iterator { - - private final Iterator iterator; - private final Function mapper; - - private IteratorImpl(Iterator iterator, Function mapper) { - this.iterator = iterator; - this.mapper = mapper; - } - - @Override - public boolean hasNext() { - return iterator.hasNext(); - } - - @Override - public S next() { - return mapper.apply(iterator.next()); - } - - @Override - public void remove() { - iterator.remove(); - } - } - - private static final class IterableImpl implements Iterable { - - private final Iterable iterable; - private final Function mapper; - - private IterableImpl(Iterable iterable, Function mapper) { - this.iterable = iterable; - this.mapper = mapper; - } - - @Override - public Iterator iterator() { - return new IteratorImpl<>(iterable.iterator(), mapper); - } - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/ResourceUsagesImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/ResourceUsagesImpl.java deleted file mode 100644 index 4b2259c072d2..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/ResourceUsagesImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.ResourceUsagesInner; -import com.azure.resourcemanager.quota.models.GroupQuotaUsagesBase; -import com.azure.resourcemanager.quota.models.ResourceUsages; - -public final class ResourceUsagesImpl implements ResourceUsages { - private ResourceUsagesInner innerObject; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - ResourceUsagesImpl(ResourceUsagesInner innerObject, com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public GroupQuotaUsagesBase properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ResourceUsagesInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/SubmittedResourceRequestStatusImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/SubmittedResourceRequestStatusImpl.java deleted file mode 100644 index 3136867e7855..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/SubmittedResourceRequestStatusImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.SubmittedResourceRequestStatusInner; -import com.azure.resourcemanager.quota.models.SubmittedResourceRequestStatus; -import com.azure.resourcemanager.quota.models.SubmittedResourceRequestStatusProperties; - -public final class SubmittedResourceRequestStatusImpl implements SubmittedResourceRequestStatus { - private SubmittedResourceRequestStatusInner innerObject; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - SubmittedResourceRequestStatusImpl(SubmittedResourceRequestStatusInner innerObject, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SubmittedResourceRequestStatusProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public SubmittedResourceRequestStatusInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/SubscriptionQuotaAllocationsListImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/SubscriptionQuotaAllocationsListImpl.java deleted file mode 100644 index ea8523928180..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/SubscriptionQuotaAllocationsListImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsListInner; -import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocationsList; -import com.azure.resourcemanager.quota.models.SubscriptionQuotaAllocationsListProperties; - -public final class SubscriptionQuotaAllocationsListImpl implements SubscriptionQuotaAllocationsList { - private SubscriptionQuotaAllocationsListInner innerObject; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - SubscriptionQuotaAllocationsListImpl(SubscriptionQuotaAllocationsListInner innerObject, - com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SubscriptionQuotaAllocationsListProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public SubscriptionQuotaAllocationsListInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/UsagesClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/UsagesClientImpl.java deleted file mode 100644 index 87c8fc002d59..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/UsagesClientImpl.java +++ /dev/null @@ -1,349 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.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.quota.fluent.UsagesClient; -import com.azure.resourcemanager.quota.fluent.models.CurrentUsagesBaseInner; -import com.azure.resourcemanager.quota.implementation.models.UsagesLimits; -import com.azure.resourcemanager.quota.models.UsagesGetResponse; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in UsagesClient. - */ -public final class UsagesClientImpl implements UsagesClient { - /** - * The proxy service used to perform REST calls. - */ - private final UsagesService service; - - /** - * The service client containing this operation class. - */ - private final QuotaManagementClientImpl client; - - /** - * Initializes an instance of UsagesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - UsagesClientImpl(QuotaManagementClientImpl client) { - this.service = RestProxy.create(UsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for QuotaManagementClientUsages to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "QuotaManagementClientUsages") - public interface UsagesService { - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Quota/usages/{resourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Quota/usages/{resourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - UsagesGetResponse getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, @PathParam("resourceName") String resourceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Quota/usages") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Quota/usages") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get the current usage of a resource. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the 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 current usage of a resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getWithResponseAsync(String resourceName, String scope) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), scope, - resourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the current usage of a resource. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the 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 current usage of a resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceName, String scope) { - return getWithResponseAsync(resourceName, scope).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the current usage of a resource. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the 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 current usage of a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UsagesGetResponse getWithResponse(String resourceName, String scope, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, resourceName, accept, - context); - } - - /** - * Get the current usage of a resource. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the 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 current usage of a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CurrentUsagesBaseInner get(String resourceName, String scope) { - return getWithResponse(resourceName, scope, Context.NONE).getValue(); - } - - /** - * Get a list of current usage for all resources for the scope specified. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of current usage for all resources for the scope specified along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), scope, 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 a list of current usage for all resources for the scope specified. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of current usage for all resources for the scope specified as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of current usage for all resources for the scope specified. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of current usage for all resources for the scope specified along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String scope) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get a list of current usage for all resources for the scope specified. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of current usage for all resources for the scope specified along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String scope, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), scope, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get a list of current usage for all resources for the scope specified. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of current usage for all resources for the scope specified as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(() -> listSinglePage(scope), nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Get a list of current usage for all resources for the scope specified. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of current usage for all resources for the scope specified as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(() -> listSinglePage(scope, 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 a list of current usage for all resources for the scope specified along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of current usage for all resources for the scope specified along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of current usage for all resources for the scope specified along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/UsagesImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/UsagesImpl.java deleted file mode 100644 index 4b9472db4a4d..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/UsagesImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.quota.fluent.UsagesClient; -import com.azure.resourcemanager.quota.fluent.models.CurrentUsagesBaseInner; -import com.azure.resourcemanager.quota.models.CurrentUsagesBase; -import com.azure.resourcemanager.quota.models.Usages; -import com.azure.resourcemanager.quota.models.UsagesGetResponse; - -public final class UsagesImpl implements Usages { - private static final ClientLogger LOGGER = new ClientLogger(UsagesImpl.class); - - private final UsagesClient innerClient; - - private final com.azure.resourcemanager.quota.QuotaManager serviceManager; - - public UsagesImpl(UsagesClient innerClient, com.azure.resourcemanager.quota.QuotaManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceName, String scope, Context context) { - UsagesGetResponse inner = this.serviceClient().getWithResponse(resourceName, scope, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CurrentUsagesBaseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public CurrentUsagesBase get(String resourceName, String scope) { - CurrentUsagesBaseInner inner = this.serviceClient().get(resourceName, scope); - if (inner != null) { - return new CurrentUsagesBaseImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CurrentUsagesBaseImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CurrentUsagesBaseImpl(inner1, this.manager())); - } - - private UsagesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.quota.QuotaManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/GroupQuotaList.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/GroupQuotaList.java deleted file mode 100644 index ba66839c4205..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/GroupQuotaList.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEntityInner; -import java.io.IOException; -import java.util.List; - -/** - * List of Group Quotas at MG level. - */ -@Immutable -public final class GroupQuotaList implements JsonSerializable { - /* - * The GroupQuotasEntity items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of GroupQuotaList class. - */ - private GroupQuotaList() { - } - - /** - * Get the value property: The GroupQuotasEntity items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotaList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaList 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 GroupQuotaList. - */ - public static GroupQuotaList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaList deserializedGroupQuotaList = new GroupQuotaList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> GroupQuotasEntityInner.fromJson(reader1)); - deserializedGroupQuotaList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedGroupQuotaList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaList; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/GroupQuotaSubscriptionIdList.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/GroupQuotaSubscriptionIdList.java deleted file mode 100644 index b1e8de700144..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/GroupQuotaSubscriptionIdList.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaSubscriptionIdInner; -import java.io.IOException; -import java.util.List; - -/** - * List of GroupQuotaSubscriptionIds. - */ -@Immutable -public final class GroupQuotaSubscriptionIdList implements JsonSerializable { - /* - * The GroupQuotaSubscriptionId items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of GroupQuotaSubscriptionIdList class. - */ - private GroupQuotaSubscriptionIdList() { - } - - /** - * Get the value property: The GroupQuotaSubscriptionId items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotaSubscriptionIdList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaSubscriptionIdList 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 GroupQuotaSubscriptionIdList. - */ - public static GroupQuotaSubscriptionIdList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaSubscriptionIdList deserializedGroupQuotaSubscriptionIdList = new GroupQuotaSubscriptionIdList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> GroupQuotaSubscriptionIdInner.fromJson(reader1)); - deserializedGroupQuotaSubscriptionIdList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedGroupQuotaSubscriptionIdList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaSubscriptionIdList; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/GroupQuotaSubscriptionRequestStatusList.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/GroupQuotaSubscriptionRequestStatusList.java deleted file mode 100644 index f143ac7f8a1f..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/GroupQuotaSubscriptionRequestStatusList.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaSubscriptionRequestStatusInner; -import java.io.IOException; -import java.util.List; - -/** - * List of GroupQuotaSubscriptionRequests Status. - */ -@Immutable -public final class GroupQuotaSubscriptionRequestStatusList - implements JsonSerializable { - /* - * The GroupQuotaSubscriptionRequestStatus items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of GroupQuotaSubscriptionRequestStatusList class. - */ - private GroupQuotaSubscriptionRequestStatusList() { - } - - /** - * Get the value property: The GroupQuotaSubscriptionRequestStatus items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotaSubscriptionRequestStatusList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaSubscriptionRequestStatusList 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 GroupQuotaSubscriptionRequestStatusList. - */ - public static GroupQuotaSubscriptionRequestStatusList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaSubscriptionRequestStatusList deserializedGroupQuotaSubscriptionRequestStatusList - = new GroupQuotaSubscriptionRequestStatusList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> GroupQuotaSubscriptionRequestStatusInner.fromJson(reader1)); - deserializedGroupQuotaSubscriptionRequestStatusList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedGroupQuotaSubscriptionRequestStatusList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaSubscriptionRequestStatusList; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/OperationList.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/OperationList.java deleted file mode 100644 index 94358aba7172..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/OperationList.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.fluent.models.OperationResponseInner; -import java.io.IOException; -import java.util.List; - -/** - * The paginated list of connected cluster API operations. - */ -@Immutable -public final class OperationList implements JsonSerializable { - /* - * The list of connected cluster API operations. - */ - private List value; - - /* - * The link to fetch the next page of connected cluster API operations. - */ - private String nextLink; - - /** - * Creates an instance of OperationList class. - */ - private OperationList() { - } - - /** - * Get the value property: The list of connected cluster API operations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to fetch the next page of connected cluster API operations. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationList 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 OperationList. - */ - public static OperationList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationList deserializedOperationList = new OperationList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> OperationResponseInner.fromJson(reader1)); - deserializedOperationList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedOperationList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationList; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/QuotaAllocationRequestStatusList.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/QuotaAllocationRequestStatusList.java deleted file mode 100644 index 20734f880dd9..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/QuotaAllocationRequestStatusList.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.fluent.models.QuotaAllocationRequestStatusInner; -import java.io.IOException; -import java.util.List; - -/** - * List of QuotaAllocation Request Status. - */ -@Immutable -public final class QuotaAllocationRequestStatusList implements JsonSerializable { - /* - * The QuotaAllocationRequestStatus items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of QuotaAllocationRequestStatusList class. - */ - private QuotaAllocationRequestStatusList() { - } - - /** - * Get the value property: The QuotaAllocationRequestStatus items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QuotaAllocationRequestStatusList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QuotaAllocationRequestStatusList 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 QuotaAllocationRequestStatusList. - */ - public static QuotaAllocationRequestStatusList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QuotaAllocationRequestStatusList deserializedQuotaAllocationRequestStatusList - = new QuotaAllocationRequestStatusList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> QuotaAllocationRequestStatusInner.fromJson(reader1)); - deserializedQuotaAllocationRequestStatusList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedQuotaAllocationRequestStatusList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedQuotaAllocationRequestStatusList; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/QuotaLimits.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/QuotaLimits.java deleted file mode 100644 index 8542a1351f36..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/QuotaLimits.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.fluent.models.CurrentQuotaLimitBaseInner; -import java.io.IOException; -import java.util.List; - -/** - * Quota limits. - */ -@Immutable -public final class QuotaLimits implements JsonSerializable { - /* - * The CurrentQuotaLimitBase items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of QuotaLimits class. - */ - private QuotaLimits() { - } - - /** - * Get the value property: The CurrentQuotaLimitBase items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QuotaLimits from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QuotaLimits 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 QuotaLimits. - */ - public static QuotaLimits fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QuotaLimits deserializedQuotaLimits = new QuotaLimits(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> CurrentQuotaLimitBaseInner.fromJson(reader1)); - deserializedQuotaLimits.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedQuotaLimits.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedQuotaLimits; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/QuotaRequestDetailsList.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/QuotaRequestDetailsList.java deleted file mode 100644 index e6ce7d748e46..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/QuotaRequestDetailsList.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.fluent.models.QuotaRequestDetailsInner; -import java.io.IOException; -import java.util.List; - -/** - * Quota request information. - */ -@Immutable -public final class QuotaRequestDetailsList implements JsonSerializable { - /* - * The QuotaRequestDetails items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of QuotaRequestDetailsList class. - */ - private QuotaRequestDetailsList() { - } - - /** - * Get the value property: The QuotaRequestDetails items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QuotaRequestDetailsList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QuotaRequestDetailsList 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 QuotaRequestDetailsList. - */ - public static QuotaRequestDetailsList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QuotaRequestDetailsList deserializedQuotaRequestDetailsList = new QuotaRequestDetailsList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> QuotaRequestDetailsInner.fromJson(reader1)); - deserializedQuotaRequestDetailsList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedQuotaRequestDetailsList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedQuotaRequestDetailsList; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/ResourceUsageList.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/ResourceUsageList.java deleted file mode 100644 index a548158d9e7c..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/ResourceUsageList.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.fluent.models.ResourceUsagesInner; -import java.io.IOException; -import java.util.List; - -/** - * List of resource usages and quotas for GroupQuota. - */ -@Immutable -public final class ResourceUsageList implements JsonSerializable { - /* - * The ResourceUsages items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of ResourceUsageList class. - */ - private ResourceUsageList() { - } - - /** - * Get the value property: The ResourceUsages items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceUsageList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceUsageList 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 ResourceUsageList. - */ - public static ResourceUsageList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceUsageList deserializedResourceUsageList = new ResourceUsageList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ResourceUsagesInner.fromJson(reader1)); - deserializedResourceUsageList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedResourceUsageList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedResourceUsageList; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/SubmittedResourceRequestStatusList.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/SubmittedResourceRequestStatusList.java deleted file mode 100644 index f665e139cdfe..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/SubmittedResourceRequestStatusList.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.fluent.models.SubmittedResourceRequestStatusInner; -import java.io.IOException; -import java.util.List; - -/** - * Share Quota Entity list. - */ -@Immutable -public final class SubmittedResourceRequestStatusList implements JsonSerializable { - /* - * The SubmittedResourceRequestStatus items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of SubmittedResourceRequestStatusList class. - */ - private SubmittedResourceRequestStatusList() { - } - - /** - * Get the value property: The SubmittedResourceRequestStatus items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SubmittedResourceRequestStatusList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SubmittedResourceRequestStatusList 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 SubmittedResourceRequestStatusList. - */ - public static SubmittedResourceRequestStatusList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SubmittedResourceRequestStatusList deserializedSubmittedResourceRequestStatusList - = new SubmittedResourceRequestStatusList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SubmittedResourceRequestStatusInner.fromJson(reader1)); - deserializedSubmittedResourceRequestStatusList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSubmittedResourceRequestStatusList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSubmittedResourceRequestStatusList; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/UsagesLimits.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/UsagesLimits.java deleted file mode 100644 index 53880328234f..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/UsagesLimits.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.fluent.models.CurrentUsagesBaseInner; -import java.io.IOException; -import java.util.List; - -/** - * Quota limits. - */ -@Immutable -public final class UsagesLimits implements JsonSerializable { - /* - * The CurrentUsagesBase items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of UsagesLimits class. - */ - private UsagesLimits() { - } - - /** - * Get the value property: The CurrentUsagesBase items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of UsagesLimits from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of UsagesLimits 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 UsagesLimits. - */ - public static UsagesLimits fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - UsagesLimits deserializedUsagesLimits = new UsagesLimits(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> CurrentUsagesBaseInner.fromJson(reader1)); - deserializedUsagesLimits.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedUsagesLimits.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedUsagesLimits; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/package-info.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/package-info.java deleted file mode 100644 index 3107977ce570..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// 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 Quota. - * Microsoft Azure Quota Resource Provider. - */ -package com.azure.resourcemanager.quota.implementation; diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/AllocatedQuotaToSubscriptionList.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/AllocatedQuotaToSubscriptionList.java deleted file mode 100644 index d3ce56ff9e54..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/AllocatedQuotaToSubscriptionList.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Quota allocated to subscriptions. - */ -@Immutable -public final class AllocatedQuotaToSubscriptionList implements JsonSerializable { - /* - * List of Group Quota Limit allocated to subscriptions. - */ - private List value; - - /** - * Creates an instance of AllocatedQuotaToSubscriptionList class. - */ - private AllocatedQuotaToSubscriptionList() { - } - - /** - * Get the value property: List of Group Quota Limit allocated to subscriptions. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * {@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 AllocatedQuotaToSubscriptionList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AllocatedQuotaToSubscriptionList 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 AllocatedQuotaToSubscriptionList. - */ - public static AllocatedQuotaToSubscriptionList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AllocatedQuotaToSubscriptionList deserializedAllocatedQuotaToSubscriptionList - = new AllocatedQuotaToSubscriptionList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AllocatedToSubscription.fromJson(reader1)); - deserializedAllocatedQuotaToSubscriptionList.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedAllocatedQuotaToSubscriptionList; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/AllocatedToSubscription.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/AllocatedToSubscription.java deleted file mode 100644 index 1473967d9709..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/AllocatedToSubscription.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * SubscriptionIds and quota allocated to subscriptions from the GroupQuota. - */ -@Immutable -public final class AllocatedToSubscription implements JsonSerializable { - /* - * An Azure subscriptionId. - */ - private String subscriptionId; - - /* - * The amount of quota allocated to this subscriptionId from the GroupQuotasEntity. - */ - private Long quotaAllocated; - - /** - * Creates an instance of AllocatedToSubscription class. - */ - private AllocatedToSubscription() { - } - - /** - * Get the subscriptionId property: An Azure subscriptionId. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Get the quotaAllocated property: The amount of quota allocated to this subscriptionId from the GroupQuotasEntity. - * - * @return the quotaAllocated value. - */ - public Long quotaAllocated() { - return this.quotaAllocated; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("subscriptionId", this.subscriptionId); - jsonWriter.writeNumberField("quotaAllocated", this.quotaAllocated); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AllocatedToSubscription from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AllocatedToSubscription 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 AllocatedToSubscription. - */ - public static AllocatedToSubscription fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AllocatedToSubscription deserializedAllocatedToSubscription = new AllocatedToSubscription(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("subscriptionId".equals(fieldName)) { - deserializedAllocatedToSubscription.subscriptionId = reader.getString(); - } else if ("quotaAllocated".equals(fieldName)) { - deserializedAllocatedToSubscription.quotaAllocated = reader.getNullable(JsonReader::getLong); - } else { - reader.skipChildren(); - } - } - - return deserializedAllocatedToSubscription; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/CurrentQuotaLimitBase.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/CurrentQuotaLimitBase.java deleted file mode 100644 index bbdcd7399b29..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/CurrentQuotaLimitBase.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.quota.fluent.models.CurrentQuotaLimitBaseInner; - -/** - * An immutable client-side representation of CurrentQuotaLimitBase. - */ -public interface CurrentQuotaLimitBase { - /** - * 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: Quota properties for the specified resource, based on the API called, Quotas or - * Usages. - * - * @return the properties value. - */ - QuotaProperties 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.quota.fluent.models.CurrentQuotaLimitBaseInner object. - * - * @return the inner object. - */ - CurrentQuotaLimitBaseInner innerModel(); - - /** - * The entirety of the CurrentQuotaLimitBase definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { - } - - /** - * The CurrentQuotaLimitBase definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the CurrentQuotaLimitBase definition. - */ - interface Blank extends WithScope { - } - - /** - * The stage of the CurrentQuotaLimitBase definition allowing to specify parent resource. - */ - interface WithScope { - /** - * Specifies scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @return the next definition stage. - */ - WithCreate withExistingScope(String scope); - } - - /** - * The stage of the CurrentQuotaLimitBase definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - CurrentQuotaLimitBase create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - CurrentQuotaLimitBase create(Context context); - } - - /** - * The stage of the CurrentQuotaLimitBase definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Quota properties for the specified resource, based on the API called, - * Quotas or Usages.. - * - * @param properties Quota properties for the specified resource, based on the API called, Quotas or Usages. - * @return the next definition stage. - */ - WithCreate withProperties(QuotaProperties properties); - } - } - - /** - * Begins update for the CurrentQuotaLimitBase resource. - * - * @return the stage of resource update. - */ - CurrentQuotaLimitBase.Update update(); - - /** - * The template for CurrentQuotaLimitBase update. - */ - interface Update extends UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - CurrentQuotaLimitBase apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - CurrentQuotaLimitBase apply(Context context); - } - - /** - * The CurrentQuotaLimitBase update stages. - */ - interface UpdateStages { - /** - * The stage of the CurrentQuotaLimitBase update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Quota properties for the specified resource, based on the API called, - * Quotas or Usages.. - * - * @param properties Quota properties for the specified resource, based on the API called, Quotas or Usages. - * @return the next definition stage. - */ - Update withProperties(QuotaProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - CurrentQuotaLimitBase refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - CurrentQuotaLimitBase refresh(Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/CurrentUsagesBase.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/CurrentUsagesBase.java deleted file mode 100644 index 224d79e16a0e..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/CurrentUsagesBase.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.CurrentUsagesBaseInner; - -/** - * An immutable client-side representation of CurrentUsagesBase. - */ -public interface CurrentUsagesBase { - /** - * 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: Usage properties for the specified resource. - * - * @return the properties value. - */ - UsagesProperties 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.quota.fluent.models.CurrentUsagesBaseInner object. - * - * @return the inner object. - */ - CurrentUsagesBaseInner innerModel(); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/EnforcementState.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/EnforcementState.java deleted file mode 100644 index c2c39a2a9e76..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/EnforcementState.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Enforcement status. - */ -public final class EnforcementState extends ExpandableStringEnum { - /** - * Static value Enabled for EnforcementState. - */ - public static final EnforcementState ENABLED = fromString("Enabled"); - - /** - * Static value Disabled for EnforcementState. - */ - public static final EnforcementState DISABLED = fromString("Disabled"); - - /** - * Static value NotAvailable for EnforcementState. - */ - public static final EnforcementState NOT_AVAILABLE = fromString("NotAvailable"); - - /** - * Creates a new instance of EnforcementState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public EnforcementState() { - } - - /** - * Creates or finds a EnforcementState from its string representation. - * - * @param name a name to look for. - * @return the corresponding EnforcementState. - */ - public static EnforcementState fromString(String name) { - return fromString(name, EnforcementState.class); - } - - /** - * Gets known EnforcementState values. - * - * @return known EnforcementState values. - */ - public static Collection values() { - return values(EnforcementState.class); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaDetails.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaDetails.java deleted file mode 100644 index ad19d4bb6ce4..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaDetails.java +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaDetailsName; -import java.io.IOException; - -/** - * Group Quota details. - */ -@Fluent -public class GroupQuotaDetails implements JsonSerializable { - /* - * The resource name, such as SKU name. - */ - private String resourceName; - - /* - * The current Group Quota Limit at the parentId level. - */ - private Long limit; - - /* - * Any comment related to quota request. - */ - private String comment; - - /* - * The usages units, such as Count and Bytes. When requesting quota, use the **unit** value returned in the GET - * response in the request body of your PUT operation. - */ - private String unit; - - /* - * Name of the resource provided by the resource provider. This property is already included in the request URI, so - * it is a readonly property returned in the response. - */ - private GroupQuotaDetailsName innerName; - - /* - * The available Group Quota Limit at the MG level. This Group quota can be allocated to subscription(s). - */ - private Long availableLimit; - - /* - * Quota allocated to subscriptions - */ - private AllocatedQuotaToSubscriptionList allocatedToSubscriptions; - - /** - * Creates an instance of GroupQuotaDetails class. - */ - public GroupQuotaDetails() { - } - - /** - * Get the resourceName property: The resource name, such as SKU name. - * - * @return the resourceName value. - */ - public String resourceName() { - return this.resourceName; - } - - /** - * Set the resourceName property: The resource name, such as SKU name. - * - * @param resourceName the resourceName value to set. - * @return the GroupQuotaDetails object itself. - */ - public GroupQuotaDetails withResourceName(String resourceName) { - this.resourceName = resourceName; - return this; - } - - /** - * Get the limit property: The current Group Quota Limit at the parentId level. - * - * @return the limit value. - */ - public Long limit() { - return this.limit; - } - - /** - * Set the limit property: The current Group Quota Limit at the parentId level. - * - * @param limit the limit value to set. - * @return the GroupQuotaDetails object itself. - */ - public GroupQuotaDetails withLimit(Long limit) { - this.limit = limit; - return this; - } - - /** - * Get the comment property: Any comment related to quota request. - * - * @return the comment value. - */ - public String comment() { - return this.comment; - } - - /** - * Set the comment property: Any comment related to quota request. - * - * @param comment the comment value to set. - * @return the GroupQuotaDetails object itself. - */ - public GroupQuotaDetails withComment(String comment) { - this.comment = comment; - return this; - } - - /** - * Get the unit property: The usages units, such as Count and Bytes. When requesting quota, use the **unit** value - * returned in the GET response in the request body of your PUT operation. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Set the unit property: The usages units, such as Count and Bytes. When requesting quota, use the **unit** value - * returned in the GET response in the request body of your PUT operation. - * - * @param unit the unit value to set. - * @return the GroupQuotaDetails object itself. - */ - GroupQuotaDetails withUnit(String unit) { - this.unit = unit; - return this; - } - - /** - * Get the innerName property: Name of the resource provided by the resource provider. This property is already - * included in the request URI, so it is a readonly property returned in the response. - * - * @return the innerName value. - */ - private GroupQuotaDetailsName innerName() { - return this.innerName; - } - - /** - * Set the innerName property: Name of the resource provided by the resource provider. This property is already - * included in the request URI, so it is a readonly property returned in the response. - * - * @param innerName the innerName value to set. - * @return the GroupQuotaDetails object itself. - */ - GroupQuotaDetails withInnerName(GroupQuotaDetailsName innerName) { - this.innerName = innerName; - return this; - } - - /** - * Get the availableLimit property: The available Group Quota Limit at the MG level. This Group quota can be - * allocated to subscription(s). - * - * @return the availableLimit value. - */ - public Long availableLimit() { - return this.availableLimit; - } - - /** - * Set the availableLimit property: The available Group Quota Limit at the MG level. This Group quota can be - * allocated to subscription(s). - * - * @param availableLimit the availableLimit value to set. - * @return the GroupQuotaDetails object itself. - */ - GroupQuotaDetails withAvailableLimit(Long availableLimit) { - this.availableLimit = availableLimit; - return this; - } - - /** - * Get the allocatedToSubscriptions property: Quota allocated to subscriptions. - * - * @return the allocatedToSubscriptions value. - */ - public AllocatedQuotaToSubscriptionList allocatedToSubscriptions() { - return this.allocatedToSubscriptions; - } - - /** - * Set the allocatedToSubscriptions property: Quota allocated to subscriptions. - * - * @param allocatedToSubscriptions the allocatedToSubscriptions value to set. - * @return the GroupQuotaDetails object itself. - */ - GroupQuotaDetails withAllocatedToSubscriptions(AllocatedQuotaToSubscriptionList allocatedToSubscriptions) { - this.allocatedToSubscriptions = allocatedToSubscriptions; - return this; - } - - /** - * Get the value property: Resource name. - * - * @return the value value. - */ - public String value() { - return this.innerName() == null ? null : this.innerName().value(); - } - - /** - * Get the localizedValue property: Resource display name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.innerName() == null ? null : this.innerName().localizedValue(); - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("resourceName", this.resourceName); - jsonWriter.writeNumberField("limit", this.limit); - jsonWriter.writeStringField("comment", this.comment); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotaDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaDetails 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 GroupQuotaDetails. - */ - public static GroupQuotaDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaDetails deserializedGroupQuotaDetails = new GroupQuotaDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceName".equals(fieldName)) { - deserializedGroupQuotaDetails.resourceName = reader.getString(); - } else if ("limit".equals(fieldName)) { - deserializedGroupQuotaDetails.limit = reader.getNullable(JsonReader::getLong); - } else if ("comment".equals(fieldName)) { - deserializedGroupQuotaDetails.comment = reader.getString(); - } else if ("unit".equals(fieldName)) { - deserializedGroupQuotaDetails.unit = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGroupQuotaDetails.innerName = GroupQuotaDetailsName.fromJson(reader); - } else if ("availableLimit".equals(fieldName)) { - deserializedGroupQuotaDetails.availableLimit = reader.getNullable(JsonReader::getLong); - } else if ("allocatedToSubscriptions".equals(fieldName)) { - deserializedGroupQuotaDetails.allocatedToSubscriptions - = AllocatedQuotaToSubscriptionList.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaDetails; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimit.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimit.java deleted file mode 100644 index 881d968c5dae..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimit.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Group Quota limit. - */ -@Fluent -public final class GroupQuotaLimit implements JsonSerializable { - /* - * Group Quota properties for the specified resource. - */ - private GroupQuotaLimitProperties properties; - - /** - * Creates an instance of GroupQuotaLimit class. - */ - public GroupQuotaLimit() { - } - - /** - * Get the properties property: Group Quota properties for the specified resource. - * - * @return the properties value. - */ - public GroupQuotaLimitProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Group Quota properties for the specified resource. - * - * @param properties the properties value to set. - * @return the GroupQuotaLimit object itself. - */ - public GroupQuotaLimit withProperties(GroupQuotaLimitProperties properties) { - this.properties = properties; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotaLimit from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaLimit 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 GroupQuotaLimit. - */ - public static GroupQuotaLimit fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaLimit deserializedGroupQuotaLimit = new GroupQuotaLimit(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedGroupQuotaLimit.properties = GroupQuotaLimitProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaLimit; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitList.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitList.java deleted file mode 100644 index 03952b0f2c09..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitList.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitListInner; - -/** - * An immutable client-side representation of GroupQuotaLimitList. - */ -public interface GroupQuotaLimitList { - /** - * 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: The properties property. - * - * @return the properties value. - */ - GroupQuotaLimitListProperties 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.quota.fluent.models.GroupQuotaLimitListInner object. - * - * @return the inner object. - */ - GroupQuotaLimitListInner innerModel(); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitListProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitListProperties.java deleted file mode 100644 index 4d450de940e9..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitListProperties.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The GroupQuotaLimitListProperties model. - */ -@Fluent -public final class GroupQuotaLimitListProperties implements JsonSerializable { - /* - * Request status. - */ - private RequestState provisioningState; - - /* - * List of Group Quota Limit details. - */ - private List value; - - /* - * The URL to use for getting the next set of results. - */ - private String nextLink; - - /** - * Creates an instance of GroupQuotaLimitListProperties class. - */ - public GroupQuotaLimitListProperties() { - } - - /** - * Get the provisioningState property: Request status. - * - * @return the provisioningState value. - */ - public RequestState provisioningState() { - return this.provisioningState; - } - - /** - * Get the value property: List of Group Quota Limit details. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of Group Quota Limit details. - * - * @param value the value value to set. - * @return the GroupQuotaLimitListProperties object itself. - */ - public GroupQuotaLimitListProperties 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; - } - - /** - * {@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 GroupQuotaLimitListProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaLimitListProperties 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 GroupQuotaLimitListProperties. - */ - public static GroupQuotaLimitListProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaLimitListProperties deserializedGroupQuotaLimitListProperties - = new GroupQuotaLimitListProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningState".equals(fieldName)) { - deserializedGroupQuotaLimitListProperties.provisioningState - = RequestState.fromString(reader.getString()); - } else if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> GroupQuotaLimit.fromJson(reader1)); - deserializedGroupQuotaLimitListProperties.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedGroupQuotaLimitListProperties.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaLimitListProperties; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitProperties.java deleted file mode 100644 index 53f8825bb192..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitProperties.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaDetailsName; -import java.io.IOException; - -/** - * Group Quota properties for the specified resource. - */ -@Fluent -public final class GroupQuotaLimitProperties extends GroupQuotaDetails { - /* - * Quota allocated to subscriptions - */ - private AllocatedQuotaToSubscriptionList allocatedToSubscriptions; - - /* - * The available Group Quota Limit at the MG level. This Group quota can be allocated to subscription(s). - */ - private Long availableLimit; - - /* - * Name of the resource provided by the resource provider. This property is already included in the request URI, so - * it is a readonly property returned in the response. - */ - private GroupQuotaDetailsName innerName; - - /* - * The usages units, such as Count and Bytes. When requesting quota, use the **unit** value returned in the GET - * response in the request body of your PUT operation. - */ - private String unit; - - /** - * Creates an instance of GroupQuotaLimitProperties class. - */ - public GroupQuotaLimitProperties() { - } - - /** - * Get the allocatedToSubscriptions property: Quota allocated to subscriptions. - * - * @return the allocatedToSubscriptions value. - */ - @Override - public AllocatedQuotaToSubscriptionList allocatedToSubscriptions() { - return this.allocatedToSubscriptions; - } - - /** - * Get the availableLimit property: The available Group Quota Limit at the MG level. This Group quota can be - * allocated to subscription(s). - * - * @return the availableLimit value. - */ - @Override - public Long availableLimit() { - return this.availableLimit; - } - - /** - * Get the innerName property: Name of the resource provided by the resource provider. This property is already - * included in the request URI, so it is a readonly property returned in the response. - * - * @return the innerName value. - */ - private GroupQuotaDetailsName innerName() { - return this.innerName; - } - - /** - * Get the unit property: The usages units, such as Count and Bytes. When requesting quota, use the **unit** value - * returned in the GET response in the request body of your PUT operation. - * - * @return the unit value. - */ - @Override - public String unit() { - return this.unit; - } - - /** - * {@inheritDoc} - */ - @Override - public GroupQuotaLimitProperties withResourceName(String resourceName) { - super.withResourceName(resourceName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GroupQuotaLimitProperties withLimit(Long limit) { - super.withLimit(limit); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GroupQuotaLimitProperties withComment(String comment) { - super.withComment(comment); - return this; - } - - /** - * Get the value property: Resource name. - * - * @return the value value. - */ - public String value() { - return this.innerName() == null ? null : this.innerName().value(); - } - - /** - * Get the localizedValue property: Resource display name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.innerName() == null ? null : this.innerName().localizedValue(); - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("resourceName", resourceName()); - jsonWriter.writeNumberField("limit", limit()); - jsonWriter.writeStringField("comment", comment()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotaLimitProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaLimitProperties 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 GroupQuotaLimitProperties. - */ - public static GroupQuotaLimitProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaLimitProperties deserializedGroupQuotaLimitProperties = new GroupQuotaLimitProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceName".equals(fieldName)) { - deserializedGroupQuotaLimitProperties.withResourceName(reader.getString()); - } else if ("limit".equals(fieldName)) { - deserializedGroupQuotaLimitProperties.withLimit(reader.getNullable(JsonReader::getLong)); - } else if ("comment".equals(fieldName)) { - deserializedGroupQuotaLimitProperties.withComment(reader.getString()); - } else if ("unit".equals(fieldName)) { - deserializedGroupQuotaLimitProperties.unit = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGroupQuotaLimitProperties.innerName = GroupQuotaDetailsName.fromJson(reader); - } else if ("availableLimit".equals(fieldName)) { - deserializedGroupQuotaLimitProperties.availableLimit = reader.getNullable(JsonReader::getLong); - } else if ("allocatedToSubscriptions".equals(fieldName)) { - deserializedGroupQuotaLimitProperties.allocatedToSubscriptions - = AllocatedQuotaToSubscriptionList.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaLimitProperties; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimits.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimits.java deleted file mode 100644 index 070f4b47db3c..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimits.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of GroupQuotaLimits. - */ -public interface GroupQuotaLimits { - /** - * Gets the GroupQuotaLimits for the specified resource provider and location for resource names passed in - * $filter=resourceName eq {SKU}. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @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 GroupQuotaLimits for the specified resource provider and location for resource names passed in - * $filter=resourceName eq {SKU} along with {@link Response}. - */ - Response listWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context); - - /** - * Gets the GroupQuotaLimits for the specified resource provider and location for resource names passed in - * $filter=resourceName eq {SKU}. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotaLimits for the specified resource provider and location for resource names passed in - * $filter=resourceName eq {SKU}. - */ - GroupQuotaLimitList list(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitsRequests.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitsRequests.java deleted file mode 100644 index 1558f744f32b..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLimitsRequests.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaLimitListInner; - -/** - * Resource collection API of GroupQuotaLimitsRequests. - */ -public interface GroupQuotaLimitsRequests { - /** - * Get API to check the status of a GroupQuota request by requestId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators \r\n|---------------------|------------------------\n\r\n location eq - * {location} and resource eq {resourceName}\n Example: $filter=location eq eastus and resourceName eq cores. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return aPI to check the status of a GroupQuota request by requestId as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter); - - /** - * Get API to check the status of a GroupQuota request by requestId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators \r\n|---------------------|------------------------\n\r\n location eq - * {location} and resource eq {resourceName}\n Example: $filter=location eq eastus and resourceName eq cores. - * @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 aPI to check the status of a GroupQuota request by requestId as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter, Context context); - - /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are - * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a - * new groupQuota request. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Group Quota Limit details. - */ - GroupQuotaLimitList update(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location); - - /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName properties are - * specified in the request body. Only 1 resource quota can be requested. Please note that patch request creates a - * new groupQuota request. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with retry-after - * duration in seconds to check the intermediate status. This API provides the finals status with the request - * details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param groupQuotaRequest The GroupQuotaRequest body details for specific resourceProvider/location/resources. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Group Quota Limit details. - */ - GroupQuotaLimitList update(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location, GroupQuotaLimitListInner groupQuotaRequest, Context context); - - /** - * Get API to check the status of a GroupQuota request by requestId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param requestId Request 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 aPI to check the status of a GroupQuota request by requestId along with {@link Response}. - */ - Response getWithResponse(String managementGroupId, String groupQuotaName, - String requestId, Context context); - - /** - * Get API to check the status of a GroupQuota request by requestId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param requestId Request 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 aPI to check the status of a GroupQuota request by requestId. - */ - SubmittedResourceRequestStatus get(String managementGroupId, String groupQuotaName, String requestId); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLocationSettings.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLocationSettings.java deleted file mode 100644 index fd8eb3e41a33..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaLocationSettings.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEnforcementStatusInner; - -/** - * Resource collection API of GroupQuotaLocationSettings. - */ -public interface GroupQuotaLocationSettings { - /** - * Gets the GroupQuotas enforcement settings for the ResourceProvider/location. The locations, where GroupQuota - * enforcement is not enabled will return Not Found. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @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 GroupQuotas enforcement settings for the ResourceProvider/location along with {@link Response}. - */ - Response getWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context); - - /** - * Gets the GroupQuotas enforcement settings for the ResourceProvider/location. The locations, where GroupQuota - * enforcement is not enabled will return Not Found. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas enforcement settings for the ResourceProvider/location. - */ - GroupQuotasEnforcementStatus get(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location); - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Then delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region. - */ - GroupQuotasEnforcementStatus createOrUpdate(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location); - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Then delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @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 GroupQuota Enforcement status for a Azure Location/Region. - */ - GroupQuotasEnforcementStatus createOrUpdate(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, GroupQuotasEnforcementStatusInner locationSettings, - Context context); - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuota Enforcement status for a Azure Location/Region. - */ - GroupQuotasEnforcementStatus update(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location); - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The resource provider - * will start using the group quotas as the overall quota for the subscriptions included in the GroupQuota. The - * subscriptions cannot request quota at subscription level since it is now part of an enforced group. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is used, then - * submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable GroupQuota - * Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check the example - - * GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param locationSettings The GroupQuota body details for creation or update of a GroupQuota entity. - * @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 GroupQuota Enforcement status for a Azure Location/Region. - */ - GroupQuotasEnforcementStatus update(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location, GroupQuotasEnforcementStatusInner locationSettings, Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaRequestBase.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaRequestBase.java deleted file mode 100644 index 2ab72ebc076d..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaRequestBase.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaRequestBaseProperties; -import java.io.IOException; - -/** - * The new GroupQuota limit requested. - */ -@Immutable -public final class GroupQuotaRequestBase implements JsonSerializable { - /* - * The properties property. - */ - private GroupQuotaRequestBaseProperties innerProperties; - - /** - * Creates an instance of GroupQuotaRequestBase class. - */ - private GroupQuotaRequestBase() { - } - - /** - * Get the innerProperties property: The properties property. - * - * @return the innerProperties value. - */ - private GroupQuotaRequestBaseProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the limit property: The new quota limit for the subscription. The incremental quota will be allocated from - * pre-approved group quota. - * - * @return the limit value. - */ - public Long limit() { - return this.innerProperties() == null ? null : this.innerProperties().limit(); - } - - /** - * Get the region property: Location/Azure region for the quota requested for resource. - * - * @return the region value. - */ - public String region() { - return this.innerProperties() == null ? null : this.innerProperties().region(); - } - - /** - * Get the comments property: GroupQuota Request comments and details for request. This is optional paramter to - * provide more details related to the requested resource. - * - * @return the comments value. - */ - public String comments() { - return this.innerProperties() == null ? null : this.innerProperties().comments(); - } - - /** - * Get the value property: Resource name. - * - * @return the value value. - */ - public String value() { - return this.innerProperties() == null ? null : this.innerProperties().value(); - } - - /** - * Get the localizedValue property: Resource display name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.innerProperties() == null ? null : this.innerProperties().localizedValue(); - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotaRequestBase from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaRequestBase 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 GroupQuotaRequestBase. - */ - public static GroupQuotaRequestBase fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaRequestBase deserializedGroupQuotaRequestBase = new GroupQuotaRequestBase(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedGroupQuotaRequestBase.innerProperties - = GroupQuotaRequestBaseProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaRequestBase; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionAllocationRequests.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionAllocationRequests.java deleted file mode 100644 index 29d1416384bf..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionAllocationRequests.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsListInner; - -/** - * Resource collection API of GroupQuotaSubscriptionAllocationRequests. - */ -public interface GroupQuotaSubscriptionAllocationRequests { - /** - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param allocateQuotaRequest Quota requests payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 quota list. - */ - SubscriptionQuotaAllocationsList update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest); - - /** - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to subscriptions or - * reduce the quota allocated to subscription to give back the unused quota ( quota >= usages) to the groupQuota. - * So, this API can be used to assign Quota to subscriptions and assign back unused quota to group quota, which can - * be assigned to another subscriptions in the GroupQuota. User can collect unused quotas from multiple - * subscriptions within the groupQuota and assign the groupQuota to the subscription, where it's needed. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @param allocateQuotaRequest Quota requests payload. - * @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 quota list. - */ - SubscriptionQuotaAllocationsList update(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, SubscriptionQuotaAllocationsListInner allocateQuotaRequest, - Context context); - - /** - * Get the quota allocation request status for the subscriptionId by allocationId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param allocationId Request 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 quota allocation request status for the subscriptionId by allocationId along with {@link Response}. - */ - Response getWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String allocationId, Context context); - - /** - * Get the quota allocation request status for the subscriptionId by allocationId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param allocationId Request 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 quota allocation request status for the subscriptionId by allocationId. - */ - QuotaAllocationRequestStatus get(String managementGroupId, String groupQuotaName, String resourceProviderName, - String allocationId); - - /** - * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is - * required. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 quotaAllocationRequests for a resourceProvider/location as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter); - - /** - * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for location is - * required. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus. - * @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 the quotaAllocationRequests for a resourceProvider/location as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String managementGroupId, String groupQuotaName, - String resourceProviderName, String filter, Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionAllocations.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionAllocations.java deleted file mode 100644 index db14e511970a..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionAllocations.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of GroupQuotaSubscriptionAllocations. - */ -public interface GroupQuotaSubscriptionAllocations { - /** - * Gets all the quota allocated to a subscription for the specified resource provider and location for resource - * names passed in $filter=resourceName eq {SKU}. This will include the GroupQuota and total quota allocated to the - * subscription. Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @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 the quota allocated to a subscription for the specified resource provider and location for resource - * names passed in $filter=resourceName eq {SKU} along with {@link Response}. - */ - Response listWithResponse(String managementGroupId, String groupQuotaName, - String resourceProviderName, String location, Context context); - - /** - * Gets all the quota allocated to a subscription for the specified resource provider and location for resource - * names passed in $filter=resourceName eq {SKU}. This will include the GroupQuota and total quota allocated to the - * subscription. Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 quota allocated to a subscription for the specified resource provider and location for resource - * names passed in $filter=resourceName eq {SKU}. - */ - SubscriptionQuotaAllocationsList list(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionId.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionId.java deleted file mode 100644 index 5e2dbec6755a..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionId.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaSubscriptionIdInner; - -/** - * An immutable client-side representation of GroupQuotaSubscriptionId. - */ -public interface GroupQuotaSubscriptionId { - /** - * 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: The properties property. - * - * @return the properties value. - */ - GroupQuotaSubscriptionIdProperties 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.quota.fluent.models.GroupQuotaSubscriptionIdInner object. - * - * @return the inner object. - */ - GroupQuotaSubscriptionIdInner innerModel(); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionIdProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionIdProperties.java deleted file mode 100644 index 7a1f4905e592..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionIdProperties.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The GroupQuotaSubscriptionIdProperties model. - */ -@Immutable -public final class GroupQuotaSubscriptionIdProperties implements JsonSerializable { - /* - * An Azure subscriptionId. - */ - private String subscriptionId; - - /* - * Status of this subscriptionId being associated with the GroupQuotasEntity. - */ - private RequestState provisioningState; - - /** - * Creates an instance of GroupQuotaSubscriptionIdProperties class. - */ - private GroupQuotaSubscriptionIdProperties() { - } - - /** - * Get the subscriptionId property: An Azure subscriptionId. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Get the provisioningState property: Status of this subscriptionId being associated with the GroupQuotasEntity. - * - * @return the provisioningState value. - */ - public RequestState provisioningState() { - return this.provisioningState; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("subscriptionId", this.subscriptionId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotaSubscriptionIdProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaSubscriptionIdProperties 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 GroupQuotaSubscriptionIdProperties. - */ - public static GroupQuotaSubscriptionIdProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaSubscriptionIdProperties deserializedGroupQuotaSubscriptionIdProperties - = new GroupQuotaSubscriptionIdProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("subscriptionId".equals(fieldName)) { - deserializedGroupQuotaSubscriptionIdProperties.subscriptionId = reader.getString(); - } else if ("provisioningState".equals(fieldName)) { - deserializedGroupQuotaSubscriptionIdProperties.provisioningState - = RequestState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaSubscriptionIdProperties; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionRequestStatus.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionRequestStatus.java deleted file mode 100644 index a41287e258b3..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionRequestStatus.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaSubscriptionRequestStatusInner; - -/** - * An immutable client-side representation of GroupQuotaSubscriptionRequestStatus. - */ -public interface GroupQuotaSubscriptionRequestStatus { - /** - * 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: The properties property. - * - * @return the properties value. - */ - GroupQuotaSubscriptionRequestStatusProperties 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.quota.fluent.models.GroupQuotaSubscriptionRequestStatusInner object. - * - * @return the inner object. - */ - GroupQuotaSubscriptionRequestStatusInner innerModel(); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionRequestStatusProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionRequestStatusProperties.java deleted file mode 100644 index c292821e99f6..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionRequestStatusProperties.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * The GroupQuotaSubscriptionRequestStatusProperties model. - */ -@Immutable -public final class GroupQuotaSubscriptionRequestStatusProperties - implements JsonSerializable { - /* - * The subscription Id - */ - private String subscriptionId; - - /* - * The request submission time. The date conforms to the following format specified by the ISO 8601 standard: - * yyyy-MM-ddTHH:mm:ssZ - */ - private OffsetDateTime requestSubmitTime; - - /* - * Status of this subscriptionId being associated with the GroupQuotasEntity. - */ - private RequestState provisioningState; - - /** - * Creates an instance of GroupQuotaSubscriptionRequestStatusProperties class. - */ - private GroupQuotaSubscriptionRequestStatusProperties() { - } - - /** - * Get the subscriptionId property: The subscription Id. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Get the requestSubmitTime property: The request submission time. The date conforms to the following format - * specified by the ISO 8601 standard: yyyy-MM-ddTHH:mm:ssZ. - * - * @return the requestSubmitTime value. - */ - public OffsetDateTime requestSubmitTime() { - return this.requestSubmitTime; - } - - /** - * Get the provisioningState property: Status of this subscriptionId being associated with the GroupQuotasEntity. - * - * @return the provisioningState value. - */ - public RequestState provisioningState() { - return this.provisioningState; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("subscriptionId", this.subscriptionId); - jsonWriter.writeStringField("requestSubmitTime", - this.requestSubmitTime == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.requestSubmitTime)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotaSubscriptionRequestStatusProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaSubscriptionRequestStatusProperties 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 GroupQuotaSubscriptionRequestStatusProperties. - */ - public static GroupQuotaSubscriptionRequestStatusProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaSubscriptionRequestStatusProperties deserializedGroupQuotaSubscriptionRequestStatusProperties - = new GroupQuotaSubscriptionRequestStatusProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("subscriptionId".equals(fieldName)) { - deserializedGroupQuotaSubscriptionRequestStatusProperties.subscriptionId = reader.getString(); - } else if ("requestSubmitTime".equals(fieldName)) { - deserializedGroupQuotaSubscriptionRequestStatusProperties.requestSubmitTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("provisioningState".equals(fieldName)) { - deserializedGroupQuotaSubscriptionRequestStatusProperties.provisioningState - = RequestState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaSubscriptionRequestStatusProperties; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionRequests.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionRequests.java deleted file mode 100644 index f41936ab39f9..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptionRequests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of GroupQuotaSubscriptionRequests. - */ -public interface GroupQuotaSubscriptionRequests { - /** - * Get API to check the status of a subscriptionIds request by requestId. Use the polling API - OperationsStatus URI - * specified in Azure-AsyncOperation header field, with retry-after duration in seconds to check the intermediate - * status. This API provides the finals status with the request details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param requestId Request 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 aPI to check the status of a subscriptionIds request by requestId along with {@link Response}. - */ - Response getWithResponse(String managementGroupId, String groupQuotaName, - String requestId, Context context); - - /** - * Get API to check the status of a subscriptionIds request by requestId. Use the polling API - OperationsStatus URI - * specified in Azure-AsyncOperation header field, with retry-after duration in seconds to check the intermediate - * status. This API provides the finals status with the request details and status. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param requestId Request 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 aPI to check the status of a subscriptionIds request by requestId. - */ - GroupQuotaSubscriptionRequestStatus get(String managementGroupId, String groupQuotaName, String requestId); - - /** - * List API to check the status of a subscriptionId requests by requestId. Request history is maintained for 1 year. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionRequests Status as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String managementGroupId, String groupQuotaName); - - /** - * List API to check the status of a subscriptionId requests by requestId. Request history is maintained for 1 year. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionRequests Status as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String managementGroupId, String groupQuotaName, - Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptions.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptions.java deleted file mode 100644 index b58bc10dc877..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaSubscriptions.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of GroupQuotaSubscriptions. - */ -public interface GroupQuotaSubscriptions { - /** - * Returns the subscriptionIds along with its provisioning state for being associated with the GroupQuota. If the - * subscription is not a member of GroupQuota, it will return 404, else 200. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @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 this represents a Azure subscriptionId that is associated with a GroupQuotasEntity along with - * {@link Response}. - */ - Response getWithResponse(String managementGroupId, String groupQuotaName, - Context context); - - /** - * Returns the subscriptionIds along with its provisioning state for being associated with the GroupQuota. If the - * subscription is not a member of GroupQuota, it will return 404, else 200. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity. - */ - GroupQuotaSubscriptionId get(String managementGroupId, String groupQuotaName); - - /** - * Adds a subscription to GroupQuotas. The subscriptions will be validated based on the additionalAttributes defined - * in the GroupQuota. The additionalAttributes works as filter for the subscriptions, which can be included in the - * GroupQuotas. The request's TenantId is validated against the subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity. - */ - GroupQuotaSubscriptionId createOrUpdate(String managementGroupId, String groupQuotaName); - - /** - * Adds a subscription to GroupQuotas. The subscriptions will be validated based on the additionalAttributes defined - * in the GroupQuota. The additionalAttributes works as filter for the subscriptions, which can be included in the - * GroupQuotas. The request's TenantId is validated against the subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @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 this represents a Azure subscriptionId that is associated with a GroupQuotasEntity. - */ - GroupQuotaSubscriptionId createOrUpdate(String managementGroupId, String groupQuotaName, Context context); - - /** - * Updates the GroupQuotas with the subscription to add to the subscriptions list. The subscriptions will be - * validated if additionalAttributes are defined in the GroupQuota. The request's TenantId is validated against the - * subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return this represents a Azure subscriptionId that is associated with a GroupQuotasEntity. - */ - GroupQuotaSubscriptionId update(String managementGroupId, String groupQuotaName); - - /** - * Updates the GroupQuotas with the subscription to add to the subscriptions list. The subscriptions will be - * validated if additionalAttributes are defined in the GroupQuota. The request's TenantId is validated against the - * subscription's TenantId. - * - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @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 this represents a Azure subscriptionId that is associated with a GroupQuotasEntity. - */ - GroupQuotaSubscriptionId update(String managementGroupId, String groupQuotaName, Context context); - - /** - * Removes the subscription from GroupQuotas. The request's TenantId is validated against the subscription's - * TenantId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 deleteByResourceGroup(String managementGroupId, String groupQuotaName); - - /** - * Removes the subscription from GroupQuotas. The request's TenantId is validated against the subscription's - * TenantId. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @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 managementGroupId, String groupQuotaName, Context context); - - /** - * Returns a list of the subscriptionIds associated with the GroupQuotas. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionIds as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String managementGroupId, String groupQuotaName); - - /** - * Returns a list of the subscriptionIds associated with the GroupQuotas. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of GroupQuotaSubscriptionIds as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String managementGroupId, String groupQuotaName, Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaUsages.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaUsages.java deleted file mode 100644 index 1b324d6aa2ea..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaUsages.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of GroupQuotaUsages. - */ -public interface GroupQuotaUsages { - /** - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas usages and limits(quota) as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location); - - /** - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param location The name of the Azure region. - * @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 GroupQuotas usages and limits(quota) as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String managementGroupId, String groupQuotaName, String resourceProviderName, - String location, Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaUsagesBase.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaUsagesBase.java deleted file mode 100644 index c1fea0350fc0..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotaUsagesBase.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotaUsagesBaseName; -import java.io.IOException; - -/** - * Resource details with usages and GroupQuota. - */ -@Immutable -public final class GroupQuotaUsagesBase implements JsonSerializable { - /* - * Name of the resource provided by the resource provider. This property is already included in the request URI, so - * it is a readonly property returned in the response. - */ - private GroupQuotaUsagesBaseName innerName; - - /* - * Quota/limits for the resource. - */ - private Long limit; - - /* - * Usages for the resource. - */ - private Long usages; - - /* - * Representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, Percent, CountPerSecond, - * BytesPerSecond. Based on - https://armwiki.azurewebsites.net/api_contracts/UsagesAPIContract.html?q=usages . - * Different RPs may have different units, Count, type as int64 should work for most of the integer values. - */ - private String unit; - - /** - * Creates an instance of GroupQuotaUsagesBase class. - */ - private GroupQuotaUsagesBase() { - } - - /** - * Get the innerName property: Name of the resource provided by the resource provider. This property is already - * included in the request URI, so it is a readonly property returned in the response. - * - * @return the innerName value. - */ - private GroupQuotaUsagesBaseName innerName() { - return this.innerName; - } - - /** - * Get the limit property: Quota/limits for the resource. - * - * @return the limit value. - */ - public Long limit() { - return this.limit; - } - - /** - * Get the usages property: Usages for the resource. - * - * @return the usages value. - */ - public Long usages() { - return this.usages; - } - - /** - * Get the unit property: Representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, - * Percent, CountPerSecond, BytesPerSecond. Based on - - * https://armwiki.azurewebsites.net/api_contracts/UsagesAPIContract.html?q=usages . Different RPs may have - * different units, Count, type as int64 should work for most of the integer values. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Get the value property: Resource name. - * - * @return the value value. - */ - public String value() { - return this.innerName() == null ? null : this.innerName().value(); - } - - /** - * Get the localizedValue property: Resource display name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.innerName() == null ? null : this.innerName().localizedValue(); - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("name", this.innerName); - jsonWriter.writeNumberField("limit", this.limit); - jsonWriter.writeNumberField("usages", this.usages); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotaUsagesBase from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotaUsagesBase 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 GroupQuotaUsagesBase. - */ - public static GroupQuotaUsagesBase fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotaUsagesBase deserializedGroupQuotaUsagesBase = new GroupQuotaUsagesBase(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedGroupQuotaUsagesBase.innerName = GroupQuotaUsagesBaseName.fromJson(reader); - } else if ("limit".equals(fieldName)) { - deserializedGroupQuotaUsagesBase.limit = reader.getNullable(JsonReader::getLong); - } else if ("usages".equals(fieldName)) { - deserializedGroupQuotaUsagesBase.usages = reader.getNullable(JsonReader::getLong); - } else if ("unit".equals(fieldName)) { - deserializedGroupQuotaUsagesBase.unit = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotaUsagesBase; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotas.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotas.java deleted file mode 100644 index fde49db58c08..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotas.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEntityInner; - -/** - * Resource collection API of GroupQuotas. - */ -public interface GroupQuotas { - /** - * Gets the GroupQuotas for the name passed. It will return the GroupQuotas properties only. The details on group - * quota can be access from the group quota APIs. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @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 GroupQuotas for the name passed along with {@link Response}. - */ - Response getWithResponse(String managementGroupId, String groupQuotaName, Context context); - - /** - * Gets the GroupQuotas for the name passed. It will return the GroupQuotas properties only. The details on group - * quota can be access from the group quota APIs. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the GroupQuotas for the name passed. - */ - GroupQuotasEntity get(String managementGroupId, String groupQuotaName); - - /** - * Creates a new GroupQuota for the name passed. A RequestId will be returned by the Service. The status can be - * polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties and filters for ShareQuota. - */ - GroupQuotasEntity createOrUpdate(String managementGroupId, String groupQuotaName); - - /** - * Creates a new GroupQuota for the name passed. A RequestId will be returned by the Service. The status can be - * polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotaPutRequestBody The GroupQuota body details for creation or update of a GroupQuota entity. - * @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 properties and filters for ShareQuota. - */ - GroupQuotasEntity createOrUpdate(String managementGroupId, String groupQuotaName, - GroupQuotasEntityInner groupQuotaPutRequestBody, Context context); - - /** - * Updates the GroupQuotas for the name passed. A GroupQuotas RequestId will be returned by the Service. The status - * can be polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * Any change in the filters will be applicable to the future quota assignments, existing quota allocated to - * subscriptions from the GroupQuotas remains unchanged. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties and filters for ShareQuota. - */ - GroupQuotasEntity update(String managementGroupId, String groupQuotaName); - - /** - * Updates the GroupQuotas for the name passed. A GroupQuotas RequestId will be returned by the Service. The status - * can be polled periodically. The status Async polling is using standards defined at - - * https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/async-api-reference.md#asynchronous-operations. - * Use the OperationsStatus URI provided in Azure-AsyncOperation header, the duration will be specified in - * retry-after header. Once the operation gets to terminal state - Succeeded | Failed, then the URI will change to - * Get URI and full details can be checked. - * Any change in the filters will be applicable to the future quota assignments, existing quota allocated to - * subscriptions from the GroupQuotas remains unchanged. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @param groupQuotasPatchRequestBody The GroupQuotas Patch Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return properties and filters for ShareQuota. - */ - GroupQuotasEntity update(String managementGroupId, String groupQuotaName, - GroupQuotasEntityPatch groupQuotasPatchRequestBody, Context context); - - /** - * Deletes the GroupQuotas for the name passed. All the remaining shareQuota in the GroupQuotas will be lost. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 deleteByResourceGroup(String managementGroupId, String groupQuotaName); - - /** - * Deletes the GroupQuotas for the name passed. All the remaining shareQuota in the GroupQuotas will be lost. - * - * @param managementGroupId The management group ID. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context tenantId/MgId. - * @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 managementGroupId, String groupQuotaName, Context context); - - /** - * Lists GroupQuotas for the scope passed. It will return the GroupQuotas QuotaEntity properties only.The details on - * group quota can be access from the group quota APIs. - * - * @param managementGroupId The management group 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 list of Group Quotas at MG level as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String managementGroupId); - - /** - * Lists GroupQuotas for the scope passed. It will return the GroupQuotas QuotaEntity properties only.The details on - * group quota can be access from the group quota APIs. - * - * @param managementGroupId The management group 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 list of Group Quotas at MG level as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String managementGroupId, Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEnforcementStatus.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEnforcementStatus.java deleted file mode 100644 index 0327f40571e6..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEnforcementStatus.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEnforcementStatusInner; - -/** - * An immutable client-side representation of GroupQuotasEnforcementStatus. - */ -public interface GroupQuotasEnforcementStatus { - /** - * 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: The properties property. - * - * @return the properties value. - */ - GroupQuotasEnforcementStatusProperties 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.quota.fluent.models.GroupQuotasEnforcementStatusInner object. - * - * @return the inner object. - */ - GroupQuotasEnforcementStatusInner innerModel(); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEnforcementStatusProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEnforcementStatusProperties.java deleted file mode 100644 index 8a5be7201314..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEnforcementStatusProperties.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The GroupQuotasEnforcementStatusProperties model. - */ -@Fluent -public final class GroupQuotasEnforcementStatusProperties - implements JsonSerializable { - /* - * Is the GroupQuota Enforcement enabled for the Azure region. - */ - private EnforcementState enforcementEnabled; - - /* - * The name of the group that is enforced. - */ - private String enforcedGroupName; - - /* - * Request status. - */ - private RequestState provisioningState; - - /* - * Details of the failure. - */ - private String faultCode; - - /** - * Creates an instance of GroupQuotasEnforcementStatusProperties class. - */ - public GroupQuotasEnforcementStatusProperties() { - } - - /** - * Get the enforcementEnabled property: Is the GroupQuota Enforcement enabled for the Azure region. - * - * @return the enforcementEnabled value. - */ - public EnforcementState enforcementEnabled() { - return this.enforcementEnabled; - } - - /** - * Set the enforcementEnabled property: Is the GroupQuota Enforcement enabled for the Azure region. - * - * @param enforcementEnabled the enforcementEnabled value to set. - * @return the GroupQuotasEnforcementStatusProperties object itself. - */ - public GroupQuotasEnforcementStatusProperties withEnforcementEnabled(EnforcementState enforcementEnabled) { - this.enforcementEnabled = enforcementEnabled; - return this; - } - - /** - * Get the enforcedGroupName property: The name of the group that is enforced. - * - * @return the enforcedGroupName value. - */ - public String enforcedGroupName() { - return this.enforcedGroupName; - } - - /** - * Get the provisioningState property: Request status. - * - * @return the provisioningState value. - */ - public RequestState provisioningState() { - return this.provisioningState; - } - - /** - * Get the faultCode property: Details of the failure. - * - * @return the faultCode value. - */ - public String faultCode() { - return this.faultCode; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("enforcementEnabled", - this.enforcementEnabled == null ? null : this.enforcementEnabled.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotasEnforcementStatusProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotasEnforcementStatusProperties 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 GroupQuotasEnforcementStatusProperties. - */ - public static GroupQuotasEnforcementStatusProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotasEnforcementStatusProperties deserializedGroupQuotasEnforcementStatusProperties - = new GroupQuotasEnforcementStatusProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enforcementEnabled".equals(fieldName)) { - deserializedGroupQuotasEnforcementStatusProperties.enforcementEnabled - = EnforcementState.fromString(reader.getString()); - } else if ("enforcedGroupName".equals(fieldName)) { - deserializedGroupQuotasEnforcementStatusProperties.enforcedGroupName = reader.getString(); - } else if ("provisioningState".equals(fieldName)) { - deserializedGroupQuotasEnforcementStatusProperties.provisioningState - = RequestState.fromString(reader.getString()); - } else if ("faultCode".equals(fieldName)) { - deserializedGroupQuotasEnforcementStatusProperties.faultCode = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotasEnforcementStatusProperties; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntity.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntity.java deleted file mode 100644 index 5bfe082c9643..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntity.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.GroupQuotasEntityInner; - -/** - * An immutable client-side representation of GroupQuotasEntity. - */ -public interface GroupQuotasEntity { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Properties. - * - * @return the properties value. - */ - GroupQuotasEntityProperties 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.quota.fluent.models.GroupQuotasEntityInner object. - * - * @return the inner object. - */ - GroupQuotasEntityInner innerModel(); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityBase.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityBase.java deleted file mode 100644 index 999a79c9671b..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityBase.java +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Properties and filters for ShareQuota. The request parameter is optional, if there are no filters specified. - */ -@Fluent -public class GroupQuotasEntityBase implements JsonSerializable { - /* - * Display name of the GroupQuota entity. - */ - private String displayName; - - /* - * Type of the group. - */ - private GroupType groupType; - - /* - * Provisioning state of the operation. - */ - private RequestState provisioningState; - - /** - * Creates an instance of GroupQuotasEntityBase class. - */ - public GroupQuotasEntityBase() { - } - - /** - * Get the displayName property: Display name of the GroupQuota entity. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Display name of the GroupQuota entity. - * - * @param displayName the displayName value to set. - * @return the GroupQuotasEntityBase object itself. - */ - public GroupQuotasEntityBase withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the groupType property: Type of the group. - * - * @return the groupType value. - */ - public GroupType groupType() { - return this.groupType; - } - - /** - * Set the groupType property: Type of the group. - * - * @param groupType the groupType value to set. - * @return the GroupQuotasEntityBase object itself. - */ - GroupQuotasEntityBase withGroupType(GroupType groupType) { - this.groupType = groupType; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the operation. - * - * @return the provisioningState value. - */ - public RequestState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Provisioning state of the operation. - * - * @param provisioningState the provisioningState value to set. - * @return the GroupQuotasEntityBase object itself. - */ - GroupQuotasEntityBase withProvisioningState(RequestState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("displayName", this.displayName); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotasEntityBase from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotasEntityBase 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 GroupQuotasEntityBase. - */ - public static GroupQuotasEntityBase fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotasEntityBase deserializedGroupQuotasEntityBase = new GroupQuotasEntityBase(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("displayName".equals(fieldName)) { - deserializedGroupQuotasEntityBase.displayName = reader.getString(); - } else if ("groupType".equals(fieldName)) { - deserializedGroupQuotasEntityBase.groupType = GroupType.fromString(reader.getString()); - } else if ("provisioningState".equals(fieldName)) { - deserializedGroupQuotasEntityBase.provisioningState = RequestState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotasEntityBase; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityBasePatch.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityBasePatch.java deleted file mode 100644 index 73e6a996c1ce..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityBasePatch.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Properties and filters for ShareQuota. The request parameter is optional, if there are no filters specified. - */ -@Fluent -public class GroupQuotasEntityBasePatch implements JsonSerializable { - /* - * Display name of the GroupQuota entity. - */ - private String displayName; - - /* - * Provisioning state of the operation. - */ - private RequestState provisioningState; - - /** - * Creates an instance of GroupQuotasEntityBasePatch class. - */ - public GroupQuotasEntityBasePatch() { - } - - /** - * Get the displayName property: Display name of the GroupQuota entity. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Display name of the GroupQuota entity. - * - * @param displayName the displayName value to set. - * @return the GroupQuotasEntityBasePatch object itself. - */ - public GroupQuotasEntityBasePatch withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the operation. - * - * @return the provisioningState value. - */ - public RequestState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Provisioning state of the operation. - * - * @param provisioningState the provisioningState value to set. - * @return the GroupQuotasEntityBasePatch object itself. - */ - GroupQuotasEntityBasePatch withProvisioningState(RequestState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("displayName", this.displayName); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotasEntityBasePatch from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotasEntityBasePatch 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 GroupQuotasEntityBasePatch. - */ - public static GroupQuotasEntityBasePatch fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotasEntityBasePatch deserializedGroupQuotasEntityBasePatch = new GroupQuotasEntityBasePatch(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("displayName".equals(fieldName)) { - deserializedGroupQuotasEntityBasePatch.displayName = reader.getString(); - } else if ("provisioningState".equals(fieldName)) { - deserializedGroupQuotasEntityBasePatch.provisioningState - = RequestState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotasEntityBasePatch; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityPatch.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityPatch.java deleted file mode 100644 index 1a56fc9ff8de..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityPatch.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.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 java.io.IOException; - -/** - * Properties and filters for ShareQuota. The request parameter is optional, if there are no filters specified. - */ -@Fluent -public final class GroupQuotasEntityPatch extends ProxyResource { - /* - * Properties - */ - private GroupQuotasEntityPatchProperties 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 GroupQuotasEntityPatch class. - */ - public GroupQuotasEntityPatch() { - } - - /** - * Get the properties property: Properties. - * - * @return the properties value. - */ - public GroupQuotasEntityPatchProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties. - * - * @param properties the properties value to set. - * @return the GroupQuotasEntityPatch object itself. - */ - public GroupQuotasEntityPatch withProperties(GroupQuotasEntityPatchProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotasEntityPatch from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotasEntityPatch 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 GroupQuotasEntityPatch. - */ - public static GroupQuotasEntityPatch fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotasEntityPatch deserializedGroupQuotasEntityPatch = new GroupQuotasEntityPatch(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGroupQuotasEntityPatch.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGroupQuotasEntityPatch.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGroupQuotasEntityPatch.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedGroupQuotasEntityPatch.properties = GroupQuotasEntityPatchProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedGroupQuotasEntityPatch.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotasEntityPatch; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityPatchProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityPatchProperties.java deleted file mode 100644 index 5512bfadd30b..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityPatchProperties.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Properties. - */ -@Fluent -public final class GroupQuotasEntityPatchProperties extends GroupQuotasEntityBasePatch { - /* - * Provisioning state of the operation. - */ - private RequestState provisioningState; - - /** - * Creates an instance of GroupQuotasEntityPatchProperties class. - */ - public GroupQuotasEntityPatchProperties() { - } - - /** - * Get the provisioningState property: Provisioning state of the operation. - * - * @return the provisioningState value. - */ - @Override - public RequestState provisioningState() { - return this.provisioningState; - } - - /** - * {@inheritDoc} - */ - @Override - public GroupQuotasEntityPatchProperties withDisplayName(String displayName) { - super.withDisplayName(displayName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("displayName", displayName()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotasEntityPatchProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotasEntityPatchProperties 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 GroupQuotasEntityPatchProperties. - */ - public static GroupQuotasEntityPatchProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotasEntityPatchProperties deserializedGroupQuotasEntityPatchProperties - = new GroupQuotasEntityPatchProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("displayName".equals(fieldName)) { - deserializedGroupQuotasEntityPatchProperties.withDisplayName(reader.getString()); - } else if ("provisioningState".equals(fieldName)) { - deserializedGroupQuotasEntityPatchProperties.provisioningState - = RequestState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotasEntityPatchProperties; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityProperties.java deleted file mode 100644 index b32f719a93b0..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupQuotasEntityProperties.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Properties. - */ -@Fluent -public final class GroupQuotasEntityProperties extends GroupQuotasEntityBase { - /* - * Provisioning state of the operation. - */ - private RequestState provisioningState; - - /* - * Type of the group. - */ - private GroupType groupType; - - /** - * Creates an instance of GroupQuotasEntityProperties class. - */ - public GroupQuotasEntityProperties() { - } - - /** - * Get the provisioningState property: Provisioning state of the operation. - * - * @return the provisioningState value. - */ - @Override - public RequestState provisioningState() { - return this.provisioningState; - } - - /** - * Get the groupType property: Type of the group. - * - * @return the groupType value. - */ - @Override - public GroupType groupType() { - return this.groupType; - } - - /** - * {@inheritDoc} - */ - @Override - public GroupQuotasEntityProperties withDisplayName(String displayName) { - super.withDisplayName(displayName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("displayName", displayName()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GroupQuotasEntityProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GroupQuotasEntityProperties 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 GroupQuotasEntityProperties. - */ - public static GroupQuotasEntityProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GroupQuotasEntityProperties deserializedGroupQuotasEntityProperties = new GroupQuotasEntityProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("displayName".equals(fieldName)) { - deserializedGroupQuotasEntityProperties.withDisplayName(reader.getString()); - } else if ("groupType".equals(fieldName)) { - deserializedGroupQuotasEntityProperties.groupType = GroupType.fromString(reader.getString()); - } else if ("provisioningState".equals(fieldName)) { - deserializedGroupQuotasEntityProperties.provisioningState - = RequestState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedGroupQuotasEntityProperties; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupType.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupType.java deleted file mode 100644 index a5973d346afe..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/GroupType.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Type of the group. - */ -public final class GroupType extends ExpandableStringEnum { - /** - * The group is used for subscription group quota allocations. - */ - public static final GroupType ALLOCATION_GROUP = fromString("AllocationGroup"); - - /** - * The group is used for the enforced shared limit scenario. - */ - public static final GroupType ENFORCED_GROUP = fromString("EnforcedGroup"); - - /** - * Creates a new instance of GroupType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public GroupType() { - } - - /** - * Creates or finds a GroupType from its string representation. - * - * @param name a name to look for. - * @return the corresponding GroupType. - */ - public static GroupType fromString(String name) { - return fromString(name, GroupType.class); - } - - /** - * Gets known GroupType values. - * - * @return known GroupType values. - */ - public static Collection values() { - return values(GroupType.class); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitJsonObject.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitJsonObject.java deleted file mode 100644 index 1bf9362f1a25..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitJsonObject.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * LimitJson abstract class. - */ -@Immutable -public class LimitJsonObject implements JsonSerializable { - /* - * The limit object type. - */ - private LimitType limitObjectType = LimitType.fromString("LimitJsonObject"); - - /** - * Creates an instance of LimitJsonObject class. - */ - public LimitJsonObject() { - } - - /** - * Get the limitObjectType property: The limit object type. - * - * @return the limitObjectType value. - */ - public LimitType limitObjectType() { - return this.limitObjectType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("limitObjectType", - this.limitObjectType == null ? null : this.limitObjectType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LimitJsonObject from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LimitJsonObject 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 LimitJsonObject. - */ - public static LimitJsonObject fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("limitObjectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("LimitValue".equals(discriminatorValue)) { - return LimitObject.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static LimitJsonObject fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LimitJsonObject deserializedLimitJsonObject = new LimitJsonObject(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("limitObjectType".equals(fieldName)) { - deserializedLimitJsonObject.limitObjectType = LimitType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedLimitJsonObject; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitObject.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitObject.java deleted file mode 100644 index 96b83f54f555..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitObject.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The resource quota limit value. - */ -@Fluent -public final class LimitObject extends LimitJsonObject { - /* - * The limit object type. - */ - private LimitType limitObjectType = LimitType.LIMIT_VALUE; - - /* - * The quota/limit value - */ - private int value; - - /* - * The quota or usages limit types. - */ - private QuotaLimitTypes limitType; - - /** - * Creates an instance of LimitObject class. - */ - public LimitObject() { - } - - /** - * Get the limitObjectType property: The limit object type. - * - * @return the limitObjectType value. - */ - @Override - public LimitType limitObjectType() { - return this.limitObjectType; - } - - /** - * Get the value property: The quota/limit value. - * - * @return the value value. - */ - public int value() { - return this.value; - } - - /** - * Set the value property: The quota/limit value. - * - * @param value the value value to set. - * @return the LimitObject object itself. - */ - public LimitObject withValue(int value) { - this.value = value; - return this; - } - - /** - * Get the limitType property: The quota or usages limit types. - * - * @return the limitType value. - */ - public QuotaLimitTypes limitType() { - return this.limitType; - } - - /** - * Set the limitType property: The quota or usages limit types. - * - * @param limitType the limitType value to set. - * @return the LimitObject object itself. - */ - public LimitObject withLimitType(QuotaLimitTypes limitType) { - this.limitType = limitType; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeIntField("value", this.value); - jsonWriter.writeStringField("limitObjectType", - this.limitObjectType == null ? null : this.limitObjectType.toString()); - jsonWriter.writeStringField("limitType", this.limitType == null ? null : this.limitType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LimitObject from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LimitObject 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 LimitObject. - */ - public static LimitObject fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LimitObject deserializedLimitObject = new LimitObject(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - deserializedLimitObject.value = reader.getInt(); - } else if ("limitObjectType".equals(fieldName)) { - deserializedLimitObject.limitObjectType = LimitType.fromString(reader.getString()); - } else if ("limitType".equals(fieldName)) { - deserializedLimitObject.limitType = QuotaLimitTypes.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedLimitObject; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitType.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitType.java deleted file mode 100644 index 49e5301ba565..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitType.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The limit object type. - */ -public final class LimitType extends ExpandableStringEnum { - /** - * Static value LimitValue for LimitType. - */ - public static final LimitType LIMIT_VALUE = fromString("LimitValue"); - - /** - * Creates a new instance of LimitType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public LimitType() { - } - - /** - * Creates or finds a LimitType from its string representation. - * - * @param name a name to look for. - * @return the corresponding LimitType. - */ - public static LimitType fromString(String name) { - return fromString(name, LimitType.class); - } - - /** - * Gets known LimitType values. - * - * @return known LimitType values. - */ - public static Collection values() { - return values(LimitType.class); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/OperationDisplay.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/OperationDisplay.java deleted file mode 100644 index 83a522d45a40..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/OperationDisplay.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The OperationDisplay model. - */ -@Immutable -public final class OperationDisplay implements JsonSerializable { - /* - * Provider name. - */ - private String provider; - - /* - * Resource name. - */ - private String resource; - - /* - * Operation name. - */ - private String operation; - - /* - * Operation description. - */ - private String description; - - /** - * Creates an instance of OperationDisplay class. - */ - private OperationDisplay() { - } - - /** - * Get the provider property: Provider name. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Get the resource property: Resource name. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Get the operation property: Operation name. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Get the description property: Operation description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("provider", this.provider); - jsonWriter.writeStringField("resource", this.resource); - jsonWriter.writeStringField("operation", this.operation); - jsonWriter.writeStringField("description", this.description); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationDisplay from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationDisplay 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 OperationDisplay. - */ - public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationDisplay deserializedOperationDisplay = new OperationDisplay(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provider".equals(fieldName)) { - deserializedOperationDisplay.provider = reader.getString(); - } else if ("resource".equals(fieldName)) { - deserializedOperationDisplay.resource = reader.getString(); - } else if ("operation".equals(fieldName)) { - deserializedOperationDisplay.operation = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedOperationDisplay.description = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationDisplay; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/OperationResponse.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/OperationResponse.java deleted file mode 100644 index ebc0189695b2..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/OperationResponse.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.resourcemanager.quota.fluent.models.OperationResponseInner; - -/** - * An immutable client-side representation of OperationResponse. - */ -public interface OperationResponse { - /** - * Gets the name property: The name property. - * - * @return the name value. - */ - String name(); - - /** - * Gets the display property: The display property. - * - * @return the display value. - */ - OperationDisplay display(); - - /** - * Gets the origin property: The origin property. - * - * @return the origin value. - */ - String origin(); - - /** - * Gets the inner com.azure.resourcemanager.quota.fluent.models.OperationResponseInner object. - * - * @return the inner object. - */ - OperationResponseInner innerModel(); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaAllocationRequestBase.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaAllocationRequestBase.java deleted file mode 100644 index 55f7f3f1f383..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaAllocationRequestBase.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.fluent.models.QuotaAllocationRequestBaseProperties; -import java.io.IOException; - -/** - * The new quota request allocated to subscription. - */ -@Immutable -public final class QuotaAllocationRequestBase implements JsonSerializable { - /* - * The properties property. - */ - private QuotaAllocationRequestBaseProperties innerProperties; - - /** - * Creates an instance of QuotaAllocationRequestBase class. - */ - private QuotaAllocationRequestBase() { - } - - /** - * Get the innerProperties property: The properties property. - * - * @return the innerProperties value. - */ - private QuotaAllocationRequestBaseProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the limit property: The new quota limit for the subscription. The incremental quota will be allocated from - * pre-approved group quota. - * - * @return the limit value. - */ - public Long limit() { - return this.innerProperties() == null ? null : this.innerProperties().limit(); - } - - /** - * Get the region property: The location for which the subscription is allocated. - * - * @return the region value. - */ - public String region() { - return this.innerProperties() == null ? null : this.innerProperties().region(); - } - - /** - * Get the value property: Resource name. - * - * @return the value value. - */ - public String value() { - return this.innerProperties() == null ? null : this.innerProperties().value(); - } - - /** - * Get the localizedValue property: Resource display name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.innerProperties() == null ? null : this.innerProperties().localizedValue(); - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QuotaAllocationRequestBase from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QuotaAllocationRequestBase 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 QuotaAllocationRequestBase. - */ - public static QuotaAllocationRequestBase fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QuotaAllocationRequestBase deserializedQuotaAllocationRequestBase = new QuotaAllocationRequestBase(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedQuotaAllocationRequestBase.innerProperties - = QuotaAllocationRequestBaseProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedQuotaAllocationRequestBase; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaAllocationRequestStatus.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaAllocationRequestStatus.java deleted file mode 100644 index 152afcb39a26..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaAllocationRequestStatus.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.QuotaAllocationRequestStatusInner; -import java.time.OffsetDateTime; - -/** - * An immutable client-side representation of QuotaAllocationRequestStatus. - */ -public interface QuotaAllocationRequestStatus { - /** - * 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 requestedResource property: The new quota request allocated to subscription. - * - * @return the requestedResource value. - */ - QuotaAllocationRequestBase requestedResource(); - - /** - * Gets the requestSubmitTime property: The request submission time. The date conforms to the following format - * specified by the ISO 8601 standard: yyyy-MM-ddTHH:mm:ssZ. - * - * @return the requestSubmitTime value. - */ - OffsetDateTime requestSubmitTime(); - - /** - * Gets the provisioningState property: Request status. - * - * @return the provisioningState value. - */ - RequestState provisioningState(); - - /** - * Gets the faultCode property: Details of the failure. - * - * @return the faultCode value. - */ - String faultCode(); - - /** - * Gets the inner com.azure.resourcemanager.quota.fluent.models.QuotaAllocationRequestStatusInner object. - * - * @return the inner object. - */ - QuotaAllocationRequestStatusInner innerModel(); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaLimitTypes.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaLimitTypes.java deleted file mode 100644 index 7962eb3aa7df..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaLimitTypes.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The quota or usages limit types. - */ -public final class QuotaLimitTypes extends ExpandableStringEnum { - /** - * Static value Independent for QuotaLimitTypes. - */ - public static final QuotaLimitTypes INDEPENDENT = fromString("Independent"); - - /** - * Static value Shared for QuotaLimitTypes. - */ - public static final QuotaLimitTypes SHARED = fromString("Shared"); - - /** - * Creates a new instance of QuotaLimitTypes value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public QuotaLimitTypes() { - } - - /** - * Creates or finds a QuotaLimitTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding QuotaLimitTypes. - */ - public static QuotaLimitTypes fromString(String name) { - return fromString(name, QuotaLimitTypes.class); - } - - /** - * Gets known QuotaLimitTypes values. - * - * @return known QuotaLimitTypes values. - */ - public static Collection values() { - return values(QuotaLimitTypes.class); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaOperations.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaOperations.java deleted file mode 100644 index 1762ab5df412..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaOperations.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of QuotaOperations. - */ -public interface QuotaOperations { - /** - * List the operations for the provider. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of connected cluster API operations as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List the operations for the provider. - * - * @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 paginated list of connected cluster API operations as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaProperties.java deleted file mode 100644 index b17e533df17c..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaProperties.java +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Quota properties for the specified resource. - */ -@Fluent -public final class QuotaProperties implements JsonSerializable { - /* - * Resource quota limit properties. - */ - private LimitJsonObject limit; - - /* - * The quota units, such as Count and Bytes. When requesting quota, use the **unit** value returned in the GET - * response in the request body of your PUT operation. - */ - private String unit; - - /* - * Resource name provided by the resource provider. Use this property name when requesting quota. - */ - private ResourceName name; - - /* - * The name of the resource type. Optional field. - */ - private String resourceType; - - /* - * The time period over which the quota usage values are summarized. For example: - * *P1D (per one day) - * *PT1M (per one minute) - * *PT1S (per one second). - * This parameter is optional because, for some resources like compute, the period is irrelevant. - */ - private String quotaPeriod; - - /* - * States if quota can be requested for this resource. - */ - private Boolean isQuotaApplicable; - - /* - * Additional properties for the specific resource provider. - */ - private Object properties; - - /** - * Creates an instance of QuotaProperties class. - */ - public QuotaProperties() { - } - - /** - * Get the limit property: Resource quota limit properties. - * - * @return the limit value. - */ - public LimitJsonObject limit() { - return this.limit; - } - - /** - * Set the limit property: Resource quota limit properties. - * - * @param limit the limit value to set. - * @return the QuotaProperties object itself. - */ - public QuotaProperties withLimit(LimitJsonObject limit) { - this.limit = limit; - return this; - } - - /** - * Get the unit property: The quota units, such as Count and Bytes. When requesting quota, use the **unit** value - * returned in the GET response in the request body of your PUT operation. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Get the name property: Resource name provided by the resource provider. Use this property name when requesting - * quota. - * - * @return the name value. - */ - public ResourceName name() { - return this.name; - } - - /** - * Set the name property: Resource name provided by the resource provider. Use this property name when requesting - * quota. - * - * @param name the name value to set. - * @return the QuotaProperties object itself. - */ - public QuotaProperties withName(ResourceName name) { - this.name = name; - return this; - } - - /** - * Get the resourceType property: The name of the resource type. Optional field. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Set the resourceType property: The name of the resource type. Optional field. - * - * @param resourceType the resourceType value to set. - * @return the QuotaProperties object itself. - */ - public QuotaProperties withResourceType(String resourceType) { - this.resourceType = resourceType; - return this; - } - - /** - * Get the quotaPeriod property: The time period over which the quota usage values are summarized. For example: - * *P1D (per one day) - * *PT1M (per one minute) - * *PT1S (per one second). - * This parameter is optional because, for some resources like compute, the period is irrelevant. - * - * @return the quotaPeriod value. - */ - public String quotaPeriod() { - return this.quotaPeriod; - } - - /** - * Get the isQuotaApplicable property: States if quota can be requested for this resource. - * - * @return the isQuotaApplicable value. - */ - public Boolean isQuotaApplicable() { - return this.isQuotaApplicable; - } - - /** - * Get the properties property: Additional properties for the specific resource provider. - * - * @return the properties value. - */ - public Object properties() { - return this.properties; - } - - /** - * Set the properties property: Additional properties for the specific resource provider. - * - * @param properties the properties value to set. - * @return the QuotaProperties object itself. - */ - public QuotaProperties withProperties(Object properties) { - this.properties = properties; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("limit", this.limit); - jsonWriter.writeJsonField("name", this.name); - jsonWriter.writeStringField("resourceType", this.resourceType); - if (this.properties != null) { - jsonWriter.writeUntypedField("properties", this.properties); - } - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QuotaProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QuotaProperties 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 QuotaProperties. - */ - public static QuotaProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QuotaProperties deserializedQuotaProperties = new QuotaProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("limit".equals(fieldName)) { - deserializedQuotaProperties.limit = LimitJsonObject.fromJson(reader); - } else if ("unit".equals(fieldName)) { - deserializedQuotaProperties.unit = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedQuotaProperties.name = ResourceName.fromJson(reader); - } else if ("resourceType".equals(fieldName)) { - deserializedQuotaProperties.resourceType = reader.getString(); - } else if ("quotaPeriod".equals(fieldName)) { - deserializedQuotaProperties.quotaPeriod = reader.getString(); - } else if ("isQuotaApplicable".equals(fieldName)) { - deserializedQuotaProperties.isQuotaApplicable = reader.getNullable(JsonReader::getBoolean); - } else if ("properties".equals(fieldName)) { - deserializedQuotaProperties.properties = reader.readUntyped(); - } else { - reader.skipChildren(); - } - } - - return deserializedQuotaProperties; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestDetails.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestDetails.java deleted file mode 100644 index 99517f9fd846..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestDetails.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.QuotaRequestDetailsInner; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * An immutable client-side representation of QuotaRequestDetails. - */ -public interface QuotaRequestDetails { - /** - * 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 provisioningState property: The quota request status. - * - * @return the provisioningState value. - */ - QuotaRequestState provisioningState(); - - /** - * Gets the message property: User-friendly status message. - * - * @return the message value. - */ - String message(); - - /** - * Gets the error property: Error details of the quota request. - * - * @return the error value. - */ - ServiceErrorDetail error(); - - /** - * Gets the requestSubmitTime property: The quota request submission time. The date conforms to the following format - * specified by the ISO 8601 standard: yyyy-MM-ddTHH:mm:ssZ. - * - * @return the requestSubmitTime value. - */ - OffsetDateTime requestSubmitTime(); - - /** - * Gets the value property: Quota request details. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.quota.fluent.models.QuotaRequestDetailsInner object. - * - * @return the inner object. - */ - QuotaRequestDetailsInner innerModel(); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestState.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestState.java deleted file mode 100644 index ee338d911de2..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestState.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Quota request status. - */ -public final class QuotaRequestState extends ExpandableStringEnum { - /** - * Static value Accepted for QuotaRequestState. - */ - public static final QuotaRequestState ACCEPTED = fromString("Accepted"); - - /** - * Static value Invalid for QuotaRequestState. - */ - public static final QuotaRequestState INVALID = fromString("Invalid"); - - /** - * Static value Succeeded for QuotaRequestState. - */ - public static final QuotaRequestState SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Failed for QuotaRequestState. - */ - public static final QuotaRequestState FAILED = fromString("Failed"); - - /** - * Static value InProgress for QuotaRequestState. - */ - public static final QuotaRequestState IN_PROGRESS = fromString("InProgress"); - - /** - * Creates a new instance of QuotaRequestState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public QuotaRequestState() { - } - - /** - * Creates or finds a QuotaRequestState from its string representation. - * - * @param name a name to look for. - * @return the corresponding QuotaRequestState. - */ - public static QuotaRequestState fromString(String name) { - return fromString(name, QuotaRequestState.class); - } - - /** - * Gets known QuotaRequestState values. - * - * @return known QuotaRequestState values. - */ - public static Collection values() { - return values(QuotaRequestState.class); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestStatus.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestStatus.java deleted file mode 100644 index 579db74d7409..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestStatus.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of QuotaRequestStatus. - */ -public interface QuotaRequestStatus { - /** - * Get the quota request details and status by quota request ID for the resources of the resource provider at a - * specific location. The quota request ID **id** is returned in the response of the PUT operation. - * - * @param id Quota request ID. - * @param scope The fully qualified Azure Resource manager identifier of the 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 quota request details and status by quota request ID for the resources of the resource provider at a - * specific location along with {@link Response}. - */ - Response getWithResponse(String id, String scope, Context context); - - /** - * Get the quota request details and status by quota request ID for the resources of the resource provider at a - * specific location. The quota request ID **id** is returned in the response of the PUT operation. - * - * @param id Quota request ID. - * @param scope The fully qualified Azure Resource manager identifier of the 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 quota request details and status by quota request ID for the resources of the resource provider at a - * specific location. - */ - QuotaRequestDetails get(String id, String scope); - - /** - * For the specified scope, get the current quota requests for a one year period ending at the time is made. Use the - * **oData** filter to select quota requests. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 quota request information as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String scope); - - /** - * For the specified scope, get the current quota requests for a one year period ending at the time is made. Use the - * **oData** filter to select quota requests. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * |requestSubmitTime | ge, le, eq, gt, lt - * |provisioningState eq {QuotaRequestState} - * |resourceName eq {resourceName}. - * @param top Number of records to return. - * @param skiptoken The **Skiptoken** parameter is used only if a previous operation returned a partial result. If a - * previous response contains a **nextLink** element, its value includes a **skiptoken** parameter that specifies a - * starting point to use for subsequent calls. - * @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 quota request information as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String scope, String filter, Integer top, String skiptoken, - Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/Quotas.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/Quotas.java deleted file mode 100644 index 4a48111fd5c7..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/Quotas.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of Quotas. - */ -public interface Quotas { - /** - * Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new - * quota limit that can be submitted with a PUT request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the 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 quota limit of a resource. - */ - Response getWithResponse(String resourceName, String scope, Context context); - - /** - * Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new - * quota limit that can be submitted with a PUT request. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the 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 quota limit of a resource. - */ - CurrentQuotaLimitBase get(String resourceName, String scope); - - /** - * Get a list of current quota limits of all resources for the specified scope. The response from this GET operation - * can be leveraged to submit requests to update a quota. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of current quota limits of all resources for the specified scope as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String scope); - - /** - * Get a list of current quota limits of all resources for the specified scope. The response from this GET operation - * can be leveraged to submit requests to update a quota. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of current quota limits of all resources for the specified scope as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String scope, Context context); - - /** - * Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new - * quota limit that can be submitted with a PUT request. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota limit of a resource. - */ - CurrentQuotaLimitBase getById(String id); - - /** - * Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new - * quota limit that can be submitted with a PUT request. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota limit of a resource. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new CurrentQuotaLimitBase resource. - * - * @param name resource name. - * @return the first stage of the new CurrentQuotaLimitBase definition. - */ - CurrentQuotaLimitBase.DefinitionStages.Blank define(String name); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasGetHeaders.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasGetHeaders.java deleted file mode 100644 index ce61234dd2e6..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasGetHeaders.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The QuotasGetHeaders model. - */ -@Immutable -public final class QuotasGetHeaders { - /* - * The ETag property. - */ - private final String etag; - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of QuotasGetHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public QuotasGetHeaders(HttpHeaders rawHeaders) { - this.etag = rawHeaders.getValue(HttpHeaderName.ETAG); - } - - /** - * Get the etag property: The ETag property. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasGetResponse.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasGetResponse.java deleted file mode 100644 index a45a766ccb4a..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasGetResponse.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.quota.fluent.models.CurrentQuotaLimitBaseInner; - -/** - * Contains all response data for the get operation. - */ -public final class QuotasGetResponse extends ResponseBase { - /** - * Creates an instance of QuotasGetResponse. - * - * @param request the request which resulted in this QuotasGetResponse. - * @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 QuotasGetResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, - CurrentQuotaLimitBaseInner value, QuotasGetHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** - * Gets the deserialized response body. - * - * @return the deserialized response body. - */ - @Override - public CurrentQuotaLimitBaseInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/RequestState.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/RequestState.java deleted file mode 100644 index 604991c78d28..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/RequestState.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Request status. - */ -public final class RequestState extends ExpandableStringEnum { - /** - * The quota request has been accepted. - */ - public static final RequestState ACCEPTED = fromString("Accepted"); - - /** - * The quota request has been created. - */ - public static final RequestState CREATED = fromString("Created"); - - /** - * The quota request is invalid. - */ - public static final RequestState INVALID = fromString("Invalid"); - - /** - * The quota request has succeeded. - */ - public static final RequestState SUCCEEDED = fromString("Succeeded"); - - /** - * The quota request has been escalated for further review. Please file a support ticket. A support engineer will - * follow up. - */ - public static final RequestState ESCALATED = fromString("Escalated"); - - /** - * The quota request has failed. - */ - public static final RequestState FAILED = fromString("Failed"); - - /** - * The quota request is currently being processed. - */ - public static final RequestState IN_PROGRESS = fromString("InProgress"); - - /** - * The quota request has been canceled. - */ - public static final RequestState CANCELED = fromString("Canceled"); - - /** - * Creates a new instance of RequestState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RequestState() { - } - - /** - * Creates or finds a RequestState from its string representation. - * - * @param name a name to look for. - * @return the corresponding RequestState. - */ - public static RequestState fromString(String name) { - return fromString(name, RequestState.class); - } - - /** - * Gets known RequestState values. - * - * @return known RequestState values. - */ - public static Collection values() { - return values(RequestState.class); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ResourceName.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ResourceName.java deleted file mode 100644 index abe78a182590..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ResourceName.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Name of the resource provided by the resource Provider. When requesting quota, use this property name. - */ -@Fluent -public final class ResourceName implements JsonSerializable { - /* - * Resource name. - */ - private String value; - - /* - * Resource display name. - */ - private String localizedValue; - - /** - * Creates an instance of ResourceName class. - */ - public ResourceName() { - } - - /** - * Get the value property: Resource name. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: Resource name. - * - * @param value the value value to set. - * @return the ResourceName object itself. - */ - public ResourceName withValue(String value) { - this.value = value; - return this; - } - - /** - * Get the localizedValue property: Resource display name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.localizedValue; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("value", this.value); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceName from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceName 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 ResourceName. - */ - public static ResourceName fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceName deserializedResourceName = new ResourceName(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - deserializedResourceName.value = reader.getString(); - } else if ("localizedValue".equals(fieldName)) { - deserializedResourceName.localizedValue = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedResourceName; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ResourceUsages.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ResourceUsages.java deleted file mode 100644 index b65da6499cc9..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ResourceUsages.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.ResourceUsagesInner; - -/** - * An immutable client-side representation of ResourceUsages. - */ -public interface ResourceUsages { - /** - * 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: Resource details with usages and GroupQuota. - * - * @return the properties value. - */ - GroupQuotaUsagesBase 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.quota.fluent.models.ResourceUsagesInner object. - * - * @return the inner object. - */ - ResourceUsagesInner innerModel(); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ServiceErrorDetail.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ServiceErrorDetail.java deleted file mode 100644 index 10c79ec3f86d..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ServiceErrorDetail.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Error details. - */ -@Immutable -public final class ServiceErrorDetail implements JsonSerializable { - /* - * Error code. - */ - private String code; - - /* - * Error message. - */ - private String message; - - /** - * Creates an instance of ServiceErrorDetail class. - */ - private ServiceErrorDetail() { - } - - /** - * Get the code property: Error code. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Get the message property: Error message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ServiceErrorDetail from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServiceErrorDetail 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 ServiceErrorDetail. - */ - public static ServiceErrorDetail fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServiceErrorDetail deserializedServiceErrorDetail = new ServiceErrorDetail(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("code".equals(fieldName)) { - deserializedServiceErrorDetail.code = reader.getString(); - } else if ("message".equals(fieldName)) { - deserializedServiceErrorDetail.message = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedServiceErrorDetail; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubRequest.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubRequest.java deleted file mode 100644 index cf036b7ae606..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubRequest.java +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Request property. - */ -@Immutable -public final class SubRequest implements JsonSerializable { - /* - * Resource name. - */ - private ResourceName name; - - /* - * Resource type for which the quota properties were requested. - */ - private String resourceType; - - /* - * Quota limit units, such as Count and Bytes. When requesting quota, use the **unit** value returned in the GET - * response in the request body of your PUT operation. - */ - private String unit; - - /* - * The quota request status. - */ - private QuotaRequestState provisioningState; - - /* - * User-friendly status message. - */ - private String message; - - /* - * Quota request ID. - */ - private String subRequestId; - - /* - * Resource quota limit properties. - */ - private LimitJsonObject limit; - - /** - * Creates an instance of SubRequest class. - */ - private SubRequest() { - } - - /** - * Get the name property: Resource name. - * - * @return the name value. - */ - public ResourceName name() { - return this.name; - } - - /** - * Get the resourceType property: Resource type for which the quota properties were requested. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Get the unit property: Quota limit units, such as Count and Bytes. When requesting quota, use the **unit** value - * returned in the GET response in the request body of your PUT operation. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Get the provisioningState property: The quota request status. - * - * @return the provisioningState value. - */ - public QuotaRequestState provisioningState() { - return this.provisioningState; - } - - /** - * Get the message property: User-friendly status message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Get the subRequestId property: Quota request ID. - * - * @return the subRequestId value. - */ - public String subRequestId() { - return this.subRequestId; - } - - /** - * Get the limit property: Resource quota limit properties. - * - * @return the limit value. - */ - public LimitJsonObject limit() { - return this.limit; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("name", this.name); - jsonWriter.writeStringField("unit", this.unit); - jsonWriter.writeJsonField("limit", this.limit); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SubRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SubRequest 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 SubRequest. - */ - public static SubRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SubRequest deserializedSubRequest = new SubRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedSubRequest.name = ResourceName.fromJson(reader); - } else if ("resourceType".equals(fieldName)) { - deserializedSubRequest.resourceType = reader.getString(); - } else if ("unit".equals(fieldName)) { - deserializedSubRequest.unit = reader.getString(); - } else if ("provisioningState".equals(fieldName)) { - deserializedSubRequest.provisioningState = QuotaRequestState.fromString(reader.getString()); - } else if ("message".equals(fieldName)) { - deserializedSubRequest.message = reader.getString(); - } else if ("subRequestId".equals(fieldName)) { - deserializedSubRequest.subRequestId = reader.getString(); - } else if ("limit".equals(fieldName)) { - deserializedSubRequest.limit = LimitJsonObject.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSubRequest; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubmittedResourceRequestStatus.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubmittedResourceRequestStatus.java deleted file mode 100644 index 89503c1165f5..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubmittedResourceRequestStatus.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.SubmittedResourceRequestStatusInner; - -/** - * An immutable client-side representation of SubmittedResourceRequestStatus. - */ -public interface SubmittedResourceRequestStatus { - /** - * 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: The properties property. - * - * @return the properties value. - */ - SubmittedResourceRequestStatusProperties 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.quota.fluent.models.SubmittedResourceRequestStatusInner object. - * - * @return the inner object. - */ - SubmittedResourceRequestStatusInner innerModel(); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubmittedResourceRequestStatusProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubmittedResourceRequestStatusProperties.java deleted file mode 100644 index 3467ac268737..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubmittedResourceRequestStatusProperties.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * The SubmittedResourceRequestStatusProperties model. - */ -@Immutable -public final class SubmittedResourceRequestStatusProperties - implements JsonSerializable { - /* - * Requested Resource. - */ - private GroupQuotaRequestBase requestedResource; - - /* - * The request submission time. The date conforms to the following format specified by the ISO 8601 standard: - * yyyy-MM-ddTHH:mm:ssZ - */ - private OffsetDateTime requestSubmitTime; - - /* - * Request status. - */ - private RequestState provisioningState; - - /* - * Details of the failure. - */ - private String faultCode; - - /** - * Creates an instance of SubmittedResourceRequestStatusProperties class. - */ - private SubmittedResourceRequestStatusProperties() { - } - - /** - * Get the requestedResource property: Requested Resource. - * - * @return the requestedResource value. - */ - public GroupQuotaRequestBase requestedResource() { - return this.requestedResource; - } - - /** - * Get the requestSubmitTime property: The request submission time. The date conforms to the following format - * specified by the ISO 8601 standard: yyyy-MM-ddTHH:mm:ssZ. - * - * @return the requestSubmitTime value. - */ - public OffsetDateTime requestSubmitTime() { - return this.requestSubmitTime; - } - - /** - * Get the provisioningState property: Request status. - * - * @return the provisioningState value. - */ - public RequestState provisioningState() { - return this.provisioningState; - } - - /** - * Get the faultCode property: Details of the failure. - * - * @return the faultCode value. - */ - public String faultCode() { - return this.faultCode; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("requestedResource", this.requestedResource); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SubmittedResourceRequestStatusProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SubmittedResourceRequestStatusProperties 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 SubmittedResourceRequestStatusProperties. - */ - public static SubmittedResourceRequestStatusProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SubmittedResourceRequestStatusProperties deserializedSubmittedResourceRequestStatusProperties - = new SubmittedResourceRequestStatusProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("requestedResource".equals(fieldName)) { - deserializedSubmittedResourceRequestStatusProperties.requestedResource - = GroupQuotaRequestBase.fromJson(reader); - } else if ("requestSubmitTime".equals(fieldName)) { - deserializedSubmittedResourceRequestStatusProperties.requestSubmitTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("provisioningState".equals(fieldName)) { - deserializedSubmittedResourceRequestStatusProperties.provisioningState - = RequestState.fromString(reader.getString()); - } else if ("faultCode".equals(fieldName)) { - deserializedSubmittedResourceRequestStatusProperties.faultCode = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSubmittedResourceRequestStatusProperties; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocations.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocations.java deleted file mode 100644 index b4e260b2f058..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocations.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. This will include the - * GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the subscription can be - * allocated back to the MG Group Quota. - */ -@Fluent -public final class SubscriptionQuotaAllocations implements JsonSerializable { - /* - * Quota properties for the specified resource. - */ - private SubscriptionQuotaAllocationsProperties properties; - - /** - * Creates an instance of SubscriptionQuotaAllocations class. - */ - public SubscriptionQuotaAllocations() { - } - - /** - * Get the properties property: Quota properties for the specified resource. - * - * @return the properties value. - */ - public SubscriptionQuotaAllocationsProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Quota properties for the specified resource. - * - * @param properties the properties value to set. - * @return the SubscriptionQuotaAllocations object itself. - */ - public SubscriptionQuotaAllocations withProperties(SubscriptionQuotaAllocationsProperties properties) { - this.properties = properties; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SubscriptionQuotaAllocations from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SubscriptionQuotaAllocations 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 SubscriptionQuotaAllocations. - */ - public static SubscriptionQuotaAllocations fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SubscriptionQuotaAllocations deserializedSubscriptionQuotaAllocations = new SubscriptionQuotaAllocations(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedSubscriptionQuotaAllocations.properties - = SubscriptionQuotaAllocationsProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSubscriptionQuotaAllocations; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsList.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsList.java deleted file mode 100644 index 71130d3836a6..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsList.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaAllocationsListInner; - -/** - * An immutable client-side representation of SubscriptionQuotaAllocationsList. - */ -public interface SubscriptionQuotaAllocationsList { - /** - * 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: The properties property. - * - * @return the properties value. - */ - SubscriptionQuotaAllocationsListProperties 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.quota.fluent.models.SubscriptionQuotaAllocationsListInner object. - * - * @return the inner object. - */ - SubscriptionQuotaAllocationsListInner innerModel(); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsListProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsListProperties.java deleted file mode 100644 index 607c0751ff5d..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsListProperties.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The SubscriptionQuotaAllocationsListProperties model. - */ -@Fluent -public final class SubscriptionQuotaAllocationsListProperties - implements JsonSerializable { - /* - * Request status. - */ - private RequestState provisioningState; - - /* - * Subscription quota list. - */ - private List value; - - /* - * The URL to use for getting the next set of results. - */ - private String nextLink; - - /** - * Creates an instance of SubscriptionQuotaAllocationsListProperties class. - */ - public SubscriptionQuotaAllocationsListProperties() { - } - - /** - * Get the provisioningState property: Request status. - * - * @return the provisioningState value. - */ - public RequestState provisioningState() { - return this.provisioningState; - } - - /** - * Get the value property: Subscription quota list. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Subscription quota list. - * - * @param value the value value to set. - * @return the SubscriptionQuotaAllocationsListProperties object itself. - */ - public SubscriptionQuotaAllocationsListProperties 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; - } - - /** - * {@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 SubscriptionQuotaAllocationsListProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SubscriptionQuotaAllocationsListProperties 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 SubscriptionQuotaAllocationsListProperties. - */ - public static SubscriptionQuotaAllocationsListProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SubscriptionQuotaAllocationsListProperties deserializedSubscriptionQuotaAllocationsListProperties - = new SubscriptionQuotaAllocationsListProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningState".equals(fieldName)) { - deserializedSubscriptionQuotaAllocationsListProperties.provisioningState - = RequestState.fromString(reader.getString()); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SubscriptionQuotaAllocations.fromJson(reader1)); - deserializedSubscriptionQuotaAllocationsListProperties.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSubscriptionQuotaAllocationsListProperties.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSubscriptionQuotaAllocationsListProperties; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsProperties.java deleted file mode 100644 index a91494debcde..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaAllocationsProperties.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaDetailsName; -import java.io.IOException; - -/** - * Quota properties for the specified resource. - */ -@Fluent -public final class SubscriptionQuotaAllocationsProperties extends SubscriptionQuotaDetails { - /* - * Name of the resource provided by the resource provider. This property is already included in the request URI, so - * it is a readonly property returned in the response. - */ - private SubscriptionQuotaDetailsName innerName; - - /* - * The shareable quota for the subscription. - */ - private Long shareableQuota; - - /** - * Creates an instance of SubscriptionQuotaAllocationsProperties class. - */ - public SubscriptionQuotaAllocationsProperties() { - } - - /** - * Get the innerName property: Name of the resource provided by the resource provider. This property is already - * included in the request URI, so it is a readonly property returned in the response. - * - * @return the innerName value. - */ - private SubscriptionQuotaDetailsName innerName() { - return this.innerName; - } - - /** - * Get the shareableQuota property: The shareable quota for the subscription. - * - * @return the shareableQuota value. - */ - @Override - public Long shareableQuota() { - return this.shareableQuota; - } - - /** - * {@inheritDoc} - */ - @Override - public SubscriptionQuotaAllocationsProperties withResourceName(String resourceName) { - super.withResourceName(resourceName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SubscriptionQuotaAllocationsProperties withLimit(Long limit) { - super.withLimit(limit); - return this; - } - - /** - * Get the value property: Resource name. - * - * @return the value value. - */ - public String value() { - return this.innerName() == null ? null : this.innerName().value(); - } - - /** - * Get the localizedValue property: Resource display name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.innerName() == null ? null : this.innerName().localizedValue(); - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("resourceName", resourceName()); - jsonWriter.writeNumberField("limit", limit()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SubscriptionQuotaAllocationsProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SubscriptionQuotaAllocationsProperties 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 SubscriptionQuotaAllocationsProperties. - */ - public static SubscriptionQuotaAllocationsProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SubscriptionQuotaAllocationsProperties deserializedSubscriptionQuotaAllocationsProperties - = new SubscriptionQuotaAllocationsProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceName".equals(fieldName)) { - deserializedSubscriptionQuotaAllocationsProperties.withResourceName(reader.getString()); - } else if ("limit".equals(fieldName)) { - deserializedSubscriptionQuotaAllocationsProperties - .withLimit(reader.getNullable(JsonReader::getLong)); - } else if ("shareableQuota".equals(fieldName)) { - deserializedSubscriptionQuotaAllocationsProperties.shareableQuota - = reader.getNullable(JsonReader::getLong); - } else if ("name".equals(fieldName)) { - deserializedSubscriptionQuotaAllocationsProperties.innerName - = SubscriptionQuotaDetailsName.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSubscriptionQuotaAllocationsProperties; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaDetails.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaDetails.java deleted file mode 100644 index 7f0da36e7e16..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubscriptionQuotaDetails.java +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.quota.fluent.models.SubscriptionQuotaDetailsName; -import java.io.IOException; - -/** - * Subscription Quota details. - */ -@Fluent -public class SubscriptionQuotaDetails implements JsonSerializable { - /* - * The resource name, such as SKU name. - */ - private String resourceName; - - /* - * The total quota limit for the subscription. - */ - private Long limit; - - /* - * The shareable quota for the subscription. - */ - private Long shareableQuota; - - /* - * Name of the resource provided by the resource provider. This property is already included in the request URI, so - * it is a readonly property returned in the response. - */ - private SubscriptionQuotaDetailsName innerName; - - /** - * Creates an instance of SubscriptionQuotaDetails class. - */ - public SubscriptionQuotaDetails() { - } - - /** - * Get the resourceName property: The resource name, such as SKU name. - * - * @return the resourceName value. - */ - public String resourceName() { - return this.resourceName; - } - - /** - * Set the resourceName property: The resource name, such as SKU name. - * - * @param resourceName the resourceName value to set. - * @return the SubscriptionQuotaDetails object itself. - */ - public SubscriptionQuotaDetails withResourceName(String resourceName) { - this.resourceName = resourceName; - return this; - } - - /** - * Get the limit property: The total quota limit for the subscription. - * - * @return the limit value. - */ - public Long limit() { - return this.limit; - } - - /** - * Set the limit property: The total quota limit for the subscription. - * - * @param limit the limit value to set. - * @return the SubscriptionQuotaDetails object itself. - */ - public SubscriptionQuotaDetails withLimit(Long limit) { - this.limit = limit; - return this; - } - - /** - * Get the shareableQuota property: The shareable quota for the subscription. - * - * @return the shareableQuota value. - */ - public Long shareableQuota() { - return this.shareableQuota; - } - - /** - * Set the shareableQuota property: The shareable quota for the subscription. - * - * @param shareableQuota the shareableQuota value to set. - * @return the SubscriptionQuotaDetails object itself. - */ - SubscriptionQuotaDetails withShareableQuota(Long shareableQuota) { - this.shareableQuota = shareableQuota; - return this; - } - - /** - * Get the innerName property: Name of the resource provided by the resource provider. This property is already - * included in the request URI, so it is a readonly property returned in the response. - * - * @return the innerName value. - */ - private SubscriptionQuotaDetailsName innerName() { - return this.innerName; - } - - /** - * Set the innerName property: Name of the resource provided by the resource provider. This property is already - * included in the request URI, so it is a readonly property returned in the response. - * - * @param innerName the innerName value to set. - * @return the SubscriptionQuotaDetails object itself. - */ - SubscriptionQuotaDetails withInnerName(SubscriptionQuotaDetailsName innerName) { - this.innerName = innerName; - return this; - } - - /** - * Get the value property: Resource name. - * - * @return the value value. - */ - public String value() { - return this.innerName() == null ? null : this.innerName().value(); - } - - /** - * Get the localizedValue property: Resource display name. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.innerName() == null ? null : this.innerName().localizedValue(); - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("resourceName", this.resourceName); - jsonWriter.writeNumberField("limit", this.limit); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SubscriptionQuotaDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SubscriptionQuotaDetails 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 SubscriptionQuotaDetails. - */ - public static SubscriptionQuotaDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SubscriptionQuotaDetails deserializedSubscriptionQuotaDetails = new SubscriptionQuotaDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceName".equals(fieldName)) { - deserializedSubscriptionQuotaDetails.resourceName = reader.getString(); - } else if ("limit".equals(fieldName)) { - deserializedSubscriptionQuotaDetails.limit = reader.getNullable(JsonReader::getLong); - } else if ("shareableQuota".equals(fieldName)) { - deserializedSubscriptionQuotaDetails.shareableQuota = reader.getNullable(JsonReader::getLong); - } else if ("name".equals(fieldName)) { - deserializedSubscriptionQuotaDetails.innerName = SubscriptionQuotaDetailsName.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSubscriptionQuotaDetails; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/Usages.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/Usages.java deleted file mode 100644 index 32f897e1283f..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/Usages.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of Usages. - */ -public interface Usages { - /** - * Get the current usage of a resource. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the 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 current usage of a resource. - */ - Response getWithResponse(String resourceName, String scope, Context context); - - /** - * Get the current usage of a resource. - * - * @param resourceName Resource name for a given resource provider. For example: - * - SKU name for Microsoft.Compute - * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices - * For Microsoft.Network PublicIPAddresses. - * @param scope The fully qualified Azure Resource manager identifier of the 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 current usage of a resource. - */ - CurrentUsagesBase get(String resourceName, String scope); - - /** - * Get a list of current usage for all resources for the scope specified. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of current usage for all resources for the scope specified as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String scope); - - /** - * Get a list of current usage for all resources for the scope specified. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of current usage for all resources for the scope specified as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String scope, Context context); -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesGetHeaders.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesGetHeaders.java deleted file mode 100644 index 766c67c3cc8e..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesGetHeaders.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The UsagesGetHeaders model. - */ -@Immutable -public final class UsagesGetHeaders { - /* - * The ETag property. - */ - private final String etag; - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of UsagesGetHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public UsagesGetHeaders(HttpHeaders rawHeaders) { - this.etag = rawHeaders.getValue(HttpHeaderName.ETAG); - } - - /** - * Get the etag property: The ETag property. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesGetResponse.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesGetResponse.java deleted file mode 100644 index 009607258c19..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesGetResponse.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.quota.fluent.models.CurrentUsagesBaseInner; - -/** - * Contains all response data for the get operation. - */ -public final class UsagesGetResponse extends ResponseBase { - /** - * Creates an instance of UsagesGetResponse. - * - * @param request the request which resulted in this UsagesGetResponse. - * @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 UsagesGetResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, CurrentUsagesBaseInner value, - UsagesGetHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** - * Gets the deserialized response body. - * - * @return the deserialized response body. - */ - @Override - public CurrentUsagesBaseInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesObject.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesObject.java deleted file mode 100644 index 3274c67f8d22..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesObject.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The resource usages value. - */ -@Immutable -public final class UsagesObject implements JsonSerializable { - /* - * The usages value. - */ - private int value; - - /* - * The quota or usages limit types. - */ - private UsagesTypes usagesType; - - /** - * Creates an instance of UsagesObject class. - */ - private UsagesObject() { - } - - /** - * Get the value property: The usages value. - * - * @return the value value. - */ - public int value() { - return this.value; - } - - /** - * Get the usagesType property: The quota or usages limit types. - * - * @return the usagesType value. - */ - public UsagesTypes usagesType() { - return this.usagesType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeIntField("value", this.value); - jsonWriter.writeStringField("usagesType", this.usagesType == null ? null : this.usagesType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of UsagesObject from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of UsagesObject 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 UsagesObject. - */ - public static UsagesObject fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - UsagesObject deserializedUsagesObject = new UsagesObject(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - deserializedUsagesObject.value = reader.getInt(); - } else if ("usagesType".equals(fieldName)) { - deserializedUsagesObject.usagesType = UsagesTypes.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedUsagesObject; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesProperties.java deleted file mode 100644 index b1640c2c607c..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesProperties.java +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Usage properties for the specified resource. - */ -@Immutable -public final class UsagesProperties implements JsonSerializable { - /* - * The quota limit properties for this resource. - */ - private UsagesObject usages; - - /* - * The units for the quota usage, such as Count and Bytes. When requesting quota, use the **unit** value returned in - * the GET response in the request body of your PUT operation. - */ - private String unit; - - /* - * Resource name provided by the resource provider. Use this property name when requesting quota. - */ - private ResourceName name; - - /* - * The name of the resource type. Optional field. - */ - private String resourceType; - - /* - * The time period for the summary of the quota usage values. For example: - * *P1D (per one day) - * *PT1M (per one minute) - * *PT1S (per one second). - * This parameter is optional because it is not relevant for all resources such as compute. - */ - private String quotaPeriod; - - /* - * States if quota can be requested for this resource. - */ - private Boolean isQuotaApplicable; - - /* - * Additional properties for the specific resource provider. - */ - private Object properties; - - /** - * Creates an instance of UsagesProperties class. - */ - private UsagesProperties() { - } - - /** - * Get the usages property: The quota limit properties for this resource. - * - * @return the usages value. - */ - public UsagesObject usages() { - return this.usages; - } - - /** - * Get the unit property: The units for the quota usage, such as Count and Bytes. When requesting quota, use the - * **unit** value returned in the GET response in the request body of your PUT operation. - * - * @return the unit value. - */ - public String unit() { - return this.unit; - } - - /** - * Get the name property: Resource name provided by the resource provider. Use this property name when requesting - * quota. - * - * @return the name value. - */ - public ResourceName name() { - return this.name; - } - - /** - * Get the resourceType property: The name of the resource type. Optional field. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Get the quotaPeriod property: The time period for the summary of the quota usage values. For example: - * *P1D (per one day) - * *PT1M (per one minute) - * *PT1S (per one second). - * This parameter is optional because it is not relevant for all resources such as compute. - * - * @return the quotaPeriod value. - */ - public String quotaPeriod() { - return this.quotaPeriod; - } - - /** - * Get the isQuotaApplicable property: States if quota can be requested for this resource. - * - * @return the isQuotaApplicable value. - */ - public Boolean isQuotaApplicable() { - return this.isQuotaApplicable; - } - - /** - * Get the properties property: Additional properties for the specific resource provider. - * - * @return the properties value. - */ - public Object properties() { - return this.properties; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("usages", this.usages); - jsonWriter.writeJsonField("name", this.name); - jsonWriter.writeStringField("resourceType", this.resourceType); - if (this.properties != null) { - jsonWriter.writeUntypedField("properties", this.properties); - } - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of UsagesProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of UsagesProperties 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 UsagesProperties. - */ - public static UsagesProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - UsagesProperties deserializedUsagesProperties = new UsagesProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("usages".equals(fieldName)) { - deserializedUsagesProperties.usages = UsagesObject.fromJson(reader); - } else if ("unit".equals(fieldName)) { - deserializedUsagesProperties.unit = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedUsagesProperties.name = ResourceName.fromJson(reader); - } else if ("resourceType".equals(fieldName)) { - deserializedUsagesProperties.resourceType = reader.getString(); - } else if ("quotaPeriod".equals(fieldName)) { - deserializedUsagesProperties.quotaPeriod = reader.getString(); - } else if ("isQuotaApplicable".equals(fieldName)) { - deserializedUsagesProperties.isQuotaApplicable = reader.getNullable(JsonReader::getBoolean); - } else if ("properties".equals(fieldName)) { - deserializedUsagesProperties.properties = reader.readUntyped(); - } else { - reader.skipChildren(); - } - } - - return deserializedUsagesProperties; - }); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesTypes.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesTypes.java deleted file mode 100644 index 4db95dc55fdb..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesTypes.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.quota.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The quota or usages limit types. - */ -public final class UsagesTypes extends ExpandableStringEnum { - /** - * Static value Individual for UsagesTypes. - */ - public static final UsagesTypes INDIVIDUAL = fromString("Individual"); - - /** - * Static value Combined for UsagesTypes. - */ - public static final UsagesTypes COMBINED = fromString("Combined"); - - /** - * Creates a new instance of UsagesTypes value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public UsagesTypes() { - } - - /** - * Creates or finds a UsagesTypes from its string representation. - * - * @param name a name to look for. - * @return the corresponding UsagesTypes. - */ - public static UsagesTypes fromString(String name) { - return fromString(name, UsagesTypes.class); - } - - /** - * Gets known UsagesTypes values. - * - * @return known UsagesTypes values. - */ - public static Collection values() { - return values(UsagesTypes.class); - } -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/package-info.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/package-info.java deleted file mode 100644 index a8bda873b1fc..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// 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 Quota. - * Microsoft Azure Quota Resource Provider. - */ -package com.azure.resourcemanager.quota.models; diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/package-info.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/package-info.java deleted file mode 100644 index 7431f9cb68a8..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// 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 Quota. - * Microsoft Azure Quota Resource Provider. - */ -package com.azure.resourcemanager.quota; diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/module-info.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/module-info.java deleted file mode 100644 index 8dc12f879edf..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/module-info.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -module com.azure.resourcemanager.quota { - requires transitive com.azure.core.management; - - exports com.azure.resourcemanager.quota; - exports com.azure.resourcemanager.quota.fluent; - exports com.azure.resourcemanager.quota.fluent.models; - exports com.azure.resourcemanager.quota.models; - - opens com.azure.resourcemanager.quota.fluent.models to com.azure.core; - opens com.azure.resourcemanager.quota.models to com.azure.core; - opens com.azure.resourcemanager.quota.implementation.models to com.azure.core; -} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-quota/proxy-config.json b/sdk/quota/azure-resourcemanager-quota/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-quota/proxy-config.json deleted file mode 100644 index 903a9bbcceac..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-quota/proxy-config.json +++ /dev/null @@ -1 +0,0 @@ -[["com.azure.resourcemanager.quota.implementation.GroupQuotaLimitsClientImpl$GroupQuotaLimitsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaLimitsRequestsClientImpl$GroupQuotaLimitsRequestsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaLocationSettingsClientImpl$GroupQuotaLocationSettingsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionAllocationRequestsClientImpl$GroupQuotaSubscriptionAllocationRequestsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionAllocationsClientImpl$GroupQuotaSubscriptionAllocationsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionRequestsClientImpl$GroupQuotaSubscriptionRequestsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionsClientImpl$GroupQuotaSubscriptionsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaUsagesClientImpl$GroupQuotaUsagesService"],["com.azure.resourcemanager.quota.implementation.GroupQuotasClientImpl$GroupQuotasService"],["com.azure.resourcemanager.quota.implementation.QuotaOperationsClientImpl$QuotaOperationsService"],["com.azure.resourcemanager.quota.implementation.QuotaRequestStatusClientImpl$QuotaRequestStatusService"],["com.azure.resourcemanager.quota.implementation.QuotasClientImpl$QuotasService"],["com.azure.resourcemanager.quota.implementation.UsagesClientImpl$UsagesService"]] \ No newline at end of file diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-quota/reflect-config.json b/sdk/quota/azure-resourcemanager-quota/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-quota/reflect-config.json deleted file mode 100644 index 76485bcb1427..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-quota/reflect-config.json +++ /dev/null @@ -1 +0,0 @@ -[{"name":"com.azure.resourcemanager.quota.models.ServiceErrorDetail","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true}] \ No newline at end of file diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/resources/azure-resourcemanager-quota.properties b/sdk/quota/azure-resourcemanager-quota/src/main/resources/azure-resourcemanager-quota.properties deleted file mode 100644 index defbd48204e4..000000000000 --- a/sdk/quota/azure-resourcemanager-quota/src/main/resources/azure-resourcemanager-quota.properties +++ /dev/null @@ -1 +0,0 @@ -version=${project.version} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/RecoveryServicesBackupManager.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/RecoveryServicesBackupManager.java deleted file mode 100644 index 54c24fb41522..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/RecoveryServicesBackupManager.java +++ /dev/null @@ -1,1125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -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.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.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.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.recoveryservicesbackup.fluent.RecoveryServicesBackupManagementClient; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupEnginesImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupJobsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupOperationResultsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupOperationStatusesImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupPoliciesImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectableItemsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectedItemsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectionContainersImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectionIntentsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceEncryptionConfigsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceStorageConfigsNonCrrsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceVaultConfigsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupStatusImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupUsageSummariesImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupWorkloadItemsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.BmsPrepareDataMoveOperationResultsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.DeletedProtectionContainersImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.ExportJobsOperationResultsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.FeatureSupportsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.FetchTieringCostsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.GetTieringCostOperationResultsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.ItemLevelRecoveryConnectionsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.JobCancellationsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.JobDetailsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.JobOperationResultsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.JobsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.OperationOperationsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.OperationsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.PrivateEndpointConnectionsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.PrivateEndpointsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectableContainersImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemOperationResultsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemOperationStatusesImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionContainerOperationResultsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionContainerRefreshOperationResultsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionContainersImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionIntentsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionPoliciesImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionPolicyOperationResultsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionPolicyOperationStatusesImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.RecoveryPointsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.RecoveryPointsRecommendedForMovesImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.RecoveryServicesBackupManagementClientBuilder; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.ResourceGuardProxyOperationsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.ResourceProvidersImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.RestoresImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.SecurityPINsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.TieringCostOperationStatusImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationResultsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationStatusesImpl; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationsImpl; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupEngines; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupJobs; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupOperationResults; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupOperationStatuses; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupPolicies; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectableItems; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectedItems; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectionContainers; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectionIntents; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigs; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceStorageConfigsNonCrrs; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceVaultConfigs; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupStatus; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupUsageSummaries; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupWorkloadItems; -import com.azure.resourcemanager.recoveryservicesbackup.models.Backups; -import com.azure.resourcemanager.recoveryservicesbackup.models.BmsPrepareDataMoveOperationResults; -import com.azure.resourcemanager.recoveryservicesbackup.models.DeletedProtectionContainers; -import com.azure.resourcemanager.recoveryservicesbackup.models.ExportJobsOperationResults; -import com.azure.resourcemanager.recoveryservicesbackup.models.FeatureSupports; -import com.azure.resourcemanager.recoveryservicesbackup.models.FetchTieringCosts; -import com.azure.resourcemanager.recoveryservicesbackup.models.GetTieringCostOperationResults; -import com.azure.resourcemanager.recoveryservicesbackup.models.ItemLevelRecoveryConnections; -import com.azure.resourcemanager.recoveryservicesbackup.models.JobCancellations; -import com.azure.resourcemanager.recoveryservicesbackup.models.JobDetails; -import com.azure.resourcemanager.recoveryservicesbackup.models.JobOperationResults; -import com.azure.resourcemanager.recoveryservicesbackup.models.Jobs; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationOperations; -import com.azure.resourcemanager.recoveryservicesbackup.models.Operations; -import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpointConnections; -import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpoints; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectableContainers; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemOperationResults; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemOperationStatuses; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItems; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainerOperationResults; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainerRefreshOperationResults; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainers; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionIntents; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicies; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicyOperationResults; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicyOperationStatuses; -import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPoints; -import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointsRecommendedForMoves; -import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceGuardProxyOperations; -import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceProviders; -import com.azure.resourcemanager.recoveryservicesbackup.models.Restores; -import com.azure.resourcemanager.recoveryservicesbackup.models.SecurityPINs; -import com.azure.resourcemanager.recoveryservicesbackup.models.TieringCostOperationStatus; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationResults; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationStatuses; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperations; -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; - -/** - * Entry point to RecoveryServicesBackupManager. - * Open API 2.0 Specs for Azure RecoveryServices Backup service. - */ -public final class RecoveryServicesBackupManager { - private ResourceProviders resourceProviders; - - private Operations operations; - - private BackupResourceStorageConfigsNonCrrs backupResourceStorageConfigsNonCrrs; - - private BmsPrepareDataMoveOperationResults bmsPrepareDataMoveOperationResults; - - private BackupResourceVaultConfigs backupResourceVaultConfigs; - - private BackupResourceEncryptionConfigs backupResourceEncryptionConfigs; - - private ProtectedItems protectedItems; - - private Backups backups; - - private RecoveryPointsRecommendedForMoves recoveryPointsRecommendedForMoves; - - private ProtectedItemOperationStatuses protectedItemOperationStatuses; - - private ProtectedItemOperationResults protectedItemOperationResults; - - private ProtectionContainers protectionContainers; - - private BackupWorkloadItems backupWorkloadItems; - - private ProtectionContainerOperationResults protectionContainerOperationResults; - - private RecoveryPoints recoveryPoints; - - private Restores restores; - - private ItemLevelRecoveryConnections itemLevelRecoveryConnections; - - private ProtectionPolicies protectionPolicies; - - private BackupPolicies backupPolicies; - - private ProtectionPolicyOperationResults protectionPolicyOperationResults; - - private ProtectionPolicyOperationStatuses protectionPolicyOperationStatuses; - - private JobDetails jobDetails; - - private BackupJobs backupJobs; - - private JobCancellations jobCancellations; - - private JobOperationResults jobOperationResults; - - private ExportJobsOperationResults exportJobsOperationResults; - - private BackupEngines backupEngines; - - private BackupStatus backupStatus; - - private FeatureSupports featureSupports; - - private BackupProtectionIntents backupProtectionIntents; - - private BackupUsageSummaries backupUsageSummaries; - - private Jobs jobs; - - private BackupProtectedItems backupProtectedItems; - - private ValidateOperations validateOperations; - - private ValidateOperationResults validateOperationResults; - - private ValidateOperationStatuses validateOperationStatuses; - - private ProtectionContainerRefreshOperationResults protectionContainerRefreshOperationResults; - - private ProtectableContainers protectableContainers; - - private BackupOperationResults backupOperationResults; - - private BackupOperationStatuses backupOperationStatuses; - - private BackupProtectableItems backupProtectableItems; - - private BackupProtectionContainers backupProtectionContainers; - - private DeletedProtectionContainers deletedProtectionContainers; - - private SecurityPINs securityPINs; - - private FetchTieringCosts fetchTieringCosts; - - private GetTieringCostOperationResults getTieringCostOperationResults; - - private TieringCostOperationStatus tieringCostOperationStatus; - - private ProtectionIntents protectionIntents; - - private PrivateEndpointConnections privateEndpointConnections; - - private PrivateEndpoints privateEndpoints; - - private ResourceGuardProxyOperations resourceGuardProxyOperations; - - private OperationOperations operationOperations; - - private final RecoveryServicesBackupManagementClient clientObject; - - private RecoveryServicesBackupManager(HttpPipeline httpPipeline, AzureProfile profile, - Duration defaultPollInterval) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = new RecoveryServicesBackupManagementClientBuilder().pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); - } - - /** - * Creates an instance of Recovery Services Backup service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the Recovery Services Backup service API instance. - */ - public static RecoveryServicesBackupManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return configure().authenticate(credential, profile); - } - - /** - * Creates an instance of Recovery Services Backup service API entry point. - * - * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. - * @param profile the Azure profile for client. - * @return the Recovery Services Backup service API instance. - */ - public static RecoveryServicesBackupManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new RecoveryServicesBackupManager(httpPipeline, profile, null); - } - - /** - * Gets a Configurable instance that can be used to create RecoveryServicesBackupManager with optional - * configuration. - * - * @return the Configurable instance allowing configurations. - */ - public static Configurable configure() { - return new RecoveryServicesBackupManager.Configurable(); - } - - /** - * The Configurable allowing configurations to be set. - */ - 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-recoveryservicesbackup.properties"); - - private HttpClient httpClient; - private HttpLogOptions httpLogOptions; - private final List policies = new ArrayList<>(); - private final List scopes = new ArrayList<>(); - private RetryPolicy retryPolicy; - private RetryOptions retryOptions; - private Duration defaultPollInterval; - - private Configurable() { - } - - /** - * Sets the http client. - * - * @param httpClient the HTTP client. - * @return the configurable object itself. - */ - public Configurable withHttpClient(HttpClient httpClient) { - this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); - return this; - } - - /** - * Sets the logging options to the HTTP pipeline. - * - * @param httpLogOptions the HTTP log options. - * @return the configurable object itself. - */ - public Configurable withLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); - return this; - } - - /** - * Adds the pipeline policy to the HTTP pipeline. - * - * @param policy the HTTP pipeline policy. - * @return the configurable object itself. - */ - public Configurable withPolicy(HttpPipelinePolicy policy) { - this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); - return this; - } - - /** - * Adds the scope to permission sets. - * - * @param scope the scope. - * @return the configurable object itself. - */ - public Configurable withScope(String scope) { - this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); - return this; - } - - /** - * Sets the retry policy to the HTTP pipeline. - * - * @param retryPolicy the HTTP pipeline retry policy. - * @return the configurable object itself. - */ - public Configurable withRetryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); - return this; - } - - /** - * Sets the retry options for the HTTP pipeline retry policy. - *

- * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. - * - * @param retryOptions the retry options for the HTTP pipeline retry policy. - * @return the configurable object itself. - */ - public Configurable withRetryOptions(RetryOptions retryOptions) { - this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); - return this; - } - - /** - * Sets the default poll interval, used when service does not provide "Retry-After" header. - * - * @param defaultPollInterval the default poll interval. - * @return the configurable object itself. - */ - public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval - = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); - if (this.defaultPollInterval.isNegative()) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); - } - return this; - } - - /** - * Creates an instance of Recovery Services Backup service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the Recovery Services Backup service API instance. - */ - public RecoveryServicesBackupManager authenticate(TokenCredential credential, AzureProfile profile) { - 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.recoveryservicesbackup") - .append("/") - .append(clientVersion); - if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder.append(" (") - .append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.name")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")) - .append("; auto-generated)"); - } else { - userAgentBuilder.append(" (auto-generated)"); - } - - if (scopes.isEmpty()) { - scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); - } - if (retryPolicy == null) { - if (retryOptions != null) { - retryPolicy = new RetryPolicy(retryOptions); - } else { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); - } - } - List policies = new ArrayList<>(); - policies.add(new UserAgentPolicy(userAgentBuilder.toString())); - policies.add(new AddHeadersFromContextPolicy()); - policies.add(new RequestIdPolicy()); - policies.addAll(this.policies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(retryPolicy); - policies.add(new AddDatePolicy()); - policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies.addAll(this.policies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); - return new RecoveryServicesBackupManager(httpPipeline, profile, defaultPollInterval); - } - } - - /** - * Gets the resource collection API of ResourceProviders. - * - * @return Resource collection API of ResourceProviders. - */ - public ResourceProviders resourceProviders() { - if (this.resourceProviders == null) { - this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); - } - return resourceProviders; - } - - /** - * Gets the resource collection API of Operations. - * - * @return Resource collection API of Operations. - */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); - } - return operations; - } - - /** - * Gets the resource collection API of BackupResourceStorageConfigsNonCrrs. - * - * @return Resource collection API of BackupResourceStorageConfigsNonCrrs. - */ - public BackupResourceStorageConfigsNonCrrs backupResourceStorageConfigsNonCrrs() { - if (this.backupResourceStorageConfigsNonCrrs == null) { - this.backupResourceStorageConfigsNonCrrs = new BackupResourceStorageConfigsNonCrrsImpl( - clientObject.getBackupResourceStorageConfigsNonCrrs(), this); - } - return backupResourceStorageConfigsNonCrrs; - } - - /** - * Gets the resource collection API of BmsPrepareDataMoveOperationResults. - * - * @return Resource collection API of BmsPrepareDataMoveOperationResults. - */ - public BmsPrepareDataMoveOperationResults bmsPrepareDataMoveOperationResults() { - if (this.bmsPrepareDataMoveOperationResults == null) { - this.bmsPrepareDataMoveOperationResults = new BmsPrepareDataMoveOperationResultsImpl( - clientObject.getBmsPrepareDataMoveOperationResults(), this); - } - return bmsPrepareDataMoveOperationResults; - } - - /** - * Gets the resource collection API of BackupResourceVaultConfigs. - * - * @return Resource collection API of BackupResourceVaultConfigs. - */ - public BackupResourceVaultConfigs backupResourceVaultConfigs() { - if (this.backupResourceVaultConfigs == null) { - this.backupResourceVaultConfigs - = new BackupResourceVaultConfigsImpl(clientObject.getBackupResourceVaultConfigs(), this); - } - return backupResourceVaultConfigs; - } - - /** - * Gets the resource collection API of BackupResourceEncryptionConfigs. - * - * @return Resource collection API of BackupResourceEncryptionConfigs. - */ - public BackupResourceEncryptionConfigs backupResourceEncryptionConfigs() { - if (this.backupResourceEncryptionConfigs == null) { - this.backupResourceEncryptionConfigs - = new BackupResourceEncryptionConfigsImpl(clientObject.getBackupResourceEncryptionConfigs(), this); - } - return backupResourceEncryptionConfigs; - } - - /** - * Gets the resource collection API of ProtectedItems. It manages ProtectedItemResource. - * - * @return Resource collection API of ProtectedItems. - */ - public ProtectedItems protectedItems() { - if (this.protectedItems == null) { - this.protectedItems = new ProtectedItemsImpl(clientObject.getProtectedItems(), this); - } - return protectedItems; - } - - /** - * Gets the resource collection API of Backups. - * - * @return Resource collection API of Backups. - */ - public Backups backups() { - if (this.backups == null) { - this.backups = new BackupsImpl(clientObject.getBackups(), this); - } - return backups; - } - - /** - * Gets the resource collection API of RecoveryPointsRecommendedForMoves. - * - * @return Resource collection API of RecoveryPointsRecommendedForMoves. - */ - public RecoveryPointsRecommendedForMoves recoveryPointsRecommendedForMoves() { - if (this.recoveryPointsRecommendedForMoves == null) { - this.recoveryPointsRecommendedForMoves - = new RecoveryPointsRecommendedForMovesImpl(clientObject.getRecoveryPointsRecommendedForMoves(), this); - } - return recoveryPointsRecommendedForMoves; - } - - /** - * Gets the resource collection API of ProtectedItemOperationStatuses. - * - * @return Resource collection API of ProtectedItemOperationStatuses. - */ - public ProtectedItemOperationStatuses protectedItemOperationStatuses() { - if (this.protectedItemOperationStatuses == null) { - this.protectedItemOperationStatuses - = new ProtectedItemOperationStatusesImpl(clientObject.getProtectedItemOperationStatuses(), this); - } - return protectedItemOperationStatuses; - } - - /** - * Gets the resource collection API of ProtectedItemOperationResults. - * - * @return Resource collection API of ProtectedItemOperationResults. - */ - public ProtectedItemOperationResults protectedItemOperationResults() { - if (this.protectedItemOperationResults == null) { - this.protectedItemOperationResults - = new ProtectedItemOperationResultsImpl(clientObject.getProtectedItemOperationResults(), this); - } - return protectedItemOperationResults; - } - - /** - * Gets the resource collection API of ProtectionContainers. It manages ProtectionContainerResource. - * - * @return Resource collection API of ProtectionContainers. - */ - public ProtectionContainers protectionContainers() { - if (this.protectionContainers == null) { - this.protectionContainers = new ProtectionContainersImpl(clientObject.getProtectionContainers(), this); - } - return protectionContainers; - } - - /** - * Gets the resource collection API of BackupWorkloadItems. - * - * @return Resource collection API of BackupWorkloadItems. - */ - public BackupWorkloadItems backupWorkloadItems() { - if (this.backupWorkloadItems == null) { - this.backupWorkloadItems = new BackupWorkloadItemsImpl(clientObject.getBackupWorkloadItems(), this); - } - return backupWorkloadItems; - } - - /** - * Gets the resource collection API of ProtectionContainerOperationResults. - * - * @return Resource collection API of ProtectionContainerOperationResults. - */ - public ProtectionContainerOperationResults protectionContainerOperationResults() { - if (this.protectionContainerOperationResults == null) { - this.protectionContainerOperationResults = new ProtectionContainerOperationResultsImpl( - clientObject.getProtectionContainerOperationResults(), this); - } - return protectionContainerOperationResults; - } - - /** - * Gets the resource collection API of RecoveryPoints. - * - * @return Resource collection API of RecoveryPoints. - */ - public RecoveryPoints recoveryPoints() { - if (this.recoveryPoints == null) { - this.recoveryPoints = new RecoveryPointsImpl(clientObject.getRecoveryPoints(), this); - } - return recoveryPoints; - } - - /** - * Gets the resource collection API of Restores. - * - * @return Resource collection API of Restores. - */ - public Restores restores() { - if (this.restores == null) { - this.restores = new RestoresImpl(clientObject.getRestores(), this); - } - return restores; - } - - /** - * Gets the resource collection API of ItemLevelRecoveryConnections. - * - * @return Resource collection API of ItemLevelRecoveryConnections. - */ - public ItemLevelRecoveryConnections itemLevelRecoveryConnections() { - if (this.itemLevelRecoveryConnections == null) { - this.itemLevelRecoveryConnections - = new ItemLevelRecoveryConnectionsImpl(clientObject.getItemLevelRecoveryConnections(), this); - } - return itemLevelRecoveryConnections; - } - - /** - * Gets the resource collection API of ProtectionPolicies. It manages ProtectionPolicyResource. - * - * @return Resource collection API of ProtectionPolicies. - */ - public ProtectionPolicies protectionPolicies() { - if (this.protectionPolicies == null) { - this.protectionPolicies = new ProtectionPoliciesImpl(clientObject.getProtectionPolicies(), this); - } - return protectionPolicies; - } - - /** - * Gets the resource collection API of BackupPolicies. - * - * @return Resource collection API of BackupPolicies. - */ - public BackupPolicies backupPolicies() { - if (this.backupPolicies == null) { - this.backupPolicies = new BackupPoliciesImpl(clientObject.getBackupPolicies(), this); - } - return backupPolicies; - } - - /** - * Gets the resource collection API of ProtectionPolicyOperationResults. - * - * @return Resource collection API of ProtectionPolicyOperationResults. - */ - public ProtectionPolicyOperationResults protectionPolicyOperationResults() { - if (this.protectionPolicyOperationResults == null) { - this.protectionPolicyOperationResults - = new ProtectionPolicyOperationResultsImpl(clientObject.getProtectionPolicyOperationResults(), this); - } - return protectionPolicyOperationResults; - } - - /** - * Gets the resource collection API of ProtectionPolicyOperationStatuses. - * - * @return Resource collection API of ProtectionPolicyOperationStatuses. - */ - public ProtectionPolicyOperationStatuses protectionPolicyOperationStatuses() { - if (this.protectionPolicyOperationStatuses == null) { - this.protectionPolicyOperationStatuses - = new ProtectionPolicyOperationStatusesImpl(clientObject.getProtectionPolicyOperationStatuses(), this); - } - return protectionPolicyOperationStatuses; - } - - /** - * Gets the resource collection API of JobDetails. - * - * @return Resource collection API of JobDetails. - */ - public JobDetails jobDetails() { - if (this.jobDetails == null) { - this.jobDetails = new JobDetailsImpl(clientObject.getJobDetails(), this); - } - return jobDetails; - } - - /** - * Gets the resource collection API of BackupJobs. - * - * @return Resource collection API of BackupJobs. - */ - public BackupJobs backupJobs() { - if (this.backupJobs == null) { - this.backupJobs = new BackupJobsImpl(clientObject.getBackupJobs(), this); - } - return backupJobs; - } - - /** - * Gets the resource collection API of JobCancellations. - * - * @return Resource collection API of JobCancellations. - */ - public JobCancellations jobCancellations() { - if (this.jobCancellations == null) { - this.jobCancellations = new JobCancellationsImpl(clientObject.getJobCancellations(), this); - } - return jobCancellations; - } - - /** - * Gets the resource collection API of JobOperationResults. - * - * @return Resource collection API of JobOperationResults. - */ - public JobOperationResults jobOperationResults() { - if (this.jobOperationResults == null) { - this.jobOperationResults = new JobOperationResultsImpl(clientObject.getJobOperationResults(), this); - } - return jobOperationResults; - } - - /** - * Gets the resource collection API of ExportJobsOperationResults. - * - * @return Resource collection API of ExportJobsOperationResults. - */ - public ExportJobsOperationResults exportJobsOperationResults() { - if (this.exportJobsOperationResults == null) { - this.exportJobsOperationResults - = new ExportJobsOperationResultsImpl(clientObject.getExportJobsOperationResults(), this); - } - return exportJobsOperationResults; - } - - /** - * Gets the resource collection API of BackupEngines. - * - * @return Resource collection API of BackupEngines. - */ - public BackupEngines backupEngines() { - if (this.backupEngines == null) { - this.backupEngines = new BackupEnginesImpl(clientObject.getBackupEngines(), this); - } - return backupEngines; - } - - /** - * Gets the resource collection API of BackupStatus. - * - * @return Resource collection API of BackupStatus. - */ - public BackupStatus backupStatus() { - if (this.backupStatus == null) { - this.backupStatus = new BackupStatusImpl(clientObject.getBackupStatus(), this); - } - return backupStatus; - } - - /** - * Gets the resource collection API of FeatureSupports. - * - * @return Resource collection API of FeatureSupports. - */ - public FeatureSupports featureSupports() { - if (this.featureSupports == null) { - this.featureSupports = new FeatureSupportsImpl(clientObject.getFeatureSupports(), this); - } - return featureSupports; - } - - /** - * Gets the resource collection API of BackupProtectionIntents. - * - * @return Resource collection API of BackupProtectionIntents. - */ - public BackupProtectionIntents backupProtectionIntents() { - if (this.backupProtectionIntents == null) { - this.backupProtectionIntents - = new BackupProtectionIntentsImpl(clientObject.getBackupProtectionIntents(), this); - } - return backupProtectionIntents; - } - - /** - * Gets the resource collection API of BackupUsageSummaries. - * - * @return Resource collection API of BackupUsageSummaries. - */ - public BackupUsageSummaries backupUsageSummaries() { - if (this.backupUsageSummaries == null) { - this.backupUsageSummaries = new BackupUsageSummariesImpl(clientObject.getBackupUsageSummaries(), this); - } - return backupUsageSummaries; - } - - /** - * Gets the resource collection API of Jobs. - * - * @return Resource collection API of Jobs. - */ - public Jobs jobs() { - if (this.jobs == null) { - this.jobs = new JobsImpl(clientObject.getJobs(), this); - } - return jobs; - } - - /** - * Gets the resource collection API of BackupProtectedItems. - * - * @return Resource collection API of BackupProtectedItems. - */ - public BackupProtectedItems backupProtectedItems() { - if (this.backupProtectedItems == null) { - this.backupProtectedItems = new BackupProtectedItemsImpl(clientObject.getBackupProtectedItems(), this); - } - return backupProtectedItems; - } - - /** - * Gets the resource collection API of ValidateOperations. - * - * @return Resource collection API of ValidateOperations. - */ - public ValidateOperations validateOperations() { - if (this.validateOperations == null) { - this.validateOperations = new ValidateOperationsImpl(clientObject.getValidateOperations(), this); - } - return validateOperations; - } - - /** - * Gets the resource collection API of ValidateOperationResults. - * - * @return Resource collection API of ValidateOperationResults. - */ - public ValidateOperationResults validateOperationResults() { - if (this.validateOperationResults == null) { - this.validateOperationResults - = new ValidateOperationResultsImpl(clientObject.getValidateOperationResults(), this); - } - return validateOperationResults; - } - - /** - * Gets the resource collection API of ValidateOperationStatuses. - * - * @return Resource collection API of ValidateOperationStatuses. - */ - public ValidateOperationStatuses validateOperationStatuses() { - if (this.validateOperationStatuses == null) { - this.validateOperationStatuses - = new ValidateOperationStatusesImpl(clientObject.getValidateOperationStatuses(), this); - } - return validateOperationStatuses; - } - - /** - * Gets the resource collection API of ProtectionContainerRefreshOperationResults. - * - * @return Resource collection API of ProtectionContainerRefreshOperationResults. - */ - public ProtectionContainerRefreshOperationResults protectionContainerRefreshOperationResults() { - if (this.protectionContainerRefreshOperationResults == null) { - this.protectionContainerRefreshOperationResults = new ProtectionContainerRefreshOperationResultsImpl( - clientObject.getProtectionContainerRefreshOperationResults(), this); - } - return protectionContainerRefreshOperationResults; - } - - /** - * Gets the resource collection API of ProtectableContainers. - * - * @return Resource collection API of ProtectableContainers. - */ - public ProtectableContainers protectableContainers() { - if (this.protectableContainers == null) { - this.protectableContainers = new ProtectableContainersImpl(clientObject.getProtectableContainers(), this); - } - return protectableContainers; - } - - /** - * Gets the resource collection API of BackupOperationResults. - * - * @return Resource collection API of BackupOperationResults. - */ - public BackupOperationResults backupOperationResults() { - if (this.backupOperationResults == null) { - this.backupOperationResults - = new BackupOperationResultsImpl(clientObject.getBackupOperationResults(), this); - } - return backupOperationResults; - } - - /** - * Gets the resource collection API of BackupOperationStatuses. - * - * @return Resource collection API of BackupOperationStatuses. - */ - public BackupOperationStatuses backupOperationStatuses() { - if (this.backupOperationStatuses == null) { - this.backupOperationStatuses - = new BackupOperationStatusesImpl(clientObject.getBackupOperationStatuses(), this); - } - return backupOperationStatuses; - } - - /** - * Gets the resource collection API of BackupProtectableItems. - * - * @return Resource collection API of BackupProtectableItems. - */ - public BackupProtectableItems backupProtectableItems() { - if (this.backupProtectableItems == null) { - this.backupProtectableItems - = new BackupProtectableItemsImpl(clientObject.getBackupProtectableItems(), this); - } - return backupProtectableItems; - } - - /** - * Gets the resource collection API of BackupProtectionContainers. - * - * @return Resource collection API of BackupProtectionContainers. - */ - public BackupProtectionContainers backupProtectionContainers() { - if (this.backupProtectionContainers == null) { - this.backupProtectionContainers - = new BackupProtectionContainersImpl(clientObject.getBackupProtectionContainers(), this); - } - return backupProtectionContainers; - } - - /** - * Gets the resource collection API of DeletedProtectionContainers. - * - * @return Resource collection API of DeletedProtectionContainers. - */ - public DeletedProtectionContainers deletedProtectionContainers() { - if (this.deletedProtectionContainers == null) { - this.deletedProtectionContainers - = new DeletedProtectionContainersImpl(clientObject.getDeletedProtectionContainers(), this); - } - return deletedProtectionContainers; - } - - /** - * Gets the resource collection API of SecurityPINs. - * - * @return Resource collection API of SecurityPINs. - */ - public SecurityPINs securityPINs() { - if (this.securityPINs == null) { - this.securityPINs = new SecurityPINsImpl(clientObject.getSecurityPINs(), this); - } - return securityPINs; - } - - /** - * Gets the resource collection API of FetchTieringCosts. - * - * @return Resource collection API of FetchTieringCosts. - */ - public FetchTieringCosts fetchTieringCosts() { - if (this.fetchTieringCosts == null) { - this.fetchTieringCosts = new FetchTieringCostsImpl(clientObject.getFetchTieringCosts(), this); - } - return fetchTieringCosts; - } - - /** - * Gets the resource collection API of GetTieringCostOperationResults. - * - * @return Resource collection API of GetTieringCostOperationResults. - */ - public GetTieringCostOperationResults getTieringCostOperationResults() { - if (this.getTieringCostOperationResults == null) { - this.getTieringCostOperationResults - = new GetTieringCostOperationResultsImpl(clientObject.getGetTieringCostOperationResults(), this); - } - return getTieringCostOperationResults; - } - - /** - * Gets the resource collection API of TieringCostOperationStatus. - * - * @return Resource collection API of TieringCostOperationStatus. - */ - public TieringCostOperationStatus tieringCostOperationStatus() { - if (this.tieringCostOperationStatus == null) { - this.tieringCostOperationStatus - = new TieringCostOperationStatusImpl(clientObject.getTieringCostOperationStatus(), this); - } - return tieringCostOperationStatus; - } - - /** - * Gets the resource collection API of ProtectionIntents. It manages ProtectionIntentResource. - * - * @return Resource collection API of ProtectionIntents. - */ - public ProtectionIntents protectionIntents() { - if (this.protectionIntents == null) { - this.protectionIntents = new ProtectionIntentsImpl(clientObject.getProtectionIntents(), this); - } - return protectionIntents; - } - - /** - * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnectionResource. - * - * @return Resource collection API of PrivateEndpointConnections. - */ - public PrivateEndpointConnections privateEndpointConnections() { - if (this.privateEndpointConnections == null) { - this.privateEndpointConnections - = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); - } - return privateEndpointConnections; - } - - /** - * Gets the resource collection API of PrivateEndpoints. - * - * @return Resource collection API of PrivateEndpoints. - */ - public PrivateEndpoints privateEndpoints() { - if (this.privateEndpoints == null) { - this.privateEndpoints = new PrivateEndpointsImpl(clientObject.getPrivateEndpoints(), this); - } - return privateEndpoints; - } - - /** - * Gets the resource collection API of ResourceGuardProxyOperations. It manages ResourceGuardProxyBaseResource. - * - * @return Resource collection API of ResourceGuardProxyOperations. - */ - public ResourceGuardProxyOperations resourceGuardProxyOperations() { - if (this.resourceGuardProxyOperations == null) { - this.resourceGuardProxyOperations - = new ResourceGuardProxyOperationsImpl(clientObject.getResourceGuardProxyOperations(), this); - } - return resourceGuardProxyOperations; - } - - /** - * Gets the resource collection API of OperationOperations. - * - * @return Resource collection API of OperationOperations. - */ - public OperationOperations operationOperations() { - if (this.operationOperations == null) { - this.operationOperations = new OperationOperationsImpl(clientObject.getOperationOperations(), this); - } - return operationOperations; - } - - /** - * Gets wrapped service client RecoveryServicesBackupManagementClient providing direct access to the underlying - * auto-generated API implementation, based on Azure REST API. - * - * @return Wrapped service client RecoveryServicesBackupManagementClient. - */ - public RecoveryServicesBackupManagementClient serviceClient() { - return this.clientObject; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupEnginesClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupEnginesClient.java deleted file mode 100644 index 3d30f087ef6e..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupEnginesClient.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupEngineBaseResourceInner; - -/** - * An instance of this class provides access to all the operations defined in BackupEnginesClient. - */ -public interface BackupEnginesClient { - /** - * Returns backup management server registered to Recovery Services Vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param backupEngineName Name of the backup management server. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the base backup engine class along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, - String backupEngineName, String filter, String skipToken, Context context); - - /** - * Returns backup management server registered to Recovery Services Vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param backupEngineName Name of the backup management server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the base backup engine class. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupEngineBaseResourceInner get(String vaultName, String resourceGroupName, String backupEngineName); - - /** - * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of BackupEngineBase resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName); - - /** - * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of BackupEngineBase resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName, String filter, - String skipToken, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupJobsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupJobsClient.java deleted file mode 100644 index 20817534556c..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupJobsClient.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; - -/** - * An instance of this class provides access to all the operations defined in BackupJobsClient. - */ -public interface BackupJobsClient { - /** - * Provides a pageable list of jobs. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Job resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName); - - /** - * Provides a pageable list of jobs. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Job resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName, String filter, String skipToken, - Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupOperationResultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupOperationResultsClient.java deleted file mode 100644 index 5f5c850e4693..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupOperationResultsClient.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * An instance of this class provides access to all the operations defined in BackupOperationResultsClient. - */ -public interface BackupOperationResultsClient { - /** - * Provides the status of the delete operations such as deleting backed up item. Once the operation has started, the - * status code in the response would be Accepted. It will continue to be in this state till it reaches completion. - * On - * successful completion, the status code will be OK. This method expects OperationID as an argument. OperationID is - * part of the Location header of the operation response. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, String operationId, Context context); - - /** - * Provides the status of the delete operations such as deleting backed up item. Once the operation has started, the - * status code in the response would be Accepted. It will continue to be in this state till it reaches completion. - * On - * successful completion, the status code will be OK. This method expects OperationID as an argument. OperationID is - * part of the Location header of the operation response. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void get(String vaultName, String resourceGroupName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupOperationStatusesClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupOperationStatusesClient.java deleted file mode 100644 index 34e204ebad92..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupOperationStatusesClient.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; - -/** - * An instance of this class provides access to all the operations defined in BackupOperationStatusesClient. - */ -public interface BackupOperationStatusesClient { - /** - * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations - * create jobs. This method returns the list of jobs when the operation is complete. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, String operationId, - Context context); - - /** - * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations - * create jobs. This method returns the list of jobs when the operation is complete. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusInner get(String vaultName, String resourceGroupName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupPoliciesClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupPoliciesClient.java deleted file mode 100644 index 7ff7ffe64d8f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupPoliciesClient.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; - -/** - * An instance of this class provides access to all the operations defined in BackupPoliciesClient. - */ -public interface BackupPoliciesClient { - /** - * Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch - * scoped results. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionPolicy resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName); - - /** - * Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch - * scoped results. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionPolicy resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName, String filter, - Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectableItemsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectableItemsClient.java deleted file mode 100644 index e22f75cefc6a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectableItemsClient.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadProtectableItemResourceInner; - -/** - * An instance of this class provides access to all the operations defined in BackupProtectableItemsClient. - */ -public interface BackupProtectableItemsClient { - /** - * Provides a pageable list of protectable objects within your subscription according to the query filter and the - * pagination parameters. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadProtectableItem resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName); - - /** - * Provides a pageable list of protectable objects within your subscription according to the query filter and the - * pagination parameters. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadProtectableItem resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName, String filter, - String skipToken, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectedItemsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectedItemsClient.java deleted file mode 100644 index 568996aa1a40..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectedItemsClient.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; - -/** - * An instance of this class provides access to all the operations defined in BackupProtectedItemsClient. - */ -public interface BackupProtectedItemsClient { - /** - * Provides a pageable list of all items that are backed up within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectedItem resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName); - - /** - * Provides a pageable list of all items that are backed up within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectedItem resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName, String filter, - String skipToken, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectionContainersClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectionContainersClient.java deleted file mode 100644 index c677861318fc..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectionContainersClient.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; - -/** - * An instance of this class provides access to all the operations defined in BackupProtectionContainersClient. - */ -public interface BackupProtectionContainersClient { - /** - * Lists the containers registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName); - - /** - * Lists the containers registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName, String filter, - Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectionIntentsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectionIntentsClient.java deleted file mode 100644 index 82f4e78b1909..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectionIntentsClient.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionIntentResourceInner; - -/** - * An instance of this class provides access to all the operations defined in BackupProtectionIntentsClient. - */ -public interface BackupProtectionIntentsClient { - /** - * Provides a pageable list of all intents that are present within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionIntent resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName); - - /** - * Provides a pageable list of all intents that are present within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionIntent resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName, String filter, - String skipToken, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceEncryptionConfigsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceEncryptionConfigsClient.java deleted file mode 100644 index 63210b8fc9aa..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceEncryptionConfigsClient.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigExtendedResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigResource; - -/** - * An instance of this class provides access to all the operations defined in BackupResourceEncryptionConfigsClient. - */ -public interface BackupResourceEncryptionConfigsClient { - /** - * Fetches Vault Encryption config. - * - * @param vaultName The name of the VaultResource. - * @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 the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, - String resourceGroupName, Context context); - - /** - * Fetches Vault Encryption config. - * - * @param vaultName The name of the VaultResource. - * @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 the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupResourceEncryptionConfigExtendedResourceInner get(String vaultName, String resourceGroupName); - - /** - * Updates Vault encryption config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault encryption input config request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String vaultName, String resourceGroupName, - BackupResourceEncryptionConfigResource parameters, Context context); - - /** - * Updates Vault encryption config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault encryption input config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void update(String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResource parameters); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceStorageConfigsNonCrrsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceStorageConfigsNonCrrsClient.java deleted file mode 100644 index cf503ca82a88..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceStorageConfigsNonCrrsClient.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner; - -/** - * An instance of this class provides access to all the operations defined in BackupResourceStorageConfigsNonCrrsClient. - */ -public interface BackupResourceStorageConfigsNonCrrsClient { - /** - * Fetches resource storage config. - * - * @param vaultName The name of the VaultResource. - * @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 the resource storage details along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, - Context context); - - /** - * Fetches resource storage config. - * - * @param vaultName The name of the VaultResource. - * @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 the resource storage details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupResourceConfigResourceInner get(String vaultName, String resourceGroupName); - - /** - * Updates vault storage model type. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault storage config request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource storage details along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String vaultName, String resourceGroupName, - BackupResourceConfigResourceInner parameters, Context context); - - /** - * Updates vault storage model type. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault storage config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource storage details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupResourceConfigResourceInner update(String vaultName, String resourceGroupName, - BackupResourceConfigResourceInner parameters); - - /** - * Updates vault storage model type. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault storage config request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response patchWithResponse(String vaultName, String resourceGroupName, - BackupResourceConfigResourceInner parameters, Context context); - - /** - * Updates vault storage model type. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault storage config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void patch(String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceVaultConfigsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceVaultConfigsClient.java deleted file mode 100644 index 62c6d7ea1373..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupResourceVaultConfigsClient.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceVaultConfigResourceInner; - -/** - * An instance of this class provides access to all the operations defined in BackupResourceVaultConfigsClient. - */ -public interface BackupResourceVaultConfigsClient { - /** - * Fetches resource vault config. - * - * @param vaultName The name of the VaultResource. - * @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 backup resource vault config details along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, - Context context); - - /** - * Fetches resource vault config. - * - * @param vaultName The name of the VaultResource. - * @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 backup resource vault config details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupResourceVaultConfigResourceInner get(String vaultName, String resourceGroupName); - - /** - * Updates vault security config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource config request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup resource vault config details along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response putWithResponse(String vaultName, String resourceGroupName, - BackupResourceVaultConfigResourceInner parameters, Context context); - - /** - * Updates vault security config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup resource vault config details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupResourceVaultConfigResourceInner put(String vaultName, String resourceGroupName, - BackupResourceVaultConfigResourceInner parameters); - - /** - * Updates vault security config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource config request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup resource vault config details along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String vaultName, String resourceGroupName, - BackupResourceVaultConfigResourceInner parameters, Context context); - - /** - * Updates vault security config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup resource vault config details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupResourceVaultConfigResourceInner update(String vaultName, String resourceGroupName, - BackupResourceVaultConfigResourceInner parameters); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupStatusClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupStatusClient.java deleted file mode 100644 index 0e5acd72ed4c..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupStatusClient.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupStatusResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupStatusRequest; - -/** - * An instance of this class provides access to all the operations defined in BackupStatusClient. - */ -public interface BackupStatusClient { - /** - * Get the container backup status. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Container Backup Status Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the container backup status along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String azureRegion, BackupStatusRequest parameters, - Context context); - - /** - * Get the container backup status. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Container Backup Status Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the container backup status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupStatusResponseInner get(String azureRegion, BackupStatusRequest parameters); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupUsageSummariesClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupUsageSummariesClient.java deleted file mode 100644 index 828878881df4..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupUsageSummariesClient.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupManagementUsageInner; - -/** - * An instance of this class provides access to all the operations defined in BackupUsageSummariesClient. - */ -public interface BackupUsageSummariesClient { - /** - * Fetches the backup management usage summaries of the vault. - * - * @param vaultName The name of the recovery services vault. - * @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 backup management usage for vault as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName); - - /** - * Fetches the backup management usage summaries of the vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup management usage for vault as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName, String filter, - String skipToken, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupWorkloadItemsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupWorkloadItemsClient.java deleted file mode 100644 index 8bd383448336..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupWorkloadItemsClient.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadItemResourceInner; - -/** - * An instance of this class provides access to all the operations defined in BackupWorkloadItemsClient. - */ -public interface BackupWorkloadItemsClient { - /** - * Provides a pageable list of workload item of a specific container according to the query filter and the - * pagination - * parameters. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadItem resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName); - - /** - * Provides a pageable list of workload item of a specific container according to the query filter and the - * pagination - * parameters. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadItem resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName, String filter, String skipToken, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupsClient.java deleted file mode 100644 index 4c4cbd0998cd..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupsClient.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupRequestResource; - -/** - * An instance of this class provides access to all the operations defined in BackupsClient. - */ -public interface BackupsClient { - /** - * Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the - * operation, call GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters resource backup request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response triggerWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, BackupRequestResource parameters, Context context); - - /** - * Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the - * operation, call GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters resource backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void trigger(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, BackupRequestResource parameters); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BmsPrepareDataMoveOperationResultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BmsPrepareDataMoveOperationResultsClient.java deleted file mode 100644 index 4f1170f70b9c..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BmsPrepareDataMoveOperationResultsClient.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.VaultStorageConfigOperationResultResponseInner; - -/** - * An instance of this class provides access to all the operations defined in BmsPrepareDataMoveOperationResultsClient. - */ -public interface BmsPrepareDataMoveOperationResultsClient { - /** - * Fetches operation status for data move operation on vault. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the BackupResourceConfigResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation result response for Vault Storage Config along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, - String operationId, Context context); - - /** - * Fetches operation status for data move operation on vault. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the BackupResourceConfigResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation result response for Vault Storage Config. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - VaultStorageConfigOperationResultResponseInner get(String vaultName, String resourceGroupName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/DeletedProtectionContainersClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/DeletedProtectionContainersClient.java deleted file mode 100644 index 624f241c505a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/DeletedProtectionContainersClient.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; - -/** - * An instance of this class provides access to all the operations defined in DeletedProtectionContainersClient. - */ -public interface DeletedProtectionContainersClient { - /** - * Lists the soft deleted containers registered to Recovery Services Vault. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String vaultName); - - /** - * Lists the soft deleted containers registered to Recovery Services Vault. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String vaultName, String filter, - Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ExportJobsOperationResultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ExportJobsOperationResultsClient.java deleted file mode 100644 index 845a68ee6946..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ExportJobsOperationResultsClient.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationResultInfoBaseResourceInner; - -/** - * An instance of this class provides access to all the operations defined in ExportJobsOperationResultsClient. - */ -public interface ExportJobsOperationResultsClient { - /** - * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also - * contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized - * format. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the JobResource. - * @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 operation result of operation triggered by Export Jobs API along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, - String operationId, Context context); - - /** - * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also - * contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized - * format. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the JobResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result of operation triggered by Export Jobs API. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationResultInfoBaseResourceInner get(String vaultName, String resourceGroupName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/FeatureSupportsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/FeatureSupportsClient.java deleted file mode 100644 index 04d8d53dfc96..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/FeatureSupportsClient.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AzureVMResourceFeatureSupportResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.FeatureSupportRequest; - -/** - * An instance of this class provides access to all the operations defined in FeatureSupportsClient. - */ -public interface FeatureSupportsClient { - /** - * It will validate if given feature with resource properties is supported in service. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Feature support request object. - * @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 response for feature support requests for Azure IaasVm along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response validateWithResponse(String azureRegion, - FeatureSupportRequest parameters, Context context); - - /** - * It will validate if given feature with resource properties is supported in service. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Feature support request object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 for feature support requests for Azure IaasVm. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureVMResourceFeatureSupportResponseInner validate(String azureRegion, FeatureSupportRequest parameters); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/FetchTieringCostsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/FetchTieringCostsClient.java deleted file mode 100644 index 0b91fc9c5fd5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/FetchTieringCostsClient.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TieringCostInfoInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.FetchTieringCostInfoRequest; - -/** - * An instance of this class provides access to all the operations defined in FetchTieringCostsClient. - */ -public interface FetchTieringCostsClient { - /** - * Provides the details of the tiering related sizes and cost. - * Status of the operation can be fetched using GetTieringCostOperationStatus API and result using - * GetTieringCostOperationResult API. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param parameters Fetch Tiering Cost Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of base class for tiering cost response. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, TieringCostInfoInner> beginPost(String resourceGroupName, - String vaultName, FetchTieringCostInfoRequest parameters); - - /** - * Provides the details of the tiering related sizes and cost. - * Status of the operation can be fetched using GetTieringCostOperationStatus API and result using - * GetTieringCostOperationResult API. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param parameters Fetch Tiering Cost Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of base class for tiering cost response. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, TieringCostInfoInner> beginPost(String resourceGroupName, - String vaultName, FetchTieringCostInfoRequest parameters, Context context); - - /** - * Provides the details of the tiering related sizes and cost. - * Status of the operation can be fetched using GetTieringCostOperationStatus API and result using - * GetTieringCostOperationResult API. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param parameters Fetch Tiering Cost Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for tiering cost response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TieringCostInfoInner post(String resourceGroupName, String vaultName, FetchTieringCostInfoRequest parameters); - - /** - * Provides the details of the tiering related sizes and cost. - * Status of the operation can be fetched using GetTieringCostOperationStatus API and result using - * GetTieringCostOperationResult API. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param parameters Fetch Tiering Cost Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for tiering cost response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TieringCostInfoInner post(String resourceGroupName, String vaultName, FetchTieringCostInfoRequest parameters, - Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/GetTieringCostOperationResultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/GetTieringCostOperationResultsClient.java deleted file mode 100644 index f0e996f218bb..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/GetTieringCostOperationResultsClient.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TieringCostInfoInner; - -/** - * An instance of this class provides access to all the operations defined in GetTieringCostOperationResultsClient. - */ -public interface GetTieringCostOperationResultsClient { - /** - * Gets the result of async operation for tiering cost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param operationId The operationId 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 result of async operation for tiering cost along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String vaultName, String operationId, - Context context); - - /** - * Gets the result of async operation for tiering cost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param operationId The operationId 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 result of async operation for tiering cost. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TieringCostInfoInner get(String resourceGroupName, String vaultName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ItemLevelRecoveryConnectionsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ItemLevelRecoveryConnectionsClient.java deleted file mode 100644 index 496af3cdaa1f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ItemLevelRecoveryConnectionsClient.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.models.IlrRequestResource; - -/** - * An instance of this class provides access to all the operations defined in ItemLevelRecoveryConnectionsClient. - */ -public interface ItemLevelRecoveryConnectionsClient { - /** - * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a file - * explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status - * of - * provisioning, call GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource ILR request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response provisionWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId, IlrRequestResource parameters, - Context context); - - /** - * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a file - * explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status - * of - * provisioning, call GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource ILR request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void provision(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, IlrRequestResource parameters); - - /** - * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer - * displaying all recoverable files and folders. This is an asynchronous operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response revokeWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId, Context context); - - /** - * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer - * displaying all recoverable files and folders. This is an asynchronous operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void revoke(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobCancellationsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobCancellationsClient.java deleted file mode 100644 index 46268b3c813a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobCancellationsClient.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * An instance of this class provides access to all the operations defined in JobCancellationsClient. - */ -public interface JobCancellationsClient { - /** - * Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call - * GetCancelOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Name of the job whose details are to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response triggerWithResponse(String vaultName, String resourceGroupName, String jobName, Context context); - - /** - * Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call - * GetCancelOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Name of the job whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void trigger(String vaultName, String resourceGroupName, String jobName); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobDetailsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobDetailsClient.java deleted file mode 100644 index ac4aaf22ee46..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobDetailsClient.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; - -/** - * An instance of this class provides access to all the operations defined in JobDetailsClient. - */ -public interface JobDetailsClient { - /** - * Gets extended information associated with the job. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Name of the job whose details are to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extended information associated with the job along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, String jobName, - Context context); - - /** - * Gets extended information associated with the job. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Name of the job whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extended information associated with the job. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - JobResourceInner get(String vaultName, String resourceGroupName, String jobName); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobOperationResultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobOperationResultsClient.java deleted file mode 100644 index 5b6844050255..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobOperationResultsClient.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * An instance of this class provides access to all the operations defined in JobOperationResultsClient. - */ -public interface JobOperationResultsClient { - /** - * Fetches the result of any operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName The name of the JobResource. - * @param operationId The name of the JobResource. - * @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 getWithResponse(String vaultName, String resourceGroupName, String jobName, String operationId, - Context context); - - /** - * Fetches the result of any operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName The name of the JobResource. - * @param operationId The name of the JobResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void get(String vaultName, String resourceGroupName, String jobName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobsClient.java deleted file mode 100644 index 80d2e6efc93d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobsClient.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * An instance of this class provides access to all the operations defined in JobsClient. - */ -public interface JobsClient { - /** - * Triggers export of jobs specified by filters and returns an OperationID to track. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response exportWithResponse(String vaultName, String resourceGroupName, String filter, Context context); - - /** - * Triggers export of jobs specified by filters and returns an OperationID to track. - * - * @param vaultName The name of the recovery services vault. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void export(String vaultName, String resourceGroupName); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationOperationsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationOperationsClient.java deleted file mode 100644 index 1605f4b0e651..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationOperationsClient.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequestResource; - -/** - * An instance of this class provides access to all the operations defined in OperationOperationsClient. - */ -public interface OperationOperationsClient { - /** - * Validate operation for specified backed up item. This is a synchronous operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response validateWithResponse(String vaultName, String resourceGroupName, - ValidateOperationRequestResource parameters, Context context); - - /** - * Validate operation for specified backed up item. This is a synchronous operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ValidateOperationsResponseInner validate(String vaultName, String resourceGroupName, - ValidateOperationRequestResource parameters); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationsClient.java deleted file mode 100644 index 666357241a9a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationsClient.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ClientDiscoveryValueForSingleApiInner; - -/** - * An instance of this class provides access to all the operations defined in OperationsClient. - */ -public interface OperationsClient { - /** - * List the operations for the provider. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List the operations for the provider. - * - * @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 operations List response which contains list of available APIs as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/PrivateEndpointConnectionsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/PrivateEndpointConnectionsClient.java deleted file mode 100644 index 53660a836cda..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/PrivateEndpointConnectionsClient.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.PrivateEndpointConnectionResourceInner; - -/** - * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. - */ -public interface PrivateEndpointConnectionsClient { - /** - * Get Private Endpoint Connection. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @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 private Endpoint Connection along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, - String privateEndpointConnectionName, Context context); - - /** - * Get Private Endpoint Connection. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionResourceInner get(String vaultName, String resourceGroupName, - String privateEndpointConnectionName); - - /** - * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of private Endpoint Connection Response Properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, PrivateEndpointConnectionResourceInner> beginPut( - String vaultName, String resourceGroupName, String privateEndpointConnectionName, - PrivateEndpointConnectionResourceInner parameters); - - /** - * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Request body for operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of private Endpoint Connection Response Properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, PrivateEndpointConnectionResourceInner> beginPut( - String vaultName, String resourceGroupName, String privateEndpointConnectionName, - PrivateEndpointConnectionResourceInner parameters, Context context); - - /** - * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection Response Properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionResourceInner put(String vaultName, String resourceGroupName, - String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters); - - /** - * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Request body for operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection Response Properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionResourceInner put(String vaultName, String resourceGroupName, - String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters, Context context); - - /** - * Delete Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 vaultName, String resourceGroupName, - String privateEndpointConnectionName); - - /** - * Delete Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @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 vaultName, String resourceGroupName, - String privateEndpointConnectionName, Context context); - - /** - * Delete Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 vaultName, String resourceGroupName, String privateEndpointConnectionName); - - /** - * Delete Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @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 vaultName, String resourceGroupName, String privateEndpointConnectionName, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/PrivateEndpointsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/PrivateEndpointsClient.java deleted file mode 100644 index d3b0058c8e32..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/PrivateEndpointsClient.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; - -/** - * An instance of this class provides access to all the operations defined in PrivateEndpointsClient. - */ -public interface PrivateEndpointsClient { - /** - * Gets the operation status for a private endpoint connection. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the PrivateEndpointConnectionResource. - * @param operationId The name of the PrivateEndpointConnectionResource. - * @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 operation status for a private endpoint connection along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getOperationStatusWithResponse(String vaultName, String resourceGroupName, - String privateEndpointConnectionName, String operationId, Context context); - - /** - * Gets the operation status for a private endpoint connection. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the PrivateEndpointConnectionResource. - * @param operationId The name of the PrivateEndpointConnectionResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation status for a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusInner getOperationStatus(String vaultName, String resourceGroupName, - String privateEndpointConnectionName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectableContainersClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectableContainersClient.java deleted file mode 100644 index 5ddd54a353af..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectableContainersClient.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectableContainerResourceInner; - -/** - * An instance of this class provides access to all the operations defined in ProtectableContainersClient. - */ -public interface ProtectableContainersClient { - /** - * Lists the containers that can be registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The fabricName 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 list of ProtectableContainer resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName, - String fabricName); - - /** - * Lists the containers that can be registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The fabricName parameter. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectableContainer resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String filter, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemOperationResultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemOperationResultsClient.java deleted file mode 100644 index adbd5d0278fa..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemOperationResultsClient.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; - -/** - * An instance of this class provides access to all the operations defined in ProtectedItemOperationResultsClient. - */ -public interface ProtectedItemOperationResultsClient { - /** - * Fetches the result of any operation on the backup item. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param protectedItemName The name of the ProtectedItemResource. - * @param operationId The name of the ProtectedItemResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String operationId, Context context); - - /** - * Fetches the result of any operation on the backup item. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param protectedItemName The name of the ProtectedItemResource. - * @param operationId The name of the ProtectedItemResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProtectedItemResourceInner get(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemOperationStatusesClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemOperationStatusesClient.java deleted file mode 100644 index b3bac26cbb34..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemOperationStatusesClient.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; - -/** - * An instance of this class provides access to all the operations defined in ProtectedItemOperationStatusesClient. - */ -public interface ProtectedItemOperationStatusesClient { - /** - * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some - * operations - * create jobs. This method returns the list of jobs associated with the operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param protectedItemName The name of the ProtectedItemResource. - * @param operationId The name of the ProtectedItemResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String operationId, Context context); - - /** - * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some - * operations - * create jobs. This method returns the list of jobs associated with the operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param protectedItemName The name of the ProtectedItemResource. - * @param operationId The name of the ProtectedItemResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusInner get(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemsClient.java deleted file mode 100644 index a338c1f8416e..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemsClient.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; - -/** - * An instance of this class provides access to all the operations defined in ProtectedItemsClient. - */ -public interface ProtectedItemsClient { - /** - * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the - * operation, - * call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String filter, Context context); - - /** - * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the - * operation, - * call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProtectedItemResourceInner get(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName); - - /** - * Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an - * asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters resource backed up item. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of base class for backup items. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProtectedItemResourceInner> beginCreateOrUpdate(String vaultName, - String resourceGroupName, String fabricName, String containerName, String protectedItemName, - ProtectedItemResourceInner parameters); - - /** - * Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an - * asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters resource backed up item. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of base class for backup items. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProtectedItemResourceInner> beginCreateOrUpdate(String vaultName, - String resourceGroupName, String fabricName, String containerName, String protectedItemName, - ProtectedItemResourceInner parameters, Context context); - - /** - * Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an - * asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters resource backed up item. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProtectedItemResourceInner createOrUpdate(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, ProtectedItemResourceInner parameters); - - /** - * Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an - * asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters resource backed up item. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProtectedItemResourceInner createOrUpdate(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, ProtectedItemResourceInner parameters, Context context); - - /** - * Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of - * the - * request, call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, Context context); - - /** - * Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of - * the - * request, call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionContainerOperationResultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionContainerOperationResultsClient.java deleted file mode 100644 index 4b8205a54885..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionContainerOperationResultsClient.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; - -/** - * An instance of this class provides access to all the operations defined in ProtectionContainerOperationResultsClient. - */ -public interface ProtectionContainerOperationResultsClient { - /** - * Fetches the result of any operation on the container. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param operationId The name of the ProtectionContainerResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for container with backup items along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, - String fabricName, String containerName, String operationId, Context context); - - /** - * Fetches the result of any operation on the container. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param operationId The name of the ProtectionContainerResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for container with backup items. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProtectionContainerResourceInner get(String vaultName, String resourceGroupName, String fabricName, - String containerName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionContainerRefreshOperationResultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionContainerRefreshOperationResultsClient.java deleted file mode 100644 index fe5847d07330..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionContainerRefreshOperationResultsClient.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * An instance of this class provides access to all the operations defined in - * ProtectionContainerRefreshOperationResultsClient. - */ -public interface ProtectionContainerRefreshOperationResultsClient { - /** - * Provides the result of the refresh operation triggered by the BeginRefresh operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName Fabric name associated with the container. - * @param operationId Operation ID associated with the operation whose result needs to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, String fabricName, String operationId, - Context context); - - /** - * Provides the result of the refresh operation triggered by the BeginRefresh operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName Fabric name associated with the container. - * @param operationId Operation ID associated with the operation whose result needs to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void get(String vaultName, String resourceGroupName, String fabricName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionContainersClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionContainersClient.java deleted file mode 100644 index 218446294f6f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionContainersClient.java +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; - -/** - * An instance of this class provides access to all the operations defined in ProtectionContainersClient. - */ -public interface ProtectionContainersClient { - /** - * Gets details of the specific container registered to your Recovery Services Vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of the specific container registered to your Recovery Services Vault along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, - String fabricName, String containerName, Context context); - - /** - * Gets details of the specific container registered to your Recovery Services Vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of the specific container registered to your Recovery Services Vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProtectionContainerResourceInner get(String vaultName, String resourceGroupName, String fabricName, - String containerName); - - /** - * Registers the container with Recovery Services vault. - * This is an asynchronous operation. To track the operation status, use location header to call get latest status - * of - * the operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of base class for container with backup items. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProtectionContainerResourceInner> beginRegister( - String vaultName, String resourceGroupName, String fabricName, String containerName, - ProtectionContainerResourceInner parameters); - - /** - * Registers the container with Recovery Services vault. - * This is an asynchronous operation. To track the operation status, use location header to call get latest status - * of - * the operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param parameters Request body for operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of base class for container with backup items. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProtectionContainerResourceInner> beginRegister( - String vaultName, String resourceGroupName, String fabricName, String containerName, - ProtectionContainerResourceInner parameters, Context context); - - /** - * Registers the container with Recovery Services vault. - * This is an asynchronous operation. To track the operation status, use location header to call get latest status - * of - * the operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for container with backup items. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProtectionContainerResourceInner register(String vaultName, String resourceGroupName, String fabricName, - String containerName, ProtectionContainerResourceInner parameters); - - /** - * Registers the container with Recovery Services vault. - * This is an asynchronous operation. To track the operation status, use location header to call get latest status - * of - * the operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param parameters Request body for operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for container with backup items. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProtectionContainerResourceInner register(String vaultName, String resourceGroupName, String fabricName, - String containerName, ProtectionContainerResourceInner parameters, Context context); - - /** - * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To - * determine - * whether the backend service has finished processing the request, call Get Container Operation Result API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response unregisterWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, Context context); - - /** - * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To - * determine - * whether the backend service has finished processing the request, call Get Container Operation Result API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void unregister(String vaultName, String resourceGroupName, String fabricName, String containerName); - - /** - * This is an async operation and the results should be tracked using location header or Azure-async-url. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response inquireWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String filter, Context context); - - /** - * This is an async operation and the results should be tracked using location header or Azure-async-url. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void inquire(String vaultName, String resourceGroupName, String fabricName, String containerName); - - /** - * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an - * asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName Fabric name associated the container. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response refreshWithResponse(String vaultName, String resourceGroupName, String fabricName, String filter, - Context context); - - /** - * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an - * asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName Fabric name associated the container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 refresh(String vaultName, String resourceGroupName, String fabricName); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionIntentsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionIntentsClient.java deleted file mode 100644 index 3d1ce92f71b0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionIntentsClient.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.PreValidateEnableBackupResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionIntentResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.PreValidateEnableBackupRequest; - -/** - * An instance of this class provides access to all the operations defined in ProtectionIntentsClient. - */ -public interface ProtectionIntentsClient { - /** - * Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of - * the operation, - * call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup ProtectionIntent along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, - String fabricName, String intentObjectName, Context context); - - /** - * Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of - * the operation, - * call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup ProtectionIntent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProtectionIntentResourceInner get(String vaultName, String resourceGroupName, String fabricName, - String intentObjectName); - - /** - * Create Intent for Enabling backup of an item. This is a synchronous operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @param parameters resource backed up item. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup ProtectionIntent along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String vaultName, String resourceGroupName, - String fabricName, String intentObjectName, ProtectionIntentResourceInner parameters, Context context); - - /** - * Create Intent for Enabling backup of an item. This is a synchronous operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @param parameters resource backed up item. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup ProtectionIntent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProtectionIntentResourceInner createOrUpdate(String vaultName, String resourceGroupName, String fabricName, - String intentObjectName, ProtectionIntentResourceInner parameters); - - /** - * Used to remove intent from an item. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String vaultName, String resourceGroupName, String fabricName, - String intentObjectName, Context context); - - /** - * Used to remove intent from an item. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String vaultName, String resourceGroupName, String fabricName, String intentObjectName); - - /** - * It will validate followings - * 1. Vault capacity - * 2. VM is already protected - * 3. Any VM related configuration passed in properties. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Enable backup validation request on Virtual Machine. - * @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 response contract for enable backup validation request along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response validateWithResponse(String azureRegion, - PreValidateEnableBackupRequest parameters, Context context); - - /** - * It will validate followings - * 1. Vault capacity - * 2. VM is already protected - * 3. Any VM related configuration passed in properties. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Enable backup validation request on Virtual Machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 contract for enable backup validation request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PreValidateEnableBackupResponseInner validate(String azureRegion, PreValidateEnableBackupRequest parameters); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPoliciesClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPoliciesClient.java deleted file mode 100644 index 1537bf0a1601..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPoliciesClient.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; - -/** - * An instance of this class provides access to all the operations defined in ProtectionPoliciesClient. - */ -public interface ProtectionPoliciesClient { - /** - * Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous - * operation. Status of the operation can be fetched using GetPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, - String policyName, Context context); - - /** - * Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous - * operation. Status of the operation can be fetched using GetPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProtectionPolicyResourceInner get(String vaultName, String resourceGroupName, String policyName); - - /** - * Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched - * using GetPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @param parameters resource backup policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String vaultName, String resourceGroupName, - String policyName, ProtectionPolicyResourceInner parameters, Context context); - - /** - * Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched - * using GetPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @param parameters resource backup policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProtectionPolicyResourceInner createOrUpdate(String vaultName, String resourceGroupName, String policyName, - ProtectionPolicyResourceInner parameters); - - /** - * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of - * the - * operation can be fetched using GetProtectionPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String vaultName, String resourceGroupName, String policyName); - - /** - * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of - * the - * operation can be fetched using GetProtectionPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String vaultName, String resourceGroupName, String policyName, - Context context); - - /** - * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of - * the - * operation can be fetched using GetProtectionPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String vaultName, String resourceGroupName, String policyName); - - /** - * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of - * the - * operation can be fetched using GetProtectionPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String vaultName, String resourceGroupName, String policyName, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPolicyOperationResultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPolicyOperationResultsClient.java deleted file mode 100644 index 685f94eaba2a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPolicyOperationResultsClient.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; - -/** - * An instance of this class provides access to all the operations defined in ProtectionPolicyOperationResultsClient. - */ -public interface ProtectionPolicyOperationResultsClient { - /** - * Provides the result of an operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName The name of the ProtectionPolicyResource. - * @param operationId The name of the ProtectionPolicyResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, - String policyName, String operationId, Context context); - - /** - * Provides the result of an operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName The name of the ProtectionPolicyResource. - * @param operationId The name of the ProtectionPolicyResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProtectionPolicyResourceInner get(String vaultName, String resourceGroupName, String policyName, - String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPolicyOperationStatusesClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPolicyOperationStatusesClient.java deleted file mode 100644 index 5dd0a4aa8798..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectionPolicyOperationStatusesClient.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; - -/** - * An instance of this class provides access to all the operations defined in ProtectionPolicyOperationStatusesClient. - */ -public interface ProtectionPolicyOperationStatusesClient { - /** - * Provides the status of the asynchronous operations like backup, restore. The status can be in progress, completed - * or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some - * operations - * create jobs. This method returns the list of jobs associated with operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName The name of the ProtectionPolicyResource. - * @param operationId The name of the ProtectionPolicyResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, String policyName, - String operationId, Context context); - - /** - * Provides the status of the asynchronous operations like backup, restore. The status can be in progress, completed - * or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some - * operations - * create jobs. This method returns the list of jobs associated with operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName The name of the ProtectionPolicyResource. - * @param operationId The name of the ProtectionPolicyResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusInner get(String vaultName, String resourceGroupName, String policyName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsClient.java deleted file mode 100644 index 5fad2408774b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsClient.java +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.UpdateRecoveryPointRequest; - -/** - * An instance of this class provides access to all the operations defined in RecoveryPointsClient. - */ -public interface RecoveryPointsClient { - /** - * Provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous - * operation. - * To know the status of the operation, call the GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup copies along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId, Context context); - - /** - * Provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous - * operation. - * To know the status of the operation, call the GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup copies. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RecoveryPointResourceInner get(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId); - - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName); - - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String filter, Context context); - - /** - * UpdateRecoveryPoint to update recovery point for given RecoveryPointID. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the VaultResource. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Request body for operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup copies along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String vaultName, - String fabricName, String containerName, String protectedItemName, String recoveryPointId, - UpdateRecoveryPointRequest parameters, Context context); - - /** - * UpdateRecoveryPoint to update recovery point for given RecoveryPointID. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the VaultResource. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup copies. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RecoveryPointResourceInner update(String resourceGroupName, String vaultName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId, UpdateRecoveryPointRequest parameters); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsRecommendedForMovesClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsRecommendedForMovesClient.java deleted file mode 100644 index 495487b3e183..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryPointsRecommendedForMovesClient.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ListRecoveryPointsRecommendedForMoveRequest; - -/** - * An instance of this class provides access to all the operations defined in RecoveryPointsRecommendedForMovesClient. - */ -public interface RecoveryPointsRecommendedForMovesClient { - /** - * Lists the recovery points recommended for move to another tier. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters List Recovery points Recommended for Move Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, ListRecoveryPointsRecommendedForMoveRequest parameters); - - /** - * Lists the recovery points recommended for move to another tier. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters List Recovery points Recommended for Move Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, ListRecoveryPointsRecommendedForMoveRequest parameters, - Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryServicesBackupManagementClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryServicesBackupManagementClient.java deleted file mode 100644 index 4fbf3fbeea52..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryServicesBackupManagementClient.java +++ /dev/null @@ -1,412 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** - * The interface for RecoveryServicesBackupManagementClient class. - */ -public interface RecoveryServicesBackupManagementClient { - /** - * Gets Service host. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * 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. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the ResourceProvidersClient object to access its operations. - * - * @return the ResourceProvidersClient object. - */ - ResourceProvidersClient getResourceProviders(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - - /** - * Gets the BackupResourceStorageConfigsNonCrrsClient object to access its operations. - * - * @return the BackupResourceStorageConfigsNonCrrsClient object. - */ - BackupResourceStorageConfigsNonCrrsClient getBackupResourceStorageConfigsNonCrrs(); - - /** - * Gets the BmsPrepareDataMoveOperationResultsClient object to access its operations. - * - * @return the BmsPrepareDataMoveOperationResultsClient object. - */ - BmsPrepareDataMoveOperationResultsClient getBmsPrepareDataMoveOperationResults(); - - /** - * Gets the BackupResourceVaultConfigsClient object to access its operations. - * - * @return the BackupResourceVaultConfigsClient object. - */ - BackupResourceVaultConfigsClient getBackupResourceVaultConfigs(); - - /** - * Gets the BackupResourceEncryptionConfigsClient object to access its operations. - * - * @return the BackupResourceEncryptionConfigsClient object. - */ - BackupResourceEncryptionConfigsClient getBackupResourceEncryptionConfigs(); - - /** - * Gets the ProtectedItemsClient object to access its operations. - * - * @return the ProtectedItemsClient object. - */ - ProtectedItemsClient getProtectedItems(); - - /** - * Gets the BackupsClient object to access its operations. - * - * @return the BackupsClient object. - */ - BackupsClient getBackups(); - - /** - * Gets the RecoveryPointsRecommendedForMovesClient object to access its operations. - * - * @return the RecoveryPointsRecommendedForMovesClient object. - */ - RecoveryPointsRecommendedForMovesClient getRecoveryPointsRecommendedForMoves(); - - /** - * Gets the ProtectedItemOperationStatusesClient object to access its operations. - * - * @return the ProtectedItemOperationStatusesClient object. - */ - ProtectedItemOperationStatusesClient getProtectedItemOperationStatuses(); - - /** - * Gets the ProtectedItemOperationResultsClient object to access its operations. - * - * @return the ProtectedItemOperationResultsClient object. - */ - ProtectedItemOperationResultsClient getProtectedItemOperationResults(); - - /** - * Gets the ProtectionContainersClient object to access its operations. - * - * @return the ProtectionContainersClient object. - */ - ProtectionContainersClient getProtectionContainers(); - - /** - * Gets the BackupWorkloadItemsClient object to access its operations. - * - * @return the BackupWorkloadItemsClient object. - */ - BackupWorkloadItemsClient getBackupWorkloadItems(); - - /** - * Gets the ProtectionContainerOperationResultsClient object to access its operations. - * - * @return the ProtectionContainerOperationResultsClient object. - */ - ProtectionContainerOperationResultsClient getProtectionContainerOperationResults(); - - /** - * Gets the RecoveryPointsClient object to access its operations. - * - * @return the RecoveryPointsClient object. - */ - RecoveryPointsClient getRecoveryPoints(); - - /** - * Gets the RestoresClient object to access its operations. - * - * @return the RestoresClient object. - */ - RestoresClient getRestores(); - - /** - * Gets the ItemLevelRecoveryConnectionsClient object to access its operations. - * - * @return the ItemLevelRecoveryConnectionsClient object. - */ - ItemLevelRecoveryConnectionsClient getItemLevelRecoveryConnections(); - - /** - * Gets the ProtectionPoliciesClient object to access its operations. - * - * @return the ProtectionPoliciesClient object. - */ - ProtectionPoliciesClient getProtectionPolicies(); - - /** - * Gets the BackupPoliciesClient object to access its operations. - * - * @return the BackupPoliciesClient object. - */ - BackupPoliciesClient getBackupPolicies(); - - /** - * Gets the ProtectionPolicyOperationResultsClient object to access its operations. - * - * @return the ProtectionPolicyOperationResultsClient object. - */ - ProtectionPolicyOperationResultsClient getProtectionPolicyOperationResults(); - - /** - * Gets the ProtectionPolicyOperationStatusesClient object to access its operations. - * - * @return the ProtectionPolicyOperationStatusesClient object. - */ - ProtectionPolicyOperationStatusesClient getProtectionPolicyOperationStatuses(); - - /** - * Gets the JobDetailsClient object to access its operations. - * - * @return the JobDetailsClient object. - */ - JobDetailsClient getJobDetails(); - - /** - * Gets the BackupJobsClient object to access its operations. - * - * @return the BackupJobsClient object. - */ - BackupJobsClient getBackupJobs(); - - /** - * Gets the JobCancellationsClient object to access its operations. - * - * @return the JobCancellationsClient object. - */ - JobCancellationsClient getJobCancellations(); - - /** - * Gets the JobOperationResultsClient object to access its operations. - * - * @return the JobOperationResultsClient object. - */ - JobOperationResultsClient getJobOperationResults(); - - /** - * Gets the ExportJobsOperationResultsClient object to access its operations. - * - * @return the ExportJobsOperationResultsClient object. - */ - ExportJobsOperationResultsClient getExportJobsOperationResults(); - - /** - * Gets the BackupEnginesClient object to access its operations. - * - * @return the BackupEnginesClient object. - */ - BackupEnginesClient getBackupEngines(); - - /** - * Gets the BackupStatusClient object to access its operations. - * - * @return the BackupStatusClient object. - */ - BackupStatusClient getBackupStatus(); - - /** - * Gets the FeatureSupportsClient object to access its operations. - * - * @return the FeatureSupportsClient object. - */ - FeatureSupportsClient getFeatureSupports(); - - /** - * Gets the BackupProtectionIntentsClient object to access its operations. - * - * @return the BackupProtectionIntentsClient object. - */ - BackupProtectionIntentsClient getBackupProtectionIntents(); - - /** - * Gets the BackupUsageSummariesClient object to access its operations. - * - * @return the BackupUsageSummariesClient object. - */ - BackupUsageSummariesClient getBackupUsageSummaries(); - - /** - * Gets the JobsClient object to access its operations. - * - * @return the JobsClient object. - */ - JobsClient getJobs(); - - /** - * Gets the BackupProtectedItemsClient object to access its operations. - * - * @return the BackupProtectedItemsClient object. - */ - BackupProtectedItemsClient getBackupProtectedItems(); - - /** - * Gets the ValidateOperationsClient object to access its operations. - * - * @return the ValidateOperationsClient object. - */ - ValidateOperationsClient getValidateOperations(); - - /** - * Gets the ValidateOperationResultsClient object to access its operations. - * - * @return the ValidateOperationResultsClient object. - */ - ValidateOperationResultsClient getValidateOperationResults(); - - /** - * Gets the ValidateOperationStatusesClient object to access its operations. - * - * @return the ValidateOperationStatusesClient object. - */ - ValidateOperationStatusesClient getValidateOperationStatuses(); - - /** - * Gets the ProtectionContainerRefreshOperationResultsClient object to access its operations. - * - * @return the ProtectionContainerRefreshOperationResultsClient object. - */ - ProtectionContainerRefreshOperationResultsClient getProtectionContainerRefreshOperationResults(); - - /** - * Gets the ProtectableContainersClient object to access its operations. - * - * @return the ProtectableContainersClient object. - */ - ProtectableContainersClient getProtectableContainers(); - - /** - * Gets the BackupOperationResultsClient object to access its operations. - * - * @return the BackupOperationResultsClient object. - */ - BackupOperationResultsClient getBackupOperationResults(); - - /** - * Gets the BackupOperationStatusesClient object to access its operations. - * - * @return the BackupOperationStatusesClient object. - */ - BackupOperationStatusesClient getBackupOperationStatuses(); - - /** - * Gets the BackupProtectableItemsClient object to access its operations. - * - * @return the BackupProtectableItemsClient object. - */ - BackupProtectableItemsClient getBackupProtectableItems(); - - /** - * Gets the BackupProtectionContainersClient object to access its operations. - * - * @return the BackupProtectionContainersClient object. - */ - BackupProtectionContainersClient getBackupProtectionContainers(); - - /** - * Gets the DeletedProtectionContainersClient object to access its operations. - * - * @return the DeletedProtectionContainersClient object. - */ - DeletedProtectionContainersClient getDeletedProtectionContainers(); - - /** - * Gets the SecurityPINsClient object to access its operations. - * - * @return the SecurityPINsClient object. - */ - SecurityPINsClient getSecurityPINs(); - - /** - * Gets the FetchTieringCostsClient object to access its operations. - * - * @return the FetchTieringCostsClient object. - */ - FetchTieringCostsClient getFetchTieringCosts(); - - /** - * Gets the GetTieringCostOperationResultsClient object to access its operations. - * - * @return the GetTieringCostOperationResultsClient object. - */ - GetTieringCostOperationResultsClient getGetTieringCostOperationResults(); - - /** - * Gets the TieringCostOperationStatusClient object to access its operations. - * - * @return the TieringCostOperationStatusClient object. - */ - TieringCostOperationStatusClient getTieringCostOperationStatus(); - - /** - * Gets the ProtectionIntentsClient object to access its operations. - * - * @return the ProtectionIntentsClient object. - */ - ProtectionIntentsClient getProtectionIntents(); - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - PrivateEndpointConnectionsClient getPrivateEndpointConnections(); - - /** - * Gets the PrivateEndpointsClient object to access its operations. - * - * @return the PrivateEndpointsClient object. - */ - PrivateEndpointsClient getPrivateEndpoints(); - - /** - * Gets the ResourceGuardProxyOperationsClient object to access its operations. - * - * @return the ResourceGuardProxyOperationsClient object. - */ - ResourceGuardProxyOperationsClient getResourceGuardProxyOperations(); - - /** - * Gets the OperationOperationsClient object to access its operations. - * - * @return the OperationOperationsClient object. - */ - OperationOperationsClient getOperationOperations(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceGuardProxyOperationsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceGuardProxyOperationsClient.java deleted file mode 100644 index b094676bae14..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceGuardProxyOperationsClient.java +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ResourceGuardProxyBaseResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.UnlockDeleteResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.UnlockDeleteRequest; - -/** - * An instance of this class provides access to all the operations defined in ResourceGuardProxyOperationsClient. - */ -public interface ResourceGuardProxyOperationsClient { - /** - * Returns ResourceGuardProxy under vault and with the name referenced in request. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, - String resourceGuardProxyName, Context context); - - /** - * Returns ResourceGuardProxy under vault and with the name referenced in request. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName 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 response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ResourceGuardProxyBaseResourceInner get(String vaultName, String resourceGroupName, String resourceGuardProxyName); - - /** - * Add or Update ResourceGuardProxy under vault - * Secures vault critical operations. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName parameter. - * @param parameters Request body for operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response putWithResponse(String vaultName, String resourceGroupName, - String resourceGuardProxyName, ResourceGuardProxyBaseResourceInner parameters, Context context); - - /** - * Add or Update ResourceGuardProxy under vault - * Secures vault critical operations. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName parameter. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ResourceGuardProxyBaseResourceInner put(String vaultName, String resourceGroupName, String resourceGuardProxyName, - ResourceGuardProxyBaseResourceInner parameters); - - /** - * Delete ResourceGuardProxy under vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName 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 Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String vaultName, String resourceGroupName, String resourceGuardProxyName, - Context context); - - /** - * Delete ResourceGuardProxy under vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String vaultName, String resourceGroupName, String resourceGuardProxyName); - - /** - * Secures delete ResourceGuardProxy operations. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName parameter. - * @param parameters Request body for operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of Unlock Delete API along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response unlockDeleteWithResponse(String vaultName, String resourceGroupName, - String resourceGuardProxyName, UnlockDeleteRequest parameters, Context context); - - /** - * Secures delete ResourceGuardProxy operations. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName parameter. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of Unlock Delete API. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - UnlockDeleteResponseInner unlockDelete(String vaultName, String resourceGroupName, String resourceGuardProxyName, - UnlockDeleteRequest parameters); - - /** - * List the ResourceGuardProxies under vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ResourceGuardProxyBase resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName); - - /** - * List the ResourceGuardProxies under vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ResourceGuardProxyBase resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String vaultName, String resourceGroupName, - Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceProvidersClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceProvidersClient.java deleted file mode 100644 index 4076cf4ff4b8..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ResourceProvidersClient.java +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.MoveRPAcrossTiersRequest; -import com.azure.resourcemanager.recoveryservicesbackup.models.PrepareDataMoveRequest; -import com.azure.resourcemanager.recoveryservicesbackup.models.TriggerDataMoveRequest; - -/** - * An instance of this class provides access to all the operations defined in ResourceProvidersClient. - */ -public interface ResourceProvidersClient { - /** - * Prepares source vault for Data Move operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Prepare data move request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginBmsPrepareDataMove(String vaultName, String resourceGroupName, - PrepareDataMoveRequest parameters); - - /** - * Prepares source vault for Data Move operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Prepare data move request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginBmsPrepareDataMove(String vaultName, String resourceGroupName, - PrepareDataMoveRequest parameters, Context context); - - /** - * Prepares source vault for Data Move operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Prepare data move request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void bmsPrepareDataMove(String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters); - - /** - * Prepares source vault for Data Move operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Prepare data move request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void bmsPrepareDataMove(String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters, - Context context); - - /** - * Triggers Data Move Operation on target vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Trigger data move request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginBmsTriggerDataMove(String vaultName, String resourceGroupName, - TriggerDataMoveRequest parameters); - - /** - * Triggers Data Move Operation on target vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Trigger data move request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginBmsTriggerDataMove(String vaultName, String resourceGroupName, - TriggerDataMoveRequest parameters, Context context); - - /** - * Triggers Data Move Operation on target vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Trigger data move request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void bmsTriggerDataMove(String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters); - - /** - * Triggers Data Move Operation on target vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Trigger data move request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void bmsTriggerDataMove(String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters, - Context context); - - /** - * Fetches Operation Result for Prepare Data Move. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the BackupResourceConfigResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getOperationStatusWithResponse(String vaultName, String resourceGroupName, - String operationId, Context context); - - /** - * Fetches Operation Result for Prepare Data Move. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the BackupResourceConfigResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusInner getOperationStatus(String vaultName, String resourceGroupName, String operationId); - - /** - * Move recovery point from one datastore to another store. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Move Resource Across Tiers Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginMoveRecoveryPoint(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String recoveryPointId, - MoveRPAcrossTiersRequest parameters); - - /** - * Move recovery point from one datastore to another store. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Move Resource Across Tiers Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginMoveRecoveryPoint(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String recoveryPointId, - MoveRPAcrossTiersRequest parameters, Context context); - - /** - * Move recovery point from one datastore to another store. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Move Resource Across Tiers Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void moveRecoveryPoint(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, MoveRPAcrossTiersRequest parameters); - - /** - * Move recovery point from one datastore to another store. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Move Resource Across Tiers Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void moveRecoveryPoint(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, MoveRPAcrossTiersRequest parameters, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RestoresClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RestoresClient.java deleted file mode 100644 index fb85fcd55fe6..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RestoresClient.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.recoveryservicesbackup.models.RestoreRequestResource; - -/** - * An instance of this class provides access to all the operations defined in RestoresClient. - */ -public interface RestoresClient { - /** - * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, - * use - * GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginTrigger(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId, RestoreRequestResource parameters); - - /** - * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, - * use - * GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginTrigger(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId, RestoreRequestResource parameters, - Context context); - - /** - * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, - * use - * GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void trigger(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, RestoreRequestResource parameters); - - /** - * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, - * use - * GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void trigger(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, RestoreRequestResource parameters, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/SecurityPINsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/SecurityPINsClient.java deleted file mode 100644 index 4ba46a06d262..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/SecurityPINsClient.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TokenInformationInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.SecurityPinBase; - -/** - * An instance of this class provides access to all the operations defined in SecurityPINsClient. - */ -public interface SecurityPINsClient { - /** - * Get the security PIN. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters security pin request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security PIN along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, - SecurityPinBase parameters, Context context); - - /** - * Get the security PIN. - * - * @param vaultName The name of the recovery services vault. - * @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 the security PIN. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TokenInformationInner get(String vaultName, String resourceGroupName); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/TieringCostOperationStatusClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/TieringCostOperationStatusClient.java deleted file mode 100644 index 0ec600be6c37..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/TieringCostOperationStatusClient.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; - -/** - * An instance of this class provides access to all the operations defined in TieringCostOperationStatusClient. - */ -public interface TieringCostOperationStatusClient { - /** - * Gets the status of async operations of tiering cost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param operationId The operationId 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 status of async operations of tiering cost along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String vaultName, String operationId, - Context context); - - /** - * Gets the status of async operations of tiering cost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param operationId The operationId 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 status of async operations of tiering cost. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusInner get(String resourceGroupName, String vaultName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ValidateOperationResultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ValidateOperationResultsClient.java deleted file mode 100644 index 53f413ffb076..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ValidateOperationResultsClient.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; - -/** - * An instance of this class provides access to all the operations defined in ValidateOperationResultsClient. - */ -public interface ValidateOperationResultsClient { - /** - * Fetches the result of a triggered validate operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation whose result needs to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, - String operationId, Context context); - - /** - * Fetches the result of a triggered validate operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation whose result needs to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ValidateOperationsResponseInner get(String vaultName, String resourceGroupName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ValidateOperationStatusesClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ValidateOperationStatusesClient.java deleted file mode 100644 index 9c7c582e180a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ValidateOperationStatusesClient.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; - -/** - * An instance of this class provides access to all the operations defined in ValidateOperationStatusesClient. - */ -public interface ValidateOperationStatusesClient { - /** - * Fetches the status of a triggered validate operation. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. - * If operation has completed, this method returns the list of errors obtained while validating the operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID represents the operation whose status needs to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String vaultName, String resourceGroupName, String operationId, - Context context); - - /** - * Fetches the status of a triggered validate operation. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. - * If operation has completed, this method returns the list of errors obtained while validating the operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID represents the operation whose status needs to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusInner get(String vaultName, String resourceGroupName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ValidateOperationsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ValidateOperationsClient.java deleted file mode 100644 index 64e1486cefd2..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ValidateOperationsClient.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequestResource; - -/** - * An instance of this class provides access to all the operations defined in ValidateOperationsClient. - */ -public interface ValidateOperationsClient { - /** - * Validate operation for specified backed up item in the form of an asynchronous operation. Returns tracking - * headers which can be tracked using GetValidateOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginTrigger(String vaultName, String resourceGroupName, - ValidateOperationRequestResource parameters); - - /** - * Validate operation for specified backed up item in the form of an asynchronous operation. Returns tracking - * headers which can be tracked using GetValidateOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginTrigger(String vaultName, String resourceGroupName, - ValidateOperationRequestResource parameters, Context context); - - /** - * Validate operation for specified backed up item in the form of an asynchronous operation. Returns tracking - * headers which can be tracked using GetValidateOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void trigger(String vaultName, String resourceGroupName, ValidateOperationRequestResource parameters); - - /** - * Validate operation for specified backed up item in the form of an asynchronous operation. Returns tracking - * headers which can be tracked using GetValidateOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void trigger(String vaultName, String resourceGroupName, ValidateOperationRequestResource parameters, - Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/AzureVMResourceFeatureSupportResponseInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/AzureVMResourceFeatureSupportResponseInner.java deleted file mode 100644 index cdfe35e0ec3e..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/AzureVMResourceFeatureSupportResponseInner.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.SupportStatus; -import java.io.IOException; - -/** - * Response for feature support requests for Azure IaasVm. - */ -@Immutable -public final class AzureVMResourceFeatureSupportResponseInner - implements JsonSerializable { - /* - * Support status of feature - */ - private SupportStatus supportStatus; - - /** - * Creates an instance of AzureVMResourceFeatureSupportResponseInner class. - */ - private AzureVMResourceFeatureSupportResponseInner() { - } - - /** - * Get the supportStatus property: Support status of feature. - * - * @return the supportStatus value. - */ - public SupportStatus supportStatus() { - return this.supportStatus; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("supportStatus", this.supportStatus == null ? null : this.supportStatus.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVMResourceFeatureSupportResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVMResourceFeatureSupportResponseInner 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 AzureVMResourceFeatureSupportResponseInner. - */ - public static AzureVMResourceFeatureSupportResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVMResourceFeatureSupportResponseInner deserializedAzureVMResourceFeatureSupportResponseInner - = new AzureVMResourceFeatureSupportResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("supportStatus".equals(fieldName)) { - deserializedAzureVMResourceFeatureSupportResponseInner.supportStatus - = SupportStatus.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVMResourceFeatureSupportResponseInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupEngineBaseResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupEngineBaseResourceInner.java deleted file mode 100644 index 2f64728baee0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupEngineBaseResourceInner.java +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupEngineBase; -import java.io.IOException; -import java.util.Map; - -/** - * The base backup engine class. All workload specific backup engines derive from this class. - */ -@Immutable -public final class BackupEngineBaseResourceInner extends ProxyResource { - /* - * BackupEngineBaseResource properties - */ - private BackupEngineBase properties; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The geo-location where the resource lives - */ - private String location; - - /* - * Optional ETag. - */ - private String etag; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of BackupEngineBaseResourceInner class. - */ - private BackupEngineBaseResourceInner() { - } - - /** - * Get the properties property: BackupEngineBaseResource properties. - * - * @return the properties value. - */ - public BackupEngineBase properties() { - return this.properties; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Get the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the etag property: Optional ETag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeStringField("eTag", this.etag); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupEngineBaseResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupEngineBaseResourceInner 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 BackupEngineBaseResourceInner. - */ - public static BackupEngineBaseResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupEngineBaseResourceInner deserializedBackupEngineBaseResourceInner - = new BackupEngineBaseResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedBackupEngineBaseResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedBackupEngineBaseResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedBackupEngineBaseResourceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedBackupEngineBaseResourceInner.properties = BackupEngineBase.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedBackupEngineBaseResourceInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedBackupEngineBaseResourceInner.location = reader.getString(); - } else if ("eTag".equals(fieldName)) { - deserializedBackupEngineBaseResourceInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedBackupEngineBaseResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupEngineBaseResourceInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupManagementUsageInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupManagementUsageInner.java deleted file mode 100644 index 8e7a084fca9e..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupManagementUsageInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.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 com.azure.resourcemanager.recoveryservicesbackup.models.NameInfo; -import com.azure.resourcemanager.recoveryservicesbackup.models.UsagesUnit; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Backup management usages of a vault. - */ -@Immutable -public final class BackupManagementUsageInner implements JsonSerializable { - /* - * Unit of the usage. - */ - private UsagesUnit unit; - - /* - * Quota period of usage. - */ - private String quotaPeriod; - - /* - * Next reset time of usage. - */ - private OffsetDateTime nextResetTime; - - /* - * Current value of usage. - */ - private Long currentValue; - - /* - * Limit of usage. - */ - private Long limit; - - /* - * Name of usage. - */ - private NameInfo name; - - /** - * Creates an instance of BackupManagementUsageInner class. - */ - private BackupManagementUsageInner() { - } - - /** - * Get the unit property: Unit of the usage. - * - * @return the unit value. - */ - public UsagesUnit unit() { - return this.unit; - } - - /** - * Get the quotaPeriod property: Quota period of usage. - * - * @return the quotaPeriod value. - */ - public String quotaPeriod() { - return this.quotaPeriod; - } - - /** - * Get the nextResetTime property: Next reset time of usage. - * - * @return the nextResetTime value. - */ - public OffsetDateTime nextResetTime() { - return this.nextResetTime; - } - - /** - * Get the currentValue property: Current value of usage. - * - * @return the currentValue value. - */ - public Long currentValue() { - return this.currentValue; - } - - /** - * Get the limit property: Limit of usage. - * - * @return the limit value. - */ - public Long limit() { - return this.limit; - } - - /** - * Get the name property: Name of usage. - * - * @return the name value. - */ - public NameInfo name() { - return this.name; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("unit", this.unit == null ? null : this.unit.toString()); - jsonWriter.writeStringField("quotaPeriod", this.quotaPeriod); - jsonWriter.writeStringField("nextResetTime", - this.nextResetTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.nextResetTime)); - jsonWriter.writeNumberField("currentValue", this.currentValue); - jsonWriter.writeNumberField("limit", this.limit); - jsonWriter.writeJsonField("name", this.name); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupManagementUsageInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupManagementUsageInner 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 BackupManagementUsageInner. - */ - public static BackupManagementUsageInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupManagementUsageInner deserializedBackupManagementUsageInner = new BackupManagementUsageInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("unit".equals(fieldName)) { - deserializedBackupManagementUsageInner.unit = UsagesUnit.fromString(reader.getString()); - } else if ("quotaPeriod".equals(fieldName)) { - deserializedBackupManagementUsageInner.quotaPeriod = reader.getString(); - } else if ("nextResetTime".equals(fieldName)) { - deserializedBackupManagementUsageInner.nextResetTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("currentValue".equals(fieldName)) { - deserializedBackupManagementUsageInner.currentValue = reader.getNullable(JsonReader::getLong); - } else if ("limit".equals(fieldName)) { - deserializedBackupManagementUsageInner.limit = reader.getNullable(JsonReader::getLong); - } else if ("name".equals(fieldName)) { - deserializedBackupManagementUsageInner.name = NameInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupManagementUsageInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceConfigResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceConfigResourceInner.java deleted file mode 100644 index 3543eb4145d7..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceConfigResourceInner.java +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceConfig; -import java.io.IOException; -import java.util.Map; - -/** - * The resource storage details. - */ -@Fluent -public final class BackupResourceConfigResourceInner extends ProxyResource { - /* - * BackupResourceConfigResource properties - */ - private BackupResourceConfig properties; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The geo-location where the resource lives - */ - private String location; - - /* - * Optional ETag. - */ - private String etag; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of BackupResourceConfigResourceInner class. - */ - public BackupResourceConfigResourceInner() { - } - - /** - * Get the properties property: BackupResourceConfigResource properties. - * - * @return the properties value. - */ - public BackupResourceConfig properties() { - return this.properties; - } - - /** - * Set the properties property: BackupResourceConfigResource properties. - * - * @param properties the properties value to set. - * @return the BackupResourceConfigResourceInner object itself. - */ - public BackupResourceConfigResourceInner withProperties(BackupResourceConfig properties) { - this.properties = properties; - return this; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the BackupResourceConfigResourceInner object itself. - */ - public BackupResourceConfigResourceInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The geo-location where the resource lives. - * - * @param location the location value to set. - * @return the BackupResourceConfigResourceInner object itself. - */ - public BackupResourceConfigResourceInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the etag property: Optional ETag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Optional ETag. - * - * @param etag the etag value to set. - * @return the BackupResourceConfigResourceInner object itself. - */ - public BackupResourceConfigResourceInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeStringField("eTag", this.etag); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupResourceConfigResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupResourceConfigResourceInner 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 BackupResourceConfigResourceInner. - */ - public static BackupResourceConfigResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupResourceConfigResourceInner deserializedBackupResourceConfigResourceInner - = new BackupResourceConfigResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedBackupResourceConfigResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedBackupResourceConfigResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedBackupResourceConfigResourceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedBackupResourceConfigResourceInner.properties = BackupResourceConfig.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedBackupResourceConfigResourceInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedBackupResourceConfigResourceInner.location = reader.getString(); - } else if ("eTag".equals(fieldName)) { - deserializedBackupResourceConfigResourceInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedBackupResourceConfigResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupResourceConfigResourceInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceEncryptionConfigExtendedResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceEncryptionConfigExtendedResourceInner.java deleted file mode 100644 index 86f45879786a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceEncryptionConfigExtendedResourceInner.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigExtended; -import java.io.IOException; -import java.util.Map; - -/** - * The BackupResourceEncryptionConfigExtendedResource model. - */ -@Immutable -public final class BackupResourceEncryptionConfigExtendedResourceInner extends ProxyResource { - /* - * The properties of the backup resource encryption config extended resource - */ - private BackupResourceEncryptionConfigExtended properties; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The geo-location where the resource lives - */ - private String location; - - /* - * Optional ETag. - */ - private String etag; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of BackupResourceEncryptionConfigExtendedResourceInner class. - */ - private BackupResourceEncryptionConfigExtendedResourceInner() { - } - - /** - * Get the properties property: The properties of the backup resource encryption config extended resource. - * - * @return the properties value. - */ - public BackupResourceEncryptionConfigExtended properties() { - return this.properties; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Get the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the etag property: Optional ETag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeStringField("eTag", this.etag); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupResourceEncryptionConfigExtendedResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupResourceEncryptionConfigExtendedResourceInner 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 BackupResourceEncryptionConfigExtendedResourceInner. - */ - public static BackupResourceEncryptionConfigExtendedResourceInner fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - BackupResourceEncryptionConfigExtendedResourceInner deserializedBackupResourceEncryptionConfigExtendedResourceInner - = new BackupResourceEncryptionConfigExtendedResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedBackupResourceEncryptionConfigExtendedResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedBackupResourceEncryptionConfigExtendedResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedBackupResourceEncryptionConfigExtendedResourceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedBackupResourceEncryptionConfigExtendedResourceInner.properties - = BackupResourceEncryptionConfigExtended.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedBackupResourceEncryptionConfigExtendedResourceInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedBackupResourceEncryptionConfigExtendedResourceInner.location = reader.getString(); - } else if ("eTag".equals(fieldName)) { - deserializedBackupResourceEncryptionConfigExtendedResourceInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedBackupResourceEncryptionConfigExtendedResourceInner.systemData - = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupResourceEncryptionConfigExtendedResourceInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceVaultConfigResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceVaultConfigResourceInner.java deleted file mode 100644 index 493883050d40..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupResourceVaultConfigResourceInner.java +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceVaultConfig; -import java.io.IOException; -import java.util.Map; - -/** - * Backup resource vault config details. - */ -@Fluent -public final class BackupResourceVaultConfigResourceInner extends ProxyResource { - /* - * BackupResourceVaultConfigResource properties - */ - private BackupResourceVaultConfig properties; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The geo-location where the resource lives - */ - private String location; - - /* - * Optional ETag. - */ - private String etag; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of BackupResourceVaultConfigResourceInner class. - */ - public BackupResourceVaultConfigResourceInner() { - } - - /** - * Get the properties property: BackupResourceVaultConfigResource properties. - * - * @return the properties value. - */ - public BackupResourceVaultConfig properties() { - return this.properties; - } - - /** - * Set the properties property: BackupResourceVaultConfigResource properties. - * - * @param properties the properties value to set. - * @return the BackupResourceVaultConfigResourceInner object itself. - */ - public BackupResourceVaultConfigResourceInner withProperties(BackupResourceVaultConfig properties) { - this.properties = properties; - return this; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the BackupResourceVaultConfigResourceInner object itself. - */ - public BackupResourceVaultConfigResourceInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The geo-location where the resource lives. - * - * @param location the location value to set. - * @return the BackupResourceVaultConfigResourceInner object itself. - */ - public BackupResourceVaultConfigResourceInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the etag property: Optional ETag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Optional ETag. - * - * @param etag the etag value to set. - * @return the BackupResourceVaultConfigResourceInner object itself. - */ - public BackupResourceVaultConfigResourceInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeStringField("eTag", this.etag); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupResourceVaultConfigResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupResourceVaultConfigResourceInner 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 BackupResourceVaultConfigResourceInner. - */ - public static BackupResourceVaultConfigResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupResourceVaultConfigResourceInner deserializedBackupResourceVaultConfigResourceInner - = new BackupResourceVaultConfigResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedBackupResourceVaultConfigResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedBackupResourceVaultConfigResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedBackupResourceVaultConfigResourceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedBackupResourceVaultConfigResourceInner.properties - = BackupResourceVaultConfig.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedBackupResourceVaultConfigResourceInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedBackupResourceVaultConfigResourceInner.location = reader.getString(); - } else if ("eTag".equals(fieldName)) { - deserializedBackupResourceVaultConfigResourceInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedBackupResourceVaultConfigResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupResourceVaultConfigResourceInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupStatusResponseInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupStatusResponseInner.java deleted file mode 100644 index 644bf8ebf817..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/BackupStatusResponseInner.java +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.AcquireStorageAccountLock; -import com.azure.resourcemanager.recoveryservicesbackup.models.FabricName; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionStatus; -import java.io.IOException; - -/** - * BackupStatus response. - */ -@Immutable -public final class BackupStatusResponseInner implements JsonSerializable { - /* - * Specifies whether the container is registered or not - */ - private ProtectionStatus protectionStatus; - - /* - * Specifies the arm resource id of the vault - */ - private String vaultId; - - /* - * Specifies the fabric name - Azure or AD - */ - private FabricName fabricName; - - /* - * Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;csname;vmname. - */ - private String containerName; - - /* - * Specifies the product specific ds name. E.g. vm;iaasvmcontainer;csname;vmname. - */ - private String protectedItemName; - - /* - * ErrorCode in case of intent failed - */ - private String errorCode; - - /* - * ErrorMessage in case of intent failed. - */ - private String errorMessage; - - /* - * Specifies the policy name which is used for protection - */ - private String policyName; - - /* - * Container registration status - */ - private String registrationStatus; - - /* - * Number of protected items - */ - private Integer protectedItemsCount; - - /* - * Specifies whether the storage account lock has been acquired or not - */ - private AcquireStorageAccountLock acquireStorageAccountLock; - - /** - * Creates an instance of BackupStatusResponseInner class. - */ - private BackupStatusResponseInner() { - } - - /** - * Get the protectionStatus property: Specifies whether the container is registered or not. - * - * @return the protectionStatus value. - */ - public ProtectionStatus protectionStatus() { - return this.protectionStatus; - } - - /** - * Get the vaultId property: Specifies the arm resource id of the vault. - * - * @return the vaultId value. - */ - public String vaultId() { - return this.vaultId; - } - - /** - * Get the fabricName property: Specifies the fabric name - Azure or AD. - * - * @return the fabricName value. - */ - public FabricName fabricName() { - return this.fabricName; - } - - /** - * Get the containerName property: Specifies the product specific container name. E.g. - * iaasvmcontainer;iaasvmcontainer;csname;vmname. - * - * @return the containerName value. - */ - public String containerName() { - return this.containerName; - } - - /** - * Get the protectedItemName property: Specifies the product specific ds name. E.g. - * vm;iaasvmcontainer;csname;vmname. - * - * @return the protectedItemName value. - */ - public String protectedItemName() { - return this.protectedItemName; - } - - /** - * Get the errorCode property: ErrorCode in case of intent failed. - * - * @return the errorCode value. - */ - public String errorCode() { - return this.errorCode; - } - - /** - * Get the errorMessage property: ErrorMessage in case of intent failed. - * - * @return the errorMessage value. - */ - public String errorMessage() { - return this.errorMessage; - } - - /** - * Get the policyName property: Specifies the policy name which is used for protection. - * - * @return the policyName value. - */ - public String policyName() { - return this.policyName; - } - - /** - * Get the registrationStatus property: Container registration status. - * - * @return the registrationStatus value. - */ - public String registrationStatus() { - return this.registrationStatus; - } - - /** - * Get the protectedItemsCount property: Number of protected items. - * - * @return the protectedItemsCount value. - */ - public Integer protectedItemsCount() { - return this.protectedItemsCount; - } - - /** - * Get the acquireStorageAccountLock property: Specifies whether the storage account lock has been acquired or not. - * - * @return the acquireStorageAccountLock value. - */ - public AcquireStorageAccountLock acquireStorageAccountLock() { - return this.acquireStorageAccountLock; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("protectionStatus", - this.protectionStatus == null ? null : this.protectionStatus.toString()); - jsonWriter.writeStringField("vaultId", this.vaultId); - jsonWriter.writeStringField("fabricName", this.fabricName == null ? null : this.fabricName.toString()); - jsonWriter.writeStringField("containerName", this.containerName); - jsonWriter.writeStringField("protectedItemName", this.protectedItemName); - jsonWriter.writeStringField("errorCode", this.errorCode); - jsonWriter.writeStringField("errorMessage", this.errorMessage); - jsonWriter.writeStringField("policyName", this.policyName); - jsonWriter.writeStringField("registrationStatus", this.registrationStatus); - jsonWriter.writeNumberField("protectedItemsCount", this.protectedItemsCount); - jsonWriter.writeStringField("acquireStorageAccountLock", - this.acquireStorageAccountLock == null ? null : this.acquireStorageAccountLock.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupStatusResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupStatusResponseInner 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 BackupStatusResponseInner. - */ - public static BackupStatusResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupStatusResponseInner deserializedBackupStatusResponseInner = new BackupStatusResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("protectionStatus".equals(fieldName)) { - deserializedBackupStatusResponseInner.protectionStatus - = ProtectionStatus.fromString(reader.getString()); - } else if ("vaultId".equals(fieldName)) { - deserializedBackupStatusResponseInner.vaultId = reader.getString(); - } else if ("fabricName".equals(fieldName)) { - deserializedBackupStatusResponseInner.fabricName = FabricName.fromString(reader.getString()); - } else if ("containerName".equals(fieldName)) { - deserializedBackupStatusResponseInner.containerName = reader.getString(); - } else if ("protectedItemName".equals(fieldName)) { - deserializedBackupStatusResponseInner.protectedItemName = reader.getString(); - } else if ("errorCode".equals(fieldName)) { - deserializedBackupStatusResponseInner.errorCode = reader.getString(); - } else if ("errorMessage".equals(fieldName)) { - deserializedBackupStatusResponseInner.errorMessage = reader.getString(); - } else if ("policyName".equals(fieldName)) { - deserializedBackupStatusResponseInner.policyName = reader.getString(); - } else if ("registrationStatus".equals(fieldName)) { - deserializedBackupStatusResponseInner.registrationStatus = reader.getString(); - } else if ("protectedItemsCount".equals(fieldName)) { - deserializedBackupStatusResponseInner.protectedItemsCount = reader.getNullable(JsonReader::getInt); - } else if ("acquireStorageAccountLock".equals(fieldName)) { - deserializedBackupStatusResponseInner.acquireStorageAccountLock - = AcquireStorageAccountLock.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupStatusResponseInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ClientDiscoveryValueForSingleApiInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ClientDiscoveryValueForSingleApiInner.java deleted file mode 100644 index b1ac7bd590ed..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ClientDiscoveryValueForSingleApiInner.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.ClientDiscoveryDisplay; -import com.azure.resourcemanager.recoveryservicesbackup.models.ClientDiscoveryForProperties; -import java.io.IOException; - -/** - * Available operation details. - */ -@Immutable -public final class ClientDiscoveryValueForSingleApiInner - implements JsonSerializable { - /* - * Name of the Operation. - */ - private String name; - - /* - * Contains the localized display information for this particular operation - */ - private ClientDiscoveryDisplay display; - - /* - * The intended executor of the operation;governs the display of the operation in the RBAC UX and the audit logs UX - */ - private String origin; - - /* - * ShoeBox properties for the given operation. - */ - private ClientDiscoveryForProperties properties; - - /** - * Creates an instance of ClientDiscoveryValueForSingleApiInner class. - */ - private ClientDiscoveryValueForSingleApiInner() { - } - - /** - * Get the name property: Name of the Operation. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the display property: Contains the localized display information for this particular operation. - * - * @return the display value. - */ - public ClientDiscoveryDisplay display() { - return this.display; - } - - /** - * Get the origin property: The intended executor of the operation;governs the display of the operation in the RBAC - * UX and the audit logs UX. - * - * @return the origin value. - */ - public String origin() { - return this.origin; - } - - /** - * Get the properties property: ShoeBox properties for the given operation. - * - * @return the properties value. - */ - public ClientDiscoveryForProperties properties() { - return this.properties; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeJsonField("display", this.display); - jsonWriter.writeStringField("origin", this.origin); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ClientDiscoveryValueForSingleApiInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ClientDiscoveryValueForSingleApiInner 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 ClientDiscoveryValueForSingleApiInner. - */ - public static ClientDiscoveryValueForSingleApiInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ClientDiscoveryValueForSingleApiInner deserializedClientDiscoveryValueForSingleApiInner - = new ClientDiscoveryValueForSingleApiInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedClientDiscoveryValueForSingleApiInner.name = reader.getString(); - } else if ("display".equals(fieldName)) { - deserializedClientDiscoveryValueForSingleApiInner.display = ClientDiscoveryDisplay.fromJson(reader); - } else if ("origin".equals(fieldName)) { - deserializedClientDiscoveryValueForSingleApiInner.origin = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedClientDiscoveryValueForSingleApiInner.properties - = ClientDiscoveryForProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedClientDiscoveryValueForSingleApiInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/JobResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/JobResourceInner.java deleted file mode 100644 index daecf685b58e..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/JobResourceInner.java +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.Job; -import java.io.IOException; -import java.util.Map; - -/** - * Defines workload agnostic properties for a job. - */ -@Immutable -public final class JobResourceInner extends ProxyResource { - /* - * JobResource properties - */ - private Job properties; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The geo-location where the resource lives - */ - private String location; - - /* - * Optional ETag. - */ - private String etag; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of JobResourceInner class. - */ - private JobResourceInner() { - } - - /** - * Get the properties property: JobResource properties. - * - * @return the properties value. - */ - public Job properties() { - return this.properties; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Get the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the etag property: Optional ETag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeStringField("eTag", this.etag); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of JobResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of JobResourceInner 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 JobResourceInner. - */ - public static JobResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - JobResourceInner deserializedJobResourceInner = new JobResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedJobResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedJobResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedJobResourceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedJobResourceInner.properties = Job.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedJobResourceInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedJobResourceInner.location = reader.getString(); - } else if ("eTag".equals(fieldName)) { - deserializedJobResourceInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedJobResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedJobResourceInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationResultInfoBaseResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationResultInfoBaseResourceInner.java deleted file mode 100644 index b2071c140e35..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationResultInfoBaseResourceInner.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.HttpStatusCode; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationResultInfoBase; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationWorkerResponse; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * Base class for operation result info. - */ -@Immutable -public final class OperationResultInfoBaseResourceInner extends OperationWorkerResponse { - /* - * OperationResultInfoBaseResource operation - */ - private OperationResultInfoBase operation; - - /* - * HTTP headers associated with this operation. - */ - private Map> headers; - - /* - * HTTP Status Code of the operation. - */ - private HttpStatusCode statusCode; - - /** - * Creates an instance of OperationResultInfoBaseResourceInner class. - */ - private OperationResultInfoBaseResourceInner() { - } - - /** - * Get the operation property: OperationResultInfoBaseResource operation. - * - * @return the operation value. - */ - public OperationResultInfoBase operation() { - return this.operation; - } - - /** - * Get the headers property: HTTP headers associated with this operation. - * - * @return the headers value. - */ - @Override - public Map> headers() { - return this.headers; - } - - /** - * Get the statusCode property: HTTP Status Code of the operation. - * - * @return the statusCode value. - */ - @Override - public HttpStatusCode statusCode() { - return this.statusCode; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("statusCode", statusCode() == null ? null : statusCode().toString()); - jsonWriter.writeMapField("headers", headers(), - (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeString(element1))); - jsonWriter.writeJsonField("operation", this.operation); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationResultInfoBaseResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationResultInfoBaseResourceInner 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 OperationResultInfoBaseResourceInner. - */ - public static OperationResultInfoBaseResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationResultInfoBaseResourceInner deserializedOperationResultInfoBaseResourceInner - = new OperationResultInfoBaseResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("statusCode".equals(fieldName)) { - deserializedOperationResultInfoBaseResourceInner.statusCode - = HttpStatusCode.fromString(reader.getString()); - } else if ("headers".equals(fieldName)) { - Map> headers - = reader.readMap(reader1 -> reader1.readArray(reader2 -> reader2.getString())); - deserializedOperationResultInfoBaseResourceInner.headers = headers; - } else if ("operation".equals(fieldName)) { - deserializedOperationResultInfoBaseResourceInner.operation - = OperationResultInfoBase.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationResultInfoBaseResourceInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationStatusInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationStatusInner.java deleted file mode 100644 index e6bdffeb6bc9..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/OperationStatusInner.java +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.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 com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatusError; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatusExtendedInfo; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatusValues; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Operation status. - */ -@Immutable -public final class OperationStatusInner implements JsonSerializable { - /* - * ID of the operation. - */ - private String id; - - /* - * Name of the operation. - */ - private String name; - - /* - * Operation status. - */ - private OperationStatusValues status; - - /* - * Operation start time. Format: ISO-8601. - */ - private OffsetDateTime startTime; - - /* - * Operation end time. Format: ISO-8601. - */ - private OffsetDateTime endTime; - - /* - * Error information related to this operation. - */ - private OperationStatusError error; - - /* - * Additional information associated with this operation. - */ - private OperationStatusExtendedInfo properties; - - /** - * Creates an instance of OperationStatusInner class. - */ - private OperationStatusInner() { - } - - /** - * Get the id property: ID of the operation. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the name property: Name of the operation. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the status property: Operation status. - * - * @return the status value. - */ - public OperationStatusValues status() { - return this.status; - } - - /** - * Get the startTime property: Operation start time. Format: ISO-8601. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Get the endTime property: Operation end time. Format: ISO-8601. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Get the error property: Error information related to this operation. - * - * @return the error value. - */ - public OperationStatusError error() { - return this.error; - } - - /** - * Get the properties property: Additional information associated with this operation. - * - * @return the properties value. - */ - public OperationStatusExtendedInfo properties() { - return this.properties; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeStringField("startTime", - this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); - jsonWriter.writeStringField("endTime", - this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); - jsonWriter.writeJsonField("error", this.error); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationStatusInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationStatusInner 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 OperationStatusInner. - */ - public static OperationStatusInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationStatusInner deserializedOperationStatusInner = new OperationStatusInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedOperationStatusInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedOperationStatusInner.name = reader.getString(); - } else if ("status".equals(fieldName)) { - deserializedOperationStatusInner.status = OperationStatusValues.fromString(reader.getString()); - } else if ("startTime".equals(fieldName)) { - deserializedOperationStatusInner.startTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("endTime".equals(fieldName)) { - deserializedOperationStatusInner.endTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("error".equals(fieldName)) { - deserializedOperationStatusInner.error = OperationStatusError.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedOperationStatusInner.properties = OperationStatusExtendedInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationStatusInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PreValidateEnableBackupResponseInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PreValidateEnableBackupResponseInner.java deleted file mode 100644 index cb2b403c0519..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PreValidateEnableBackupResponseInner.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidationStatus; -import java.io.IOException; - -/** - * Response contract for enable backup validation request. - */ -@Immutable -public final class PreValidateEnableBackupResponseInner - implements JsonSerializable { - /* - * Validation Status - */ - private ValidationStatus status; - - /* - * Response error code - */ - private String errorCode; - - /* - * Response error message - */ - private String errorMessage; - - /* - * Recommended action for user - */ - private String recommendation; - - /* - * Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is - * required - * for portal - */ - private String containerName; - - /* - * Specifies the product specific ds name. E.g. vm;iaasvmcontainer;rgname;vmname. This is required for portal - */ - private String protectedItemName; - - /** - * Creates an instance of PreValidateEnableBackupResponseInner class. - */ - private PreValidateEnableBackupResponseInner() { - } - - /** - * Get the status property: Validation Status. - * - * @return the status value. - */ - public ValidationStatus status() { - return this.status; - } - - /** - * Get the errorCode property: Response error code. - * - * @return the errorCode value. - */ - public String errorCode() { - return this.errorCode; - } - - /** - * Get the errorMessage property: Response error message. - * - * @return the errorMessage value. - */ - public String errorMessage() { - return this.errorMessage; - } - - /** - * Get the recommendation property: Recommended action for user. - * - * @return the recommendation value. - */ - public String recommendation() { - return this.recommendation; - } - - /** - * Get the containerName property: Specifies the product specific container name. E.g. - * iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required - * for portal. - * - * @return the containerName value. - */ - public String containerName() { - return this.containerName; - } - - /** - * Get the protectedItemName property: Specifies the product specific ds name. E.g. - * vm;iaasvmcontainer;rgname;vmname. This is required for portal. - * - * @return the protectedItemName value. - */ - public String protectedItemName() { - return this.protectedItemName; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeStringField("errorCode", this.errorCode); - jsonWriter.writeStringField("errorMessage", this.errorMessage); - jsonWriter.writeStringField("recommendation", this.recommendation); - jsonWriter.writeStringField("containerName", this.containerName); - jsonWriter.writeStringField("protectedItemName", this.protectedItemName); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PreValidateEnableBackupResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PreValidateEnableBackupResponseInner 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 PreValidateEnableBackupResponseInner. - */ - public static PreValidateEnableBackupResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PreValidateEnableBackupResponseInner deserializedPreValidateEnableBackupResponseInner - = new PreValidateEnableBackupResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedPreValidateEnableBackupResponseInner.status - = ValidationStatus.fromString(reader.getString()); - } else if ("errorCode".equals(fieldName)) { - deserializedPreValidateEnableBackupResponseInner.errorCode = reader.getString(); - } else if ("errorMessage".equals(fieldName)) { - deserializedPreValidateEnableBackupResponseInner.errorMessage = reader.getString(); - } else if ("recommendation".equals(fieldName)) { - deserializedPreValidateEnableBackupResponseInner.recommendation = reader.getString(); - } else if ("containerName".equals(fieldName)) { - deserializedPreValidateEnableBackupResponseInner.containerName = reader.getString(); - } else if ("protectedItemName".equals(fieldName)) { - deserializedPreValidateEnableBackupResponseInner.protectedItemName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPreValidateEnableBackupResponseInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PrivateEndpointConnectionResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PrivateEndpointConnectionResourceInner.java deleted file mode 100644 index 423ca1d6aaff..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/PrivateEndpointConnectionResourceInner.java +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpointConnection; -import java.io.IOException; -import java.util.Map; - -/** - * Private Endpoint Connection Response Properties. - */ -@Fluent -public final class PrivateEndpointConnectionResourceInner extends ProxyResource { - /* - * PrivateEndpointConnectionResource properties - */ - private PrivateEndpointConnection properties; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The geo-location where the resource lives - */ - private String location; - - /* - * Optional ETag. - */ - private String etag; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of PrivateEndpointConnectionResourceInner class. - */ - public PrivateEndpointConnectionResourceInner() { - } - - /** - * Get the properties property: PrivateEndpointConnectionResource properties. - * - * @return the properties value. - */ - public PrivateEndpointConnection properties() { - return this.properties; - } - - /** - * Set the properties property: PrivateEndpointConnectionResource properties. - * - * @param properties the properties value to set. - * @return the PrivateEndpointConnectionResourceInner object itself. - */ - public PrivateEndpointConnectionResourceInner withProperties(PrivateEndpointConnection properties) { - this.properties = properties; - return this; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the PrivateEndpointConnectionResourceInner object itself. - */ - public PrivateEndpointConnectionResourceInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The geo-location where the resource lives. - * - * @param location the location value to set. - * @return the PrivateEndpointConnectionResourceInner object itself. - */ - public PrivateEndpointConnectionResourceInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the etag property: Optional ETag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Optional ETag. - * - * @param etag the etag value to set. - * @return the PrivateEndpointConnectionResourceInner object itself. - */ - public PrivateEndpointConnectionResourceInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeStringField("eTag", this.etag); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateEndpointConnectionResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpointConnectionResourceInner 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 PrivateEndpointConnectionResourceInner. - */ - public static PrivateEndpointConnectionResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpointConnectionResourceInner deserializedPrivateEndpointConnectionResourceInner - = new PrivateEndpointConnectionResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedPrivateEndpointConnectionResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedPrivateEndpointConnectionResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedPrivateEndpointConnectionResourceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedPrivateEndpointConnectionResourceInner.properties - = PrivateEndpointConnection.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedPrivateEndpointConnectionResourceInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedPrivateEndpointConnectionResourceInner.location = reader.getString(); - } else if ("eTag".equals(fieldName)) { - deserializedPrivateEndpointConnectionResourceInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedPrivateEndpointConnectionResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpointConnectionResourceInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectableContainerResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectableContainerResourceInner.java deleted file mode 100644 index c539e78b76f5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectableContainerResourceInner.java +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectableContainer; -import java.io.IOException; -import java.util.Map; - -/** - * Protectable Container Class. - */ -@Immutable -public final class ProtectableContainerResourceInner extends ProxyResource { - /* - * Resource location. - */ - private String location; - - /* - * Resource tags. - */ - private Map tags; - - /* - * Optional ETag. - */ - private String eTag; - - /* - * ProtectableContainerResource properties - */ - private ProtectableContainer 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 ProtectableContainerResourceInner class. - */ - private ProtectableContainerResourceInner() { - } - - /** - * Get the location property: Resource location. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Get the eTag property: Optional ETag. - * - * @return the eTag value. - */ - public String eTag() { - return this.eTag; - } - - /** - * Get the properties property: ProtectableContainerResource properties. - * - * @return the properties value. - */ - public ProtectableContainer properties() { - return this.properties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("eTag", this.eTag); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ProtectableContainerResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProtectableContainerResourceInner 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 ProtectableContainerResourceInner. - */ - public static ProtectableContainerResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProtectableContainerResourceInner deserializedProtectableContainerResourceInner - = new ProtectableContainerResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedProtectableContainerResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedProtectableContainerResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedProtectableContainerResourceInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedProtectableContainerResourceInner.location = reader.getString(); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedProtectableContainerResourceInner.tags = tags; - } else if ("eTag".equals(fieldName)) { - deserializedProtectableContainerResourceInner.eTag = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedProtectableContainerResourceInner.properties = ProtectableContainer.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedProtectableContainerResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedProtectableContainerResourceInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectedItemResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectedItemResourceInner.java deleted file mode 100644 index 71133e692280..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectedItemResourceInner.java +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItem; -import java.io.IOException; -import java.util.Map; - -/** - * Base class for backup items. - */ -@Fluent -public final class ProtectedItemResourceInner extends ProxyResource { - /* - * ProtectedItemResource properties - */ - private ProtectedItem properties; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The geo-location where the resource lives - */ - private String location; - - /* - * Optional ETag. - */ - private String etag; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of ProtectedItemResourceInner class. - */ - public ProtectedItemResourceInner() { - } - - /** - * Get the properties property: ProtectedItemResource properties. - * - * @return the properties value. - */ - public ProtectedItem properties() { - return this.properties; - } - - /** - * Set the properties property: ProtectedItemResource properties. - * - * @param properties the properties value to set. - * @return the ProtectedItemResourceInner object itself. - */ - public ProtectedItemResourceInner withProperties(ProtectedItem properties) { - this.properties = properties; - return this; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the ProtectedItemResourceInner object itself. - */ - public ProtectedItemResourceInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The geo-location where the resource lives. - * - * @param location the location value to set. - * @return the ProtectedItemResourceInner object itself. - */ - public ProtectedItemResourceInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the etag property: Optional ETag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Optional ETag. - * - * @param etag the etag value to set. - * @return the ProtectedItemResourceInner object itself. - */ - public ProtectedItemResourceInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeStringField("eTag", this.etag); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ProtectedItemResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProtectedItemResourceInner 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 ProtectedItemResourceInner. - */ - public static ProtectedItemResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProtectedItemResourceInner deserializedProtectedItemResourceInner = new ProtectedItemResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedProtectedItemResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedProtectedItemResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedProtectedItemResourceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedProtectedItemResourceInner.properties = ProtectedItem.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedProtectedItemResourceInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedProtectedItemResourceInner.location = reader.getString(); - } else if ("eTag".equals(fieldName)) { - deserializedProtectedItemResourceInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedProtectedItemResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedProtectedItemResourceInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionContainerResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionContainerResourceInner.java deleted file mode 100644 index 44939e8fbd26..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionContainerResourceInner.java +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainer; -import java.io.IOException; -import java.util.Map; - -/** - * Base class for container with backup items. Containers with specific workloads are derived from this class. - */ -@Fluent -public final class ProtectionContainerResourceInner extends ProxyResource { - /* - * ProtectionContainerResource properties - */ - private ProtectionContainer properties; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The geo-location where the resource lives - */ - private String location; - - /* - * Optional ETag. - */ - private String etag; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of ProtectionContainerResourceInner class. - */ - public ProtectionContainerResourceInner() { - } - - /** - * Get the properties property: ProtectionContainerResource properties. - * - * @return the properties value. - */ - public ProtectionContainer properties() { - return this.properties; - } - - /** - * Set the properties property: ProtectionContainerResource properties. - * - * @param properties the properties value to set. - * @return the ProtectionContainerResourceInner object itself. - */ - public ProtectionContainerResourceInner withProperties(ProtectionContainer properties) { - this.properties = properties; - return this; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the ProtectionContainerResourceInner object itself. - */ - public ProtectionContainerResourceInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The geo-location where the resource lives. - * - * @param location the location value to set. - * @return the ProtectionContainerResourceInner object itself. - */ - public ProtectionContainerResourceInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the etag property: Optional ETag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Optional ETag. - * - * @param etag the etag value to set. - * @return the ProtectionContainerResourceInner object itself. - */ - public ProtectionContainerResourceInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeStringField("eTag", this.etag); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ProtectionContainerResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProtectionContainerResourceInner 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 ProtectionContainerResourceInner. - */ - public static ProtectionContainerResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProtectionContainerResourceInner deserializedProtectionContainerResourceInner - = new ProtectionContainerResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedProtectionContainerResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedProtectionContainerResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedProtectionContainerResourceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedProtectionContainerResourceInner.properties = ProtectionContainer.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedProtectionContainerResourceInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedProtectionContainerResourceInner.location = reader.getString(); - } else if ("eTag".equals(fieldName)) { - deserializedProtectionContainerResourceInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedProtectionContainerResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedProtectionContainerResourceInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionIntentResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionIntentResourceInner.java deleted file mode 100644 index bd93bf2c88ba..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionIntentResourceInner.java +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionIntent; -import java.io.IOException; -import java.util.Map; - -/** - * Base class for backup ProtectionIntent. - */ -@Fluent -public final class ProtectionIntentResourceInner extends ProxyResource { - /* - * ProtectionIntentResource properties - */ - private ProtectionIntent properties; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The geo-location where the resource lives - */ - private String location; - - /* - * Optional ETag. - */ - private String etag; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of ProtectionIntentResourceInner class. - */ - public ProtectionIntentResourceInner() { - } - - /** - * Get the properties property: ProtectionIntentResource properties. - * - * @return the properties value. - */ - public ProtectionIntent properties() { - return this.properties; - } - - /** - * Set the properties property: ProtectionIntentResource properties. - * - * @param properties the properties value to set. - * @return the ProtectionIntentResourceInner object itself. - */ - public ProtectionIntentResourceInner withProperties(ProtectionIntent properties) { - this.properties = properties; - return this; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the ProtectionIntentResourceInner object itself. - */ - public ProtectionIntentResourceInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The geo-location where the resource lives. - * - * @param location the location value to set. - * @return the ProtectionIntentResourceInner object itself. - */ - public ProtectionIntentResourceInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the etag property: Optional ETag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Optional ETag. - * - * @param etag the etag value to set. - * @return the ProtectionIntentResourceInner object itself. - */ - public ProtectionIntentResourceInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeStringField("eTag", this.etag); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ProtectionIntentResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProtectionIntentResourceInner 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 ProtectionIntentResourceInner. - */ - public static ProtectionIntentResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProtectionIntentResourceInner deserializedProtectionIntentResourceInner - = new ProtectionIntentResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedProtectionIntentResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedProtectionIntentResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedProtectionIntentResourceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedProtectionIntentResourceInner.properties = ProtectionIntent.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedProtectionIntentResourceInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedProtectionIntentResourceInner.location = reader.getString(); - } else if ("eTag".equals(fieldName)) { - deserializedProtectionIntentResourceInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedProtectionIntentResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedProtectionIntentResourceInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionPolicyResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionPolicyResourceInner.java deleted file mode 100644 index f177881876d8..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionPolicyResourceInner.java +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicy; -import java.io.IOException; -import java.util.Map; - -/** - * Base class for backup policy. Workload-specific backup policies are derived from this class. - */ -@Fluent -public final class ProtectionPolicyResourceInner extends ProxyResource { - /* - * ProtectionPolicyResource properties - */ - private ProtectionPolicy properties; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The geo-location where the resource lives - */ - private String location; - - /* - * Optional ETag. - */ - private String etag; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of ProtectionPolicyResourceInner class. - */ - public ProtectionPolicyResourceInner() { - } - - /** - * Get the properties property: ProtectionPolicyResource properties. - * - * @return the properties value. - */ - public ProtectionPolicy properties() { - return this.properties; - } - - /** - * Set the properties property: ProtectionPolicyResource properties. - * - * @param properties the properties value to set. - * @return the ProtectionPolicyResourceInner object itself. - */ - public ProtectionPolicyResourceInner withProperties(ProtectionPolicy properties) { - this.properties = properties; - return this; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the ProtectionPolicyResourceInner object itself. - */ - public ProtectionPolicyResourceInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The geo-location where the resource lives. - * - * @param location the location value to set. - * @return the ProtectionPolicyResourceInner object itself. - */ - public ProtectionPolicyResourceInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the etag property: Optional ETag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Optional ETag. - * - * @param etag the etag value to set. - * @return the ProtectionPolicyResourceInner object itself. - */ - public ProtectionPolicyResourceInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeStringField("eTag", this.etag); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ProtectionPolicyResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProtectionPolicyResourceInner 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 ProtectionPolicyResourceInner. - */ - public static ProtectionPolicyResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProtectionPolicyResourceInner deserializedProtectionPolicyResourceInner - = new ProtectionPolicyResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedProtectionPolicyResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedProtectionPolicyResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedProtectionPolicyResourceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedProtectionPolicyResourceInner.properties = ProtectionPolicy.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedProtectionPolicyResourceInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedProtectionPolicyResourceInner.location = reader.getString(); - } else if ("eTag".equals(fieldName)) { - deserializedProtectionPolicyResourceInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedProtectionPolicyResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedProtectionPolicyResourceInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/RecoveryPointResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/RecoveryPointResourceInner.java deleted file mode 100644 index 92a38550bd17..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/RecoveryPointResourceInner.java +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPoint; -import java.io.IOException; -import java.util.Map; - -/** - * Base class for backup copies. Workload-specific backup copies are derived from this class. - */ -@Immutable -public final class RecoveryPointResourceInner extends ProxyResource { - /* - * RecoveryPointResource properties - */ - private RecoveryPoint properties; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The geo-location where the resource lives - */ - private String location; - - /* - * Optional ETag. - */ - private String etag; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of RecoveryPointResourceInner class. - */ - private RecoveryPointResourceInner() { - } - - /** - * Get the properties property: RecoveryPointResource properties. - * - * @return the properties value. - */ - public RecoveryPoint properties() { - return this.properties; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Get the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the etag property: Optional ETag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeStringField("eTag", this.etag); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RecoveryPointResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RecoveryPointResourceInner 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 RecoveryPointResourceInner. - */ - public static RecoveryPointResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RecoveryPointResourceInner deserializedRecoveryPointResourceInner = new RecoveryPointResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedRecoveryPointResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedRecoveryPointResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedRecoveryPointResourceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedRecoveryPointResourceInner.properties = RecoveryPoint.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedRecoveryPointResourceInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedRecoveryPointResourceInner.location = reader.getString(); - } else if ("eTag".equals(fieldName)) { - deserializedRecoveryPointResourceInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedRecoveryPointResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRecoveryPointResourceInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ResourceGuardProxyBaseResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ResourceGuardProxyBaseResourceInner.java deleted file mode 100644 index f913d1c5501b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ResourceGuardProxyBaseResourceInner.java +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceGuardProxyBase; -import java.io.IOException; -import java.util.Map; - -/** - * The ResourceGuardProxyBaseResource model. - */ -@Fluent -public final class ResourceGuardProxyBaseResourceInner extends ProxyResource { - /* - * ResourceGuardProxyBaseResource properties - */ - private ResourceGuardProxyBase properties; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The geo-location where the resource lives - */ - private String location; - - /* - * Optional ETag. - */ - private String etag; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of ResourceGuardProxyBaseResourceInner class. - */ - public ResourceGuardProxyBaseResourceInner() { - } - - /** - * Get the properties property: ResourceGuardProxyBaseResource properties. - * - * @return the properties value. - */ - public ResourceGuardProxyBase properties() { - return this.properties; - } - - /** - * Set the properties property: ResourceGuardProxyBaseResource properties. - * - * @param properties the properties value to set. - * @return the ResourceGuardProxyBaseResourceInner object itself. - */ - public ResourceGuardProxyBaseResourceInner withProperties(ResourceGuardProxyBase properties) { - this.properties = properties; - return this; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the ResourceGuardProxyBaseResourceInner object itself. - */ - public ResourceGuardProxyBaseResourceInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The geo-location where the resource lives. - * - * @param location the location value to set. - * @return the ResourceGuardProxyBaseResourceInner object itself. - */ - public ResourceGuardProxyBaseResourceInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the etag property: Optional ETag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Optional ETag. - * - * @param etag the etag value to set. - * @return the ResourceGuardProxyBaseResourceInner object itself. - */ - public ResourceGuardProxyBaseResourceInner withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeStringField("eTag", this.etag); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceGuardProxyBaseResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceGuardProxyBaseResourceInner 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 ResourceGuardProxyBaseResourceInner. - */ - public static ResourceGuardProxyBaseResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceGuardProxyBaseResourceInner deserializedResourceGuardProxyBaseResourceInner - = new ResourceGuardProxyBaseResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedResourceGuardProxyBaseResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedResourceGuardProxyBaseResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedResourceGuardProxyBaseResourceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedResourceGuardProxyBaseResourceInner.properties - = ResourceGuardProxyBase.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedResourceGuardProxyBaseResourceInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedResourceGuardProxyBaseResourceInner.location = reader.getString(); - } else if ("eTag".equals(fieldName)) { - deserializedResourceGuardProxyBaseResourceInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedResourceGuardProxyBaseResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedResourceGuardProxyBaseResourceInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/TieringCostInfoInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/TieringCostInfoInner.java deleted file mode 100644 index 87f9e0112a70..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/TieringCostInfoInner.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.TieringCostRehydrationInfo; -import com.azure.resourcemanager.recoveryservicesbackup.models.TieringCostSavingInfo; -import java.io.IOException; - -/** - * Base class for tiering cost response. - */ -@Immutable -public class TieringCostInfoInner implements JsonSerializable { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "TieringCostInfo"; - - /** - * Creates an instance of TieringCostInfoInner class. - */ - protected TieringCostInfoInner() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - public String objectType() { - return this.objectType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of TieringCostInfoInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TieringCostInfoInner 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 TieringCostInfoInner. - */ - public static TieringCostInfoInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("TieringCostRehydrationInfo".equals(discriminatorValue)) { - return TieringCostRehydrationInfo.fromJson(readerToUse.reset()); - } else if ("TieringCostSavingInfo".equals(discriminatorValue)) { - return TieringCostSavingInfo.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static TieringCostInfoInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - TieringCostInfoInner deserializedTieringCostInfoInner = new TieringCostInfoInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedTieringCostInfoInner.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedTieringCostInfoInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/TokenInformationInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/TokenInformationInner.java deleted file mode 100644 index a12252559b00..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/TokenInformationInner.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The token information details. - */ -@Immutable -public final class TokenInformationInner implements JsonSerializable { - /* - * Token value. - */ - private String token; - - /* - * Expiry time of token. - */ - private Long expiryTimeInUtcTicks; - - /* - * Security PIN - */ - private String securityPin; - - /** - * Creates an instance of TokenInformationInner class. - */ - private TokenInformationInner() { - } - - /** - * Get the token property: Token value. - * - * @return the token value. - */ - public String token() { - return this.token; - } - - /** - * Get the expiryTimeInUtcTicks property: Expiry time of token. - * - * @return the expiryTimeInUtcTicks value. - */ - public Long expiryTimeInUtcTicks() { - return this.expiryTimeInUtcTicks; - } - - /** - * Get the securityPin property: Security PIN. - * - * @return the securityPin value. - */ - public String securityPin() { - return this.securityPin; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("token", this.token); - jsonWriter.writeNumberField("expiryTimeInUtcTicks", this.expiryTimeInUtcTicks); - jsonWriter.writeStringField("securityPIN", this.securityPin); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of TokenInformationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TokenInformationInner 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 TokenInformationInner. - */ - public static TokenInformationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - TokenInformationInner deserializedTokenInformationInner = new TokenInformationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("token".equals(fieldName)) { - deserializedTokenInformationInner.token = reader.getString(); - } else if ("expiryTimeInUtcTicks".equals(fieldName)) { - deserializedTokenInformationInner.expiryTimeInUtcTicks = reader.getNullable(JsonReader::getLong); - } else if ("securityPIN".equals(fieldName)) { - deserializedTokenInformationInner.securityPin = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedTokenInformationInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/UnlockDeleteResponseInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/UnlockDeleteResponseInner.java deleted file mode 100644 index e77bf80309b4..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/UnlockDeleteResponseInner.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Response of Unlock Delete API. - */ -@Immutable -public final class UnlockDeleteResponseInner implements JsonSerializable { - /* - * This is the time when unlock delete privileges will get expired. - */ - private String unlockDeleteExpiryTime; - - /** - * Creates an instance of UnlockDeleteResponseInner class. - */ - private UnlockDeleteResponseInner() { - } - - /** - * Get the unlockDeleteExpiryTime property: This is the time when unlock delete privileges will get expired. - * - * @return the unlockDeleteExpiryTime value. - */ - public String unlockDeleteExpiryTime() { - return this.unlockDeleteExpiryTime; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("unlockDeleteExpiryTime", this.unlockDeleteExpiryTime); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of UnlockDeleteResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of UnlockDeleteResponseInner 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 UnlockDeleteResponseInner. - */ - public static UnlockDeleteResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - UnlockDeleteResponseInner deserializedUnlockDeleteResponseInner = new UnlockDeleteResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("unlockDeleteExpiryTime".equals(fieldName)) { - deserializedUnlockDeleteResponseInner.unlockDeleteExpiryTime = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedUnlockDeleteResponseInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ValidateOperationsResponseInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ValidateOperationsResponseInner.java deleted file mode 100644 index 365de5ed77af..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ValidateOperationsResponseInner.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationResponse; -import java.io.IOException; - -/** - * The ValidateOperationsResponse model. - */ -@Immutable -public final class ValidateOperationsResponseInner implements JsonSerializable { - /* - * Base class for validate operation response. - */ - private ValidateOperationResponse validateOperationResponse; - - /** - * Creates an instance of ValidateOperationsResponseInner class. - */ - private ValidateOperationsResponseInner() { - } - - /** - * Get the validateOperationResponse property: Base class for validate operation response. - * - * @return the validateOperationResponse value. - */ - public ValidateOperationResponse validateOperationResponse() { - return this.validateOperationResponse; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("validateOperationResponse", this.validateOperationResponse); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ValidateOperationsResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ValidateOperationsResponseInner 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 ValidateOperationsResponseInner. - */ - public static ValidateOperationsResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ValidateOperationsResponseInner deserializedValidateOperationsResponseInner - = new ValidateOperationsResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("validateOperationResponse".equals(fieldName)) { - deserializedValidateOperationsResponseInner.validateOperationResponse - = ValidateOperationResponse.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedValidateOperationsResponseInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/VaultStorageConfigOperationResultResponseInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/VaultStorageConfigOperationResultResponseInner.java deleted file mode 100644 index 6f64ef1ecf7c..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/VaultStorageConfigOperationResultResponseInner.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.PrepareDataMoveResponse; -import java.io.IOException; - -/** - * Operation result response for Vault Storage Config. - */ -@Immutable -public class VaultStorageConfigOperationResultResponseInner - implements JsonSerializable { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "VaultStorageConfigOperationResultResponse"; - - /** - * Creates an instance of VaultStorageConfigOperationResultResponseInner class. - */ - protected VaultStorageConfigOperationResultResponseInner() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - public String objectType() { - return this.objectType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of VaultStorageConfigOperationResultResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of VaultStorageConfigOperationResultResponseInner 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 VaultStorageConfigOperationResultResponseInner. - */ - public static VaultStorageConfigOperationResultResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("PrepareDataMoveResponse".equals(discriminatorValue)) { - return PrepareDataMoveResponse.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static VaultStorageConfigOperationResultResponseInner fromJsonKnownDiscriminator(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - VaultStorageConfigOperationResultResponseInner deserializedVaultStorageConfigOperationResultResponseInner - = new VaultStorageConfigOperationResultResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedVaultStorageConfigOperationResultResponseInner.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedVaultStorageConfigOperationResultResponseInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadItemResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadItemResourceInner.java deleted file mode 100644 index 4902ab6326f4..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadItemResourceInner.java +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.WorkloadItem; -import java.io.IOException; -import java.util.Map; - -/** - * Base class for backup item. Workload-specific backup items are derived from this class. - */ -@Immutable -public final class WorkloadItemResourceInner extends ProxyResource { - /* - * Resource location. - */ - private String location; - - /* - * Resource tags. - */ - private Map tags; - - /* - * Optional ETag. - */ - private String eTag; - - /* - * WorkloadItemResource properties - */ - private WorkloadItem 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 WorkloadItemResourceInner class. - */ - private WorkloadItemResourceInner() { - } - - /** - * Get the location property: Resource location. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Get the eTag property: Optional ETag. - * - * @return the eTag value. - */ - public String eTag() { - return this.eTag; - } - - /** - * Get the properties property: WorkloadItemResource properties. - * - * @return the properties value. - */ - public WorkloadItem properties() { - return this.properties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("eTag", this.eTag); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WorkloadItemResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WorkloadItemResourceInner 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 WorkloadItemResourceInner. - */ - public static WorkloadItemResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WorkloadItemResourceInner deserializedWorkloadItemResourceInner = new WorkloadItemResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedWorkloadItemResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedWorkloadItemResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedWorkloadItemResourceInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedWorkloadItemResourceInner.location = reader.getString(); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedWorkloadItemResourceInner.tags = tags; - } else if ("eTag".equals(fieldName)) { - deserializedWorkloadItemResourceInner.eTag = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedWorkloadItemResourceInner.properties = WorkloadItem.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedWorkloadItemResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedWorkloadItemResourceInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadProtectableItemResourceInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadProtectableItemResourceInner.java deleted file mode 100644 index db1fec4584a0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/WorkloadProtectableItemResourceInner.java +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.models.WorkloadProtectableItem; -import java.io.IOException; -import java.util.Map; - -/** - * Base class for backup item. Workload-specific backup items are derived from this class. - */ -@Immutable -public final class WorkloadProtectableItemResourceInner extends ProxyResource { - /* - * Resource location. - */ - private String location; - - /* - * Resource tags. - */ - private Map tags; - - /* - * Optional ETag. - */ - private String eTag; - - /* - * WorkloadProtectableItemResource properties - */ - private WorkloadProtectableItem 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 WorkloadProtectableItemResourceInner class. - */ - private WorkloadProtectableItemResourceInner() { - } - - /** - * Get the location property: Resource location. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Get the eTag property: Optional ETag. - * - * @return the eTag value. - */ - public String eTag() { - return this.eTag; - } - - /** - * Get the properties property: WorkloadProtectableItemResource properties. - * - * @return the properties value. - */ - public WorkloadProtectableItem properties() { - return this.properties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("eTag", this.eTag); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WorkloadProtectableItemResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WorkloadProtectableItemResourceInner 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 WorkloadProtectableItemResourceInner. - */ - public static WorkloadProtectableItemResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WorkloadProtectableItemResourceInner deserializedWorkloadProtectableItemResourceInner - = new WorkloadProtectableItemResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedWorkloadProtectableItemResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedWorkloadProtectableItemResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedWorkloadProtectableItemResourceInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedWorkloadProtectableItemResourceInner.location = reader.getString(); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedWorkloadProtectableItemResourceInner.tags = tags; - } else if ("eTag".equals(fieldName)) { - deserializedWorkloadProtectableItemResourceInner.eTag = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedWorkloadProtectableItemResourceInner.properties - = WorkloadProtectableItem.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedWorkloadProtectableItemResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedWorkloadProtectableItemResourceInner; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/package-info.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/package-info.java deleted file mode 100644 index b3ef6b67531f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -/** - * Package containing the inner data models for RecoveryServicesBackup. - * Open API 2.0 Specs for Azure RecoveryServices Backup service. - */ -package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/package-info.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/package-info.java deleted file mode 100644 index f42c5372830d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -/** - * Package containing the service clients for RecoveryServicesBackup. - * Open API 2.0 Specs for Azure RecoveryServices Backup service. - */ -package com.azure.resourcemanager.recoveryservicesbackup.fluent; diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AzureVMResourceFeatureSupportResponseImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AzureVMResourceFeatureSupportResponseImpl.java deleted file mode 100644 index a7408634b8a0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/AzureVMResourceFeatureSupportResponseImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AzureVMResourceFeatureSupportResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.AzureVMResourceFeatureSupportResponse; -import com.azure.resourcemanager.recoveryservicesbackup.models.SupportStatus; - -public final class AzureVMResourceFeatureSupportResponseImpl implements AzureVMResourceFeatureSupportResponse { - private AzureVMResourceFeatureSupportResponseInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - AzureVMResourceFeatureSupportResponseImpl(AzureVMResourceFeatureSupportResponseInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public SupportStatus supportStatus() { - return this.innerModel().supportStatus(); - } - - public AzureVMResourceFeatureSupportResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEngineBaseResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEngineBaseResourceImpl.java deleted file mode 100644 index b737cada8f32..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEngineBaseResourceImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupEngineBaseResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupEngineBase; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupEngineBaseResource; -import java.util.Collections; -import java.util.Map; - -public final class BackupEngineBaseResourceImpl implements BackupEngineBaseResource { - private BackupEngineBaseResourceInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - BackupEngineBaseResourceImpl(BackupEngineBaseResourceInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager 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 BackupEngineBase properties() { - return this.innerModel().properties(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String location() { - return this.innerModel().location(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public BackupEngineBaseResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesClientImpl.java deleted file mode 100644 index c193882ef33d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesClientImpl.java +++ /dev/null @@ -1,409 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupEnginesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupEngineBaseResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.BackupEngineBaseResourceList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in BackupEnginesClient. - */ -public final class BackupEnginesClientImpl implements BackupEnginesClient { - /** - * The proxy service used to perform REST calls. - */ - private final BackupEnginesService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of BackupEnginesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BackupEnginesClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service - = RestProxy.create(BackupEnginesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientBackupEngines to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientBackupEngines") - public interface BackupEnginesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines/{backupEngineName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("backupEngineName") String backupEngineName, @QueryParam("$filter") String filter, - @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines/{backupEngineName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("backupEngineName") String backupEngineName, @QueryParam("$filter") String filter, - @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @QueryParam("$filter") String filter, @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @QueryParam("$filter") String filter, @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Returns backup management server registered to Recovery Services Vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param backupEngineName Name of the backup management server. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the base backup engine class along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, - String resourceGroupName, String backupEngineName, String filter, String skipToken) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, backupEngineName, filter, skipToken, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns backup management server registered to Recovery Services Vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param backupEngineName Name of the backup management server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the base backup engine class on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName, - String backupEngineName) { - final String filter = null; - final String skipToken = null; - return getWithResponseAsync(vaultName, resourceGroupName, backupEngineName, filter, skipToken) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns backup management server registered to Recovery Services Vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param backupEngineName Name of the backup management server. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the base backup engine class along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, - String backupEngineName, String filter, String skipToken, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, backupEngineName, filter, skipToken, accept, context); - } - - /** - * Returns backup management server registered to Recovery Services Vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param backupEngineName Name of the backup management server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the base backup engine class. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupEngineBaseResourceInner get(String vaultName, String resourceGroupName, String backupEngineName) { - final String filter = null; - final String skipToken = null; - return getWithResponse(vaultName, resourceGroupName, backupEngineName, filter, skipToken, Context.NONE) - .getValue(); - } - - /** - * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of BackupEngineBase resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String vaultName, - String resourceGroupName, String filter, String skipToken) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, filter, skipToken, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of BackupEngineBase resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName, - String filter, String skipToken) { - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of BackupEngineBase resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName) { - final String filter = null; - final String skipToken = null; - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of BackupEngineBase resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, - String filter, String skipToken) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, filter, skipToken, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of BackupEngineBase resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, - String filter, String skipToken, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, filter, skipToken, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of BackupEngineBase resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName) { - final String filter = null; - final String skipToken = null; - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, filter, skipToken), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of BackupEngineBase resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName, String filter, - String skipToken, Context context) { - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, filter, skipToken, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of BackupEngineBase resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of BackupEngineBase resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of BackupEngineBase resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesImpl.java deleted file mode 100644 index 47c95190b2bc..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupEnginesImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupEnginesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupEngineBaseResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupEngineBaseResource; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupEngines; - -public final class BackupEnginesImpl implements BackupEngines { - private static final ClientLogger LOGGER = new ClientLogger(BackupEnginesImpl.class); - - private final BackupEnginesClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public BackupEnginesImpl(BackupEnginesClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, - String backupEngineName, String filter, String skipToken, Context context) { - Response inner = this.serviceClient() - .getWithResponse(vaultName, resourceGroupName, backupEngineName, filter, skipToken, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new BackupEngineBaseResourceImpl(inner.getValue(), this.manager())); - } - - public BackupEngineBaseResource get(String vaultName, String resourceGroupName, String backupEngineName) { - BackupEngineBaseResourceInner inner = this.serviceClient().get(vaultName, resourceGroupName, backupEngineName); - if (inner != null) { - return new BackupEngineBaseResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String vaultName, String resourceGroupName) { - PagedIterable inner = this.serviceClient().list(vaultName, resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new BackupEngineBaseResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String vaultName, String resourceGroupName, String filter, - String skipToken, Context context) { - PagedIterable inner - = this.serviceClient().list(vaultName, resourceGroupName, filter, skipToken, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new BackupEngineBaseResourceImpl(inner1, this.manager())); - } - - private BackupEnginesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsClientImpl.java deleted file mode 100644 index d87dd87e5645..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsClientImpl.java +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupJobsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.JobResourceList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in BackupJobsClient. - */ -public final class BackupJobsClientImpl implements BackupJobsClient { - /** - * The proxy service used to perform REST calls. - */ - private final BackupJobsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of BackupJobsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BackupJobsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service - = RestProxy.create(BackupJobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientBackupJobs to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientBackupJobs") - public interface BackupJobsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @QueryParam("$filter") String filter, @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @QueryParam("$filter") String filter, @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Provides a pageable list of jobs. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Job resources along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String vaultName, String resourceGroupName, - String filter, String skipToken) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, filter, skipToken, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Provides a pageable list of jobs. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Job resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName, String filter, - String skipToken) { - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Provides a pageable list of jobs. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Job resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName) { - final String filter = null; - final String skipToken = null; - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Provides a pageable list of jobs. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Job resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, String filter, - String skipToken) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, filter, skipToken, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Provides a pageable list of jobs. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Job resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, String filter, - String skipToken, Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, filter, skipToken, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Provides a pageable list of jobs. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Job resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName) { - final String filter = null; - final String skipToken = null; - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, filter, skipToken), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Provides a pageable list of jobs. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Job resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName, String filter, - String skipToken, Context context) { - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, filter, skipToken, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Job resources along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Job resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Job resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsImpl.java deleted file mode 100644 index a691f7b9ee47..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupJobsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupJobs; -import com.azure.resourcemanager.recoveryservicesbackup.models.JobResource; - -public final class BackupJobsImpl implements BackupJobs { - private static final ClientLogger LOGGER = new ClientLogger(BackupJobsImpl.class); - - private final BackupJobsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public BackupJobsImpl(BackupJobsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String vaultName, String resourceGroupName) { - PagedIterable inner = this.serviceClient().list(vaultName, resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new JobResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String vaultName, String resourceGroupName, String filter, String skipToken, - Context context) { - PagedIterable inner - = this.serviceClient().list(vaultName, resourceGroupName, filter, skipToken, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new JobResourceImpl(inner1, this.manager())); - } - - private BackupJobsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupManagementUsageImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupManagementUsageImpl.java deleted file mode 100644 index 4b4550ccf9de..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupManagementUsageImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupManagementUsageInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupManagementUsage; -import com.azure.resourcemanager.recoveryservicesbackup.models.NameInfo; -import com.azure.resourcemanager.recoveryservicesbackup.models.UsagesUnit; -import java.time.OffsetDateTime; - -public final class BackupManagementUsageImpl implements BackupManagementUsage { - private BackupManagementUsageInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - BackupManagementUsageImpl(BackupManagementUsageInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public UsagesUnit unit() { - return this.innerModel().unit(); - } - - public String quotaPeriod() { - return this.innerModel().quotaPeriod(); - } - - public OffsetDateTime nextResetTime() { - return this.innerModel().nextResetTime(); - } - - public Long currentValue() { - return this.innerModel().currentValue(); - } - - public Long limit() { - return this.innerModel().limit(); - } - - public NameInfo name() { - return this.innerModel().name(); - } - - public BackupManagementUsageInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationResultsClientImpl.java deleted file mode 100644 index 028b492e0797..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationResultsClientImpl.java +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupOperationResultsClient; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in BackupOperationResultsClient. - */ -public final class BackupOperationResultsClientImpl implements BackupOperationResultsClient { - /** - * The proxy service used to perform REST calls. - */ - private final BackupOperationResultsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of BackupOperationResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BackupOperationResultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(BackupOperationResultsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientBackupOperationResults to be - * used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientBackupOperationResults") - public interface BackupOperationResultsService { - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperationResults/{operationId}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("operationId") String operationId, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperationResults/{operationId}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("operationId") String operationId, - Context context); - } - - /** - * Provides the status of the delete operations such as deleting backed up item. Once the operation has started, the - * status code in the response would be Accepted. It will continue to be in this state till it reaches completion. - * On - * successful completion, the status code will be OK. This method expects OperationID as an argument. OperationID is - * part of the Location header of the operation response. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> getWithResponseAsync(String vaultName, String resourceGroupName, String operationId) { - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, - resourceGroupName, this.client.getSubscriptionId(), operationId, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Provides the status of the delete operations such as deleting backed up item. Once the operation has started, the - * status code in the response would be Accepted. It will continue to be in this state till it reaches completion. - * On - * successful completion, the status code will be OK. This method expects OperationID as an argument. OperationID is - * part of the Location header of the operation response. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 getAsync(String vaultName, String resourceGroupName, String operationId) { - return getWithResponseAsync(vaultName, resourceGroupName, operationId).flatMap(ignored -> Mono.empty()); - } - - /** - * Provides the status of the delete operations such as deleting backed up item. Once the operation has started, the - * status code in the response would be Accepted. It will continue to be in this state till it reaches completion. - * On - * successful completion, the status code will be OK. This method expects OperationID as an argument. OperationID is - * part of the Location header of the operation response. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, String operationId, - Context context) { - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), operationId, context); - } - - /** - * Provides the status of the delete operations such as deleting backed up item. Once the operation has started, the - * status code in the response would be Accepted. It will continue to be in this state till it reaches completion. - * On - * successful completion, the status code will be OK. This method expects OperationID as an argument. OperationID is - * part of the Location header of the operation response. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void get(String vaultName, String resourceGroupName, String operationId) { - getWithResponse(vaultName, resourceGroupName, operationId, Context.NONE); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationResultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationResultsImpl.java deleted file mode 100644 index 312301f66323..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationResultsImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupOperationResults; - -public final class BackupOperationResultsImpl implements BackupOperationResults { - private static final ClientLogger LOGGER = new ClientLogger(BackupOperationResultsImpl.class); - - private final BackupOperationResultsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public BackupOperationResultsImpl(BackupOperationResultsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, String operationId, - Context context) { - return this.serviceClient().getWithResponse(vaultName, resourceGroupName, operationId, context); - } - - public void get(String vaultName, String resourceGroupName, String operationId) { - this.serviceClient().get(vaultName, resourceGroupName, operationId); - } - - private BackupOperationResultsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationStatusesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationStatusesClientImpl.java deleted file mode 100644 index d99997548624..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationStatusesClientImpl.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupOperationStatusesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in BackupOperationStatusesClient. - */ -public final class BackupOperationStatusesClientImpl implements BackupOperationStatusesClient { - /** - * The proxy service used to perform REST calls. - */ - private final BackupOperationStatusesService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of BackupOperationStatusesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BackupOperationStatusesClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(BackupOperationStatusesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientBackupOperationStatuses to be - * used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientBackupOperationStatuses") - public interface BackupOperationStatusesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperations/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperations/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations - * create jobs. This method returns the list of jobs when the operation is complete. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, String resourceGroupName, - String operationId) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, - resourceGroupName, this.client.getSubscriptionId(), operationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations - * create jobs. This method returns the list of jobs when the operation is complete. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName, String operationId) { - return getWithResponseAsync(vaultName, resourceGroupName, operationId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations - * create jobs. This method returns the list of jobs when the operation is complete. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, - String operationId, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), operationId, accept, context); - } - - /** - * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations - * create jobs. This method returns the list of jobs when the operation is complete. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusInner get(String vaultName, String resourceGroupName, String operationId) { - return getWithResponse(vaultName, resourceGroupName, operationId, Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationStatusesImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationStatusesImpl.java deleted file mode 100644 index b830f03cf51d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupOperationStatusesImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupOperationStatusesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupOperationStatuses; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatus; - -public final class BackupOperationStatusesImpl implements BackupOperationStatuses { - private static final ClientLogger LOGGER = new ClientLogger(BackupOperationStatusesImpl.class); - - private final BackupOperationStatusesClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public BackupOperationStatusesImpl(BackupOperationStatusesClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, String operationId, - Context context) { - Response inner - = this.serviceClient().getWithResponse(vaultName, resourceGroupName, operationId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationStatusImpl(inner.getValue(), this.manager())); - } - - public OperationStatus get(String vaultName, String resourceGroupName, String operationId) { - OperationStatusInner inner = this.serviceClient().get(vaultName, resourceGroupName, operationId); - if (inner != null) { - return new OperationStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - private BackupOperationStatusesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesClientImpl.java deleted file mode 100644 index 5131df2186ed..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesClientImpl.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupPoliciesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.ProtectionPolicyResourceList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in BackupPoliciesClient. - */ -public final class BackupPoliciesClientImpl implements BackupPoliciesClient { - /** - * The proxy service used to perform REST calls. - */ - private final BackupPoliciesService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of BackupPoliciesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BackupPoliciesClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service - = RestProxy.create(BackupPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientBackupPolicies to be used by - * the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientBackupPolicies") - public interface BackupPoliciesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch - * scoped results. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionPolicy resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String vaultName, - String resourceGroupName, String filter) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, filter, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch - * scoped results. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionPolicy resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName, - String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch - * scoped results. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionPolicy resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName) { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch - * scoped results. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionPolicy resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, - String filter) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, filter, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch - * scoped results. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionPolicy resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, - String filter, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, filter, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch - * scoped results. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionPolicy resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName) { - final String filter = null; - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, filter), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch - * scoped results. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionPolicy resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName, String filter, - Context context) { - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, filter, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionPolicy resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionPolicy resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionPolicy resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesImpl.java deleted file mode 100644 index 53c20dfc1e68..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupPoliciesImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupPoliciesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupPolicies; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicyResource; - -public final class BackupPoliciesImpl implements BackupPolicies { - private static final ClientLogger LOGGER = new ClientLogger(BackupPoliciesImpl.class); - - private final BackupPoliciesClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public BackupPoliciesImpl(BackupPoliciesClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String vaultName, String resourceGroupName) { - PagedIterable inner = this.serviceClient().list(vaultName, resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ProtectionPolicyResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String vaultName, String resourceGroupName, String filter, - Context context) { - PagedIterable inner - = this.serviceClient().list(vaultName, resourceGroupName, filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ProtectionPolicyResourceImpl(inner1, this.manager())); - } - - private BackupPoliciesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsClientImpl.java deleted file mode 100644 index 19ee07476d1e..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsClientImpl.java +++ /dev/null @@ -1,311 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectableItemsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadProtectableItemResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.WorkloadProtectableItemResourceList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in BackupProtectableItemsClient. - */ -public final class BackupProtectableItemsClientImpl implements BackupProtectableItemsClient { - /** - * The proxy service used to perform REST calls. - */ - private final BackupProtectableItemsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of BackupProtectableItemsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BackupProtectableItemsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(BackupProtectableItemsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientBackupProtectableItems to be - * used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientBackupProtectableItems") - public interface BackupProtectableItemsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectableItems") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("$filter") String filter, - @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectableItems") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("$filter") String filter, - @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Provides a pageable list of protectable objects within your subscription according to the query filter and the - * pagination parameters. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadProtectableItem resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String vaultName, - String resourceGroupName, String filter, String skipToken) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, - resourceGroupName, this.client.getSubscriptionId(), filter, skipToken, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Provides a pageable list of protectable objects within your subscription according to the query filter and the - * pagination parameters. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadProtectableItem resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName, - String filter, String skipToken) { - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Provides a pageable list of protectable objects within your subscription according to the query filter and the - * pagination parameters. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadProtectableItem resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName) { - final String filter = null; - final String skipToken = null; - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Provides a pageable list of protectable objects within your subscription according to the query filter and the - * pagination parameters. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadProtectableItem resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, - String resourceGroupName, String filter, String skipToken) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), filter, skipToken, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Provides a pageable list of protectable objects within your subscription according to the query filter and the - * pagination parameters. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadProtectableItem resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, - String resourceGroupName, String filter, String skipToken, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), filter, skipToken, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Provides a pageable list of protectable objects within your subscription according to the query filter and the - * pagination parameters. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadProtectableItem resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName) { - final String filter = null; - final String skipToken = null; - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, filter, skipToken), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Provides a pageable list of protectable objects within your subscription according to the query filter and the - * pagination parameters. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadProtectableItem resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName, - String filter, String skipToken, Context context) { - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, filter, skipToken, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadProtectableItem resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadProtectableItem resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadProtectableItem resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsImpl.java deleted file mode 100644 index 90b8fb318913..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectableItemsImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectableItemsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadProtectableItemResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectableItems; -import com.azure.resourcemanager.recoveryservicesbackup.models.WorkloadProtectableItemResource; - -public final class BackupProtectableItemsImpl implements BackupProtectableItems { - private static final ClientLogger LOGGER = new ClientLogger(BackupProtectableItemsImpl.class); - - private final BackupProtectableItemsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public BackupProtectableItemsImpl(BackupProtectableItemsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String vaultName, String resourceGroupName) { - PagedIterable inner - = this.serviceClient().list(vaultName, resourceGroupName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new WorkloadProtectableItemResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String vaultName, String resourceGroupName, - String filter, String skipToken, Context context) { - PagedIterable inner - = this.serviceClient().list(vaultName, resourceGroupName, filter, skipToken, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new WorkloadProtectableItemResourceImpl(inner1, this.manager())); - } - - private BackupProtectableItemsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsClientImpl.java deleted file mode 100644 index b69e2dc0fd03..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsClientImpl.java +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectedItemsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.ProtectedItemResourceList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in BackupProtectedItemsClient. - */ -public final class BackupProtectedItemsClientImpl implements BackupProtectedItemsClient { - /** - * The proxy service used to perform REST calls. - */ - private final BackupProtectedItemsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of BackupProtectedItemsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BackupProtectedItemsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(BackupProtectedItemsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientBackupProtectedItems to be used - * by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientBackupProtectedItems") - public interface BackupProtectedItemsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("$filter") String filter, - @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("$filter") String filter, - @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Provides a pageable list of all items that are backed up within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectedItem resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String vaultName, - String resourceGroupName, String filter, String skipToken) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, - resourceGroupName, this.client.getSubscriptionId(), filter, skipToken, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Provides a pageable list of all items that are backed up within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectedItem resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName, String filter, - String skipToken) { - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Provides a pageable list of all items that are backed up within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectedItem resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName) { - final String filter = null; - final String skipToken = null; - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Provides a pageable list of all items that are backed up within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectedItem resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, - String filter, String skipToken) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), filter, skipToken, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Provides a pageable list of all items that are backed up within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectedItem resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, - String filter, String skipToken, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), filter, skipToken, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Provides a pageable list of all items that are backed up within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectedItem resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName) { - final String filter = null; - final String skipToken = null; - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, filter, skipToken), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Provides a pageable list of all items that are backed up within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectedItem resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName, String filter, - String skipToken, Context context) { - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, filter, skipToken, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectedItem resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectedItem resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectedItem resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsImpl.java deleted file mode 100644 index f6c6a15d32c4..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectedItemsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectedItems; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemResource; - -public final class BackupProtectedItemsImpl implements BackupProtectedItems { - private static final ClientLogger LOGGER = new ClientLogger(BackupProtectedItemsImpl.class); - - private final BackupProtectedItemsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public BackupProtectedItemsImpl(BackupProtectedItemsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String vaultName, String resourceGroupName) { - PagedIterable inner = this.serviceClient().list(vaultName, resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ProtectedItemResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String vaultName, String resourceGroupName, String filter, - String skipToken, Context context) { - PagedIterable inner - = this.serviceClient().list(vaultName, resourceGroupName, filter, skipToken, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ProtectedItemResourceImpl(inner1, this.manager())); - } - - private BackupProtectedItemsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersClientImpl.java deleted file mode 100644 index d92c77bf46e3..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersClientImpl.java +++ /dev/null @@ -1,297 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectionContainersClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.ProtectionContainerResourceList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in BackupProtectionContainersClient. - */ -public final class BackupProtectionContainersClientImpl implements BackupProtectionContainersClient { - /** - * The proxy service used to perform REST calls. - */ - private final BackupProtectionContainersService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of BackupProtectionContainersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BackupProtectionContainersClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(BackupProtectionContainersService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientBackupProtectionContainers to - * be used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientBackupProtectionContainers") - public interface BackupProtectionContainersService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectionContainers") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectionContainers") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists the containers registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String vaultName, - String resourceGroupName, String filter) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, - resourceGroupName, this.client.getSubscriptionId(), filter, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the containers registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName, - String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the containers registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName) { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the containers registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, - String filter) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), filter, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists the containers registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, - String filter, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), filter, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists the containers registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName) { - final String filter = null; - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, filter), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Lists the containers registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName, - String filter, Context context) { - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, filter, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersImpl.java deleted file mode 100644 index 8bebc64000ba..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionContainersImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectionContainersClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectionContainers; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainerResource; - -public final class BackupProtectionContainersImpl implements BackupProtectionContainers { - private static final ClientLogger LOGGER = new ClientLogger(BackupProtectionContainersImpl.class); - - private final BackupProtectionContainersClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public BackupProtectionContainersImpl(BackupProtectionContainersClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String vaultName, String resourceGroupName) { - PagedIterable inner = this.serviceClient().list(vaultName, resourceGroupName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ProtectionContainerResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String vaultName, String resourceGroupName, String filter, - Context context) { - PagedIterable inner - = this.serviceClient().list(vaultName, resourceGroupName, filter, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ProtectionContainerResourceImpl(inner1, this.manager())); - } - - private BackupProtectionContainersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsClientImpl.java deleted file mode 100644 index 650c8684a82f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsClientImpl.java +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectionIntentsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionIntentResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.ProtectionIntentResourceList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in BackupProtectionIntentsClient. - */ -public final class BackupProtectionIntentsClientImpl implements BackupProtectionIntentsClient { - /** - * The proxy service used to perform REST calls. - */ - private final BackupProtectionIntentsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of BackupProtectionIntentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BackupProtectionIntentsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(BackupProtectionIntentsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientBackupProtectionIntents to be - * used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientBackupProtectionIntents") - public interface BackupProtectionIntentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectionIntents") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("$filter") String filter, - @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectionIntents") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("$filter") String filter, - @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Provides a pageable list of all intents that are present within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionIntent resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String vaultName, - String resourceGroupName, String filter, String skipToken) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, - resourceGroupName, this.client.getSubscriptionId(), filter, skipToken, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Provides a pageable list of all intents that are present within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionIntent resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName, - String filter, String skipToken) { - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Provides a pageable list of all intents that are present within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionIntent resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName) { - final String filter = null; - final String skipToken = null; - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Provides a pageable list of all intents that are present within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionIntent resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, - String filter, String skipToken) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), filter, skipToken, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Provides a pageable list of all intents that are present within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionIntent resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, - String filter, String skipToken, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), filter, skipToken, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Provides a pageable list of all intents that are present within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionIntent resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName) { - final String filter = null; - final String skipToken = null; - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, filter, skipToken), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Provides a pageable list of all intents that are present within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionIntent resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName, String filter, - String skipToken, Context context) { - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, filter, skipToken, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionIntent resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionIntent resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionIntent resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsImpl.java deleted file mode 100644 index fac012245d94..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectionIntentsImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectionIntentsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionIntentResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectionIntents; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionIntentResource; - -public final class BackupProtectionIntentsImpl implements BackupProtectionIntents { - private static final ClientLogger LOGGER = new ClientLogger(BackupProtectionIntentsImpl.class); - - private final BackupProtectionIntentsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public BackupProtectionIntentsImpl(BackupProtectionIntentsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String vaultName, String resourceGroupName) { - PagedIterable inner = this.serviceClient().list(vaultName, resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ProtectionIntentResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String vaultName, String resourceGroupName, String filter, - String skipToken, Context context) { - PagedIterable inner - = this.serviceClient().list(vaultName, resourceGroupName, filter, skipToken, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ProtectionIntentResourceImpl(inner1, this.manager())); - } - - private BackupProtectionIntentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceConfigResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceConfigResourceImpl.java deleted file mode 100644 index 695540c356ae..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceConfigResourceImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceConfig; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceConfigResource; -import java.util.Collections; -import java.util.Map; - -public final class BackupResourceConfigResourceImpl implements BackupResourceConfigResource { - private BackupResourceConfigResourceInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - BackupResourceConfigResourceImpl(BackupResourceConfigResourceInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager 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 BackupResourceConfig properties() { - return this.innerModel().properties(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String location() { - return this.innerModel().location(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public BackupResourceConfigResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigExtendedResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigExtendedResourceImpl.java deleted file mode 100644 index 26776c904dfa..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigExtendedResourceImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigExtendedResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigExtended; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigExtendedResource; -import java.util.Collections; -import java.util.Map; - -public final class BackupResourceEncryptionConfigExtendedResourceImpl - implements BackupResourceEncryptionConfigExtendedResource { - private BackupResourceEncryptionConfigExtendedResourceInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - BackupResourceEncryptionConfigExtendedResourceImpl(BackupResourceEncryptionConfigExtendedResourceInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager 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 BackupResourceEncryptionConfigExtended properties() { - return this.innerModel().properties(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String location() { - return this.innerModel().location(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public BackupResourceEncryptionConfigExtendedResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsClientImpl.java deleted file mode 100644 index 4866e58cee93..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsClientImpl.java +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.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.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceEncryptionConfigsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigExtendedResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigResource; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in BackupResourceEncryptionConfigsClient. - */ -public final class BackupResourceEncryptionConfigsClientImpl implements BackupResourceEncryptionConfigsClient { - /** - * The proxy service used to perform REST calls. - */ - private final BackupResourceEncryptionConfigsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of BackupResourceEncryptionConfigsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BackupResourceEncryptionConfigsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(BackupResourceEncryptionConfigsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientBackupResourceEncryptionConfigs - * to be used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientBackupResourceEncryptionConfigs") - public interface BackupResourceEncryptionConfigsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEncryptionConfigs/backupResourceEncryptionConfig") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEncryptionConfigs/backupResourceEncryptionConfig") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEncryptionConfigs/backupResourceEncryptionConfig") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BackupResourceEncryptionConfigResource parameters, Context context); - - @Headers({ "Accept: application/json;q=0.9" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEncryptionConfigs/backupResourceEncryptionConfig") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BackupResourceEncryptionConfigResource parameters, Context context); - } - - /** - * Fetches Vault Encryption config. - * - * @param vaultName The name of the VaultResource. - * @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 the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, - String resourceGroupName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Fetches Vault Encryption config. - * - * @param vaultName The name of the VaultResource. - * @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 the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, - String resourceGroupName) { - return getWithResponseAsync(vaultName, resourceGroupName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Fetches Vault Encryption config. - * - * @param vaultName The name of the VaultResource. - * @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 the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, - String resourceGroupName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, accept, context); - } - - /** - * Fetches Vault Encryption config. - * - * @param vaultName The name of the VaultResource. - * @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 the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupResourceEncryptionConfigExtendedResourceInner get(String vaultName, String resourceGroupName) { - return getWithResponse(vaultName, resourceGroupName, Context.NONE).getValue(); - } - - /** - * Updates Vault encryption config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault encryption input config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String vaultName, String resourceGroupName, - BackupResourceEncryptionConfigResource parameters) { - final String contentType = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, contentType, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates Vault encryption config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault encryption input config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String vaultName, String resourceGroupName, - BackupResourceEncryptionConfigResource parameters) { - return updateWithResponseAsync(vaultName, resourceGroupName, parameters).flatMap(ignored -> Mono.empty()); - } - - /** - * Updates Vault encryption config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault encryption input config request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String vaultName, String resourceGroupName, - BackupResourceEncryptionConfigResource parameters, Context context) { - final String contentType = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, contentType, parameters, context); - } - - /** - * Updates Vault encryption config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault encryption input config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void update(String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResource parameters) { - updateWithResponse(vaultName, resourceGroupName, parameters, Context.NONE); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsImpl.java deleted file mode 100644 index 5c9abaff82b5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceEncryptionConfigsImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceEncryptionConfigsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigExtendedResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigExtendedResource; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigResource; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigs; - -public final class BackupResourceEncryptionConfigsImpl implements BackupResourceEncryptionConfigs { - private static final ClientLogger LOGGER = new ClientLogger(BackupResourceEncryptionConfigsImpl.class); - - private final BackupResourceEncryptionConfigsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public BackupResourceEncryptionConfigsImpl(BackupResourceEncryptionConfigsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, - String resourceGroupName, Context context) { - Response inner - = this.serviceClient().getWithResponse(vaultName, resourceGroupName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new BackupResourceEncryptionConfigExtendedResourceImpl(inner.getValue(), this.manager())); - } - - public BackupResourceEncryptionConfigExtendedResource get(String vaultName, String resourceGroupName) { - BackupResourceEncryptionConfigExtendedResourceInner inner - = this.serviceClient().get(vaultName, resourceGroupName); - if (inner != null) { - return new BackupResourceEncryptionConfigExtendedResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response updateWithResponse(String vaultName, String resourceGroupName, - BackupResourceEncryptionConfigResource parameters, Context context) { - return this.serviceClient().updateWithResponse(vaultName, resourceGroupName, parameters, context); - } - - public void update(String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResource parameters) { - this.serviceClient().update(vaultName, resourceGroupName, parameters); - } - - private BackupResourceEncryptionConfigsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsNonCrrsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsNonCrrsClientImpl.java deleted file mode 100644 index 6644db4fdd45..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsNonCrrsClientImpl.java +++ /dev/null @@ -1,339 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -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.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceStorageConfigsNonCrrsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in BackupResourceStorageConfigsNonCrrsClient. - */ -public final class BackupResourceStorageConfigsNonCrrsClientImpl implements BackupResourceStorageConfigsNonCrrsClient { - /** - * The proxy service used to perform REST calls. - */ - private final BackupResourceStorageConfigsNonCrrsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of BackupResourceStorageConfigsNonCrrsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BackupResourceStorageConfigsNonCrrsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(BackupResourceStorageConfigsNonCrrsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for - * RecoveryServicesBackupManagementClientBackupResourceStorageConfigsNonCrrs to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientBackupResourceStorageConfigsNonCrrs") - public interface BackupResourceStorageConfigsNonCrrsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BackupResourceConfigResourceInner parameters, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BackupResourceConfigResourceInner parameters, Context context); - - @Headers({ "Accept: application/json;q=0.9" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> patch(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BackupResourceConfigResourceInner parameters, Context context); - - @Headers({ "Accept: application/json;q=0.9" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response patchSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BackupResourceConfigResourceInner parameters, Context context); - } - - /** - * Fetches resource storage config. - * - * @param vaultName The name of the VaultResource. - * @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 the resource storage details along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, - String resourceGroupName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Fetches resource storage config. - * - * @param vaultName The name of the VaultResource. - * @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 the resource storage details on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName) { - return getWithResponseAsync(vaultName, resourceGroupName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Fetches resource storage config. - * - * @param vaultName The name of the VaultResource. - * @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 the resource storage details along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, - Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, accept, context); - } - - /** - * Fetches resource storage config. - * - * @param vaultName The name of the VaultResource. - * @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 the resource storage details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupResourceConfigResourceInner get(String vaultName, String resourceGroupName) { - return getWithResponse(vaultName, resourceGroupName, Context.NONE).getValue(); - } - - /** - * Updates vault storage model type. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault storage config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource storage details along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String vaultName, - String resourceGroupName, BackupResourceConfigResourceInner parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, contentType, accept, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates vault storage model type. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault storage config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource storage details on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String vaultName, String resourceGroupName, - BackupResourceConfigResourceInner parameters) { - return updateWithResponseAsync(vaultName, resourceGroupName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Updates vault storage model type. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault storage config request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource storage details along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String vaultName, String resourceGroupName, - BackupResourceConfigResourceInner parameters, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, contentType, accept, parameters, context); - } - - /** - * Updates vault storage model type. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault storage config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource storage details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupResourceConfigResourceInner update(String vaultName, String resourceGroupName, - BackupResourceConfigResourceInner parameters) { - return updateWithResponse(vaultName, resourceGroupName, parameters, Context.NONE).getValue(); - } - - /** - * Updates vault storage model type. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault storage config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> patchWithResponseAsync(String vaultName, String resourceGroupName, - BackupResourceConfigResourceInner parameters) { - final String contentType = "application/json"; - return FluxUtil - .withContext(context -> service.patch(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, contentType, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates vault storage model type. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault storage config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono patchAsync(String vaultName, String resourceGroupName, - BackupResourceConfigResourceInner parameters) { - return patchWithResponseAsync(vaultName, resourceGroupName, parameters).flatMap(ignored -> Mono.empty()); - } - - /** - * Updates vault storage model type. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault storage config request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response patchWithResponse(String vaultName, String resourceGroupName, - BackupResourceConfigResourceInner parameters, Context context) { - final String contentType = "application/json"; - return service.patchSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, contentType, parameters, context); - } - - /** - * Updates vault storage model type. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault storage config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void patch(String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters) { - patchWithResponse(vaultName, resourceGroupName, parameters, Context.NONE); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsNonCrrsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsNonCrrsImpl.java deleted file mode 100644 index c851c2b4e2cf..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceStorageConfigsNonCrrsImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceStorageConfigsNonCrrsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceConfigResource; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceStorageConfigsNonCrrs; - -public final class BackupResourceStorageConfigsNonCrrsImpl implements BackupResourceStorageConfigsNonCrrs { - private static final ClientLogger LOGGER = new ClientLogger(BackupResourceStorageConfigsNonCrrsImpl.class); - - private final BackupResourceStorageConfigsNonCrrsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public BackupResourceStorageConfigsNonCrrsImpl(BackupResourceStorageConfigsNonCrrsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(vaultName, resourceGroupName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new BackupResourceConfigResourceImpl(inner.getValue(), this.manager())); - } - - public BackupResourceConfigResource get(String vaultName, String resourceGroupName) { - BackupResourceConfigResourceInner inner = this.serviceClient().get(vaultName, resourceGroupName); - if (inner != null) { - return new BackupResourceConfigResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response updateWithResponse(String vaultName, String resourceGroupName, - BackupResourceConfigResourceInner parameters, Context context) { - Response inner - = this.serviceClient().updateWithResponse(vaultName, resourceGroupName, parameters, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new BackupResourceConfigResourceImpl(inner.getValue(), this.manager())); - } - - public BackupResourceConfigResource update(String vaultName, String resourceGroupName, - BackupResourceConfigResourceInner parameters) { - BackupResourceConfigResourceInner inner = this.serviceClient().update(vaultName, resourceGroupName, parameters); - if (inner != null) { - return new BackupResourceConfigResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response patchWithResponse(String vaultName, String resourceGroupName, - BackupResourceConfigResourceInner parameters, Context context) { - return this.serviceClient().patchWithResponse(vaultName, resourceGroupName, parameters, context); - } - - public void patch(String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters) { - this.serviceClient().patch(vaultName, resourceGroupName, parameters); - } - - private BackupResourceStorageConfigsNonCrrsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigResourceImpl.java deleted file mode 100644 index 60e654e56c03..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigResourceImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceVaultConfigResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceVaultConfig; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceVaultConfigResource; -import java.util.Collections; -import java.util.Map; - -public final class BackupResourceVaultConfigResourceImpl implements BackupResourceVaultConfigResource { - private BackupResourceVaultConfigResourceInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - BackupResourceVaultConfigResourceImpl(BackupResourceVaultConfigResourceInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager 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 BackupResourceVaultConfig properties() { - return this.innerModel().properties(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String location() { - return this.innerModel().location(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public BackupResourceVaultConfigResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigsClientImpl.java deleted file mode 100644 index bebb021bc0ee..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigsClientImpl.java +++ /dev/null @@ -1,343 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -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.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceVaultConfigsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceVaultConfigResourceInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in BackupResourceVaultConfigsClient. - */ -public final class BackupResourceVaultConfigsClientImpl implements BackupResourceVaultConfigsClient { - /** - * The proxy service used to perform REST calls. - */ - private final BackupResourceVaultConfigsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of BackupResourceVaultConfigsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BackupResourceVaultConfigsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(BackupResourceVaultConfigsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientBackupResourceVaultConfigs to - * be used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientBackupResourceVaultConfigs") - public interface BackupResourceVaultConfigsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> put(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BackupResourceVaultConfigResourceInner parameters, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response putSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BackupResourceVaultConfigResourceInner parameters, Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BackupResourceVaultConfigResourceInner parameters, Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BackupResourceVaultConfigResourceInner parameters, Context context); - } - - /** - * Fetches resource vault config. - * - * @param vaultName The name of the VaultResource. - * @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 backup resource vault config details along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, - String resourceGroupName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Fetches resource vault config. - * - * @param vaultName The name of the VaultResource. - * @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 backup resource vault config details on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName) { - return getWithResponseAsync(vaultName, resourceGroupName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Fetches resource vault config. - * - * @param vaultName The name of the VaultResource. - * @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 backup resource vault config details along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, - Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, accept, context); - } - - /** - * Fetches resource vault config. - * - * @param vaultName The name of the VaultResource. - * @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 backup resource vault config details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupResourceVaultConfigResourceInner get(String vaultName, String resourceGroupName) { - return getWithResponse(vaultName, resourceGroupName, Context.NONE).getValue(); - } - - /** - * Updates vault security config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup resource vault config details along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> putWithResponseAsync(String vaultName, - String resourceGroupName, BackupResourceVaultConfigResourceInner parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.put(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, contentType, accept, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates vault security config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup resource vault config details on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono putAsync(String vaultName, String resourceGroupName, - BackupResourceVaultConfigResourceInner parameters) { - return putWithResponseAsync(vaultName, resourceGroupName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Updates vault security config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource config request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup resource vault config details along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response putWithResponse(String vaultName, String resourceGroupName, - BackupResourceVaultConfigResourceInner parameters, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.putSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, contentType, accept, parameters, context); - } - - /** - * Updates vault security config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup resource vault config details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupResourceVaultConfigResourceInner put(String vaultName, String resourceGroupName, - BackupResourceVaultConfigResourceInner parameters) { - return putWithResponse(vaultName, resourceGroupName, parameters, Context.NONE).getValue(); - } - - /** - * Updates vault security config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup resource vault config details along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String vaultName, - String resourceGroupName, BackupResourceVaultConfigResourceInner parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, contentType, accept, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates vault security config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup resource vault config details on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String vaultName, String resourceGroupName, - BackupResourceVaultConfigResourceInner parameters) { - return updateWithResponseAsync(vaultName, resourceGroupName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Updates vault security config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource config request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup resource vault config details along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String vaultName, - String resourceGroupName, BackupResourceVaultConfigResourceInner parameters, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, contentType, accept, parameters, context); - } - - /** - * Updates vault security config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup resource vault config details. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupResourceVaultConfigResourceInner update(String vaultName, String resourceGroupName, - BackupResourceVaultConfigResourceInner parameters) { - return updateWithResponse(vaultName, resourceGroupName, parameters, Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigsImpl.java deleted file mode 100644 index c2b86a0d3f80..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupResourceVaultConfigsImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceVaultConfigsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceVaultConfigResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceVaultConfigResource; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceVaultConfigs; - -public final class BackupResourceVaultConfigsImpl implements BackupResourceVaultConfigs { - private static final ClientLogger LOGGER = new ClientLogger(BackupResourceVaultConfigsImpl.class); - - private final BackupResourceVaultConfigsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public BackupResourceVaultConfigsImpl(BackupResourceVaultConfigsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(vaultName, resourceGroupName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new BackupResourceVaultConfigResourceImpl(inner.getValue(), this.manager())); - } - - public BackupResourceVaultConfigResource get(String vaultName, String resourceGroupName) { - BackupResourceVaultConfigResourceInner inner = this.serviceClient().get(vaultName, resourceGroupName); - if (inner != null) { - return new BackupResourceVaultConfigResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response putWithResponse(String vaultName, String resourceGroupName, - BackupResourceVaultConfigResourceInner parameters, Context context) { - Response inner - = this.serviceClient().putWithResponse(vaultName, resourceGroupName, parameters, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new BackupResourceVaultConfigResourceImpl(inner.getValue(), this.manager())); - } - - public BackupResourceVaultConfigResource put(String vaultName, String resourceGroupName, - BackupResourceVaultConfigResourceInner parameters) { - BackupResourceVaultConfigResourceInner inner - = this.serviceClient().put(vaultName, resourceGroupName, parameters); - if (inner != null) { - return new BackupResourceVaultConfigResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response updateWithResponse(String vaultName, String resourceGroupName, - BackupResourceVaultConfigResourceInner parameters, Context context) { - Response inner - = this.serviceClient().updateWithResponse(vaultName, resourceGroupName, parameters, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new BackupResourceVaultConfigResourceImpl(inner.getValue(), this.manager())); - } - - public BackupResourceVaultConfigResource update(String vaultName, String resourceGroupName, - BackupResourceVaultConfigResourceInner parameters) { - BackupResourceVaultConfigResourceInner inner - = this.serviceClient().update(vaultName, resourceGroupName, parameters); - if (inner != null) { - return new BackupResourceVaultConfigResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - private BackupResourceVaultConfigsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusClientImpl.java deleted file mode 100644 index eeac8970b059..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusClientImpl.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupStatusClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupStatusResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupStatusRequest; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in BackupStatusClient. - */ -public final class BackupStatusClientImpl implements BackupStatusClient { - /** - * The proxy service used to perform REST calls. - */ - private final BackupStatusService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of BackupStatusClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BackupStatusClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service - = RestProxy.create(BackupStatusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientBackupStatus to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientBackupStatus") - public interface BackupStatusService { - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupStatus") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("azureRegion") String azureRegion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BackupStatusRequest parameters, - Context context); - - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupStatus") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("azureRegion") String azureRegion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BackupStatusRequest parameters, - Context context); - } - - /** - * Get the container backup status. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Container Backup Status Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the container backup status along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String azureRegion, - BackupStatusRequest parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), azureRegion, - this.client.getSubscriptionId(), contentType, accept, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the container backup status. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Container Backup Status Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the container backup status on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String azureRegion, BackupStatusRequest parameters) { - return getWithResponseAsync(azureRegion, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the container backup status. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Container Backup Status Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the container backup status along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String azureRegion, BackupStatusRequest parameters, - Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), azureRegion, - this.client.getSubscriptionId(), contentType, accept, parameters, context); - } - - /** - * Get the container backup status. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Container Backup Status Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the container backup status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public BackupStatusResponseInner get(String azureRegion, BackupStatusRequest parameters) { - return getWithResponse(azureRegion, parameters, Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusImpl.java deleted file mode 100644 index 0ef0a949d2d4..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupStatusClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupStatusResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupStatus; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupStatusRequest; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupStatusResponse; - -public final class BackupStatusImpl implements BackupStatus { - private static final ClientLogger LOGGER = new ClientLogger(BackupStatusImpl.class); - - private final BackupStatusClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public BackupStatusImpl(BackupStatusClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String azureRegion, BackupStatusRequest parameters, - Context context) { - Response inner - = this.serviceClient().getWithResponse(azureRegion, parameters, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new BackupStatusResponseImpl(inner.getValue(), this.manager())); - } - - public BackupStatusResponse get(String azureRegion, BackupStatusRequest parameters) { - BackupStatusResponseInner inner = this.serviceClient().get(azureRegion, parameters); - if (inner != null) { - return new BackupStatusResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private BackupStatusClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusResponseImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusResponseImpl.java deleted file mode 100644 index 1cc86bb741b4..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupStatusResponseImpl.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupStatusResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.AcquireStorageAccountLock; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupStatusResponse; -import com.azure.resourcemanager.recoveryservicesbackup.models.FabricName; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionStatus; - -public final class BackupStatusResponseImpl implements BackupStatusResponse { - private BackupStatusResponseInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - BackupStatusResponseImpl(BackupStatusResponseInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public ProtectionStatus protectionStatus() { - return this.innerModel().protectionStatus(); - } - - public String vaultId() { - return this.innerModel().vaultId(); - } - - public FabricName fabricName() { - return this.innerModel().fabricName(); - } - - public String containerName() { - return this.innerModel().containerName(); - } - - public String protectedItemName() { - return this.innerModel().protectedItemName(); - } - - public String errorCode() { - return this.innerModel().errorCode(); - } - - public String errorMessage() { - return this.innerModel().errorMessage(); - } - - public String policyName() { - return this.innerModel().policyName(); - } - - public String registrationStatus() { - return this.innerModel().registrationStatus(); - } - - public Integer protectedItemsCount() { - return this.innerModel().protectedItemsCount(); - } - - public AcquireStorageAccountLock acquireStorageAccountLock() { - return this.innerModel().acquireStorageAccountLock(); - } - - public BackupStatusResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesClientImpl.java deleted file mode 100644 index 4f1be869e5c0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesClientImpl.java +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupUsageSummariesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupManagementUsageInner; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.BackupManagementUsageList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in BackupUsageSummariesClient. - */ -public final class BackupUsageSummariesClientImpl implements BackupUsageSummariesClient { - /** - * The proxy service used to perform REST calls. - */ - private final BackupUsageSummariesService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of BackupUsageSummariesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BackupUsageSummariesClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(BackupUsageSummariesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientBackupUsageSummaries to be used - * by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientBackupUsageSummaries") - public interface BackupUsageSummariesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupUsageSummaries") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("$filter") String filter, - @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupUsageSummaries") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("$filter") String filter, - @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Fetches the backup management usage summaries of the vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup management usage for vault along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String vaultName, - String resourceGroupName, String filter, String skipToken) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, - resourceGroupName, this.client.getSubscriptionId(), filter, skipToken, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Fetches the backup management usage summaries of the vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup management usage for vault as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName, String filter, - String skipToken) { - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Fetches the backup management usage summaries of the vault. - * - * @param vaultName The name of the recovery services vault. - * @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 backup management usage for vault as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName) { - final String filter = null; - final String skipToken = null; - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, filter, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Fetches the backup management usage summaries of the vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup management usage for vault along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, - String filter, String skipToken) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), filter, skipToken, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Fetches the backup management usage summaries of the vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup management usage for vault along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, - String filter, String skipToken, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), filter, skipToken, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Fetches the backup management usage summaries of the vault. - * - * @param vaultName The name of the recovery services vault. - * @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 backup management usage for vault as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName) { - final String filter = null; - final String skipToken = null; - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, filter, skipToken), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Fetches the backup management usage summaries of the vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup management usage for vault as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName, String filter, - String skipToken, Context context) { - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, filter, skipToken, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup management usage for vault along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup management usage for vault along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup management usage for vault along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesImpl.java deleted file mode 100644 index 1ccbb1a9954f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupUsageSummariesImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupUsageSummariesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupManagementUsageInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupManagementUsage; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupUsageSummaries; - -public final class BackupUsageSummariesImpl implements BackupUsageSummaries { - private static final ClientLogger LOGGER = new ClientLogger(BackupUsageSummariesImpl.class); - - private final BackupUsageSummariesClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public BackupUsageSummariesImpl(BackupUsageSummariesClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String vaultName, String resourceGroupName) { - PagedIterable inner = this.serviceClient().list(vaultName, resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new BackupManagementUsageImpl(inner1, this.manager())); - } - - public PagedIterable list(String vaultName, String resourceGroupName, String filter, - String skipToken, Context context) { - PagedIterable inner - = this.serviceClient().list(vaultName, resourceGroupName, filter, skipToken, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new BackupManagementUsageImpl(inner1, this.manager())); - } - - private BackupUsageSummariesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsClientImpl.java deleted file mode 100644 index c21e9636b99b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsClientImpl.java +++ /dev/null @@ -1,338 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupWorkloadItemsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadItemResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.WorkloadItemResourceList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in BackupWorkloadItemsClient. - */ -public final class BackupWorkloadItemsClientImpl implements BackupWorkloadItemsClient { - /** - * The proxy service used to perform REST calls. - */ - private final BackupWorkloadItemsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of BackupWorkloadItemsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BackupWorkloadItemsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(BackupWorkloadItemsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientBackupWorkloadItems to be used - * by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientBackupWorkloadItems") - public interface BackupWorkloadItemsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/items") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @QueryParam("$filter") String filter, @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/items") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @QueryParam("$filter") String filter, @QueryParam("$skipToken") String skipToken, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Provides a pageable list of workload item of a specific container according to the query filter and the - * pagination - * parameters. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadItem resources along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String vaultName, - String resourceGroupName, String fabricName, String containerName, String filter, String skipToken) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, filter, - skipToken, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Provides a pageable list of workload item of a specific container according to the query filter and the - * pagination - * parameters. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadItem resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName, - String fabricName, String containerName, String filter, String skipToken) { - return new PagedFlux<>( - () -> listSinglePageAsync(vaultName, resourceGroupName, fabricName, containerName, filter, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Provides a pageable list of workload item of a specific container according to the query filter and the - * pagination - * parameters. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadItem resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName, - String fabricName, String containerName) { - final String filter = null; - final String skipToken = null; - return new PagedFlux<>( - () -> listSinglePageAsync(vaultName, resourceGroupName, fabricName, containerName, filter, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Provides a pageable list of workload item of a specific container according to the query filter and the - * pagination - * parameters. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadItem resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, - String fabricName, String containerName, String filter, String skipToken) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, fabricName, containerName, filter, skipToken, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Provides a pageable list of workload item of a specific container according to the query filter and the - * pagination - * parameters. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadItem resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, - String fabricName, String containerName, String filter, String skipToken, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, fabricName, containerName, filter, skipToken, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Provides a pageable list of workload item of a specific container according to the query filter and the - * pagination - * parameters. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadItem resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName) { - final String filter = null; - final String skipToken = null; - return new PagedIterable<>( - () -> listSinglePage(vaultName, resourceGroupName, fabricName, containerName, filter, skipToken), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Provides a pageable list of workload item of a specific container according to the query filter and the - * pagination - * parameters. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadItem resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName, String filter, String skipToken, Context context) { - return new PagedIterable<>( - () -> listSinglePage(vaultName, resourceGroupName, fabricName, containerName, filter, skipToken, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadItem resources along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadItem resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadItem resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsImpl.java deleted file mode 100644 index 6acda5f3dcbf..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupWorkloadItemsImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupWorkloadItemsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadItemResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupWorkloadItems; -import com.azure.resourcemanager.recoveryservicesbackup.models.WorkloadItemResource; - -public final class BackupWorkloadItemsImpl implements BackupWorkloadItems { - private static final ClientLogger LOGGER = new ClientLogger(BackupWorkloadItemsImpl.class); - - private final BackupWorkloadItemsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public BackupWorkloadItemsImpl(BackupWorkloadItemsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName) { - PagedIterable inner - = this.serviceClient().list(vaultName, resourceGroupName, fabricName, containerName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadItemResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName, String filter, String skipToken, Context context) { - PagedIterable inner = this.serviceClient() - .list(vaultName, resourceGroupName, fabricName, containerName, filter, skipToken, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkloadItemResourceImpl(inner1, this.manager())); - } - - private BackupWorkloadItemsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupsClientImpl.java deleted file mode 100644 index cca10629d9a6..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupsClientImpl.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupsClient; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupRequestResource; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in BackupsClient. - */ -public final class BackupsClientImpl implements BackupsClient { - /** - * The proxy service used to perform REST calls. - */ - private final BackupsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of BackupsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BackupsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(BackupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientBackups to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientBackups") - public interface BackupsService { - @Headers({ "Accept: application/json;q=0.9" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/backup") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> trigger(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BackupRequestResource parameters, Context context); - - @Headers({ "Accept: application/json;q=0.9" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/backup") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response triggerSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BackupRequestResource parameters, Context context); - } - - /** - * Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the - * operation, call GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters resource backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> triggerWithResponseAsync(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, BackupRequestResource parameters) { - final String contentType = "application/json"; - return FluxUtil - .withContext(context -> service.trigger(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, - protectedItemName, contentType, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the - * operation, call GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters resource backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono triggerAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, BackupRequestResource parameters) { - return triggerWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - parameters).flatMap(ignored -> Mono.empty()); - } - - /** - * Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the - * operation, call GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters resource backup request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response triggerWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, BackupRequestResource parameters, Context context) { - final String contentType = "application/json"; - return service.triggerSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, protectedItemName, - contentType, parameters, context); - } - - /** - * Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the - * operation, call GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters resource backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void trigger(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, BackupRequestResource parameters) { - triggerWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters, - Context.NONE); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupsImpl.java deleted file mode 100644 index 600b3b0d8dc5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupsImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupsClient; -import com.azure.resourcemanager.recoveryservicesbackup.models.BackupRequestResource; -import com.azure.resourcemanager.recoveryservicesbackup.models.Backups; - -public final class BackupsImpl implements Backups { - private static final ClientLogger LOGGER = new ClientLogger(BackupsImpl.class); - - private final BackupsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public BackupsImpl(BackupsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response triggerWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, BackupRequestResource parameters, Context context) { - return this.serviceClient() - .triggerWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters, - context); - } - - public void trigger(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, BackupRequestResource parameters) { - this.serviceClient() - .trigger(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters); - } - - private BackupsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BmsPrepareDataMoveOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BmsPrepareDataMoveOperationResultsClientImpl.java deleted file mode 100644 index 479f94481ef5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BmsPrepareDataMoveOperationResultsClientImpl.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BmsPrepareDataMoveOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.VaultStorageConfigOperationResultResponseInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in BmsPrepareDataMoveOperationResultsClient. - */ -public final class BmsPrepareDataMoveOperationResultsClientImpl implements BmsPrepareDataMoveOperationResultsClient { - /** - * The proxy service used to perform REST calls. - */ - private final BmsPrepareDataMoveOperationResultsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of BmsPrepareDataMoveOperationResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - BmsPrepareDataMoveOperationResultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(BmsPrepareDataMoveOperationResultsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for - * RecoveryServicesBackupManagementClientBmsPrepareDataMoveOperationResults to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientBmsPrepareDataMoveOperationResults") - public interface BmsPrepareDataMoveOperationResultsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/operationResults/{operationId}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/operationResults/{operationId}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Fetches operation status for data move operation on vault. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the BackupResourceConfigResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation result response for Vault Storage Config along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, - String resourceGroupName, String operationId) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, operationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Fetches operation status for data move operation on vault. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the BackupResourceConfigResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation result response for Vault Storage Config on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName, - String operationId) { - return getWithResponseAsync(vaultName, resourceGroupName, operationId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Fetches operation status for data move operation on vault. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the BackupResourceConfigResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation result response for Vault Storage Config along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, - String resourceGroupName, String operationId, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, operationId, accept, context); - } - - /** - * Fetches operation status for data move operation on vault. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the BackupResourceConfigResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation result response for Vault Storage Config. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VaultStorageConfigOperationResultResponseInner get(String vaultName, String resourceGroupName, - String operationId) { - return getWithResponse(vaultName, resourceGroupName, operationId, Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BmsPrepareDataMoveOperationResultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BmsPrepareDataMoveOperationResultsImpl.java deleted file mode 100644 index e6402e2a9c8d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BmsPrepareDataMoveOperationResultsImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BmsPrepareDataMoveOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.VaultStorageConfigOperationResultResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.BmsPrepareDataMoveOperationResults; -import com.azure.resourcemanager.recoveryservicesbackup.models.VaultStorageConfigOperationResultResponse; - -public final class BmsPrepareDataMoveOperationResultsImpl implements BmsPrepareDataMoveOperationResults { - private static final ClientLogger LOGGER = new ClientLogger(BmsPrepareDataMoveOperationResultsImpl.class); - - private final BmsPrepareDataMoveOperationResultsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public BmsPrepareDataMoveOperationResultsImpl(BmsPrepareDataMoveOperationResultsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, - String resourceGroupName, String operationId, Context context) { - Response inner - = this.serviceClient().getWithResponse(vaultName, resourceGroupName, operationId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new VaultStorageConfigOperationResultResponseImpl(inner.getValue(), this.manager())); - } - - public VaultStorageConfigOperationResultResponse get(String vaultName, String resourceGroupName, - String operationId) { - VaultStorageConfigOperationResultResponseInner inner - = this.serviceClient().get(vaultName, resourceGroupName, operationId); - if (inner != null) { - return new VaultStorageConfigOperationResultResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private BmsPrepareDataMoveOperationResultsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ClientDiscoveryValueForSingleApiImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ClientDiscoveryValueForSingleApiImpl.java deleted file mode 100644 index ca1c73adcfac..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ClientDiscoveryValueForSingleApiImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ClientDiscoveryValueForSingleApiInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ClientDiscoveryDisplay; -import com.azure.resourcemanager.recoveryservicesbackup.models.ClientDiscoveryForProperties; -import com.azure.resourcemanager.recoveryservicesbackup.models.ClientDiscoveryValueForSingleApi; - -public final class ClientDiscoveryValueForSingleApiImpl implements ClientDiscoveryValueForSingleApi { - private ClientDiscoveryValueForSingleApiInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - ClientDiscoveryValueForSingleApiImpl(ClientDiscoveryValueForSingleApiInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public ClientDiscoveryDisplay display() { - return this.innerModel().display(); - } - - public String origin() { - return this.innerModel().origin(); - } - - public ClientDiscoveryForProperties properties() { - return this.innerModel().properties(); - } - - public ClientDiscoveryValueForSingleApiInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/DeletedProtectionContainersClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/DeletedProtectionContainersClientImpl.java deleted file mode 100644 index 4960648b7211..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/DeletedProtectionContainersClientImpl.java +++ /dev/null @@ -1,295 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.DeletedProtectionContainersClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.ProtectionContainerResourceList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in DeletedProtectionContainersClient. - */ -public final class DeletedProtectionContainersClientImpl implements DeletedProtectionContainersClient { - /** - * The proxy service used to perform REST calls. - */ - private final DeletedProtectionContainersService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of DeletedProtectionContainersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DeletedProtectionContainersClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(DeletedProtectionContainersService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientDeletedProtectionContainers to - * be used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientDeletedProtectionContainers") - public interface DeletedProtectionContainersService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupDeletedProtectionContainers") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupDeletedProtectionContainers") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists the soft deleted containers registered to Recovery Services Vault. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param filter OData filter options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String vaultName, String filter) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, filter, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the soft deleted containers registered to Recovery Services Vault. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param filter OData filter options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String vaultName, - String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, vaultName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the soft deleted containers registered to Recovery Services Vault. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String vaultName) { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, vaultName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the soft deleted containers registered to Recovery Services Vault. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param filter OData filter options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String vaultName, - String filter) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, filter, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists the soft deleted containers registered to Recovery Services Vault. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String vaultName, - String filter, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, filter, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists the soft deleted containers registered to Recovery Services Vault. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String vaultName) { - final String filter = null; - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, vaultName, filter), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Lists the soft deleted containers registered to Recovery Services Vault. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String vaultName, - String filter, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, vaultName, filter, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/DeletedProtectionContainersImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/DeletedProtectionContainersImpl.java deleted file mode 100644 index 35c56a1fc264..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/DeletedProtectionContainersImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.DeletedProtectionContainersClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.DeletedProtectionContainers; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainerResource; - -public final class DeletedProtectionContainersImpl implements DeletedProtectionContainers { - private static final ClientLogger LOGGER = new ClientLogger(DeletedProtectionContainersImpl.class); - - private final DeletedProtectionContainersClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public DeletedProtectionContainersImpl(DeletedProtectionContainersClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String vaultName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ProtectionContainerResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String vaultName, String filter, - Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, vaultName, filter, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ProtectionContainerResourceImpl(inner1, this.manager())); - } - - private DeletedProtectionContainersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ExportJobsOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ExportJobsOperationResultsClientImpl.java deleted file mode 100644 index 2d0326243efd..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ExportJobsOperationResultsClientImpl.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ExportJobsOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationResultInfoBaseResourceInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ExportJobsOperationResultsClient. - */ -public final class ExportJobsOperationResultsClientImpl implements ExportJobsOperationResultsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ExportJobsOperationResultsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of ExportJobsOperationResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ExportJobsOperationResultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(ExportJobsOperationResultsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientExportJobsOperationResults to - * be used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientExportJobsOperationResults") - public interface ExportJobsOperationResultsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/operationResults/{operationId}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/operationResults/{operationId}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also - * contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized - * format. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the JobResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result of operation triggered by Export Jobs API along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, - String resourceGroupName, String operationId) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, operationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also - * contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized - * format. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the JobResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result of operation triggered by Export Jobs API on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName, - String operationId) { - return getWithResponseAsync(vaultName, resourceGroupName, operationId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also - * contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized - * format. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the JobResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result of operation triggered by Export Jobs API along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, - String operationId, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, operationId, accept, context); - } - - /** - * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also - * contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized - * format. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the JobResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result of operation triggered by Export Jobs API. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationResultInfoBaseResourceInner get(String vaultName, String resourceGroupName, String operationId) { - return getWithResponse(vaultName, resourceGroupName, operationId, Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ExportJobsOperationResultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ExportJobsOperationResultsImpl.java deleted file mode 100644 index af1d46ba4c74..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ExportJobsOperationResultsImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ExportJobsOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationResultInfoBaseResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ExportJobsOperationResults; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationResultInfoBaseResource; - -public final class ExportJobsOperationResultsImpl implements ExportJobsOperationResults { - private static final ClientLogger LOGGER = new ClientLogger(ExportJobsOperationResultsImpl.class); - - private final ExportJobsOperationResultsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public ExportJobsOperationResultsImpl(ExportJobsOperationResultsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, - String operationId, Context context) { - Response inner - = this.serviceClient().getWithResponse(vaultName, resourceGroupName, operationId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationResultInfoBaseResourceImpl(inner.getValue(), this.manager())); - } - - public OperationResultInfoBaseResource get(String vaultName, String resourceGroupName, String operationId) { - OperationResultInfoBaseResourceInner inner - = this.serviceClient().get(vaultName, resourceGroupName, operationId); - if (inner != null) { - return new OperationResultInfoBaseResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - private ExportJobsOperationResultsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FeatureSupportsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FeatureSupportsClientImpl.java deleted file mode 100644 index 0873a8805acf..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FeatureSupportsClientImpl.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.FeatureSupportsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AzureVMResourceFeatureSupportResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.FeatureSupportRequest; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in FeatureSupportsClient. - */ -public final class FeatureSupportsClientImpl implements FeatureSupportsClient { - /** - * The proxy service used to perform REST calls. - */ - private final FeatureSupportsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of FeatureSupportsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - FeatureSupportsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service - = RestProxy.create(FeatureSupportsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientFeatureSupports to be used by - * the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientFeatureSupports") - public interface FeatureSupportsService { - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupValidateFeatures") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> validate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("azureRegion") String azureRegion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") FeatureSupportRequest parameters, - Context context); - - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupValidateFeatures") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response validateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("azureRegion") String azureRegion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") FeatureSupportRequest parameters, - Context context); - } - - /** - * It will validate if given feature with resource properties is supported in service. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Feature support request object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 for feature support requests for Azure IaasVm along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateWithResponseAsync(String azureRegion, - FeatureSupportRequest parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.validate(this.client.getEndpoint(), this.client.getApiVersion(), - azureRegion, this.client.getSubscriptionId(), contentType, accept, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * It will validate if given feature with resource properties is supported in service. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Feature support request object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 for feature support requests for Azure IaasVm on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateAsync(String azureRegion, - FeatureSupportRequest parameters) { - return validateWithResponseAsync(azureRegion, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * It will validate if given feature with resource properties is supported in service. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Feature support request object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 for feature support requests for Azure IaasVm along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateWithResponse(String azureRegion, - FeatureSupportRequest parameters, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.validateSync(this.client.getEndpoint(), this.client.getApiVersion(), azureRegion, - this.client.getSubscriptionId(), contentType, accept, parameters, context); - } - - /** - * It will validate if given feature with resource properties is supported in service. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Feature support request object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 for feature support requests for Azure IaasVm. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureVMResourceFeatureSupportResponseInner validate(String azureRegion, FeatureSupportRequest parameters) { - return validateWithResponse(azureRegion, parameters, Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FeatureSupportsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FeatureSupportsImpl.java deleted file mode 100644 index affc087686b4..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FeatureSupportsImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.FeatureSupportsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AzureVMResourceFeatureSupportResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.AzureVMResourceFeatureSupportResponse; -import com.azure.resourcemanager.recoveryservicesbackup.models.FeatureSupportRequest; -import com.azure.resourcemanager.recoveryservicesbackup.models.FeatureSupports; - -public final class FeatureSupportsImpl implements FeatureSupports { - private static final ClientLogger LOGGER = new ClientLogger(FeatureSupportsImpl.class); - - private final FeatureSupportsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public FeatureSupportsImpl(FeatureSupportsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response validateWithResponse(String azureRegion, - FeatureSupportRequest parameters, Context context) { - Response inner - = this.serviceClient().validateWithResponse(azureRegion, parameters, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AzureVMResourceFeatureSupportResponseImpl(inner.getValue(), this.manager())); - } - - public AzureVMResourceFeatureSupportResponse validate(String azureRegion, FeatureSupportRequest parameters) { - AzureVMResourceFeatureSupportResponseInner inner = this.serviceClient().validate(azureRegion, parameters); - if (inner != null) { - return new AzureVMResourceFeatureSupportResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private FeatureSupportsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FetchTieringCostsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FetchTieringCostsClientImpl.java deleted file mode 100644 index 4a2146134b5c..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FetchTieringCostsClientImpl.java +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.FetchTieringCostsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TieringCostInfoInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.FetchTieringCostInfoRequest; -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 FetchTieringCostsClient. - */ -public final class FetchTieringCostsClientImpl implements FetchTieringCostsClient { - /** - * The proxy service used to perform REST calls. - */ - private final FetchTieringCostsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of FetchTieringCostsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - FetchTieringCostsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service - = RestProxy.create(FetchTieringCostsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientFetchTieringCosts to be used by - * the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientFetchTieringCosts") - public interface FetchTieringCostsService { - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupTieringCost/default/fetchTieringCost") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> post(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") FetchTieringCostInfoRequest parameters, Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupTieringCost/default/fetchTieringCost") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response postSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") FetchTieringCostInfoRequest parameters, Context context); - } - - /** - * Provides the details of the tiering related sizes and cost. - * Status of the operation can be fetched using GetTieringCostOperationStatus API and result using - * GetTieringCostOperationResult API. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param parameters Fetch Tiering Cost Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for tiering cost response along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> postWithResponseAsync(String resourceGroupName, String vaultName, - FetchTieringCostInfoRequest parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.post(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, contentType, accept, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Provides the details of the tiering related sizes and cost. - * Status of the operation can be fetched using GetTieringCostOperationStatus API and result using - * GetTieringCostOperationResult API. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param parameters Fetch Tiering Cost Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for tiering cost response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response postWithResponse(String resourceGroupName, String vaultName, - FetchTieringCostInfoRequest parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.postSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, contentType, accept, parameters, Context.NONE); - } - - /** - * Provides the details of the tiering related sizes and cost. - * Status of the operation can be fetched using GetTieringCostOperationStatus API and result using - * GetTieringCostOperationResult API. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param parameters Fetch Tiering Cost Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for tiering cost response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response postWithResponse(String resourceGroupName, String vaultName, - FetchTieringCostInfoRequest parameters, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.postSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, contentType, accept, parameters, context); - } - - /** - * Provides the details of the tiering related sizes and cost. - * Status of the operation can be fetched using GetTieringCostOperationStatus API and result using - * GetTieringCostOperationResult API. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param parameters Fetch Tiering Cost Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of base class for tiering cost response. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, TieringCostInfoInner> beginPostAsync(String resourceGroupName, - String vaultName, FetchTieringCostInfoRequest parameters) { - Mono>> mono = postWithResponseAsync(resourceGroupName, vaultName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - TieringCostInfoInner.class, TieringCostInfoInner.class, this.client.getContext()); - } - - /** - * Provides the details of the tiering related sizes and cost. - * Status of the operation can be fetched using GetTieringCostOperationStatus API and result using - * GetTieringCostOperationResult API. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param parameters Fetch Tiering Cost Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of base class for tiering cost response. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, TieringCostInfoInner> beginPost(String resourceGroupName, - String vaultName, FetchTieringCostInfoRequest parameters) { - Response response = postWithResponse(resourceGroupName, vaultName, parameters); - return this.client.getLroResult(response, - TieringCostInfoInner.class, TieringCostInfoInner.class, Context.NONE); - } - - /** - * Provides the details of the tiering related sizes and cost. - * Status of the operation can be fetched using GetTieringCostOperationStatus API and result using - * GetTieringCostOperationResult API. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param parameters Fetch Tiering Cost Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of base class for tiering cost response. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, TieringCostInfoInner> beginPost(String resourceGroupName, - String vaultName, FetchTieringCostInfoRequest parameters, Context context) { - Response response = postWithResponse(resourceGroupName, vaultName, parameters, context); - return this.client.getLroResult(response, - TieringCostInfoInner.class, TieringCostInfoInner.class, context); - } - - /** - * Provides the details of the tiering related sizes and cost. - * Status of the operation can be fetched using GetTieringCostOperationStatus API and result using - * GetTieringCostOperationResult API. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param parameters Fetch Tiering Cost Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for tiering cost response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono postAsync(String resourceGroupName, String vaultName, - FetchTieringCostInfoRequest parameters) { - return beginPostAsync(resourceGroupName, vaultName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Provides the details of the tiering related sizes and cost. - * Status of the operation can be fetched using GetTieringCostOperationStatus API and result using - * GetTieringCostOperationResult API. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param parameters Fetch Tiering Cost Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for tiering cost response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TieringCostInfoInner post(String resourceGroupName, String vaultName, - FetchTieringCostInfoRequest parameters) { - return beginPost(resourceGroupName, vaultName, parameters).getFinalResult(); - } - - /** - * Provides the details of the tiering related sizes and cost. - * Status of the operation can be fetched using GetTieringCostOperationStatus API and result using - * GetTieringCostOperationResult API. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param parameters Fetch Tiering Cost Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for tiering cost response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TieringCostInfoInner post(String resourceGroupName, String vaultName, FetchTieringCostInfoRequest parameters, - Context context) { - return beginPost(resourceGroupName, vaultName, parameters, context).getFinalResult(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FetchTieringCostsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FetchTieringCostsImpl.java deleted file mode 100644 index a3fe113eafc6..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/FetchTieringCostsImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.FetchTieringCostsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TieringCostInfoInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.FetchTieringCostInfoRequest; -import com.azure.resourcemanager.recoveryservicesbackup.models.FetchTieringCosts; -import com.azure.resourcemanager.recoveryservicesbackup.models.TieringCostInfo; - -public final class FetchTieringCostsImpl implements FetchTieringCosts { - private static final ClientLogger LOGGER = new ClientLogger(FetchTieringCostsImpl.class); - - private final FetchTieringCostsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public FetchTieringCostsImpl(FetchTieringCostsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public TieringCostInfo post(String resourceGroupName, String vaultName, FetchTieringCostInfoRequest parameters) { - TieringCostInfoInner inner = this.serviceClient().post(resourceGroupName, vaultName, parameters); - if (inner != null) { - return new TieringCostInfoImpl(inner, this.manager()); - } else { - return null; - } - } - - public TieringCostInfo post(String resourceGroupName, String vaultName, FetchTieringCostInfoRequest parameters, - Context context) { - TieringCostInfoInner inner = this.serviceClient().post(resourceGroupName, vaultName, parameters, context); - if (inner != null) { - return new TieringCostInfoImpl(inner, this.manager()); - } else { - return null; - } - } - - private FetchTieringCostsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/GetTieringCostOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/GetTieringCostOperationResultsClientImpl.java deleted file mode 100644 index d6bec29af50a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/GetTieringCostOperationResultsClientImpl.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.GetTieringCostOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TieringCostInfoInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in GetTieringCostOperationResultsClient. - */ -public final class GetTieringCostOperationResultsClientImpl implements GetTieringCostOperationResultsClient { - /** - * The proxy service used to perform REST calls. - */ - private final GetTieringCostOperationResultsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of GetTieringCostOperationResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GetTieringCostOperationResultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(GetTieringCostOperationResultsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientGetTieringCostOperationResults - * to be used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientGetTieringCostOperationResults") - public interface GetTieringCostOperationResultsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupTieringCost/default/operationResults/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupTieringCost/default/operationResults/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the result of async operation for tiering cost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param operationId The operationId 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 result of async operation for tiering cost along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String vaultName, - String operationId) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, operationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the result of async operation for tiering cost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param operationId The operationId 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 result of async operation for tiering cost on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String vaultName, String operationId) { - return getWithResponseAsync(resourceGroupName, vaultName, operationId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the result of async operation for tiering cost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param operationId The operationId 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 result of async operation for tiering cost along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String vaultName, - String operationId, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, operationId, accept, context); - } - - /** - * Gets the result of async operation for tiering cost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param operationId The operationId 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 result of async operation for tiering cost. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TieringCostInfoInner get(String resourceGroupName, String vaultName, String operationId) { - return getWithResponse(resourceGroupName, vaultName, operationId, Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/GetTieringCostOperationResultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/GetTieringCostOperationResultsImpl.java deleted file mode 100644 index 2f0075fef4d0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/GetTieringCostOperationResultsImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.GetTieringCostOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TieringCostInfoInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.GetTieringCostOperationResults; -import com.azure.resourcemanager.recoveryservicesbackup.models.TieringCostInfo; - -public final class GetTieringCostOperationResultsImpl implements GetTieringCostOperationResults { - private static final ClientLogger LOGGER = new ClientLogger(GetTieringCostOperationResultsImpl.class); - - private final GetTieringCostOperationResultsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public GetTieringCostOperationResultsImpl(GetTieringCostOperationResultsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String vaultName, String operationId, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, vaultName, operationId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new TieringCostInfoImpl(inner.getValue(), this.manager())); - } - - public TieringCostInfo get(String resourceGroupName, String vaultName, String operationId) { - TieringCostInfoInner inner = this.serviceClient().get(resourceGroupName, vaultName, operationId); - if (inner != null) { - return new TieringCostInfoImpl(inner, this.manager()); - } else { - return null; - } - } - - private GetTieringCostOperationResultsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ItemLevelRecoveryConnectionsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ItemLevelRecoveryConnectionsClientImpl.java deleted file mode 100644 index 3a0ab72c7a1b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ItemLevelRecoveryConnectionsClientImpl.java +++ /dev/null @@ -1,307 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ItemLevelRecoveryConnectionsClient; -import com.azure.resourcemanager.recoveryservicesbackup.models.IlrRequestResource; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ItemLevelRecoveryConnectionsClient. - */ -public final class ItemLevelRecoveryConnectionsClientImpl implements ItemLevelRecoveryConnectionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ItemLevelRecoveryConnectionsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of ItemLevelRecoveryConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ItemLevelRecoveryConnectionsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(ItemLevelRecoveryConnectionsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientItemLevelRecoveryConnections to - * be used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientItemLevelRecoveryConnections") - public interface ItemLevelRecoveryConnectionsService { - @Headers({ "Accept: application/json;q=0.9" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/provisionInstantItemRecovery") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> provision(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, - @PathParam("recoveryPointId") String recoveryPointId, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") IlrRequestResource parameters, Context context); - - @Headers({ "Accept: application/json;q=0.9" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/provisionInstantItemRecovery") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response provisionSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, - @PathParam("recoveryPointId") String recoveryPointId, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") IlrRequestResource parameters, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/revokeInstantItemRecovery") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> revoke(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, - @PathParam("recoveryPointId") String recoveryPointId, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/revokeInstantItemRecovery") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response revokeSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, - @PathParam("recoveryPointId") String recoveryPointId, Context context); - } - - /** - * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a file - * explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status - * of - * provisioning, call GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource ILR request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> provisionWithResponseAsync(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String recoveryPointId, - IlrRequestResource parameters) { - final String contentType = "application/json"; - return FluxUtil - .withContext(context -> service.provision(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, - protectedItemName, recoveryPointId, contentType, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a file - * explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status - * of - * provisioning, call GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource ILR request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono provisionAsync(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId, IlrRequestResource parameters) { - return provisionWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - recoveryPointId, parameters).flatMap(ignored -> Mono.empty()); - } - - /** - * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a file - * explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status - * of - * provisioning, call GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource ILR request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response provisionWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId, IlrRequestResource parameters, - Context context) { - final String contentType = "application/json"; - return service.provisionSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, protectedItemName, - recoveryPointId, contentType, parameters, context); - } - - /** - * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a file - * explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status - * of - * provisioning, call GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource ILR request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void provision(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, IlrRequestResource parameters) { - provisionWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - recoveryPointId, parameters, Context.NONE); - } - - /** - * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer - * displaying all recoverable files and folders. This is an asynchronous operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> revokeWithResponseAsync(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId) { - return FluxUtil - .withContext(context -> service.revoke(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, - protectedItemName, recoveryPointId, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer - * displaying all recoverable files and folders. This is an asynchronous operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono revokeAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId) { - return revokeWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - recoveryPointId).flatMap(ignored -> Mono.empty()); - } - - /** - * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer - * displaying all recoverable files and folders. This is an asynchronous operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response revokeWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId, Context context) { - return service.revokeSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, protectedItemName, - recoveryPointId, context); - } - - /** - * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer - * displaying all recoverable files and folders. This is an asynchronous operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void revoke(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId) { - revokeWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, - Context.NONE); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ItemLevelRecoveryConnectionsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ItemLevelRecoveryConnectionsImpl.java deleted file mode 100644 index 37d6acbdc74b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ItemLevelRecoveryConnectionsImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ItemLevelRecoveryConnectionsClient; -import com.azure.resourcemanager.recoveryservicesbackup.models.IlrRequestResource; -import com.azure.resourcemanager.recoveryservicesbackup.models.ItemLevelRecoveryConnections; - -public final class ItemLevelRecoveryConnectionsImpl implements ItemLevelRecoveryConnections { - private static final ClientLogger LOGGER = new ClientLogger(ItemLevelRecoveryConnectionsImpl.class); - - private final ItemLevelRecoveryConnectionsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public ItemLevelRecoveryConnectionsImpl(ItemLevelRecoveryConnectionsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response provisionWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId, IlrRequestResource parameters, - Context context) { - return this.serviceClient() - .provisionWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - recoveryPointId, parameters, context); - } - - public void provision(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, IlrRequestResource parameters) { - this.serviceClient() - .provision(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, - parameters); - } - - public Response revokeWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId, Context context) { - return this.serviceClient() - .revokeWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - recoveryPointId, context); - } - - public void revoke(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId) { - this.serviceClient() - .revoke(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId); - } - - private ItemLevelRecoveryConnectionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobCancellationsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobCancellationsClientImpl.java deleted file mode 100644 index 2c8cbade6b81..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobCancellationsClientImpl.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobCancellationsClient; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in JobCancellationsClient. - */ -public final class JobCancellationsClientImpl implements JobCancellationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final JobCancellationsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of JobCancellationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - JobCancellationsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service - = RestProxy.create(JobCancellationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientJobCancellations to be used by - * the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientJobCancellations") - public interface JobCancellationsService { - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/cancel") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> trigger(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("jobName") String jobName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/cancel") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response triggerSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("jobName") String jobName, Context context); - } - - /** - * Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call - * GetCancelOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Name of the job whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> triggerWithResponseAsync(String vaultName, String resourceGroupName, String jobName) { - return FluxUtil - .withContext(context -> service.trigger(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, jobName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call - * GetCancelOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Name of the job whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono triggerAsync(String vaultName, String resourceGroupName, String jobName) { - return triggerWithResponseAsync(vaultName, resourceGroupName, jobName).flatMap(ignored -> Mono.empty()); - } - - /** - * Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call - * GetCancelOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Name of the job whose details are to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response triggerWithResponse(String vaultName, String resourceGroupName, String jobName, - Context context) { - return service.triggerSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, jobName, context); - } - - /** - * Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call - * GetCancelOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Name of the job whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void trigger(String vaultName, String resourceGroupName, String jobName) { - triggerWithResponse(vaultName, resourceGroupName, jobName, Context.NONE); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobCancellationsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobCancellationsImpl.java deleted file mode 100644 index 2164c1bf7d61..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobCancellationsImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobCancellationsClient; -import com.azure.resourcemanager.recoveryservicesbackup.models.JobCancellations; - -public final class JobCancellationsImpl implements JobCancellations { - private static final ClientLogger LOGGER = new ClientLogger(JobCancellationsImpl.class); - - private final JobCancellationsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public JobCancellationsImpl(JobCancellationsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response triggerWithResponse(String vaultName, String resourceGroupName, String jobName, - Context context) { - return this.serviceClient().triggerWithResponse(vaultName, resourceGroupName, jobName, context); - } - - public void trigger(String vaultName, String resourceGroupName, String jobName) { - this.serviceClient().trigger(vaultName, resourceGroupName, jobName); - } - - private JobCancellationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsClientImpl.java deleted file mode 100644 index 2937016c3e9b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsClientImpl.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobDetailsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in JobDetailsClient. - */ -public final class JobDetailsClientImpl implements JobDetailsClient { - /** - * The proxy service used to perform REST calls. - */ - private final JobDetailsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of JobDetailsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - JobDetailsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service - = RestProxy.create(JobDetailsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientJobDetails to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientJobDetails") - public interface JobDetailsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets extended information associated with the job. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Name of the job whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extended information associated with the job along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, String resourceGroupName, - String jobName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, jobName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets extended information associated with the job. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Name of the job whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extended information associated with the job on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName, String jobName) { - return getWithResponseAsync(vaultName, resourceGroupName, jobName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets extended information associated with the job. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Name of the job whose details are to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extended information associated with the job along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, String jobName, - Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, jobName, accept, context); - } - - /** - * Gets extended information associated with the job. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Name of the job whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extended information associated with the job. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public JobResourceInner get(String vaultName, String resourceGroupName, String jobName) { - return getWithResponse(vaultName, resourceGroupName, jobName, Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsImpl.java deleted file mode 100644 index 7d666b455ee2..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobDetailsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.JobDetails; -import com.azure.resourcemanager.recoveryservicesbackup.models.JobResource; - -public final class JobDetailsImpl implements JobDetails { - private static final ClientLogger LOGGER = new ClientLogger(JobDetailsImpl.class); - - private final JobDetailsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public JobDetailsImpl(JobDetailsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, String jobName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(vaultName, resourceGroupName, jobName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new JobResourceImpl(inner.getValue(), this.manager())); - } - - public JobResource get(String vaultName, String resourceGroupName, String jobName) { - JobResourceInner inner = this.serviceClient().get(vaultName, resourceGroupName, jobName); - if (inner != null) { - return new JobResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - private JobDetailsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobOperationResultsClientImpl.java deleted file mode 100644 index b2139380430f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobOperationResultsClientImpl.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobOperationResultsClient; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in JobOperationResultsClient. - */ -public final class JobOperationResultsClientImpl implements JobOperationResultsClient { - /** - * The proxy service used to perform REST calls. - */ - private final JobOperationResultsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of JobOperationResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - JobOperationResultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(JobOperationResultsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientJobOperationResults to be used - * by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientJobOperationResults") - public interface JobOperationResultsService { - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/operationResults/{operationId}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("jobName") String jobName, @PathParam("operationId") String operationId, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/operationResults/{operationId}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("jobName") String jobName, @PathParam("operationId") String operationId, Context context); - } - - /** - * Fetches the result of any operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName The name of the JobResource. - * @param operationId The name of the JobResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> getWithResponseAsync(String vaultName, String resourceGroupName, String jobName, - String operationId) { - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, jobName, operationId, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Fetches the result of any operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName The name of the JobResource. - * @param operationId The name of the JobResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 getAsync(String vaultName, String resourceGroupName, String jobName, String operationId) { - return getWithResponseAsync(vaultName, resourceGroupName, jobName, operationId) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Fetches the result of any operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName The name of the JobResource. - * @param operationId The name of the JobResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 getWithResponse(String vaultName, String resourceGroupName, String jobName, - String operationId, Context context) { - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, jobName, operationId, context); - } - - /** - * Fetches the result of any operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName The name of the JobResource. - * @param operationId The name of the JobResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void get(String vaultName, String resourceGroupName, String jobName, String operationId) { - getWithResponse(vaultName, resourceGroupName, jobName, operationId, Context.NONE); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobOperationResultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobOperationResultsImpl.java deleted file mode 100644 index 7613e4c6fc5f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobOperationResultsImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.models.JobOperationResults; - -public final class JobOperationResultsImpl implements JobOperationResults { - private static final ClientLogger LOGGER = new ClientLogger(JobOperationResultsImpl.class); - - private final JobOperationResultsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public JobOperationResultsImpl(JobOperationResultsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, String jobName, - String operationId, Context context) { - return this.serviceClient().getWithResponse(vaultName, resourceGroupName, jobName, operationId, context); - } - - public void get(String vaultName, String resourceGroupName, String jobName, String operationId) { - this.serviceClient().get(vaultName, resourceGroupName, jobName, operationId); - } - - private JobOperationResultsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobResourceImpl.java deleted file mode 100644 index 8ea5de90d3ba..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobResourceImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.Job; -import com.azure.resourcemanager.recoveryservicesbackup.models.JobResource; -import java.util.Collections; -import java.util.Map; - -public final class JobResourceImpl implements JobResource { - private JobResourceInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - JobResourceImpl(JobResourceInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager 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 Job properties() { - return this.innerModel().properties(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String location() { - return this.innerModel().location(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public JobResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobsClientImpl.java deleted file mode 100644 index 9994f8aea9b7..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobsClientImpl.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobsClient; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in JobsClient. - */ -public final class JobsClientImpl implements JobsClient { - /** - * The proxy service used to perform REST calls. - */ - private final JobsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of JobsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - JobsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(JobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientJobs to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientJobs") - public interface JobsService { - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobsExport") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> export(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("$filter") String filter, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobsExport") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response exportSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("$filter") String filter, Context context); - } - - /** - * Triggers export of jobs specified by filters and returns an OperationID to track. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> exportWithResponseAsync(String vaultName, String resourceGroupName, String filter) { - return FluxUtil - .withContext(context -> service.export(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, - resourceGroupName, this.client.getSubscriptionId(), filter, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Triggers export of jobs specified by filters and returns an OperationID to track. - * - * @param vaultName The name of the recovery services vault. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono exportAsync(String vaultName, String resourceGroupName) { - final String filter = null; - return exportWithResponseAsync(vaultName, resourceGroupName, filter).flatMap(ignored -> Mono.empty()); - } - - /** - * Triggers export of jobs specified by filters and returns an OperationID to track. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response exportWithResponse(String vaultName, String resourceGroupName, String filter, - Context context) { - return service.exportSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), filter, context); - } - - /** - * Triggers export of jobs specified by filters and returns an OperationID to track. - * - * @param vaultName The name of the recovery services vault. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void export(String vaultName, String resourceGroupName) { - final String filter = null; - exportWithResponse(vaultName, resourceGroupName, filter, Context.NONE); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobsImpl.java deleted file mode 100644 index e9009446172b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobsImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobsClient; -import com.azure.resourcemanager.recoveryservicesbackup.models.Jobs; - -public final class JobsImpl implements Jobs { - private static final ClientLogger LOGGER = new ClientLogger(JobsImpl.class); - - private final JobsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public JobsImpl(JobsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response exportWithResponse(String vaultName, String resourceGroupName, String filter, - Context context) { - return this.serviceClient().exportWithResponse(vaultName, resourceGroupName, filter, context); - } - - public void export(String vaultName, String resourceGroupName) { - this.serviceClient().export(vaultName, resourceGroupName); - } - - private JobsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationOperationsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationOperationsClientImpl.java deleted file mode 100644 index 2c378ae85e5e..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationOperationsClientImpl.java +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationOperationsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequestResource; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in OperationOperationsClient. - */ -public final class OperationOperationsClientImpl implements OperationOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final OperationOperationsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of OperationOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationOperationsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(OperationOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientOperationOperations to be used - * by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientOperationOperations") - public interface OperationOperationsService { - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupValidateOperation") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> validate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") ValidateOperationRequestResource parameters, Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupValidateOperation") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response validateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") ValidateOperationRequestResource parameters, Context context); - } - - /** - * Validate operation for specified backed up item. This is a synchronous operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateWithResponseAsync(String vaultName, - String resourceGroupName, ValidateOperationRequestResource parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.validate(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, - resourceGroupName, this.client.getSubscriptionId(), contentType, accept, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Validate operation for specified backed up item. This is a synchronous operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateAsync(String vaultName, String resourceGroupName, - ValidateOperationRequestResource parameters) { - return validateWithResponseAsync(vaultName, resourceGroupName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Validate operation for specified backed up item. This is a synchronous operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateWithResponse(String vaultName, String resourceGroupName, - ValidateOperationRequestResource parameters, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.validateSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, - resourceGroupName, this.client.getSubscriptionId(), contentType, accept, parameters, context); - } - - /** - * Validate operation for specified backed up item. This is a synchronous operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ValidateOperationsResponseInner validate(String vaultName, String resourceGroupName, - ValidateOperationRequestResource parameters) { - return validateWithResponse(vaultName, resourceGroupName, parameters, Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationOperationsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationOperationsImpl.java deleted file mode 100644 index 2bbcce2494bf..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationOperationsImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationOperationsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationOperations; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequestResource; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationsResponse; - -public final class OperationOperationsImpl implements OperationOperations { - private static final ClientLogger LOGGER = new ClientLogger(OperationOperationsImpl.class); - - private final OperationOperationsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public OperationOperationsImpl(OperationOperationsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response validateWithResponse(String vaultName, String resourceGroupName, - ValidateOperationRequestResource parameters, Context context) { - Response inner - = this.serviceClient().validateWithResponse(vaultName, resourceGroupName, parameters, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ValidateOperationsResponseImpl(inner.getValue(), this.manager())); - } - - public ValidateOperationsResponse validate(String vaultName, String resourceGroupName, - ValidateOperationRequestResource parameters) { - ValidateOperationsResponseInner inner = this.serviceClient().validate(vaultName, resourceGroupName, parameters); - if (inner != null) { - return new ValidateOperationsResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private OperationOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationResultInfoBaseResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationResultInfoBaseResourceImpl.java deleted file mode 100644 index 753a1a300f7d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationResultInfoBaseResourceImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationResultInfoBaseResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.HttpStatusCode; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationResultInfoBase; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationResultInfoBaseResource; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class OperationResultInfoBaseResourceImpl implements OperationResultInfoBaseResource { - private OperationResultInfoBaseResourceInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - OperationResultInfoBaseResourceImpl(OperationResultInfoBaseResourceInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public HttpStatusCode statusCode() { - return this.innerModel().statusCode(); - } - - public Map> headers() { - Map> inner = this.innerModel().headers(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public OperationResultInfoBase operation() { - return this.innerModel().operation(); - } - - public OperationResultInfoBaseResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationStatusImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationStatusImpl.java deleted file mode 100644 index 80c5bab18d55..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationStatusImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatus; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatusError; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatusExtendedInfo; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatusValues; -import java.time.OffsetDateTime; - -public final class OperationStatusImpl implements OperationStatus { - private OperationStatusInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - OperationStatusImpl(OperationStatusInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public OperationStatusValues status() { - return this.innerModel().status(); - } - - public OffsetDateTime startTime() { - return this.innerModel().startTime(); - } - - public OffsetDateTime endTime() { - return this.innerModel().endTime(); - } - - public OperationStatusError error() { - return this.innerModel().error(); - } - - public OperationStatusExtendedInfo properties() { - return this.innerModel().properties(); - } - - public OperationStatusInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsClientImpl.java deleted file mode 100644 index dffa53aae052..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ClientDiscoveryValueForSingleApiInner; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.ClientDiscoveryResponse; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in OperationsClient. - */ -public final class OperationsClientImpl implements OperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final OperationsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service - = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientOperations to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientOperations") - public interface OperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.RecoveryServices/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - 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.RecoveryServices/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List the operations for the provider. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - final String accept = "application/json"; - 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())); - } - - /** - * List the operations for the provider. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List the operations for the provider. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage() { - 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); - } - - /** - * List the operations for the provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(Context context) { - 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); - } - - /** - * List the operations for the provider. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); - } - - /** - * List the operations for the provider. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs 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 operations List response which contains list of available APIs along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsImpl.java deleted file mode 100644 index dfb4b0a9ea26..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationsImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ClientDiscoveryValueForSingleApiInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ClientDiscoveryValueForSingleApi; -import com.azure.resourcemanager.recoveryservicesbackup.models.Operations; - -public final class OperationsImpl implements Operations { - private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); - - private final OperationsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public OperationsImpl(OperationsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ClientDiscoveryValueForSingleApiImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ClientDiscoveryValueForSingleApiImpl(inner1, this.manager())); - } - - private OperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PreValidateEnableBackupResponseImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PreValidateEnableBackupResponseImpl.java deleted file mode 100644 index 0c6a85d1d196..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PreValidateEnableBackupResponseImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.PreValidateEnableBackupResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.PreValidateEnableBackupResponse; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidationStatus; - -public final class PreValidateEnableBackupResponseImpl implements PreValidateEnableBackupResponse { - private PreValidateEnableBackupResponseInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - PreValidateEnableBackupResponseImpl(PreValidateEnableBackupResponseInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public ValidationStatus status() { - return this.innerModel().status(); - } - - public String errorCode() { - return this.innerModel().errorCode(); - } - - public String errorMessage() { - return this.innerModel().errorMessage(); - } - - public String recommendation() { - return this.innerModel().recommendation(); - } - - public String containerName() { - return this.innerModel().containerName(); - } - - public String protectedItemName() { - return this.innerModel().protectedItemName(); - } - - public PreValidateEnableBackupResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionResourceImpl.java deleted file mode 100644 index 93c993da34a9..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionResourceImpl.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.PrivateEndpointConnectionResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpointConnection; -import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpointConnectionResource; -import java.util.Collections; -import java.util.Map; - -public final class PrivateEndpointConnectionResourceImpl implements PrivateEndpointConnectionResource, - PrivateEndpointConnectionResource.Definition, PrivateEndpointConnectionResource.Update { - private PrivateEndpointConnectionResourceInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public PrivateEndpointConnection properties() { - return this.innerModel().properties(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String location() { - return this.innerModel().location(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public PrivateEndpointConnectionResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } - - private String vaultName; - - private String resourceGroupName; - - private String privateEndpointConnectionName; - - public PrivateEndpointConnectionResourceImpl withExistingVault(String vaultName, String resourceGroupName) { - this.vaultName = vaultName; - this.resourceGroupName = resourceGroupName; - return this; - } - - public PrivateEndpointConnectionResource create() { - this.innerObject = serviceManager.serviceClient() - .getPrivateEndpointConnections() - .put(vaultName, resourceGroupName, privateEndpointConnectionName, this.innerModel(), Context.NONE); - return this; - } - - public PrivateEndpointConnectionResource create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getPrivateEndpointConnections() - .put(vaultName, resourceGroupName, privateEndpointConnectionName, this.innerModel(), context); - return this; - } - - PrivateEndpointConnectionResourceImpl(String name, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = new PrivateEndpointConnectionResourceInner(); - this.serviceManager = serviceManager; - this.privateEndpointConnectionName = name; - } - - public PrivateEndpointConnectionResourceImpl update() { - return this; - } - - public PrivateEndpointConnectionResource apply() { - this.innerObject = serviceManager.serviceClient() - .getPrivateEndpointConnections() - .put(vaultName, resourceGroupName, privateEndpointConnectionName, this.innerModel(), Context.NONE); - return this; - } - - public PrivateEndpointConnectionResource apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getPrivateEndpointConnections() - .put(vaultName, resourceGroupName, privateEndpointConnectionName, this.innerModel(), context); - return this; - } - - PrivateEndpointConnectionResourceImpl(PrivateEndpointConnectionResourceInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.vaultName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "vaults"); - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.privateEndpointConnectionName - = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); - } - - public PrivateEndpointConnectionResource refresh() { - this.innerObject = serviceManager.serviceClient() - .getPrivateEndpointConnections() - .getWithResponse(vaultName, resourceGroupName, privateEndpointConnectionName, Context.NONE) - .getValue(); - return this; - } - - public PrivateEndpointConnectionResource refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getPrivateEndpointConnections() - .getWithResponse(vaultName, resourceGroupName, privateEndpointConnectionName, context) - .getValue(); - return this; - } - - public PrivateEndpointConnectionResourceImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public PrivateEndpointConnectionResourceImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public PrivateEndpointConnectionResourceImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public PrivateEndpointConnectionResourceImpl withProperties(PrivateEndpointConnection properties) { - this.innerModel().withProperties(properties); - return this; - } - - public PrivateEndpointConnectionResourceImpl withEtag(String etag) { - this.innerModel().withEtag(etag); - return this; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionsClientImpl.java deleted file mode 100644 index 7d7fef74fc6a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionsClientImpl.java +++ /dev/null @@ -1,563 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.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.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.PrivateEndpointConnectionResourceInner; -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 PrivateEndpointConnectionsClient. - */ -public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final PrivateEndpointConnectionsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of PrivateEndpointConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateEndpointConnectionsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientPrivateEndpointConnections to - * be used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientPrivateEndpointConnections") - public interface PrivateEndpointConnectionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> put(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") PrivateEndpointConnectionResourceInner parameters, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response putSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") PrivateEndpointConnectionResourceInner parameters, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); - } - - /** - * Get Private Endpoint Connection. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, - String resourceGroupName, String privateEndpointConnectionName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, privateEndpointConnectionName, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Private Endpoint Connection. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName, - String privateEndpointConnectionName) { - return getWithResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get Private Endpoint Connection. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, - String privateEndpointConnectionName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, privateEndpointConnectionName, accept, context); - } - - /** - * Get Private Endpoint Connection. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionResourceInner get(String vaultName, String resourceGroupName, - String privateEndpointConnectionName) { - return getWithResponse(vaultName, resourceGroupName, privateEndpointConnectionName, Context.NONE).getValue(); - } - - /** - * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection Response Properties along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> putWithResponseAsync(String vaultName, String resourceGroupName, - String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.put(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, privateEndpointConnectionName, - contentType, accept, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection Response Properties along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response putWithResponse(String vaultName, String resourceGroupName, - String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.putSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, privateEndpointConnectionName, contentType, accept, parameters, Context.NONE); - } - - /** - * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Request body for operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection Response Properties along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response putWithResponse(String vaultName, String resourceGroupName, - String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.putSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, privateEndpointConnectionName, contentType, accept, parameters, context); - } - - /** - * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of private Endpoint Connection Response Properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, PrivateEndpointConnectionResourceInner> - beginPutAsync(String vaultName, String resourceGroupName, String privateEndpointConnectionName, - PrivateEndpointConnectionResourceInner parameters) { - Mono>> mono - = putWithResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters); - return this.client.getLroResult( - mono, this.client.getHttpPipeline(), PrivateEndpointConnectionResourceInner.class, - PrivateEndpointConnectionResourceInner.class, this.client.getContext()); - } - - /** - * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of private Endpoint Connection Response Properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, PrivateEndpointConnectionResourceInner> - beginPut(String vaultName, String resourceGroupName, String privateEndpointConnectionName, - PrivateEndpointConnectionResourceInner parameters) { - Response response - = putWithResponse(vaultName, resourceGroupName, privateEndpointConnectionName, parameters); - return this.client.getLroResult( - response, PrivateEndpointConnectionResourceInner.class, PrivateEndpointConnectionResourceInner.class, - Context.NONE); - } - - /** - * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Request body for operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of private Endpoint Connection Response Properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, PrivateEndpointConnectionResourceInner> - beginPut(String vaultName, String resourceGroupName, String privateEndpointConnectionName, - PrivateEndpointConnectionResourceInner parameters, Context context) { - Response response - = putWithResponse(vaultName, resourceGroupName, privateEndpointConnectionName, parameters, context); - return this.client.getLroResult( - response, PrivateEndpointConnectionResourceInner.class, PrivateEndpointConnectionResourceInner.class, - context); - } - - /** - * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection Response Properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono putAsync(String vaultName, String resourceGroupName, - String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters) { - return beginPutAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection Response Properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionResourceInner put(String vaultName, String resourceGroupName, - String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters) { - return beginPut(vaultName, resourceGroupName, privateEndpointConnectionName, parameters).getFinalResult(); - } - - /** - * Approve or Reject Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param parameters Request body for operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection Response Properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionResourceInner put(String vaultName, String resourceGroupName, - String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters, Context context) { - return beginPut(vaultName, resourceGroupName, privateEndpointConnectionName, parameters, context) - .getFinalResult(); - } - - /** - * Delete Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 vaultName, String resourceGroupName, - String privateEndpointConnectionName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, privateEndpointConnectionName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 vaultName, String resourceGroupName, - String privateEndpointConnectionName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, privateEndpointConnectionName, Context.NONE); - } - - /** - * Delete Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 vaultName, String resourceGroupName, - String privateEndpointConnectionName, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, privateEndpointConnectionName, context); - } - - /** - * Delete Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 vaultName, String resourceGroupName, - String privateEndpointConnectionName) { - Mono>> mono - = deleteWithResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Delete Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 vaultName, String resourceGroupName, - String privateEndpointConnectionName) { - Response response = deleteWithResponse(vaultName, resourceGroupName, privateEndpointConnectionName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Delete Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 vaultName, String resourceGroupName, - String privateEndpointConnectionName, Context context) { - Response response - = deleteWithResponse(vaultName, resourceGroupName, privateEndpointConnectionName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Delete Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 vaultName, String resourceGroupName, String privateEndpointConnectionName) { - return beginDeleteAsync(vaultName, resourceGroupName, privateEndpointConnectionName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 vaultName, String resourceGroupName, String privateEndpointConnectionName) { - beginDelete(vaultName, resourceGroupName, privateEndpointConnectionName).getFinalResult(); - } - - /** - * Delete Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 vaultName, String resourceGroupName, String privateEndpointConnectionName, - Context context) { - beginDelete(vaultName, resourceGroupName, privateEndpointConnectionName, context).getFinalResult(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionsImpl.java deleted file mode 100644 index 26642d30e2a9..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointConnectionsImpl.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.PrivateEndpointConnectionResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpointConnectionResource; -import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpointConnections; - -public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { - private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); - - private final PrivateEndpointConnectionsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, - String privateEndpointConnectionName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(vaultName, resourceGroupName, privateEndpointConnectionName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PrivateEndpointConnectionResourceImpl(inner.getValue(), this.manager())); - } - - public PrivateEndpointConnectionResource get(String vaultName, String resourceGroupName, - String privateEndpointConnectionName) { - PrivateEndpointConnectionResourceInner inner - = this.serviceClient().get(vaultName, resourceGroupName, privateEndpointConnectionName); - if (inner != null) { - return new PrivateEndpointConnectionResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String vaultName, String resourceGroupName, String privateEndpointConnectionName) { - this.serviceClient().delete(vaultName, resourceGroupName, privateEndpointConnectionName); - } - - public void delete(String vaultName, String resourceGroupName, String privateEndpointConnectionName, - Context context) { - this.serviceClient().delete(vaultName, resourceGroupName, privateEndpointConnectionName, context); - } - - public PrivateEndpointConnectionResource getById(String id) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 privateEndpointConnectionName - = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); - if (privateEndpointConnectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); - } - return this.getWithResponse(vaultName, resourceGroupName, privateEndpointConnectionName, Context.NONE) - .getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 privateEndpointConnectionName - = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); - if (privateEndpointConnectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); - } - return this.getWithResponse(vaultName, resourceGroupName, privateEndpointConnectionName, context); - } - - public void deleteById(String id) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 privateEndpointConnectionName - = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); - if (privateEndpointConnectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); - } - this.delete(vaultName, resourceGroupName, privateEndpointConnectionName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 privateEndpointConnectionName - = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); - if (privateEndpointConnectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); - } - this.delete(vaultName, resourceGroupName, privateEndpointConnectionName, context); - } - - private PrivateEndpointConnectionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } - - public PrivateEndpointConnectionResourceImpl define(String name) { - return new PrivateEndpointConnectionResourceImpl(name, this.manager()); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointsClientImpl.java deleted file mode 100644 index 30182e91f5b3..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointsClientImpl.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.PrivateEndpointsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in PrivateEndpointsClient. - */ -public final class PrivateEndpointsClientImpl implements PrivateEndpointsClient { - /** - * The proxy service used to perform REST calls. - */ - private final PrivateEndpointsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of PrivateEndpointsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateEndpointsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service - = RestProxy.create(PrivateEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientPrivateEndpoints to be used by - * the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientPrivateEndpoints") - public interface PrivateEndpointsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}/operationsStatus/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getOperationStatus(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}/operationsStatus/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getOperationStatusSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the operation status for a private endpoint connection. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the PrivateEndpointConnectionResource. - * @param operationId The name of the PrivateEndpointConnectionResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation status for a private endpoint connection along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getOperationStatusWithResponseAsync(String vaultName, - String resourceGroupName, String privateEndpointConnectionName, String operationId) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getOperationStatus(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, privateEndpointConnectionName, - operationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the operation status for a private endpoint connection. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the PrivateEndpointConnectionResource. - * @param operationId The name of the PrivateEndpointConnectionResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation status for a private endpoint connection on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getOperationStatusAsync(String vaultName, String resourceGroupName, - String privateEndpointConnectionName, String operationId) { - return getOperationStatusWithResponseAsync(vaultName, resourceGroupName, privateEndpointConnectionName, - operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the operation status for a private endpoint connection. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the PrivateEndpointConnectionResource. - * @param operationId The name of the PrivateEndpointConnectionResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation status for a private endpoint connection along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getOperationStatusWithResponse(String vaultName, String resourceGroupName, - String privateEndpointConnectionName, String operationId, Context context) { - final String accept = "application/json"; - return service.getOperationStatusSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, privateEndpointConnectionName, operationId, - accept, context); - } - - /** - * Gets the operation status for a private endpoint connection. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the PrivateEndpointConnectionResource. - * @param operationId The name of the PrivateEndpointConnectionResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation status for a private endpoint connection. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusInner getOperationStatus(String vaultName, String resourceGroupName, - String privateEndpointConnectionName, String operationId) { - return getOperationStatusWithResponse(vaultName, resourceGroupName, privateEndpointConnectionName, operationId, - Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointsImpl.java deleted file mode 100644 index c2d966c292f7..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/PrivateEndpointsImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.PrivateEndpointsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatus; -import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpoints; - -public final class PrivateEndpointsImpl implements PrivateEndpoints { - private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointsImpl.class); - - private final PrivateEndpointsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public PrivateEndpointsImpl(PrivateEndpointsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getOperationStatusWithResponse(String vaultName, String resourceGroupName, - String privateEndpointConnectionName, String operationId, Context context) { - Response inner = this.serviceClient() - .getOperationStatusWithResponse(vaultName, resourceGroupName, privateEndpointConnectionName, operationId, - context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationStatusImpl(inner.getValue(), this.manager())); - } - - public OperationStatus getOperationStatus(String vaultName, String resourceGroupName, - String privateEndpointConnectionName, String operationId) { - OperationStatusInner inner = this.serviceClient() - .getOperationStatus(vaultName, resourceGroupName, privateEndpointConnectionName, operationId); - if (inner != null) { - return new OperationStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - private PrivateEndpointsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainerResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainerResourceImpl.java deleted file mode 100644 index 21e0fa3df3e3..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainerResourceImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectableContainerResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectableContainer; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectableContainerResource; -import java.util.Collections; -import java.util.Map; - -public final class ProtectableContainerResourceImpl implements ProtectableContainerResource { - private ProtectableContainerResourceInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - ProtectableContainerResourceImpl(ProtectableContainerResourceInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager 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 String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String eTag() { - return this.innerModel().eTag(); - } - - public ProtectableContainer properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ProtectableContainerResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersClientImpl.java deleted file mode 100644 index 8d8914607802..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersClientImpl.java +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectableContainersClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectableContainerResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.ProtectableContainerResourceList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ProtectableContainersClient. - */ -public final class ProtectableContainersClientImpl implements ProtectableContainersClient { - /** - * The proxy service used to perform REST calls. - */ - private final ProtectableContainersService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of ProtectableContainersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ProtectableContainersClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(ProtectableContainersService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientProtectableContainers to be - * used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientProtectableContainers") - public interface ProtectableContainersService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectableContainers") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectableContainers") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists the containers that can be registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The fabricName parameter. - * @param filter OData filter options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectableContainer resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String vaultName, - String resourceGroupName, String fabricName, String filter) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, - resourceGroupName, this.client.getSubscriptionId(), fabricName, filter, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the containers that can be registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The fabricName parameter. - * @param filter OData filter options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectableContainer resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName, - String fabricName, String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, fabricName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the containers that can be registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The fabricName 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 list of ProtectableContainer resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName, - String fabricName) { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, fabricName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the containers that can be registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The fabricName parameter. - * @param filter OData filter options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectableContainer resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, - String fabricName, String filter) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), fabricName, filter, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists the containers that can be registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The fabricName parameter. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectableContainer resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, - String fabricName, String filter, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), fabricName, filter, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists the containers that can be registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The fabricName 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 list of ProtectableContainer resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName, - String fabricName) { - final String filter = null; - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, fabricName, filter), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Lists the containers that can be registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The fabricName parameter. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectableContainer resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName, - String fabricName, String filter, Context context) { - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, fabricName, filter, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectableContainer resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectableContainer resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectableContainer resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersImpl.java deleted file mode 100644 index ca38ac659f39..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectableContainersImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectableContainersClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectableContainerResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectableContainerResource; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectableContainers; - -public final class ProtectableContainersImpl implements ProtectableContainers { - private static final ClientLogger LOGGER = new ClientLogger(ProtectableContainersImpl.class); - - private final ProtectableContainersClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public ProtectableContainersImpl(ProtectableContainersClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String vaultName, String resourceGroupName, - String fabricName) { - PagedIterable inner - = this.serviceClient().list(vaultName, resourceGroupName, fabricName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ProtectableContainerResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String vaultName, String resourceGroupName, - String fabricName, String filter, Context context) { - PagedIterable inner - = this.serviceClient().list(vaultName, resourceGroupName, fabricName, filter, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ProtectableContainerResourceImpl(inner1, this.manager())); - } - - private ProtectableContainersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsClientImpl.java deleted file mode 100644 index 5d208843b503..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsClientImpl.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ProtectedItemOperationResultsClient. - */ -public final class ProtectedItemOperationResultsClientImpl implements ProtectedItemOperationResultsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ProtectedItemOperationResultsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of ProtectedItemOperationResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ProtectedItemOperationResultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(ProtectedItemOperationResultsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientProtectedItemOperationResults - * to be used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientProtectedItemOperationResults") - public interface ProtectedItemOperationResultsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationResults/{operationId}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationResults/{operationId}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Fetches the result of any operation on the backup item. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param protectedItemName The name of the ProtectedItemResource. - * @param operationId The name of the ProtectedItemResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String operationId) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, - protectedItemName, operationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Fetches the result of any operation on the backup item. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param protectedItemName The name of the ProtectedItemResource. - * @param operationId The name of the ProtectedItemResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String operationId) { - return getWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Fetches the result of any operation on the backup item. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param protectedItemName The name of the ProtectedItemResource. - * @param operationId The name of the ProtectedItemResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String operationId, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, fabricName, containerName, protectedItemName, operationId, accept, context); - } - - /** - * Fetches the result of any operation on the backup item. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param protectedItemName The name of the ProtectedItemResource. - * @param operationId The name of the ProtectedItemResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProtectedItemResourceInner get(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String operationId) { - return getWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId, - Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsImpl.java deleted file mode 100644 index d282fbb87061..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemOperationResults; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemResource; - -public final class ProtectedItemOperationResultsImpl implements ProtectedItemOperationResults { - private static final ClientLogger LOGGER = new ClientLogger(ProtectedItemOperationResultsImpl.class); - - private final ProtectedItemOperationResultsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public ProtectedItemOperationResultsImpl(ProtectedItemOperationResultsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String operationId, Context context) { - Response inner = this.serviceClient() - .getWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId, - context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ProtectedItemResourceImpl(inner.getValue(), this.manager())); - } - - public ProtectedItemResource get(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String operationId) { - ProtectedItemResourceInner inner = this.serviceClient() - .get(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId); - if (inner != null) { - return new ProtectedItemResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - private ProtectedItemOperationResultsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesClientImpl.java deleted file mode 100644 index aa740772da98..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesClientImpl.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemOperationStatusesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ProtectedItemOperationStatusesClient. - */ -public final class ProtectedItemOperationStatusesClientImpl implements ProtectedItemOperationStatusesClient { - /** - * The proxy service used to perform REST calls. - */ - private final ProtectedItemOperationStatusesService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of ProtectedItemOperationStatusesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ProtectedItemOperationStatusesClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(ProtectedItemOperationStatusesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientProtectedItemOperationStatuses - * to be used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientProtectedItemOperationStatuses") - public interface ProtectedItemOperationStatusesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationsStatus/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationsStatus/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some - * operations - * create jobs. This method returns the list of jobs associated with the operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param protectedItemName The name of the ProtectedItemResource. - * @param operationId The name of the ProtectedItemResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String operationId) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, - protectedItemName, operationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some - * operations - * create jobs. This method returns the list of jobs associated with the operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param protectedItemName The name of the ProtectedItemResource. - * @param operationId The name of the ProtectedItemResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String operationId) { - return getWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some - * operations - * create jobs. This method returns the list of jobs associated with the operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param protectedItemName The name of the ProtectedItemResource. - * @param operationId The name of the ProtectedItemResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String operationId, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, fabricName, containerName, protectedItemName, operationId, accept, context); - } - - /** - * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some - * operations - * create jobs. This method returns the list of jobs associated with the operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param protectedItemName The name of the ProtectedItemResource. - * @param operationId The name of the ProtectedItemResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusInner get(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String operationId) { - return getWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId, - Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesImpl.java deleted file mode 100644 index 753df15c690d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemOperationStatusesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatus; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemOperationStatuses; - -public final class ProtectedItemOperationStatusesImpl implements ProtectedItemOperationStatuses { - private static final ClientLogger LOGGER = new ClientLogger(ProtectedItemOperationStatusesImpl.class); - - private final ProtectedItemOperationStatusesClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public ProtectedItemOperationStatusesImpl(ProtectedItemOperationStatusesClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String operationId, Context context) { - Response inner = this.serviceClient() - .getWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId, - context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationStatusImpl(inner.getValue(), this.manager())); - } - - public OperationStatus get(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String operationId) { - OperationStatusInner inner = this.serviceClient() - .get(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId); - if (inner != null) { - return new OperationStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - private ProtectedItemOperationStatusesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemResourceImpl.java deleted file mode 100644 index 6aa3808b5ba3..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemResourceImpl.java +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItem; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemResource; -import java.util.Collections; -import java.util.Map; - -public final class ProtectedItemResourceImpl - implements ProtectedItemResource, ProtectedItemResource.Definition, ProtectedItemResource.Update { - private ProtectedItemResourceInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public ProtectedItem properties() { - return this.innerModel().properties(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String location() { - return this.innerModel().location(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public ProtectedItemResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } - - private String vaultName; - - private String resourceGroupName; - - private String fabricName; - - private String containerName; - - private String protectedItemName; - - public ProtectedItemResourceImpl withExistingProtectionContainer(String vaultName, String resourceGroupName, - String fabricName, String containerName) { - this.vaultName = vaultName; - this.resourceGroupName = resourceGroupName; - this.fabricName = fabricName; - this.containerName = containerName; - return this; - } - - public ProtectedItemResource create() { - this.innerObject = serviceManager.serviceClient() - .getProtectedItems() - .createOrUpdate(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - this.innerModel(), Context.NONE); - return this; - } - - public ProtectedItemResource create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getProtectedItems() - .createOrUpdate(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - this.innerModel(), context); - return this; - } - - ProtectedItemResourceImpl(String name, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = new ProtectedItemResourceInner(); - this.serviceManager = serviceManager; - this.protectedItemName = name; - } - - public ProtectedItemResourceImpl update() { - return this; - } - - public ProtectedItemResource apply() { - this.innerObject = serviceManager.serviceClient() - .getProtectedItems() - .createOrUpdate(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - this.innerModel(), Context.NONE); - return this; - } - - public ProtectedItemResource apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getProtectedItems() - .createOrUpdate(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - this.innerModel(), context); - return this; - } - - ProtectedItemResourceImpl(ProtectedItemResourceInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.vaultName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "vaults"); - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.fabricName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "backupFabrics"); - this.containerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "protectionContainers"); - this.protectedItemName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "protectedItems"); - } - - public ProtectedItemResource refresh() { - String localFilter = null; - this.innerObject = serviceManager.serviceClient() - .getProtectedItems() - .getWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, localFilter, - Context.NONE) - .getValue(); - return this; - } - - public ProtectedItemResource refresh(Context context) { - String localFilter = null; - this.innerObject = serviceManager.serviceClient() - .getProtectedItems() - .getWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, localFilter, - context) - .getValue(); - return this; - } - - public ProtectedItemResourceImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public ProtectedItemResourceImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public ProtectedItemResourceImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public ProtectedItemResourceImpl withProperties(ProtectedItem properties) { - this.innerModel().withProperties(properties); - return this; - } - - public ProtectedItemResourceImpl withEtag(String etag) { - this.innerModel().withEtag(etag); - return this; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsClientImpl.java deleted file mode 100644 index 9fa29cdd5078..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsClientImpl.java +++ /dev/null @@ -1,545 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.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.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; -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 ProtectedItemsClient. - */ -public final class ProtectedItemsClientImpl implements ProtectedItemsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ProtectedItemsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of ProtectedItemsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ProtectedItemsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service - = RestProxy.create(ProtectedItemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientProtectedItems to be used by - * the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientProtectedItems") - public interface ProtectedItemsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") ProtectedItemResourceInner parameters, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") ProtectedItemResourceInner parameters, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, Context context); - } - - /** - * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the - * operation, - * call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param filter OData filter options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String filter) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, - protectedItemName, filter, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the - * operation, - * call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName) { - final String filter = null; - return getWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the - * operation, - * call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String filter, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, fabricName, containerName, protectedItemName, filter, accept, context); - } - - /** - * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the - * operation, - * call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProtectedItemResourceInner get(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName) { - final String filter = null; - return getWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter, - Context.NONE).getValue(); - } - - /** - * Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an - * asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters resource backed up item. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, ProtectedItemResourceInner parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, - protectedItemName, contentType, accept, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an - * asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters resource backed up item. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, ProtectedItemResourceInner parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, protectedItemName, - contentType, accept, parameters, Context.NONE); - } - - /** - * Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an - * asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters resource backed up item. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, ProtectedItemResourceInner parameters, - Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, protectedItemName, - contentType, accept, parameters, context); - } - - /** - * Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an - * asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters resource backed up item. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of base class for backup items. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProtectedItemResourceInner> beginCreateOrUpdateAsync( - String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, - ProtectedItemResourceInner parameters) { - Mono>> mono = createOrUpdateWithResponseAsync(vaultName, resourceGroupName, - fabricName, containerName, protectedItemName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ProtectedItemResourceInner.class, ProtectedItemResourceInner.class, - this.client.getContext()); - } - - /** - * Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an - * asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters resource backed up item. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of base class for backup items. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProtectedItemResourceInner> beginCreateOrUpdate( - String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, - ProtectedItemResourceInner parameters) { - Response response = createOrUpdateWithResponse(vaultName, resourceGroupName, fabricName, - containerName, protectedItemName, parameters); - return this.client.getLroResult(response, - ProtectedItemResourceInner.class, ProtectedItemResourceInner.class, Context.NONE); - } - - /** - * Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an - * asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters resource backed up item. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of base class for backup items. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProtectedItemResourceInner> beginCreateOrUpdate( - String vaultName, String resourceGroupName, String fabricName, String containerName, String protectedItemName, - ProtectedItemResourceInner parameters, Context context) { - Response response = createOrUpdateWithResponse(vaultName, resourceGroupName, fabricName, - containerName, protectedItemName, parameters, context); - return this.client.getLroResult(response, - ProtectedItemResourceInner.class, ProtectedItemResourceInner.class, context); - } - - /** - * Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an - * asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters resource backed up item. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, ProtectedItemResourceInner parameters) { - return beginCreateOrUpdateAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - parameters).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an - * asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters resource backed up item. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProtectedItemResourceInner createOrUpdate(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, ProtectedItemResourceInner parameters) { - return beginCreateOrUpdate(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - parameters).getFinalResult(); - } - - /** - * Enables backup of an item or to modifies the backup policy information of an already backed up item. This is an - * asynchronous operation. To know the status of the operation, call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters resource backed up item. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProtectedItemResourceInner createOrUpdate(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, ProtectedItemResourceInner parameters, Context context) { - return beginCreateOrUpdate(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - parameters, context).getFinalResult(); - } - - /** - * Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of - * the - * request, call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, - protectedItemName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of - * the - * request, call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName) { - return deleteWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of - * the - * request, call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, protectedItemName, - context); - } - - /** - * Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of - * the - * request, call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName) { - deleteWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, Context.NONE); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsImpl.java deleted file mode 100644 index bb07293cff80..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemsImpl.java +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemResource; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItems; - -public final class ProtectedItemsImpl implements ProtectedItems { - private static final ClientLogger LOGGER = new ClientLogger(ProtectedItemsImpl.class); - - private final ProtectedItemsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public ProtectedItemsImpl(ProtectedItemsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String filter, Context context) { - Response inner = this.serviceClient() - .getWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter, - context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ProtectedItemResourceImpl(inner.getValue(), this.manager())); - } - - public ProtectedItemResource get(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName) { - ProtectedItemResourceInner inner - = this.serviceClient().get(vaultName, resourceGroupName, fabricName, containerName, protectedItemName); - if (inner != null) { - return new ProtectedItemResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, Context context) { - return this.serviceClient() - .deleteWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, context); - } - - public void delete(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName) { - this.serviceClient().delete(vaultName, resourceGroupName, fabricName, containerName, protectedItemName); - } - - public ProtectedItemResource getById(String id) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 fabricName = ResourceManagerUtils.getValueFromIdByName(id, "backupFabrics"); - if (fabricName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupFabrics'.", id))); - } - String containerName = ResourceManagerUtils.getValueFromIdByName(id, "protectionContainers"); - if (containerName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'protectionContainers'.", id))); - } - String protectedItemName = ResourceManagerUtils.getValueFromIdByName(id, "protectedItems"); - if (protectedItemName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'protectedItems'.", id))); - } - String localFilter = null; - return this - .getWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, localFilter, - Context.NONE) - .getValue(); - } - - public Response getByIdWithResponse(String id, String filter, Context context) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 fabricName = ResourceManagerUtils.getValueFromIdByName(id, "backupFabrics"); - if (fabricName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupFabrics'.", id))); - } - String containerName = ResourceManagerUtils.getValueFromIdByName(id, "protectionContainers"); - if (containerName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'protectionContainers'.", id))); - } - String protectedItemName = ResourceManagerUtils.getValueFromIdByName(id, "protectedItems"); - if (protectedItemName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'protectedItems'.", id))); - } - return this.getWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter, - context); - } - - public void deleteById(String id) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 fabricName = ResourceManagerUtils.getValueFromIdByName(id, "backupFabrics"); - if (fabricName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupFabrics'.", id))); - } - String containerName = ResourceManagerUtils.getValueFromIdByName(id, "protectionContainers"); - if (containerName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'protectionContainers'.", id))); - } - String protectedItemName = ResourceManagerUtils.getValueFromIdByName(id, "protectedItems"); - if (protectedItemName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'protectedItems'.", id))); - } - this.deleteWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 fabricName = ResourceManagerUtils.getValueFromIdByName(id, "backupFabrics"); - if (fabricName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupFabrics'.", id))); - } - String containerName = ResourceManagerUtils.getValueFromIdByName(id, "protectionContainers"); - if (containerName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'protectionContainers'.", id))); - } - String protectedItemName = ResourceManagerUtils.getValueFromIdByName(id, "protectedItems"); - if (protectedItemName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'protectedItems'.", id))); - } - return this.deleteWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - context); - } - - private ProtectedItemsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } - - public ProtectedItemResourceImpl define(String name) { - return new ProtectedItemResourceImpl(name, this.manager()); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerOperationResultsClientImpl.java deleted file mode 100644 index 4da3d037c869..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerOperationResultsClientImpl.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionContainerOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ProtectionContainerOperationResultsClient. - */ -public final class ProtectionContainerOperationResultsClientImpl implements ProtectionContainerOperationResultsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ProtectionContainerOperationResultsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of ProtectionContainerOperationResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ProtectionContainerOperationResultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(ProtectionContainerOperationResultsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for - * RecoveryServicesBackupManagementClientProtectionContainerOperationResults to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientProtectionContainerOperationResults") - public interface ProtectionContainerOperationResultsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/operationResults/{operationId}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/operationResults/{operationId}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Fetches the result of any operation on the container. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param operationId The name of the ProtectionContainerResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for container with backup items along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, - String resourceGroupName, String fabricName, String containerName, String operationId) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, operationId, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Fetches the result of any operation on the container. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param operationId The name of the ProtectionContainerResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for container with backup items on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName, - String fabricName, String containerName, String operationId) { - return getWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, operationId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Fetches the result of any operation on the container. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param operationId The name of the ProtectionContainerResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for container with backup items along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, - String fabricName, String containerName, String operationId, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, fabricName, containerName, operationId, accept, context); - } - - /** - * Fetches the result of any operation on the container. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param operationId The name of the ProtectionContainerResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for container with backup items. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProtectionContainerResourceInner get(String vaultName, String resourceGroupName, String fabricName, - String containerName, String operationId) { - return getWithResponse(vaultName, resourceGroupName, fabricName, containerName, operationId, Context.NONE) - .getValue(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerOperationResultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerOperationResultsImpl.java deleted file mode 100644 index 64ec40ac9e79..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerOperationResultsImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionContainerOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainerOperationResults; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainerResource; - -public final class ProtectionContainerOperationResultsImpl implements ProtectionContainerOperationResults { - private static final ClientLogger LOGGER = new ClientLogger(ProtectionContainerOperationResultsImpl.class); - - private final ProtectionContainerOperationResultsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public ProtectionContainerOperationResultsImpl(ProtectionContainerOperationResultsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, - String fabricName, String containerName, String operationId, Context context) { - Response inner = this.serviceClient() - .getWithResponse(vaultName, resourceGroupName, fabricName, containerName, operationId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ProtectionContainerResourceImpl(inner.getValue(), this.manager())); - } - - public ProtectionContainerResource get(String vaultName, String resourceGroupName, String fabricName, - String containerName, String operationId) { - ProtectionContainerResourceInner inner - = this.serviceClient().get(vaultName, resourceGroupName, fabricName, containerName, operationId); - if (inner != null) { - return new ProtectionContainerResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - private ProtectionContainerOperationResultsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerRefreshOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerRefreshOperationResultsClientImpl.java deleted file mode 100644 index 57dccdd4a2dc..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerRefreshOperationResultsClientImpl.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionContainerRefreshOperationResultsClient; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * ProtectionContainerRefreshOperationResultsClient. - */ -public final class ProtectionContainerRefreshOperationResultsClientImpl - implements ProtectionContainerRefreshOperationResultsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ProtectionContainerRefreshOperationResultsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of ProtectionContainerRefreshOperationResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ProtectionContainerRefreshOperationResultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(ProtectionContainerRefreshOperationResultsService.class, - client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for - * RecoveryServicesBackupManagementClientProtectionContainerRefreshOperationResults to be used by the proxy service - * to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientProtectionContainerRefreshOperationResults") - public interface ProtectionContainerRefreshOperationResultsService { - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/operationResults/{operationId}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, - @PathParam("operationId") String operationId, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/operationResults/{operationId}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, - @PathParam("operationId") String operationId, Context context); - } - - /** - * Provides the result of the refresh operation triggered by the BeginRefresh operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName Fabric name associated with the container. - * @param operationId Operation ID associated with the operation whose result needs to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, String resourceGroupName, String fabricName, - String operationId) { - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, - resourceGroupName, this.client.getSubscriptionId(), fabricName, operationId, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Provides the result of the refresh operation triggered by the BeginRefresh operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName Fabric name associated with the container. - * @param operationId Operation ID associated with the operation whose result needs to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName, String fabricName, String operationId) { - return getWithResponseAsync(vaultName, resourceGroupName, fabricName, operationId) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Provides the result of the refresh operation triggered by the BeginRefresh operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName Fabric name associated with the container. - * @param operationId Operation ID associated with the operation whose result needs to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, String fabricName, - String operationId, Context context) { - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), fabricName, operationId, context); - } - - /** - * Provides the result of the refresh operation triggered by the BeginRefresh operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName Fabric name associated with the container. - * @param operationId Operation ID associated with the operation whose result needs to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void get(String vaultName, String resourceGroupName, String fabricName, String operationId) { - getWithResponse(vaultName, resourceGroupName, fabricName, operationId, Context.NONE); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerRefreshOperationResultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerRefreshOperationResultsImpl.java deleted file mode 100644 index a0a2adb4ebb9..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerRefreshOperationResultsImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionContainerRefreshOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainerRefreshOperationResults; - -public final class ProtectionContainerRefreshOperationResultsImpl - implements ProtectionContainerRefreshOperationResults { - private static final ClientLogger LOGGER = new ClientLogger(ProtectionContainerRefreshOperationResultsImpl.class); - - private final ProtectionContainerRefreshOperationResultsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public ProtectionContainerRefreshOperationResultsImpl(ProtectionContainerRefreshOperationResultsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, String fabricName, - String operationId, Context context) { - return this.serviceClient().getWithResponse(vaultName, resourceGroupName, fabricName, operationId, context); - } - - public void get(String vaultName, String resourceGroupName, String fabricName, String operationId) { - this.serviceClient().get(vaultName, resourceGroupName, fabricName, operationId); - } - - private ProtectionContainerRefreshOperationResultsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerResourceImpl.java deleted file mode 100644 index 9fa6f259a84c..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainerResourceImpl.java +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainer; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainerResource; -import java.util.Collections; -import java.util.Map; - -public final class ProtectionContainerResourceImpl - implements ProtectionContainerResource, ProtectionContainerResource.Definition, ProtectionContainerResource.Update { - private ProtectionContainerResourceInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public ProtectionContainer properties() { - return this.innerModel().properties(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String location() { - return this.innerModel().location(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public ProtectionContainerResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } - - private String vaultName; - - private String resourceGroupName; - - private String fabricName; - - private String containerName; - - public ProtectionContainerResourceImpl withExistingBackupFabric(String vaultName, String resourceGroupName, - String fabricName) { - this.vaultName = vaultName; - this.resourceGroupName = resourceGroupName; - this.fabricName = fabricName; - return this; - } - - public ProtectionContainerResource create() { - this.innerObject = serviceManager.serviceClient() - .getProtectionContainers() - .register(vaultName, resourceGroupName, fabricName, containerName, this.innerModel(), Context.NONE); - return this; - } - - public ProtectionContainerResource create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getProtectionContainers() - .register(vaultName, resourceGroupName, fabricName, containerName, this.innerModel(), context); - return this; - } - - ProtectionContainerResourceImpl(String name, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = new ProtectionContainerResourceInner(); - this.serviceManager = serviceManager; - this.containerName = name; - } - - public ProtectionContainerResourceImpl update() { - return this; - } - - public ProtectionContainerResource apply() { - this.innerObject = serviceManager.serviceClient() - .getProtectionContainers() - .register(vaultName, resourceGroupName, fabricName, containerName, this.innerModel(), Context.NONE); - return this; - } - - public ProtectionContainerResource apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getProtectionContainers() - .register(vaultName, resourceGroupName, fabricName, containerName, this.innerModel(), context); - return this; - } - - ProtectionContainerResourceImpl(ProtectionContainerResourceInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.vaultName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "vaults"); - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.fabricName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "backupFabrics"); - this.containerName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "protectionContainers"); - } - - public ProtectionContainerResource refresh() { - this.innerObject = serviceManager.serviceClient() - .getProtectionContainers() - .getWithResponse(vaultName, resourceGroupName, fabricName, containerName, Context.NONE) - .getValue(); - return this; - } - - public ProtectionContainerResource refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getProtectionContainers() - .getWithResponse(vaultName, resourceGroupName, fabricName, containerName, context) - .getValue(); - return this; - } - - public Response inquireWithResponse(String filter, Context context) { - return serviceManager.protectionContainers() - .inquireWithResponse(vaultName, resourceGroupName, fabricName, containerName, filter, context); - } - - public void inquire() { - serviceManager.protectionContainers().inquire(vaultName, resourceGroupName, fabricName, containerName); - } - - public ProtectionContainerResourceImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public ProtectionContainerResourceImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public ProtectionContainerResourceImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public ProtectionContainerResourceImpl withProperties(ProtectionContainer properties) { - this.innerModel().withProperties(properties); - return this; - } - - public ProtectionContainerResourceImpl withEtag(String etag) { - this.innerModel().withEtag(etag); - return this; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainersClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainersClientImpl.java deleted file mode 100644 index cdedc90c4096..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainersClientImpl.java +++ /dev/null @@ -1,723 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionContainersClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; -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 ProtectionContainersClient. - */ -public final class ProtectionContainersClientImpl implements ProtectionContainersClient { - /** - * The proxy service used to perform REST calls. - */ - private final ProtectionContainersService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of ProtectionContainersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ProtectionContainersClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(ProtectionContainersService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientProtectionContainers to be used - * by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientProtectionContainers") - public interface ProtectionContainersService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> register(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ProtectionContainerResourceInner parameters, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response registerSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ProtectionContainerResourceInner parameters, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> unregister(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response unregisterSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/inquire") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> inquire(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @QueryParam("$filter") String filter, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/inquire") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response inquireSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @QueryParam("$filter") String filter, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/refreshContainers") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> refresh(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, - @QueryParam("$filter") String filter, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/refreshContainers") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response refreshSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("vaultName") String vaultName, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("fabricName") String fabricName, - @QueryParam("$filter") String filter, Context context); - } - - /** - * Gets details of the specific container registered to your Recovery Services Vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of the specific container registered to your Recovery Services Vault along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, - String resourceGroupName, String fabricName, String containerName) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets details of the specific container registered to your Recovery Services Vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of the specific container registered to your Recovery Services Vault on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName, - String fabricName, String containerName) { - return getWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets details of the specific container registered to your Recovery Services Vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of the specific container registered to your Recovery Services Vault along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, - String fabricName, String containerName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, fabricName, containerName, accept, context); - } - - /** - * Gets details of the specific container registered to your Recovery Services Vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of the specific container registered to your Recovery Services Vault. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProtectionContainerResourceInner get(String vaultName, String resourceGroupName, String fabricName, - String containerName) { - return getWithResponse(vaultName, resourceGroupName, fabricName, containerName, Context.NONE).getValue(); - } - - /** - * Registers the container with Recovery Services vault. - * This is an asynchronous operation. To track the operation status, use location header to call get latest status - * of - * the operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for container with backup items along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> registerWithResponseAsync(String vaultName, String resourceGroupName, - String fabricName, String containerName, ProtectionContainerResourceInner parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.register(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, contentType, - accept, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Registers the container with Recovery Services vault. - * This is an asynchronous operation. To track the operation status, use location header to call get latest status - * of - * the operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for container with backup items along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response registerWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, ProtectionContainerResourceInner parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.registerSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, contentType, - accept, parameters, Context.NONE); - } - - /** - * Registers the container with Recovery Services vault. - * This is an asynchronous operation. To track the operation status, use location header to call get latest status - * of - * the operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param parameters Request body for operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for container with backup items along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response registerWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, ProtectionContainerResourceInner parameters, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.registerSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, contentType, - accept, parameters, context); - } - - /** - * Registers the container with Recovery Services vault. - * This is an asynchronous operation. To track the operation status, use location header to call get latest status - * of - * the operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of base class for container with backup items. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProtectionContainerResourceInner> - beginRegisterAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, - ProtectionContainerResourceInner parameters) { - Mono>> mono - = registerWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, parameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ProtectionContainerResourceInner.class, - ProtectionContainerResourceInner.class, this.client.getContext()); - } - - /** - * Registers the container with Recovery Services vault. - * This is an asynchronous operation. To track the operation status, use location header to call get latest status - * of - * the operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of base class for container with backup items. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProtectionContainerResourceInner> beginRegister( - String vaultName, String resourceGroupName, String fabricName, String containerName, - ProtectionContainerResourceInner parameters) { - Response response - = registerWithResponse(vaultName, resourceGroupName, fabricName, containerName, parameters); - return this.client.getLroResult(response, - ProtectionContainerResourceInner.class, ProtectionContainerResourceInner.class, Context.NONE); - } - - /** - * Registers the container with Recovery Services vault. - * This is an asynchronous operation. To track the operation status, use location header to call get latest status - * of - * the operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param parameters Request body for operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of base class for container with backup items. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProtectionContainerResourceInner> beginRegister( - String vaultName, String resourceGroupName, String fabricName, String containerName, - ProtectionContainerResourceInner parameters, Context context) { - Response response - = registerWithResponse(vaultName, resourceGroupName, fabricName, containerName, parameters, context); - return this.client.getLroResult(response, - ProtectionContainerResourceInner.class, ProtectionContainerResourceInner.class, context); - } - - /** - * Registers the container with Recovery Services vault. - * This is an asynchronous operation. To track the operation status, use location header to call get latest status - * of - * the operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for container with backup items on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono registerAsync(String vaultName, String resourceGroupName, - String fabricName, String containerName, ProtectionContainerResourceInner parameters) { - return beginRegisterAsync(vaultName, resourceGroupName, fabricName, containerName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Registers the container with Recovery Services vault. - * This is an asynchronous operation. To track the operation status, use location header to call get latest status - * of - * the operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for container with backup items. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProtectionContainerResourceInner register(String vaultName, String resourceGroupName, String fabricName, - String containerName, ProtectionContainerResourceInner parameters) { - return beginRegister(vaultName, resourceGroupName, fabricName, containerName, parameters).getFinalResult(); - } - - /** - * Registers the container with Recovery Services vault. - * This is an asynchronous operation. To track the operation status, use location header to call get latest status - * of - * the operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param parameters Request body for operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for container with backup items. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProtectionContainerResourceInner register(String vaultName, String resourceGroupName, String fabricName, - String containerName, ProtectionContainerResourceInner parameters, Context context) { - return beginRegister(vaultName, resourceGroupName, fabricName, containerName, parameters, context) - .getFinalResult(); - } - - /** - * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To - * determine - * whether the backend service has finished processing the request, call Get Container Operation Result API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> unregisterWithResponseAsync(String vaultName, String resourceGroupName, - String fabricName, String containerName) { - return FluxUtil - .withContext(context -> service.unregister(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To - * determine - * whether the backend service has finished processing the request, call Get Container Operation Result API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono unregisterAsync(String vaultName, String resourceGroupName, String fabricName, - String containerName) { - return unregisterWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To - * determine - * whether the backend service has finished processing the request, call Get Container Operation Result API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response unregisterWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, Context context) { - return service.unregisterSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, context); - } - - /** - * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To - * determine - * whether the backend service has finished processing the request, call Get Container Operation Result API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void unregister(String vaultName, String resourceGroupName, String fabricName, String containerName) { - unregisterWithResponse(vaultName, resourceGroupName, fabricName, containerName, Context.NONE); - } - - /** - * This is an async operation and the results should be tracked using location header or Azure-async-url. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param filter OData filter options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> inquireWithResponseAsync(String vaultName, String resourceGroupName, String fabricName, - String containerName, String filter) { - return FluxUtil.withContext(context -> service.inquire(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, filter, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * This is an async operation and the results should be tracked using location header or Azure-async-url. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono inquireAsync(String vaultName, String resourceGroupName, String fabricName, - String containerName) { - final String filter = null; - return inquireWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, filter) - .flatMap(ignored -> Mono.empty()); - } - - /** - * This is an async operation and the results should be tracked using location header or Azure-async-url. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response inquireWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String filter, Context context) { - return service.inquireSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, filter, context); - } - - /** - * This is an async operation and the results should be tracked using location header or Azure-async-url. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void inquire(String vaultName, String resourceGroupName, String fabricName, String containerName) { - final String filter = null; - inquireWithResponse(vaultName, resourceGroupName, fabricName, containerName, filter, Context.NONE); - } - - /** - * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an - * asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName Fabric name associated the container. - * @param filter OData filter options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> refreshWithResponseAsync(String vaultName, String resourceGroupName, String fabricName, - String filter) { - return FluxUtil - .withContext(context -> service.refresh(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, - resourceGroupName, this.client.getSubscriptionId(), fabricName, filter, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an - * asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName Fabric name associated the container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 refreshAsync(String vaultName, String resourceGroupName, String fabricName) { - final String filter = null; - return refreshWithResponseAsync(vaultName, resourceGroupName, fabricName, filter) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an - * asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName Fabric name associated the container. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response refreshWithResponse(String vaultName, String resourceGroupName, String fabricName, - String filter, Context context) { - return service.refreshSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), fabricName, filter, context); - } - - /** - * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an - * asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName Fabric name associated the container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 refresh(String vaultName, String resourceGroupName, String fabricName) { - final String filter = null; - refreshWithResponse(vaultName, resourceGroupName, fabricName, filter, Context.NONE); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainersImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainersImpl.java deleted file mode 100644 index 0a27759ef4b5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionContainersImpl.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionContainersClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainerResource; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainers; - -public final class ProtectionContainersImpl implements ProtectionContainers { - private static final ClientLogger LOGGER = new ClientLogger(ProtectionContainersImpl.class); - - private final ProtectionContainersClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public ProtectionContainersImpl(ProtectionContainersClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, - String fabricName, String containerName, Context context) { - Response inner - = this.serviceClient().getWithResponse(vaultName, resourceGroupName, fabricName, containerName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ProtectionContainerResourceImpl(inner.getValue(), this.manager())); - } - - public ProtectionContainerResource get(String vaultName, String resourceGroupName, String fabricName, - String containerName) { - ProtectionContainerResourceInner inner - = this.serviceClient().get(vaultName, resourceGroupName, fabricName, containerName); - if (inner != null) { - return new ProtectionContainerResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response unregisterWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, Context context) { - return this.serviceClient() - .unregisterWithResponse(vaultName, resourceGroupName, fabricName, containerName, context); - } - - public void unregister(String vaultName, String resourceGroupName, String fabricName, String containerName) { - this.serviceClient().unregister(vaultName, resourceGroupName, fabricName, containerName); - } - - public Response inquireWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String filter, Context context) { - return this.serviceClient() - .inquireWithResponse(vaultName, resourceGroupName, fabricName, containerName, filter, context); - } - - public void inquire(String vaultName, String resourceGroupName, String fabricName, String containerName) { - this.serviceClient().inquire(vaultName, resourceGroupName, fabricName, containerName); - } - - public Response refreshWithResponse(String vaultName, String resourceGroupName, String fabricName, - String filter, Context context) { - return this.serviceClient().refreshWithResponse(vaultName, resourceGroupName, fabricName, filter, context); - } - - public void refresh(String vaultName, String resourceGroupName, String fabricName) { - this.serviceClient().refresh(vaultName, resourceGroupName, fabricName); - } - - public ProtectionContainerResource getById(String id) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 fabricName = ResourceManagerUtils.getValueFromIdByName(id, "backupFabrics"); - if (fabricName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupFabrics'.", id))); - } - String containerName = ResourceManagerUtils.getValueFromIdByName(id, "protectionContainers"); - if (containerName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'protectionContainers'.", id))); - } - return this.getWithResponse(vaultName, resourceGroupName, fabricName, containerName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 fabricName = ResourceManagerUtils.getValueFromIdByName(id, "backupFabrics"); - if (fabricName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupFabrics'.", id))); - } - String containerName = ResourceManagerUtils.getValueFromIdByName(id, "protectionContainers"); - if (containerName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'protectionContainers'.", id))); - } - return this.getWithResponse(vaultName, resourceGroupName, fabricName, containerName, context); - } - - private ProtectionContainersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } - - public ProtectionContainerResourceImpl define(String name) { - return new ProtectionContainerResourceImpl(name, this.manager()); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentResourceImpl.java deleted file mode 100644 index 58b6251a750a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentResourceImpl.java +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionIntentResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionIntent; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionIntentResource; -import java.util.Collections; -import java.util.Map; - -public final class ProtectionIntentResourceImpl - implements ProtectionIntentResource, ProtectionIntentResource.Definition, ProtectionIntentResource.Update { - private ProtectionIntentResourceInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public ProtectionIntent properties() { - return this.innerModel().properties(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String location() { - return this.innerModel().location(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public ProtectionIntentResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } - - private String vaultName; - - private String resourceGroupName; - - private String fabricName; - - private String intentObjectName; - - public ProtectionIntentResourceImpl withExistingBackupFabric(String vaultName, String resourceGroupName, - String fabricName) { - this.vaultName = vaultName; - this.resourceGroupName = resourceGroupName; - this.fabricName = fabricName; - return this; - } - - public ProtectionIntentResource create() { - this.innerObject = serviceManager.serviceClient() - .getProtectionIntents() - .createOrUpdateWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public ProtectionIntentResource create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getProtectionIntents() - .createOrUpdateWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, this.innerModel(), - context) - .getValue(); - return this; - } - - ProtectionIntentResourceImpl(String name, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = new ProtectionIntentResourceInner(); - this.serviceManager = serviceManager; - this.intentObjectName = name; - } - - public ProtectionIntentResourceImpl update() { - return this; - } - - public ProtectionIntentResource apply() { - this.innerObject = serviceManager.serviceClient() - .getProtectionIntents() - .createOrUpdateWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public ProtectionIntentResource apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getProtectionIntents() - .createOrUpdateWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, this.innerModel(), - context) - .getValue(); - return this; - } - - ProtectionIntentResourceImpl(ProtectionIntentResourceInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.vaultName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "vaults"); - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.fabricName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "backupFabrics"); - this.intentObjectName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "backupProtectionIntent"); - } - - public ProtectionIntentResource refresh() { - this.innerObject = serviceManager.serviceClient() - .getProtectionIntents() - .getWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, Context.NONE) - .getValue(); - return this; - } - - public ProtectionIntentResource refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getProtectionIntents() - .getWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, context) - .getValue(); - return this; - } - - public ProtectionIntentResourceImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public ProtectionIntentResourceImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public ProtectionIntentResourceImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public ProtectionIntentResourceImpl withProperties(ProtectionIntent properties) { - this.innerModel().withProperties(properties); - return this; - } - - public ProtectionIntentResourceImpl withEtag(String etag) { - this.innerModel().withEtag(etag); - return this; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsClientImpl.java deleted file mode 100644 index c30b9d8cbb4d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsClientImpl.java +++ /dev/null @@ -1,488 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionIntentsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.PreValidateEnableBackupResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionIntentResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.PreValidateEnableBackupRequest; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ProtectionIntentsClient. - */ -public final class ProtectionIntentsClientImpl implements ProtectionIntentsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ProtectionIntentsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of ProtectionIntentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ProtectionIntentsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service - = RestProxy.create(ProtectionIntentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientProtectionIntents to be used by - * the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientProtectionIntents") - public interface ProtectionIntentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("intentObjectName") String intentObjectName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("intentObjectName") String intentObjectName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("intentObjectName") String intentObjectName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ProtectionIntentResourceInner parameters, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("intentObjectName") String intentObjectName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ProtectionIntentResourceInner parameters, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("intentObjectName") String intentObjectName, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("intentObjectName") String intentObjectName, - Context context); - - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupPreValidateProtection") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> validate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("azureRegion") String azureRegion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") PreValidateEnableBackupRequest parameters, Context context); - - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupPreValidateProtection") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response validateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("azureRegion") String azureRegion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") PreValidateEnableBackupRequest parameters, Context context); - } - - /** - * Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of - * the operation, - * call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup ProtectionIntent along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, - String resourceGroupName, String fabricName, String intentObjectName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, intentObjectName, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of - * the operation, - * call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup ProtectionIntent on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName, String fabricName, - String intentObjectName) { - return getWithResponseAsync(vaultName, resourceGroupName, fabricName, intentObjectName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of - * the operation, - * call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup ProtectionIntent along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, - String fabricName, String intentObjectName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, fabricName, intentObjectName, accept, context); - } - - /** - * Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of - * the operation, - * call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup ProtectionIntent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProtectionIntentResourceInner get(String vaultName, String resourceGroupName, String fabricName, - String intentObjectName) { - return getWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, Context.NONE).getValue(); - } - - /** - * Create Intent for Enabling backup of an item. This is a synchronous operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @param parameters resource backed up item. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup ProtectionIntent along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String vaultName, - String resourceGroupName, String fabricName, String intentObjectName, - ProtectionIntentResourceInner parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, intentObjectName, - contentType, accept, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create Intent for Enabling backup of an item. This is a synchronous operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @param parameters resource backed up item. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup ProtectionIntent on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String vaultName, String resourceGroupName, - String fabricName, String intentObjectName, ProtectionIntentResourceInner parameters) { - return createOrUpdateWithResponseAsync(vaultName, resourceGroupName, fabricName, intentObjectName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create Intent for Enabling backup of an item. This is a synchronous operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @param parameters resource backed up item. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup ProtectionIntent along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String vaultName, - String resourceGroupName, String fabricName, String intentObjectName, ProtectionIntentResourceInner parameters, - Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, intentObjectName, contentType, - accept, parameters, context); - } - - /** - * Create Intent for Enabling backup of an item. This is a synchronous operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @param parameters resource backed up item. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup ProtectionIntent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProtectionIntentResourceInner createOrUpdate(String vaultName, String resourceGroupName, String fabricName, - String intentObjectName, ProtectionIntentResourceInner parameters) { - return createOrUpdateWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, parameters, - Context.NONE).getValue(); - } - - /** - * Used to remove intent from an item. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String vaultName, String resourceGroupName, String fabricName, - String intentObjectName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, intentObjectName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Used to remove intent from an item. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String vaultName, String resourceGroupName, String fabricName, - String intentObjectName) { - return deleteWithResponseAsync(vaultName, resourceGroupName, fabricName, intentObjectName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Used to remove intent from an item. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String vaultName, String resourceGroupName, String fabricName, - String intentObjectName, Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, intentObjectName, context); - } - - /** - * Used to remove intent from an item. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String vaultName, String resourceGroupName, String fabricName, String intentObjectName) { - deleteWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, Context.NONE); - } - - /** - * It will validate followings - * 1. Vault capacity - * 2. VM is already protected - * 3. Any VM related configuration passed in properties. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Enable backup validation request on Virtual Machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 contract for enable backup validation request along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateWithResponseAsync(String azureRegion, - PreValidateEnableBackupRequest parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.validate(this.client.getEndpoint(), this.client.getApiVersion(), - azureRegion, this.client.getSubscriptionId(), contentType, accept, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * It will validate followings - * 1. Vault capacity - * 2. VM is already protected - * 3. Any VM related configuration passed in properties. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Enable backup validation request on Virtual Machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 contract for enable backup validation request on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateAsync(String azureRegion, - PreValidateEnableBackupRequest parameters) { - return validateWithResponseAsync(azureRegion, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * It will validate followings - * 1. Vault capacity - * 2. VM is already protected - * 3. Any VM related configuration passed in properties. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Enable backup validation request on Virtual Machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 contract for enable backup validation request along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateWithResponse(String azureRegion, - PreValidateEnableBackupRequest parameters, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.validateSync(this.client.getEndpoint(), this.client.getApiVersion(), azureRegion, - this.client.getSubscriptionId(), contentType, accept, parameters, context); - } - - /** - * It will validate followings - * 1. Vault capacity - * 2. VM is already protected - * 3. Any VM related configuration passed in properties. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Enable backup validation request on Virtual Machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 contract for enable backup validation request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PreValidateEnableBackupResponseInner validate(String azureRegion, - PreValidateEnableBackupRequest parameters) { - return validateWithResponse(azureRegion, parameters, Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsImpl.java deleted file mode 100644 index 3ff66a2b257f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionIntentsImpl.java +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionIntentsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.PreValidateEnableBackupResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionIntentResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.PreValidateEnableBackupRequest; -import com.azure.resourcemanager.recoveryservicesbackup.models.PreValidateEnableBackupResponse; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionIntentResource; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionIntents; - -public final class ProtectionIntentsImpl implements ProtectionIntents { - private static final ClientLogger LOGGER = new ClientLogger(ProtectionIntentsImpl.class); - - private final ProtectionIntentsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public ProtectionIntentsImpl(ProtectionIntentsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, - String fabricName, String intentObjectName, Context context) { - Response inner - = this.serviceClient().getWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ProtectionIntentResourceImpl(inner.getValue(), this.manager())); - } - - public ProtectionIntentResource get(String vaultName, String resourceGroupName, String fabricName, - String intentObjectName) { - ProtectionIntentResourceInner inner - = this.serviceClient().get(vaultName, resourceGroupName, fabricName, intentObjectName); - if (inner != null) { - return new ProtectionIntentResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String vaultName, String resourceGroupName, String fabricName, - String intentObjectName, Context context) { - return this.serviceClient() - .deleteWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, context); - } - - public void delete(String vaultName, String resourceGroupName, String fabricName, String intentObjectName) { - this.serviceClient().delete(vaultName, resourceGroupName, fabricName, intentObjectName); - } - - public Response validateWithResponse(String azureRegion, - PreValidateEnableBackupRequest parameters, Context context) { - Response inner - = this.serviceClient().validateWithResponse(azureRegion, parameters, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PreValidateEnableBackupResponseImpl(inner.getValue(), this.manager())); - } - - public PreValidateEnableBackupResponse validate(String azureRegion, PreValidateEnableBackupRequest parameters) { - PreValidateEnableBackupResponseInner inner = this.serviceClient().validate(azureRegion, parameters); - if (inner != null) { - return new PreValidateEnableBackupResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public ProtectionIntentResource getById(String id) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 fabricName = ResourceManagerUtils.getValueFromIdByName(id, "backupFabrics"); - if (fabricName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupFabrics'.", id))); - } - String intentObjectName = ResourceManagerUtils.getValueFromIdByName(id, "backupProtectionIntent"); - if (intentObjectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'backupProtectionIntent'.", id))); - } - return this.getWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, Context.NONE) - .getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 fabricName = ResourceManagerUtils.getValueFromIdByName(id, "backupFabrics"); - if (fabricName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupFabrics'.", id))); - } - String intentObjectName = ResourceManagerUtils.getValueFromIdByName(id, "backupProtectionIntent"); - if (intentObjectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'backupProtectionIntent'.", id))); - } - return this.getWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, context); - } - - public void deleteById(String id) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 fabricName = ResourceManagerUtils.getValueFromIdByName(id, "backupFabrics"); - if (fabricName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupFabrics'.", id))); - } - String intentObjectName = ResourceManagerUtils.getValueFromIdByName(id, "backupProtectionIntent"); - if (intentObjectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'backupProtectionIntent'.", id))); - } - this.deleteWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 fabricName = ResourceManagerUtils.getValueFromIdByName(id, "backupFabrics"); - if (fabricName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupFabrics'.", id))); - } - String intentObjectName = ResourceManagerUtils.getValueFromIdByName(id, "backupProtectionIntent"); - if (intentObjectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'backupProtectionIntent'.", id))); - } - return this.deleteWithResponse(vaultName, resourceGroupName, fabricName, intentObjectName, context); - } - - private ProtectionIntentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } - - public ProtectionIntentResourceImpl define(String name) { - return new ProtectionIntentResourceImpl(name, this.manager()); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPoliciesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPoliciesClientImpl.java deleted file mode 100644 index ea2fa9539849..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPoliciesClientImpl.java +++ /dev/null @@ -1,471 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.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.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionPoliciesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; -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 ProtectionPoliciesClient. - */ -public final class ProtectionPoliciesClientImpl implements ProtectionPoliciesClient { - /** - * The proxy service used to perform REST calls. - */ - private final ProtectionPoliciesService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of ProtectionPoliciesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ProtectionPoliciesClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(ProtectionPoliciesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientProtectionPolicies to be used - * by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientProtectionPolicies") - public interface ProtectionPoliciesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("policyName") String policyName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("policyName") String policyName, @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("policyName") String policyName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") ProtectionPolicyResourceInner parameters, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("policyName") String policyName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") ProtectionPolicyResourceInner parameters, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("policyName") String policyName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("policyName") String policyName, Context context); - } - - /** - * Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous - * operation. Status of the operation can be fetched using GetPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, - String resourceGroupName, String policyName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, policyName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous - * operation. Status of the operation can be fetched using GetPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName, - String policyName) { - return getWithResponseAsync(vaultName, resourceGroupName, policyName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous - * operation. Status of the operation can be fetched using GetPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, - String policyName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, policyName, accept, context); - } - - /** - * Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous - * operation. Status of the operation can be fetched using GetPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProtectionPolicyResourceInner get(String vaultName, String resourceGroupName, String policyName) { - return getWithResponse(vaultName, resourceGroupName, policyName, Context.NONE).getValue(); - } - - /** - * Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched - * using GetPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @param parameters resource backup policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String vaultName, - String resourceGroupName, String policyName, ProtectionPolicyResourceInner parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, policyName, contentType, accept, - parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched - * using GetPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @param parameters resource backup policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String vaultName, String resourceGroupName, - String policyName, ProtectionPolicyResourceInner parameters) { - return createOrUpdateWithResponseAsync(vaultName, resourceGroupName, policyName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched - * using GetPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @param parameters resource backup policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String vaultName, - String resourceGroupName, String policyName, ProtectionPolicyResourceInner parameters, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, policyName, contentType, accept, parameters, - context); - } - - /** - * Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be fetched - * using GetPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @param parameters resource backup policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProtectionPolicyResourceInner createOrUpdate(String vaultName, String resourceGroupName, String policyName, - ProtectionPolicyResourceInner parameters) { - return createOrUpdateWithResponse(vaultName, resourceGroupName, policyName, parameters, Context.NONE) - .getValue(); - } - - /** - * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of - * the - * operation can be fetched using GetProtectionPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String vaultName, String resourceGroupName, - String policyName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, policyName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of - * the - * operation can be fetched using GetProtectionPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String vaultName, String resourceGroupName, String policyName) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, policyName, Context.NONE); - } - - /** - * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of - * the - * operation can be fetched using GetProtectionPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String vaultName, String resourceGroupName, String policyName, - Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, policyName, context); - } - - /** - * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of - * the - * operation can be fetched using GetProtectionPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String vaultName, String resourceGroupName, - String policyName) { - Mono>> mono = deleteWithResponseAsync(vaultName, resourceGroupName, policyName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of - * the - * operation can be fetched using GetProtectionPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String vaultName, String resourceGroupName, - String policyName) { - Response response = deleteWithResponse(vaultName, resourceGroupName, policyName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of - * the - * operation can be fetched using GetProtectionPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String vaultName, String resourceGroupName, String policyName, - Context context) { - Response response = deleteWithResponse(vaultName, resourceGroupName, policyName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of - * the - * operation can be fetched using GetProtectionPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String vaultName, String resourceGroupName, String policyName) { - return beginDeleteAsync(vaultName, resourceGroupName, policyName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of - * the - * operation can be fetched using GetProtectionPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String vaultName, String resourceGroupName, String policyName) { - beginDelete(vaultName, resourceGroupName, policyName).getFinalResult(); - } - - /** - * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of - * the - * operation can be fetched using GetProtectionPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String vaultName, String resourceGroupName, String policyName, Context context) { - beginDelete(vaultName, resourceGroupName, policyName, context).getFinalResult(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPoliciesImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPoliciesImpl.java deleted file mode 100644 index 440d02dd90cc..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPoliciesImpl.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionPoliciesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicies; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicyResource; - -public final class ProtectionPoliciesImpl implements ProtectionPolicies { - private static final ClientLogger LOGGER = new ClientLogger(ProtectionPoliciesImpl.class); - - private final ProtectionPoliciesClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public ProtectionPoliciesImpl(ProtectionPoliciesClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, - String policyName, Context context) { - Response inner - = this.serviceClient().getWithResponse(vaultName, resourceGroupName, policyName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ProtectionPolicyResourceImpl(inner.getValue(), this.manager())); - } - - public ProtectionPolicyResource get(String vaultName, String resourceGroupName, String policyName) { - ProtectionPolicyResourceInner inner = this.serviceClient().get(vaultName, resourceGroupName, policyName); - if (inner != null) { - return new ProtectionPolicyResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String vaultName, String resourceGroupName, String policyName) { - this.serviceClient().delete(vaultName, resourceGroupName, policyName); - } - - public void delete(String vaultName, String resourceGroupName, String policyName, Context context) { - this.serviceClient().delete(vaultName, resourceGroupName, policyName, context); - } - - public ProtectionPolicyResource getById(String id) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 policyName = ResourceManagerUtils.getValueFromIdByName(id, "backupPolicies"); - if (policyName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id))); - } - return this.getWithResponse(vaultName, resourceGroupName, policyName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 policyName = ResourceManagerUtils.getValueFromIdByName(id, "backupPolicies"); - if (policyName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id))); - } - return this.getWithResponse(vaultName, resourceGroupName, policyName, context); - } - - public void deleteById(String id) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 policyName = ResourceManagerUtils.getValueFromIdByName(id, "backupPolicies"); - if (policyName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id))); - } - this.delete(vaultName, resourceGroupName, policyName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 policyName = ResourceManagerUtils.getValueFromIdByName(id, "backupPolicies"); - if (policyName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id))); - } - this.delete(vaultName, resourceGroupName, policyName, context); - } - - private ProtectionPoliciesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } - - public ProtectionPolicyResourceImpl define(String name) { - return new ProtectionPolicyResourceImpl(name, this.manager()); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationResultsClientImpl.java deleted file mode 100644 index a6d66752cb54..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationResultsClientImpl.java +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionPolicyOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ProtectionPolicyOperationResultsClient. - */ -public final class ProtectionPolicyOperationResultsClientImpl implements ProtectionPolicyOperationResultsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ProtectionPolicyOperationResultsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of ProtectionPolicyOperationResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ProtectionPolicyOperationResultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(ProtectionPolicyOperationResultsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for - * RecoveryServicesBackupManagementClientProtectionPolicyOperationResults to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientProtectionPolicyOperationResults") - public interface ProtectionPolicyOperationResultsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operationResults/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("policyName") String policyName, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operationResults/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("policyName") String policyName, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Provides the result of an operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName The name of the ProtectionPolicyResource. - * @param operationId The name of the ProtectionPolicyResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, - String resourceGroupName, String policyName, String operationId) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, policyName, operationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Provides the result of an operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName The name of the ProtectionPolicyResource. - * @param operationId The name of the ProtectionPolicyResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName, String policyName, - String operationId) { - return getWithResponseAsync(vaultName, resourceGroupName, policyName, operationId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Provides the result of an operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName The name of the ProtectionPolicyResource. - * @param operationId The name of the ProtectionPolicyResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, - String policyName, String operationId, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, policyName, operationId, accept, context); - } - - /** - * Provides the result of an operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName The name of the ProtectionPolicyResource. - * @param operationId The name of the ProtectionPolicyResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProtectionPolicyResourceInner get(String vaultName, String resourceGroupName, String policyName, - String operationId) { - return getWithResponse(vaultName, resourceGroupName, policyName, operationId, Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationResultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationResultsImpl.java deleted file mode 100644 index 9f75f7b454bf..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationResultsImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionPolicyOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicyOperationResults; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicyResource; - -public final class ProtectionPolicyOperationResultsImpl implements ProtectionPolicyOperationResults { - private static final ClientLogger LOGGER = new ClientLogger(ProtectionPolicyOperationResultsImpl.class); - - private final ProtectionPolicyOperationResultsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public ProtectionPolicyOperationResultsImpl(ProtectionPolicyOperationResultsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, - String policyName, String operationId, Context context) { - Response inner - = this.serviceClient().getWithResponse(vaultName, resourceGroupName, policyName, operationId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ProtectionPolicyResourceImpl(inner.getValue(), this.manager())); - } - - public ProtectionPolicyResource get(String vaultName, String resourceGroupName, String policyName, - String operationId) { - ProtectionPolicyResourceInner inner - = this.serviceClient().get(vaultName, resourceGroupName, policyName, operationId); - if (inner != null) { - return new ProtectionPolicyResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - private ProtectionPolicyOperationResultsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationStatusesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationStatusesClientImpl.java deleted file mode 100644 index 574b8e56776f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationStatusesClientImpl.java +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionPolicyOperationStatusesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ProtectionPolicyOperationStatusesClient. - */ -public final class ProtectionPolicyOperationStatusesClientImpl implements ProtectionPolicyOperationStatusesClient { - /** - * The proxy service used to perform REST calls. - */ - private final ProtectionPolicyOperationStatusesService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of ProtectionPolicyOperationStatusesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ProtectionPolicyOperationStatusesClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(ProtectionPolicyOperationStatusesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for - * RecoveryServicesBackupManagementClientProtectionPolicyOperationStatuses to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientProtectionPolicyOperationStatuses") - public interface ProtectionPolicyOperationStatusesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operations/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("policyName") String policyName, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operations/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("policyName") String policyName, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Provides the status of the asynchronous operations like backup, restore. The status can be in progress, completed - * or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some - * operations - * create jobs. This method returns the list of jobs associated with operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName The name of the ProtectionPolicyResource. - * @param operationId The name of the ProtectionPolicyResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, String resourceGroupName, - String policyName, String operationId) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, policyName, operationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Provides the status of the asynchronous operations like backup, restore. The status can be in progress, completed - * or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some - * operations - * create jobs. This method returns the list of jobs associated with operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName The name of the ProtectionPolicyResource. - * @param operationId The name of the ProtectionPolicyResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName, String policyName, - String operationId) { - return getWithResponseAsync(vaultName, resourceGroupName, policyName, operationId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Provides the status of the asynchronous operations like backup, restore. The status can be in progress, completed - * or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some - * operations - * create jobs. This method returns the list of jobs associated with operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName The name of the ProtectionPolicyResource. - * @param operationId The name of the ProtectionPolicyResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, String policyName, - String operationId, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, policyName, operationId, accept, context); - } - - /** - * Provides the status of the asynchronous operations like backup, restore. The status can be in progress, completed - * or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some - * operations - * create jobs. This method returns the list of jobs associated with operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName The name of the ProtectionPolicyResource. - * @param operationId The name of the ProtectionPolicyResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusInner get(String vaultName, String resourceGroupName, String policyName, String operationId) { - return getWithResponse(vaultName, resourceGroupName, policyName, operationId, Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationStatusesImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationStatusesImpl.java deleted file mode 100644 index ddf8aa9c5928..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyOperationStatusesImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionPolicyOperationStatusesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatus; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicyOperationStatuses; - -public final class ProtectionPolicyOperationStatusesImpl implements ProtectionPolicyOperationStatuses { - private static final ClientLogger LOGGER = new ClientLogger(ProtectionPolicyOperationStatusesImpl.class); - - private final ProtectionPolicyOperationStatusesClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public ProtectionPolicyOperationStatusesImpl(ProtectionPolicyOperationStatusesClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, String policyName, - String operationId, Context context) { - Response inner - = this.serviceClient().getWithResponse(vaultName, resourceGroupName, policyName, operationId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationStatusImpl(inner.getValue(), this.manager())); - } - - public OperationStatus get(String vaultName, String resourceGroupName, String policyName, String operationId) { - OperationStatusInner inner = this.serviceClient().get(vaultName, resourceGroupName, policyName, operationId); - if (inner != null) { - return new OperationStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - private ProtectionPolicyOperationStatusesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyResourceImpl.java deleted file mode 100644 index e2906fac43e5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectionPolicyResourceImpl.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicy; -import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionPolicyResource; -import java.util.Collections; -import java.util.Map; - -public final class ProtectionPolicyResourceImpl - implements ProtectionPolicyResource, ProtectionPolicyResource.Definition, ProtectionPolicyResource.Update { - private ProtectionPolicyResourceInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public ProtectionPolicy properties() { - return this.innerModel().properties(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String location() { - return this.innerModel().location(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public ProtectionPolicyResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } - - private String vaultName; - - private String resourceGroupName; - - private String policyName; - - public ProtectionPolicyResourceImpl withExistingVault(String vaultName, String resourceGroupName) { - this.vaultName = vaultName; - this.resourceGroupName = resourceGroupName; - return this; - } - - public ProtectionPolicyResource create() { - this.innerObject = serviceManager.serviceClient() - .getProtectionPolicies() - .createOrUpdateWithResponse(vaultName, resourceGroupName, policyName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public ProtectionPolicyResource create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getProtectionPolicies() - .createOrUpdateWithResponse(vaultName, resourceGroupName, policyName, this.innerModel(), context) - .getValue(); - return this; - } - - ProtectionPolicyResourceImpl(String name, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = new ProtectionPolicyResourceInner(); - this.serviceManager = serviceManager; - this.policyName = name; - } - - public ProtectionPolicyResourceImpl update() { - return this; - } - - public ProtectionPolicyResource apply() { - this.innerObject = serviceManager.serviceClient() - .getProtectionPolicies() - .createOrUpdateWithResponse(vaultName, resourceGroupName, policyName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public ProtectionPolicyResource apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getProtectionPolicies() - .createOrUpdateWithResponse(vaultName, resourceGroupName, policyName, this.innerModel(), context) - .getValue(); - return this; - } - - ProtectionPolicyResourceImpl(ProtectionPolicyResourceInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.vaultName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "vaults"); - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.policyName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "backupPolicies"); - } - - public ProtectionPolicyResource refresh() { - this.innerObject = serviceManager.serviceClient() - .getProtectionPolicies() - .getWithResponse(vaultName, resourceGroupName, policyName, Context.NONE) - .getValue(); - return this; - } - - public ProtectionPolicyResource refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getProtectionPolicies() - .getWithResponse(vaultName, resourceGroupName, policyName, context) - .getValue(); - return this; - } - - public ProtectionPolicyResourceImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public ProtectionPolicyResourceImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public ProtectionPolicyResourceImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public ProtectionPolicyResourceImpl withProperties(ProtectionPolicy properties) { - this.innerModel().withProperties(properties); - return this; - } - - public ProtectionPolicyResourceImpl withEtag(String etag) { - this.innerModel().withEtag(etag); - return this; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointResourceImpl.java deleted file mode 100644 index 51c299945ae1..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointResourceImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPoint; -import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointResource; -import java.util.Collections; -import java.util.Map; - -public final class RecoveryPointResourceImpl implements RecoveryPointResource { - private RecoveryPointResourceInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - RecoveryPointResourceImpl(RecoveryPointResourceInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager 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 RecoveryPoint properties() { - return this.innerModel().properties(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String location() { - return this.innerModel().location(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public RecoveryPointResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsClientImpl.java deleted file mode 100644 index 717d93d55256..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsClientImpl.java +++ /dev/null @@ -1,572 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.RecoveryPointResourceList; -import com.azure.resourcemanager.recoveryservicesbackup.models.UpdateRecoveryPointRequest; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in RecoveryPointsClient. - */ -public final class RecoveryPointsClientImpl implements RecoveryPointsClient { - /** - * The proxy service used to perform REST calls. - */ - private final RecoveryPointsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of RecoveryPointsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RecoveryPointsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service - = RestProxy.create(RecoveryPointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientRecoveryPoints to be used by - * the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientRecoveryPoints") - public interface RecoveryPointsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, - @PathParam("recoveryPointId") String recoveryPointId, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, - @PathParam("recoveryPointId") String recoveryPointId, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, - @PathParam("recoveryPointId") String recoveryPointId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") UpdateRecoveryPointRequest parameters, - Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, - @PathParam("recoveryPointId") String recoveryPointId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") UpdateRecoveryPointRequest parameters, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous - * operation. - * To know the status of the operation, call the GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup copies along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String recoveryPointId) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, - protectedItemName, recoveryPointId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous - * operation. - * To know the status of the operation, call the GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup copies on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId) { - return getWithResponseAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - recoveryPointId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous - * operation. - * To know the status of the operation, call the GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup copies along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String recoveryPointId, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId, accept, - context); - } - - /** - * Provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous - * operation. - * To know the status of the operation, call the GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup copies. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RecoveryPointResourceInner get(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId) { - return getWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - recoveryPointId, Context.NONE).getValue(); - } - - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param filter OData filter options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String vaultName, - String resourceGroupName, String fabricName, String containerName, String protectedItemName, String filter) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, - protectedItemName, filter, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param filter OData filter options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, fabricName, containerName, - protectedItemName, filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName) { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, fabricName, containerName, - protectedItemName, filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param filter OData filter options. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String filter) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, - containerName, protectedItemName, filter, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String filter, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, fabricName, containerName, protectedItemName, filter, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName) { - final String filter = null; - return new PagedIterable<>( - () -> listSinglePage(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String filter, Context context) { - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, fabricName, containerName, - protectedItemName, filter, context), nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * UpdateRecoveryPoint to update recovery point for given RecoveryPointID. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the VaultResource. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup copies along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String vaultName, String fabricName, String containerName, String protectedItemName, String recoveryPointId, - UpdateRecoveryPointRequest parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, - protectedItemName, recoveryPointId, contentType, accept, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * UpdateRecoveryPoint to update recovery point for given RecoveryPointID. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the VaultResource. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup copies on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String vaultName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId, UpdateRecoveryPointRequest parameters) { - return updateWithResponseAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, - recoveryPointId, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * UpdateRecoveryPoint to update recovery point for given RecoveryPointID. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the VaultResource. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Request body for operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup copies along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String vaultName, - String fabricName, String containerName, String protectedItemName, String recoveryPointId, - UpdateRecoveryPointRequest parameters, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, protectedItemName, - recoveryPointId, contentType, accept, parameters, context); - } - - /** - * UpdateRecoveryPoint to update recovery point for given RecoveryPointID. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the VaultResource. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup copies. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RecoveryPointResourceInner update(String resourceGroupName, String vaultName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId, UpdateRecoveryPointRequest parameters) { - return updateWithResponse(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, - recoveryPointId, parameters, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsImpl.java deleted file mode 100644 index da5c60c7c356..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointResource; -import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPoints; -import com.azure.resourcemanager.recoveryservicesbackup.models.UpdateRecoveryPointRequest; - -public final class RecoveryPointsImpl implements RecoveryPoints { - private static final ClientLogger LOGGER = new ClientLogger(RecoveryPointsImpl.class); - - private final RecoveryPointsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public RecoveryPointsImpl(RecoveryPointsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String recoveryPointId, Context context) { - Response inner = this.serviceClient() - .getWithResponse(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - recoveryPointId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RecoveryPointResourceImpl(inner.getValue(), this.manager())); - } - - public RecoveryPointResource get(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId) { - RecoveryPointResourceInner inner = this.serviceClient() - .get(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId); - if (inner != null) { - return new RecoveryPointResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName) { - PagedIterable inner - = this.serviceClient().list(vaultName, resourceGroupName, fabricName, containerName, protectedItemName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RecoveryPointResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String filter, Context context) { - PagedIterable inner = this.serviceClient() - .list(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RecoveryPointResourceImpl(inner1, this.manager())); - } - - public Response updateWithResponse(String resourceGroupName, String vaultName, - String fabricName, String containerName, String protectedItemName, String recoveryPointId, - UpdateRecoveryPointRequest parameters, Context context) { - Response inner = this.serviceClient() - .updateWithResponse(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, - recoveryPointId, parameters, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RecoveryPointResourceImpl(inner.getValue(), this.manager())); - } - - public RecoveryPointResource update(String resourceGroupName, String vaultName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId, UpdateRecoveryPointRequest parameters) { - RecoveryPointResourceInner inner = this.serviceClient() - .update(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId, - parameters); - if (inner != null) { - return new RecoveryPointResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - private RecoveryPointsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesClientImpl.java deleted file mode 100644 index 4dab36cf9afb..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesClientImpl.java +++ /dev/null @@ -1,310 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsRecommendedForMovesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.RecoveryPointResourceList; -import com.azure.resourcemanager.recoveryservicesbackup.models.ListRecoveryPointsRecommendedForMoveRequest; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in RecoveryPointsRecommendedForMovesClient. - */ -public final class RecoveryPointsRecommendedForMovesClientImpl implements RecoveryPointsRecommendedForMovesClient { - /** - * The proxy service used to perform REST calls. - */ - private final RecoveryPointsRecommendedForMovesService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of RecoveryPointsRecommendedForMovesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RecoveryPointsRecommendedForMovesClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(RecoveryPointsRecommendedForMovesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for - * RecoveryServicesBackupManagementClientRecoveryPointsRecommendedForMoves to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientRecoveryPointsRecommendedForMoves") - public interface RecoveryPointsRecommendedForMovesService { - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPointsRecommendedForMove") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ListRecoveryPointsRecommendedForMoveRequest parameters, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPointsRecommendedForMove") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ListRecoveryPointsRecommendedForMoveRequest parameters, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists the recovery points recommended for move to another tier. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters List Recovery points Recommended for Move Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String vaultName, - String resourceGroupName, String fabricName, String containerName, String protectedItemName, - ListRecoveryPointsRecommendedForMoveRequest parameters) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, - protectedItemName, accept, parameters, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the recovery points recommended for move to another tier. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters List Recovery points Recommended for Move Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, - ListRecoveryPointsRecommendedForMoveRequest parameters) { - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName, fabricName, containerName, - protectedItemName, parameters), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the recovery points recommended for move to another tier. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters List Recovery points Recommended for Move Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, - ListRecoveryPointsRecommendedForMoveRequest parameters) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, - containerName, protectedItemName, accept, parameters, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists the recovery points recommended for move to another tier. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters List Recovery points Recommended for Move Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, - ListRecoveryPointsRecommendedForMoveRequest parameters, Context context) { - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, - containerName, protectedItemName, accept, parameters, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists the recovery points recommended for move to another tier. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters List Recovery points Recommended for Move Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, ListRecoveryPointsRecommendedForMoveRequest parameters) { - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, fabricName, containerName, - protectedItemName, parameters), nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Lists the recovery points recommended for move to another tier. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters List Recovery points Recommended for Move Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, ListRecoveryPointsRecommendedForMoveRequest parameters, - Context context) { - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, fabricName, containerName, - protectedItemName, parameters, context), nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesImpl.java deleted file mode 100644 index 00721b4272a8..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryPointsRecommendedForMovesImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsRecommendedForMovesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ListRecoveryPointsRecommendedForMoveRequest; -import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointResource; -import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointsRecommendedForMoves; - -public final class RecoveryPointsRecommendedForMovesImpl implements RecoveryPointsRecommendedForMoves { - private static final ClientLogger LOGGER = new ClientLogger(RecoveryPointsRecommendedForMovesImpl.class); - - private final RecoveryPointsRecommendedForMovesClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public RecoveryPointsRecommendedForMovesImpl(RecoveryPointsRecommendedForMovesClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, ListRecoveryPointsRecommendedForMoveRequest parameters) { - PagedIterable inner = this.serviceClient() - .list(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RecoveryPointResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, ListRecoveryPointsRecommendedForMoveRequest parameters, - Context context) { - PagedIterable inner = this.serviceClient() - .list(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RecoveryPointResourceImpl(inner1, this.manager())); - } - - private RecoveryPointsRecommendedForMovesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupManagementClientBuilder.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupManagementClientBuilder.java deleted file mode 100644 index b87487037d16..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupManagementClientBuilder.java +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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 RecoveryServicesBackupManagementClientImpl type. - */ -@ServiceClientBuilder(serviceClients = { RecoveryServicesBackupManagementClientImpl.class }) -public final class RecoveryServicesBackupManagementClientBuilder { - /* - * Service host - */ - private String endpoint; - - /** - * Sets Service host. - * - * @param endpoint the endpoint value. - * @return the RecoveryServicesBackupManagementClientBuilder. - */ - public RecoveryServicesBackupManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The ID of the target subscription. The value must be an UUID. - */ - private String subscriptionId; - - /** - * Sets The ID of the target subscription. The value must be an UUID. - * - * @param subscriptionId the subscriptionId value. - * @return the RecoveryServicesBackupManagementClientBuilder. - */ - public RecoveryServicesBackupManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the RecoveryServicesBackupManagementClientBuilder. - */ - public RecoveryServicesBackupManagementClientBuilder 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 RecoveryServicesBackupManagementClientBuilder. - */ - public RecoveryServicesBackupManagementClientBuilder 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 RecoveryServicesBackupManagementClientBuilder. - */ - public RecoveryServicesBackupManagementClientBuilder 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 RecoveryServicesBackupManagementClientBuilder. - */ - public RecoveryServicesBackupManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of RecoveryServicesBackupManagementClientImpl with the provided parameters. - * - * @return an instance of RecoveryServicesBackupManagementClientImpl. - */ - public RecoveryServicesBackupManagementClientImpl 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(); - RecoveryServicesBackupManagementClientImpl client - = new RecoveryServicesBackupManagementClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); - return client; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupManagementClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupManagementClientImpl.java deleted file mode 100644 index c2b837439d50..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupManagementClientImpl.java +++ /dev/null @@ -1,1125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.Response; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.exception.ManagementError; -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.recoveryservicesbackup.fluent.BackupEnginesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupJobsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupOperationStatusesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupPoliciesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectableItemsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectedItemsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectionContainersClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectionIntentsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceEncryptionConfigsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceStorageConfigsNonCrrsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceVaultConfigsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupStatusClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupUsageSummariesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupWorkloadItemsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.BmsPrepareDataMoveOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.DeletedProtectionContainersClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ExportJobsOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.FeatureSupportsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.FetchTieringCostsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.GetTieringCostOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ItemLevelRecoveryConnectionsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobCancellationsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobDetailsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationOperationsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.PrivateEndpointsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectableContainersClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemOperationStatusesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionContainerOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionContainerRefreshOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionContainersClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionIntentsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionPoliciesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionPolicyOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionPolicyOperationStatusesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryPointsRecommendedForMovesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryServicesBackupManagementClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ResourceGuardProxyOperationsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ResourceProvidersClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.RestoresClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.SecurityPINsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.TieringCostOperationStatusClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationStatusesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationsClient; -import java.io.IOException; -import java.lang.reflect.Type; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the RecoveryServicesBackupManagementClientImpl type. - */ -@ServiceClient(builder = RecoveryServicesBackupManagementClientBuilder.class) -public final class RecoveryServicesBackupManagementClientImpl implements RecoveryServicesBackupManagementClient { - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - * Version parameter. - */ - private final String apiVersion; - - /** - * Gets Version parameter. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** - * The ID of the target subscription. The value must be an UUID. - */ - 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. - */ - 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 ResourceProvidersClient object to access its operations. - */ - private final ResourceProvidersClient resourceProviders; - - /** - * Gets the ResourceProvidersClient object to access its operations. - * - * @return the ResourceProvidersClient object. - */ - public ResourceProvidersClient getResourceProviders() { - return this.resourceProviders; - } - - /** - * The OperationsClient object to access its operations. - */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** - * The BackupResourceStorageConfigsNonCrrsClient object to access its operations. - */ - private final BackupResourceStorageConfigsNonCrrsClient backupResourceStorageConfigsNonCrrs; - - /** - * Gets the BackupResourceStorageConfigsNonCrrsClient object to access its operations. - * - * @return the BackupResourceStorageConfigsNonCrrsClient object. - */ - public BackupResourceStorageConfigsNonCrrsClient getBackupResourceStorageConfigsNonCrrs() { - return this.backupResourceStorageConfigsNonCrrs; - } - - /** - * The BmsPrepareDataMoveOperationResultsClient object to access its operations. - */ - private final BmsPrepareDataMoveOperationResultsClient bmsPrepareDataMoveOperationResults; - - /** - * Gets the BmsPrepareDataMoveOperationResultsClient object to access its operations. - * - * @return the BmsPrepareDataMoveOperationResultsClient object. - */ - public BmsPrepareDataMoveOperationResultsClient getBmsPrepareDataMoveOperationResults() { - return this.bmsPrepareDataMoveOperationResults; - } - - /** - * The BackupResourceVaultConfigsClient object to access its operations. - */ - private final BackupResourceVaultConfigsClient backupResourceVaultConfigs; - - /** - * Gets the BackupResourceVaultConfigsClient object to access its operations. - * - * @return the BackupResourceVaultConfigsClient object. - */ - public BackupResourceVaultConfigsClient getBackupResourceVaultConfigs() { - return this.backupResourceVaultConfigs; - } - - /** - * The BackupResourceEncryptionConfigsClient object to access its operations. - */ - private final BackupResourceEncryptionConfigsClient backupResourceEncryptionConfigs; - - /** - * Gets the BackupResourceEncryptionConfigsClient object to access its operations. - * - * @return the BackupResourceEncryptionConfigsClient object. - */ - public BackupResourceEncryptionConfigsClient getBackupResourceEncryptionConfigs() { - return this.backupResourceEncryptionConfigs; - } - - /** - * The ProtectedItemsClient object to access its operations. - */ - private final ProtectedItemsClient protectedItems; - - /** - * Gets the ProtectedItemsClient object to access its operations. - * - * @return the ProtectedItemsClient object. - */ - public ProtectedItemsClient getProtectedItems() { - return this.protectedItems; - } - - /** - * The BackupsClient object to access its operations. - */ - private final BackupsClient backups; - - /** - * Gets the BackupsClient object to access its operations. - * - * @return the BackupsClient object. - */ - public BackupsClient getBackups() { - return this.backups; - } - - /** - * The RecoveryPointsRecommendedForMovesClient object to access its operations. - */ - private final RecoveryPointsRecommendedForMovesClient recoveryPointsRecommendedForMoves; - - /** - * Gets the RecoveryPointsRecommendedForMovesClient object to access its operations. - * - * @return the RecoveryPointsRecommendedForMovesClient object. - */ - public RecoveryPointsRecommendedForMovesClient getRecoveryPointsRecommendedForMoves() { - return this.recoveryPointsRecommendedForMoves; - } - - /** - * The ProtectedItemOperationStatusesClient object to access its operations. - */ - private final ProtectedItemOperationStatusesClient protectedItemOperationStatuses; - - /** - * Gets the ProtectedItemOperationStatusesClient object to access its operations. - * - * @return the ProtectedItemOperationStatusesClient object. - */ - public ProtectedItemOperationStatusesClient getProtectedItemOperationStatuses() { - return this.protectedItemOperationStatuses; - } - - /** - * The ProtectedItemOperationResultsClient object to access its operations. - */ - private final ProtectedItemOperationResultsClient protectedItemOperationResults; - - /** - * Gets the ProtectedItemOperationResultsClient object to access its operations. - * - * @return the ProtectedItemOperationResultsClient object. - */ - public ProtectedItemOperationResultsClient getProtectedItemOperationResults() { - return this.protectedItemOperationResults; - } - - /** - * The ProtectionContainersClient object to access its operations. - */ - private final ProtectionContainersClient protectionContainers; - - /** - * Gets the ProtectionContainersClient object to access its operations. - * - * @return the ProtectionContainersClient object. - */ - public ProtectionContainersClient getProtectionContainers() { - return this.protectionContainers; - } - - /** - * The BackupWorkloadItemsClient object to access its operations. - */ - private final BackupWorkloadItemsClient backupWorkloadItems; - - /** - * Gets the BackupWorkloadItemsClient object to access its operations. - * - * @return the BackupWorkloadItemsClient object. - */ - public BackupWorkloadItemsClient getBackupWorkloadItems() { - return this.backupWorkloadItems; - } - - /** - * The ProtectionContainerOperationResultsClient object to access its operations. - */ - private final ProtectionContainerOperationResultsClient protectionContainerOperationResults; - - /** - * Gets the ProtectionContainerOperationResultsClient object to access its operations. - * - * @return the ProtectionContainerOperationResultsClient object. - */ - public ProtectionContainerOperationResultsClient getProtectionContainerOperationResults() { - return this.protectionContainerOperationResults; - } - - /** - * The RecoveryPointsClient object to access its operations. - */ - private final RecoveryPointsClient recoveryPoints; - - /** - * Gets the RecoveryPointsClient object to access its operations. - * - * @return the RecoveryPointsClient object. - */ - public RecoveryPointsClient getRecoveryPoints() { - return this.recoveryPoints; - } - - /** - * The RestoresClient object to access its operations. - */ - private final RestoresClient restores; - - /** - * Gets the RestoresClient object to access its operations. - * - * @return the RestoresClient object. - */ - public RestoresClient getRestores() { - return this.restores; - } - - /** - * The ItemLevelRecoveryConnectionsClient object to access its operations. - */ - private final ItemLevelRecoveryConnectionsClient itemLevelRecoveryConnections; - - /** - * Gets the ItemLevelRecoveryConnectionsClient object to access its operations. - * - * @return the ItemLevelRecoveryConnectionsClient object. - */ - public ItemLevelRecoveryConnectionsClient getItemLevelRecoveryConnections() { - return this.itemLevelRecoveryConnections; - } - - /** - * The ProtectionPoliciesClient object to access its operations. - */ - private final ProtectionPoliciesClient protectionPolicies; - - /** - * Gets the ProtectionPoliciesClient object to access its operations. - * - * @return the ProtectionPoliciesClient object. - */ - public ProtectionPoliciesClient getProtectionPolicies() { - return this.protectionPolicies; - } - - /** - * The BackupPoliciesClient object to access its operations. - */ - private final BackupPoliciesClient backupPolicies; - - /** - * Gets the BackupPoliciesClient object to access its operations. - * - * @return the BackupPoliciesClient object. - */ - public BackupPoliciesClient getBackupPolicies() { - return this.backupPolicies; - } - - /** - * The ProtectionPolicyOperationResultsClient object to access its operations. - */ - private final ProtectionPolicyOperationResultsClient protectionPolicyOperationResults; - - /** - * Gets the ProtectionPolicyOperationResultsClient object to access its operations. - * - * @return the ProtectionPolicyOperationResultsClient object. - */ - public ProtectionPolicyOperationResultsClient getProtectionPolicyOperationResults() { - return this.protectionPolicyOperationResults; - } - - /** - * The ProtectionPolicyOperationStatusesClient object to access its operations. - */ - private final ProtectionPolicyOperationStatusesClient protectionPolicyOperationStatuses; - - /** - * Gets the ProtectionPolicyOperationStatusesClient object to access its operations. - * - * @return the ProtectionPolicyOperationStatusesClient object. - */ - public ProtectionPolicyOperationStatusesClient getProtectionPolicyOperationStatuses() { - return this.protectionPolicyOperationStatuses; - } - - /** - * The JobDetailsClient object to access its operations. - */ - private final JobDetailsClient jobDetails; - - /** - * Gets the JobDetailsClient object to access its operations. - * - * @return the JobDetailsClient object. - */ - public JobDetailsClient getJobDetails() { - return this.jobDetails; - } - - /** - * The BackupJobsClient object to access its operations. - */ - private final BackupJobsClient backupJobs; - - /** - * Gets the BackupJobsClient object to access its operations. - * - * @return the BackupJobsClient object. - */ - public BackupJobsClient getBackupJobs() { - return this.backupJobs; - } - - /** - * The JobCancellationsClient object to access its operations. - */ - private final JobCancellationsClient jobCancellations; - - /** - * Gets the JobCancellationsClient object to access its operations. - * - * @return the JobCancellationsClient object. - */ - public JobCancellationsClient getJobCancellations() { - return this.jobCancellations; - } - - /** - * The JobOperationResultsClient object to access its operations. - */ - private final JobOperationResultsClient jobOperationResults; - - /** - * Gets the JobOperationResultsClient object to access its operations. - * - * @return the JobOperationResultsClient object. - */ - public JobOperationResultsClient getJobOperationResults() { - return this.jobOperationResults; - } - - /** - * The ExportJobsOperationResultsClient object to access its operations. - */ - private final ExportJobsOperationResultsClient exportJobsOperationResults; - - /** - * Gets the ExportJobsOperationResultsClient object to access its operations. - * - * @return the ExportJobsOperationResultsClient object. - */ - public ExportJobsOperationResultsClient getExportJobsOperationResults() { - return this.exportJobsOperationResults; - } - - /** - * The BackupEnginesClient object to access its operations. - */ - private final BackupEnginesClient backupEngines; - - /** - * Gets the BackupEnginesClient object to access its operations. - * - * @return the BackupEnginesClient object. - */ - public BackupEnginesClient getBackupEngines() { - return this.backupEngines; - } - - /** - * The BackupStatusClient object to access its operations. - */ - private final BackupStatusClient backupStatus; - - /** - * Gets the BackupStatusClient object to access its operations. - * - * @return the BackupStatusClient object. - */ - public BackupStatusClient getBackupStatus() { - return this.backupStatus; - } - - /** - * The FeatureSupportsClient object to access its operations. - */ - private final FeatureSupportsClient featureSupports; - - /** - * Gets the FeatureSupportsClient object to access its operations. - * - * @return the FeatureSupportsClient object. - */ - public FeatureSupportsClient getFeatureSupports() { - return this.featureSupports; - } - - /** - * The BackupProtectionIntentsClient object to access its operations. - */ - private final BackupProtectionIntentsClient backupProtectionIntents; - - /** - * Gets the BackupProtectionIntentsClient object to access its operations. - * - * @return the BackupProtectionIntentsClient object. - */ - public BackupProtectionIntentsClient getBackupProtectionIntents() { - return this.backupProtectionIntents; - } - - /** - * The BackupUsageSummariesClient object to access its operations. - */ - private final BackupUsageSummariesClient backupUsageSummaries; - - /** - * Gets the BackupUsageSummariesClient object to access its operations. - * - * @return the BackupUsageSummariesClient object. - */ - public BackupUsageSummariesClient getBackupUsageSummaries() { - return this.backupUsageSummaries; - } - - /** - * The JobsClient object to access its operations. - */ - private final JobsClient jobs; - - /** - * Gets the JobsClient object to access its operations. - * - * @return the JobsClient object. - */ - public JobsClient getJobs() { - return this.jobs; - } - - /** - * The BackupProtectedItemsClient object to access its operations. - */ - private final BackupProtectedItemsClient backupProtectedItems; - - /** - * Gets the BackupProtectedItemsClient object to access its operations. - * - * @return the BackupProtectedItemsClient object. - */ - public BackupProtectedItemsClient getBackupProtectedItems() { - return this.backupProtectedItems; - } - - /** - * The ValidateOperationsClient object to access its operations. - */ - private final ValidateOperationsClient validateOperations; - - /** - * Gets the ValidateOperationsClient object to access its operations. - * - * @return the ValidateOperationsClient object. - */ - public ValidateOperationsClient getValidateOperations() { - return this.validateOperations; - } - - /** - * The ValidateOperationResultsClient object to access its operations. - */ - private final ValidateOperationResultsClient validateOperationResults; - - /** - * Gets the ValidateOperationResultsClient object to access its operations. - * - * @return the ValidateOperationResultsClient object. - */ - public ValidateOperationResultsClient getValidateOperationResults() { - return this.validateOperationResults; - } - - /** - * The ValidateOperationStatusesClient object to access its operations. - */ - private final ValidateOperationStatusesClient validateOperationStatuses; - - /** - * Gets the ValidateOperationStatusesClient object to access its operations. - * - * @return the ValidateOperationStatusesClient object. - */ - public ValidateOperationStatusesClient getValidateOperationStatuses() { - return this.validateOperationStatuses; - } - - /** - * The ProtectionContainerRefreshOperationResultsClient object to access its operations. - */ - private final ProtectionContainerRefreshOperationResultsClient protectionContainerRefreshOperationResults; - - /** - * Gets the ProtectionContainerRefreshOperationResultsClient object to access its operations. - * - * @return the ProtectionContainerRefreshOperationResultsClient object. - */ - public ProtectionContainerRefreshOperationResultsClient getProtectionContainerRefreshOperationResults() { - return this.protectionContainerRefreshOperationResults; - } - - /** - * The ProtectableContainersClient object to access its operations. - */ - private final ProtectableContainersClient protectableContainers; - - /** - * Gets the ProtectableContainersClient object to access its operations. - * - * @return the ProtectableContainersClient object. - */ - public ProtectableContainersClient getProtectableContainers() { - return this.protectableContainers; - } - - /** - * The BackupOperationResultsClient object to access its operations. - */ - private final BackupOperationResultsClient backupOperationResults; - - /** - * Gets the BackupOperationResultsClient object to access its operations. - * - * @return the BackupOperationResultsClient object. - */ - public BackupOperationResultsClient getBackupOperationResults() { - return this.backupOperationResults; - } - - /** - * The BackupOperationStatusesClient object to access its operations. - */ - private final BackupOperationStatusesClient backupOperationStatuses; - - /** - * Gets the BackupOperationStatusesClient object to access its operations. - * - * @return the BackupOperationStatusesClient object. - */ - public BackupOperationStatusesClient getBackupOperationStatuses() { - return this.backupOperationStatuses; - } - - /** - * The BackupProtectableItemsClient object to access its operations. - */ - private final BackupProtectableItemsClient backupProtectableItems; - - /** - * Gets the BackupProtectableItemsClient object to access its operations. - * - * @return the BackupProtectableItemsClient object. - */ - public BackupProtectableItemsClient getBackupProtectableItems() { - return this.backupProtectableItems; - } - - /** - * The BackupProtectionContainersClient object to access its operations. - */ - private final BackupProtectionContainersClient backupProtectionContainers; - - /** - * Gets the BackupProtectionContainersClient object to access its operations. - * - * @return the BackupProtectionContainersClient object. - */ - public BackupProtectionContainersClient getBackupProtectionContainers() { - return this.backupProtectionContainers; - } - - /** - * The DeletedProtectionContainersClient object to access its operations. - */ - private final DeletedProtectionContainersClient deletedProtectionContainers; - - /** - * Gets the DeletedProtectionContainersClient object to access its operations. - * - * @return the DeletedProtectionContainersClient object. - */ - public DeletedProtectionContainersClient getDeletedProtectionContainers() { - return this.deletedProtectionContainers; - } - - /** - * The SecurityPINsClient object to access its operations. - */ - private final SecurityPINsClient securityPINs; - - /** - * Gets the SecurityPINsClient object to access its operations. - * - * @return the SecurityPINsClient object. - */ - public SecurityPINsClient getSecurityPINs() { - return this.securityPINs; - } - - /** - * The FetchTieringCostsClient object to access its operations. - */ - private final FetchTieringCostsClient fetchTieringCosts; - - /** - * Gets the FetchTieringCostsClient object to access its operations. - * - * @return the FetchTieringCostsClient object. - */ - public FetchTieringCostsClient getFetchTieringCosts() { - return this.fetchTieringCosts; - } - - /** - * The GetTieringCostOperationResultsClient object to access its operations. - */ - private final GetTieringCostOperationResultsClient getTieringCostOperationResults; - - /** - * Gets the GetTieringCostOperationResultsClient object to access its operations. - * - * @return the GetTieringCostOperationResultsClient object. - */ - public GetTieringCostOperationResultsClient getGetTieringCostOperationResults() { - return this.getTieringCostOperationResults; - } - - /** - * The TieringCostOperationStatusClient object to access its operations. - */ - private final TieringCostOperationStatusClient tieringCostOperationStatus; - - /** - * Gets the TieringCostOperationStatusClient object to access its operations. - * - * @return the TieringCostOperationStatusClient object. - */ - public TieringCostOperationStatusClient getTieringCostOperationStatus() { - return this.tieringCostOperationStatus; - } - - /** - * The ProtectionIntentsClient object to access its operations. - */ - private final ProtectionIntentsClient protectionIntents; - - /** - * Gets the ProtectionIntentsClient object to access its operations. - * - * @return the ProtectionIntentsClient object. - */ - public ProtectionIntentsClient getProtectionIntents() { - return this.protectionIntents; - } - - /** - * The PrivateEndpointConnectionsClient object to access its operations. - */ - private final PrivateEndpointConnectionsClient privateEndpointConnections; - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** - * The PrivateEndpointsClient object to access its operations. - */ - private final PrivateEndpointsClient privateEndpoints; - - /** - * Gets the PrivateEndpointsClient object to access its operations. - * - * @return the PrivateEndpointsClient object. - */ - public PrivateEndpointsClient getPrivateEndpoints() { - return this.privateEndpoints; - } - - /** - * The ResourceGuardProxyOperationsClient object to access its operations. - */ - private final ResourceGuardProxyOperationsClient resourceGuardProxyOperations; - - /** - * Gets the ResourceGuardProxyOperationsClient object to access its operations. - * - * @return the ResourceGuardProxyOperationsClient object. - */ - public ResourceGuardProxyOperationsClient getResourceGuardProxyOperations() { - return this.resourceGuardProxyOperations; - } - - /** - * The OperationOperationsClient object to access its operations. - */ - private final OperationOperationsClient operationOperations; - - /** - * Gets the OperationOperationsClient object to access its operations. - * - * @return the OperationOperationsClient object. - */ - public OperationOperationsClient getOperationOperations() { - return this.operationOperations; - } - - /** - * Initializes an instance of RecoveryServicesBackupManagementClient 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 endpoint Service host. - * @param subscriptionId The ID of the target subscription. The value must be an UUID. - */ - RecoveryServicesBackupManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.endpoint = endpoint; - this.subscriptionId = subscriptionId; - this.apiVersion = "2026-01-31-preview"; - this.resourceProviders = new ResourceProvidersClientImpl(this); - this.operations = new OperationsClientImpl(this); - this.backupResourceStorageConfigsNonCrrs = new BackupResourceStorageConfigsNonCrrsClientImpl(this); - this.bmsPrepareDataMoveOperationResults = new BmsPrepareDataMoveOperationResultsClientImpl(this); - this.backupResourceVaultConfigs = new BackupResourceVaultConfigsClientImpl(this); - this.backupResourceEncryptionConfigs = new BackupResourceEncryptionConfigsClientImpl(this); - this.protectedItems = new ProtectedItemsClientImpl(this); - this.backups = new BackupsClientImpl(this); - this.recoveryPointsRecommendedForMoves = new RecoveryPointsRecommendedForMovesClientImpl(this); - this.protectedItemOperationStatuses = new ProtectedItemOperationStatusesClientImpl(this); - this.protectedItemOperationResults = new ProtectedItemOperationResultsClientImpl(this); - this.protectionContainers = new ProtectionContainersClientImpl(this); - this.backupWorkloadItems = new BackupWorkloadItemsClientImpl(this); - this.protectionContainerOperationResults = new ProtectionContainerOperationResultsClientImpl(this); - this.recoveryPoints = new RecoveryPointsClientImpl(this); - this.restores = new RestoresClientImpl(this); - this.itemLevelRecoveryConnections = new ItemLevelRecoveryConnectionsClientImpl(this); - this.protectionPolicies = new ProtectionPoliciesClientImpl(this); - this.backupPolicies = new BackupPoliciesClientImpl(this); - this.protectionPolicyOperationResults = new ProtectionPolicyOperationResultsClientImpl(this); - this.protectionPolicyOperationStatuses = new ProtectionPolicyOperationStatusesClientImpl(this); - this.jobDetails = new JobDetailsClientImpl(this); - this.backupJobs = new BackupJobsClientImpl(this); - this.jobCancellations = new JobCancellationsClientImpl(this); - this.jobOperationResults = new JobOperationResultsClientImpl(this); - this.exportJobsOperationResults = new ExportJobsOperationResultsClientImpl(this); - this.backupEngines = new BackupEnginesClientImpl(this); - this.backupStatus = new BackupStatusClientImpl(this); - this.featureSupports = new FeatureSupportsClientImpl(this); - this.backupProtectionIntents = new BackupProtectionIntentsClientImpl(this); - this.backupUsageSummaries = new BackupUsageSummariesClientImpl(this); - this.jobs = new JobsClientImpl(this); - this.backupProtectedItems = new BackupProtectedItemsClientImpl(this); - this.validateOperations = new ValidateOperationsClientImpl(this); - this.validateOperationResults = new ValidateOperationResultsClientImpl(this); - this.validateOperationStatuses = new ValidateOperationStatusesClientImpl(this); - this.protectionContainerRefreshOperationResults - = new ProtectionContainerRefreshOperationResultsClientImpl(this); - this.protectableContainers = new ProtectableContainersClientImpl(this); - this.backupOperationResults = new BackupOperationResultsClientImpl(this); - this.backupOperationStatuses = new BackupOperationStatusesClientImpl(this); - this.backupProtectableItems = new BackupProtectableItemsClientImpl(this); - this.backupProtectionContainers = new BackupProtectionContainersClientImpl(this); - this.deletedProtectionContainers = new DeletedProtectionContainersClientImpl(this); - this.securityPINs = new SecurityPINsClientImpl(this); - this.fetchTieringCosts = new FetchTieringCostsClientImpl(this); - this.getTieringCostOperationResults = new GetTieringCostOperationResultsClientImpl(this); - this.tieringCostOperationStatus = new TieringCostOperationStatusClientImpl(this); - this.protectionIntents = new ProtectionIntentsClientImpl(this); - this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); - this.privateEndpoints = new PrivateEndpointsClientImpl(this); - this.resourceGuardProxyOperations = new ResourceGuardProxyOperationsClientImpl(this); - this.operationOperations = new OperationOperationsClientImpl(this); - } - - /** - * Gets default client context. - * - * @return the default client context. - */ - public Context getContext() { - return Context.NONE; - } - - /** - * Merges default client context with provided context. - * - * @param context the context to be merged with default client context. - * @return the merged context. - */ - public Context mergeContext(Context context) { - return CoreUtils.mergeContexts(this.getContext(), context); - } - - /** - * Gets long running operation result. - * - * @param activationResponse the response of activation operation. - * @param httpPipeline the http pipeline. - * @param pollResultType type of poll result. - * @param finalResultType type of final result. - * @param context the context shared by all requests. - * @param type of poll result. - * @param type of final result. - * @return poller flux for poll result and final result. - */ - public PollerFlux, U> getLroResult(Mono>> activationResponse, - HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { - return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, - defaultPollInterval, activationResponse, context); - } - - /** - * Gets long running operation result. - * - * @param activationResponse the response of activation operation. - * @param pollResultType type of poll result. - * @param finalResultType type of final result. - * @param context the context shared by all requests. - * @param 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. - * - * @param response the last async poll response. - * @param type of poll result. - * @param type of final result. - * @return the final result, or an error. - */ - public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { - if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { - String errorMessage; - ManagementError managementError = null; - HttpResponse errorResponse = null; - PollResult.Error lroError = response.getValue().getError(); - if (lroError != null) { - errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), - lroError.getResponseBody()); - - errorMessage = response.getValue().getError().getMessage(); - String errorBody = response.getValue().getError().getResponseBody(); - if (errorBody != null) { - // try to deserialize error body to ManagementError - try { - managementError = this.getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); - if (managementError.getCode() == null || managementError.getMessage() == null) { - managementError = null; - } - } catch (IOException | RuntimeException ioe) { - LOGGER.logThrowableAsWarning(ioe); - } - } - } else { - // fallback to default error message - errorMessage = "Long running operation failed."; - } - if (managementError == null) { - // fallback to default ManagementError - managementError = new ManagementError(response.getStatus().toString(), errorMessage); - } - return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); - } else { - return response.getFinalResult(); - } - } - - private static final class HttpResponseImpl extends HttpResponse { - private final int statusCode; - - private final byte[] responseBody; - - private final HttpHeaders httpHeaders; - - HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { - super(null); - this.statusCode = statusCode; - this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? new byte[0] : responseBody.getBytes(StandardCharsets.UTF_8); - } - - public int getStatusCode() { - return statusCode; - } - - public String getHeaderValue(String s) { - return httpHeaders.getValue(HttpHeaderName.fromString(s)); - } - - public HttpHeaders getHeaders() { - return httpHeaders; - } - - public Flux getBody() { - return Flux.just(ByteBuffer.wrap(responseBody)); - } - - public Mono getBodyAsByteArray() { - return Mono.just(responseBody); - } - - public Mono getBodyAsString() { - return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); - } - - public Mono getBodyAsString(Charset charset) { - return Mono.just(new String(responseBody, charset)); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(RecoveryServicesBackupManagementClientImpl.class); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyBaseResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyBaseResourceImpl.java deleted file mode 100644 index 044d746b7abb..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyBaseResourceImpl.java +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ResourceGuardProxyBaseResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceGuardProxyBase; -import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceGuardProxyBaseResource; -import com.azure.resourcemanager.recoveryservicesbackup.models.UnlockDeleteRequest; -import com.azure.resourcemanager.recoveryservicesbackup.models.UnlockDeleteResponse; -import java.util.Collections; -import java.util.Map; - -public final class ResourceGuardProxyBaseResourceImpl implements ResourceGuardProxyBaseResource, - ResourceGuardProxyBaseResource.Definition, ResourceGuardProxyBaseResource.Update { - private ResourceGuardProxyBaseResourceInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public ResourceGuardProxyBase properties() { - return this.innerModel().properties(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String location() { - return this.innerModel().location(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public ResourceGuardProxyBaseResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } - - private String vaultName; - - private String resourceGroupName; - - private String resourceGuardProxyName; - - public ResourceGuardProxyBaseResourceImpl withExistingVault(String vaultName, String resourceGroupName) { - this.vaultName = vaultName; - this.resourceGroupName = resourceGroupName; - return this; - } - - public ResourceGuardProxyBaseResource create() { - this.innerObject = serviceManager.serviceClient() - .getResourceGuardProxyOperations() - .putWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public ResourceGuardProxyBaseResource create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getResourceGuardProxyOperations() - .putWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, this.innerModel(), context) - .getValue(); - return this; - } - - ResourceGuardProxyBaseResourceImpl(String name, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = new ResourceGuardProxyBaseResourceInner(); - this.serviceManager = serviceManager; - this.resourceGuardProxyName = name; - } - - public ResourceGuardProxyBaseResourceImpl update() { - return this; - } - - public ResourceGuardProxyBaseResource apply() { - this.innerObject = serviceManager.serviceClient() - .getResourceGuardProxyOperations() - .putWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public ResourceGuardProxyBaseResource apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getResourceGuardProxyOperations() - .putWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, this.innerModel(), context) - .getValue(); - return this; - } - - ResourceGuardProxyBaseResourceImpl(ResourceGuardProxyBaseResourceInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.vaultName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "vaults"); - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.resourceGuardProxyName - = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "backupResourceGuardProxies"); - } - - public ResourceGuardProxyBaseResource refresh() { - this.innerObject = serviceManager.serviceClient() - .getResourceGuardProxyOperations() - .getWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, Context.NONE) - .getValue(); - return this; - } - - public ResourceGuardProxyBaseResource refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getResourceGuardProxyOperations() - .getWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, context) - .getValue(); - return this; - } - - public Response unlockDeleteWithResponse(UnlockDeleteRequest parameters, Context context) { - return serviceManager.resourceGuardProxyOperations() - .unlockDeleteWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, parameters, context); - } - - public UnlockDeleteResponse unlockDelete(UnlockDeleteRequest parameters) { - return serviceManager.resourceGuardProxyOperations() - .unlockDelete(vaultName, resourceGroupName, resourceGuardProxyName, parameters); - } - - public ResourceGuardProxyBaseResourceImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public ResourceGuardProxyBaseResourceImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public ResourceGuardProxyBaseResourceImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public ResourceGuardProxyBaseResourceImpl withProperties(ResourceGuardProxyBase properties) { - this.innerModel().withProperties(properties); - return this; - } - - public ResourceGuardProxyBaseResourceImpl withEtag(String etag) { - this.innerModel().withEtag(etag); - return this; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyOperationsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyOperationsClientImpl.java deleted file mode 100644 index 06abb1320cdf..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyOperationsClientImpl.java +++ /dev/null @@ -1,675 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ResourceGuardProxyOperationsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ResourceGuardProxyBaseResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.UnlockDeleteResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.ResourceGuardProxyBaseResourceList; -import com.azure.resourcemanager.recoveryservicesbackup.models.UnlockDeleteRequest; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ResourceGuardProxyOperationsClient. - */ -public final class ResourceGuardProxyOperationsClientImpl implements ResourceGuardProxyOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ResourceGuardProxyOperationsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of ResourceGuardProxyOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ResourceGuardProxyOperationsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(ResourceGuardProxyOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientResourceGuardProxyOperations to - * be used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientResourceGuardProxyOperations") - public interface ResourceGuardProxyOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("resourceGuardProxyName") String resourceGuardProxyName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("resourceGuardProxyName") String resourceGuardProxyName, @HeaderParam("Accept") String accept, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> put(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("resourceGuardProxyName") String resourceGuardProxyName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ResourceGuardProxyBaseResourceInner parameters, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response putSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("resourceGuardProxyName") String resourceGuardProxyName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ResourceGuardProxyBaseResourceInner parameters, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("resourceGuardProxyName") String resourceGuardProxyName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("resourceGuardProxyName") String resourceGuardProxyName, Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}/unlockDelete") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> unlockDelete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("resourceGuardProxyName") String resourceGuardProxyName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") UnlockDeleteRequest parameters, Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}/unlockDelete") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response unlockDeleteSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("resourceGuardProxyName") String resourceGuardProxyName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") UnlockDeleteRequest parameters, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Returns ResourceGuardProxy under vault and with the name referenced in request. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName 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} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, - String resourceGroupName, String resourceGuardProxyName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, resourceGuardProxyName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns ResourceGuardProxy under vault and with the name referenced in request. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName, - String resourceGuardProxyName) { - return getWithResponseAsync(vaultName, resourceGroupName, resourceGuardProxyName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns ResourceGuardProxy under vault and with the name referenced in request. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName 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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, - String resourceGuardProxyName, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, resourceGuardProxyName, accept, context); - } - - /** - * Returns ResourceGuardProxy under vault and with the name referenced in request. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceGuardProxyBaseResourceInner get(String vaultName, String resourceGroupName, - String resourceGuardProxyName) { - return getWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, Context.NONE).getValue(); - } - - /** - * Add or Update ResourceGuardProxy under vault - * Secures vault critical operations. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName parameter. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> putWithResponseAsync(String vaultName, - String resourceGroupName, String resourceGuardProxyName, ResourceGuardProxyBaseResourceInner parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.put(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, resourceGuardProxyName, contentType, - accept, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Add or Update ResourceGuardProxy under vault - * Secures vault critical operations. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName parameter. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono putAsync(String vaultName, String resourceGroupName, - String resourceGuardProxyName, ResourceGuardProxyBaseResourceInner parameters) { - return putWithResponseAsync(vaultName, resourceGroupName, resourceGuardProxyName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Add or Update ResourceGuardProxy under vault - * Secures vault critical operations. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName parameter. - * @param parameters Request body for operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response putWithResponse(String vaultName, String resourceGroupName, - String resourceGuardProxyName, ResourceGuardProxyBaseResourceInner parameters, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.putSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, resourceGuardProxyName, contentType, accept, parameters, context); - } - - /** - * Add or Update ResourceGuardProxy under vault - * Secures vault critical operations. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName parameter. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceGuardProxyBaseResourceInner put(String vaultName, String resourceGroupName, - String resourceGuardProxyName, ResourceGuardProxyBaseResourceInner parameters) { - return putWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, parameters, Context.NONE) - .getValue(); - } - - /** - * Delete ResourceGuardProxy under vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName 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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String vaultName, String resourceGroupName, - String resourceGuardProxyName) { - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, resourceGuardProxyName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete ResourceGuardProxy under vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName 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 deleteAsync(String vaultName, String resourceGroupName, String resourceGuardProxyName) { - return deleteWithResponseAsync(vaultName, resourceGroupName, resourceGuardProxyName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Delete ResourceGuardProxy under vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName 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 Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String vaultName, String resourceGroupName, String resourceGuardProxyName, - Context context) { - return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, resourceGuardProxyName, context); - } - - /** - * Delete ResourceGuardProxy under vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String vaultName, String resourceGroupName, String resourceGuardProxyName) { - deleteWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, Context.NONE); - } - - /** - * Secures delete ResourceGuardProxy operations. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName parameter. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of Unlock Delete API along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> unlockDeleteWithResponseAsync(String vaultName, - String resourceGroupName, String resourceGuardProxyName, UnlockDeleteRequest parameters) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.unlockDelete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, resourceGuardProxyName, contentType, - accept, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Secures delete ResourceGuardProxy operations. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName parameter. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of Unlock Delete API on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono unlockDeleteAsync(String vaultName, String resourceGroupName, - String resourceGuardProxyName, UnlockDeleteRequest parameters) { - return unlockDeleteWithResponseAsync(vaultName, resourceGroupName, resourceGuardProxyName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Secures delete ResourceGuardProxy operations. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName parameter. - * @param parameters Request body for operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of Unlock Delete API along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response unlockDeleteWithResponse(String vaultName, String resourceGroupName, - String resourceGuardProxyName, UnlockDeleteRequest parameters, Context context) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.unlockDeleteSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, resourceGuardProxyName, contentType, accept, - parameters, context); - } - - /** - * Secures delete ResourceGuardProxy operations. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName parameter. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of Unlock Delete API. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UnlockDeleteResponseInner unlockDelete(String vaultName, String resourceGroupName, - String resourceGuardProxyName, UnlockDeleteRequest parameters) { - return unlockDeleteWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, parameters, Context.NONE) - .getValue(); - } - - /** - * List the ResourceGuardProxies under vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ResourceGuardProxyBase resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String vaultName, - String resourceGroupName) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List the ResourceGuardProxies under vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ResourceGuardProxyBase resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String vaultName, String resourceGroupName) { - return new PagedFlux<>(() -> listSinglePageAsync(vaultName, resourceGroupName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List the ResourceGuardProxies under vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ResourceGuardProxyBase resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, - String resourceGroupName) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List the ResourceGuardProxies under vault. - * - * @param vaultName The name of the VaultResource. - * @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 list of ResourceGuardProxyBase resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String vaultName, - String resourceGroupName, Context context) { - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * List the ResourceGuardProxies under vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ResourceGuardProxyBase resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName) { - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * List the ResourceGuardProxies under vault. - * - * @param vaultName The name of the VaultResource. - * @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 list of ResourceGuardProxyBase resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String vaultName, String resourceGroupName, - Context context) { - return new PagedIterable<>(() -> listSinglePage(vaultName, resourceGroupName, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ResourceGuardProxyBase resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ResourceGuardProxyBase resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ResourceGuardProxyBase resources along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyOperationsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyOperationsImpl.java deleted file mode 100644 index 852b298d10a3..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceGuardProxyOperationsImpl.java +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ResourceGuardProxyOperationsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ResourceGuardProxyBaseResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.UnlockDeleteResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceGuardProxyBaseResource; -import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceGuardProxyOperations; -import com.azure.resourcemanager.recoveryservicesbackup.models.UnlockDeleteRequest; -import com.azure.resourcemanager.recoveryservicesbackup.models.UnlockDeleteResponse; - -public final class ResourceGuardProxyOperationsImpl implements ResourceGuardProxyOperations { - private static final ClientLogger LOGGER = new ClientLogger(ResourceGuardProxyOperationsImpl.class); - - private final ResourceGuardProxyOperationsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public ResourceGuardProxyOperationsImpl(ResourceGuardProxyOperationsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, - String resourceGuardProxyName, Context context) { - Response inner - = this.serviceClient().getWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ResourceGuardProxyBaseResourceImpl(inner.getValue(), this.manager())); - } - - public ResourceGuardProxyBaseResource get(String vaultName, String resourceGroupName, - String resourceGuardProxyName) { - ResourceGuardProxyBaseResourceInner inner - = this.serviceClient().get(vaultName, resourceGroupName, resourceGuardProxyName); - if (inner != null) { - return new ResourceGuardProxyBaseResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String vaultName, String resourceGroupName, String resourceGuardProxyName, - Context context) { - return this.serviceClient().deleteWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, context); - } - - public void delete(String vaultName, String resourceGroupName, String resourceGuardProxyName) { - this.serviceClient().delete(vaultName, resourceGroupName, resourceGuardProxyName); - } - - public Response unlockDeleteWithResponse(String vaultName, String resourceGroupName, - String resourceGuardProxyName, UnlockDeleteRequest parameters, Context context) { - Response inner = this.serviceClient() - .unlockDeleteWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, parameters, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new UnlockDeleteResponseImpl(inner.getValue(), this.manager())); - } - - public UnlockDeleteResponse unlockDelete(String vaultName, String resourceGroupName, String resourceGuardProxyName, - UnlockDeleteRequest parameters) { - UnlockDeleteResponseInner inner - = this.serviceClient().unlockDelete(vaultName, resourceGroupName, resourceGuardProxyName, parameters); - if (inner != null) { - return new UnlockDeleteResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String vaultName, String resourceGroupName) { - PagedIterable inner - = this.serviceClient().list(vaultName, resourceGroupName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ResourceGuardProxyBaseResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String vaultName, String resourceGroupName, - Context context) { - PagedIterable inner - = this.serviceClient().list(vaultName, resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ResourceGuardProxyBaseResourceImpl(inner1, this.manager())); - } - - public ResourceGuardProxyBaseResource getById(String id) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 resourceGuardProxyName = ResourceManagerUtils.getValueFromIdByName(id, "backupResourceGuardProxies"); - if (resourceGuardProxyName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'backupResourceGuardProxies'.", id))); - } - return this.getWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 resourceGuardProxyName = ResourceManagerUtils.getValueFromIdByName(id, "backupResourceGuardProxies"); - if (resourceGuardProxyName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'backupResourceGuardProxies'.", id))); - } - return this.getWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, context); - } - - public void deleteById(String id) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 resourceGuardProxyName = ResourceManagerUtils.getValueFromIdByName(id, "backupResourceGuardProxies"); - if (resourceGuardProxyName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'backupResourceGuardProxies'.", id))); - } - this.deleteWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); - if (vaultName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); - } - String 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 resourceGuardProxyName = ResourceManagerUtils.getValueFromIdByName(id, "backupResourceGuardProxies"); - if (resourceGuardProxyName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'backupResourceGuardProxies'.", id))); - } - return this.deleteWithResponse(vaultName, resourceGroupName, resourceGuardProxyName, context); - } - - private ResourceGuardProxyOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } - - public ResourceGuardProxyBaseResourceImpl define(String name) { - return new ResourceGuardProxyBaseResourceImpl(name, this.manager()); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceManagerUtils.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceManagerUtils.java deleted file mode 100644 index 268452a916c1..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceManagerUtils.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -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.util.CoreUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import reactor.core.publisher.Flux; - -final class ResourceManagerUtils { - private ResourceManagerUtils() { - } - - static String getValueFromIdByName(String id, String name) { - if (id == null) { - return null; - } - Iterator itr = Arrays.stream(id.split("/")).iterator(); - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && !part.trim().isEmpty()) { - if (part.equalsIgnoreCase(name)) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } - } - } - } - return null; - } - - static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { - if (id == null || pathTemplate == null) { - return null; - } - String parameterNameParentheses = "{" + parameterName + "}"; - List idSegmentsReverted = Arrays.asList(id.split("/")); - List pathSegments = Arrays.asList(pathTemplate.split("/")); - Collections.reverse(idSegmentsReverted); - Iterator idItrReverted = idSegmentsReverted.iterator(); - int pathIndex = pathSegments.size(); - while (idItrReverted.hasNext() && pathIndex > 0) { - String idSegment = idItrReverted.next(); - String pathSegment = pathSegments.get(--pathIndex); - if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { - if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { - if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { - List segments = new ArrayList<>(); - segments.add(idSegment); - idItrReverted.forEachRemaining(segments::add); - Collections.reverse(segments); - if (!segments.isEmpty() && segments.get(0).isEmpty()) { - segments.remove(0); - } - return String.join("/", segments); - } else { - return idSegment; - } - } - } - } - return null; - } - - static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl<>(pageIterable, mapper); - } - - private static final class PagedIterableImpl extends PagedIterable { - - private final PagedIterable pagedIterable; - private final Function mapper; - private final Function, PagedResponse> pageMapper; - - private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux - .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); - this.pagedIterable = pagedIterable; - this.mapper = mapper; - this.pageMapper = getPageMapper(mapper); - } - - private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), - null); - } - - @Override - public Stream stream() { - return pagedIterable.stream().map(mapper); - } - - @Override - public Stream> streamByPage() { - return pagedIterable.streamByPage().map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken) { - return pagedIterable.streamByPage(continuationToken).map(pageMapper); - } - - @Override - public Stream> streamByPage(int preferredPageSize) { - return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken, int preferredPageSize) { - return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); - } - - @Override - public Iterator iterator() { - return new IteratorImpl<>(pagedIterable.iterator(), mapper); - } - - @Override - public Iterable> iterableByPage() { - return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); - } - - @Override - public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); - } - } - - private static final class IteratorImpl implements Iterator { - - private final Iterator iterator; - private final Function mapper; - - private IteratorImpl(Iterator iterator, Function mapper) { - this.iterator = iterator; - this.mapper = mapper; - } - - @Override - public boolean hasNext() { - return iterator.hasNext(); - } - - @Override - public S next() { - return mapper.apply(iterator.next()); - } - - @Override - public void remove() { - iterator.remove(); - } - } - - private static final class IterableImpl implements Iterable { - - private final Iterable iterable; - private final Function mapper; - - private IterableImpl(Iterable iterable, Function mapper) { - this.iterable = iterable; - this.mapper = mapper; - } - - @Override - public Iterator iterator() { - return new IteratorImpl<>(iterable.iterator(), mapper); - } - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceProvidersClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceProvidersClientImpl.java deleted file mode 100644 index 36e3c2ddbe1d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceProvidersClientImpl.java +++ /dev/null @@ -1,781 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ResourceProvidersClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.MoveRPAcrossTiersRequest; -import com.azure.resourcemanager.recoveryservicesbackup.models.PrepareDataMoveRequest; -import com.azure.resourcemanager.recoveryservicesbackup.models.TriggerDataMoveRequest; -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 ResourceProvidersClient. - */ -public final class ResourceProvidersClientImpl implements ResourceProvidersClient { - /** - * The proxy service used to perform REST calls. - */ - private final ResourceProvidersService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of ResourceProvidersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ResourceProvidersClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service - = RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientResourceProviders to be used by - * the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientResourceProviders") - public interface ResourceProvidersService { - @Headers({ "Accept: application/json;q=0.9" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/prepareDataMove") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> bmsPrepareDataMove(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") PrepareDataMoveRequest parameters, Context context); - - @Headers({ "Accept: application/json;q=0.9" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/prepareDataMove") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response bmsPrepareDataMoveSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") PrepareDataMoveRequest parameters, Context context); - - @Headers({ "Accept: application/json;q=0.9" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/triggerDataMove") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> bmsTriggerDataMove(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") TriggerDataMoveRequest parameters, Context context); - - @Headers({ "Accept: application/json;q=0.9" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/triggerDataMove") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response bmsTriggerDataMoveSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") TriggerDataMoveRequest parameters, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/operationStatus/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getOperationStatus(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/operationStatus/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getOperationStatusSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/move") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> moveRecoveryPoint(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, - @PathParam("recoveryPointId") String recoveryPointId, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") MoveRPAcrossTiersRequest parameters, Context context); - - @Headers({ "Accept: application/json;q=0.9" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/move") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response moveRecoveryPointSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, - @PathParam("recoveryPointId") String recoveryPointId, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") MoveRPAcrossTiersRequest parameters, Context context); - } - - /** - * Prepares source vault for Data Move operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Prepare data move request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> bmsPrepareDataMoveWithResponseAsync(String vaultName, - String resourceGroupName, PrepareDataMoveRequest parameters) { - final String contentType = "application/json"; - return FluxUtil - .withContext(context -> service.bmsPrepareDataMove(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, contentType, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Prepares source vault for Data Move operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Prepare data move request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response bmsPrepareDataMoveWithResponse(String vaultName, String resourceGroupName, - PrepareDataMoveRequest parameters) { - final String contentType = "application/json"; - return service.bmsPrepareDataMoveSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, contentType, parameters, Context.NONE); - } - - /** - * Prepares source vault for Data Move operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Prepare data move request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response bmsPrepareDataMoveWithResponse(String vaultName, String resourceGroupName, - PrepareDataMoveRequest parameters, Context context) { - final String contentType = "application/json"; - return service.bmsPrepareDataMoveSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, contentType, parameters, context); - } - - /** - * Prepares source vault for Data Move operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Prepare data move request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginBmsPrepareDataMoveAsync(String vaultName, String resourceGroupName, - PrepareDataMoveRequest parameters) { - Mono>> mono - = bmsPrepareDataMoveWithResponseAsync(vaultName, resourceGroupName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Prepares source vault for Data Move operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Prepare data move request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginBmsPrepareDataMove(String vaultName, String resourceGroupName, - PrepareDataMoveRequest parameters) { - Response response = bmsPrepareDataMoveWithResponse(vaultName, resourceGroupName, parameters); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Prepares source vault for Data Move operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Prepare data move request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginBmsPrepareDataMove(String vaultName, String resourceGroupName, - PrepareDataMoveRequest parameters, Context context) { - Response response - = bmsPrepareDataMoveWithResponse(vaultName, resourceGroupName, parameters, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Prepares source vault for Data Move operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Prepare data move request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono bmsPrepareDataMoveAsync(String vaultName, String resourceGroupName, - PrepareDataMoveRequest parameters) { - return beginBmsPrepareDataMoveAsync(vaultName, resourceGroupName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Prepares source vault for Data Move operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Prepare data move request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void bmsPrepareDataMove(String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters) { - beginBmsPrepareDataMove(vaultName, resourceGroupName, parameters).getFinalResult(); - } - - /** - * Prepares source vault for Data Move operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Prepare data move request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void bmsPrepareDataMove(String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters, - Context context) { - beginBmsPrepareDataMove(vaultName, resourceGroupName, parameters, context).getFinalResult(); - } - - /** - * Triggers Data Move Operation on target vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Trigger data move request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> bmsTriggerDataMoveWithResponseAsync(String vaultName, - String resourceGroupName, TriggerDataMoveRequest parameters) { - final String contentType = "application/json"; - return FluxUtil - .withContext(context -> service.bmsTriggerDataMove(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, contentType, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Triggers Data Move Operation on target vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Trigger data move request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response bmsTriggerDataMoveWithResponse(String vaultName, String resourceGroupName, - TriggerDataMoveRequest parameters) { - final String contentType = "application/json"; - return service.bmsTriggerDataMoveSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, contentType, parameters, Context.NONE); - } - - /** - * Triggers Data Move Operation on target vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Trigger data move request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response bmsTriggerDataMoveWithResponse(String vaultName, String resourceGroupName, - TriggerDataMoveRequest parameters, Context context) { - final String contentType = "application/json"; - return service.bmsTriggerDataMoveSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, contentType, parameters, context); - } - - /** - * Triggers Data Move Operation on target vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Trigger data move request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginBmsTriggerDataMoveAsync(String vaultName, String resourceGroupName, - TriggerDataMoveRequest parameters) { - Mono>> mono - = bmsTriggerDataMoveWithResponseAsync(vaultName, resourceGroupName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Triggers Data Move Operation on target vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Trigger data move request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginBmsTriggerDataMove(String vaultName, String resourceGroupName, - TriggerDataMoveRequest parameters) { - Response response = bmsTriggerDataMoveWithResponse(vaultName, resourceGroupName, parameters); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Triggers Data Move Operation on target vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Trigger data move request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginBmsTriggerDataMove(String vaultName, String resourceGroupName, - TriggerDataMoveRequest parameters, Context context) { - Response response - = bmsTriggerDataMoveWithResponse(vaultName, resourceGroupName, parameters, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Triggers Data Move Operation on target vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Trigger data move request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono bmsTriggerDataMoveAsync(String vaultName, String resourceGroupName, - TriggerDataMoveRequest parameters) { - return beginBmsTriggerDataMoveAsync(vaultName, resourceGroupName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Triggers Data Move Operation on target vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Trigger data move request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void bmsTriggerDataMove(String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters) { - beginBmsTriggerDataMove(vaultName, resourceGroupName, parameters).getFinalResult(); - } - - /** - * Triggers Data Move Operation on target vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Trigger data move request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void bmsTriggerDataMove(String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters, - Context context) { - beginBmsTriggerDataMove(vaultName, resourceGroupName, parameters, context).getFinalResult(); - } - - /** - * Fetches Operation Result for Prepare Data Move. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the BackupResourceConfigResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getOperationStatusWithResponseAsync(String vaultName, - String resourceGroupName, String operationId) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getOperationStatus(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, operationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Fetches Operation Result for Prepare Data Move. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the BackupResourceConfigResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getOperationStatusAsync(String vaultName, String resourceGroupName, - String operationId) { - return getOperationStatusWithResponseAsync(vaultName, resourceGroupName, operationId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Fetches Operation Result for Prepare Data Move. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the BackupResourceConfigResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getOperationStatusWithResponse(String vaultName, String resourceGroupName, - String operationId, Context context) { - final String accept = "application/json"; - return service.getOperationStatusSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, operationId, accept, context); - } - - /** - * Fetches Operation Result for Prepare Data Move. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the BackupResourceConfigResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusInner getOperationStatus(String vaultName, String resourceGroupName, String operationId) { - return getOperationStatusWithResponse(vaultName, resourceGroupName, operationId, Context.NONE).getValue(); - } - - /** - * Move recovery point from one datastore to another store. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Move Resource Across Tiers Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> moveRecoveryPointWithResponseAsync(String vaultName, - String resourceGroupName, String fabricName, String containerName, String protectedItemName, - String recoveryPointId, MoveRPAcrossTiersRequest parameters) { - final String contentType = "application/json"; - return FluxUtil - .withContext(context -> service.moveRecoveryPoint(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, - protectedItemName, recoveryPointId, contentType, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Move recovery point from one datastore to another store. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Move Resource Across Tiers Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response moveRecoveryPointWithResponse(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String recoveryPointId, - MoveRPAcrossTiersRequest parameters) { - final String contentType = "application/json"; - return service.moveRecoveryPointSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, protectedItemName, - recoveryPointId, contentType, parameters, Context.NONE); - } - - /** - * Move recovery point from one datastore to another store. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Move Resource Across Tiers Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response moveRecoveryPointWithResponse(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String recoveryPointId, - MoveRPAcrossTiersRequest parameters, Context context) { - final String contentType = "application/json"; - return service.moveRecoveryPointSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, protectedItemName, - recoveryPointId, contentType, parameters, context); - } - - /** - * Move recovery point from one datastore to another store. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Move Resource Across Tiers Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginMoveRecoveryPointAsync(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String recoveryPointId, - MoveRPAcrossTiersRequest parameters) { - Mono>> mono = moveRecoveryPointWithResponseAsync(vaultName, resourceGroupName, - fabricName, containerName, protectedItemName, recoveryPointId, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Move recovery point from one datastore to another store. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Move Resource Across Tiers Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginMoveRecoveryPoint(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String recoveryPointId, - MoveRPAcrossTiersRequest parameters) { - Response response = moveRecoveryPointWithResponse(vaultName, resourceGroupName, fabricName, - containerName, protectedItemName, recoveryPointId, parameters); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Move recovery point from one datastore to another store. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Move Resource Across Tiers Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginMoveRecoveryPoint(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String recoveryPointId, - MoveRPAcrossTiersRequest parameters, Context context) { - Response response = moveRecoveryPointWithResponse(vaultName, resourceGroupName, fabricName, - containerName, protectedItemName, recoveryPointId, parameters, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Move recovery point from one datastore to another store. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Move Resource Across Tiers Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono moveRecoveryPointAsync(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId, MoveRPAcrossTiersRequest parameters) { - return beginMoveRecoveryPointAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - recoveryPointId, parameters).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Move recovery point from one datastore to another store. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Move Resource Across Tiers Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void moveRecoveryPoint(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, MoveRPAcrossTiersRequest parameters) { - beginMoveRecoveryPoint(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - recoveryPointId, parameters).getFinalResult(); - } - - /** - * Move recovery point from one datastore to another store. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Move Resource Across Tiers Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void moveRecoveryPoint(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, MoveRPAcrossTiersRequest parameters, Context context) { - beginMoveRecoveryPoint(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - recoveryPointId, parameters, context).getFinalResult(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceProvidersImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceProvidersImpl.java deleted file mode 100644 index 343f96a8811e..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ResourceProvidersImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ResourceProvidersClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.MoveRPAcrossTiersRequest; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatus; -import com.azure.resourcemanager.recoveryservicesbackup.models.PrepareDataMoveRequest; -import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceProviders; -import com.azure.resourcemanager.recoveryservicesbackup.models.TriggerDataMoveRequest; - -public final class ResourceProvidersImpl implements ResourceProviders { - private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); - - private final ResourceProvidersClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public ResourceProvidersImpl(ResourceProvidersClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public void bmsPrepareDataMove(String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters) { - this.serviceClient().bmsPrepareDataMove(vaultName, resourceGroupName, parameters); - } - - public void bmsPrepareDataMove(String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters, - Context context) { - this.serviceClient().bmsPrepareDataMove(vaultName, resourceGroupName, parameters, context); - } - - public void bmsTriggerDataMove(String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters) { - this.serviceClient().bmsTriggerDataMove(vaultName, resourceGroupName, parameters); - } - - public void bmsTriggerDataMove(String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters, - Context context) { - this.serviceClient().bmsTriggerDataMove(vaultName, resourceGroupName, parameters, context); - } - - public Response getOperationStatusWithResponse(String vaultName, String resourceGroupName, - String operationId, Context context) { - Response inner - = this.serviceClient().getOperationStatusWithResponse(vaultName, resourceGroupName, operationId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationStatusImpl(inner.getValue(), this.manager())); - } - - public OperationStatus getOperationStatus(String vaultName, String resourceGroupName, String operationId) { - OperationStatusInner inner = this.serviceClient().getOperationStatus(vaultName, resourceGroupName, operationId); - if (inner != null) { - return new OperationStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - public void moveRecoveryPoint(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, MoveRPAcrossTiersRequest parameters) { - this.serviceClient() - .moveRecoveryPoint(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - recoveryPointId, parameters); - } - - public void moveRecoveryPoint(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, MoveRPAcrossTiersRequest parameters, Context context) { - this.serviceClient() - .moveRecoveryPoint(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - recoveryPointId, parameters, context); - } - - private ResourceProvidersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresClientImpl.java deleted file mode 100644 index dd1df34159bd..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresClientImpl.java +++ /dev/null @@ -1,324 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.RestoresClient; -import com.azure.resourcemanager.recoveryservicesbackup.models.RestoreRequestResource; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in RestoresClient. - */ -public final class RestoresClientImpl implements RestoresClient { - /** - * The proxy service used to perform REST calls. - */ - private final RestoresService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of RestoresClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RestoresClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(RestoresService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientRestores to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientRestores") - public interface RestoresService { - @Headers({ "Accept: application/json;q=0.9" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/restore") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> trigger(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, - @PathParam("recoveryPointId") String recoveryPointId, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") RestoreRequestResource parameters, Context context); - - @Headers({ "Accept: application/json;q=0.9" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/restore") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response triggerSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, - @PathParam("protectedItemName") String protectedItemName, - @PathParam("recoveryPointId") String recoveryPointId, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") RestoreRequestResource parameters, Context context); - } - - /** - * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, - * use - * GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> triggerWithResponseAsync(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String recoveryPointId, - RestoreRequestResource parameters) { - final String contentType = "application/json"; - return FluxUtil - .withContext(context -> service.trigger(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, - protectedItemName, recoveryPointId, contentType, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, - * use - * GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response triggerWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId, RestoreRequestResource parameters) { - final String contentType = "application/json"; - return service.triggerSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, protectedItemName, - recoveryPointId, contentType, parameters, Context.NONE); - } - - /** - * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, - * use - * GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response triggerWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId, RestoreRequestResource parameters, - Context context) { - final String contentType = "application/json"; - return service.triggerSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, fabricName, containerName, protectedItemName, - recoveryPointId, contentType, parameters, context); - } - - /** - * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, - * use - * GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginTriggerAsync(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String recoveryPointId, - RestoreRequestResource parameters) { - Mono>> mono = triggerWithResponseAsync(vaultName, resourceGroupName, fabricName, - containerName, protectedItemName, recoveryPointId, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, - * use - * GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginTrigger(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String recoveryPointId, - RestoreRequestResource parameters) { - Response response = triggerWithResponse(vaultName, resourceGroupName, fabricName, containerName, - protectedItemName, recoveryPointId, parameters); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, - * use - * GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginTrigger(String vaultName, String resourceGroupName, - String fabricName, String containerName, String protectedItemName, String recoveryPointId, - RestoreRequestResource parameters, Context context) { - Response response = triggerWithResponse(vaultName, resourceGroupName, fabricName, containerName, - protectedItemName, recoveryPointId, parameters, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, - * use - * GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono triggerAsync(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, RestoreRequestResource parameters) { - return beginTriggerAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, - recoveryPointId, parameters).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, - * use - * GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void trigger(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, RestoreRequestResource parameters) { - beginTrigger(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, - parameters).getFinalResult(); - } - - /** - * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, - * use - * GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void trigger(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, RestoreRequestResource parameters, Context context) { - beginTrigger(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, - parameters, context).getFinalResult(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresImpl.java deleted file mode 100644 index 2936db8fa520..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.RestoresClient; -import com.azure.resourcemanager.recoveryservicesbackup.models.RestoreRequestResource; -import com.azure.resourcemanager.recoveryservicesbackup.models.Restores; - -public final class RestoresImpl implements Restores { - private static final ClientLogger LOGGER = new ClientLogger(RestoresImpl.class); - - private final RestoresClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public RestoresImpl(RestoresClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public void trigger(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, RestoreRequestResource parameters) { - this.serviceClient() - .trigger(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, - parameters); - } - - public void trigger(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, RestoreRequestResource parameters, Context context) { - this.serviceClient() - .trigger(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, - parameters, context); - } - - private RestoresClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsClientImpl.java deleted file mode 100644 index 75a260136bf4..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsClientImpl.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.SecurityPINsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TokenInformationInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.SecurityPinBase; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SecurityPINsClient. - */ -public final class SecurityPINsClientImpl implements SecurityPINsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SecurityPINsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of SecurityPINsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecurityPINsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service - = RestProxy.create(SecurityPINsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientSecurityPINs to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientSecurityPINs") - public interface SecurityPINsService { - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupSecurityPIN") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, - @BodyParam("application/json") SecurityPinBase parameters, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupSecurityPIN") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, - @BodyParam("application/json") SecurityPinBase parameters, Context context); - } - - /** - * Get the security PIN. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters security pin request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security PIN along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, String resourceGroupName, - SecurityPinBase parameters) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, - resourceGroupName, this.client.getSubscriptionId(), accept, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the security PIN. - * - * @param vaultName The name of the recovery services vault. - * @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 the security PIN on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName) { - final SecurityPinBase parameters = null; - return getWithResponseAsync(vaultName, resourceGroupName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the security PIN. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters security pin request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security PIN along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, - SecurityPinBase parameters, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), accept, parameters, context); - } - - /** - * Get the security PIN. - * - * @param vaultName The name of the recovery services vault. - * @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 the security PIN. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TokenInformationInner get(String vaultName, String resourceGroupName) { - final SecurityPinBase parameters = null; - return getWithResponse(vaultName, resourceGroupName, parameters, Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsImpl.java deleted file mode 100644 index 4985055f8ca5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/SecurityPINsImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.SecurityPINsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TokenInformationInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.SecurityPINs; -import com.azure.resourcemanager.recoveryservicesbackup.models.SecurityPinBase; -import com.azure.resourcemanager.recoveryservicesbackup.models.TokenInformation; - -public final class SecurityPINsImpl implements SecurityPINs { - private static final ClientLogger LOGGER = new ClientLogger(SecurityPINsImpl.class); - - private final SecurityPINsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public SecurityPINsImpl(SecurityPINsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, - SecurityPinBase parameters, Context context) { - Response inner - = this.serviceClient().getWithResponse(vaultName, resourceGroupName, parameters, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new TokenInformationImpl(inner.getValue(), this.manager())); - } - - public TokenInformation get(String vaultName, String resourceGroupName) { - TokenInformationInner inner = this.serviceClient().get(vaultName, resourceGroupName); - if (inner != null) { - return new TokenInformationImpl(inner, this.manager()); - } else { - return null; - } - } - - private SecurityPINsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/TieringCostInfoImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/TieringCostInfoImpl.java deleted file mode 100644 index 92641668dac5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/TieringCostInfoImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TieringCostInfoInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.TieringCostInfo; - -public final class TieringCostInfoImpl implements TieringCostInfo { - private TieringCostInfoInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - TieringCostInfoImpl(TieringCostInfoInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String objectType() { - return this.innerModel().objectType(); - } - - public TieringCostInfoInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/TieringCostOperationStatusClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/TieringCostOperationStatusClientImpl.java deleted file mode 100644 index 5cfe8ab9c575..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/TieringCostOperationStatusClientImpl.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.TieringCostOperationStatusClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in TieringCostOperationStatusClient. - */ -public final class TieringCostOperationStatusClientImpl implements TieringCostOperationStatusClient { - /** - * The proxy service used to perform REST calls. - */ - private final TieringCostOperationStatusService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of TieringCostOperationStatusClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - TieringCostOperationStatusClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(TieringCostOperationStatusService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientTieringCostOperationStatus to - * be used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientTieringCostOperationStatus") - public interface TieringCostOperationStatusService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupTieringCost/default/operationsStatus/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupTieringCost/default/operationsStatus/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, - @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the status of async operations of tiering cost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param operationId The operationId 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 status of async operations of tiering cost along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String vaultName, - String operationId) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vaultName, operationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the status of async operations of tiering cost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param operationId The operationId 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 status of async operations of tiering cost on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String vaultName, String operationId) { - return getWithResponseAsync(resourceGroupName, vaultName, operationId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the status of async operations of tiering cost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param operationId The operationId 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 status of async operations of tiering cost along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String vaultName, - String operationId, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, vaultName, operationId, accept, context); - } - - /** - * Gets the status of async operations of tiering cost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param operationId The operationId 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 status of async operations of tiering cost. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusInner get(String resourceGroupName, String vaultName, String operationId) { - return getWithResponse(resourceGroupName, vaultName, operationId, Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/TieringCostOperationStatusImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/TieringCostOperationStatusImpl.java deleted file mode 100644 index 214a707ef2dc..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/TieringCostOperationStatusImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.TieringCostOperationStatusClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatus; -import com.azure.resourcemanager.recoveryservicesbackup.models.TieringCostOperationStatus; - -public final class TieringCostOperationStatusImpl implements TieringCostOperationStatus { - private static final ClientLogger LOGGER = new ClientLogger(TieringCostOperationStatusImpl.class); - - private final TieringCostOperationStatusClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public TieringCostOperationStatusImpl(TieringCostOperationStatusClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String vaultName, String operationId, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, vaultName, operationId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationStatusImpl(inner.getValue(), this.manager())); - } - - public OperationStatus get(String resourceGroupName, String vaultName, String operationId) { - OperationStatusInner inner = this.serviceClient().get(resourceGroupName, vaultName, operationId); - if (inner != null) { - return new OperationStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - private TieringCostOperationStatusClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/TokenInformationImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/TokenInformationImpl.java deleted file mode 100644 index 49dc76a4c17c..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/TokenInformationImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TokenInformationInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.TokenInformation; - -public final class TokenInformationImpl implements TokenInformation { - private TokenInformationInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - TokenInformationImpl(TokenInformationInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String token() { - return this.innerModel().token(); - } - - public Long expiryTimeInUtcTicks() { - return this.innerModel().expiryTimeInUtcTicks(); - } - - public String securityPin() { - return this.innerModel().securityPin(); - } - - public TokenInformationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/UnlockDeleteResponseImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/UnlockDeleteResponseImpl.java deleted file mode 100644 index 572be623b52b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/UnlockDeleteResponseImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.UnlockDeleteResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.UnlockDeleteResponse; - -public final class UnlockDeleteResponseImpl implements UnlockDeleteResponse { - private UnlockDeleteResponseInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - UnlockDeleteResponseImpl(UnlockDeleteResponseInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String unlockDeleteExpiryTime() { - return this.innerModel().unlockDeleteExpiryTime(); - } - - public UnlockDeleteResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationResultsClientImpl.java deleted file mode 100644 index 6a0f5810dcbf..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationResultsClientImpl.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ValidateOperationResultsClient. - */ -public final class ValidateOperationResultsClientImpl implements ValidateOperationResultsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ValidateOperationResultsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of ValidateOperationResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ValidateOperationResultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(ValidateOperationResultsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientValidateOperationResults to be - * used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientValidateOperationResults") - public interface ValidateOperationResultsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupValidateOperationResults/{operationId}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupValidateOperationResults/{operationId}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Fetches the result of a triggered validate operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation whose result needs to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, - String resourceGroupName, String operationId) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, - resourceGroupName, this.client.getSubscriptionId(), operationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Fetches the result of a triggered validate operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation whose result needs to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName, - String operationId) { - return getWithResponseAsync(vaultName, resourceGroupName, operationId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Fetches the result of a triggered validate operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation whose result needs to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, - String operationId, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), operationId, accept, context); - } - - /** - * Fetches the result of a triggered validate operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation whose result needs to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ValidateOperationsResponseInner get(String vaultName, String resourceGroupName, String operationId) { - return getWithResponse(vaultName, resourceGroupName, operationId, Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationResultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationResultsImpl.java deleted file mode 100644 index 23dc1f7c29cc..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationResultsImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationResultsClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationResults; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationsResponse; - -public final class ValidateOperationResultsImpl implements ValidateOperationResults { - private static final ClientLogger LOGGER = new ClientLogger(ValidateOperationResultsImpl.class); - - private final ValidateOperationResultsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public ValidateOperationResultsImpl(ValidateOperationResultsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, - String operationId, Context context) { - Response inner - = this.serviceClient().getWithResponse(vaultName, resourceGroupName, operationId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ValidateOperationsResponseImpl(inner.getValue(), this.manager())); - } - - public ValidateOperationsResponse get(String vaultName, String resourceGroupName, String operationId) { - ValidateOperationsResponseInner inner = this.serviceClient().get(vaultName, resourceGroupName, operationId); - if (inner != null) { - return new ValidateOperationsResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private ValidateOperationResultsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationStatusesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationStatusesClientImpl.java deleted file mode 100644 index c80bcaaa688f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationStatusesClientImpl.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationStatusesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ValidateOperationStatusesClient. - */ -public final class ValidateOperationStatusesClientImpl implements ValidateOperationStatusesClient { - /** - * The proxy service used to perform REST calls. - */ - private final ValidateOperationStatusesService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of ValidateOperationStatusesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ValidateOperationStatusesClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(ValidateOperationStatusesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientValidateOperationStatuses to be - * used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientValidateOperationStatuses") - public interface ValidateOperationStatusesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupValidateOperationsStatuses/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupValidateOperationsStatuses/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Fetches the status of a triggered validate operation. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. - * If operation has completed, this method returns the list of errors obtained while validating the operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID represents the operation whose status needs to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String vaultName, String resourceGroupName, - String operationId) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, - resourceGroupName, this.client.getSubscriptionId(), operationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Fetches the status of a triggered validate operation. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. - * If operation has completed, this method returns the list of errors obtained while validating the operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID represents the operation whose status needs to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String vaultName, String resourceGroupName, String operationId) { - return getWithResponseAsync(vaultName, resourceGroupName, operationId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Fetches the status of a triggered validate operation. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. - * If operation has completed, this method returns the list of errors obtained while validating the operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID represents the operation whose status needs to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String vaultName, String resourceGroupName, - String operationId, Context context) { - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), operationId, accept, context); - } - - /** - * Fetches the status of a triggered validate operation. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. - * If operation has completed, this method returns the list of errors obtained while validating the operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID represents the operation whose status needs to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusInner get(String vaultName, String resourceGroupName, String operationId) { - return getWithResponse(vaultName, resourceGroupName, operationId, Context.NONE).getValue(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationStatusesImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationStatusesImpl.java deleted file mode 100644 index d43773c88e5a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationStatusesImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationStatusesClient; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatus; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationStatuses; - -public final class ValidateOperationStatusesImpl implements ValidateOperationStatuses { - private static final ClientLogger LOGGER = new ClientLogger(ValidateOperationStatusesImpl.class); - - private final ValidateOperationStatusesClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public ValidateOperationStatusesImpl(ValidateOperationStatusesClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String vaultName, String resourceGroupName, String operationId, - Context context) { - Response inner - = this.serviceClient().getWithResponse(vaultName, resourceGroupName, operationId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationStatusImpl(inner.getValue(), this.manager())); - } - - public OperationStatus get(String vaultName, String resourceGroupName, String operationId) { - OperationStatusInner inner = this.serviceClient().get(vaultName, resourceGroupName, operationId); - if (inner != null) { - return new OperationStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - private ValidateOperationStatusesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationsClientImpl.java deleted file mode 100644 index cf8b4fc04ac5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationsClientImpl.java +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationsClient; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequestResource; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ValidateOperationsClient. - */ -public final class ValidateOperationsClientImpl implements ValidateOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ValidateOperationsService service; - - /** - * The service client containing this operation class. - */ - private final RecoveryServicesBackupManagementClientImpl client; - - /** - * Initializes an instance of ValidateOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ValidateOperationsClientImpl(RecoveryServicesBackupManagementClientImpl client) { - this.service = RestProxy.create(ValidateOperationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for RecoveryServicesBackupManagementClientValidateOperations to be used - * by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "RecoveryServicesBackupManagementClientValidateOperations") - public interface ValidateOperationsService { - @Headers({ "Accept: application/json;q=0.9" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupTriggerValidateOperation") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> trigger(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") ValidateOperationRequestResource parameters, Context context); - - @Headers({ "Accept: application/json;q=0.9" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupTriggerValidateOperation") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response triggerSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("vaultName") String vaultName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") ValidateOperationRequestResource parameters, Context context); - } - - /** - * Validate operation for specified backed up item in the form of an asynchronous operation. Returns tracking - * headers which can be tracked using GetValidateOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> triggerWithResponseAsync(String vaultName, String resourceGroupName, - ValidateOperationRequestResource parameters) { - final String contentType = "application/json"; - return FluxUtil - .withContext(context -> service.trigger(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, - resourceGroupName, this.client.getSubscriptionId(), contentType, parameters, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Validate operation for specified backed up item in the form of an asynchronous operation. Returns tracking - * headers which can be tracked using GetValidateOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response triggerWithResponse(String vaultName, String resourceGroupName, - ValidateOperationRequestResource parameters) { - final String contentType = "application/json"; - return service.triggerSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), contentType, parameters, Context.NONE); - } - - /** - * Validate operation for specified backed up item in the form of an asynchronous operation. Returns tracking - * headers which can be tracked using GetValidateOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response triggerWithResponse(String vaultName, String resourceGroupName, - ValidateOperationRequestResource parameters, Context context) { - final String contentType = "application/json"; - return service.triggerSync(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, - this.client.getSubscriptionId(), contentType, parameters, context); - } - - /** - * Validate operation for specified backed up item in the form of an asynchronous operation. Returns tracking - * headers which can be tracked using GetValidateOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginTriggerAsync(String vaultName, String resourceGroupName, - ValidateOperationRequestResource parameters) { - Mono>> mono = triggerWithResponseAsync(vaultName, resourceGroupName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Validate operation for specified backed up item in the form of an asynchronous operation. Returns tracking - * headers which can be tracked using GetValidateOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginTrigger(String vaultName, String resourceGroupName, - ValidateOperationRequestResource parameters) { - Response response = triggerWithResponse(vaultName, resourceGroupName, parameters); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); - } - - /** - * Validate operation for specified backed up item in the form of an asynchronous operation. Returns tracking - * headers which can be tracked using GetValidateOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginTrigger(String vaultName, String resourceGroupName, - ValidateOperationRequestResource parameters, Context context) { - Response response = triggerWithResponse(vaultName, resourceGroupName, parameters, context); - return this.client.getLroResult(response, Void.class, Void.class, context); - } - - /** - * Validate operation for specified backed up item in the form of an asynchronous operation. Returns tracking - * headers which can be tracked using GetValidateOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono triggerAsync(String vaultName, String resourceGroupName, - ValidateOperationRequestResource parameters) { - return beginTriggerAsync(vaultName, resourceGroupName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Validate operation for specified backed up item in the form of an asynchronous operation. Returns tracking - * headers which can be tracked using GetValidateOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void trigger(String vaultName, String resourceGroupName, ValidateOperationRequestResource parameters) { - beginTrigger(vaultName, resourceGroupName, parameters).getFinalResult(); - } - - /** - * Validate operation for specified backed up item in the form of an asynchronous operation. Returns tracking - * headers which can be tracked using GetValidateOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void trigger(String vaultName, String resourceGroupName, ValidateOperationRequestResource parameters, - Context context) { - beginTrigger(vaultName, resourceGroupName, parameters, context).getFinalResult(); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationsImpl.java deleted file mode 100644 index cd00a547c86e..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationsImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationsClient; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequestResource; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperations; - -public final class ValidateOperationsImpl implements ValidateOperations { - private static final ClientLogger LOGGER = new ClientLogger(ValidateOperationsImpl.class); - - private final ValidateOperationsClient innerClient; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - public ValidateOperationsImpl(ValidateOperationsClient innerClient, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public void trigger(String vaultName, String resourceGroupName, ValidateOperationRequestResource parameters) { - this.serviceClient().trigger(vaultName, resourceGroupName, parameters); - } - - public void trigger(String vaultName, String resourceGroupName, ValidateOperationRequestResource parameters, - Context context) { - this.serviceClient().trigger(vaultName, resourceGroupName, parameters, context); - } - - private ValidateOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationsResponseImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationsResponseImpl.java deleted file mode 100644 index eb7a43a93eca..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationsResponseImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationResponse; -import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationsResponse; - -public final class ValidateOperationsResponseImpl implements ValidateOperationsResponse { - private ValidateOperationsResponseInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - ValidateOperationsResponseImpl(ValidateOperationsResponseInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public ValidateOperationResponse validateOperationResponse() { - return this.innerModel().validateOperationResponse(); - } - - public ValidateOperationsResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/VaultStorageConfigOperationResultResponseImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/VaultStorageConfigOperationResultResponseImpl.java deleted file mode 100644 index a035ba90d408..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/VaultStorageConfigOperationResultResponseImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.VaultStorageConfigOperationResultResponseInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.VaultStorageConfigOperationResultResponse; - -public final class VaultStorageConfigOperationResultResponseImpl implements VaultStorageConfigOperationResultResponse { - private VaultStorageConfigOperationResultResponseInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - VaultStorageConfigOperationResultResponseImpl(VaultStorageConfigOperationResultResponseInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String objectType() { - return this.innerModel().objectType(); - } - - public VaultStorageConfigOperationResultResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/WorkloadItemResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/WorkloadItemResourceImpl.java deleted file mode 100644 index 849db971619d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/WorkloadItemResourceImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadItemResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.WorkloadItem; -import com.azure.resourcemanager.recoveryservicesbackup.models.WorkloadItemResource; -import java.util.Collections; -import java.util.Map; - -public final class WorkloadItemResourceImpl implements WorkloadItemResource { - private WorkloadItemResourceInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - WorkloadItemResourceImpl(WorkloadItemResourceInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager 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 String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String eTag() { - return this.innerModel().eTag(); - } - - public WorkloadItem properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public WorkloadItemResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/WorkloadProtectableItemResourceImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/WorkloadProtectableItemResourceImpl.java deleted file mode 100644 index 155f6e93f3f0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/WorkloadProtectableItemResourceImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadProtectableItemResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.WorkloadProtectableItem; -import com.azure.resourcemanager.recoveryservicesbackup.models.WorkloadProtectableItemResource; -import java.util.Collections; -import java.util.Map; - -public final class WorkloadProtectableItemResourceImpl implements WorkloadProtectableItemResource { - private WorkloadProtectableItemResourceInner innerObject; - - private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; - - WorkloadProtectableItemResourceImpl(WorkloadProtectableItemResourceInner innerObject, - com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager 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 String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String eTag() { - return this.innerModel().eTag(); - } - - public WorkloadProtectableItem properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public WorkloadProtectableItemResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/BackupEngineBaseResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/BackupEngineBaseResourceList.java deleted file mode 100644 index 55c672837b39..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/BackupEngineBaseResourceList.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupEngineBaseResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceList; -import java.io.IOException; -import java.util.List; - -/** - * List of BackupEngineBase resources. - */ -@Immutable -public final class BackupEngineBaseResourceList extends ResourceList { - /* - * List of resources. - */ - private List value; - - /* - * The URI to fetch the next page of resources, with each API call returning up to 200 resources per page. Use - * ListNext() to fetch the next page if the total number of resources exceeds 200. - */ - private String nextLink; - - /** - * Creates an instance of BackupEngineBaseResourceList class. - */ - private BackupEngineBaseResourceList() { - } - - /** - * Get the value property: List of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page of resources, with each API call returning up to 200 - * resources per page. Use ListNext() to fetch the next page if the total number of resources exceeds 200. - * - * @return the nextLink value. - */ - @Override - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", nextLink()); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupEngineBaseResourceList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupEngineBaseResourceList 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 BackupEngineBaseResourceList. - */ - public static BackupEngineBaseResourceList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupEngineBaseResourceList deserializedBackupEngineBaseResourceList = new BackupEngineBaseResourceList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedBackupEngineBaseResourceList.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> BackupEngineBaseResourceInner.fromJson(reader1)); - deserializedBackupEngineBaseResourceList.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedBackupEngineBaseResourceList; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/BackupManagementUsageList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/BackupManagementUsageList.java deleted file mode 100644 index 58818788867d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/BackupManagementUsageList.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupManagementUsageInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceList; -import java.io.IOException; -import java.util.List; - -/** - * Backup management usage for vault. - */ -@Immutable -public final class BackupManagementUsageList extends ResourceList { - /* - * The list of backup management usages for the given vault. - */ - private List value; - - /* - * The URI to fetch the next page of resources, with each API call returning up to 200 resources per page. Use - * ListNext() to fetch the next page if the total number of resources exceeds 200. - */ - private String nextLink; - - /** - * Creates an instance of BackupManagementUsageList class. - */ - private BackupManagementUsageList() { - } - - /** - * Get the value property: The list of backup management usages for the given vault. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page of resources, with each API call returning up to 200 - * resources per page. Use ListNext() to fetch the next page if the total number of resources exceeds 200. - * - * @return the nextLink value. - */ - @Override - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", nextLink()); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupManagementUsageList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupManagementUsageList 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 BackupManagementUsageList. - */ - public static BackupManagementUsageList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupManagementUsageList deserializedBackupManagementUsageList = new BackupManagementUsageList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedBackupManagementUsageList.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> BackupManagementUsageInner.fromJson(reader1)); - deserializedBackupManagementUsageList.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedBackupManagementUsageList; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ClientDiscoveryResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ClientDiscoveryResponse.java deleted file mode 100644 index 697b93cdddad..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ClientDiscoveryResponse.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ClientDiscoveryValueForSingleApiInner; -import java.io.IOException; -import java.util.List; - -/** - * Operations List response which contains list of available APIs. - */ -@Immutable -public final class ClientDiscoveryResponse implements JsonSerializable { - /* - * List of available operations. - */ - private List value; - - /* - * Link to the next chunk of Response. - */ - private String nextLink; - - /** - * Creates an instance of ClientDiscoveryResponse class. - */ - private ClientDiscoveryResponse() { - } - - /** - * Get the value property: List of available operations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: Link to the next chunk of Response. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ClientDiscoveryResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ClientDiscoveryResponse 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 ClientDiscoveryResponse. - */ - public static ClientDiscoveryResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ClientDiscoveryResponse deserializedClientDiscoveryResponse = new ClientDiscoveryResponse(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ClientDiscoveryValueForSingleApiInner.fromJson(reader1)); - deserializedClientDiscoveryResponse.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedClientDiscoveryResponse.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedClientDiscoveryResponse; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/JobResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/JobResourceList.java deleted file mode 100644 index 96b8209f17d2..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/JobResourceList.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceList; -import java.io.IOException; -import java.util.List; - -/** - * List of Job resources. - */ -@Immutable -public final class JobResourceList extends ResourceList { - /* - * List of resources. - */ - private List value; - - /* - * The URI to fetch the next page of resources, with each API call returning up to 200 resources per page. Use - * ListNext() to fetch the next page if the total number of resources exceeds 200. - */ - private String nextLink; - - /** - * Creates an instance of JobResourceList class. - */ - private JobResourceList() { - } - - /** - * Get the value property: List of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page of resources, with each API call returning up to 200 - * resources per page. Use ListNext() to fetch the next page if the total number of resources exceeds 200. - * - * @return the nextLink value. - */ - @Override - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", nextLink()); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of JobResourceList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of JobResourceList 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 JobResourceList. - */ - public static JobResourceList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - JobResourceList deserializedJobResourceList = new JobResourceList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedJobResourceList.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> JobResourceInner.fromJson(reader1)); - deserializedJobResourceList.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedJobResourceList; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ProtectableContainerResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ProtectableContainerResourceList.java deleted file mode 100644 index af16ad223f4c..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ProtectableContainerResourceList.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectableContainerResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceList; -import java.io.IOException; -import java.util.List; - -/** - * List of ProtectableContainer resources. - */ -@Immutable -public final class ProtectableContainerResourceList extends ResourceList { - /* - * List of resources. - */ - private List value; - - /* - * The URI to fetch the next page of resources, with each API call returning up to 200 resources per page. Use - * ListNext() to fetch the next page if the total number of resources exceeds 200. - */ - private String nextLink; - - /** - * Creates an instance of ProtectableContainerResourceList class. - */ - private ProtectableContainerResourceList() { - } - - /** - * Get the value property: List of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page of resources, with each API call returning up to 200 - * resources per page. Use ListNext() to fetch the next page if the total number of resources exceeds 200. - * - * @return the nextLink value. - */ - @Override - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", nextLink()); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ProtectableContainerResourceList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProtectableContainerResourceList 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 ProtectableContainerResourceList. - */ - public static ProtectableContainerResourceList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProtectableContainerResourceList deserializedProtectableContainerResourceList - = new ProtectableContainerResourceList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedProtectableContainerResourceList.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ProtectableContainerResourceInner.fromJson(reader1)); - deserializedProtectableContainerResourceList.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedProtectableContainerResourceList; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ProtectedItemResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ProtectedItemResourceList.java deleted file mode 100644 index 6486660d035a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ProtectedItemResourceList.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceList; -import java.io.IOException; -import java.util.List; - -/** - * List of ProtectedItem resources. - */ -@Immutable -public final class ProtectedItemResourceList extends ResourceList { - /* - * List of resources. - */ - private List value; - - /* - * The URI to fetch the next page of resources, with each API call returning up to 200 resources per page. Use - * ListNext() to fetch the next page if the total number of resources exceeds 200. - */ - private String nextLink; - - /** - * Creates an instance of ProtectedItemResourceList class. - */ - private ProtectedItemResourceList() { - } - - /** - * Get the value property: List of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page of resources, with each API call returning up to 200 - * resources per page. Use ListNext() to fetch the next page if the total number of resources exceeds 200. - * - * @return the nextLink value. - */ - @Override - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", nextLink()); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ProtectedItemResourceList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProtectedItemResourceList 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 ProtectedItemResourceList. - */ - public static ProtectedItemResourceList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProtectedItemResourceList deserializedProtectedItemResourceList = new ProtectedItemResourceList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedProtectedItemResourceList.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ProtectedItemResourceInner.fromJson(reader1)); - deserializedProtectedItemResourceList.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedProtectedItemResourceList; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ProtectionContainerResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ProtectionContainerResourceList.java deleted file mode 100644 index 3816d98e9368..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ProtectionContainerResourceList.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceList; -import java.io.IOException; -import java.util.List; - -/** - * List of ProtectionContainer resources. - */ -@Immutable -public final class ProtectionContainerResourceList extends ResourceList { - /* - * List of resources. - */ - private List value; - - /* - * The URI to fetch the next page of resources, with each API call returning up to 200 resources per page. Use - * ListNext() to fetch the next page if the total number of resources exceeds 200. - */ - private String nextLink; - - /** - * Creates an instance of ProtectionContainerResourceList class. - */ - private ProtectionContainerResourceList() { - } - - /** - * Get the value property: List of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page of resources, with each API call returning up to 200 - * resources per page. Use ListNext() to fetch the next page if the total number of resources exceeds 200. - * - * @return the nextLink value. - */ - @Override - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", nextLink()); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ProtectionContainerResourceList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProtectionContainerResourceList 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 ProtectionContainerResourceList. - */ - public static ProtectionContainerResourceList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProtectionContainerResourceList deserializedProtectionContainerResourceList - = new ProtectionContainerResourceList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedProtectionContainerResourceList.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ProtectionContainerResourceInner.fromJson(reader1)); - deserializedProtectionContainerResourceList.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedProtectionContainerResourceList; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ProtectionIntentResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ProtectionIntentResourceList.java deleted file mode 100644 index 1a21fb9c1d4b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ProtectionIntentResourceList.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionIntentResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceList; -import java.io.IOException; -import java.util.List; - -/** - * List of ProtectionIntent resources. - */ -@Immutable -public final class ProtectionIntentResourceList extends ResourceList { - /* - * List of resources. - */ - private List value; - - /* - * The URI to fetch the next page of resources, with each API call returning up to 200 resources per page. Use - * ListNext() to fetch the next page if the total number of resources exceeds 200. - */ - private String nextLink; - - /** - * Creates an instance of ProtectionIntentResourceList class. - */ - private ProtectionIntentResourceList() { - } - - /** - * Get the value property: List of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page of resources, with each API call returning up to 200 - * resources per page. Use ListNext() to fetch the next page if the total number of resources exceeds 200. - * - * @return the nextLink value. - */ - @Override - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", nextLink()); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ProtectionIntentResourceList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProtectionIntentResourceList 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 ProtectionIntentResourceList. - */ - public static ProtectionIntentResourceList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProtectionIntentResourceList deserializedProtectionIntentResourceList = new ProtectionIntentResourceList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedProtectionIntentResourceList.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ProtectionIntentResourceInner.fromJson(reader1)); - deserializedProtectionIntentResourceList.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedProtectionIntentResourceList; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ProtectionPolicyResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ProtectionPolicyResourceList.java deleted file mode 100644 index 1b81e1d730d1..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ProtectionPolicyResourceList.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceList; -import java.io.IOException; -import java.util.List; - -/** - * List of ProtectionPolicy resources. - */ -@Immutable -public final class ProtectionPolicyResourceList extends ResourceList { - /* - * List of resources. - */ - private List value; - - /* - * The URI to fetch the next page of resources, with each API call returning up to 200 resources per page. Use - * ListNext() to fetch the next page if the total number of resources exceeds 200. - */ - private String nextLink; - - /** - * Creates an instance of ProtectionPolicyResourceList class. - */ - private ProtectionPolicyResourceList() { - } - - /** - * Get the value property: List of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page of resources, with each API call returning up to 200 - * resources per page. Use ListNext() to fetch the next page if the total number of resources exceeds 200. - * - * @return the nextLink value. - */ - @Override - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", nextLink()); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ProtectionPolicyResourceList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProtectionPolicyResourceList 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 ProtectionPolicyResourceList. - */ - public static ProtectionPolicyResourceList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProtectionPolicyResourceList deserializedProtectionPolicyResourceList = new ProtectionPolicyResourceList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedProtectionPolicyResourceList.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ProtectionPolicyResourceInner.fromJson(reader1)); - deserializedProtectionPolicyResourceList.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedProtectionPolicyResourceList; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/RecoveryPointResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/RecoveryPointResourceList.java deleted file mode 100644 index 72b62d9f8268..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/RecoveryPointResourceList.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceList; -import java.io.IOException; -import java.util.List; - -/** - * List of RecoveryPoint resources. - */ -@Immutable -public final class RecoveryPointResourceList extends ResourceList { - /* - * List of resources. - */ - private List value; - - /* - * The URI to fetch the next page of resources, with each API call returning up to 200 resources per page. Use - * ListNext() to fetch the next page if the total number of resources exceeds 200. - */ - private String nextLink; - - /** - * Creates an instance of RecoveryPointResourceList class. - */ - private RecoveryPointResourceList() { - } - - /** - * Get the value property: List of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page of resources, with each API call returning up to 200 - * resources per page. Use ListNext() to fetch the next page if the total number of resources exceeds 200. - * - * @return the nextLink value. - */ - @Override - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", nextLink()); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RecoveryPointResourceList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RecoveryPointResourceList 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 RecoveryPointResourceList. - */ - public static RecoveryPointResourceList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RecoveryPointResourceList deserializedRecoveryPointResourceList = new RecoveryPointResourceList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedRecoveryPointResourceList.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> RecoveryPointResourceInner.fromJson(reader1)); - deserializedRecoveryPointResourceList.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedRecoveryPointResourceList; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ResourceGuardProxyBaseResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ResourceGuardProxyBaseResourceList.java deleted file mode 100644 index fe146ffef132..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/ResourceGuardProxyBaseResourceList.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ResourceGuardProxyBaseResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceList; -import java.io.IOException; -import java.util.List; - -/** - * List of ResourceGuardProxyBase resources. - */ -@Immutable -public final class ResourceGuardProxyBaseResourceList extends ResourceList { - /* - * List of resources. - */ - private List value; - - /* - * The URI to fetch the next page of resources, with each API call returning up to 200 resources per page. Use - * ListNext() to fetch the next page if the total number of resources exceeds 200. - */ - private String nextLink; - - /** - * Creates an instance of ResourceGuardProxyBaseResourceList class. - */ - private ResourceGuardProxyBaseResourceList() { - } - - /** - * Get the value property: List of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page of resources, with each API call returning up to 200 - * resources per page. Use ListNext() to fetch the next page if the total number of resources exceeds 200. - * - * @return the nextLink value. - */ - @Override - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", nextLink()); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceGuardProxyBaseResourceList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceGuardProxyBaseResourceList 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 ResourceGuardProxyBaseResourceList. - */ - public static ResourceGuardProxyBaseResourceList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceGuardProxyBaseResourceList deserializedResourceGuardProxyBaseResourceList - = new ResourceGuardProxyBaseResourceList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedResourceGuardProxyBaseResourceList.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ResourceGuardProxyBaseResourceInner.fromJson(reader1)); - deserializedResourceGuardProxyBaseResourceList.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedResourceGuardProxyBaseResourceList; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/WorkloadItemResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/WorkloadItemResourceList.java deleted file mode 100644 index 72a2f313fc69..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/WorkloadItemResourceList.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadItemResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceList; -import java.io.IOException; -import java.util.List; - -/** - * List of WorkloadItem resources. - */ -@Immutable -public final class WorkloadItemResourceList extends ResourceList { - /* - * List of resources. - */ - private List value; - - /* - * The URI to fetch the next page of resources, with each API call returning up to 200 resources per page. Use - * ListNext() to fetch the next page if the total number of resources exceeds 200. - */ - private String nextLink; - - /** - * Creates an instance of WorkloadItemResourceList class. - */ - private WorkloadItemResourceList() { - } - - /** - * Get the value property: List of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page of resources, with each API call returning up to 200 - * resources per page. Use ListNext() to fetch the next page if the total number of resources exceeds 200. - * - * @return the nextLink value. - */ - @Override - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", nextLink()); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WorkloadItemResourceList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WorkloadItemResourceList 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 WorkloadItemResourceList. - */ - public static WorkloadItemResourceList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WorkloadItemResourceList deserializedWorkloadItemResourceList = new WorkloadItemResourceList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedWorkloadItemResourceList.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> WorkloadItemResourceInner.fromJson(reader1)); - deserializedWorkloadItemResourceList.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedWorkloadItemResourceList; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/WorkloadProtectableItemResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/WorkloadProtectableItemResourceList.java deleted file mode 100644 index 6b033ef5d58d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/WorkloadProtectableItemResourceList.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadProtectableItemResourceInner; -import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceList; -import java.io.IOException; -import java.util.List; - -/** - * List of WorkloadProtectableItem resources. - */ -@Immutable -public final class WorkloadProtectableItemResourceList extends ResourceList { - /* - * List of resources. - */ - private List value; - - /* - * The URI to fetch the next page of resources, with each API call returning up to 200 resources per page. Use - * ListNext() to fetch the next page if the total number of resources exceeds 200. - */ - private String nextLink; - - /** - * Creates an instance of WorkloadProtectableItemResourceList class. - */ - private WorkloadProtectableItemResourceList() { - } - - /** - * Get the value property: List of resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page of resources, with each API call returning up to 200 - * resources per page. Use ListNext() to fetch the next page if the total number of resources exceeds 200. - * - * @return the nextLink value. - */ - @Override - public String nextLink() { - return this.nextLink; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", nextLink()); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WorkloadProtectableItemResourceList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WorkloadProtectableItemResourceList 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 WorkloadProtectableItemResourceList. - */ - public static WorkloadProtectableItemResourceList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WorkloadProtectableItemResourceList deserializedWorkloadProtectableItemResourceList - = new WorkloadProtectableItemResourceList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedWorkloadProtectableItemResourceList.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> WorkloadProtectableItemResourceInner.fromJson(reader1)); - deserializedWorkloadProtectableItemResourceList.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedWorkloadProtectableItemResourceList; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/package-info.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/package-info.java deleted file mode 100644 index ed1af0dd1190..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// 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 RecoveryServicesBackup. - * Open API 2.0 Specs for Azure RecoveryServices Backup service. - */ -package com.azure.resourcemanager.recoveryservicesbackup.implementation; diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AcquireStorageAccountLock.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AcquireStorageAccountLock.java deleted file mode 100644 index 9c6dfdce810c..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AcquireStorageAccountLock.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Whether storage account lock is to be acquired for this container or not. - */ -public final class AcquireStorageAccountLock extends ExpandableStringEnum { - /** - * Static value Acquire for AcquireStorageAccountLock. - */ - public static final AcquireStorageAccountLock ACQUIRE = fromString("Acquire"); - - /** - * Static value NotAcquire for AcquireStorageAccountLock. - */ - public static final AcquireStorageAccountLock NOT_ACQUIRE = fromString("NotAcquire"); - - /** - * Creates a new instance of AcquireStorageAccountLock value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AcquireStorageAccountLock() { - } - - /** - * Creates or finds a AcquireStorageAccountLock from its string representation. - * - * @param name a name to look for. - * @return the corresponding AcquireStorageAccountLock. - */ - public static AcquireStorageAccountLock fromString(String name) { - return fromString(name, AcquireStorageAccountLock.class); - } - - /** - * Gets known AcquireStorageAccountLock values. - * - * @return known AcquireStorageAccountLock values. - */ - public static Collection values() { - return values(AcquireStorageAccountLock.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupGoalFeatureSupportRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupGoalFeatureSupportRequest.java deleted file mode 100644 index cc5f883b3a1b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupGoalFeatureSupportRequest.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure backup goal feature specific request. - */ -@Immutable -public final class AzureBackupGoalFeatureSupportRequest extends FeatureSupportRequest { - /* - * backup support feature type. - */ - private String featureType = "AzureBackupGoals"; - - /** - * Creates an instance of AzureBackupGoalFeatureSupportRequest class. - */ - public AzureBackupGoalFeatureSupportRequest() { - } - - /** - * Get the featureType property: backup support feature type. - * - * @return the featureType value. - */ - @Override - public String featureType() { - return this.featureType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("featureType", this.featureType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureBackupGoalFeatureSupportRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureBackupGoalFeatureSupportRequest 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 AzureBackupGoalFeatureSupportRequest. - */ - public static AzureBackupGoalFeatureSupportRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureBackupGoalFeatureSupportRequest deserializedAzureBackupGoalFeatureSupportRequest - = new AzureBackupGoalFeatureSupportRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("featureType".equals(fieldName)) { - deserializedAzureBackupGoalFeatureSupportRequest.featureType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureBackupGoalFeatureSupportRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerContainer.java deleted file mode 100644 index 781728d80261..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerContainer.java +++ /dev/null @@ -1,246 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * AzureBackupServer (DPMVenus) workload-specific protection container. - */ -@Fluent -public final class AzureBackupServerContainer extends DpmContainer { - /* - * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines - * 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer - */ - private ProtectableContainerType containerType = ProtectableContainerType.AZURE_BACKUP_SERVER_CONTAINER; - - /** - * Creates an instance of AzureBackupServerContainer class. - */ - public AzureBackupServerContainer() { - } - - /** - * Get the containerType property: Type of the container. The value of this property for: 1. Compute Azure VM is - * Microsoft.Compute/virtualMachines 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer. - * - * @return the containerType value. - */ - @Override - public ProtectableContainerType containerType() { - return this.containerType; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureBackupServerContainer withCanReRegister(Boolean canReRegister) { - super.withCanReRegister(canReRegister); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureBackupServerContainer withContainerId(String containerId) { - super.withContainerId(containerId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureBackupServerContainer withProtectedItemCount(Long protectedItemCount) { - super.withProtectedItemCount(protectedItemCount); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureBackupServerContainer withDpmAgentVersion(String dpmAgentVersion) { - super.withDpmAgentVersion(dpmAgentVersion); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureBackupServerContainer withDpmServers(List dpmServers) { - super.withDpmServers(dpmServers); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureBackupServerContainer withUpgradeAvailable(Boolean upgradeAvailable) { - super.withUpgradeAvailable(upgradeAvailable); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureBackupServerContainer withProtectionStatus(String protectionStatus) { - super.withProtectionStatus(protectionStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureBackupServerContainer withExtendedInfo(DpmContainerExtendedInfo extendedInfo) { - super.withExtendedInfo(extendedInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureBackupServerContainer withFriendlyName(String friendlyName) { - super.withFriendlyName(friendlyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureBackupServerContainer withBackupManagementType(BackupManagementType backupManagementType) { - super.withBackupManagementType(backupManagementType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureBackupServerContainer withRegistrationStatus(String registrationStatus) { - super.withRegistrationStatus(registrationStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureBackupServerContainer withHealthStatus(String healthStatus) { - super.withHealthStatus(healthStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureBackupServerContainer withProtectableObjectType(String protectableObjectType) { - super.withProtectableObjectType(protectableObjectType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("registrationStatus", registrationStatus()); - jsonWriter.writeStringField("healthStatus", healthStatus()); - jsonWriter.writeStringField("protectableObjectType", protectableObjectType()); - jsonWriter.writeBooleanField("canReRegister", canReRegister()); - jsonWriter.writeStringField("containerId", containerId()); - jsonWriter.writeNumberField("protectedItemCount", protectedItemCount()); - jsonWriter.writeStringField("dpmAgentVersion", dpmAgentVersion()); - jsonWriter.writeArrayField("dpmServers", dpmServers(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("upgradeAvailable", upgradeAvailable()); - jsonWriter.writeStringField("protectionStatus", protectionStatus()); - jsonWriter.writeJsonField("extendedInfo", extendedInfo()); - jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureBackupServerContainer from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureBackupServerContainer 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 AzureBackupServerContainer. - */ - public static AzureBackupServerContainer fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureBackupServerContainer deserializedAzureBackupServerContainer = new AzureBackupServerContainer(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("friendlyName".equals(fieldName)) { - deserializedAzureBackupServerContainer.withFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedAzureBackupServerContainer - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("registrationStatus".equals(fieldName)) { - deserializedAzureBackupServerContainer.withRegistrationStatus(reader.getString()); - } else if ("healthStatus".equals(fieldName)) { - deserializedAzureBackupServerContainer.withHealthStatus(reader.getString()); - } else if ("protectableObjectType".equals(fieldName)) { - deserializedAzureBackupServerContainer.withProtectableObjectType(reader.getString()); - } else if ("canReRegister".equals(fieldName)) { - deserializedAzureBackupServerContainer - .withCanReRegister(reader.getNullable(JsonReader::getBoolean)); - } else if ("containerId".equals(fieldName)) { - deserializedAzureBackupServerContainer.withContainerId(reader.getString()); - } else if ("protectedItemCount".equals(fieldName)) { - deserializedAzureBackupServerContainer - .withProtectedItemCount(reader.getNullable(JsonReader::getLong)); - } else if ("dpmAgentVersion".equals(fieldName)) { - deserializedAzureBackupServerContainer.withDpmAgentVersion(reader.getString()); - } else if ("dpmServers".equals(fieldName)) { - List dpmServers = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureBackupServerContainer.withDpmServers(dpmServers); - } else if ("upgradeAvailable".equals(fieldName)) { - deserializedAzureBackupServerContainer - .withUpgradeAvailable(reader.getNullable(JsonReader::getBoolean)); - } else if ("protectionStatus".equals(fieldName)) { - deserializedAzureBackupServerContainer.withProtectionStatus(reader.getString()); - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureBackupServerContainer.withExtendedInfo(DpmContainerExtendedInfo.fromJson(reader)); - } else if ("containerType".equals(fieldName)) { - deserializedAzureBackupServerContainer.containerType - = ProtectableContainerType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureBackupServerContainer; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerEngine.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerEngine.java deleted file mode 100644 index 1b62e05238eb..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureBackupServerEngine.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Backup engine type when Azure Backup Server is used to manage the backups. - */ -@Immutable -public final class AzureBackupServerEngine extends BackupEngineBase { - /* - * Type of the backup engine. - */ - private BackupEngineType backupEngineType = BackupEngineType.AZURE_BACKUP_SERVER_ENGINE; - - /** - * Creates an instance of AzureBackupServerEngine class. - */ - private AzureBackupServerEngine() { - } - - /** - * Get the backupEngineType property: Type of the backup engine. - * - * @return the backupEngineType value. - */ - @Override - public BackupEngineType backupEngineType() { - return this.backupEngineType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("registrationStatus", registrationStatus()); - jsonWriter.writeStringField("backupEngineState", backupEngineState()); - jsonWriter.writeStringField("healthStatus", healthStatus()); - jsonWriter.writeBooleanField("canReRegister", canReRegister()); - jsonWriter.writeStringField("backupEngineId", backupEngineId()); - jsonWriter.writeStringField("dpmVersion", dpmVersion()); - jsonWriter.writeStringField("azureBackupAgentVersion", azureBackupAgentVersion()); - jsonWriter.writeBooleanField("isAzureBackupAgentUpgradeAvailable", isAzureBackupAgentUpgradeAvailable()); - jsonWriter.writeBooleanField("isDpmUpgradeAvailable", isDpmUpgradeAvailable()); - jsonWriter.writeJsonField("extendedInfo", extendedInfo()); - jsonWriter.writeStringField("backupEngineType", - this.backupEngineType == null ? null : this.backupEngineType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureBackupServerEngine from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureBackupServerEngine 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 AzureBackupServerEngine. - */ - public static AzureBackupServerEngine fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureBackupServerEngine deserializedAzureBackupServerEngine = new AzureBackupServerEngine(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("friendlyName".equals(fieldName)) { - deserializedAzureBackupServerEngine.withFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedAzureBackupServerEngine - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("registrationStatus".equals(fieldName)) { - deserializedAzureBackupServerEngine.withRegistrationStatus(reader.getString()); - } else if ("backupEngineState".equals(fieldName)) { - deserializedAzureBackupServerEngine.withBackupEngineState(reader.getString()); - } else if ("healthStatus".equals(fieldName)) { - deserializedAzureBackupServerEngine.withHealthStatus(reader.getString()); - } else if ("canReRegister".equals(fieldName)) { - deserializedAzureBackupServerEngine.withCanReRegister(reader.getNullable(JsonReader::getBoolean)); - } else if ("backupEngineId".equals(fieldName)) { - deserializedAzureBackupServerEngine.withBackupEngineId(reader.getString()); - } else if ("dpmVersion".equals(fieldName)) { - deserializedAzureBackupServerEngine.withDpmVersion(reader.getString()); - } else if ("azureBackupAgentVersion".equals(fieldName)) { - deserializedAzureBackupServerEngine.withAzureBackupAgentVersion(reader.getString()); - } else if ("isAzureBackupAgentUpgradeAvailable".equals(fieldName)) { - deserializedAzureBackupServerEngine - .withIsAzureBackupAgentUpgradeAvailable(reader.getNullable(JsonReader::getBoolean)); - } else if ("isDpmUpgradeAvailable".equals(fieldName)) { - deserializedAzureBackupServerEngine - .withIsDpmUpgradeAvailable(reader.getNullable(JsonReader::getBoolean)); - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureBackupServerEngine.withExtendedInfo(BackupEngineExtendedInfo.fromJson(reader)); - } else if ("backupEngineType".equals(fieldName)) { - deserializedAzureBackupServerEngine.backupEngineType - = BackupEngineType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureBackupServerEngine; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareBackupRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareBackupRequest.java deleted file mode 100644 index aebef802e5bf..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareBackupRequest.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * AzureFileShare workload-specific backup request. - */ -@Fluent -public final class AzureFileShareBackupRequest extends BackupRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureFileShareBackupRequest"; - - /* - * Backup copy will expire after the time specified (UTC). - */ - private OffsetDateTime recoveryPointExpiryTimeInUtc; - - /** - * Creates an instance of AzureFileShareBackupRequest class. - */ - public AzureFileShareBackupRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the recoveryPointExpiryTimeInUtc property: Backup copy will expire after the time specified (UTC). - * - * @return the recoveryPointExpiryTimeInUtc value. - */ - public OffsetDateTime recoveryPointExpiryTimeInUtc() { - return this.recoveryPointExpiryTimeInUtc; - } - - /** - * Set the recoveryPointExpiryTimeInUtc property: Backup copy will expire after the time specified (UTC). - * - * @param recoveryPointExpiryTimeInUtc the recoveryPointExpiryTimeInUtc value to set. - * @return the AzureFileShareBackupRequest object itself. - */ - public AzureFileShareBackupRequest withRecoveryPointExpiryTimeInUtc(OffsetDateTime recoveryPointExpiryTimeInUtc) { - this.recoveryPointExpiryTimeInUtc = recoveryPointExpiryTimeInUtc; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("recoveryPointExpiryTimeInUTC", - this.recoveryPointExpiryTimeInUtc == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.recoveryPointExpiryTimeInUtc)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureFileShareBackupRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureFileShareBackupRequest 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 AzureFileShareBackupRequest. - */ - public static AzureFileShareBackupRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureFileShareBackupRequest deserializedAzureFileShareBackupRequest = new AzureFileShareBackupRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedAzureFileShareBackupRequest.objectType = reader.getString(); - } else if ("recoveryPointExpiryTimeInUTC".equals(fieldName)) { - deserializedAzureFileShareBackupRequest.recoveryPointExpiryTimeInUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureFileShareBackupRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectableItem.java deleted file mode 100644 index 7b8dae9f8dce..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectableItem.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Protectable item for Azure Fileshare workloads. - */ -@Immutable -public final class AzureFileShareProtectableItem extends WorkloadProtectableItem { - /* - * Type of the backup item. - */ - private String protectableItemType = "AzureFileShare"; - - /* - * Full Fabric ID of container to which this protectable item belongs. For example, ARM ID. - */ - private String parentContainerFabricId; - - /* - * Friendly name of container to which this protectable item belongs. - */ - private String parentContainerFriendlyName; - - /* - * File Share type XSync or XSMB. - */ - private AzureFileShareType azureFileShareType; - - /** - * Creates an instance of AzureFileShareProtectableItem class. - */ - private AzureFileShareProtectableItem() { - } - - /** - * Get the protectableItemType property: Type of the backup item. - * - * @return the protectableItemType value. - */ - @Override - public String protectableItemType() { - return this.protectableItemType; - } - - /** - * Get the parentContainerFabricId property: Full Fabric ID of container to which this protectable item belongs. For - * example, ARM ID. - * - * @return the parentContainerFabricId value. - */ - public String parentContainerFabricId() { - return this.parentContainerFabricId; - } - - /** - * Get the parentContainerFriendlyName property: Friendly name of container to which this protectable item belongs. - * - * @return the parentContainerFriendlyName value. - */ - public String parentContainerFriendlyName() { - return this.parentContainerFriendlyName; - } - - /** - * Get the azureFileShareType property: File Share type XSync or XSMB. - * - * @return the azureFileShareType value. - */ - public AzureFileShareType azureFileShareType() { - return this.azureFileShareType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("protectableItemType", this.protectableItemType); - jsonWriter.writeStringField("parentContainerFabricId", this.parentContainerFabricId); - jsonWriter.writeStringField("parentContainerFriendlyName", this.parentContainerFriendlyName); - jsonWriter.writeStringField("azureFileShareType", - this.azureFileShareType == null ? null : this.azureFileShareType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureFileShareProtectableItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureFileShareProtectableItem 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 AzureFileShareProtectableItem. - */ - public static AzureFileShareProtectableItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureFileShareProtectableItem deserializedAzureFileShareProtectableItem - = new AzureFileShareProtectableItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureFileShareProtectableItem.withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureFileShareProtectableItem.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureFileShareProtectableItem.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureFileShareProtectableItem - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("protectableItemType".equals(fieldName)) { - deserializedAzureFileShareProtectableItem.protectableItemType = reader.getString(); - } else if ("parentContainerFabricId".equals(fieldName)) { - deserializedAzureFileShareProtectableItem.parentContainerFabricId = reader.getString(); - } else if ("parentContainerFriendlyName".equals(fieldName)) { - deserializedAzureFileShareProtectableItem.parentContainerFriendlyName = reader.getString(); - } else if ("azureFileShareType".equals(fieldName)) { - deserializedAzureFileShareProtectableItem.azureFileShareType - = AzureFileShareType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureFileShareProtectableItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectionPolicy.java deleted file mode 100644 index 745b4258f196..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProtectionPolicy.java +++ /dev/null @@ -1,251 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * AzureStorage backup policy. - */ -@Fluent -public final class AzureFileShareProtectionPolicy extends ProtectionPolicy { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String backupManagementType = "AzureStorage"; - - /* - * Type of workload for the backup management - */ - private WorkloadType workLoadType; - - /* - * Backup schedule specified as part of backup policy. - */ - private SchedulePolicy schedulePolicy; - - /* - * Retention policy with the details on backup copy retention ranges. - */ - private RetentionPolicy retentionPolicy; - - /* - * Retention policy with the details on hardened backup copy retention ranges. - */ - private VaultRetentionPolicy vaultRetentionPolicy; - - /* - * TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - */ - private String timeZone; - - /** - * Creates an instance of AzureFileShareProtectionPolicy class. - */ - public AzureFileShareProtectionPolicy() { - } - - /** - * Get the backupManagementType property: This property will be used as the discriminator for deciding the specific - * types in the polymorphic chain of types. - * - * @return the backupManagementType value. - */ - @Override - public String backupManagementType() { - return this.backupManagementType; - } - - /** - * Get the workLoadType property: Type of workload for the backup management. - * - * @return the workLoadType value. - */ - public WorkloadType workLoadType() { - return this.workLoadType; - } - - /** - * Set the workLoadType property: Type of workload for the backup management. - * - * @param workLoadType the workLoadType value to set. - * @return the AzureFileShareProtectionPolicy object itself. - */ - public AzureFileShareProtectionPolicy withWorkLoadType(WorkloadType workLoadType) { - this.workLoadType = workLoadType; - return this; - } - - /** - * Get the schedulePolicy property: Backup schedule specified as part of backup policy. - * - * @return the schedulePolicy value. - */ - public SchedulePolicy schedulePolicy() { - return this.schedulePolicy; - } - - /** - * Set the schedulePolicy property: Backup schedule specified as part of backup policy. - * - * @param schedulePolicy the schedulePolicy value to set. - * @return the AzureFileShareProtectionPolicy object itself. - */ - public AzureFileShareProtectionPolicy withSchedulePolicy(SchedulePolicy schedulePolicy) { - this.schedulePolicy = schedulePolicy; - return this; - } - - /** - * Get the retentionPolicy property: Retention policy with the details on backup copy retention ranges. - * - * @return the retentionPolicy value. - */ - public RetentionPolicy retentionPolicy() { - return this.retentionPolicy; - } - - /** - * Set the retentionPolicy property: Retention policy with the details on backup copy retention ranges. - * - * @param retentionPolicy the retentionPolicy value to set. - * @return the AzureFileShareProtectionPolicy object itself. - */ - public AzureFileShareProtectionPolicy withRetentionPolicy(RetentionPolicy retentionPolicy) { - this.retentionPolicy = retentionPolicy; - return this; - } - - /** - * Get the vaultRetentionPolicy property: Retention policy with the details on hardened backup copy retention - * ranges. - * - * @return the vaultRetentionPolicy value. - */ - public VaultRetentionPolicy vaultRetentionPolicy() { - return this.vaultRetentionPolicy; - } - - /** - * Set the vaultRetentionPolicy property: Retention policy with the details on hardened backup copy retention - * ranges. - * - * @param vaultRetentionPolicy the vaultRetentionPolicy value to set. - * @return the AzureFileShareProtectionPolicy object itself. - */ - public AzureFileShareProtectionPolicy withVaultRetentionPolicy(VaultRetentionPolicy vaultRetentionPolicy) { - this.vaultRetentionPolicy = vaultRetentionPolicy; - return this; - } - - /** - * Get the timeZone property: TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - * - * @return the timeZone value. - */ - public String timeZone() { - return this.timeZone; - } - - /** - * Set the timeZone property: TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - * - * @param timeZone the timeZone value to set. - * @return the AzureFileShareProtectionPolicy object itself. - */ - public AzureFileShareProtectionPolicy withTimeZone(String timeZone) { - this.timeZone = timeZone; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureFileShareProtectionPolicy withProtectedItemsCount(Integer protectedItemsCount) { - super.withProtectedItemsCount(protectedItemsCount); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureFileShareProtectionPolicy - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("protectedItemsCount", protectedItemsCount()); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("backupManagementType", this.backupManagementType); - jsonWriter.writeStringField("workLoadType", this.workLoadType == null ? null : this.workLoadType.toString()); - jsonWriter.writeJsonField("schedulePolicy", this.schedulePolicy); - jsonWriter.writeJsonField("retentionPolicy", this.retentionPolicy); - jsonWriter.writeJsonField("vaultRetentionPolicy", this.vaultRetentionPolicy); - jsonWriter.writeStringField("timeZone", this.timeZone); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureFileShareProtectionPolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureFileShareProtectionPolicy 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 AzureFileShareProtectionPolicy. - */ - public static AzureFileShareProtectionPolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureFileShareProtectionPolicy deserializedAzureFileShareProtectionPolicy - = new AzureFileShareProtectionPolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("protectedItemsCount".equals(fieldName)) { - deserializedAzureFileShareProtectionPolicy - .withProtectedItemsCount(reader.getNullable(JsonReader::getInt)); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureFileShareProtectionPolicy - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("backupManagementType".equals(fieldName)) { - deserializedAzureFileShareProtectionPolicy.backupManagementType = reader.getString(); - } else if ("workLoadType".equals(fieldName)) { - deserializedAzureFileShareProtectionPolicy.workLoadType - = WorkloadType.fromString(reader.getString()); - } else if ("schedulePolicy".equals(fieldName)) { - deserializedAzureFileShareProtectionPolicy.schedulePolicy = SchedulePolicy.fromJson(reader); - } else if ("retentionPolicy".equals(fieldName)) { - deserializedAzureFileShareProtectionPolicy.retentionPolicy = RetentionPolicy.fromJson(reader); - } else if ("vaultRetentionPolicy".equals(fieldName)) { - deserializedAzureFileShareProtectionPolicy.vaultRetentionPolicy - = VaultRetentionPolicy.fromJson(reader); - } else if ("timeZone".equals(fieldName)) { - deserializedAzureFileShareProtectionPolicy.timeZone = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureFileShareProtectionPolicy; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProvisionIlrRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProvisionIlrRequest.java deleted file mode 100644 index 0af9848ed374..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareProvisionIlrRequest.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Update snapshot Uri with the correct friendly Name of the source Azure file share. - */ -@Fluent -public final class AzureFileShareProvisionIlrRequest extends IlrRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureFileShareProvisionILRRequest"; - - /* - * Recovery point ID. - */ - private String recoveryPointId; - - /* - * Source Storage account ARM Id - */ - private String sourceResourceId; - - /** - * Creates an instance of AzureFileShareProvisionIlrRequest class. - */ - public AzureFileShareProvisionIlrRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the recoveryPointId property: Recovery point ID. - * - * @return the recoveryPointId value. - */ - public String recoveryPointId() { - return this.recoveryPointId; - } - - /** - * Set the recoveryPointId property: Recovery point ID. - * - * @param recoveryPointId the recoveryPointId value to set. - * @return the AzureFileShareProvisionIlrRequest object itself. - */ - public AzureFileShareProvisionIlrRequest withRecoveryPointId(String recoveryPointId) { - this.recoveryPointId = recoveryPointId; - return this; - } - - /** - * Get the sourceResourceId property: Source Storage account ARM Id. - * - * @return the sourceResourceId value. - */ - public String sourceResourceId() { - return this.sourceResourceId; - } - - /** - * Set the sourceResourceId property: Source Storage account ARM Id. - * - * @param sourceResourceId the sourceResourceId value to set. - * @return the AzureFileShareProvisionIlrRequest object itself. - */ - public AzureFileShareProvisionIlrRequest withSourceResourceId(String sourceResourceId) { - this.sourceResourceId = sourceResourceId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("recoveryPointId", this.recoveryPointId); - jsonWriter.writeStringField("sourceResourceId", this.sourceResourceId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureFileShareProvisionIlrRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureFileShareProvisionIlrRequest 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 AzureFileShareProvisionIlrRequest. - */ - public static AzureFileShareProvisionIlrRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureFileShareProvisionIlrRequest deserializedAzureFileShareProvisionIlrRequest - = new AzureFileShareProvisionIlrRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedAzureFileShareProvisionIlrRequest.objectType = reader.getString(); - } else if ("recoveryPointId".equals(fieldName)) { - deserializedAzureFileShareProvisionIlrRequest.recoveryPointId = reader.getString(); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureFileShareProvisionIlrRequest.sourceResourceId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureFileShareProvisionIlrRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRecoveryPoint.java deleted file mode 100644 index 9cf1f9e1c827..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRecoveryPoint.java +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Azure File Share workload specific backup copy. - */ -@Immutable -public final class AzureFileShareRecoveryPoint extends RecoveryPoint { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureFileShareRecoveryPoint"; - - /* - * Type of the backup copy. Specifies whether it is a crash consistent backup or app consistent. - */ - private String recoveryPointType; - - /* - * Time at which this backup copy was created. - */ - private OffsetDateTime recoveryPointTime; - - /* - * Contains Url to the snapshot of fileshare, if applicable - */ - private String fileShareSnapshotUri; - - /* - * Contains recovery point size - */ - private Integer recoveryPointSizeInGB; - - /* - * Properties of Recovery Point - */ - private RecoveryPointProperties recoveryPointProperties; - - /* - * Recovery point tier information. - */ - private List recoveryPointTierDetails; - - /** - * Creates an instance of AzureFileShareRecoveryPoint class. - */ - private AzureFileShareRecoveryPoint() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the recoveryPointType property: Type of the backup copy. Specifies whether it is a crash consistent backup or - * app consistent. - * - * @return the recoveryPointType value. - */ - public String recoveryPointType() { - return this.recoveryPointType; - } - - /** - * Get the recoveryPointTime property: Time at which this backup copy was created. - * - * @return the recoveryPointTime value. - */ - public OffsetDateTime recoveryPointTime() { - return this.recoveryPointTime; - } - - /** - * Get the fileShareSnapshotUri property: Contains Url to the snapshot of fileshare, if applicable. - * - * @return the fileShareSnapshotUri value. - */ - public String fileShareSnapshotUri() { - return this.fileShareSnapshotUri; - } - - /** - * Get the recoveryPointSizeInGB property: Contains recovery point size. - * - * @return the recoveryPointSizeInGB value. - */ - public Integer recoveryPointSizeInGB() { - return this.recoveryPointSizeInGB; - } - - /** - * Get the recoveryPointProperties property: Properties of Recovery Point. - * - * @return the recoveryPointProperties value. - */ - public RecoveryPointProperties recoveryPointProperties() { - return this.recoveryPointProperties; - } - - /** - * Get the recoveryPointTierDetails property: Recovery point tier information. - * - * @return the recoveryPointTierDetails value. - */ - public List recoveryPointTierDetails() { - return this.recoveryPointTierDetails; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("threatStatus", threatStatus() == null ? null : threatStatus().toString()); - jsonWriter.writeArrayField("threatInfo", threatInfo(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("recoveryPointType", this.recoveryPointType); - jsonWriter.writeStringField("recoveryPointTime", - this.recoveryPointTime == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.recoveryPointTime)); - jsonWriter.writeStringField("fileShareSnapshotUri", this.fileShareSnapshotUri); - jsonWriter.writeNumberField("recoveryPointSizeInGB", this.recoveryPointSizeInGB); - jsonWriter.writeJsonField("recoveryPointProperties", this.recoveryPointProperties); - jsonWriter.writeArrayField("recoveryPointTierDetails", this.recoveryPointTierDetails, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureFileShareRecoveryPoint from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureFileShareRecoveryPoint 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 AzureFileShareRecoveryPoint. - */ - public static AzureFileShareRecoveryPoint fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureFileShareRecoveryPoint deserializedAzureFileShareRecoveryPoint = new AzureFileShareRecoveryPoint(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("threatStatus".equals(fieldName)) { - deserializedAzureFileShareRecoveryPoint - .withThreatStatus(ThreatStatus.fromString(reader.getString())); - } else if ("threatInfo".equals(fieldName)) { - List threatInfo = reader.readArray(reader1 -> ThreatInfo.fromJson(reader1)); - deserializedAzureFileShareRecoveryPoint.withThreatInfo(threatInfo); - } else if ("objectType".equals(fieldName)) { - deserializedAzureFileShareRecoveryPoint.objectType = reader.getString(); - } else if ("recoveryPointType".equals(fieldName)) { - deserializedAzureFileShareRecoveryPoint.recoveryPointType = reader.getString(); - } else if ("recoveryPointTime".equals(fieldName)) { - deserializedAzureFileShareRecoveryPoint.recoveryPointTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("fileShareSnapshotUri".equals(fieldName)) { - deserializedAzureFileShareRecoveryPoint.fileShareSnapshotUri = reader.getString(); - } else if ("recoveryPointSizeInGB".equals(fieldName)) { - deserializedAzureFileShareRecoveryPoint.recoveryPointSizeInGB - = reader.getNullable(JsonReader::getInt); - } else if ("recoveryPointProperties".equals(fieldName)) { - deserializedAzureFileShareRecoveryPoint.recoveryPointProperties - = RecoveryPointProperties.fromJson(reader); - } else if ("recoveryPointTierDetails".equals(fieldName)) { - List recoveryPointTierDetails - = reader.readArray(reader1 -> RecoveryPointTierInformation.fromJson(reader1)); - deserializedAzureFileShareRecoveryPoint.recoveryPointTierDetails = recoveryPointTierDetails; - } else { - reader.skipChildren(); - } - } - - return deserializedAzureFileShareRecoveryPoint; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRestoreRequest.java deleted file mode 100644 index 766203f8cea7..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRestoreRequest.java +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * AzureFileShare Restore Request. - */ -@Fluent -public final class AzureFileShareRestoreRequest extends RestoreRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureFileShareRestoreRequest"; - - /* - * Type of this recovery. - */ - private RecoveryType recoveryType; - - /* - * Source storage account ARM Id - */ - private String sourceResourceId; - - /* - * Options to resolve copy conflicts. - */ - private CopyOptions copyOptions; - - /* - * Restore Type (FullShareRestore or ItemLevelRestore) - */ - private RestoreRequestType restoreRequestType; - - /* - * List of Source Files/Folders(which need to recover) and TargetFolderPath details - */ - private List restoreFileSpecs; - - /* - * Target File Share Details - */ - private TargetAfsRestoreInfo targetDetails; - - /** - * Creates an instance of AzureFileShareRestoreRequest class. - */ - public AzureFileShareRestoreRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the recoveryType property: Type of this recovery. - * - * @return the recoveryType value. - */ - public RecoveryType recoveryType() { - return this.recoveryType; - } - - /** - * Set the recoveryType property: Type of this recovery. - * - * @param recoveryType the recoveryType value to set. - * @return the AzureFileShareRestoreRequest object itself. - */ - public AzureFileShareRestoreRequest withRecoveryType(RecoveryType recoveryType) { - this.recoveryType = recoveryType; - return this; - } - - /** - * Get the sourceResourceId property: Source storage account ARM Id. - * - * @return the sourceResourceId value. - */ - public String sourceResourceId() { - return this.sourceResourceId; - } - - /** - * Set the sourceResourceId property: Source storage account ARM Id. - * - * @param sourceResourceId the sourceResourceId value to set. - * @return the AzureFileShareRestoreRequest object itself. - */ - public AzureFileShareRestoreRequest withSourceResourceId(String sourceResourceId) { - this.sourceResourceId = sourceResourceId; - return this; - } - - /** - * Get the copyOptions property: Options to resolve copy conflicts. - * - * @return the copyOptions value. - */ - public CopyOptions copyOptions() { - return this.copyOptions; - } - - /** - * Set the copyOptions property: Options to resolve copy conflicts. - * - * @param copyOptions the copyOptions value to set. - * @return the AzureFileShareRestoreRequest object itself. - */ - public AzureFileShareRestoreRequest withCopyOptions(CopyOptions copyOptions) { - this.copyOptions = copyOptions; - return this; - } - - /** - * Get the restoreRequestType property: Restore Type (FullShareRestore or ItemLevelRestore). - * - * @return the restoreRequestType value. - */ - public RestoreRequestType restoreRequestType() { - return this.restoreRequestType; - } - - /** - * Set the restoreRequestType property: Restore Type (FullShareRestore or ItemLevelRestore). - * - * @param restoreRequestType the restoreRequestType value to set. - * @return the AzureFileShareRestoreRequest object itself. - */ - public AzureFileShareRestoreRequest withRestoreRequestType(RestoreRequestType restoreRequestType) { - this.restoreRequestType = restoreRequestType; - return this; - } - - /** - * Get the restoreFileSpecs property: List of Source Files/Folders(which need to recover) and TargetFolderPath - * details. - * - * @return the restoreFileSpecs value. - */ - public List restoreFileSpecs() { - return this.restoreFileSpecs; - } - - /** - * Set the restoreFileSpecs property: List of Source Files/Folders(which need to recover) and TargetFolderPath - * details. - * - * @param restoreFileSpecs the restoreFileSpecs value to set. - * @return the AzureFileShareRestoreRequest object itself. - */ - public AzureFileShareRestoreRequest withRestoreFileSpecs(List restoreFileSpecs) { - this.restoreFileSpecs = restoreFileSpecs; - return this; - } - - /** - * Get the targetDetails property: Target File Share Details. - * - * @return the targetDetails value. - */ - public TargetAfsRestoreInfo targetDetails() { - return this.targetDetails; - } - - /** - * Set the targetDetails property: Target File Share Details. - * - * @param targetDetails the targetDetails value to set. - * @return the AzureFileShareRestoreRequest object itself. - */ - public AzureFileShareRestoreRequest withTargetDetails(TargetAfsRestoreInfo targetDetails) { - this.targetDetails = targetDetails; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureFileShareRestoreRequest - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("recoveryType", this.recoveryType == null ? null : this.recoveryType.toString()); - jsonWriter.writeStringField("sourceResourceId", this.sourceResourceId); - jsonWriter.writeStringField("copyOptions", this.copyOptions == null ? null : this.copyOptions.toString()); - jsonWriter.writeStringField("restoreRequestType", - this.restoreRequestType == null ? null : this.restoreRequestType.toString()); - jsonWriter.writeArrayField("restoreFileSpecs", this.restoreFileSpecs, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("targetDetails", this.targetDetails); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureFileShareRestoreRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureFileShareRestoreRequest 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 AzureFileShareRestoreRequest. - */ - public static AzureFileShareRestoreRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureFileShareRestoreRequest deserializedAzureFileShareRestoreRequest = new AzureFileShareRestoreRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureFileShareRestoreRequest - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("objectType".equals(fieldName)) { - deserializedAzureFileShareRestoreRequest.objectType = reader.getString(); - } else if ("recoveryType".equals(fieldName)) { - deserializedAzureFileShareRestoreRequest.recoveryType = RecoveryType.fromString(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureFileShareRestoreRequest.sourceResourceId = reader.getString(); - } else if ("copyOptions".equals(fieldName)) { - deserializedAzureFileShareRestoreRequest.copyOptions = CopyOptions.fromString(reader.getString()); - } else if ("restoreRequestType".equals(fieldName)) { - deserializedAzureFileShareRestoreRequest.restoreRequestType - = RestoreRequestType.fromString(reader.getString()); - } else if ("restoreFileSpecs".equals(fieldName)) { - List restoreFileSpecs - = reader.readArray(reader1 -> RestoreFileSpecs.fromJson(reader1)); - deserializedAzureFileShareRestoreRequest.restoreFileSpecs = restoreFileSpecs; - } else if ("targetDetails".equals(fieldName)) { - deserializedAzureFileShareRestoreRequest.targetDetails = TargetAfsRestoreInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureFileShareRestoreRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareType.java deleted file mode 100644 index 514224945268..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareType.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * File Share type XSync or XSMB. - */ -public final class AzureFileShareType extends ExpandableStringEnum { - /** - * Static value Invalid for AzureFileShareType. - */ - public static final AzureFileShareType INVALID = fromString("Invalid"); - - /** - * Static value XSMB for AzureFileShareType. - */ - public static final AzureFileShareType XSMB = fromString("XSMB"); - - /** - * Static value XSync for AzureFileShareType. - */ - public static final AzureFileShareType XSYNC = fromString("XSync"); - - /** - * Creates a new instance of AzureFileShareType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AzureFileShareType() { - } - - /** - * Creates or finds a AzureFileShareType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AzureFileShareType. - */ - public static AzureFileShareType fromString(String name) { - return fromString(name, AzureFileShareType.class); - } - - /** - * Gets known AzureFileShareType values. - * - * @return known AzureFileShareType values. - */ - public static Collection values() { - return values(AzureFileShareType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItem.java deleted file mode 100644 index 24d9dc88296c..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItem.java +++ /dev/null @@ -1,495 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * Azure File Share workload-specific backup item. - */ -@Fluent -public final class AzureFileshareProtectedItem extends ProtectedItem { - /* - * backup item type. - */ - private String protectedItemType = "AzureFileShareProtectedItem"; - - /* - * Friendly name of the fileshare represented by this backup item. - */ - private String friendlyName; - - /* - * Backup status of this backup item. - */ - private String protectionStatus; - - /* - * Backup state of this backup item. - */ - private ProtectionState protectionState; - - /* - * Last backup operation status. Possible values: Healthy, Unhealthy. - */ - private String lastBackupStatus; - - /* - * Timestamp of the last backup operation on this backup item. - */ - private OffsetDateTime lastBackupTime; - - /* - * Health details of different KPIs - */ - private Map kpisHealths; - - /* - * Additional information with this backup item. - */ - private AzureFileshareProtectedItemExtendedInfo extendedInfo; - - /** - * Creates an instance of AzureFileshareProtectedItem class. - */ - public AzureFileshareProtectedItem() { - } - - /** - * Get the protectedItemType property: backup item type. - * - * @return the protectedItemType value. - */ - @Override - public String protectedItemType() { - return this.protectedItemType; - } - - /** - * Get the friendlyName property: Friendly name of the fileshare represented by this backup item. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.friendlyName; - } - - /** - * Set the friendlyName property: Friendly name of the fileshare represented by this backup item. - * - * @param friendlyName the friendlyName value to set. - * @return the AzureFileshareProtectedItem object itself. - */ - public AzureFileshareProtectedItem withFriendlyName(String friendlyName) { - this.friendlyName = friendlyName; - return this; - } - - /** - * Get the protectionStatus property: Backup status of this backup item. - * - * @return the protectionStatus value. - */ - public String protectionStatus() { - return this.protectionStatus; - } - - /** - * Set the protectionStatus property: Backup status of this backup item. - * - * @param protectionStatus the protectionStatus value to set. - * @return the AzureFileshareProtectedItem object itself. - */ - public AzureFileshareProtectedItem withProtectionStatus(String protectionStatus) { - this.protectionStatus = protectionStatus; - return this; - } - - /** - * Get the protectionState property: Backup state of this backup item. - * - * @return the protectionState value. - */ - public ProtectionState protectionState() { - return this.protectionState; - } - - /** - * Set the protectionState property: Backup state of this backup item. - * - * @param protectionState the protectionState value to set. - * @return the AzureFileshareProtectedItem object itself. - */ - public AzureFileshareProtectedItem withProtectionState(ProtectionState protectionState) { - this.protectionState = protectionState; - return this; - } - - /** - * Get the lastBackupStatus property: Last backup operation status. Possible values: Healthy, Unhealthy. - * - * @return the lastBackupStatus value. - */ - public String lastBackupStatus() { - return this.lastBackupStatus; - } - - /** - * Set the lastBackupStatus property: Last backup operation status. Possible values: Healthy, Unhealthy. - * - * @param lastBackupStatus the lastBackupStatus value to set. - * @return the AzureFileshareProtectedItem object itself. - */ - public AzureFileshareProtectedItem withLastBackupStatus(String lastBackupStatus) { - this.lastBackupStatus = lastBackupStatus; - return this; - } - - /** - * Get the lastBackupTime property: Timestamp of the last backup operation on this backup item. - * - * @return the lastBackupTime value. - */ - public OffsetDateTime lastBackupTime() { - return this.lastBackupTime; - } - - /** - * Set the lastBackupTime property: Timestamp of the last backup operation on this backup item. - * - * @param lastBackupTime the lastBackupTime value to set. - * @return the AzureFileshareProtectedItem object itself. - */ - public AzureFileshareProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) { - this.lastBackupTime = lastBackupTime; - return this; - } - - /** - * Get the kpisHealths property: Health details of different KPIs. - * - * @return the kpisHealths value. - */ - public Map kpisHealths() { - return this.kpisHealths; - } - - /** - * Set the kpisHealths property: Health details of different KPIs. - * - * @param kpisHealths the kpisHealths value to set. - * @return the AzureFileshareProtectedItem object itself. - */ - public AzureFileshareProtectedItem withKpisHealths(Map kpisHealths) { - this.kpisHealths = kpisHealths; - return this; - } - - /** - * Get the extendedInfo property: Additional information with this backup item. - * - * @return the extendedInfo value. - */ - public AzureFileshareProtectedItemExtendedInfo extendedInfo() { - return this.extendedInfo; - } - - /** - * Set the extendedInfo property: Additional information with this backup item. - * - * @param extendedInfo the extendedInfo value to set. - * @return the AzureFileshareProtectedItem object itself. - */ - public AzureFileshareProtectedItem withExtendedInfo(AzureFileshareProtectedItemExtendedInfo extendedInfo) { - this.extendedInfo = extendedInfo; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureFileshareProtectedItem withContainerName(String containerName) { - super.withContainerName(containerName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureFileshareProtectedItem withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureFileshareProtectedItem withPolicyId(String policyId) { - super.withPolicyId(policyId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureFileshareProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { - super.withLastRecoveryPoint(lastRecoveryPoint); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureFileshareProtectedItem withBackupSetName(String backupSetName) { - super.withBackupSetName(backupSetName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureFileshareProtectedItem withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureFileshareProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { - super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureFileshareProtectedItem withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { - super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureFileshareProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { - super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureFileshareProtectedItem withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { - super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureFileshareProtectedItem withIsRehydrate(Boolean isRehydrate) { - super.withIsRehydrate(isRehydrate); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureFileshareProtectedItem withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureFileshareProtectedItem withIsArchiveEnabled(Boolean isArchiveEnabled) { - super.withIsArchiveEnabled(isArchiveEnabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureFileshareProtectedItem withPolicyName(String policyName) { - super.withPolicyName(policyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureFileshareProtectedItem withSoftDeleteRetentionPeriodInDays(Integer softDeleteRetentionPeriodInDays) { - super.withSoftDeleteRetentionPeriodInDays(softDeleteRetentionPeriodInDays); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureFileshareProtectedItem withSourceSideScanInfo(SourceSideScanInfo sourceSideScanInfo) { - super.withSourceSideScanInfo(sourceSideScanInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("containerName", containerName()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("policyId", policyId()); - jsonWriter.writeStringField("lastRecoveryPoint", - lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint())); - jsonWriter.writeStringField("backupSetName", backupSetName()); - jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString()); - jsonWriter.writeStringField("deferredDeleteTimeInUTC", - deferredDeleteTimeInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc())); - jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete()); - jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining()); - jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming()); - jsonWriter.writeBooleanField("isRehydrate", isRehydrate()); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled()); - jsonWriter.writeStringField("policyName", policyName()); - jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriodInDays()); - jsonWriter.writeJsonField("sourceSideScanInfo", sourceSideScanInfo()); - jsonWriter.writeStringField("protectedItemType", this.protectedItemType); - jsonWriter.writeStringField("friendlyName", this.friendlyName); - jsonWriter.writeStringField("protectionStatus", this.protectionStatus); - jsonWriter.writeStringField("protectionState", - this.protectionState == null ? null : this.protectionState.toString()); - jsonWriter.writeStringField("lastBackupStatus", this.lastBackupStatus); - jsonWriter.writeStringField("lastBackupTime", - this.lastBackupTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastBackupTime)); - jsonWriter.writeMapField("kpisHealths", this.kpisHealths, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("extendedInfo", this.extendedInfo); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureFileshareProtectedItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureFileshareProtectedItem 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 AzureFileshareProtectedItem. - */ - public static AzureFileshareProtectedItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureFileshareProtectedItem deserializedAzureFileshareProtectedItem = new AzureFileshareProtectedItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureFileshareProtectedItem - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureFileshareProtectedItem - .withWorkloadType(DataSourceType.fromString(reader.getString())); - } else if ("containerName".equals(fieldName)) { - deserializedAzureFileshareProtectedItem.withContainerName(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureFileshareProtectedItem.withSourceResourceId(reader.getString()); - } else if ("policyId".equals(fieldName)) { - deserializedAzureFileshareProtectedItem.withPolicyId(reader.getString()); - } else if ("lastRecoveryPoint".equals(fieldName)) { - deserializedAzureFileshareProtectedItem.withLastRecoveryPoint(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("backupSetName".equals(fieldName)) { - deserializedAzureFileshareProtectedItem.withBackupSetName(reader.getString()); - } else if ("createMode".equals(fieldName)) { - deserializedAzureFileshareProtectedItem.withCreateMode(CreateMode.fromString(reader.getString())); - } else if ("deferredDeleteTimeInUTC".equals(fieldName)) { - deserializedAzureFileshareProtectedItem.withDeferredDeleteTimeInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("isScheduledForDeferredDelete".equals(fieldName)) { - deserializedAzureFileshareProtectedItem - .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean)); - } else if ("deferredDeleteTimeRemaining".equals(fieldName)) { - deserializedAzureFileshareProtectedItem.withDeferredDeleteTimeRemaining(reader.getString()); - } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) { - deserializedAzureFileshareProtectedItem - .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean)); - } else if ("isRehydrate".equals(fieldName)) { - deserializedAzureFileshareProtectedItem.withIsRehydrate(reader.getNullable(JsonReader::getBoolean)); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureFileshareProtectedItem - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("isArchiveEnabled".equals(fieldName)) { - deserializedAzureFileshareProtectedItem - .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("policyName".equals(fieldName)) { - deserializedAzureFileshareProtectedItem.withPolicyName(reader.getString()); - } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) { - deserializedAzureFileshareProtectedItem - .withSoftDeleteRetentionPeriodInDays(reader.getNullable(JsonReader::getInt)); - } else if ("vaultId".equals(fieldName)) { - deserializedAzureFileshareProtectedItem.withVaultId(reader.getString()); - } else if ("sourceSideScanInfo".equals(fieldName)) { - deserializedAzureFileshareProtectedItem.withSourceSideScanInfo(SourceSideScanInfo.fromJson(reader)); - } else if ("protectedItemType".equals(fieldName)) { - deserializedAzureFileshareProtectedItem.protectedItemType = reader.getString(); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureFileshareProtectedItem.friendlyName = reader.getString(); - } else if ("protectionStatus".equals(fieldName)) { - deserializedAzureFileshareProtectedItem.protectionStatus = reader.getString(); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureFileshareProtectedItem.protectionState - = ProtectionState.fromString(reader.getString()); - } else if ("lastBackupStatus".equals(fieldName)) { - deserializedAzureFileshareProtectedItem.lastBackupStatus = reader.getString(); - } else if ("lastBackupTime".equals(fieldName)) { - deserializedAzureFileshareProtectedItem.lastBackupTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("kpisHealths".equals(fieldName)) { - Map kpisHealths - = reader.readMap(reader1 -> KpiResourceHealthDetails.fromJson(reader1)); - deserializedAzureFileshareProtectedItem.kpisHealths = kpisHealths; - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureFileshareProtectedItem.extendedInfo - = AzureFileshareProtectedItemExtendedInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureFileshareProtectedItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItemExtendedInfo.java deleted file mode 100644 index 778820b18955..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileshareProtectedItemExtendedInfo.java +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Additional information about Azure File Share backup item. - */ -@Fluent -public final class AzureFileshareProtectedItemExtendedInfo - implements JsonSerializable { - /* - * The oldest backup copy available for this item in the service. - */ - private OffsetDateTime oldestRecoveryPoint; - - /* - * Number of available backup copies associated with this backup item. - */ - private Integer recoveryPointCount; - - /* - * Indicates consistency of policy object and policy applied to this backup item. - */ - private String policyState; - - /* - * Indicates the state of this resource. Possible values are from enum ResourceState {Invalid, Active, SoftDeleted, - * Deleted} - */ - private String resourceState; - - /* - * The resource state sync time for this backup item. - */ - private OffsetDateTime resourceStateSyncTime; - - /** - * Creates an instance of AzureFileshareProtectedItemExtendedInfo class. - */ - public AzureFileshareProtectedItemExtendedInfo() { - } - - /** - * Get the oldestRecoveryPoint property: The oldest backup copy available for this item in the service. - * - * @return the oldestRecoveryPoint value. - */ - public OffsetDateTime oldestRecoveryPoint() { - return this.oldestRecoveryPoint; - } - - /** - * Set the oldestRecoveryPoint property: The oldest backup copy available for this item in the service. - * - * @param oldestRecoveryPoint the oldestRecoveryPoint value to set. - * @return the AzureFileshareProtectedItemExtendedInfo object itself. - */ - public AzureFileshareProtectedItemExtendedInfo withOldestRecoveryPoint(OffsetDateTime oldestRecoveryPoint) { - this.oldestRecoveryPoint = oldestRecoveryPoint; - return this; - } - - /** - * Get the recoveryPointCount property: Number of available backup copies associated with this backup item. - * - * @return the recoveryPointCount value. - */ - public Integer recoveryPointCount() { - return this.recoveryPointCount; - } - - /** - * Set the recoveryPointCount property: Number of available backup copies associated with this backup item. - * - * @param recoveryPointCount the recoveryPointCount value to set. - * @return the AzureFileshareProtectedItemExtendedInfo object itself. - */ - public AzureFileshareProtectedItemExtendedInfo withRecoveryPointCount(Integer recoveryPointCount) { - this.recoveryPointCount = recoveryPointCount; - return this; - } - - /** - * Get the policyState property: Indicates consistency of policy object and policy applied to this backup item. - * - * @return the policyState value. - */ - public String policyState() { - return this.policyState; - } - - /** - * Set the policyState property: Indicates consistency of policy object and policy applied to this backup item. - * - * @param policyState the policyState value to set. - * @return the AzureFileshareProtectedItemExtendedInfo object itself. - */ - public AzureFileshareProtectedItemExtendedInfo withPolicyState(String policyState) { - this.policyState = policyState; - return this; - } - - /** - * Get the resourceState property: Indicates the state of this resource. Possible values are from enum ResourceState - * {Invalid, Active, SoftDeleted, Deleted}. - * - * @return the resourceState value. - */ - public String resourceState() { - return this.resourceState; - } - - /** - * Get the resourceStateSyncTime property: The resource state sync time for this backup item. - * - * @return the resourceStateSyncTime value. - */ - public OffsetDateTime resourceStateSyncTime() { - return this.resourceStateSyncTime; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("oldestRecoveryPoint", - this.oldestRecoveryPoint == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.oldestRecoveryPoint)); - jsonWriter.writeNumberField("recoveryPointCount", this.recoveryPointCount); - jsonWriter.writeStringField("policyState", this.policyState); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureFileshareProtectedItemExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureFileshareProtectedItemExtendedInfo 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 AzureFileshareProtectedItemExtendedInfo. - */ - public static AzureFileshareProtectedItemExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureFileshareProtectedItemExtendedInfo deserializedAzureFileshareProtectedItemExtendedInfo - = new AzureFileshareProtectedItemExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("oldestRecoveryPoint".equals(fieldName)) { - deserializedAzureFileshareProtectedItemExtendedInfo.oldestRecoveryPoint = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("recoveryPointCount".equals(fieldName)) { - deserializedAzureFileshareProtectedItemExtendedInfo.recoveryPointCount - = reader.getNullable(JsonReader::getInt); - } else if ("policyState".equals(fieldName)) { - deserializedAzureFileshareProtectedItemExtendedInfo.policyState = reader.getString(); - } else if ("resourceState".equals(fieldName)) { - deserializedAzureFileshareProtectedItemExtendedInfo.resourceState = reader.getString(); - } else if ("resourceStateSyncTime".equals(fieldName)) { - deserializedAzureFileshareProtectedItemExtendedInfo.resourceStateSyncTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureFileshareProtectedItemExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMContainer.java deleted file mode 100644 index 9147c7e5617d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMContainer.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * IaaS VM workload-specific backup item representing a classic virtual machine. - */ -@Fluent -public final class AzureIaaSClassicComputeVMContainer extends IaaSvmContainer { - /* - * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines - * 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer - */ - private ProtectableContainerType containerType - = ProtectableContainerType.MICROSOFT_CLASSIC_COMPUTE_VIRTUAL_MACHINES; - - /** - * Creates an instance of AzureIaaSClassicComputeVMContainer class. - */ - public AzureIaaSClassicComputeVMContainer() { - } - - /** - * Get the containerType property: Type of the container. The value of this property for: 1. Compute Azure VM is - * Microsoft.Compute/virtualMachines 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer. - * - * @return the containerType value. - */ - @Override - public ProtectableContainerType containerType() { - return this.containerType; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMContainer withVirtualMachineId(String virtualMachineId) { - super.withVirtualMachineId(virtualMachineId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMContainer withVirtualMachineVersion(String virtualMachineVersion) { - super.withVirtualMachineVersion(virtualMachineVersion); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMContainer withResourceGroup(String resourceGroup) { - super.withResourceGroup(resourceGroup); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMContainer withFriendlyName(String friendlyName) { - super.withFriendlyName(friendlyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMContainer withBackupManagementType(BackupManagementType backupManagementType) { - super.withBackupManagementType(backupManagementType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMContainer withRegistrationStatus(String registrationStatus) { - super.withRegistrationStatus(registrationStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMContainer withHealthStatus(String healthStatus) { - super.withHealthStatus(healthStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMContainer withProtectableObjectType(String protectableObjectType) { - super.withProtectableObjectType(protectableObjectType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("registrationStatus", registrationStatus()); - jsonWriter.writeStringField("healthStatus", healthStatus()); - jsonWriter.writeStringField("protectableObjectType", protectableObjectType()); - jsonWriter.writeStringField("virtualMachineId", virtualMachineId()); - jsonWriter.writeStringField("virtualMachineVersion", virtualMachineVersion()); - jsonWriter.writeStringField("resourceGroup", resourceGroup()); - jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureIaaSClassicComputeVMContainer from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureIaaSClassicComputeVMContainer 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 AzureIaaSClassicComputeVMContainer. - */ - public static AzureIaaSClassicComputeVMContainer fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureIaaSClassicComputeVMContainer deserializedAzureIaaSClassicComputeVMContainer - = new AzureIaaSClassicComputeVMContainer(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("friendlyName".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMContainer.withFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMContainer - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("registrationStatus".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMContainer.withRegistrationStatus(reader.getString()); - } else if ("healthStatus".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMContainer.withHealthStatus(reader.getString()); - } else if ("protectableObjectType".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMContainer.withProtectableObjectType(reader.getString()); - } else if ("virtualMachineId".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMContainer.withVirtualMachineId(reader.getString()); - } else if ("virtualMachineVersion".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMContainer.withVirtualMachineVersion(reader.getString()); - } else if ("resourceGroup".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMContainer.withResourceGroup(reader.getString()); - } else if ("containerType".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMContainer.containerType - = ProtectableContainerType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureIaaSClassicComputeVMContainer; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectableItem.java deleted file mode 100644 index b22d61c77bb5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectableItem.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * IaaS VM workload-specific backup item representing the Classic Compute VM. - */ -@Immutable -public final class AzureIaaSClassicComputeVMProtectableItem extends IaasVmProtectableItem { - /* - * Type of the backup item. - */ - private String protectableItemType = "Microsoft.ClassicCompute/virtualMachines"; - - /** - * Creates an instance of AzureIaaSClassicComputeVMProtectableItem class. - */ - private AzureIaaSClassicComputeVMProtectableItem() { - } - - /** - * Get the protectableItemType property: Type of the backup item. - * - * @return the protectableItemType value. - */ - @Override - public String protectableItemType() { - return this.protectableItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("virtualMachineId", virtualMachineId()); - jsonWriter.writeStringField("virtualMachineVersion", virtualMachineVersion()); - jsonWriter.writeStringField("resourceGroup", resourceGroup()); - jsonWriter.writeStringField("protectableItemType", this.protectableItemType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureIaaSClassicComputeVMProtectableItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureIaaSClassicComputeVMProtectableItem 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 AzureIaaSClassicComputeVMProtectableItem. - */ - public static AzureIaaSClassicComputeVMProtectableItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureIaaSClassicComputeVMProtectableItem deserializedAzureIaaSClassicComputeVMProtectableItem - = new AzureIaaSClassicComputeVMProtectableItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectableItem.withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectableItem.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectableItem.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectableItem - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("virtualMachineId".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectableItem.withVirtualMachineId(reader.getString()); - } else if ("virtualMachineVersion".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectableItem.withVirtualMachineVersion(reader.getString()); - } else if ("resourceGroup".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectableItem.withResourceGroup(reader.getString()); - } else if ("protectableItemType".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectableItem.protectableItemType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureIaaSClassicComputeVMProtectableItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectedItem.java deleted file mode 100644 index 129765b61d84..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSClassicComputeVMProtectedItem.java +++ /dev/null @@ -1,406 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * IaaS VM workload-specific backup item representing the Classic Compute VM. - */ -@Fluent -public final class AzureIaaSClassicComputeVMProtectedItem extends AzureIaaSvmProtectedItem { - /* - * backup item type. - */ - private String protectedItemType = "Microsoft.ClassicCompute/virtualMachines"; - - /** - * Creates an instance of AzureIaaSClassicComputeVMProtectedItem class. - */ - public AzureIaaSClassicComputeVMProtectedItem() { - } - - /** - * Get the protectedItemType property: backup item type. - * - * @return the protectedItemType value. - */ - @Override - public String protectedItemType() { - return this.protectedItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem withProtectionStatus(String protectionStatus) { - super.withProtectionStatus(protectionStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem withProtectionState(ProtectionState protectionState) { - super.withProtectionState(protectionState); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem withHealthDetails(List healthDetails) { - super.withHealthDetails(healthDetails); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem withKpisHealths(Map kpisHealths) { - super.withKpisHealths(kpisHealths); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem withLastBackupStatus(String lastBackupStatus) { - super.withLastBackupStatus(lastBackupStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem withExtendedInfo(AzureIaaSvmProtectedItemExtendedInfo extendedInfo) { - super.withExtendedInfo(extendedInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem withExtendedProperties(ExtendedProperties extendedProperties) { - super.withExtendedProperties(extendedProperties); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem withContainerName(String containerName) { - super.withContainerName(containerName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem withPolicyId(String policyId) { - super.withPolicyId(policyId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { - super.withLastRecoveryPoint(lastRecoveryPoint); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem withBackupSetName(String backupSetName) { - super.withBackupSetName(backupSetName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { - super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem - withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { - super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { - super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem - withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { - super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem withIsRehydrate(Boolean isRehydrate) { - super.withIsRehydrate(isRehydrate); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem withIsArchiveEnabled(Boolean isArchiveEnabled) { - super.withIsArchiveEnabled(isArchiveEnabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem withPolicyName(String policyName) { - super.withPolicyName(policyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem - withSoftDeleteRetentionPeriodInDays(Integer softDeleteRetentionPeriodInDays) { - super.withSoftDeleteRetentionPeriodInDays(softDeleteRetentionPeriodInDays); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSClassicComputeVMProtectedItem withSourceSideScanInfo(SourceSideScanInfo sourceSideScanInfo) { - super.withSourceSideScanInfo(sourceSideScanInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("containerName", containerName()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("policyId", policyId()); - jsonWriter.writeStringField("lastRecoveryPoint", - lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint())); - jsonWriter.writeStringField("backupSetName", backupSetName()); - jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString()); - jsonWriter.writeStringField("deferredDeleteTimeInUTC", - deferredDeleteTimeInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc())); - jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete()); - jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining()); - jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming()); - jsonWriter.writeBooleanField("isRehydrate", isRehydrate()); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled()); - jsonWriter.writeStringField("policyName", policyName()); - jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriodInDays()); - jsonWriter.writeJsonField("sourceSideScanInfo", sourceSideScanInfo()); - jsonWriter.writeStringField("protectionStatus", protectionStatus()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeArrayField("healthDetails", healthDetails(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeMapField("kpisHealths", kpisHealths(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("lastBackupStatus", lastBackupStatus()); - jsonWriter.writeJsonField("extendedInfo", extendedInfo()); - jsonWriter.writeJsonField("extendedProperties", extendedProperties()); - jsonWriter.writeStringField("protectedItemType", this.protectedItemType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureIaaSClassicComputeVMProtectedItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureIaaSClassicComputeVMProtectedItem 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 AzureIaaSClassicComputeVMProtectedItem. - */ - public static AzureIaaSClassicComputeVMProtectedItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureIaaSClassicComputeVMProtectedItem deserializedAzureIaaSClassicComputeVMProtectedItem - = new AzureIaaSClassicComputeVMProtectedItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem - .withWorkloadType(DataSourceType.fromString(reader.getString())); - } else if ("containerName".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem.withContainerName(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem.withSourceResourceId(reader.getString()); - } else if ("policyId".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem.withPolicyId(reader.getString()); - } else if ("lastRecoveryPoint".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem.withLastRecoveryPoint(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("backupSetName".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem.withBackupSetName(reader.getString()); - } else if ("createMode".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem - .withCreateMode(CreateMode.fromString(reader.getString())); - } else if ("deferredDeleteTimeInUTC".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem.withDeferredDeleteTimeInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("isScheduledForDeferredDelete".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem - .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean)); - } else if ("deferredDeleteTimeRemaining".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem - .withDeferredDeleteTimeRemaining(reader.getString()); - } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem - .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean)); - } else if ("isRehydrate".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem - .withIsRehydrate(reader.getNullable(JsonReader::getBoolean)); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureIaaSClassicComputeVMProtectedItem - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("isArchiveEnabled".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem - .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("policyName".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem.withPolicyName(reader.getString()); - } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem - .withSoftDeleteRetentionPeriodInDays(reader.getNullable(JsonReader::getInt)); - } else if ("vaultId".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem.withVaultId(reader.getString()); - } else if ("sourceSideScanInfo".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem - .withSourceSideScanInfo(SourceSideScanInfo.fromJson(reader)); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem.withFriendlyName(reader.getString()); - } else if ("virtualMachineId".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem.withVirtualMachineId(reader.getString()); - } else if ("protectionStatus".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem.withProtectionStatus(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem - .withProtectionState(ProtectionState.fromString(reader.getString())); - } else if ("healthStatus".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem - .withHealthStatus(HealthStatus.fromString(reader.getString())); - } else if ("healthDetails".equals(fieldName)) { - List healthDetails - = reader.readArray(reader1 -> AzureIaaSvmHealthDetails.fromJson(reader1)); - deserializedAzureIaaSClassicComputeVMProtectedItem.withHealthDetails(healthDetails); - } else if ("kpisHealths".equals(fieldName)) { - Map kpisHealths - = reader.readMap(reader1 -> KpiResourceHealthDetails.fromJson(reader1)); - deserializedAzureIaaSClassicComputeVMProtectedItem.withKpisHealths(kpisHealths); - } else if ("lastBackupStatus".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem.withLastBackupStatus(reader.getString()); - } else if ("lastBackupTime".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem.withLastBackupTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("protectedItemDataId".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem.withProtectedItemDataId(reader.getString()); - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem - .withExtendedInfo(AzureIaaSvmProtectedItemExtendedInfo.fromJson(reader)); - } else if ("extendedProperties".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem - .withExtendedProperties(ExtendedProperties.fromJson(reader)); - } else if ("policyType".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem.withPolicyType(reader.getString()); - } else if ("protectedItemType".equals(fieldName)) { - deserializedAzureIaaSClassicComputeVMProtectedItem.protectedItemType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureIaaSClassicComputeVMProtectedItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMContainer.java deleted file mode 100644 index 01aa89fbf645..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMContainer.java +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * IaaS VM workload-specific backup item representing an Azure Resource Manager virtual machine. - */ -@Fluent -public final class AzureIaaSComputeVMContainer extends IaaSvmContainer { - /* - * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines - * 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer - */ - private ProtectableContainerType containerType = ProtectableContainerType.MICROSOFT_COMPUTE_VIRTUAL_MACHINES; - - /** - * Creates an instance of AzureIaaSComputeVMContainer class. - */ - public AzureIaaSComputeVMContainer() { - } - - /** - * Get the containerType property: Type of the container. The value of this property for: 1. Compute Azure VM is - * Microsoft.Compute/virtualMachines 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer. - * - * @return the containerType value. - */ - @Override - public ProtectableContainerType containerType() { - return this.containerType; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMContainer withVirtualMachineId(String virtualMachineId) { - super.withVirtualMachineId(virtualMachineId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMContainer withVirtualMachineVersion(String virtualMachineVersion) { - super.withVirtualMachineVersion(virtualMachineVersion); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMContainer withResourceGroup(String resourceGroup) { - super.withResourceGroup(resourceGroup); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMContainer withFriendlyName(String friendlyName) { - super.withFriendlyName(friendlyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMContainer withBackupManagementType(BackupManagementType backupManagementType) { - super.withBackupManagementType(backupManagementType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMContainer withRegistrationStatus(String registrationStatus) { - super.withRegistrationStatus(registrationStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMContainer withHealthStatus(String healthStatus) { - super.withHealthStatus(healthStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMContainer withProtectableObjectType(String protectableObjectType) { - super.withProtectableObjectType(protectableObjectType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("registrationStatus", registrationStatus()); - jsonWriter.writeStringField("healthStatus", healthStatus()); - jsonWriter.writeStringField("protectableObjectType", protectableObjectType()); - jsonWriter.writeStringField("virtualMachineId", virtualMachineId()); - jsonWriter.writeStringField("virtualMachineVersion", virtualMachineVersion()); - jsonWriter.writeStringField("resourceGroup", resourceGroup()); - jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureIaaSComputeVMContainer from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureIaaSComputeVMContainer 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 AzureIaaSComputeVMContainer. - */ - public static AzureIaaSComputeVMContainer fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureIaaSComputeVMContainer deserializedAzureIaaSComputeVMContainer = new AzureIaaSComputeVMContainer(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("friendlyName".equals(fieldName)) { - deserializedAzureIaaSComputeVMContainer.withFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedAzureIaaSComputeVMContainer - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("registrationStatus".equals(fieldName)) { - deserializedAzureIaaSComputeVMContainer.withRegistrationStatus(reader.getString()); - } else if ("healthStatus".equals(fieldName)) { - deserializedAzureIaaSComputeVMContainer.withHealthStatus(reader.getString()); - } else if ("protectableObjectType".equals(fieldName)) { - deserializedAzureIaaSComputeVMContainer.withProtectableObjectType(reader.getString()); - } else if ("virtualMachineId".equals(fieldName)) { - deserializedAzureIaaSComputeVMContainer.withVirtualMachineId(reader.getString()); - } else if ("virtualMachineVersion".equals(fieldName)) { - deserializedAzureIaaSComputeVMContainer.withVirtualMachineVersion(reader.getString()); - } else if ("resourceGroup".equals(fieldName)) { - deserializedAzureIaaSComputeVMContainer.withResourceGroup(reader.getString()); - } else if ("containerType".equals(fieldName)) { - deserializedAzureIaaSComputeVMContainer.containerType - = ProtectableContainerType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureIaaSComputeVMContainer; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectableItem.java deleted file mode 100644 index f47910be56c1..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectableItem.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * IaaS VM workload-specific backup item representing the Azure Resource Manager VM. - */ -@Immutable -public final class AzureIaaSComputeVMProtectableItem extends IaasVmProtectableItem { - /* - * Type of the backup item. - */ - private String protectableItemType = "Microsoft.Compute/virtualMachines"; - - /** - * Creates an instance of AzureIaaSComputeVMProtectableItem class. - */ - private AzureIaaSComputeVMProtectableItem() { - } - - /** - * Get the protectableItemType property: Type of the backup item. - * - * @return the protectableItemType value. - */ - @Override - public String protectableItemType() { - return this.protectableItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("virtualMachineId", virtualMachineId()); - jsonWriter.writeStringField("virtualMachineVersion", virtualMachineVersion()); - jsonWriter.writeStringField("resourceGroup", resourceGroup()); - jsonWriter.writeStringField("protectableItemType", this.protectableItemType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureIaaSComputeVMProtectableItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureIaaSComputeVMProtectableItem 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 AzureIaaSComputeVMProtectableItem. - */ - public static AzureIaaSComputeVMProtectableItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureIaaSComputeVMProtectableItem deserializedAzureIaaSComputeVMProtectableItem - = new AzureIaaSComputeVMProtectableItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectableItem.withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectableItem.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectableItem.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectableItem - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("virtualMachineId".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectableItem.withVirtualMachineId(reader.getString()); - } else if ("virtualMachineVersion".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectableItem.withVirtualMachineVersion(reader.getString()); - } else if ("resourceGroup".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectableItem.withResourceGroup(reader.getString()); - } else if ("protectableItemType".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectableItem.protectableItemType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureIaaSComputeVMProtectableItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectedItem.java deleted file mode 100644 index 723f06b98753..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSComputeVMProtectedItem.java +++ /dev/null @@ -1,404 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * IaaS VM workload-specific backup item representing the Azure Resource Manager VM. - */ -@Fluent -public final class AzureIaaSComputeVMProtectedItem extends AzureIaaSvmProtectedItem { - /* - * backup item type. - */ - private String protectedItemType = "Microsoft.Compute/virtualMachines"; - - /** - * Creates an instance of AzureIaaSComputeVMProtectedItem class. - */ - public AzureIaaSComputeVMProtectedItem() { - } - - /** - * Get the protectedItemType property: backup item type. - * - * @return the protectedItemType value. - */ - @Override - public String protectedItemType() { - return this.protectedItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem withProtectionStatus(String protectionStatus) { - super.withProtectionStatus(protectionStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem withProtectionState(ProtectionState protectionState) { - super.withProtectionState(protectionState); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem withHealthDetails(List healthDetails) { - super.withHealthDetails(healthDetails); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem withKpisHealths(Map kpisHealths) { - super.withKpisHealths(kpisHealths); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem withLastBackupStatus(String lastBackupStatus) { - super.withLastBackupStatus(lastBackupStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem withExtendedInfo(AzureIaaSvmProtectedItemExtendedInfo extendedInfo) { - super.withExtendedInfo(extendedInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem withExtendedProperties(ExtendedProperties extendedProperties) { - super.withExtendedProperties(extendedProperties); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem withContainerName(String containerName) { - super.withContainerName(containerName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem withPolicyId(String policyId) { - super.withPolicyId(policyId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { - super.withLastRecoveryPoint(lastRecoveryPoint); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem withBackupSetName(String backupSetName) { - super.withBackupSetName(backupSetName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { - super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { - super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { - super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem - withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { - super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem withIsRehydrate(Boolean isRehydrate) { - super.withIsRehydrate(isRehydrate); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem withIsArchiveEnabled(Boolean isArchiveEnabled) { - super.withIsArchiveEnabled(isArchiveEnabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem withPolicyName(String policyName) { - super.withPolicyName(policyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem - withSoftDeleteRetentionPeriodInDays(Integer softDeleteRetentionPeriodInDays) { - super.withSoftDeleteRetentionPeriodInDays(softDeleteRetentionPeriodInDays); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSComputeVMProtectedItem withSourceSideScanInfo(SourceSideScanInfo sourceSideScanInfo) { - super.withSourceSideScanInfo(sourceSideScanInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("containerName", containerName()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("policyId", policyId()); - jsonWriter.writeStringField("lastRecoveryPoint", - lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint())); - jsonWriter.writeStringField("backupSetName", backupSetName()); - jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString()); - jsonWriter.writeStringField("deferredDeleteTimeInUTC", - deferredDeleteTimeInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc())); - jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete()); - jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining()); - jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming()); - jsonWriter.writeBooleanField("isRehydrate", isRehydrate()); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled()); - jsonWriter.writeStringField("policyName", policyName()); - jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriodInDays()); - jsonWriter.writeJsonField("sourceSideScanInfo", sourceSideScanInfo()); - jsonWriter.writeStringField("protectionStatus", protectionStatus()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeArrayField("healthDetails", healthDetails(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeMapField("kpisHealths", kpisHealths(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("lastBackupStatus", lastBackupStatus()); - jsonWriter.writeJsonField("extendedInfo", extendedInfo()); - jsonWriter.writeJsonField("extendedProperties", extendedProperties()); - jsonWriter.writeStringField("protectedItemType", this.protectedItemType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureIaaSComputeVMProtectedItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureIaaSComputeVMProtectedItem 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 AzureIaaSComputeVMProtectedItem. - */ - public static AzureIaaSComputeVMProtectedItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureIaaSComputeVMProtectedItem deserializedAzureIaaSComputeVMProtectedItem - = new AzureIaaSComputeVMProtectedItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem - .withWorkloadType(DataSourceType.fromString(reader.getString())); - } else if ("containerName".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem.withContainerName(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem.withSourceResourceId(reader.getString()); - } else if ("policyId".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem.withPolicyId(reader.getString()); - } else if ("lastRecoveryPoint".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem.withLastRecoveryPoint(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("backupSetName".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem.withBackupSetName(reader.getString()); - } else if ("createMode".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem - .withCreateMode(CreateMode.fromString(reader.getString())); - } else if ("deferredDeleteTimeInUTC".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem.withDeferredDeleteTimeInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("isScheduledForDeferredDelete".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem - .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean)); - } else if ("deferredDeleteTimeRemaining".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem.withDeferredDeleteTimeRemaining(reader.getString()); - } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem - .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean)); - } else if ("isRehydrate".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem - .withIsRehydrate(reader.getNullable(JsonReader::getBoolean)); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureIaaSComputeVMProtectedItem - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("isArchiveEnabled".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem - .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("policyName".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem.withPolicyName(reader.getString()); - } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem - .withSoftDeleteRetentionPeriodInDays(reader.getNullable(JsonReader::getInt)); - } else if ("vaultId".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem.withVaultId(reader.getString()); - } else if ("sourceSideScanInfo".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem - .withSourceSideScanInfo(SourceSideScanInfo.fromJson(reader)); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem.withFriendlyName(reader.getString()); - } else if ("virtualMachineId".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem.withVirtualMachineId(reader.getString()); - } else if ("protectionStatus".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem.withProtectionStatus(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem - .withProtectionState(ProtectionState.fromString(reader.getString())); - } else if ("healthStatus".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem - .withHealthStatus(HealthStatus.fromString(reader.getString())); - } else if ("healthDetails".equals(fieldName)) { - List healthDetails - = reader.readArray(reader1 -> AzureIaaSvmHealthDetails.fromJson(reader1)); - deserializedAzureIaaSComputeVMProtectedItem.withHealthDetails(healthDetails); - } else if ("kpisHealths".equals(fieldName)) { - Map kpisHealths - = reader.readMap(reader1 -> KpiResourceHealthDetails.fromJson(reader1)); - deserializedAzureIaaSComputeVMProtectedItem.withKpisHealths(kpisHealths); - } else if ("lastBackupStatus".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem.withLastBackupStatus(reader.getString()); - } else if ("lastBackupTime".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem.withLastBackupTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("protectedItemDataId".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem.withProtectedItemDataId(reader.getString()); - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem - .withExtendedInfo(AzureIaaSvmProtectedItemExtendedInfo.fromJson(reader)); - } else if ("extendedProperties".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem - .withExtendedProperties(ExtendedProperties.fromJson(reader)); - } else if ("policyType".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem.withPolicyType(reader.getString()); - } else if ("protectedItemType".equals(fieldName)) { - deserializedAzureIaaSComputeVMProtectedItem.protectedItemType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureIaaSComputeVMProtectedItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmErrorInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmErrorInfo.java deleted file mode 100644 index 034c7a9de5db..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmErrorInfo.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Azure IaaS VM workload-specific error information. - */ -@Immutable -public final class AzureIaaSvmErrorInfo implements JsonSerializable { - /* - * Error code. - */ - private Integer errorCode; - - /* - * Title: Typically, the entity that the error pertains to. - */ - private String errorTitle; - - /* - * Localized error string. - */ - private String errorString; - - /* - * List of localized recommendations for above error code. - */ - private List recommendations; - - /** - * Creates an instance of AzureIaaSvmErrorInfo class. - */ - private AzureIaaSvmErrorInfo() { - } - - /** - * Get the errorCode property: Error code. - * - * @return the errorCode value. - */ - public Integer errorCode() { - return this.errorCode; - } - - /** - * Get the errorTitle property: Title: Typically, the entity that the error pertains to. - * - * @return the errorTitle value. - */ - public String errorTitle() { - return this.errorTitle; - } - - /** - * Get the errorString property: Localized error string. - * - * @return the errorString value. - */ - public String errorString() { - return this.errorString; - } - - /** - * Get the recommendations property: List of localized recommendations for above error code. - * - * @return the recommendations value. - */ - public List recommendations() { - return this.recommendations; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureIaaSvmErrorInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureIaaSvmErrorInfo 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 AzureIaaSvmErrorInfo. - */ - public static AzureIaaSvmErrorInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureIaaSvmErrorInfo deserializedAzureIaaSvmErrorInfo = new AzureIaaSvmErrorInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("errorCode".equals(fieldName)) { - deserializedAzureIaaSvmErrorInfo.errorCode = reader.getNullable(JsonReader::getInt); - } else if ("errorTitle".equals(fieldName)) { - deserializedAzureIaaSvmErrorInfo.errorTitle = reader.getString(); - } else if ("errorString".equals(fieldName)) { - deserializedAzureIaaSvmErrorInfo.errorString = reader.getString(); - } else if ("recommendations".equals(fieldName)) { - List recommendations = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureIaaSvmErrorInfo.recommendations = recommendations; - } else { - reader.skipChildren(); - } - } - - return deserializedAzureIaaSvmErrorInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmHealthDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmHealthDetails.java deleted file mode 100644 index 764833290b95..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmHealthDetails.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Azure IaaS VM workload-specific Health Details. - */ -@Immutable -public final class AzureIaaSvmHealthDetails extends ResourceHealthDetails { - /* - * Health Recommended Actions - */ - private List recommendations; - - /* - * Health Message - */ - private String message; - - /* - * Health Title - */ - private String title; - - /* - * Health Code - */ - private Integer code; - - /** - * Creates an instance of AzureIaaSvmHealthDetails class. - */ - public AzureIaaSvmHealthDetails() { - } - - /** - * Get the recommendations property: Health Recommended Actions. - * - * @return the recommendations value. - */ - @Override - public List recommendations() { - return this.recommendations; - } - - /** - * Get the message property: Health Message. - * - * @return the message value. - */ - @Override - public String message() { - return this.message; - } - - /** - * Get the title property: Health Title. - * - * @return the title value. - */ - @Override - public String title() { - return this.title; - } - - /** - * Get the code property: Health Code. - * - * @return the code value. - */ - @Override - public Integer code() { - return this.code; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureIaaSvmHealthDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureIaaSvmHealthDetails 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 AzureIaaSvmHealthDetails. - */ - public static AzureIaaSvmHealthDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureIaaSvmHealthDetails deserializedAzureIaaSvmHealthDetails = new AzureIaaSvmHealthDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("code".equals(fieldName)) { - deserializedAzureIaaSvmHealthDetails.code = reader.getNullable(JsonReader::getInt); - } else if ("title".equals(fieldName)) { - deserializedAzureIaaSvmHealthDetails.title = reader.getString(); - } else if ("message".equals(fieldName)) { - deserializedAzureIaaSvmHealthDetails.message = reader.getString(); - } else if ("recommendations".equals(fieldName)) { - List recommendations = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureIaaSvmHealthDetails.recommendations = recommendations; - } else { - reader.skipChildren(); - } - } - - return deserializedAzureIaaSvmHealthDetails; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJob.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJob.java deleted file mode 100644 index 8a4fb60dd7e7..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJob.java +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.Duration; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Azure IaaS VM workload-specific job object. - */ -@Immutable -public final class AzureIaaSvmJob extends Job { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String jobType = "AzureIaaSVMJob"; - - /* - * Time elapsed during the execution of this job. - */ - private Duration duration; - - /* - * Gets or sets the state/actions applicable on this job like cancel/retry. - */ - private List actionsInfo; - - /* - * Error details on execution of this job. - */ - private List errorDetails; - - /* - * Specifies whether the backup item is a Classic or an Azure Resource Manager VM. - */ - private String virtualMachineVersion; - - /* - * Additional information for this job. - */ - private AzureIaaSvmJobExtendedInfo extendedInfo; - - /* - * Container name of the entity on which the current job is executing. - */ - private String containerName; - - /* - * Indicated that whether the job is adhoc(true) or scheduled(false) - */ - private Boolean isUserTriggered; - - /** - * Creates an instance of AzureIaaSvmJob class. - */ - private AzureIaaSvmJob() { - } - - /** - * Get the jobType property: This property will be used as the discriminator for deciding the specific types in the - * polymorphic chain of types. - * - * @return the jobType value. - */ - @Override - public String jobType() { - return this.jobType; - } - - /** - * Get the duration property: Time elapsed during the execution of this job. - * - * @return the duration value. - */ - public Duration duration() { - return this.duration; - } - - /** - * Get the actionsInfo property: Gets or sets the state/actions applicable on this job like cancel/retry. - * - * @return the actionsInfo value. - */ - public List actionsInfo() { - return this.actionsInfo; - } - - /** - * Get the errorDetails property: Error details on execution of this job. - * - * @return the errorDetails value. - */ - public List errorDetails() { - return this.errorDetails; - } - - /** - * Get the virtualMachineVersion property: Specifies whether the backup item is a Classic or an Azure Resource - * Manager VM. - * - * @return the virtualMachineVersion value. - */ - public String virtualMachineVersion() { - return this.virtualMachineVersion; - } - - /** - * Get the extendedInfo property: Additional information for this job. - * - * @return the extendedInfo value. - */ - public AzureIaaSvmJobExtendedInfo extendedInfo() { - return this.extendedInfo; - } - - /** - * Get the containerName property: Container name of the entity on which the current job is executing. - * - * @return the containerName value. - */ - public String containerName() { - return this.containerName; - } - - /** - * Get the isUserTriggered property: Indicated that whether the job is adhoc(true) or scheduled(false). - * - * @return the isUserTriggered value. - */ - public Boolean isUserTriggered() { - return this.isUserTriggered; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("entityFriendlyName", entityFriendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("operation", operation()); - jsonWriter.writeStringField("status", status()); - jsonWriter.writeStringField("startTime", - startTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(startTime())); - jsonWriter.writeStringField("endTime", - endTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(endTime())); - jsonWriter.writeStringField("activityId", activityId()); - jsonWriter.writeStringField("jobType", this.jobType); - jsonWriter.writeStringField("duration", CoreUtils.durationToStringWithDays(this.duration)); - jsonWriter.writeArrayField("actionsInfo", this.actionsInfo, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("errorDetails", this.errorDetails, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("virtualMachineVersion", this.virtualMachineVersion); - jsonWriter.writeJsonField("extendedInfo", this.extendedInfo); - jsonWriter.writeStringField("containerName", this.containerName); - jsonWriter.writeBooleanField("isUserTriggered", this.isUserTriggered); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureIaaSvmJob from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureIaaSvmJob 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 AzureIaaSvmJob. - */ - public static AzureIaaSvmJob fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureIaaSvmJob deserializedAzureIaaSvmJob = new AzureIaaSvmJob(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("entityFriendlyName".equals(fieldName)) { - deserializedAzureIaaSvmJob.withEntityFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedAzureIaaSvmJob - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("operation".equals(fieldName)) { - deserializedAzureIaaSvmJob.withOperation(reader.getString()); - } else if ("status".equals(fieldName)) { - deserializedAzureIaaSvmJob.withStatus(reader.getString()); - } else if ("startTime".equals(fieldName)) { - deserializedAzureIaaSvmJob.withStartTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("endTime".equals(fieldName)) { - deserializedAzureIaaSvmJob.withEndTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("activityId".equals(fieldName)) { - deserializedAzureIaaSvmJob.withActivityId(reader.getString()); - } else if ("jobType".equals(fieldName)) { - deserializedAzureIaaSvmJob.jobType = reader.getString(); - } else if ("duration".equals(fieldName)) { - deserializedAzureIaaSvmJob.duration - = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); - } else if ("actionsInfo".equals(fieldName)) { - List actionsInfo - = reader.readArray(reader1 -> JobSupportedAction.fromString(reader1.getString())); - deserializedAzureIaaSvmJob.actionsInfo = actionsInfo; - } else if ("errorDetails".equals(fieldName)) { - List errorDetails - = reader.readArray(reader1 -> AzureIaaSvmErrorInfo.fromJson(reader1)); - deserializedAzureIaaSvmJob.errorDetails = errorDetails; - } else if ("virtualMachineVersion".equals(fieldName)) { - deserializedAzureIaaSvmJob.virtualMachineVersion = reader.getString(); - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureIaaSvmJob.extendedInfo = AzureIaaSvmJobExtendedInfo.fromJson(reader); - } else if ("containerName".equals(fieldName)) { - deserializedAzureIaaSvmJob.containerName = reader.getString(); - } else if ("isUserTriggered".equals(fieldName)) { - deserializedAzureIaaSvmJob.isUserTriggered = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureIaaSvmJob; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobExtendedInfo.java deleted file mode 100644 index c2e69918e12b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobExtendedInfo.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; -import java.util.Map; - -/** - * Azure IaaS VM workload-specific additional information for job. - */ -@Immutable -public final class AzureIaaSvmJobExtendedInfo implements JsonSerializable { - /* - * List of tasks associated with this job. - */ - private List tasksList; - - /* - * Job properties. - */ - private Map propertyBag; - - /* - * Job internal properties. - */ - private Map internalPropertyBag; - - /* - * Indicates progress of the job. Null if it has not started or completed. - */ - private Double progressPercentage; - - /* - * Time remaining for execution of this job. - */ - private String estimatedRemainingDuration; - - /* - * Non localized error message on job execution. - */ - private String dynamicErrorMessage; - - /** - * Creates an instance of AzureIaaSvmJobExtendedInfo class. - */ - private AzureIaaSvmJobExtendedInfo() { - } - - /** - * Get the tasksList property: List of tasks associated with this job. - * - * @return the tasksList value. - */ - public List tasksList() { - return this.tasksList; - } - - /** - * Get the propertyBag property: Job properties. - * - * @return the propertyBag value. - */ - public Map propertyBag() { - return this.propertyBag; - } - - /** - * Get the internalPropertyBag property: Job internal properties. - * - * @return the internalPropertyBag value. - */ - public Map internalPropertyBag() { - return this.internalPropertyBag; - } - - /** - * Get the progressPercentage property: Indicates progress of the job. Null if it has not started or completed. - * - * @return the progressPercentage value. - */ - public Double progressPercentage() { - return this.progressPercentage; - } - - /** - * Get the estimatedRemainingDuration property: Time remaining for execution of this job. - * - * @return the estimatedRemainingDuration value. - */ - public String estimatedRemainingDuration() { - return this.estimatedRemainingDuration; - } - - /** - * Get the dynamicErrorMessage property: Non localized error message on job execution. - * - * @return the dynamicErrorMessage value. - */ - public String dynamicErrorMessage() { - return this.dynamicErrorMessage; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("tasksList", this.tasksList, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeMapField("propertyBag", this.propertyBag, (writer, element) -> writer.writeString(element)); - jsonWriter.writeMapField("internalPropertyBag", this.internalPropertyBag, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeNumberField("progressPercentage", this.progressPercentage); - jsonWriter.writeStringField("estimatedRemainingDuration", this.estimatedRemainingDuration); - jsonWriter.writeStringField("dynamicErrorMessage", this.dynamicErrorMessage); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureIaaSvmJobExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureIaaSvmJobExtendedInfo 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 AzureIaaSvmJobExtendedInfo. - */ - public static AzureIaaSvmJobExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureIaaSvmJobExtendedInfo deserializedAzureIaaSvmJobExtendedInfo = new AzureIaaSvmJobExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("tasksList".equals(fieldName)) { - List tasksList - = reader.readArray(reader1 -> AzureIaaSvmJobTaskDetails.fromJson(reader1)); - deserializedAzureIaaSvmJobExtendedInfo.tasksList = tasksList; - } else if ("propertyBag".equals(fieldName)) { - Map propertyBag = reader.readMap(reader1 -> reader1.getString()); - deserializedAzureIaaSvmJobExtendedInfo.propertyBag = propertyBag; - } else if ("internalPropertyBag".equals(fieldName)) { - Map internalPropertyBag = reader.readMap(reader1 -> reader1.getString()); - deserializedAzureIaaSvmJobExtendedInfo.internalPropertyBag = internalPropertyBag; - } else if ("progressPercentage".equals(fieldName)) { - deserializedAzureIaaSvmJobExtendedInfo.progressPercentage - = reader.getNullable(JsonReader::getDouble); - } else if ("estimatedRemainingDuration".equals(fieldName)) { - deserializedAzureIaaSvmJobExtendedInfo.estimatedRemainingDuration = reader.getString(); - } else if ("dynamicErrorMessage".equals(fieldName)) { - deserializedAzureIaaSvmJobExtendedInfo.dynamicErrorMessage = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureIaaSvmJobExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobTaskDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobTaskDetails.java deleted file mode 100644 index b6d331fcd70f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobTaskDetails.java +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Azure IaaS VM workload-specific job task details. - */ -@Immutable -public final class AzureIaaSvmJobTaskDetails implements JsonSerializable { - /* - * The task display name. - */ - private String taskId; - - /* - * The start time. - */ - private OffsetDateTime startTime; - - /* - * The end time. - */ - private OffsetDateTime endTime; - - /* - * The instanceId. - */ - private String instanceId; - - /* - * Time elapsed for task. - */ - private Duration duration; - - /* - * The status. - */ - private String status; - - /* - * Progress of the task. - */ - private Double progressPercentage; - - /* - * Details about execution of the task. - * eg: number of bytes transferred etc - */ - private String taskExecutionDetails; - - /** - * Creates an instance of AzureIaaSvmJobTaskDetails class. - */ - private AzureIaaSvmJobTaskDetails() { - } - - /** - * Get the taskId property: The task display name. - * - * @return the taskId value. - */ - public String taskId() { - return this.taskId; - } - - /** - * Get the startTime property: The start time. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Get the endTime property: The end time. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Get the instanceId property: The instanceId. - * - * @return the instanceId value. - */ - public String instanceId() { - return this.instanceId; - } - - /** - * Get the duration property: Time elapsed for task. - * - * @return the duration value. - */ - public Duration duration() { - return this.duration; - } - - /** - * Get the status property: The status. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Get the progressPercentage property: Progress of the task. - * - * @return the progressPercentage value. - */ - public Double progressPercentage() { - return this.progressPercentage; - } - - /** - * Get the taskExecutionDetails property: Details about execution of the task. - * eg: number of bytes transferred etc. - * - * @return the taskExecutionDetails value. - */ - public String taskExecutionDetails() { - return this.taskExecutionDetails; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskId", this.taskId); - jsonWriter.writeStringField("startTime", - this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); - jsonWriter.writeStringField("endTime", - this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); - jsonWriter.writeStringField("instanceId", this.instanceId); - jsonWriter.writeStringField("duration", CoreUtils.durationToStringWithDays(this.duration)); - jsonWriter.writeStringField("status", this.status); - jsonWriter.writeNumberField("progressPercentage", this.progressPercentage); - jsonWriter.writeStringField("taskExecutionDetails", this.taskExecutionDetails); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureIaaSvmJobTaskDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureIaaSvmJobTaskDetails 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 AzureIaaSvmJobTaskDetails. - */ - public static AzureIaaSvmJobTaskDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureIaaSvmJobTaskDetails deserializedAzureIaaSvmJobTaskDetails = new AzureIaaSvmJobTaskDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("taskId".equals(fieldName)) { - deserializedAzureIaaSvmJobTaskDetails.taskId = reader.getString(); - } else if ("startTime".equals(fieldName)) { - deserializedAzureIaaSvmJobTaskDetails.startTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("endTime".equals(fieldName)) { - deserializedAzureIaaSvmJobTaskDetails.endTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("instanceId".equals(fieldName)) { - deserializedAzureIaaSvmJobTaskDetails.instanceId = reader.getString(); - } else if ("duration".equals(fieldName)) { - deserializedAzureIaaSvmJobTaskDetails.duration - = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); - } else if ("status".equals(fieldName)) { - deserializedAzureIaaSvmJobTaskDetails.status = reader.getString(); - } else if ("progressPercentage".equals(fieldName)) { - deserializedAzureIaaSvmJobTaskDetails.progressPercentage - = reader.getNullable(JsonReader::getDouble); - } else if ("taskExecutionDetails".equals(fieldName)) { - deserializedAzureIaaSvmJobTaskDetails.taskExecutionDetails = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureIaaSvmJobTaskDetails; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobV2.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobV2.java deleted file mode 100644 index f086831376b8..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmJobV2.java +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.Duration; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Azure IaaS VM workload-specific job object. - */ -@Immutable -public final class AzureIaaSvmJobV2 extends Job { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String jobType = "AzureIaaSVMJobV2"; - - /* - * Gets or sets the state/actions applicable on this job like cancel/retry. - */ - private List actionsInfo; - - /* - * Container name of the entity on which the current job is executing. - */ - private String containerName; - - /* - * Time elapsed during the execution of this job. - */ - private Duration duration; - - /* - * Error details on execution of this job. - */ - private List errorDetails; - - /* - * Specifies whether the backup item is a Classic or an Azure Resource Manager VM. - */ - private String virtualMachineVersion; - - /* - * Additional information for this job. - */ - private AzureIaaSvmJobExtendedInfo extendedInfo; - - /** - * Creates an instance of AzureIaaSvmJobV2 class. - */ - private AzureIaaSvmJobV2() { - } - - /** - * Get the jobType property: This property will be used as the discriminator for deciding the specific types in the - * polymorphic chain of types. - * - * @return the jobType value. - */ - @Override - public String jobType() { - return this.jobType; - } - - /** - * Get the actionsInfo property: Gets or sets the state/actions applicable on this job like cancel/retry. - * - * @return the actionsInfo value. - */ - public List actionsInfo() { - return this.actionsInfo; - } - - /** - * Get the containerName property: Container name of the entity on which the current job is executing. - * - * @return the containerName value. - */ - public String containerName() { - return this.containerName; - } - - /** - * Get the duration property: Time elapsed during the execution of this job. - * - * @return the duration value. - */ - public Duration duration() { - return this.duration; - } - - /** - * Get the errorDetails property: Error details on execution of this job. - * - * @return the errorDetails value. - */ - public List errorDetails() { - return this.errorDetails; - } - - /** - * Get the virtualMachineVersion property: Specifies whether the backup item is a Classic or an Azure Resource - * Manager VM. - * - * @return the virtualMachineVersion value. - */ - public String virtualMachineVersion() { - return this.virtualMachineVersion; - } - - /** - * Get the extendedInfo property: Additional information for this job. - * - * @return the extendedInfo value. - */ - public AzureIaaSvmJobExtendedInfo extendedInfo() { - return this.extendedInfo; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("entityFriendlyName", entityFriendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("operation", operation()); - jsonWriter.writeStringField("status", status()); - jsonWriter.writeStringField("startTime", - startTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(startTime())); - jsonWriter.writeStringField("endTime", - endTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(endTime())); - jsonWriter.writeStringField("activityId", activityId()); - jsonWriter.writeStringField("jobType", this.jobType); - jsonWriter.writeArrayField("actionsInfo", this.actionsInfo, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeStringField("containerName", this.containerName); - jsonWriter.writeStringField("duration", CoreUtils.durationToStringWithDays(this.duration)); - jsonWriter.writeArrayField("errorDetails", this.errorDetails, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("virtualMachineVersion", this.virtualMachineVersion); - jsonWriter.writeJsonField("extendedInfo", this.extendedInfo); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureIaaSvmJobV2 from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureIaaSvmJobV2 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 AzureIaaSvmJobV2. - */ - public static AzureIaaSvmJobV2 fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureIaaSvmJobV2 deserializedAzureIaaSvmJobV2 = new AzureIaaSvmJobV2(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("entityFriendlyName".equals(fieldName)) { - deserializedAzureIaaSvmJobV2.withEntityFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedAzureIaaSvmJobV2 - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("operation".equals(fieldName)) { - deserializedAzureIaaSvmJobV2.withOperation(reader.getString()); - } else if ("status".equals(fieldName)) { - deserializedAzureIaaSvmJobV2.withStatus(reader.getString()); - } else if ("startTime".equals(fieldName)) { - deserializedAzureIaaSvmJobV2.withStartTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("endTime".equals(fieldName)) { - deserializedAzureIaaSvmJobV2.withEndTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("activityId".equals(fieldName)) { - deserializedAzureIaaSvmJobV2.withActivityId(reader.getString()); - } else if ("jobType".equals(fieldName)) { - deserializedAzureIaaSvmJobV2.jobType = reader.getString(); - } else if ("actionsInfo".equals(fieldName)) { - List actionsInfo - = reader.readArray(reader1 -> JobSupportedAction.fromString(reader1.getString())); - deserializedAzureIaaSvmJobV2.actionsInfo = actionsInfo; - } else if ("containerName".equals(fieldName)) { - deserializedAzureIaaSvmJobV2.containerName = reader.getString(); - } else if ("duration".equals(fieldName)) { - deserializedAzureIaaSvmJobV2.duration - = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); - } else if ("errorDetails".equals(fieldName)) { - List errorDetails - = reader.readArray(reader1 -> AzureIaaSvmErrorInfo.fromJson(reader1)); - deserializedAzureIaaSvmJobV2.errorDetails = errorDetails; - } else if ("virtualMachineVersion".equals(fieldName)) { - deserializedAzureIaaSvmJobV2.virtualMachineVersion = reader.getString(); - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureIaaSvmJobV2.extendedInfo = AzureIaaSvmJobExtendedInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureIaaSvmJobV2; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItem.java deleted file mode 100644 index f51fea9da9d0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItem.java +++ /dev/null @@ -1,685 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * IaaS VM workload-specific backup item. - */ -@Fluent -public class AzureIaaSvmProtectedItem extends ProtectedItem { - /* - * backup item type. - */ - private String protectedItemType = "AzureIaaSVMProtectedItem"; - - /* - * Friendly name of the VM represented by this backup item. - */ - private String friendlyName; - - /* - * Fully qualified ARM ID of the virtual machine represented by this item. - */ - private String virtualMachineId; - - /* - * Backup status of this backup item. - */ - private String protectionStatus; - - /* - * Backup state of this backup item. - */ - private ProtectionState protectionState; - - /* - * Health status of protected item. - */ - private HealthStatus healthStatus; - - /* - * Health details on this backup item. - */ - private List healthDetails; - - /* - * Health details of different KPIs - */ - private Map kpisHealths; - - /* - * Last backup operation status. - */ - private String lastBackupStatus; - - /* - * Timestamp of the last backup operation on this backup item. - */ - private OffsetDateTime lastBackupTime; - - /* - * Data ID of the protected item. - */ - private String protectedItemDataId; - - /* - * Additional information for this backup item. - */ - private AzureIaaSvmProtectedItemExtendedInfo extendedInfo; - - /* - * Extended Properties for Azure IaasVM Backup. - */ - private ExtendedProperties extendedProperties; - - /* - * Type of the policy used for protection - */ - private String policyType; - - /** - * Creates an instance of AzureIaaSvmProtectedItem class. - */ - public AzureIaaSvmProtectedItem() { - } - - /** - * Get the protectedItemType property: backup item type. - * - * @return the protectedItemType value. - */ - @Override - public String protectedItemType() { - return this.protectedItemType; - } - - /** - * Get the friendlyName property: Friendly name of the VM represented by this backup item. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.friendlyName; - } - - /** - * Set the friendlyName property: Friendly name of the VM represented by this backup item. - * - * @param friendlyName the friendlyName value to set. - * @return the AzureIaaSvmProtectedItem object itself. - */ - AzureIaaSvmProtectedItem withFriendlyName(String friendlyName) { - this.friendlyName = friendlyName; - return this; - } - - /** - * Get the virtualMachineId property: Fully qualified ARM ID of the virtual machine represented by this item. - * - * @return the virtualMachineId value. - */ - public String virtualMachineId() { - return this.virtualMachineId; - } - - /** - * Set the virtualMachineId property: Fully qualified ARM ID of the virtual machine represented by this item. - * - * @param virtualMachineId the virtualMachineId value to set. - * @return the AzureIaaSvmProtectedItem object itself. - */ - AzureIaaSvmProtectedItem withVirtualMachineId(String virtualMachineId) { - this.virtualMachineId = virtualMachineId; - return this; - } - - /** - * Get the protectionStatus property: Backup status of this backup item. - * - * @return the protectionStatus value. - */ - public String protectionStatus() { - return this.protectionStatus; - } - - /** - * Set the protectionStatus property: Backup status of this backup item. - * - * @param protectionStatus the protectionStatus value to set. - * @return the AzureIaaSvmProtectedItem object itself. - */ - public AzureIaaSvmProtectedItem withProtectionStatus(String protectionStatus) { - this.protectionStatus = protectionStatus; - return this; - } - - /** - * Get the protectionState property: Backup state of this backup item. - * - * @return the protectionState value. - */ - public ProtectionState protectionState() { - return this.protectionState; - } - - /** - * Set the protectionState property: Backup state of this backup item. - * - * @param protectionState the protectionState value to set. - * @return the AzureIaaSvmProtectedItem object itself. - */ - public AzureIaaSvmProtectedItem withProtectionState(ProtectionState protectionState) { - this.protectionState = protectionState; - return this; - } - - /** - * Get the healthStatus property: Health status of protected item. - * - * @return the healthStatus value. - */ - public HealthStatus healthStatus() { - return this.healthStatus; - } - - /** - * Set the healthStatus property: Health status of protected item. - * - * @param healthStatus the healthStatus value to set. - * @return the AzureIaaSvmProtectedItem object itself. - */ - AzureIaaSvmProtectedItem withHealthStatus(HealthStatus healthStatus) { - this.healthStatus = healthStatus; - return this; - } - - /** - * Get the healthDetails property: Health details on this backup item. - * - * @return the healthDetails value. - */ - public List healthDetails() { - return this.healthDetails; - } - - /** - * Set the healthDetails property: Health details on this backup item. - * - * @param healthDetails the healthDetails value to set. - * @return the AzureIaaSvmProtectedItem object itself. - */ - public AzureIaaSvmProtectedItem withHealthDetails(List healthDetails) { - this.healthDetails = healthDetails; - return this; - } - - /** - * Get the kpisHealths property: Health details of different KPIs. - * - * @return the kpisHealths value. - */ - public Map kpisHealths() { - return this.kpisHealths; - } - - /** - * Set the kpisHealths property: Health details of different KPIs. - * - * @param kpisHealths the kpisHealths value to set. - * @return the AzureIaaSvmProtectedItem object itself. - */ - public AzureIaaSvmProtectedItem withKpisHealths(Map kpisHealths) { - this.kpisHealths = kpisHealths; - return this; - } - - /** - * Get the lastBackupStatus property: Last backup operation status. - * - * @return the lastBackupStatus value. - */ - public String lastBackupStatus() { - return this.lastBackupStatus; - } - - /** - * Set the lastBackupStatus property: Last backup operation status. - * - * @param lastBackupStatus the lastBackupStatus value to set. - * @return the AzureIaaSvmProtectedItem object itself. - */ - public AzureIaaSvmProtectedItem withLastBackupStatus(String lastBackupStatus) { - this.lastBackupStatus = lastBackupStatus; - return this; - } - - /** - * Get the lastBackupTime property: Timestamp of the last backup operation on this backup item. - * - * @return the lastBackupTime value. - */ - public OffsetDateTime lastBackupTime() { - return this.lastBackupTime; - } - - /** - * Set the lastBackupTime property: Timestamp of the last backup operation on this backup item. - * - * @param lastBackupTime the lastBackupTime value to set. - * @return the AzureIaaSvmProtectedItem object itself. - */ - AzureIaaSvmProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) { - this.lastBackupTime = lastBackupTime; - return this; - } - - /** - * Get the protectedItemDataId property: Data ID of the protected item. - * - * @return the protectedItemDataId value. - */ - public String protectedItemDataId() { - return this.protectedItemDataId; - } - - /** - * Set the protectedItemDataId property: Data ID of the protected item. - * - * @param protectedItemDataId the protectedItemDataId value to set. - * @return the AzureIaaSvmProtectedItem object itself. - */ - AzureIaaSvmProtectedItem withProtectedItemDataId(String protectedItemDataId) { - this.protectedItemDataId = protectedItemDataId; - return this; - } - - /** - * Get the extendedInfo property: Additional information for this backup item. - * - * @return the extendedInfo value. - */ - public AzureIaaSvmProtectedItemExtendedInfo extendedInfo() { - return this.extendedInfo; - } - - /** - * Set the extendedInfo property: Additional information for this backup item. - * - * @param extendedInfo the extendedInfo value to set. - * @return the AzureIaaSvmProtectedItem object itself. - */ - public AzureIaaSvmProtectedItem withExtendedInfo(AzureIaaSvmProtectedItemExtendedInfo extendedInfo) { - this.extendedInfo = extendedInfo; - return this; - } - - /** - * Get the extendedProperties property: Extended Properties for Azure IaasVM Backup. - * - * @return the extendedProperties value. - */ - public ExtendedProperties extendedProperties() { - return this.extendedProperties; - } - - /** - * Set the extendedProperties property: Extended Properties for Azure IaasVM Backup. - * - * @param extendedProperties the extendedProperties value to set. - * @return the AzureIaaSvmProtectedItem object itself. - */ - public AzureIaaSvmProtectedItem withExtendedProperties(ExtendedProperties extendedProperties) { - this.extendedProperties = extendedProperties; - return this; - } - - /** - * Get the policyType property: Type of the policy used for protection. - * - * @return the policyType value. - */ - public String policyType() { - return this.policyType; - } - - /** - * Set the policyType property: Type of the policy used for protection. - * - * @param policyType the policyType value to set. - * @return the AzureIaaSvmProtectedItem object itself. - */ - AzureIaaSvmProtectedItem withPolicyType(String policyType) { - this.policyType = policyType; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSvmProtectedItem withContainerName(String containerName) { - super.withContainerName(containerName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSvmProtectedItem withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSvmProtectedItem withPolicyId(String policyId) { - super.withPolicyId(policyId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSvmProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { - super.withLastRecoveryPoint(lastRecoveryPoint); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSvmProtectedItem withBackupSetName(String backupSetName) { - super.withBackupSetName(backupSetName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSvmProtectedItem withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSvmProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { - super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSvmProtectedItem withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { - super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSvmProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { - super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSvmProtectedItem withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { - super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSvmProtectedItem withIsRehydrate(Boolean isRehydrate) { - super.withIsRehydrate(isRehydrate); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSvmProtectedItem withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSvmProtectedItem withIsArchiveEnabled(Boolean isArchiveEnabled) { - super.withIsArchiveEnabled(isArchiveEnabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSvmProtectedItem withPolicyName(String policyName) { - super.withPolicyName(policyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSvmProtectedItem withSoftDeleteRetentionPeriodInDays(Integer softDeleteRetentionPeriodInDays) { - super.withSoftDeleteRetentionPeriodInDays(softDeleteRetentionPeriodInDays); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSvmProtectedItem withSourceSideScanInfo(SourceSideScanInfo sourceSideScanInfo) { - super.withSourceSideScanInfo(sourceSideScanInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("containerName", containerName()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("policyId", policyId()); - jsonWriter.writeStringField("lastRecoveryPoint", - lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint())); - jsonWriter.writeStringField("backupSetName", backupSetName()); - jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString()); - jsonWriter.writeStringField("deferredDeleteTimeInUTC", - deferredDeleteTimeInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc())); - jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete()); - jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining()); - jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming()); - jsonWriter.writeBooleanField("isRehydrate", isRehydrate()); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled()); - jsonWriter.writeStringField("policyName", policyName()); - jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriodInDays()); - jsonWriter.writeJsonField("sourceSideScanInfo", sourceSideScanInfo()); - jsonWriter.writeStringField("protectedItemType", this.protectedItemType); - jsonWriter.writeStringField("protectionStatus", this.protectionStatus); - jsonWriter.writeStringField("protectionState", - this.protectionState == null ? null : this.protectionState.toString()); - jsonWriter.writeArrayField("healthDetails", this.healthDetails, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeMapField("kpisHealths", this.kpisHealths, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("lastBackupStatus", this.lastBackupStatus); - jsonWriter.writeJsonField("extendedInfo", this.extendedInfo); - jsonWriter.writeJsonField("extendedProperties", this.extendedProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureIaaSvmProtectedItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureIaaSvmProtectedItem 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 AzureIaaSvmProtectedItem. - */ - public static AzureIaaSvmProtectedItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("protectedItemType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("Microsoft.Compute/virtualMachines".equals(discriminatorValue)) { - return AzureIaaSComputeVMProtectedItem.fromJson(readerToUse.reset()); - } else if ("Microsoft.ClassicCompute/virtualMachines".equals(discriminatorValue)) { - return AzureIaaSClassicComputeVMProtectedItem.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AzureIaaSvmProtectedItem fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureIaaSvmProtectedItem deserializedAzureIaaSvmProtectedItem = new AzureIaaSvmProtectedItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem - .withWorkloadType(DataSourceType.fromString(reader.getString())); - } else if ("containerName".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.withContainerName(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.withSourceResourceId(reader.getString()); - } else if ("policyId".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.withPolicyId(reader.getString()); - } else if ("lastRecoveryPoint".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.withLastRecoveryPoint(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("backupSetName".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.withBackupSetName(reader.getString()); - } else if ("createMode".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.withCreateMode(CreateMode.fromString(reader.getString())); - } else if ("deferredDeleteTimeInUTC".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.withDeferredDeleteTimeInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("isScheduledForDeferredDelete".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem - .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean)); - } else if ("deferredDeleteTimeRemaining".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.withDeferredDeleteTimeRemaining(reader.getString()); - } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem - .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean)); - } else if ("isRehydrate".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.withIsRehydrate(reader.getNullable(JsonReader::getBoolean)); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureIaaSvmProtectedItem - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("isArchiveEnabled".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem - .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("policyName".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.withPolicyName(reader.getString()); - } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem - .withSoftDeleteRetentionPeriodInDays(reader.getNullable(JsonReader::getInt)); - } else if ("vaultId".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.withVaultId(reader.getString()); - } else if ("sourceSideScanInfo".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.withSourceSideScanInfo(SourceSideScanInfo.fromJson(reader)); - } else if ("protectedItemType".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.protectedItemType = reader.getString(); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.friendlyName = reader.getString(); - } else if ("virtualMachineId".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.virtualMachineId = reader.getString(); - } else if ("protectionStatus".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.protectionStatus = reader.getString(); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.protectionState - = ProtectionState.fromString(reader.getString()); - } else if ("healthStatus".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.healthStatus = HealthStatus.fromString(reader.getString()); - } else if ("healthDetails".equals(fieldName)) { - List healthDetails - = reader.readArray(reader1 -> AzureIaaSvmHealthDetails.fromJson(reader1)); - deserializedAzureIaaSvmProtectedItem.healthDetails = healthDetails; - } else if ("kpisHealths".equals(fieldName)) { - Map kpisHealths - = reader.readMap(reader1 -> KpiResourceHealthDetails.fromJson(reader1)); - deserializedAzureIaaSvmProtectedItem.kpisHealths = kpisHealths; - } else if ("lastBackupStatus".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.lastBackupStatus = reader.getString(); - } else if ("lastBackupTime".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.lastBackupTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("protectedItemDataId".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.protectedItemDataId = reader.getString(); - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.extendedInfo - = AzureIaaSvmProtectedItemExtendedInfo.fromJson(reader); - } else if ("extendedProperties".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.extendedProperties = ExtendedProperties.fromJson(reader); - } else if ("policyType".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItem.policyType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureIaaSvmProtectedItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItemExtendedInfo.java deleted file mode 100644 index 2ca2aa4cfa0d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectedItemExtendedInfo.java +++ /dev/null @@ -1,255 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Additional information on Azure IaaS VM specific backup item. - */ -@Fluent -public final class AzureIaaSvmProtectedItemExtendedInfo - implements JsonSerializable { - /* - * The oldest backup copy available for this backup item across all tiers. - */ - private OffsetDateTime oldestRecoveryPoint; - - /* - * The oldest backup copy available for this backup item in vault tier - */ - private OffsetDateTime oldestRecoveryPointInVault; - - /* - * The oldest backup copy available for this backup item in archive tier - */ - private OffsetDateTime oldestRecoveryPointInArchive; - - /* - * The latest backup copy available for this backup item in archive tier - */ - private OffsetDateTime newestRecoveryPointInArchive; - - /* - * Number of backup copies available for this backup item. - */ - private Integer recoveryPointCount; - - /* - * Specifies if backup policy associated with the backup item is inconsistent. - */ - private Boolean policyInconsistent; - - /** - * Creates an instance of AzureIaaSvmProtectedItemExtendedInfo class. - */ - public AzureIaaSvmProtectedItemExtendedInfo() { - } - - /** - * Get the oldestRecoveryPoint property: The oldest backup copy available for this backup item across all tiers. - * - * @return the oldestRecoveryPoint value. - */ - public OffsetDateTime oldestRecoveryPoint() { - return this.oldestRecoveryPoint; - } - - /** - * Set the oldestRecoveryPoint property: The oldest backup copy available for this backup item across all tiers. - * - * @param oldestRecoveryPoint the oldestRecoveryPoint value to set. - * @return the AzureIaaSvmProtectedItemExtendedInfo object itself. - */ - public AzureIaaSvmProtectedItemExtendedInfo withOldestRecoveryPoint(OffsetDateTime oldestRecoveryPoint) { - this.oldestRecoveryPoint = oldestRecoveryPoint; - return this; - } - - /** - * Get the oldestRecoveryPointInVault property: The oldest backup copy available for this backup item in vault tier. - * - * @return the oldestRecoveryPointInVault value. - */ - public OffsetDateTime oldestRecoveryPointInVault() { - return this.oldestRecoveryPointInVault; - } - - /** - * Set the oldestRecoveryPointInVault property: The oldest backup copy available for this backup item in vault tier. - * - * @param oldestRecoveryPointInVault the oldestRecoveryPointInVault value to set. - * @return the AzureIaaSvmProtectedItemExtendedInfo object itself. - */ - public AzureIaaSvmProtectedItemExtendedInfo - withOldestRecoveryPointInVault(OffsetDateTime oldestRecoveryPointInVault) { - this.oldestRecoveryPointInVault = oldestRecoveryPointInVault; - return this; - } - - /** - * Get the oldestRecoveryPointInArchive property: The oldest backup copy available for this backup item in archive - * tier. - * - * @return the oldestRecoveryPointInArchive value. - */ - public OffsetDateTime oldestRecoveryPointInArchive() { - return this.oldestRecoveryPointInArchive; - } - - /** - * Set the oldestRecoveryPointInArchive property: The oldest backup copy available for this backup item in archive - * tier. - * - * @param oldestRecoveryPointInArchive the oldestRecoveryPointInArchive value to set. - * @return the AzureIaaSvmProtectedItemExtendedInfo object itself. - */ - public AzureIaaSvmProtectedItemExtendedInfo - withOldestRecoveryPointInArchive(OffsetDateTime oldestRecoveryPointInArchive) { - this.oldestRecoveryPointInArchive = oldestRecoveryPointInArchive; - return this; - } - - /** - * Get the newestRecoveryPointInArchive property: The latest backup copy available for this backup item in archive - * tier. - * - * @return the newestRecoveryPointInArchive value. - */ - public OffsetDateTime newestRecoveryPointInArchive() { - return this.newestRecoveryPointInArchive; - } - - /** - * Set the newestRecoveryPointInArchive property: The latest backup copy available for this backup item in archive - * tier. - * - * @param newestRecoveryPointInArchive the newestRecoveryPointInArchive value to set. - * @return the AzureIaaSvmProtectedItemExtendedInfo object itself. - */ - public AzureIaaSvmProtectedItemExtendedInfo - withNewestRecoveryPointInArchive(OffsetDateTime newestRecoveryPointInArchive) { - this.newestRecoveryPointInArchive = newestRecoveryPointInArchive; - return this; - } - - /** - * Get the recoveryPointCount property: Number of backup copies available for this backup item. - * - * @return the recoveryPointCount value. - */ - public Integer recoveryPointCount() { - return this.recoveryPointCount; - } - - /** - * Set the recoveryPointCount property: Number of backup copies available for this backup item. - * - * @param recoveryPointCount the recoveryPointCount value to set. - * @return the AzureIaaSvmProtectedItemExtendedInfo object itself. - */ - public AzureIaaSvmProtectedItemExtendedInfo withRecoveryPointCount(Integer recoveryPointCount) { - this.recoveryPointCount = recoveryPointCount; - return this; - } - - /** - * Get the policyInconsistent property: Specifies if backup policy associated with the backup item is inconsistent. - * - * @return the policyInconsistent value. - */ - public Boolean policyInconsistent() { - return this.policyInconsistent; - } - - /** - * Set the policyInconsistent property: Specifies if backup policy associated with the backup item is inconsistent. - * - * @param policyInconsistent the policyInconsistent value to set. - * @return the AzureIaaSvmProtectedItemExtendedInfo object itself. - */ - public AzureIaaSvmProtectedItemExtendedInfo withPolicyInconsistent(Boolean policyInconsistent) { - this.policyInconsistent = policyInconsistent; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("oldestRecoveryPoint", - this.oldestRecoveryPoint == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.oldestRecoveryPoint)); - jsonWriter.writeStringField("oldestRecoveryPointInVault", - this.oldestRecoveryPointInVault == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.oldestRecoveryPointInVault)); - jsonWriter.writeStringField("oldestRecoveryPointInArchive", - this.oldestRecoveryPointInArchive == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.oldestRecoveryPointInArchive)); - jsonWriter.writeStringField("newestRecoveryPointInArchive", - this.newestRecoveryPointInArchive == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.newestRecoveryPointInArchive)); - jsonWriter.writeNumberField("recoveryPointCount", this.recoveryPointCount); - jsonWriter.writeBooleanField("policyInconsistent", this.policyInconsistent); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureIaaSvmProtectedItemExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureIaaSvmProtectedItemExtendedInfo 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 AzureIaaSvmProtectedItemExtendedInfo. - */ - public static AzureIaaSvmProtectedItemExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureIaaSvmProtectedItemExtendedInfo deserializedAzureIaaSvmProtectedItemExtendedInfo - = new AzureIaaSvmProtectedItemExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("oldestRecoveryPoint".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItemExtendedInfo.oldestRecoveryPoint = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("oldestRecoveryPointInVault".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItemExtendedInfo.oldestRecoveryPointInVault = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("oldestRecoveryPointInArchive".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItemExtendedInfo.oldestRecoveryPointInArchive = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("newestRecoveryPointInArchive".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItemExtendedInfo.newestRecoveryPointInArchive = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("recoveryPointCount".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItemExtendedInfo.recoveryPointCount - = reader.getNullable(JsonReader::getInt); - } else if ("policyInconsistent".equals(fieldName)) { - deserializedAzureIaaSvmProtectedItemExtendedInfo.policyInconsistent - = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureIaaSvmProtectedItemExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectionPolicy.java deleted file mode 100644 index 76e1cf5e6b9e..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureIaaSvmProtectionPolicy.java +++ /dev/null @@ -1,344 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * IaaS VM workload-specific backup policy. - */ -@Fluent -public final class AzureIaaSvmProtectionPolicy extends ProtectionPolicy { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String backupManagementType = "AzureIaasVM"; - - /* - * The instantRPDetails property. - */ - private InstantRPAdditionalDetails instantRPDetails; - - /* - * Backup schedule specified as part of backup policy. - */ - private SchedulePolicy schedulePolicy; - - /* - * Retention policy with the details on backup copy retention ranges. - */ - private RetentionPolicy retentionPolicy; - - /* - * Tiering policy to automatically move RPs to another tier - * Key is Target Tier, defined in RecoveryPointTierType enum. - * Tiering policy specifies the criteria to move RP to the target tier. - */ - private Map tieringPolicy; - - /* - * Instant RP retention policy range in days - */ - private Integer instantRpRetentionRangeInDays; - - /* - * TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - */ - private String timeZone; - - /* - * The policyType property. - */ - private IaasvmPolicyType policyType; - - /* - * The snapshotConsistencyType property. - */ - private IaasVMSnapshotConsistencyType snapshotConsistencyType; - - /** - * Creates an instance of AzureIaaSvmProtectionPolicy class. - */ - public AzureIaaSvmProtectionPolicy() { - } - - /** - * Get the backupManagementType property: This property will be used as the discriminator for deciding the specific - * types in the polymorphic chain of types. - * - * @return the backupManagementType value. - */ - @Override - public String backupManagementType() { - return this.backupManagementType; - } - - /** - * Get the instantRPDetails property: The instantRPDetails property. - * - * @return the instantRPDetails value. - */ - public InstantRPAdditionalDetails instantRPDetails() { - return this.instantRPDetails; - } - - /** - * Set the instantRPDetails property: The instantRPDetails property. - * - * @param instantRPDetails the instantRPDetails value to set. - * @return the AzureIaaSvmProtectionPolicy object itself. - */ - public AzureIaaSvmProtectionPolicy withInstantRPDetails(InstantRPAdditionalDetails instantRPDetails) { - this.instantRPDetails = instantRPDetails; - return this; - } - - /** - * Get the schedulePolicy property: Backup schedule specified as part of backup policy. - * - * @return the schedulePolicy value. - */ - public SchedulePolicy schedulePolicy() { - return this.schedulePolicy; - } - - /** - * Set the schedulePolicy property: Backup schedule specified as part of backup policy. - * - * @param schedulePolicy the schedulePolicy value to set. - * @return the AzureIaaSvmProtectionPolicy object itself. - */ - public AzureIaaSvmProtectionPolicy withSchedulePolicy(SchedulePolicy schedulePolicy) { - this.schedulePolicy = schedulePolicy; - return this; - } - - /** - * Get the retentionPolicy property: Retention policy with the details on backup copy retention ranges. - * - * @return the retentionPolicy value. - */ - public RetentionPolicy retentionPolicy() { - return this.retentionPolicy; - } - - /** - * Set the retentionPolicy property: Retention policy with the details on backup copy retention ranges. - * - * @param retentionPolicy the retentionPolicy value to set. - * @return the AzureIaaSvmProtectionPolicy object itself. - */ - public AzureIaaSvmProtectionPolicy withRetentionPolicy(RetentionPolicy retentionPolicy) { - this.retentionPolicy = retentionPolicy; - return this; - } - - /** - * Get the tieringPolicy property: Tiering policy to automatically move RPs to another tier - * Key is Target Tier, defined in RecoveryPointTierType enum. - * Tiering policy specifies the criteria to move RP to the target tier. - * - * @return the tieringPolicy value. - */ - public Map tieringPolicy() { - return this.tieringPolicy; - } - - /** - * Set the tieringPolicy property: Tiering policy to automatically move RPs to another tier - * Key is Target Tier, defined in RecoveryPointTierType enum. - * Tiering policy specifies the criteria to move RP to the target tier. - * - * @param tieringPolicy the tieringPolicy value to set. - * @return the AzureIaaSvmProtectionPolicy object itself. - */ - public AzureIaaSvmProtectionPolicy withTieringPolicy(Map tieringPolicy) { - this.tieringPolicy = tieringPolicy; - return this; - } - - /** - * Get the instantRpRetentionRangeInDays property: Instant RP retention policy range in days. - * - * @return the instantRpRetentionRangeInDays value. - */ - public Integer instantRpRetentionRangeInDays() { - return this.instantRpRetentionRangeInDays; - } - - /** - * Set the instantRpRetentionRangeInDays property: Instant RP retention policy range in days. - * - * @param instantRpRetentionRangeInDays the instantRpRetentionRangeInDays value to set. - * @return the AzureIaaSvmProtectionPolicy object itself. - */ - public AzureIaaSvmProtectionPolicy withInstantRpRetentionRangeInDays(Integer instantRpRetentionRangeInDays) { - this.instantRpRetentionRangeInDays = instantRpRetentionRangeInDays; - return this; - } - - /** - * Get the timeZone property: TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - * - * @return the timeZone value. - */ - public String timeZone() { - return this.timeZone; - } - - /** - * Set the timeZone property: TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - * - * @param timeZone the timeZone value to set. - * @return the AzureIaaSvmProtectionPolicy object itself. - */ - public AzureIaaSvmProtectionPolicy withTimeZone(String timeZone) { - this.timeZone = timeZone; - return this; - } - - /** - * Get the policyType property: The policyType property. - * - * @return the policyType value. - */ - public IaasvmPolicyType policyType() { - return this.policyType; - } - - /** - * Set the policyType property: The policyType property. - * - * @param policyType the policyType value to set. - * @return the AzureIaaSvmProtectionPolicy object itself. - */ - public AzureIaaSvmProtectionPolicy withPolicyType(IaasvmPolicyType policyType) { - this.policyType = policyType; - return this; - } - - /** - * Get the snapshotConsistencyType property: The snapshotConsistencyType property. - * - * @return the snapshotConsistencyType value. - */ - public IaasVMSnapshotConsistencyType snapshotConsistencyType() { - return this.snapshotConsistencyType; - } - - /** - * Set the snapshotConsistencyType property: The snapshotConsistencyType property. - * - * @param snapshotConsistencyType the snapshotConsistencyType value to set. - * @return the AzureIaaSvmProtectionPolicy object itself. - */ - public AzureIaaSvmProtectionPolicy - withSnapshotConsistencyType(IaasVMSnapshotConsistencyType snapshotConsistencyType) { - this.snapshotConsistencyType = snapshotConsistencyType; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSvmProtectionPolicy withProtectedItemsCount(Integer protectedItemsCount) { - super.withProtectedItemsCount(protectedItemsCount); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureIaaSvmProtectionPolicy withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("protectedItemsCount", protectedItemsCount()); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("backupManagementType", this.backupManagementType); - jsonWriter.writeJsonField("instantRPDetails", this.instantRPDetails); - jsonWriter.writeJsonField("schedulePolicy", this.schedulePolicy); - jsonWriter.writeJsonField("retentionPolicy", this.retentionPolicy); - jsonWriter.writeMapField("tieringPolicy", this.tieringPolicy, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeNumberField("instantRpRetentionRangeInDays", this.instantRpRetentionRangeInDays); - jsonWriter.writeStringField("timeZone", this.timeZone); - jsonWriter.writeStringField("policyType", this.policyType == null ? null : this.policyType.toString()); - jsonWriter.writeStringField("snapshotConsistencyType", - this.snapshotConsistencyType == null ? null : this.snapshotConsistencyType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureIaaSvmProtectionPolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureIaaSvmProtectionPolicy 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 AzureIaaSvmProtectionPolicy. - */ - public static AzureIaaSvmProtectionPolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureIaaSvmProtectionPolicy deserializedAzureIaaSvmProtectionPolicy = new AzureIaaSvmProtectionPolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("protectedItemsCount".equals(fieldName)) { - deserializedAzureIaaSvmProtectionPolicy - .withProtectedItemsCount(reader.getNullable(JsonReader::getInt)); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureIaaSvmProtectionPolicy - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("backupManagementType".equals(fieldName)) { - deserializedAzureIaaSvmProtectionPolicy.backupManagementType = reader.getString(); - } else if ("instantRPDetails".equals(fieldName)) { - deserializedAzureIaaSvmProtectionPolicy.instantRPDetails - = InstantRPAdditionalDetails.fromJson(reader); - } else if ("schedulePolicy".equals(fieldName)) { - deserializedAzureIaaSvmProtectionPolicy.schedulePolicy = SchedulePolicy.fromJson(reader); - } else if ("retentionPolicy".equals(fieldName)) { - deserializedAzureIaaSvmProtectionPolicy.retentionPolicy = RetentionPolicy.fromJson(reader); - } else if ("tieringPolicy".equals(fieldName)) { - Map tieringPolicy - = reader.readMap(reader1 -> TieringPolicy.fromJson(reader1)); - deserializedAzureIaaSvmProtectionPolicy.tieringPolicy = tieringPolicy; - } else if ("instantRpRetentionRangeInDays".equals(fieldName)) { - deserializedAzureIaaSvmProtectionPolicy.instantRpRetentionRangeInDays - = reader.getNullable(JsonReader::getInt); - } else if ("timeZone".equals(fieldName)) { - deserializedAzureIaaSvmProtectionPolicy.timeZone = reader.getString(); - } else if ("policyType".equals(fieldName)) { - deserializedAzureIaaSvmProtectionPolicy.policyType - = IaasvmPolicyType.fromString(reader.getString()); - } else if ("snapshotConsistencyType".equals(fieldName)) { - deserializedAzureIaaSvmProtectionPolicy.snapshotConsistencyType - = IaasVMSnapshotConsistencyType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureIaaSvmProtectionPolicy; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureRecoveryServiceVaultProtectionIntent.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureRecoveryServiceVaultProtectionIntent.java deleted file mode 100644 index 60c56bd22144..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureRecoveryServiceVaultProtectionIntent.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure Recovery Services Vault specific protection intent item. - */ -@Fluent -public class AzureRecoveryServiceVaultProtectionIntent extends ProtectionIntent { - /* - * backup protectionIntent type. - */ - private ProtectionIntentItemType protectionIntentItemType = ProtectionIntentItemType.RECOVERY_SERVICE_VAULT_ITEM; - - /** - * Creates an instance of AzureRecoveryServiceVaultProtectionIntent class. - */ - public AzureRecoveryServiceVaultProtectionIntent() { - } - - /** - * Get the protectionIntentItemType property: backup protectionIntent type. - * - * @return the protectionIntentItemType value. - */ - @Override - public ProtectionIntentItemType protectionIntentItemType() { - return this.protectionIntentItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureRecoveryServiceVaultProtectionIntent - withBackupManagementType(BackupManagementType backupManagementType) { - super.withBackupManagementType(backupManagementType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureRecoveryServiceVaultProtectionIntent withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureRecoveryServiceVaultProtectionIntent withItemId(String itemId) { - super.withItemId(itemId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureRecoveryServiceVaultProtectionIntent withPolicyId(String policyId) { - super.withPolicyId(policyId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureRecoveryServiceVaultProtectionIntent withProtectionState(ProtectionStatus protectionState) { - super.withProtectionState(protectionState); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("itemId", itemId()); - jsonWriter.writeStringField("policyId", policyId()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("protectionIntentItemType", - this.protectionIntentItemType == null ? null : this.protectionIntentItemType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureRecoveryServiceVaultProtectionIntent from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureRecoveryServiceVaultProtectionIntent 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 AzureRecoveryServiceVaultProtectionIntent. - */ - public static AzureRecoveryServiceVaultProtectionIntent fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("protectionIntentItemType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureWorkloadAutoProtectionIntent".equals(discriminatorValue)) { - return AzureWorkloadAutoProtectionIntent.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureWorkloadSQLAutoProtectionIntent".equals(discriminatorValue)) { - return AzureWorkloadSqlAutoProtectionIntent.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AzureRecoveryServiceVaultProtectionIntent fromJsonKnownDiscriminator(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - AzureRecoveryServiceVaultProtectionIntent deserializedAzureRecoveryServiceVaultProtectionIntent - = new AzureRecoveryServiceVaultProtectionIntent(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureRecoveryServiceVaultProtectionIntent - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureRecoveryServiceVaultProtectionIntent.withSourceResourceId(reader.getString()); - } else if ("itemId".equals(fieldName)) { - deserializedAzureRecoveryServiceVaultProtectionIntent.withItemId(reader.getString()); - } else if ("policyId".equals(fieldName)) { - deserializedAzureRecoveryServiceVaultProtectionIntent.withPolicyId(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureRecoveryServiceVaultProtectionIntent - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("protectionIntentItemType".equals(fieldName)) { - deserializedAzureRecoveryServiceVaultProtectionIntent.protectionIntentItemType - = ProtectionIntentItemType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureRecoveryServiceVaultProtectionIntent; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureResourceProtectionIntent.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureResourceProtectionIntent.java deleted file mode 100644 index 6959d646b6fc..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureResourceProtectionIntent.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * IaaS VM specific backup protection intent item. - */ -@Fluent -public final class AzureResourceProtectionIntent extends ProtectionIntent { - /* - * backup protectionIntent type. - */ - private ProtectionIntentItemType protectionIntentItemType = ProtectionIntentItemType.AZURE_RESOURCE_ITEM; - - /* - * Friendly name of the VM represented by this backup item. - */ - private String friendlyName; - - /** - * Creates an instance of AzureResourceProtectionIntent class. - */ - public AzureResourceProtectionIntent() { - } - - /** - * Get the protectionIntentItemType property: backup protectionIntent type. - * - * @return the protectionIntentItemType value. - */ - @Override - public ProtectionIntentItemType protectionIntentItemType() { - return this.protectionIntentItemType; - } - - /** - * Get the friendlyName property: Friendly name of the VM represented by this backup item. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.friendlyName; - } - - /** - * Set the friendlyName property: Friendly name of the VM represented by this backup item. - * - * @param friendlyName the friendlyName value to set. - * @return the AzureResourceProtectionIntent object itself. - */ - public AzureResourceProtectionIntent withFriendlyName(String friendlyName) { - this.friendlyName = friendlyName; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureResourceProtectionIntent withBackupManagementType(BackupManagementType backupManagementType) { - super.withBackupManagementType(backupManagementType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureResourceProtectionIntent withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureResourceProtectionIntent withItemId(String itemId) { - super.withItemId(itemId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureResourceProtectionIntent withPolicyId(String policyId) { - super.withPolicyId(policyId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureResourceProtectionIntent withProtectionState(ProtectionStatus protectionState) { - super.withProtectionState(protectionState); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("itemId", itemId()); - jsonWriter.writeStringField("policyId", policyId()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("protectionIntentItemType", - this.protectionIntentItemType == null ? null : this.protectionIntentItemType.toString()); - jsonWriter.writeStringField("friendlyName", this.friendlyName); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureResourceProtectionIntent from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureResourceProtectionIntent 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 AzureResourceProtectionIntent. - */ - public static AzureResourceProtectionIntent fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureResourceProtectionIntent deserializedAzureResourceProtectionIntent - = new AzureResourceProtectionIntent(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureResourceProtectionIntent - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureResourceProtectionIntent.withSourceResourceId(reader.getString()); - } else if ("itemId".equals(fieldName)) { - deserializedAzureResourceProtectionIntent.withItemId(reader.getString()); - } else if ("policyId".equals(fieldName)) { - deserializedAzureResourceProtectionIntent.withPolicyId(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureResourceProtectionIntent - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("protectionIntentItemType".equals(fieldName)) { - deserializedAzureResourceProtectionIntent.protectionIntentItemType - = ProtectionIntentItemType.fromString(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureResourceProtectionIntent.friendlyName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureResourceProtectionIntent; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlContainer.java deleted file mode 100644 index b8214ab0b022..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlContainer.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure Sql workload-specific container. - */ -@Fluent -public final class AzureSqlContainer extends ProtectionContainer { - /* - * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines - * 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer - */ - private ProtectableContainerType containerType = ProtectableContainerType.AZURE_SQL_CONTAINER; - - /** - * Creates an instance of AzureSqlContainer class. - */ - public AzureSqlContainer() { - } - - /** - * Get the containerType property: Type of the container. The value of this property for: 1. Compute Azure VM is - * Microsoft.Compute/virtualMachines 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer. - * - * @return the containerType value. - */ - @Override - public ProtectableContainerType containerType() { - return this.containerType; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlContainer withFriendlyName(String friendlyName) { - super.withFriendlyName(friendlyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlContainer withBackupManagementType(BackupManagementType backupManagementType) { - super.withBackupManagementType(backupManagementType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlContainer withRegistrationStatus(String registrationStatus) { - super.withRegistrationStatus(registrationStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlContainer withHealthStatus(String healthStatus) { - super.withHealthStatus(healthStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlContainer withProtectableObjectType(String protectableObjectType) { - super.withProtectableObjectType(protectableObjectType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("registrationStatus", registrationStatus()); - jsonWriter.writeStringField("healthStatus", healthStatus()); - jsonWriter.writeStringField("protectableObjectType", protectableObjectType()); - jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureSqlContainer from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureSqlContainer 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 AzureSqlContainer. - */ - public static AzureSqlContainer fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureSqlContainer deserializedAzureSqlContainer = new AzureSqlContainer(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("friendlyName".equals(fieldName)) { - deserializedAzureSqlContainer.withFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedAzureSqlContainer - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("registrationStatus".equals(fieldName)) { - deserializedAzureSqlContainer.withRegistrationStatus(reader.getString()); - } else if ("healthStatus".equals(fieldName)) { - deserializedAzureSqlContainer.withHealthStatus(reader.getString()); - } else if ("protectableObjectType".equals(fieldName)) { - deserializedAzureSqlContainer.withProtectableObjectType(reader.getString()); - } else if ("containerType".equals(fieldName)) { - deserializedAzureSqlContainer.containerType - = ProtectableContainerType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureSqlContainer; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItem.java deleted file mode 100644 index 2dc122a2fb2c..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItem.java +++ /dev/null @@ -1,377 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Azure SQL workload-specific backup item. - */ -@Fluent -public final class AzureSqlProtectedItem extends ProtectedItem { - /* - * backup item type. - */ - private String protectedItemType = "Microsoft.Sql/servers/databases"; - - /* - * Internal ID of a backup item. Used by Azure SQL Backup engine to contact Recovery Services. - */ - private String protectedItemDataId; - - /* - * Backup state of the backed up item. - */ - private ProtectedItemState protectionState; - - /* - * Additional information for this backup item. - */ - private AzureSqlProtectedItemExtendedInfo extendedInfo; - - /** - * Creates an instance of AzureSqlProtectedItem class. - */ - public AzureSqlProtectedItem() { - } - - /** - * Get the protectedItemType property: backup item type. - * - * @return the protectedItemType value. - */ - @Override - public String protectedItemType() { - return this.protectedItemType; - } - - /** - * Get the protectedItemDataId property: Internal ID of a backup item. Used by Azure SQL Backup engine to contact - * Recovery Services. - * - * @return the protectedItemDataId value. - */ - public String protectedItemDataId() { - return this.protectedItemDataId; - } - - /** - * Set the protectedItemDataId property: Internal ID of a backup item. Used by Azure SQL Backup engine to contact - * Recovery Services. - * - * @param protectedItemDataId the protectedItemDataId value to set. - * @return the AzureSqlProtectedItem object itself. - */ - public AzureSqlProtectedItem withProtectedItemDataId(String protectedItemDataId) { - this.protectedItemDataId = protectedItemDataId; - return this; - } - - /** - * Get the protectionState property: Backup state of the backed up item. - * - * @return the protectionState value. - */ - public ProtectedItemState protectionState() { - return this.protectionState; - } - - /** - * Set the protectionState property: Backup state of the backed up item. - * - * @param protectionState the protectionState value to set. - * @return the AzureSqlProtectedItem object itself. - */ - public AzureSqlProtectedItem withProtectionState(ProtectedItemState protectionState) { - this.protectionState = protectionState; - return this; - } - - /** - * Get the extendedInfo property: Additional information for this backup item. - * - * @return the extendedInfo value. - */ - public AzureSqlProtectedItemExtendedInfo extendedInfo() { - return this.extendedInfo; - } - - /** - * Set the extendedInfo property: Additional information for this backup item. - * - * @param extendedInfo the extendedInfo value to set. - * @return the AzureSqlProtectedItem object itself. - */ - public AzureSqlProtectedItem withExtendedInfo(AzureSqlProtectedItemExtendedInfo extendedInfo) { - this.extendedInfo = extendedInfo; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlProtectedItem withContainerName(String containerName) { - super.withContainerName(containerName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlProtectedItem withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlProtectedItem withPolicyId(String policyId) { - super.withPolicyId(policyId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { - super.withLastRecoveryPoint(lastRecoveryPoint); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlProtectedItem withBackupSetName(String backupSetName) { - super.withBackupSetName(backupSetName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlProtectedItem withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { - super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlProtectedItem withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { - super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { - super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlProtectedItem withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { - super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlProtectedItem withIsRehydrate(Boolean isRehydrate) { - super.withIsRehydrate(isRehydrate); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlProtectedItem withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlProtectedItem withIsArchiveEnabled(Boolean isArchiveEnabled) { - super.withIsArchiveEnabled(isArchiveEnabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlProtectedItem withPolicyName(String policyName) { - super.withPolicyName(policyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlProtectedItem withSoftDeleteRetentionPeriodInDays(Integer softDeleteRetentionPeriodInDays) { - super.withSoftDeleteRetentionPeriodInDays(softDeleteRetentionPeriodInDays); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlProtectedItem withSourceSideScanInfo(SourceSideScanInfo sourceSideScanInfo) { - super.withSourceSideScanInfo(sourceSideScanInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("containerName", containerName()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("policyId", policyId()); - jsonWriter.writeStringField("lastRecoveryPoint", - lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint())); - jsonWriter.writeStringField("backupSetName", backupSetName()); - jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString()); - jsonWriter.writeStringField("deferredDeleteTimeInUTC", - deferredDeleteTimeInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc())); - jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete()); - jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining()); - jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming()); - jsonWriter.writeBooleanField("isRehydrate", isRehydrate()); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled()); - jsonWriter.writeStringField("policyName", policyName()); - jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriodInDays()); - jsonWriter.writeJsonField("sourceSideScanInfo", sourceSideScanInfo()); - jsonWriter.writeStringField("protectedItemType", this.protectedItemType); - jsonWriter.writeStringField("protectedItemDataId", this.protectedItemDataId); - jsonWriter.writeStringField("protectionState", - this.protectionState == null ? null : this.protectionState.toString()); - jsonWriter.writeJsonField("extendedInfo", this.extendedInfo); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureSqlProtectedItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureSqlProtectedItem 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 AzureSqlProtectedItem. - */ - public static AzureSqlProtectedItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureSqlProtectedItem deserializedAzureSqlProtectedItem = new AzureSqlProtectedItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureSqlProtectedItem - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureSqlProtectedItem.withWorkloadType(DataSourceType.fromString(reader.getString())); - } else if ("containerName".equals(fieldName)) { - deserializedAzureSqlProtectedItem.withContainerName(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureSqlProtectedItem.withSourceResourceId(reader.getString()); - } else if ("policyId".equals(fieldName)) { - deserializedAzureSqlProtectedItem.withPolicyId(reader.getString()); - } else if ("lastRecoveryPoint".equals(fieldName)) { - deserializedAzureSqlProtectedItem.withLastRecoveryPoint(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("backupSetName".equals(fieldName)) { - deserializedAzureSqlProtectedItem.withBackupSetName(reader.getString()); - } else if ("createMode".equals(fieldName)) { - deserializedAzureSqlProtectedItem.withCreateMode(CreateMode.fromString(reader.getString())); - } else if ("deferredDeleteTimeInUTC".equals(fieldName)) { - deserializedAzureSqlProtectedItem.withDeferredDeleteTimeInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("isScheduledForDeferredDelete".equals(fieldName)) { - deserializedAzureSqlProtectedItem - .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean)); - } else if ("deferredDeleteTimeRemaining".equals(fieldName)) { - deserializedAzureSqlProtectedItem.withDeferredDeleteTimeRemaining(reader.getString()); - } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) { - deserializedAzureSqlProtectedItem - .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean)); - } else if ("isRehydrate".equals(fieldName)) { - deserializedAzureSqlProtectedItem.withIsRehydrate(reader.getNullable(JsonReader::getBoolean)); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureSqlProtectedItem - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("isArchiveEnabled".equals(fieldName)) { - deserializedAzureSqlProtectedItem.withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("policyName".equals(fieldName)) { - deserializedAzureSqlProtectedItem.withPolicyName(reader.getString()); - } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) { - deserializedAzureSqlProtectedItem - .withSoftDeleteRetentionPeriodInDays(reader.getNullable(JsonReader::getInt)); - } else if ("vaultId".equals(fieldName)) { - deserializedAzureSqlProtectedItem.withVaultId(reader.getString()); - } else if ("sourceSideScanInfo".equals(fieldName)) { - deserializedAzureSqlProtectedItem.withSourceSideScanInfo(SourceSideScanInfo.fromJson(reader)); - } else if ("protectedItemType".equals(fieldName)) { - deserializedAzureSqlProtectedItem.protectedItemType = reader.getString(); - } else if ("protectedItemDataId".equals(fieldName)) { - deserializedAzureSqlProtectedItem.protectedItemDataId = reader.getString(); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureSqlProtectedItem.protectionState - = ProtectedItemState.fromString(reader.getString()); - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureSqlProtectedItem.extendedInfo = AzureSqlProtectedItemExtendedInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureSqlProtectedItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItemExtendedInfo.java deleted file mode 100644 index 30acb9a6f5c6..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectedItemExtendedInfo.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Additional information on Azure Sql specific protected item. - */ -@Fluent -public final class AzureSqlProtectedItemExtendedInfo implements JsonSerializable { - /* - * The oldest backup copy available for this item in the service. - */ - private OffsetDateTime oldestRecoveryPoint; - - /* - * Number of available backup copies associated with this backup item. - */ - private Integer recoveryPointCount; - - /* - * State of the backup policy associated with this backup item. - */ - private String policyState; - - /** - * Creates an instance of AzureSqlProtectedItemExtendedInfo class. - */ - public AzureSqlProtectedItemExtendedInfo() { - } - - /** - * Get the oldestRecoveryPoint property: The oldest backup copy available for this item in the service. - * - * @return the oldestRecoveryPoint value. - */ - public OffsetDateTime oldestRecoveryPoint() { - return this.oldestRecoveryPoint; - } - - /** - * Set the oldestRecoveryPoint property: The oldest backup copy available for this item in the service. - * - * @param oldestRecoveryPoint the oldestRecoveryPoint value to set. - * @return the AzureSqlProtectedItemExtendedInfo object itself. - */ - public AzureSqlProtectedItemExtendedInfo withOldestRecoveryPoint(OffsetDateTime oldestRecoveryPoint) { - this.oldestRecoveryPoint = oldestRecoveryPoint; - return this; - } - - /** - * Get the recoveryPointCount property: Number of available backup copies associated with this backup item. - * - * @return the recoveryPointCount value. - */ - public Integer recoveryPointCount() { - return this.recoveryPointCount; - } - - /** - * Set the recoveryPointCount property: Number of available backup copies associated with this backup item. - * - * @param recoveryPointCount the recoveryPointCount value to set. - * @return the AzureSqlProtectedItemExtendedInfo object itself. - */ - public AzureSqlProtectedItemExtendedInfo withRecoveryPointCount(Integer recoveryPointCount) { - this.recoveryPointCount = recoveryPointCount; - return this; - } - - /** - * Get the policyState property: State of the backup policy associated with this backup item. - * - * @return the policyState value. - */ - public String policyState() { - return this.policyState; - } - - /** - * Set the policyState property: State of the backup policy associated with this backup item. - * - * @param policyState the policyState value to set. - * @return the AzureSqlProtectedItemExtendedInfo object itself. - */ - public AzureSqlProtectedItemExtendedInfo withPolicyState(String policyState) { - this.policyState = policyState; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("oldestRecoveryPoint", - this.oldestRecoveryPoint == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.oldestRecoveryPoint)); - jsonWriter.writeNumberField("recoveryPointCount", this.recoveryPointCount); - jsonWriter.writeStringField("policyState", this.policyState); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureSqlProtectedItemExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureSqlProtectedItemExtendedInfo 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 AzureSqlProtectedItemExtendedInfo. - */ - public static AzureSqlProtectedItemExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureSqlProtectedItemExtendedInfo deserializedAzureSqlProtectedItemExtendedInfo - = new AzureSqlProtectedItemExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("oldestRecoveryPoint".equals(fieldName)) { - deserializedAzureSqlProtectedItemExtendedInfo.oldestRecoveryPoint = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("recoveryPointCount".equals(fieldName)) { - deserializedAzureSqlProtectedItemExtendedInfo.recoveryPointCount - = reader.getNullable(JsonReader::getInt); - } else if ("policyState".equals(fieldName)) { - deserializedAzureSqlProtectedItemExtendedInfo.policyState = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureSqlProtectedItemExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectionPolicy.java deleted file mode 100644 index 409ba660901f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlProtectionPolicy.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Azure SQL workload-specific backup policy. - */ -@Fluent -public final class AzureSqlProtectionPolicy extends ProtectionPolicy { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String backupManagementType = "AzureSql"; - - /* - * Retention policy details. - */ - private RetentionPolicy retentionPolicy; - - /** - * Creates an instance of AzureSqlProtectionPolicy class. - */ - public AzureSqlProtectionPolicy() { - } - - /** - * Get the backupManagementType property: This property will be used as the discriminator for deciding the specific - * types in the polymorphic chain of types. - * - * @return the backupManagementType value. - */ - @Override - public String backupManagementType() { - return this.backupManagementType; - } - - /** - * Get the retentionPolicy property: Retention policy details. - * - * @return the retentionPolicy value. - */ - public RetentionPolicy retentionPolicy() { - return this.retentionPolicy; - } - - /** - * Set the retentionPolicy property: Retention policy details. - * - * @param retentionPolicy the retentionPolicy value to set. - * @return the AzureSqlProtectionPolicy object itself. - */ - public AzureSqlProtectionPolicy withRetentionPolicy(RetentionPolicy retentionPolicy) { - this.retentionPolicy = retentionPolicy; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlProtectionPolicy withProtectedItemsCount(Integer protectedItemsCount) { - super.withProtectedItemsCount(protectedItemsCount); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlProtectionPolicy withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("protectedItemsCount", protectedItemsCount()); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("backupManagementType", this.backupManagementType); - jsonWriter.writeJsonField("retentionPolicy", this.retentionPolicy); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureSqlProtectionPolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureSqlProtectionPolicy 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 AzureSqlProtectionPolicy. - */ - public static AzureSqlProtectionPolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureSqlProtectionPolicy deserializedAzureSqlProtectionPolicy = new AzureSqlProtectionPolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("protectedItemsCount".equals(fieldName)) { - deserializedAzureSqlProtectionPolicy - .withProtectedItemsCount(reader.getNullable(JsonReader::getInt)); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureSqlProtectionPolicy - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("backupManagementType".equals(fieldName)) { - deserializedAzureSqlProtectionPolicy.backupManagementType = reader.getString(); - } else if ("retentionPolicy".equals(fieldName)) { - deserializedAzureSqlProtectionPolicy.retentionPolicy = RetentionPolicy.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureSqlProtectionPolicy; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlagWorkloadContainerProtectionContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlagWorkloadContainerProtectionContainer.java deleted file mode 100644 index 33de7fd57c6b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureSqlagWorkloadContainerProtectionContainer.java +++ /dev/null @@ -1,218 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Container for SQL workloads under SQL Availability Group. - */ -@Fluent -public final class AzureSqlagWorkloadContainerProtectionContainer extends AzureWorkloadContainer { - /* - * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines - * 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer - */ - private ProtectableContainerType containerType = ProtectableContainerType.SQLAGWORK_LOAD_CONTAINER; - - /** - * Creates an instance of AzureSqlagWorkloadContainerProtectionContainer class. - */ - public AzureSqlagWorkloadContainerProtectionContainer() { - } - - /** - * Get the containerType property: Type of the container. The value of this property for: 1. Compute Azure VM is - * Microsoft.Compute/virtualMachines 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer. - * - * @return the containerType value. - */ - @Override - public ProtectableContainerType containerType() { - return this.containerType; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlagWorkloadContainerProtectionContainer withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlagWorkloadContainerProtectionContainer withLastUpdatedTime(OffsetDateTime lastUpdatedTime) { - super.withLastUpdatedTime(lastUpdatedTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlagWorkloadContainerProtectionContainer - withExtendedInfo(AzureWorkloadContainerExtendedInfo extendedInfo) { - super.withExtendedInfo(extendedInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlagWorkloadContainerProtectionContainer withWorkloadType(WorkloadType workloadType) { - super.withWorkloadType(workloadType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlagWorkloadContainerProtectionContainer withOperationType(OperationType operationType) { - super.withOperationType(operationType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlagWorkloadContainerProtectionContainer withFriendlyName(String friendlyName) { - super.withFriendlyName(friendlyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlagWorkloadContainerProtectionContainer - withBackupManagementType(BackupManagementType backupManagementType) { - super.withBackupManagementType(backupManagementType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlagWorkloadContainerProtectionContainer withRegistrationStatus(String registrationStatus) { - super.withRegistrationStatus(registrationStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlagWorkloadContainerProtectionContainer withHealthStatus(String healthStatus) { - super.withHealthStatus(healthStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureSqlagWorkloadContainerProtectionContainer withProtectableObjectType(String protectableObjectType) { - super.withProtectableObjectType(protectableObjectType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("registrationStatus", registrationStatus()); - jsonWriter.writeStringField("healthStatus", healthStatus()); - jsonWriter.writeStringField("protectableObjectType", protectableObjectType()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("lastUpdatedTime", - lastUpdatedTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastUpdatedTime())); - jsonWriter.writeJsonField("extendedInfo", extendedInfo()); - jsonWriter.writeStringField("workloadType", workloadType() == null ? null : workloadType().toString()); - jsonWriter.writeStringField("operationType", operationType() == null ? null : operationType().toString()); - jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureSqlagWorkloadContainerProtectionContainer from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureSqlagWorkloadContainerProtectionContainer 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 AzureSqlagWorkloadContainerProtectionContainer. - */ - public static AzureSqlagWorkloadContainerProtectionContainer fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureSqlagWorkloadContainerProtectionContainer deserializedAzureSqlagWorkloadContainerProtectionContainer - = new AzureSqlagWorkloadContainerProtectionContainer(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("friendlyName".equals(fieldName)) { - deserializedAzureSqlagWorkloadContainerProtectionContainer.withFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedAzureSqlagWorkloadContainerProtectionContainer - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("registrationStatus".equals(fieldName)) { - deserializedAzureSqlagWorkloadContainerProtectionContainer - .withRegistrationStatus(reader.getString()); - } else if ("healthStatus".equals(fieldName)) { - deserializedAzureSqlagWorkloadContainerProtectionContainer.withHealthStatus(reader.getString()); - } else if ("protectableObjectType".equals(fieldName)) { - deserializedAzureSqlagWorkloadContainerProtectionContainer - .withProtectableObjectType(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureSqlagWorkloadContainerProtectionContainer.withSourceResourceId(reader.getString()); - } else if ("lastUpdatedTime".equals(fieldName)) { - deserializedAzureSqlagWorkloadContainerProtectionContainer.withLastUpdatedTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureSqlagWorkloadContainerProtectionContainer - .withExtendedInfo(AzureWorkloadContainerExtendedInfo.fromJson(reader)); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureSqlagWorkloadContainerProtectionContainer - .withWorkloadType(WorkloadType.fromString(reader.getString())); - } else if ("operationType".equals(fieldName)) { - deserializedAzureSqlagWorkloadContainerProtectionContainer - .withOperationType(OperationType.fromString(reader.getString())); - } else if ("containerType".equals(fieldName)) { - deserializedAzureSqlagWorkloadContainerProtectionContainer.containerType - = ProtectableContainerType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureSqlagWorkloadContainerProtectionContainer; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageContainer.java deleted file mode 100644 index 61ee5f04e42a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageContainer.java +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure Storage Account workload-specific container. - */ -@Fluent -public final class AzureStorageContainer extends ProtectionContainer { - /* - * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines - * 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer - */ - private ProtectableContainerType containerType = ProtectableContainerType.STORAGE_CONTAINER; - - /* - * Fully qualified ARM url. - */ - private String sourceResourceId; - - /* - * Storage account version. - */ - private String storageAccountVersion; - - /* - * Resource group name of Recovery Services Vault. - */ - private String resourceGroup; - - /* - * Number of items backed up in this container. - */ - private Long protectedItemCount; - - /* - * Whether storage account lock is to be acquired for this container or not. - */ - private AcquireStorageAccountLock acquireStorageAccountLock; - - /* - * Re-Do Operation - */ - private OperationType operationType; - - /** - * Creates an instance of AzureStorageContainer class. - */ - public AzureStorageContainer() { - } - - /** - * Get the containerType property: Type of the container. The value of this property for: 1. Compute Azure VM is - * Microsoft.Compute/virtualMachines 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer. - * - * @return the containerType value. - */ - @Override - public ProtectableContainerType containerType() { - return this.containerType; - } - - /** - * Get the sourceResourceId property: Fully qualified ARM url. - * - * @return the sourceResourceId value. - */ - public String sourceResourceId() { - return this.sourceResourceId; - } - - /** - * Set the sourceResourceId property: Fully qualified ARM url. - * - * @param sourceResourceId the sourceResourceId value to set. - * @return the AzureStorageContainer object itself. - */ - public AzureStorageContainer withSourceResourceId(String sourceResourceId) { - this.sourceResourceId = sourceResourceId; - return this; - } - - /** - * Get the storageAccountVersion property: Storage account version. - * - * @return the storageAccountVersion value. - */ - public String storageAccountVersion() { - return this.storageAccountVersion; - } - - /** - * Set the storageAccountVersion property: Storage account version. - * - * @param storageAccountVersion the storageAccountVersion value to set. - * @return the AzureStorageContainer object itself. - */ - public AzureStorageContainer withStorageAccountVersion(String storageAccountVersion) { - this.storageAccountVersion = storageAccountVersion; - return this; - } - - /** - * Get the resourceGroup property: Resource group name of Recovery Services Vault. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.resourceGroup; - } - - /** - * Set the resourceGroup property: Resource group name of Recovery Services Vault. - * - * @param resourceGroup the resourceGroup value to set. - * @return the AzureStorageContainer object itself. - */ - public AzureStorageContainer withResourceGroup(String resourceGroup) { - this.resourceGroup = resourceGroup; - return this; - } - - /** - * Get the protectedItemCount property: Number of items backed up in this container. - * - * @return the protectedItemCount value. - */ - public Long protectedItemCount() { - return this.protectedItemCount; - } - - /** - * Set the protectedItemCount property: Number of items backed up in this container. - * - * @param protectedItemCount the protectedItemCount value to set. - * @return the AzureStorageContainer object itself. - */ - public AzureStorageContainer withProtectedItemCount(Long protectedItemCount) { - this.protectedItemCount = protectedItemCount; - return this; - } - - /** - * Get the acquireStorageAccountLock property: Whether storage account lock is to be acquired for this container or - * not. - * - * @return the acquireStorageAccountLock value. - */ - public AcquireStorageAccountLock acquireStorageAccountLock() { - return this.acquireStorageAccountLock; - } - - /** - * Set the acquireStorageAccountLock property: Whether storage account lock is to be acquired for this container or - * not. - * - * @param acquireStorageAccountLock the acquireStorageAccountLock value to set. - * @return the AzureStorageContainer object itself. - */ - public AzureStorageContainer withAcquireStorageAccountLock(AcquireStorageAccountLock acquireStorageAccountLock) { - this.acquireStorageAccountLock = acquireStorageAccountLock; - return this; - } - - /** - * Get the operationType property: Re-Do Operation. - * - * @return the operationType value. - */ - public OperationType operationType() { - return this.operationType; - } - - /** - * Set the operationType property: Re-Do Operation. - * - * @param operationType the operationType value to set. - * @return the AzureStorageContainer object itself. - */ - public AzureStorageContainer withOperationType(OperationType operationType) { - this.operationType = operationType; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureStorageContainer withFriendlyName(String friendlyName) { - super.withFriendlyName(friendlyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureStorageContainer withBackupManagementType(BackupManagementType backupManagementType) { - super.withBackupManagementType(backupManagementType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureStorageContainer withRegistrationStatus(String registrationStatus) { - super.withRegistrationStatus(registrationStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureStorageContainer withHealthStatus(String healthStatus) { - super.withHealthStatus(healthStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureStorageContainer withProtectableObjectType(String protectableObjectType) { - super.withProtectableObjectType(protectableObjectType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("registrationStatus", registrationStatus()); - jsonWriter.writeStringField("healthStatus", healthStatus()); - jsonWriter.writeStringField("protectableObjectType", protectableObjectType()); - jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString()); - jsonWriter.writeStringField("sourceResourceId", this.sourceResourceId); - jsonWriter.writeStringField("storageAccountVersion", this.storageAccountVersion); - jsonWriter.writeStringField("resourceGroup", this.resourceGroup); - jsonWriter.writeNumberField("protectedItemCount", this.protectedItemCount); - jsonWriter.writeStringField("acquireStorageAccountLock", - this.acquireStorageAccountLock == null ? null : this.acquireStorageAccountLock.toString()); - jsonWriter.writeStringField("operationType", this.operationType == null ? null : this.operationType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureStorageContainer from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureStorageContainer 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 AzureStorageContainer. - */ - public static AzureStorageContainer fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureStorageContainer deserializedAzureStorageContainer = new AzureStorageContainer(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("friendlyName".equals(fieldName)) { - deserializedAzureStorageContainer.withFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedAzureStorageContainer - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("registrationStatus".equals(fieldName)) { - deserializedAzureStorageContainer.withRegistrationStatus(reader.getString()); - } else if ("healthStatus".equals(fieldName)) { - deserializedAzureStorageContainer.withHealthStatus(reader.getString()); - } else if ("protectableObjectType".equals(fieldName)) { - deserializedAzureStorageContainer.withProtectableObjectType(reader.getString()); - } else if ("containerType".equals(fieldName)) { - deserializedAzureStorageContainer.containerType - = ProtectableContainerType.fromString(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureStorageContainer.sourceResourceId = reader.getString(); - } else if ("storageAccountVersion".equals(fieldName)) { - deserializedAzureStorageContainer.storageAccountVersion = reader.getString(); - } else if ("resourceGroup".equals(fieldName)) { - deserializedAzureStorageContainer.resourceGroup = reader.getString(); - } else if ("protectedItemCount".equals(fieldName)) { - deserializedAzureStorageContainer.protectedItemCount = reader.getNullable(JsonReader::getLong); - } else if ("acquireStorageAccountLock".equals(fieldName)) { - deserializedAzureStorageContainer.acquireStorageAccountLock - = AcquireStorageAccountLock.fromString(reader.getString()); - } else if ("operationType".equals(fieldName)) { - deserializedAzureStorageContainer.operationType = OperationType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureStorageContainer; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageErrorInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageErrorInfo.java deleted file mode 100644 index b12975ff29ab..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageErrorInfo.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Azure storage specific error information. - */ -@Immutable -public final class AzureStorageErrorInfo implements JsonSerializable { - /* - * Error code. - */ - private Integer errorCode; - - /* - * Localized error string. - */ - private String errorString; - - /* - * List of localized recommendations for above error code. - */ - private List recommendations; - - /** - * Creates an instance of AzureStorageErrorInfo class. - */ - private AzureStorageErrorInfo() { - } - - /** - * Get the errorCode property: Error code. - * - * @return the errorCode value. - */ - public Integer errorCode() { - return this.errorCode; - } - - /** - * Get the errorString property: Localized error string. - * - * @return the errorString value. - */ - public String errorString() { - return this.errorString; - } - - /** - * Get the recommendations property: List of localized recommendations for above error code. - * - * @return the recommendations value. - */ - public List recommendations() { - return this.recommendations; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("errorCode", this.errorCode); - jsonWriter.writeStringField("errorString", this.errorString); - jsonWriter.writeArrayField("recommendations", this.recommendations, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureStorageErrorInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureStorageErrorInfo 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 AzureStorageErrorInfo. - */ - public static AzureStorageErrorInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureStorageErrorInfo deserializedAzureStorageErrorInfo = new AzureStorageErrorInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("errorCode".equals(fieldName)) { - deserializedAzureStorageErrorInfo.errorCode = reader.getNullable(JsonReader::getInt); - } else if ("errorString".equals(fieldName)) { - deserializedAzureStorageErrorInfo.errorString = reader.getString(); - } else if ("recommendations".equals(fieldName)) { - List recommendations = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureStorageErrorInfo.recommendations = recommendations; - } else { - reader.skipChildren(); - } - } - - return deserializedAzureStorageErrorInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJob.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJob.java deleted file mode 100644 index 4a5fa1e76040..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJob.java +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.Duration; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Azure storage specific job. - */ -@Immutable -public final class AzureStorageJob extends Job { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String jobType = "AzureStorageJob"; - - /* - * Time elapsed during the execution of this job. - */ - private Duration duration; - - /* - * Gets or sets the state/actions applicable on this job like cancel/retry. - */ - private List actionsInfo; - - /* - * Error details on execution of this job. - */ - private List errorDetails; - - /* - * Specifies friendly name of the storage account. - */ - private String storageAccountName; - - /* - * Specifies whether the Storage account is a Classic or an Azure Resource Manager Storage account. - */ - private String storageAccountVersion; - - /* - * Additional information about the job. - */ - private AzureStorageJobExtendedInfo extendedInfo; - - /* - * Indicated that whether the job is adhoc(true) or scheduled(false) - */ - private Boolean isUserTriggered; - - /** - * Creates an instance of AzureStorageJob class. - */ - private AzureStorageJob() { - } - - /** - * Get the jobType property: This property will be used as the discriminator for deciding the specific types in the - * polymorphic chain of types. - * - * @return the jobType value. - */ - @Override - public String jobType() { - return this.jobType; - } - - /** - * Get the duration property: Time elapsed during the execution of this job. - * - * @return the duration value. - */ - public Duration duration() { - return this.duration; - } - - /** - * Get the actionsInfo property: Gets or sets the state/actions applicable on this job like cancel/retry. - * - * @return the actionsInfo value. - */ - public List actionsInfo() { - return this.actionsInfo; - } - - /** - * Get the errorDetails property: Error details on execution of this job. - * - * @return the errorDetails value. - */ - public List errorDetails() { - return this.errorDetails; - } - - /** - * Get the storageAccountName property: Specifies friendly name of the storage account. - * - * @return the storageAccountName value. - */ - public String storageAccountName() { - return this.storageAccountName; - } - - /** - * Get the storageAccountVersion property: Specifies whether the Storage account is a Classic or an Azure Resource - * Manager Storage account. - * - * @return the storageAccountVersion value. - */ - public String storageAccountVersion() { - return this.storageAccountVersion; - } - - /** - * Get the extendedInfo property: Additional information about the job. - * - * @return the extendedInfo value. - */ - public AzureStorageJobExtendedInfo extendedInfo() { - return this.extendedInfo; - } - - /** - * Get the isUserTriggered property: Indicated that whether the job is adhoc(true) or scheduled(false). - * - * @return the isUserTriggered value. - */ - public Boolean isUserTriggered() { - return this.isUserTriggered; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("entityFriendlyName", entityFriendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("operation", operation()); - jsonWriter.writeStringField("status", status()); - jsonWriter.writeStringField("startTime", - startTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(startTime())); - jsonWriter.writeStringField("endTime", - endTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(endTime())); - jsonWriter.writeStringField("activityId", activityId()); - jsonWriter.writeStringField("jobType", this.jobType); - jsonWriter.writeStringField("duration", CoreUtils.durationToStringWithDays(this.duration)); - jsonWriter.writeArrayField("actionsInfo", this.actionsInfo, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("errorDetails", this.errorDetails, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("storageAccountName", this.storageAccountName); - jsonWriter.writeStringField("storageAccountVersion", this.storageAccountVersion); - jsonWriter.writeJsonField("extendedInfo", this.extendedInfo); - jsonWriter.writeBooleanField("isUserTriggered", this.isUserTriggered); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureStorageJob from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureStorageJob 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 AzureStorageJob. - */ - public static AzureStorageJob fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureStorageJob deserializedAzureStorageJob = new AzureStorageJob(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("entityFriendlyName".equals(fieldName)) { - deserializedAzureStorageJob.withEntityFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedAzureStorageJob - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("operation".equals(fieldName)) { - deserializedAzureStorageJob.withOperation(reader.getString()); - } else if ("status".equals(fieldName)) { - deserializedAzureStorageJob.withStatus(reader.getString()); - } else if ("startTime".equals(fieldName)) { - deserializedAzureStorageJob.withStartTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("endTime".equals(fieldName)) { - deserializedAzureStorageJob.withEndTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("activityId".equals(fieldName)) { - deserializedAzureStorageJob.withActivityId(reader.getString()); - } else if ("jobType".equals(fieldName)) { - deserializedAzureStorageJob.jobType = reader.getString(); - } else if ("duration".equals(fieldName)) { - deserializedAzureStorageJob.duration - = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); - } else if ("actionsInfo".equals(fieldName)) { - List actionsInfo - = reader.readArray(reader1 -> JobSupportedAction.fromString(reader1.getString())); - deserializedAzureStorageJob.actionsInfo = actionsInfo; - } else if ("errorDetails".equals(fieldName)) { - List errorDetails - = reader.readArray(reader1 -> AzureStorageErrorInfo.fromJson(reader1)); - deserializedAzureStorageJob.errorDetails = errorDetails; - } else if ("storageAccountName".equals(fieldName)) { - deserializedAzureStorageJob.storageAccountName = reader.getString(); - } else if ("storageAccountVersion".equals(fieldName)) { - deserializedAzureStorageJob.storageAccountVersion = reader.getString(); - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureStorageJob.extendedInfo = AzureStorageJobExtendedInfo.fromJson(reader); - } else if ("isUserTriggered".equals(fieldName)) { - deserializedAzureStorageJob.isUserTriggered = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureStorageJob; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobExtendedInfo.java deleted file mode 100644 index 10a63226b851..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobExtendedInfo.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; -import java.util.Map; - -/** - * Azure Storage workload-specific additional information for job. - */ -@Immutable -public final class AzureStorageJobExtendedInfo implements JsonSerializable { - /* - * List of tasks for this job - */ - private List tasksList; - - /* - * Job properties. - */ - private Map propertyBag; - - /* - * Non localized error message on job execution. - */ - private String dynamicErrorMessage; - - /** - * Creates an instance of AzureStorageJobExtendedInfo class. - */ - private AzureStorageJobExtendedInfo() { - } - - /** - * Get the tasksList property: List of tasks for this job. - * - * @return the tasksList value. - */ - public List tasksList() { - return this.tasksList; - } - - /** - * Get the propertyBag property: Job properties. - * - * @return the propertyBag value. - */ - public Map propertyBag() { - return this.propertyBag; - } - - /** - * Get the dynamicErrorMessage property: Non localized error message on job execution. - * - * @return the dynamicErrorMessage value. - */ - public String dynamicErrorMessage() { - return this.dynamicErrorMessage; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("tasksList", this.tasksList, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeMapField("propertyBag", this.propertyBag, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("dynamicErrorMessage", this.dynamicErrorMessage); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureStorageJobExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureStorageJobExtendedInfo 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 AzureStorageJobExtendedInfo. - */ - public static AzureStorageJobExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureStorageJobExtendedInfo deserializedAzureStorageJobExtendedInfo = new AzureStorageJobExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("tasksList".equals(fieldName)) { - List tasksList - = reader.readArray(reader1 -> AzureStorageJobTaskDetails.fromJson(reader1)); - deserializedAzureStorageJobExtendedInfo.tasksList = tasksList; - } else if ("propertyBag".equals(fieldName)) { - Map propertyBag = reader.readMap(reader1 -> reader1.getString()); - deserializedAzureStorageJobExtendedInfo.propertyBag = propertyBag; - } else if ("dynamicErrorMessage".equals(fieldName)) { - deserializedAzureStorageJobExtendedInfo.dynamicErrorMessage = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureStorageJobExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobTaskDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobTaskDetails.java deleted file mode 100644 index 989f8e3e27e7..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageJobTaskDetails.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Azure storage workload specific job task details. - */ -@Immutable -public final class AzureStorageJobTaskDetails implements JsonSerializable { - /* - * The task display name. - */ - private String taskId; - - /* - * The status. - */ - private String status; - - /** - * Creates an instance of AzureStorageJobTaskDetails class. - */ - private AzureStorageJobTaskDetails() { - } - - /** - * Get the taskId property: The task display name. - * - * @return the taskId value. - */ - public String taskId() { - return this.taskId; - } - - /** - * Get the status property: The status. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskId", this.taskId); - jsonWriter.writeStringField("status", this.status); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureStorageJobTaskDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureStorageJobTaskDetails 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 AzureStorageJobTaskDetails. - */ - public static AzureStorageJobTaskDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureStorageJobTaskDetails deserializedAzureStorageJobTaskDetails = new AzureStorageJobTaskDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("taskId".equals(fieldName)) { - deserializedAzureStorageJobTaskDetails.taskId = reader.getString(); - } else if ("status".equals(fieldName)) { - deserializedAzureStorageJobTaskDetails.status = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureStorageJobTaskDetails; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageProtectableContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageProtectableContainer.java deleted file mode 100644 index f13e90f03a60..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageProtectableContainer.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure Storage-specific protectable containers. - */ -@Immutable -public final class AzureStorageProtectableContainer extends ProtectableContainer { - /* - * Type of the container. The value of this property for - * 1. Compute Azure VM is Microsoft.Compute/virtualMachines - * 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines - */ - private ProtectableContainerType protectableContainerType = ProtectableContainerType.STORAGE_CONTAINER; - - /** - * Creates an instance of AzureStorageProtectableContainer class. - */ - private AzureStorageProtectableContainer() { - } - - /** - * Get the protectableContainerType property: Type of the container. The value of this property for - * 1. Compute Azure VM is Microsoft.Compute/virtualMachines - * 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines. - * - * @return the protectableContainerType value. - */ - @Override - public ProtectableContainerType protectableContainerType() { - return this.protectableContainerType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("healthStatus", healthStatus()); - jsonWriter.writeStringField("containerId", containerId()); - jsonWriter.writeStringField("protectableContainerType", - this.protectableContainerType == null ? null : this.protectableContainerType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureStorageProtectableContainer from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureStorageProtectableContainer 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 AzureStorageProtectableContainer. - */ - public static AzureStorageProtectableContainer fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureStorageProtectableContainer deserializedAzureStorageProtectableContainer - = new AzureStorageProtectableContainer(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("friendlyName".equals(fieldName)) { - deserializedAzureStorageProtectableContainer.withFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedAzureStorageProtectableContainer - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("healthStatus".equals(fieldName)) { - deserializedAzureStorageProtectableContainer.withHealthStatus(reader.getString()); - } else if ("containerId".equals(fieldName)) { - deserializedAzureStorageProtectableContainer.withContainerId(reader.getString()); - } else if ("protectableContainerType".equals(fieldName)) { - deserializedAzureStorageProtectableContainer.protectableContainerType - = ProtectableContainerType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureStorageProtectableContainer; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectableContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectableContainer.java deleted file mode 100644 index 293637975bd8..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectableContainer.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure workload-specific container. - */ -@Immutable -public final class AzureVMAppContainerProtectableContainer extends ProtectableContainer { - /* - * Type of the container. The value of this property for - * 1. Compute Azure VM is Microsoft.Compute/virtualMachines - * 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines - */ - private ProtectableContainerType protectableContainerType = ProtectableContainerType.VMAPP_CONTAINER; - - /** - * Creates an instance of AzureVMAppContainerProtectableContainer class. - */ - private AzureVMAppContainerProtectableContainer() { - } - - /** - * Get the protectableContainerType property: Type of the container. The value of this property for - * 1. Compute Azure VM is Microsoft.Compute/virtualMachines - * 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines. - * - * @return the protectableContainerType value. - */ - @Override - public ProtectableContainerType protectableContainerType() { - return this.protectableContainerType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("healthStatus", healthStatus()); - jsonWriter.writeStringField("containerId", containerId()); - jsonWriter.writeStringField("protectableContainerType", - this.protectableContainerType == null ? null : this.protectableContainerType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVMAppContainerProtectableContainer from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVMAppContainerProtectableContainer 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 AzureVMAppContainerProtectableContainer. - */ - public static AzureVMAppContainerProtectableContainer fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVMAppContainerProtectableContainer deserializedAzureVMAppContainerProtectableContainer - = new AzureVMAppContainerProtectableContainer(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("friendlyName".equals(fieldName)) { - deserializedAzureVMAppContainerProtectableContainer.withFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedAzureVMAppContainerProtectableContainer - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("healthStatus".equals(fieldName)) { - deserializedAzureVMAppContainerProtectableContainer.withHealthStatus(reader.getString()); - } else if ("containerId".equals(fieldName)) { - deserializedAzureVMAppContainerProtectableContainer.withContainerId(reader.getString()); - } else if ("protectableContainerType".equals(fieldName)) { - deserializedAzureVMAppContainerProtectableContainer.protectableContainerType - = ProtectableContainerType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVMAppContainerProtectableContainer; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectionContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectionContainer.java deleted file mode 100644 index 7dca06b8e0fd..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMAppContainerProtectionContainer.java +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Container for SQL workloads under Azure Virtual Machines. - */ -@Fluent -public final class AzureVMAppContainerProtectionContainer extends AzureWorkloadContainer { - /* - * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines - * 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer - */ - private ProtectableContainerType containerType = ProtectableContainerType.VMAPP_CONTAINER; - - /** - * Creates an instance of AzureVMAppContainerProtectionContainer class. - */ - public AzureVMAppContainerProtectionContainer() { - } - - /** - * Get the containerType property: Type of the container. The value of this property for: 1. Compute Azure VM is - * Microsoft.Compute/virtualMachines 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer. - * - * @return the containerType value. - */ - @Override - public ProtectableContainerType containerType() { - return this.containerType; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVMAppContainerProtectionContainer withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVMAppContainerProtectionContainer withLastUpdatedTime(OffsetDateTime lastUpdatedTime) { - super.withLastUpdatedTime(lastUpdatedTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVMAppContainerProtectionContainer withExtendedInfo(AzureWorkloadContainerExtendedInfo extendedInfo) { - super.withExtendedInfo(extendedInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVMAppContainerProtectionContainer withWorkloadType(WorkloadType workloadType) { - super.withWorkloadType(workloadType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVMAppContainerProtectionContainer withOperationType(OperationType operationType) { - super.withOperationType(operationType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVMAppContainerProtectionContainer withFriendlyName(String friendlyName) { - super.withFriendlyName(friendlyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVMAppContainerProtectionContainer withBackupManagementType(BackupManagementType backupManagementType) { - super.withBackupManagementType(backupManagementType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVMAppContainerProtectionContainer withRegistrationStatus(String registrationStatus) { - super.withRegistrationStatus(registrationStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVMAppContainerProtectionContainer withHealthStatus(String healthStatus) { - super.withHealthStatus(healthStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVMAppContainerProtectionContainer withProtectableObjectType(String protectableObjectType) { - super.withProtectableObjectType(protectableObjectType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("registrationStatus", registrationStatus()); - jsonWriter.writeStringField("healthStatus", healthStatus()); - jsonWriter.writeStringField("protectableObjectType", protectableObjectType()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("lastUpdatedTime", - lastUpdatedTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastUpdatedTime())); - jsonWriter.writeJsonField("extendedInfo", extendedInfo()); - jsonWriter.writeStringField("workloadType", workloadType() == null ? null : workloadType().toString()); - jsonWriter.writeStringField("operationType", operationType() == null ? null : operationType().toString()); - jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVMAppContainerProtectionContainer from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVMAppContainerProtectionContainer 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 AzureVMAppContainerProtectionContainer. - */ - public static AzureVMAppContainerProtectionContainer fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVMAppContainerProtectionContainer deserializedAzureVMAppContainerProtectionContainer - = new AzureVMAppContainerProtectionContainer(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("friendlyName".equals(fieldName)) { - deserializedAzureVMAppContainerProtectionContainer.withFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedAzureVMAppContainerProtectionContainer - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("registrationStatus".equals(fieldName)) { - deserializedAzureVMAppContainerProtectionContainer.withRegistrationStatus(reader.getString()); - } else if ("healthStatus".equals(fieldName)) { - deserializedAzureVMAppContainerProtectionContainer.withHealthStatus(reader.getString()); - } else if ("protectableObjectType".equals(fieldName)) { - deserializedAzureVMAppContainerProtectionContainer.withProtectableObjectType(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureVMAppContainerProtectionContainer.withSourceResourceId(reader.getString()); - } else if ("lastUpdatedTime".equals(fieldName)) { - deserializedAzureVMAppContainerProtectionContainer.withLastUpdatedTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureVMAppContainerProtectionContainer - .withExtendedInfo(AzureWorkloadContainerExtendedInfo.fromJson(reader)); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVMAppContainerProtectionContainer - .withWorkloadType(WorkloadType.fromString(reader.getString())); - } else if ("operationType".equals(fieldName)) { - deserializedAzureVMAppContainerProtectionContainer - .withOperationType(OperationType.fromString(reader.getString())); - } else if ("containerType".equals(fieldName)) { - deserializedAzureVMAppContainerProtectionContainer.containerType - = ProtectableContainerType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVMAppContainerProtectionContainer; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMResourceFeatureSupportRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMResourceFeatureSupportRequest.java deleted file mode 100644 index 05eb3679a8a4..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMResourceFeatureSupportRequest.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * AzureResource(IaaS VM) Specific feature support request. - */ -@Fluent -public final class AzureVMResourceFeatureSupportRequest extends FeatureSupportRequest { - /* - * backup support feature type. - */ - private String featureType = "AzureVMResourceBackup"; - - /* - * Size of the resource: VM size(A/D series etc) in case of IaasVM - */ - private String vmSize; - - /* - * SKUs (Premium/Managed etc) in case of IaasVM - */ - private String vmSku; - - /** - * Creates an instance of AzureVMResourceFeatureSupportRequest class. - */ - public AzureVMResourceFeatureSupportRequest() { - } - - /** - * Get the featureType property: backup support feature type. - * - * @return the featureType value. - */ - @Override - public String featureType() { - return this.featureType; - } - - /** - * Get the vmSize property: Size of the resource: VM size(A/D series etc) in case of IaasVM. - * - * @return the vmSize value. - */ - public String vmSize() { - return this.vmSize; - } - - /** - * Set the vmSize property: Size of the resource: VM size(A/D series etc) in case of IaasVM. - * - * @param vmSize the vmSize value to set. - * @return the AzureVMResourceFeatureSupportRequest object itself. - */ - public AzureVMResourceFeatureSupportRequest withVmSize(String vmSize) { - this.vmSize = vmSize; - return this; - } - - /** - * Get the vmSku property: SKUs (Premium/Managed etc) in case of IaasVM. - * - * @return the vmSku value. - */ - public String vmSku() { - return this.vmSku; - } - - /** - * Set the vmSku property: SKUs (Premium/Managed etc) in case of IaasVM. - * - * @param vmSku the vmSku value to set. - * @return the AzureVMResourceFeatureSupportRequest object itself. - */ - public AzureVMResourceFeatureSupportRequest withVmSku(String vmSku) { - this.vmSku = vmSku; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("featureType", this.featureType); - jsonWriter.writeStringField("vmSize", this.vmSize); - jsonWriter.writeStringField("vmSku", this.vmSku); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVMResourceFeatureSupportRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVMResourceFeatureSupportRequest 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 AzureVMResourceFeatureSupportRequest. - */ - public static AzureVMResourceFeatureSupportRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVMResourceFeatureSupportRequest deserializedAzureVMResourceFeatureSupportRequest - = new AzureVMResourceFeatureSupportRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("featureType".equals(fieldName)) { - deserializedAzureVMResourceFeatureSupportRequest.featureType = reader.getString(); - } else if ("vmSize".equals(fieldName)) { - deserializedAzureVMResourceFeatureSupportRequest.vmSize = reader.getString(); - } else if ("vmSku".equals(fieldName)) { - deserializedAzureVMResourceFeatureSupportRequest.vmSku = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVMResourceFeatureSupportRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMResourceFeatureSupportResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMResourceFeatureSupportResponse.java deleted file mode 100644 index 590caef6eb03..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVMResourceFeatureSupportResponse.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AzureVMResourceFeatureSupportResponseInner; - -/** - * An immutable client-side representation of AzureVMResourceFeatureSupportResponse. - */ -public interface AzureVMResourceFeatureSupportResponse { - /** - * Gets the supportStatus property: Support status of feature. - * - * @return the supportStatus value. - */ - SupportStatus supportStatus(); - - /** - * Gets the inner - * com.azure.resourcemanager.recoveryservicesbackup.fluent.models.AzureVMResourceFeatureSupportResponseInner object. - * - * @return the inner object. - */ - AzureVMResourceFeatureSupportResponseInner innerModel(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadItem.java deleted file mode 100644 index 6c52103b4f53..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadItem.java +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure VM workload-specific workload item. - */ -@Immutable -public class AzureVmWorkloadItem extends WorkloadItem { - /* - * Type of the backup item. - */ - private String workloadItemType = "AzureVmWorkloadItem"; - - /* - * Name for instance or AG - */ - private String parentName; - - /* - * Host/Cluster Name for instance or AG - */ - private String serverName; - - /* - * Indicates if workload item is auto-protectable - */ - private Boolean isAutoProtectable; - - /* - * For instance or AG, indicates number of DB's present - */ - private Integer subinquireditemcount; - - /* - * For instance or AG, indicates number of DB's to be protected - */ - private Integer subWorkloadItemCount; - - /** - * Creates an instance of AzureVmWorkloadItem class. - */ - protected AzureVmWorkloadItem() { - } - - /** - * Get the workloadItemType property: Type of the backup item. - * - * @return the workloadItemType value. - */ - @Override - public String workloadItemType() { - return this.workloadItemType; - } - - /** - * Get the parentName property: Name for instance or AG. - * - * @return the parentName value. - */ - public String parentName() { - return this.parentName; - } - - /** - * Set the parentName property: Name for instance or AG. - * - * @param parentName the parentName value to set. - * @return the AzureVmWorkloadItem object itself. - */ - AzureVmWorkloadItem withParentName(String parentName) { - this.parentName = parentName; - return this; - } - - /** - * Get the serverName property: Host/Cluster Name for instance or AG. - * - * @return the serverName value. - */ - public String serverName() { - return this.serverName; - } - - /** - * Set the serverName property: Host/Cluster Name for instance or AG. - * - * @param serverName the serverName value to set. - * @return the AzureVmWorkloadItem object itself. - */ - AzureVmWorkloadItem withServerName(String serverName) { - this.serverName = serverName; - return this; - } - - /** - * Get the isAutoProtectable property: Indicates if workload item is auto-protectable. - * - * @return the isAutoProtectable value. - */ - public Boolean isAutoProtectable() { - return this.isAutoProtectable; - } - - /** - * Set the isAutoProtectable property: Indicates if workload item is auto-protectable. - * - * @param isAutoProtectable the isAutoProtectable value to set. - * @return the AzureVmWorkloadItem object itself. - */ - AzureVmWorkloadItem withIsAutoProtectable(Boolean isAutoProtectable) { - this.isAutoProtectable = isAutoProtectable; - return this; - } - - /** - * Get the subinquireditemcount property: For instance or AG, indicates number of DB's present. - * - * @return the subinquireditemcount value. - */ - public Integer subinquireditemcount() { - return this.subinquireditemcount; - } - - /** - * Set the subinquireditemcount property: For instance or AG, indicates number of DB's present. - * - * @param subinquireditemcount the subinquireditemcount value to set. - * @return the AzureVmWorkloadItem object itself. - */ - AzureVmWorkloadItem withSubinquireditemcount(Integer subinquireditemcount) { - this.subinquireditemcount = subinquireditemcount; - return this; - } - - /** - * Get the subWorkloadItemCount property: For instance or AG, indicates number of DB's to be protected. - * - * @return the subWorkloadItemCount value. - */ - public Integer subWorkloadItemCount() { - return this.subWorkloadItemCount; - } - - /** - * Set the subWorkloadItemCount property: For instance or AG, indicates number of DB's to be protected. - * - * @param subWorkloadItemCount the subWorkloadItemCount value to set. - * @return the AzureVmWorkloadItem object itself. - */ - AzureVmWorkloadItem withSubWorkloadItemCount(Integer subWorkloadItemCount) { - this.subWorkloadItemCount = subWorkloadItemCount; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("workloadItemType", this.workloadItemType); - jsonWriter.writeStringField("parentName", this.parentName); - jsonWriter.writeStringField("serverName", this.serverName); - jsonWriter.writeBooleanField("isAutoProtectable", this.isAutoProtectable); - jsonWriter.writeNumberField("subinquireditemcount", this.subinquireditemcount); - jsonWriter.writeNumberField("subWorkloadItemCount", this.subWorkloadItemCount); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadItem 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 AzureVmWorkloadItem. - */ - public static AzureVmWorkloadItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("workloadItemType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("SAPAseDatabase".equals(discriminatorValue)) { - return AzureVmWorkloadSapAseDatabaseWorkloadItem.fromJson(readerToUse.reset()); - } else if ("SAPAseSystem".equals(discriminatorValue)) { - return AzureVmWorkloadSapAseSystemWorkloadItem.fromJson(readerToUse.reset()); - } else if ("SAPHanaDatabase".equals(discriminatorValue)) { - return AzureVmWorkloadSapHanaDatabaseWorkloadItem.fromJson(readerToUse.reset()); - } else if ("SAPHanaSystem".equals(discriminatorValue)) { - return AzureVmWorkloadSapHanaSystemWorkloadItem.fromJson(readerToUse.reset()); - } else if ("SQLDataBase".equals(discriminatorValue)) { - return AzureVmWorkloadSqlDatabaseWorkloadItem.fromJson(readerToUse.reset()); - } else if ("SQLInstance".equals(discriminatorValue)) { - return AzureVmWorkloadSqlInstanceWorkloadItem.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AzureVmWorkloadItem fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadItem deserializedAzureVmWorkloadItem = new AzureVmWorkloadItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadItem.withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadItem.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadItem.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadItem - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("workloadItemType".equals(fieldName)) { - deserializedAzureVmWorkloadItem.workloadItemType = reader.getString(); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadItem.parentName = reader.getString(); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadItem.serverName = reader.getString(); - } else if ("isAutoProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadItem.isAutoProtectable = reader.getNullable(JsonReader::getBoolean); - } else if ("subinquireditemcount".equals(fieldName)) { - deserializedAzureVmWorkloadItem.subinquireditemcount = reader.getNullable(JsonReader::getInt); - } else if ("subWorkloadItemCount".equals(fieldName)) { - deserializedAzureVmWorkloadItem.subWorkloadItemCount = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectableItem.java deleted file mode 100644 index 3d3a17b664a1..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectableItem.java +++ /dev/null @@ -1,394 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure VM workload-specific protectable item. - */ -@Immutable -public class AzureVmWorkloadProtectableItem extends WorkloadProtectableItem { - /* - * Type of the backup item. - */ - private String protectableItemType = "AzureVmWorkloadProtectableItem"; - - /* - * Name for instance or AG - */ - private String parentName; - - /* - * Parent Unique Name is added to provide the service formatted URI Name of the Parent - * Only Applicable for data bases where the parent would be either Instance or a SQL AG. - */ - private String parentUniqueName; - - /* - * Host/Cluster Name for instance or AG - */ - private String serverName; - - /* - * Indicates if protectable item is auto-protectable - */ - private Boolean isAutoProtectable; - - /* - * Indicates if protectable item is auto-protected - */ - private Boolean isAutoProtected; - - /* - * For instance or AG, indicates number of DB's present - */ - private Integer subinquireditemcount; - - /* - * For instance or AG, indicates number of DB's to be protected - */ - private Integer subprotectableitemcount; - - /* - * Pre-backup validation for protectable objects - */ - private PreBackupValidation prebackupvalidation; - - /* - * Indicates if item is protectable - */ - private Boolean isProtectable; - - /** - * Creates an instance of AzureVmWorkloadProtectableItem class. - */ - protected AzureVmWorkloadProtectableItem() { - } - - /** - * Get the protectableItemType property: Type of the backup item. - * - * @return the protectableItemType value. - */ - @Override - public String protectableItemType() { - return this.protectableItemType; - } - - /** - * Get the parentName property: Name for instance or AG. - * - * @return the parentName value. - */ - public String parentName() { - return this.parentName; - } - - /** - * Set the parentName property: Name for instance or AG. - * - * @param parentName the parentName value to set. - * @return the AzureVmWorkloadProtectableItem object itself. - */ - AzureVmWorkloadProtectableItem withParentName(String parentName) { - this.parentName = parentName; - return this; - } - - /** - * Get the parentUniqueName property: Parent Unique Name is added to provide the service formatted URI Name of the - * Parent - * Only Applicable for data bases where the parent would be either Instance or a SQL AG. - * - * @return the parentUniqueName value. - */ - public String parentUniqueName() { - return this.parentUniqueName; - } - - /** - * Set the parentUniqueName property: Parent Unique Name is added to provide the service formatted URI Name of the - * Parent - * Only Applicable for data bases where the parent would be either Instance or a SQL AG. - * - * @param parentUniqueName the parentUniqueName value to set. - * @return the AzureVmWorkloadProtectableItem object itself. - */ - AzureVmWorkloadProtectableItem withParentUniqueName(String parentUniqueName) { - this.parentUniqueName = parentUniqueName; - return this; - } - - /** - * Get the serverName property: Host/Cluster Name for instance or AG. - * - * @return the serverName value. - */ - public String serverName() { - return this.serverName; - } - - /** - * Set the serverName property: Host/Cluster Name for instance or AG. - * - * @param serverName the serverName value to set. - * @return the AzureVmWorkloadProtectableItem object itself. - */ - AzureVmWorkloadProtectableItem withServerName(String serverName) { - this.serverName = serverName; - return this; - } - - /** - * Get the isAutoProtectable property: Indicates if protectable item is auto-protectable. - * - * @return the isAutoProtectable value. - */ - public Boolean isAutoProtectable() { - return this.isAutoProtectable; - } - - /** - * Set the isAutoProtectable property: Indicates if protectable item is auto-protectable. - * - * @param isAutoProtectable the isAutoProtectable value to set. - * @return the AzureVmWorkloadProtectableItem object itself. - */ - AzureVmWorkloadProtectableItem withIsAutoProtectable(Boolean isAutoProtectable) { - this.isAutoProtectable = isAutoProtectable; - return this; - } - - /** - * Get the isAutoProtected property: Indicates if protectable item is auto-protected. - * - * @return the isAutoProtected value. - */ - public Boolean isAutoProtected() { - return this.isAutoProtected; - } - - /** - * Set the isAutoProtected property: Indicates if protectable item is auto-protected. - * - * @param isAutoProtected the isAutoProtected value to set. - * @return the AzureVmWorkloadProtectableItem object itself. - */ - AzureVmWorkloadProtectableItem withIsAutoProtected(Boolean isAutoProtected) { - this.isAutoProtected = isAutoProtected; - return this; - } - - /** - * Get the subinquireditemcount property: For instance or AG, indicates number of DB's present. - * - * @return the subinquireditemcount value. - */ - public Integer subinquireditemcount() { - return this.subinquireditemcount; - } - - /** - * Set the subinquireditemcount property: For instance or AG, indicates number of DB's present. - * - * @param subinquireditemcount the subinquireditemcount value to set. - * @return the AzureVmWorkloadProtectableItem object itself. - */ - AzureVmWorkloadProtectableItem withSubinquireditemcount(Integer subinquireditemcount) { - this.subinquireditemcount = subinquireditemcount; - return this; - } - - /** - * Get the subprotectableitemcount property: For instance or AG, indicates number of DB's to be protected. - * - * @return the subprotectableitemcount value. - */ - public Integer subprotectableitemcount() { - return this.subprotectableitemcount; - } - - /** - * Set the subprotectableitemcount property: For instance or AG, indicates number of DB's to be protected. - * - * @param subprotectableitemcount the subprotectableitemcount value to set. - * @return the AzureVmWorkloadProtectableItem object itself. - */ - AzureVmWorkloadProtectableItem withSubprotectableitemcount(Integer subprotectableitemcount) { - this.subprotectableitemcount = subprotectableitemcount; - return this; - } - - /** - * Get the prebackupvalidation property: Pre-backup validation for protectable objects. - * - * @return the prebackupvalidation value. - */ - public PreBackupValidation prebackupvalidation() { - return this.prebackupvalidation; - } - - /** - * Set the prebackupvalidation property: Pre-backup validation for protectable objects. - * - * @param prebackupvalidation the prebackupvalidation value to set. - * @return the AzureVmWorkloadProtectableItem object itself. - */ - AzureVmWorkloadProtectableItem withPrebackupvalidation(PreBackupValidation prebackupvalidation) { - this.prebackupvalidation = prebackupvalidation; - return this; - } - - /** - * Get the isProtectable property: Indicates if item is protectable. - * - * @return the isProtectable value. - */ - public Boolean isProtectable() { - return this.isProtectable; - } - - /** - * Set the isProtectable property: Indicates if item is protectable. - * - * @param isProtectable the isProtectable value to set. - * @return the AzureVmWorkloadProtectableItem object itself. - */ - AzureVmWorkloadProtectableItem withIsProtectable(Boolean isProtectable) { - this.isProtectable = isProtectable; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("protectableItemType", this.protectableItemType); - jsonWriter.writeStringField("parentName", this.parentName); - jsonWriter.writeStringField("parentUniqueName", this.parentUniqueName); - jsonWriter.writeStringField("serverName", this.serverName); - jsonWriter.writeBooleanField("isAutoProtectable", this.isAutoProtectable); - jsonWriter.writeBooleanField("isAutoProtected", this.isAutoProtected); - jsonWriter.writeNumberField("subinquireditemcount", this.subinquireditemcount); - jsonWriter.writeNumberField("subprotectableitemcount", this.subprotectableitemcount); - jsonWriter.writeJsonField("prebackupvalidation", this.prebackupvalidation); - jsonWriter.writeBooleanField("isProtectable", this.isProtectable); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadProtectableItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadProtectableItem 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 AzureVmWorkloadProtectableItem. - */ - public static AzureVmWorkloadProtectableItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("protectableItemType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("SAPAseDatabase".equals(discriminatorValue)) { - return AzureVmWorkloadSapAseDatabaseProtectableItem.fromJson(readerToUse.reset()); - } else if ("SAPAseSystem".equals(discriminatorValue)) { - return AzureVmWorkloadSapAseSystemProtectableItem.fromJson(readerToUse.reset()); - } else if ("SAPHanaDatabase".equals(discriminatorValue)) { - return AzureVmWorkloadSapHanaDatabaseProtectableItem.fromJson(readerToUse.reset()); - } else if ("SAPHanaSystem".equals(discriminatorValue)) { - return AzureVmWorkloadSapHanaSystemProtectableItem.fromJson(readerToUse.reset()); - } else if ("SAPHanaDBInstance".equals(discriminatorValue)) { - return AzureVmWorkloadSapHanaDBInstance.fromJson(readerToUse.reset()); - } else if ("HanaHSRContainer".equals(discriminatorValue)) { - return AzureVmWorkloadSapHanaHsr.fromJson(readerToUse.reset()); - } else if ("HanaScaleoutContainer".equals(discriminatorValue)) { - return AzureVmWorkloadSAPHanaScaleoutProtectableItem.fromJson(readerToUse.reset()); - } else if ("SQLAvailabilityGroupContainer".equals(discriminatorValue)) { - return AzureVmWorkloadSqlAvailabilityGroupProtectableItem.fromJson(readerToUse.reset()); - } else if ("SQLDataBase".equals(discriminatorValue)) { - return AzureVmWorkloadSqlDatabaseProtectableItem.fromJson(readerToUse.reset()); - } else if ("SQLInstance".equals(discriminatorValue)) { - return AzureVmWorkloadSqlInstanceProtectableItem.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AzureVmWorkloadProtectableItem fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadProtectableItem deserializedAzureVmWorkloadProtectableItem - = new AzureVmWorkloadProtectableItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadProtectableItem.withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadProtectableItem.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadProtectableItem.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadProtectableItem - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("protectableItemType".equals(fieldName)) { - deserializedAzureVmWorkloadProtectableItem.protectableItemType = reader.getString(); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadProtectableItem.parentName = reader.getString(); - } else if ("parentUniqueName".equals(fieldName)) { - deserializedAzureVmWorkloadProtectableItem.parentUniqueName = reader.getString(); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadProtectableItem.serverName = reader.getString(); - } else if ("isAutoProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadProtectableItem.isAutoProtectable - = reader.getNullable(JsonReader::getBoolean); - } else if ("isAutoProtected".equals(fieldName)) { - deserializedAzureVmWorkloadProtectableItem.isAutoProtected - = reader.getNullable(JsonReader::getBoolean); - } else if ("subinquireditemcount".equals(fieldName)) { - deserializedAzureVmWorkloadProtectableItem.subinquireditemcount - = reader.getNullable(JsonReader::getInt); - } else if ("subprotectableitemcount".equals(fieldName)) { - deserializedAzureVmWorkloadProtectableItem.subprotectableitemcount - = reader.getNullable(JsonReader::getInt); - } else if ("prebackupvalidation".equals(fieldName)) { - deserializedAzureVmWorkloadProtectableItem.prebackupvalidation - = PreBackupValidation.fromJson(reader); - } else if ("isProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadProtectableItem.isProtectable - = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadProtectableItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItem.java deleted file mode 100644 index 91a5fe2cc70d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItem.java +++ /dev/null @@ -1,734 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * Azure VM workload-specific protected item. - */ -@Fluent -public class AzureVmWorkloadProtectedItem extends ProtectedItem { - /* - * backup item type. - */ - private String protectedItemType = "AzureVmWorkloadProtectedItem"; - - /* - * Friendly name of the DB represented by this backup item. - */ - private String friendlyName; - - /* - * Host/Cluster Name for instance or AG - */ - private String serverName; - - /* - * Parent name of the DB such as Instance or Availability Group. - */ - private String parentName; - - /* - * Parent type of protected item, example: for a DB, standalone server or distributed - */ - private String parentType; - - /* - * Backup status of this backup item. - */ - private String protectionStatus; - - /* - * Backup state of this backup item. - */ - private ProtectionState protectionState; - - /* - * Last backup operation status. Possible values: Healthy, Unhealthy. - */ - private LastBackupStatus lastBackupStatus; - - /* - * Timestamp of the last backup operation on this backup item. - */ - private OffsetDateTime lastBackupTime; - - /* - * Error details in last backup - */ - private ErrorDetail lastBackupErrorDetail; - - /* - * Data ID of the protected item. - */ - private String protectedItemDataSourceId; - - /* - * Health status of the backup item, evaluated based on last heartbeat received - */ - private ProtectedItemHealthStatus protectedItemHealthStatus; - - /* - * Additional information for this backup item. - */ - private AzureVmWorkloadProtectedItemExtendedInfo extendedInfo; - - /* - * Health details of different KPIs - */ - private Map kpisHealths; - - /* - * List of the nodes in case of distributed container. - */ - private List nodesList; - - /** - * Creates an instance of AzureVmWorkloadProtectedItem class. - */ - public AzureVmWorkloadProtectedItem() { - } - - /** - * Get the protectedItemType property: backup item type. - * - * @return the protectedItemType value. - */ - @Override - public String protectedItemType() { - return this.protectedItemType; - } - - /** - * Get the friendlyName property: Friendly name of the DB represented by this backup item. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.friendlyName; - } - - /** - * Set the friendlyName property: Friendly name of the DB represented by this backup item. - * - * @param friendlyName the friendlyName value to set. - * @return the AzureVmWorkloadProtectedItem object itself. - */ - AzureVmWorkloadProtectedItem withFriendlyName(String friendlyName) { - this.friendlyName = friendlyName; - return this; - } - - /** - * Get the serverName property: Host/Cluster Name for instance or AG. - * - * @return the serverName value. - */ - public String serverName() { - return this.serverName; - } - - /** - * Set the serverName property: Host/Cluster Name for instance or AG. - * - * @param serverName the serverName value to set. - * @return the AzureVmWorkloadProtectedItem object itself. - */ - public AzureVmWorkloadProtectedItem withServerName(String serverName) { - this.serverName = serverName; - return this; - } - - /** - * Get the parentName property: Parent name of the DB such as Instance or Availability Group. - * - * @return the parentName value. - */ - public String parentName() { - return this.parentName; - } - - /** - * Set the parentName property: Parent name of the DB such as Instance or Availability Group. - * - * @param parentName the parentName value to set. - * @return the AzureVmWorkloadProtectedItem object itself. - */ - public AzureVmWorkloadProtectedItem withParentName(String parentName) { - this.parentName = parentName; - return this; - } - - /** - * Get the parentType property: Parent type of protected item, example: for a DB, standalone server or distributed. - * - * @return the parentType value. - */ - public String parentType() { - return this.parentType; - } - - /** - * Set the parentType property: Parent type of protected item, example: for a DB, standalone server or distributed. - * - * @param parentType the parentType value to set. - * @return the AzureVmWorkloadProtectedItem object itself. - */ - public AzureVmWorkloadProtectedItem withParentType(String parentType) { - this.parentType = parentType; - return this; - } - - /** - * Get the protectionStatus property: Backup status of this backup item. - * - * @return the protectionStatus value. - */ - public String protectionStatus() { - return this.protectionStatus; - } - - /** - * Set the protectionStatus property: Backup status of this backup item. - * - * @param protectionStatus the protectionStatus value to set. - * @return the AzureVmWorkloadProtectedItem object itself. - */ - AzureVmWorkloadProtectedItem withProtectionStatus(String protectionStatus) { - this.protectionStatus = protectionStatus; - return this; - } - - /** - * Get the protectionState property: Backup state of this backup item. - * - * @return the protectionState value. - */ - public ProtectionState protectionState() { - return this.protectionState; - } - - /** - * Set the protectionState property: Backup state of this backup item. - * - * @param protectionState the protectionState value to set. - * @return the AzureVmWorkloadProtectedItem object itself. - */ - public AzureVmWorkloadProtectedItem withProtectionState(ProtectionState protectionState) { - this.protectionState = protectionState; - return this; - } - - /** - * Get the lastBackupStatus property: Last backup operation status. Possible values: Healthy, Unhealthy. - * - * @return the lastBackupStatus value. - */ - public LastBackupStatus lastBackupStatus() { - return this.lastBackupStatus; - } - - /** - * Set the lastBackupStatus property: Last backup operation status. Possible values: Healthy, Unhealthy. - * - * @param lastBackupStatus the lastBackupStatus value to set. - * @return the AzureVmWorkloadProtectedItem object itself. - */ - public AzureVmWorkloadProtectedItem withLastBackupStatus(LastBackupStatus lastBackupStatus) { - this.lastBackupStatus = lastBackupStatus; - return this; - } - - /** - * Get the lastBackupTime property: Timestamp of the last backup operation on this backup item. - * - * @return the lastBackupTime value. - */ - public OffsetDateTime lastBackupTime() { - return this.lastBackupTime; - } - - /** - * Set the lastBackupTime property: Timestamp of the last backup operation on this backup item. - * - * @param lastBackupTime the lastBackupTime value to set. - * @return the AzureVmWorkloadProtectedItem object itself. - */ - public AzureVmWorkloadProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) { - this.lastBackupTime = lastBackupTime; - return this; - } - - /** - * Get the lastBackupErrorDetail property: Error details in last backup. - * - * @return the lastBackupErrorDetail value. - */ - public ErrorDetail lastBackupErrorDetail() { - return this.lastBackupErrorDetail; - } - - /** - * Set the lastBackupErrorDetail property: Error details in last backup. - * - * @param lastBackupErrorDetail the lastBackupErrorDetail value to set. - * @return the AzureVmWorkloadProtectedItem object itself. - */ - public AzureVmWorkloadProtectedItem withLastBackupErrorDetail(ErrorDetail lastBackupErrorDetail) { - this.lastBackupErrorDetail = lastBackupErrorDetail; - return this; - } - - /** - * Get the protectedItemDataSourceId property: Data ID of the protected item. - * - * @return the protectedItemDataSourceId value. - */ - public String protectedItemDataSourceId() { - return this.protectedItemDataSourceId; - } - - /** - * Set the protectedItemDataSourceId property: Data ID of the protected item. - * - * @param protectedItemDataSourceId the protectedItemDataSourceId value to set. - * @return the AzureVmWorkloadProtectedItem object itself. - */ - public AzureVmWorkloadProtectedItem withProtectedItemDataSourceId(String protectedItemDataSourceId) { - this.protectedItemDataSourceId = protectedItemDataSourceId; - return this; - } - - /** - * Get the protectedItemHealthStatus property: Health status of the backup item, evaluated based on last heartbeat - * received. - * - * @return the protectedItemHealthStatus value. - */ - public ProtectedItemHealthStatus protectedItemHealthStatus() { - return this.protectedItemHealthStatus; - } - - /** - * Set the protectedItemHealthStatus property: Health status of the backup item, evaluated based on last heartbeat - * received. - * - * @param protectedItemHealthStatus the protectedItemHealthStatus value to set. - * @return the AzureVmWorkloadProtectedItem object itself. - */ - public AzureVmWorkloadProtectedItem - withProtectedItemHealthStatus(ProtectedItemHealthStatus protectedItemHealthStatus) { - this.protectedItemHealthStatus = protectedItemHealthStatus; - return this; - } - - /** - * Get the extendedInfo property: Additional information for this backup item. - * - * @return the extendedInfo value. - */ - public AzureVmWorkloadProtectedItemExtendedInfo extendedInfo() { - return this.extendedInfo; - } - - /** - * Set the extendedInfo property: Additional information for this backup item. - * - * @param extendedInfo the extendedInfo value to set. - * @return the AzureVmWorkloadProtectedItem object itself. - */ - public AzureVmWorkloadProtectedItem withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo extendedInfo) { - this.extendedInfo = extendedInfo; - return this; - } - - /** - * Get the kpisHealths property: Health details of different KPIs. - * - * @return the kpisHealths value. - */ - public Map kpisHealths() { - return this.kpisHealths; - } - - /** - * Set the kpisHealths property: Health details of different KPIs. - * - * @param kpisHealths the kpisHealths value to set. - * @return the AzureVmWorkloadProtectedItem object itself. - */ - public AzureVmWorkloadProtectedItem withKpisHealths(Map kpisHealths) { - this.kpisHealths = kpisHealths; - return this; - } - - /** - * Get the nodesList property: List of the nodes in case of distributed container. - * - * @return the nodesList value. - */ - public List nodesList() { - return this.nodesList; - } - - /** - * Set the nodesList property: List of the nodes in case of distributed container. - * - * @param nodesList the nodesList value to set. - * @return the AzureVmWorkloadProtectedItem object itself. - */ - public AzureVmWorkloadProtectedItem withNodesList(List nodesList) { - this.nodesList = nodesList; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadProtectedItem withContainerName(String containerName) { - super.withContainerName(containerName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadProtectedItem withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadProtectedItem withPolicyId(String policyId) { - super.withPolicyId(policyId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { - super.withLastRecoveryPoint(lastRecoveryPoint); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadProtectedItem withBackupSetName(String backupSetName) { - super.withBackupSetName(backupSetName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadProtectedItem withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { - super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadProtectedItem withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { - super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { - super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadProtectedItem withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { - super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadProtectedItem withIsRehydrate(Boolean isRehydrate) { - super.withIsRehydrate(isRehydrate); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadProtectedItem - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadProtectedItem withIsArchiveEnabled(Boolean isArchiveEnabled) { - super.withIsArchiveEnabled(isArchiveEnabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadProtectedItem withPolicyName(String policyName) { - super.withPolicyName(policyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadProtectedItem withSoftDeleteRetentionPeriodInDays(Integer softDeleteRetentionPeriodInDays) { - super.withSoftDeleteRetentionPeriodInDays(softDeleteRetentionPeriodInDays); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadProtectedItem withSourceSideScanInfo(SourceSideScanInfo sourceSideScanInfo) { - super.withSourceSideScanInfo(sourceSideScanInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("containerName", containerName()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("policyId", policyId()); - jsonWriter.writeStringField("lastRecoveryPoint", - lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint())); - jsonWriter.writeStringField("backupSetName", backupSetName()); - jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString()); - jsonWriter.writeStringField("deferredDeleteTimeInUTC", - deferredDeleteTimeInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc())); - jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete()); - jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining()); - jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming()); - jsonWriter.writeBooleanField("isRehydrate", isRehydrate()); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled()); - jsonWriter.writeStringField("policyName", policyName()); - jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriodInDays()); - jsonWriter.writeJsonField("sourceSideScanInfo", sourceSideScanInfo()); - jsonWriter.writeStringField("protectedItemType", this.protectedItemType); - jsonWriter.writeStringField("serverName", this.serverName); - jsonWriter.writeStringField("parentName", this.parentName); - jsonWriter.writeStringField("parentType", this.parentType); - jsonWriter.writeStringField("protectionState", - this.protectionState == null ? null : this.protectionState.toString()); - jsonWriter.writeStringField("lastBackupStatus", - this.lastBackupStatus == null ? null : this.lastBackupStatus.toString()); - jsonWriter.writeStringField("lastBackupTime", - this.lastBackupTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastBackupTime)); - jsonWriter.writeJsonField("lastBackupErrorDetail", this.lastBackupErrorDetail); - jsonWriter.writeStringField("protectedItemDataSourceId", this.protectedItemDataSourceId); - jsonWriter.writeStringField("protectedItemHealthStatus", - this.protectedItemHealthStatus == null ? null : this.protectedItemHealthStatus.toString()); - jsonWriter.writeJsonField("extendedInfo", this.extendedInfo); - jsonWriter.writeMapField("kpisHealths", this.kpisHealths, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("nodesList", this.nodesList, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadProtectedItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadProtectedItem 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 AzureVmWorkloadProtectedItem. - */ - public static AzureVmWorkloadProtectedItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("protectedItemType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureVmWorkloadSAPAseDatabase".equals(discriminatorValue)) { - return AzureVmWorkloadSapAseDatabaseProtectedItem.fromJson(readerToUse.reset()); - } else if ("AzureVmWorkloadSAPHanaDatabase".equals(discriminatorValue)) { - return AzureVmWorkloadSapHanaDatabaseProtectedItem.fromJson(readerToUse.reset()); - } else if ("AzureVmWorkloadSAPHanaDBInstance".equals(discriminatorValue)) { - return AzureVmWorkloadSapHanaDBInstanceProtectedItem.fromJson(readerToUse.reset()); - } else if ("AzureVmWorkloadSQLDatabase".equals(discriminatorValue)) { - return AzureVmWorkloadSqlDatabaseProtectedItem.fromJson(readerToUse.reset()); - } else if ("AzureVmWorkloadSQLInstance".equals(discriminatorValue)) { - return AzureVmWorkloadSQLInstanceProtectedItem.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AzureVmWorkloadProtectedItem fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadProtectedItem deserializedAzureVmWorkloadProtectedItem = new AzureVmWorkloadProtectedItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem - .withWorkloadType(DataSourceType.fromString(reader.getString())); - } else if ("containerName".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.withContainerName(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.withSourceResourceId(reader.getString()); - } else if ("policyId".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.withPolicyId(reader.getString()); - } else if ("lastRecoveryPoint".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.withLastRecoveryPoint(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("backupSetName".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.withBackupSetName(reader.getString()); - } else if ("createMode".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.withCreateMode(CreateMode.fromString(reader.getString())); - } else if ("deferredDeleteTimeInUTC".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.withDeferredDeleteTimeInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("isScheduledForDeferredDelete".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem - .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean)); - } else if ("deferredDeleteTimeRemaining".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.withDeferredDeleteTimeRemaining(reader.getString()); - } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem - .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean)); - } else if ("isRehydrate".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem - .withIsRehydrate(reader.getNullable(JsonReader::getBoolean)); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureVmWorkloadProtectedItem - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("isArchiveEnabled".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem - .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("policyName".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.withPolicyName(reader.getString()); - } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem - .withSoftDeleteRetentionPeriodInDays(reader.getNullable(JsonReader::getInt)); - } else if ("vaultId".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.withVaultId(reader.getString()); - } else if ("sourceSideScanInfo".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem - .withSourceSideScanInfo(SourceSideScanInfo.fromJson(reader)); - } else if ("protectedItemType".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.protectedItemType = reader.getString(); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.friendlyName = reader.getString(); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.serverName = reader.getString(); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.parentName = reader.getString(); - } else if ("parentType".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.parentType = reader.getString(); - } else if ("protectionStatus".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.protectionStatus = reader.getString(); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.protectionState - = ProtectionState.fromString(reader.getString()); - } else if ("lastBackupStatus".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.lastBackupStatus - = LastBackupStatus.fromString(reader.getString()); - } else if ("lastBackupTime".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.lastBackupTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("lastBackupErrorDetail".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.lastBackupErrorDetail = ErrorDetail.fromJson(reader); - } else if ("protectedItemDataSourceId".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.protectedItemDataSourceId = reader.getString(); - } else if ("protectedItemHealthStatus".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.protectedItemHealthStatus - = ProtectedItemHealthStatus.fromString(reader.getString()); - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItem.extendedInfo - = AzureVmWorkloadProtectedItemExtendedInfo.fromJson(reader); - } else if ("kpisHealths".equals(fieldName)) { - Map kpisHealths - = reader.readMap(reader1 -> KpiResourceHealthDetails.fromJson(reader1)); - deserializedAzureVmWorkloadProtectedItem.kpisHealths = kpisHealths; - } else if ("nodesList".equals(fieldName)) { - List nodesList - = reader.readArray(reader1 -> DistributedNodesInfo.fromJson(reader1)); - deserializedAzureVmWorkloadProtectedItem.nodesList = nodesList; - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadProtectedItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItemExtendedInfo.java deleted file mode 100644 index 3b9615acd9db..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectedItemExtendedInfo.java +++ /dev/null @@ -1,282 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Additional information on Azure Workload for SQL specific backup item. - */ -@Fluent -public final class AzureVmWorkloadProtectedItemExtendedInfo - implements JsonSerializable { - /* - * The oldest backup copy available for this backup item across all tiers. - */ - private OffsetDateTime oldestRecoveryPoint; - - /* - * The oldest backup copy available for this backup item in vault tier - */ - private OffsetDateTime oldestRecoveryPointInVault; - - /* - * The oldest backup copy available for this backup item in archive tier - */ - private OffsetDateTime oldestRecoveryPointInArchive; - - /* - * The latest backup copy available for this backup item in archive tier - */ - private OffsetDateTime newestRecoveryPointInArchive; - - /* - * Number of backup copies available for this backup item. - */ - private Integer recoveryPointCount; - - /* - * Indicates consistency of policy object and policy applied to this backup item. - */ - private String policyState; - - /* - * Indicates consistency of policy object and policy applied to this backup item. - */ - private String recoveryModel; - - /** - * Creates an instance of AzureVmWorkloadProtectedItemExtendedInfo class. - */ - public AzureVmWorkloadProtectedItemExtendedInfo() { - } - - /** - * Get the oldestRecoveryPoint property: The oldest backup copy available for this backup item across all tiers. - * - * @return the oldestRecoveryPoint value. - */ - public OffsetDateTime oldestRecoveryPoint() { - return this.oldestRecoveryPoint; - } - - /** - * Set the oldestRecoveryPoint property: The oldest backup copy available for this backup item across all tiers. - * - * @param oldestRecoveryPoint the oldestRecoveryPoint value to set. - * @return the AzureVmWorkloadProtectedItemExtendedInfo object itself. - */ - public AzureVmWorkloadProtectedItemExtendedInfo withOldestRecoveryPoint(OffsetDateTime oldestRecoveryPoint) { - this.oldestRecoveryPoint = oldestRecoveryPoint; - return this; - } - - /** - * Get the oldestRecoveryPointInVault property: The oldest backup copy available for this backup item in vault tier. - * - * @return the oldestRecoveryPointInVault value. - */ - public OffsetDateTime oldestRecoveryPointInVault() { - return this.oldestRecoveryPointInVault; - } - - /** - * Set the oldestRecoveryPointInVault property: The oldest backup copy available for this backup item in vault tier. - * - * @param oldestRecoveryPointInVault the oldestRecoveryPointInVault value to set. - * @return the AzureVmWorkloadProtectedItemExtendedInfo object itself. - */ - public AzureVmWorkloadProtectedItemExtendedInfo - withOldestRecoveryPointInVault(OffsetDateTime oldestRecoveryPointInVault) { - this.oldestRecoveryPointInVault = oldestRecoveryPointInVault; - return this; - } - - /** - * Get the oldestRecoveryPointInArchive property: The oldest backup copy available for this backup item in archive - * tier. - * - * @return the oldestRecoveryPointInArchive value. - */ - public OffsetDateTime oldestRecoveryPointInArchive() { - return this.oldestRecoveryPointInArchive; - } - - /** - * Set the oldestRecoveryPointInArchive property: The oldest backup copy available for this backup item in archive - * tier. - * - * @param oldestRecoveryPointInArchive the oldestRecoveryPointInArchive value to set. - * @return the AzureVmWorkloadProtectedItemExtendedInfo object itself. - */ - public AzureVmWorkloadProtectedItemExtendedInfo - withOldestRecoveryPointInArchive(OffsetDateTime oldestRecoveryPointInArchive) { - this.oldestRecoveryPointInArchive = oldestRecoveryPointInArchive; - return this; - } - - /** - * Get the newestRecoveryPointInArchive property: The latest backup copy available for this backup item in archive - * tier. - * - * @return the newestRecoveryPointInArchive value. - */ - public OffsetDateTime newestRecoveryPointInArchive() { - return this.newestRecoveryPointInArchive; - } - - /** - * Set the newestRecoveryPointInArchive property: The latest backup copy available for this backup item in archive - * tier. - * - * @param newestRecoveryPointInArchive the newestRecoveryPointInArchive value to set. - * @return the AzureVmWorkloadProtectedItemExtendedInfo object itself. - */ - public AzureVmWorkloadProtectedItemExtendedInfo - withNewestRecoveryPointInArchive(OffsetDateTime newestRecoveryPointInArchive) { - this.newestRecoveryPointInArchive = newestRecoveryPointInArchive; - return this; - } - - /** - * Get the recoveryPointCount property: Number of backup copies available for this backup item. - * - * @return the recoveryPointCount value. - */ - public Integer recoveryPointCount() { - return this.recoveryPointCount; - } - - /** - * Set the recoveryPointCount property: Number of backup copies available for this backup item. - * - * @param recoveryPointCount the recoveryPointCount value to set. - * @return the AzureVmWorkloadProtectedItemExtendedInfo object itself. - */ - public AzureVmWorkloadProtectedItemExtendedInfo withRecoveryPointCount(Integer recoveryPointCount) { - this.recoveryPointCount = recoveryPointCount; - return this; - } - - /** - * Get the policyState property: Indicates consistency of policy object and policy applied to this backup item. - * - * @return the policyState value. - */ - public String policyState() { - return this.policyState; - } - - /** - * Set the policyState property: Indicates consistency of policy object and policy applied to this backup item. - * - * @param policyState the policyState value to set. - * @return the AzureVmWorkloadProtectedItemExtendedInfo object itself. - */ - public AzureVmWorkloadProtectedItemExtendedInfo withPolicyState(String policyState) { - this.policyState = policyState; - return this; - } - - /** - * Get the recoveryModel property: Indicates consistency of policy object and policy applied to this backup item. - * - * @return the recoveryModel value. - */ - public String recoveryModel() { - return this.recoveryModel; - } - - /** - * Set the recoveryModel property: Indicates consistency of policy object and policy applied to this backup item. - * - * @param recoveryModel the recoveryModel value to set. - * @return the AzureVmWorkloadProtectedItemExtendedInfo object itself. - */ - public AzureVmWorkloadProtectedItemExtendedInfo withRecoveryModel(String recoveryModel) { - this.recoveryModel = recoveryModel; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("oldestRecoveryPoint", - this.oldestRecoveryPoint == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.oldestRecoveryPoint)); - jsonWriter.writeStringField("oldestRecoveryPointInVault", - this.oldestRecoveryPointInVault == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.oldestRecoveryPointInVault)); - jsonWriter.writeStringField("oldestRecoveryPointInArchive", - this.oldestRecoveryPointInArchive == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.oldestRecoveryPointInArchive)); - jsonWriter.writeStringField("newestRecoveryPointInArchive", - this.newestRecoveryPointInArchive == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.newestRecoveryPointInArchive)); - jsonWriter.writeNumberField("recoveryPointCount", this.recoveryPointCount); - jsonWriter.writeStringField("policyState", this.policyState); - jsonWriter.writeStringField("recoveryModel", this.recoveryModel); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadProtectedItemExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadProtectedItemExtendedInfo 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 AzureVmWorkloadProtectedItemExtendedInfo. - */ - public static AzureVmWorkloadProtectedItemExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadProtectedItemExtendedInfo deserializedAzureVmWorkloadProtectedItemExtendedInfo - = new AzureVmWorkloadProtectedItemExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("oldestRecoveryPoint".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItemExtendedInfo.oldestRecoveryPoint = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("oldestRecoveryPointInVault".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItemExtendedInfo.oldestRecoveryPointInVault = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("oldestRecoveryPointInArchive".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItemExtendedInfo.oldestRecoveryPointInArchive = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("newestRecoveryPointInArchive".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItemExtendedInfo.newestRecoveryPointInArchive = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("recoveryPointCount".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItemExtendedInfo.recoveryPointCount - = reader.getNullable(JsonReader::getInt); - } else if ("policyState".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItemExtendedInfo.policyState = reader.getString(); - } else if ("recoveryModel".equals(fieldName)) { - deserializedAzureVmWorkloadProtectedItemExtendedInfo.recoveryModel = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadProtectedItemExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectionPolicy.java deleted file mode 100644 index 5fb7abc7a954..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadProtectionPolicy.java +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Azure VM (Mercury) workload-specific backup policy. - */ -@Fluent -public final class AzureVmWorkloadProtectionPolicy extends ProtectionPolicy { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String backupManagementType = "AzureWorkload"; - - /* - * Type of workload for the backup management - */ - private WorkloadType workLoadType; - - /* - * Type of the protection policy - */ - private VMWorkloadPolicyType vmWorkloadPolicyType; - - /* - * Common settings for the backup management - */ - private Settings settings; - - /* - * List of sub-protection policies which includes schedule and retention - */ - private List subProtectionPolicy; - - /* - * Fix the policy inconsistency - */ - private Boolean makePolicyConsistent; - - /** - * Creates an instance of AzureVmWorkloadProtectionPolicy class. - */ - public AzureVmWorkloadProtectionPolicy() { - } - - /** - * Get the backupManagementType property: This property will be used as the discriminator for deciding the specific - * types in the polymorphic chain of types. - * - * @return the backupManagementType value. - */ - @Override - public String backupManagementType() { - return this.backupManagementType; - } - - /** - * Get the workLoadType property: Type of workload for the backup management. - * - * @return the workLoadType value. - */ - public WorkloadType workLoadType() { - return this.workLoadType; - } - - /** - * Set the workLoadType property: Type of workload for the backup management. - * - * @param workLoadType the workLoadType value to set. - * @return the AzureVmWorkloadProtectionPolicy object itself. - */ - public AzureVmWorkloadProtectionPolicy withWorkLoadType(WorkloadType workLoadType) { - this.workLoadType = workLoadType; - return this; - } - - /** - * Get the vmWorkloadPolicyType property: Type of the protection policy. - * - * @return the vmWorkloadPolicyType value. - */ - public VMWorkloadPolicyType vmWorkloadPolicyType() { - return this.vmWorkloadPolicyType; - } - - /** - * Set the vmWorkloadPolicyType property: Type of the protection policy. - * - * @param vmWorkloadPolicyType the vmWorkloadPolicyType value to set. - * @return the AzureVmWorkloadProtectionPolicy object itself. - */ - public AzureVmWorkloadProtectionPolicy withVmWorkloadPolicyType(VMWorkloadPolicyType vmWorkloadPolicyType) { - this.vmWorkloadPolicyType = vmWorkloadPolicyType; - return this; - } - - /** - * Get the settings property: Common settings for the backup management. - * - * @return the settings value. - */ - public Settings settings() { - return this.settings; - } - - /** - * Set the settings property: Common settings for the backup management. - * - * @param settings the settings value to set. - * @return the AzureVmWorkloadProtectionPolicy object itself. - */ - public AzureVmWorkloadProtectionPolicy withSettings(Settings settings) { - this.settings = settings; - return this; - } - - /** - * Get the subProtectionPolicy property: List of sub-protection policies which includes schedule and retention. - * - * @return the subProtectionPolicy value. - */ - public List subProtectionPolicy() { - return this.subProtectionPolicy; - } - - /** - * Set the subProtectionPolicy property: List of sub-protection policies which includes schedule and retention. - * - * @param subProtectionPolicy the subProtectionPolicy value to set. - * @return the AzureVmWorkloadProtectionPolicy object itself. - */ - public AzureVmWorkloadProtectionPolicy withSubProtectionPolicy(List subProtectionPolicy) { - this.subProtectionPolicy = subProtectionPolicy; - return this; - } - - /** - * Get the makePolicyConsistent property: Fix the policy inconsistency. - * - * @return the makePolicyConsistent value. - */ - public Boolean makePolicyConsistent() { - return this.makePolicyConsistent; - } - - /** - * Set the makePolicyConsistent property: Fix the policy inconsistency. - * - * @param makePolicyConsistent the makePolicyConsistent value to set. - * @return the AzureVmWorkloadProtectionPolicy object itself. - */ - public AzureVmWorkloadProtectionPolicy withMakePolicyConsistent(Boolean makePolicyConsistent) { - this.makePolicyConsistent = makePolicyConsistent; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadProtectionPolicy withProtectedItemsCount(Integer protectedItemsCount) { - super.withProtectedItemsCount(protectedItemsCount); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadProtectionPolicy - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("protectedItemsCount", protectedItemsCount()); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("backupManagementType", this.backupManagementType); - jsonWriter.writeStringField("workLoadType", this.workLoadType == null ? null : this.workLoadType.toString()); - jsonWriter.writeStringField("vmWorkloadPolicyType", - this.vmWorkloadPolicyType == null ? null : this.vmWorkloadPolicyType.toString()); - jsonWriter.writeJsonField("settings", this.settings); - jsonWriter.writeArrayField("subProtectionPolicy", this.subProtectionPolicy, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeBooleanField("makePolicyConsistent", this.makePolicyConsistent); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadProtectionPolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadProtectionPolicy 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 AzureVmWorkloadProtectionPolicy. - */ - public static AzureVmWorkloadProtectionPolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadProtectionPolicy deserializedAzureVmWorkloadProtectionPolicy - = new AzureVmWorkloadProtectionPolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("protectedItemsCount".equals(fieldName)) { - deserializedAzureVmWorkloadProtectionPolicy - .withProtectedItemsCount(reader.getNullable(JsonReader::getInt)); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureVmWorkloadProtectionPolicy - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadProtectionPolicy.backupManagementType = reader.getString(); - } else if ("workLoadType".equals(fieldName)) { - deserializedAzureVmWorkloadProtectionPolicy.workLoadType - = WorkloadType.fromString(reader.getString()); - } else if ("vmWorkloadPolicyType".equals(fieldName)) { - deserializedAzureVmWorkloadProtectionPolicy.vmWorkloadPolicyType - = VMWorkloadPolicyType.fromString(reader.getString()); - } else if ("settings".equals(fieldName)) { - deserializedAzureVmWorkloadProtectionPolicy.settings = Settings.fromJson(reader); - } else if ("subProtectionPolicy".equals(fieldName)) { - List subProtectionPolicy - = reader.readArray(reader1 -> SubProtectionPolicy.fromJson(reader1)); - deserializedAzureVmWorkloadProtectionPolicy.subProtectionPolicy = subProtectionPolicy; - } else if ("makePolicyConsistent".equals(fieldName)) { - deserializedAzureVmWorkloadProtectionPolicy.makePolicyConsistent - = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadProtectionPolicy; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSAPHanaScaleoutProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSAPHanaScaleoutProtectableItem.java deleted file mode 100644 index acceae81ffde..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSAPHanaScaleoutProtectableItem.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure VM workload-specific protectable item representing HANA scale out. - */ -@Immutable -public final class AzureVmWorkloadSAPHanaScaleoutProtectableItem extends AzureVmWorkloadProtectableItem { - /* - * Type of the backup item. - */ - private String protectableItemType = "HanaScaleoutContainer"; - - /** - * Creates an instance of AzureVmWorkloadSAPHanaScaleoutProtectableItem class. - */ - private AzureVmWorkloadSAPHanaScaleoutProtectableItem() { - } - - /** - * Get the protectableItemType property: Type of the backup item. - * - * @return the protectableItemType value. - */ - @Override - public String protectableItemType() { - return this.protectableItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("parentName", parentName()); - jsonWriter.writeStringField("parentUniqueName", parentUniqueName()); - jsonWriter.writeStringField("serverName", serverName()); - jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable()); - jsonWriter.writeBooleanField("isAutoProtected", isAutoProtected()); - jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount()); - jsonWriter.writeNumberField("subprotectableitemcount", subprotectableitemcount()); - jsonWriter.writeJsonField("prebackupvalidation", prebackupvalidation()); - jsonWriter.writeBooleanField("isProtectable", isProtectable()); - jsonWriter.writeStringField("protectableItemType", this.protectableItemType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadSAPHanaScaleoutProtectableItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadSAPHanaScaleoutProtectableItem 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 AzureVmWorkloadSAPHanaScaleoutProtectableItem. - */ - public static AzureVmWorkloadSAPHanaScaleoutProtectableItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadSAPHanaScaleoutProtectableItem deserializedAzureVmWorkloadSAPHanaScaleoutProtectableItem - = new AzureVmWorkloadSAPHanaScaleoutProtectableItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadSAPHanaScaleoutProtectableItem - .withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadSAPHanaScaleoutProtectableItem.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadSAPHanaScaleoutProtectableItem.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadSAPHanaScaleoutProtectableItem - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadSAPHanaScaleoutProtectableItem.withParentName(reader.getString()); - } else if ("parentUniqueName".equals(fieldName)) { - deserializedAzureVmWorkloadSAPHanaScaleoutProtectableItem.withParentUniqueName(reader.getString()); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadSAPHanaScaleoutProtectableItem.withServerName(reader.getString()); - } else if ("isAutoProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSAPHanaScaleoutProtectableItem - .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("isAutoProtected".equals(fieldName)) { - deserializedAzureVmWorkloadSAPHanaScaleoutProtectableItem - .withIsAutoProtected(reader.getNullable(JsonReader::getBoolean)); - } else if ("subinquireditemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSAPHanaScaleoutProtectableItem - .withSubinquireditemcount(reader.getNullable(JsonReader::getInt)); - } else if ("subprotectableitemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSAPHanaScaleoutProtectableItem - .withSubprotectableitemcount(reader.getNullable(JsonReader::getInt)); - } else if ("prebackupvalidation".equals(fieldName)) { - deserializedAzureVmWorkloadSAPHanaScaleoutProtectableItem - .withPrebackupvalidation(PreBackupValidation.fromJson(reader)); - } else if ("isProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSAPHanaScaleoutProtectableItem - .withIsProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("protectableItemType".equals(fieldName)) { - deserializedAzureVmWorkloadSAPHanaScaleoutProtectableItem.protectableItemType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadSAPHanaScaleoutProtectableItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSQLInstanceProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSQLInstanceProtectedItem.java deleted file mode 100644 index d15976d2c168..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSQLInstanceProtectedItem.java +++ /dev/null @@ -1,525 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * Azure VM workload-specific protected item representing SQL Instance. - */ -@Fluent -public final class AzureVmWorkloadSQLInstanceProtectedItem extends AzureVmWorkloadProtectedItem { - /* - * backup item type. - */ - private String protectedItemType = "AzureVmWorkloadSQLInstance"; - - /* - * Name of Child Dbs protected under this parent. - */ - private List childDBNames; - - /* - * The state of instance protection. - */ - private InstanceProtectionReadiness instanceProtectionReadiness; - - /** - * Creates an instance of AzureVmWorkloadSQLInstanceProtectedItem class. - */ - public AzureVmWorkloadSQLInstanceProtectedItem() { - } - - /** - * Get the protectedItemType property: backup item type. - * - * @return the protectedItemType value. - */ - @Override - public String protectedItemType() { - return this.protectedItemType; - } - - /** - * Get the childDBNames property: Name of Child Dbs protected under this parent. - * - * @return the childDBNames value. - */ - public List childDBNames() { - return this.childDBNames; - } - - /** - * Set the childDBNames property: Name of Child Dbs protected under this parent. - * - * @param childDBNames the childDBNames value to set. - * @return the AzureVmWorkloadSQLInstanceProtectedItem object itself. - */ - public AzureVmWorkloadSQLInstanceProtectedItem withChildDBNames(List childDBNames) { - this.childDBNames = childDBNames; - return this; - } - - /** - * Get the instanceProtectionReadiness property: The state of instance protection. - * - * @return the instanceProtectionReadiness value. - */ - public InstanceProtectionReadiness instanceProtectionReadiness() { - return this.instanceProtectionReadiness; - } - - /** - * Set the instanceProtectionReadiness property: The state of instance protection. - * - * @param instanceProtectionReadiness the instanceProtectionReadiness value to set. - * @return the AzureVmWorkloadSQLInstanceProtectedItem object itself. - */ - public AzureVmWorkloadSQLInstanceProtectedItem - withInstanceProtectionReadiness(InstanceProtectionReadiness instanceProtectionReadiness) { - this.instanceProtectionReadiness = instanceProtectionReadiness; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withServerName(String serverName) { - super.withServerName(serverName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withParentName(String parentName) { - super.withParentName(parentName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withParentType(String parentType) { - super.withParentType(parentType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withProtectionState(ProtectionState protectionState) { - super.withProtectionState(protectionState); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withLastBackupStatus(LastBackupStatus lastBackupStatus) { - super.withLastBackupStatus(lastBackupStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) { - super.withLastBackupTime(lastBackupTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withLastBackupErrorDetail(ErrorDetail lastBackupErrorDetail) { - super.withLastBackupErrorDetail(lastBackupErrorDetail); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withProtectedItemDataSourceId(String protectedItemDataSourceId) { - super.withProtectedItemDataSourceId(protectedItemDataSourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem - withProtectedItemHealthStatus(ProtectedItemHealthStatus protectedItemHealthStatus) { - super.withProtectedItemHealthStatus(protectedItemHealthStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem - withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo extendedInfo) { - super.withExtendedInfo(extendedInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withKpisHealths(Map kpisHealths) { - super.withKpisHealths(kpisHealths); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withNodesList(List nodesList) { - super.withNodesList(nodesList); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withContainerName(String containerName) { - super.withContainerName(containerName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withPolicyId(String policyId) { - super.withPolicyId(policyId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { - super.withLastRecoveryPoint(lastRecoveryPoint); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withBackupSetName(String backupSetName) { - super.withBackupSetName(backupSetName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { - super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem - withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { - super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { - super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem - withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { - super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withIsRehydrate(Boolean isRehydrate) { - super.withIsRehydrate(isRehydrate); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withIsArchiveEnabled(Boolean isArchiveEnabled) { - super.withIsArchiveEnabled(isArchiveEnabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withPolicyName(String policyName) { - super.withPolicyName(policyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem - withSoftDeleteRetentionPeriodInDays(Integer softDeleteRetentionPeriodInDays) { - super.withSoftDeleteRetentionPeriodInDays(softDeleteRetentionPeriodInDays); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSQLInstanceProtectedItem withSourceSideScanInfo(SourceSideScanInfo sourceSideScanInfo) { - super.withSourceSideScanInfo(sourceSideScanInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("containerName", containerName()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("policyId", policyId()); - jsonWriter.writeStringField("lastRecoveryPoint", - lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint())); - jsonWriter.writeStringField("backupSetName", backupSetName()); - jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString()); - jsonWriter.writeStringField("deferredDeleteTimeInUTC", - deferredDeleteTimeInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc())); - jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete()); - jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining()); - jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming()); - jsonWriter.writeBooleanField("isRehydrate", isRehydrate()); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled()); - jsonWriter.writeStringField("policyName", policyName()); - jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriodInDays()); - jsonWriter.writeJsonField("sourceSideScanInfo", sourceSideScanInfo()); - jsonWriter.writeStringField("serverName", serverName()); - jsonWriter.writeStringField("parentName", parentName()); - jsonWriter.writeStringField("parentType", parentType()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("lastBackupStatus", - lastBackupStatus() == null ? null : lastBackupStatus().toString()); - jsonWriter.writeStringField("lastBackupTime", - lastBackupTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastBackupTime())); - jsonWriter.writeJsonField("lastBackupErrorDetail", lastBackupErrorDetail()); - jsonWriter.writeStringField("protectedItemDataSourceId", protectedItemDataSourceId()); - jsonWriter.writeStringField("protectedItemHealthStatus", - protectedItemHealthStatus() == null ? null : protectedItemHealthStatus().toString()); - jsonWriter.writeJsonField("extendedInfo", extendedInfo()); - jsonWriter.writeMapField("kpisHealths", kpisHealths(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("nodesList", nodesList(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("protectedItemType", this.protectedItemType); - jsonWriter.writeArrayField("childDBNames", this.childDBNames, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("instanceProtectionReadiness", - this.instanceProtectionReadiness == null ? null : this.instanceProtectionReadiness.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadSQLInstanceProtectedItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadSQLInstanceProtectedItem 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 AzureVmWorkloadSQLInstanceProtectedItem. - */ - public static AzureVmWorkloadSQLInstanceProtectedItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadSQLInstanceProtectedItem deserializedAzureVmWorkloadSQLInstanceProtectedItem - = new AzureVmWorkloadSQLInstanceProtectedItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem - .withWorkloadType(DataSourceType.fromString(reader.getString())); - } else if ("containerName".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem.withContainerName(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem.withSourceResourceId(reader.getString()); - } else if ("policyId".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem.withPolicyId(reader.getString()); - } else if ("lastRecoveryPoint".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem.withLastRecoveryPoint(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("backupSetName".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem.withBackupSetName(reader.getString()); - } else if ("createMode".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem - .withCreateMode(CreateMode.fromString(reader.getString())); - } else if ("deferredDeleteTimeInUTC".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem.withDeferredDeleteTimeInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("isScheduledForDeferredDelete".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem - .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean)); - } else if ("deferredDeleteTimeRemaining".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem - .withDeferredDeleteTimeRemaining(reader.getString()); - } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem - .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean)); - } else if ("isRehydrate".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem - .withIsRehydrate(reader.getNullable(JsonReader::getBoolean)); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureVmWorkloadSQLInstanceProtectedItem - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("isArchiveEnabled".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem - .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("policyName".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem.withPolicyName(reader.getString()); - } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem - .withSoftDeleteRetentionPeriodInDays(reader.getNullable(JsonReader::getInt)); - } else if ("vaultId".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem.withVaultId(reader.getString()); - } else if ("sourceSideScanInfo".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem - .withSourceSideScanInfo(SourceSideScanInfo.fromJson(reader)); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem.withFriendlyName(reader.getString()); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem.withServerName(reader.getString()); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem.withParentName(reader.getString()); - } else if ("parentType".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem.withParentType(reader.getString()); - } else if ("protectionStatus".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem.withProtectionStatus(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem - .withProtectionState(ProtectionState.fromString(reader.getString())); - } else if ("lastBackupStatus".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem - .withLastBackupStatus(LastBackupStatus.fromString(reader.getString())); - } else if ("lastBackupTime".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem.withLastBackupTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("lastBackupErrorDetail".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem - .withLastBackupErrorDetail(ErrorDetail.fromJson(reader)); - } else if ("protectedItemDataSourceId".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem - .withProtectedItemDataSourceId(reader.getString()); - } else if ("protectedItemHealthStatus".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem - .withProtectedItemHealthStatus(ProtectedItemHealthStatus.fromString(reader.getString())); - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem - .withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo.fromJson(reader)); - } else if ("kpisHealths".equals(fieldName)) { - Map kpisHealths - = reader.readMap(reader1 -> KpiResourceHealthDetails.fromJson(reader1)); - deserializedAzureVmWorkloadSQLInstanceProtectedItem.withKpisHealths(kpisHealths); - } else if ("nodesList".equals(fieldName)) { - List nodesList - = reader.readArray(reader1 -> DistributedNodesInfo.fromJson(reader1)); - deserializedAzureVmWorkloadSQLInstanceProtectedItem.withNodesList(nodesList); - } else if ("protectedItemType".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem.protectedItemType = reader.getString(); - } else if ("childDBNames".equals(fieldName)) { - List childDBNames = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureVmWorkloadSQLInstanceProtectedItem.childDBNames = childDBNames; - } else if ("instanceProtectionReadiness".equals(fieldName)) { - deserializedAzureVmWorkloadSQLInstanceProtectedItem.instanceProtectionReadiness - = InstanceProtectionReadiness.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadSQLInstanceProtectedItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseProtectableItem.java deleted file mode 100644 index 804f17636b8e..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseProtectableItem.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure VM workload-specific protectable item representing SAP ASE Database. - */ -@Immutable -public final class AzureVmWorkloadSapAseDatabaseProtectableItem extends AzureVmWorkloadProtectableItem { - /* - * Type of the backup item. - */ - private String protectableItemType = "SAPAseDatabase"; - - /** - * Creates an instance of AzureVmWorkloadSapAseDatabaseProtectableItem class. - */ - private AzureVmWorkloadSapAseDatabaseProtectableItem() { - } - - /** - * Get the protectableItemType property: Type of the backup item. - * - * @return the protectableItemType value. - */ - @Override - public String protectableItemType() { - return this.protectableItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("parentName", parentName()); - jsonWriter.writeStringField("parentUniqueName", parentUniqueName()); - jsonWriter.writeStringField("serverName", serverName()); - jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable()); - jsonWriter.writeBooleanField("isAutoProtected", isAutoProtected()); - jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount()); - jsonWriter.writeNumberField("subprotectableitemcount", subprotectableitemcount()); - jsonWriter.writeJsonField("prebackupvalidation", prebackupvalidation()); - jsonWriter.writeBooleanField("isProtectable", isProtectable()); - jsonWriter.writeStringField("protectableItemType", this.protectableItemType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadSapAseDatabaseProtectableItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadSapAseDatabaseProtectableItem 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 AzureVmWorkloadSapAseDatabaseProtectableItem. - */ - public static AzureVmWorkloadSapAseDatabaseProtectableItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadSapAseDatabaseProtectableItem deserializedAzureVmWorkloadSapAseDatabaseProtectableItem - = new AzureVmWorkloadSapAseDatabaseProtectableItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectableItem - .withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectableItem.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectableItem.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectableItem - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectableItem.withParentName(reader.getString()); - } else if ("parentUniqueName".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectableItem.withParentUniqueName(reader.getString()); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectableItem.withServerName(reader.getString()); - } else if ("isAutoProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectableItem - .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("isAutoProtected".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectableItem - .withIsAutoProtected(reader.getNullable(JsonReader::getBoolean)); - } else if ("subinquireditemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectableItem - .withSubinquireditemcount(reader.getNullable(JsonReader::getInt)); - } else if ("subprotectableitemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectableItem - .withSubprotectableitemcount(reader.getNullable(JsonReader::getInt)); - } else if ("prebackupvalidation".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectableItem - .withPrebackupvalidation(PreBackupValidation.fromJson(reader)); - } else if ("isProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectableItem - .withIsProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("protectableItemType".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectableItem.protectableItemType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadSapAseDatabaseProtectableItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseProtectedItem.java deleted file mode 100644 index dc9b6f53e401..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseProtectedItem.java +++ /dev/null @@ -1,468 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * Azure VM workload-specific protected item representing SAP ASE Database. - */ -@Fluent -public final class AzureVmWorkloadSapAseDatabaseProtectedItem extends AzureVmWorkloadProtectedItem { - /* - * backup item type. - */ - private String protectedItemType = "AzureVmWorkloadSAPAseDatabase"; - - /** - * Creates an instance of AzureVmWorkloadSapAseDatabaseProtectedItem class. - */ - public AzureVmWorkloadSapAseDatabaseProtectedItem() { - } - - /** - * Get the protectedItemType property: backup item type. - * - * @return the protectedItemType value. - */ - @Override - public String protectedItemType() { - return this.protectedItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem withServerName(String serverName) { - super.withServerName(serverName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem withParentName(String parentName) { - super.withParentName(parentName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem withParentType(String parentType) { - super.withParentType(parentType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem withProtectionState(ProtectionState protectionState) { - super.withProtectionState(protectionState); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem withLastBackupStatus(LastBackupStatus lastBackupStatus) { - super.withLastBackupStatus(lastBackupStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) { - super.withLastBackupTime(lastBackupTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem withLastBackupErrorDetail(ErrorDetail lastBackupErrorDetail) { - super.withLastBackupErrorDetail(lastBackupErrorDetail); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem withProtectedItemDataSourceId(String protectedItemDataSourceId) { - super.withProtectedItemDataSourceId(protectedItemDataSourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem - withProtectedItemHealthStatus(ProtectedItemHealthStatus protectedItemHealthStatus) { - super.withProtectedItemHealthStatus(protectedItemHealthStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem - withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo extendedInfo) { - super.withExtendedInfo(extendedInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem - withKpisHealths(Map kpisHealths) { - super.withKpisHealths(kpisHealths); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem withNodesList(List nodesList) { - super.withNodesList(nodesList); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem withContainerName(String containerName) { - super.withContainerName(containerName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem withPolicyId(String policyId) { - super.withPolicyId(policyId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { - super.withLastRecoveryPoint(lastRecoveryPoint); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem withBackupSetName(String backupSetName) { - super.withBackupSetName(backupSetName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem - withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { - super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem - withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { - super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem - withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { - super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem - withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { - super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem withIsRehydrate(Boolean isRehydrate) { - super.withIsRehydrate(isRehydrate); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem withIsArchiveEnabled(Boolean isArchiveEnabled) { - super.withIsArchiveEnabled(isArchiveEnabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem withPolicyName(String policyName) { - super.withPolicyName(policyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem - withSoftDeleteRetentionPeriodInDays(Integer softDeleteRetentionPeriodInDays) { - super.withSoftDeleteRetentionPeriodInDays(softDeleteRetentionPeriodInDays); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapAseDatabaseProtectedItem withSourceSideScanInfo(SourceSideScanInfo sourceSideScanInfo) { - super.withSourceSideScanInfo(sourceSideScanInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("containerName", containerName()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("policyId", policyId()); - jsonWriter.writeStringField("lastRecoveryPoint", - lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint())); - jsonWriter.writeStringField("backupSetName", backupSetName()); - jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString()); - jsonWriter.writeStringField("deferredDeleteTimeInUTC", - deferredDeleteTimeInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc())); - jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete()); - jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining()); - jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming()); - jsonWriter.writeBooleanField("isRehydrate", isRehydrate()); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled()); - jsonWriter.writeStringField("policyName", policyName()); - jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriodInDays()); - jsonWriter.writeJsonField("sourceSideScanInfo", sourceSideScanInfo()); - jsonWriter.writeStringField("serverName", serverName()); - jsonWriter.writeStringField("parentName", parentName()); - jsonWriter.writeStringField("parentType", parentType()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("lastBackupStatus", - lastBackupStatus() == null ? null : lastBackupStatus().toString()); - jsonWriter.writeStringField("lastBackupTime", - lastBackupTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastBackupTime())); - jsonWriter.writeJsonField("lastBackupErrorDetail", lastBackupErrorDetail()); - jsonWriter.writeStringField("protectedItemDataSourceId", protectedItemDataSourceId()); - jsonWriter.writeStringField("protectedItemHealthStatus", - protectedItemHealthStatus() == null ? null : protectedItemHealthStatus().toString()); - jsonWriter.writeJsonField("extendedInfo", extendedInfo()); - jsonWriter.writeMapField("kpisHealths", kpisHealths(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("nodesList", nodesList(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("protectedItemType", this.protectedItemType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadSapAseDatabaseProtectedItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadSapAseDatabaseProtectedItem 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 AzureVmWorkloadSapAseDatabaseProtectedItem. - */ - public static AzureVmWorkloadSapAseDatabaseProtectedItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadSapAseDatabaseProtectedItem deserializedAzureVmWorkloadSapAseDatabaseProtectedItem - = new AzureVmWorkloadSapAseDatabaseProtectedItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem - .withWorkloadType(DataSourceType.fromString(reader.getString())); - } else if ("containerName".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withContainerName(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withSourceResourceId(reader.getString()); - } else if ("policyId".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withPolicyId(reader.getString()); - } else if ("lastRecoveryPoint".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withLastRecoveryPoint(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("backupSetName".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withBackupSetName(reader.getString()); - } else if ("createMode".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem - .withCreateMode(CreateMode.fromString(reader.getString())); - } else if ("deferredDeleteTimeInUTC".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withDeferredDeleteTimeInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("isScheduledForDeferredDelete".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem - .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean)); - } else if ("deferredDeleteTimeRemaining".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem - .withDeferredDeleteTimeRemaining(reader.getString()); - } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem - .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean)); - } else if ("isRehydrate".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem - .withIsRehydrate(reader.getNullable(JsonReader::getBoolean)); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("isArchiveEnabled".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem - .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("policyName".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withPolicyName(reader.getString()); - } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem - .withSoftDeleteRetentionPeriodInDays(reader.getNullable(JsonReader::getInt)); - } else if ("vaultId".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withVaultId(reader.getString()); - } else if ("sourceSideScanInfo".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem - .withSourceSideScanInfo(SourceSideScanInfo.fromJson(reader)); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withFriendlyName(reader.getString()); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withServerName(reader.getString()); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withParentName(reader.getString()); - } else if ("parentType".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withParentType(reader.getString()); - } else if ("protectionStatus".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withProtectionStatus(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem - .withProtectionState(ProtectionState.fromString(reader.getString())); - } else if ("lastBackupStatus".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem - .withLastBackupStatus(LastBackupStatus.fromString(reader.getString())); - } else if ("lastBackupTime".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withLastBackupTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("lastBackupErrorDetail".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem - .withLastBackupErrorDetail(ErrorDetail.fromJson(reader)); - } else if ("protectedItemDataSourceId".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem - .withProtectedItemDataSourceId(reader.getString()); - } else if ("protectedItemHealthStatus".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem - .withProtectedItemHealthStatus(ProtectedItemHealthStatus.fromString(reader.getString())); - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem - .withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo.fromJson(reader)); - } else if ("kpisHealths".equals(fieldName)) { - Map kpisHealths - = reader.readMap(reader1 -> KpiResourceHealthDetails.fromJson(reader1)); - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withKpisHealths(kpisHealths); - } else if ("nodesList".equals(fieldName)) { - List nodesList - = reader.readArray(reader1 -> DistributedNodesInfo.fromJson(reader1)); - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.withNodesList(nodesList); - } else if ("protectedItemType".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseProtectedItem.protectedItemType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadSapAseDatabaseProtectedItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseWorkloadItem.java deleted file mode 100644 index 61a8bd5d4cc6..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseDatabaseWorkloadItem.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure VM workload-specific workload item representing SAP ASE Database. - */ -@Immutable -public final class AzureVmWorkloadSapAseDatabaseWorkloadItem extends AzureVmWorkloadItem { - /* - * Type of the backup item. - */ - private String workloadItemType = "SAPAseDatabase"; - - /** - * Creates an instance of AzureVmWorkloadSapAseDatabaseWorkloadItem class. - */ - private AzureVmWorkloadSapAseDatabaseWorkloadItem() { - } - - /** - * Get the workloadItemType property: Type of the backup item. - * - * @return the workloadItemType value. - */ - @Override - public String workloadItemType() { - return this.workloadItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("parentName", parentName()); - jsonWriter.writeStringField("serverName", serverName()); - jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable()); - jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount()); - jsonWriter.writeNumberField("subWorkloadItemCount", subWorkloadItemCount()); - jsonWriter.writeStringField("workloadItemType", this.workloadItemType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadSapAseDatabaseWorkloadItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadSapAseDatabaseWorkloadItem 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 AzureVmWorkloadSapAseDatabaseWorkloadItem. - */ - public static AzureVmWorkloadSapAseDatabaseWorkloadItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadSapAseDatabaseWorkloadItem deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem - = new AzureVmWorkloadSapAseDatabaseWorkloadItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem.withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem.withParentName(reader.getString()); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem.withServerName(reader.getString()); - } else if ("isAutoProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem - .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("subinquireditemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem - .withSubinquireditemcount(reader.getNullable(JsonReader::getInt)); - } else if ("subWorkloadItemCount".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem - .withSubWorkloadItemCount(reader.getNullable(JsonReader::getInt)); - } else if ("workloadItemType".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem.workloadItemType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadSapAseDatabaseWorkloadItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemProtectableItem.java deleted file mode 100644 index bbd5c09a3809..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemProtectableItem.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure VM workload-specific protectable item representing SAP ASE System. - */ -@Immutable -public final class AzureVmWorkloadSapAseSystemProtectableItem extends AzureVmWorkloadProtectableItem { - /* - * Type of the backup item. - */ - private String protectableItemType = "SAPAseSystem"; - - /** - * Creates an instance of AzureVmWorkloadSapAseSystemProtectableItem class. - */ - private AzureVmWorkloadSapAseSystemProtectableItem() { - } - - /** - * Get the protectableItemType property: Type of the backup item. - * - * @return the protectableItemType value. - */ - @Override - public String protectableItemType() { - return this.protectableItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("parentName", parentName()); - jsonWriter.writeStringField("parentUniqueName", parentUniqueName()); - jsonWriter.writeStringField("serverName", serverName()); - jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable()); - jsonWriter.writeBooleanField("isAutoProtected", isAutoProtected()); - jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount()); - jsonWriter.writeNumberField("subprotectableitemcount", subprotectableitemcount()); - jsonWriter.writeJsonField("prebackupvalidation", prebackupvalidation()); - jsonWriter.writeBooleanField("isProtectable", isProtectable()); - jsonWriter.writeStringField("protectableItemType", this.protectableItemType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadSapAseSystemProtectableItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadSapAseSystemProtectableItem 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 AzureVmWorkloadSapAseSystemProtectableItem. - */ - public static AzureVmWorkloadSapAseSystemProtectableItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadSapAseSystemProtectableItem deserializedAzureVmWorkloadSapAseSystemProtectableItem - = new AzureVmWorkloadSapAseSystemProtectableItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemProtectableItem.withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemProtectableItem.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemProtectableItem.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemProtectableItem - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemProtectableItem.withParentName(reader.getString()); - } else if ("parentUniqueName".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemProtectableItem.withParentUniqueName(reader.getString()); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemProtectableItem.withServerName(reader.getString()); - } else if ("isAutoProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemProtectableItem - .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("isAutoProtected".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemProtectableItem - .withIsAutoProtected(reader.getNullable(JsonReader::getBoolean)); - } else if ("subinquireditemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemProtectableItem - .withSubinquireditemcount(reader.getNullable(JsonReader::getInt)); - } else if ("subprotectableitemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemProtectableItem - .withSubprotectableitemcount(reader.getNullable(JsonReader::getInt)); - } else if ("prebackupvalidation".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemProtectableItem - .withPrebackupvalidation(PreBackupValidation.fromJson(reader)); - } else if ("isProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemProtectableItem - .withIsProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("protectableItemType".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemProtectableItem.protectableItemType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadSapAseSystemProtectableItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemWorkloadItem.java deleted file mode 100644 index 90f184e38f74..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapAseSystemWorkloadItem.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure VM workload-specific workload item representing SAP ASE System. - */ -@Immutable -public final class AzureVmWorkloadSapAseSystemWorkloadItem extends AzureVmWorkloadItem { - /* - * Type of the backup item. - */ - private String workloadItemType = "SAPAseSystem"; - - /** - * Creates an instance of AzureVmWorkloadSapAseSystemWorkloadItem class. - */ - private AzureVmWorkloadSapAseSystemWorkloadItem() { - } - - /** - * Get the workloadItemType property: Type of the backup item. - * - * @return the workloadItemType value. - */ - @Override - public String workloadItemType() { - return this.workloadItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("parentName", parentName()); - jsonWriter.writeStringField("serverName", serverName()); - jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable()); - jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount()); - jsonWriter.writeNumberField("subWorkloadItemCount", subWorkloadItemCount()); - jsonWriter.writeStringField("workloadItemType", this.workloadItemType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadSapAseSystemWorkloadItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadSapAseSystemWorkloadItem 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 AzureVmWorkloadSapAseSystemWorkloadItem. - */ - public static AzureVmWorkloadSapAseSystemWorkloadItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadSapAseSystemWorkloadItem deserializedAzureVmWorkloadSapAseSystemWorkloadItem - = new AzureVmWorkloadSapAseSystemWorkloadItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemWorkloadItem.withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemWorkloadItem.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemWorkloadItem.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemWorkloadItem - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemWorkloadItem.withParentName(reader.getString()); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemWorkloadItem.withServerName(reader.getString()); - } else if ("isAutoProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemWorkloadItem - .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("subinquireditemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemWorkloadItem - .withSubinquireditemcount(reader.getNullable(JsonReader::getInt)); - } else if ("subWorkloadItemCount".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemWorkloadItem - .withSubWorkloadItemCount(reader.getNullable(JsonReader::getInt)); - } else if ("workloadItemType".equals(fieldName)) { - deserializedAzureVmWorkloadSapAseSystemWorkloadItem.workloadItemType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadSapAseSystemWorkloadItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDBInstance.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDBInstance.java deleted file mode 100644 index 5a4cd752a8fd..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDBInstance.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure VM workload-specific protectable item representing SAP HANA Dbinstance. - */ -@Immutable -public final class AzureVmWorkloadSapHanaDBInstance extends AzureVmWorkloadProtectableItem { - /* - * Type of the backup item. - */ - private String protectableItemType = "SAPHanaDBInstance"; - - /** - * Creates an instance of AzureVmWorkloadSapHanaDBInstance class. - */ - private AzureVmWorkloadSapHanaDBInstance() { - } - - /** - * Get the protectableItemType property: Type of the backup item. - * - * @return the protectableItemType value. - */ - @Override - public String protectableItemType() { - return this.protectableItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("parentName", parentName()); - jsonWriter.writeStringField("parentUniqueName", parentUniqueName()); - jsonWriter.writeStringField("serverName", serverName()); - jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable()); - jsonWriter.writeBooleanField("isAutoProtected", isAutoProtected()); - jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount()); - jsonWriter.writeNumberField("subprotectableitemcount", subprotectableitemcount()); - jsonWriter.writeJsonField("prebackupvalidation", prebackupvalidation()); - jsonWriter.writeBooleanField("isProtectable", isProtectable()); - jsonWriter.writeStringField("protectableItemType", this.protectableItemType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadSapHanaDBInstance from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadSapHanaDBInstance 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 AzureVmWorkloadSapHanaDBInstance. - */ - public static AzureVmWorkloadSapHanaDBInstance fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadSapHanaDBInstance deserializedAzureVmWorkloadSapHanaDBInstance - = new AzureVmWorkloadSapHanaDBInstance(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstance.withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstance.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstance.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstance - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstance.withParentName(reader.getString()); - } else if ("parentUniqueName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstance.withParentUniqueName(reader.getString()); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstance.withServerName(reader.getString()); - } else if ("isAutoProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstance - .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("isAutoProtected".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstance - .withIsAutoProtected(reader.getNullable(JsonReader::getBoolean)); - } else if ("subinquireditemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstance - .withSubinquireditemcount(reader.getNullable(JsonReader::getInt)); - } else if ("subprotectableitemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstance - .withSubprotectableitemcount(reader.getNullable(JsonReader::getInt)); - } else if ("prebackupvalidation".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstance - .withPrebackupvalidation(PreBackupValidation.fromJson(reader)); - } else if ("isProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstance - .withIsProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("protectableItemType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstance.protectableItemType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadSapHanaDBInstance; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDBInstanceProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDBInstanceProtectedItem.java deleted file mode 100644 index 07115a373a9d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDBInstanceProtectedItem.java +++ /dev/null @@ -1,469 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * Azure VM workload-specific protected item representing SAP HANA DBInstance. - */ -@Fluent -public final class AzureVmWorkloadSapHanaDBInstanceProtectedItem extends AzureVmWorkloadProtectedItem { - /* - * backup item type. - */ - private String protectedItemType = "AzureVmWorkloadSAPHanaDBInstance"; - - /** - * Creates an instance of AzureVmWorkloadSapHanaDBInstanceProtectedItem class. - */ - public AzureVmWorkloadSapHanaDBInstanceProtectedItem() { - } - - /** - * Get the protectedItemType property: backup item type. - * - * @return the protectedItemType value. - */ - @Override - public String protectedItemType() { - return this.protectedItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem withServerName(String serverName) { - super.withServerName(serverName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem withParentName(String parentName) { - super.withParentName(parentName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem withParentType(String parentType) { - super.withParentType(parentType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem withProtectionState(ProtectionState protectionState) { - super.withProtectionState(protectionState); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem withLastBackupStatus(LastBackupStatus lastBackupStatus) { - super.withLastBackupStatus(lastBackupStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) { - super.withLastBackupTime(lastBackupTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem withLastBackupErrorDetail(ErrorDetail lastBackupErrorDetail) { - super.withLastBackupErrorDetail(lastBackupErrorDetail); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem - withProtectedItemDataSourceId(String protectedItemDataSourceId) { - super.withProtectedItemDataSourceId(protectedItemDataSourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem - withProtectedItemHealthStatus(ProtectedItemHealthStatus protectedItemHealthStatus) { - super.withProtectedItemHealthStatus(protectedItemHealthStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem - withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo extendedInfo) { - super.withExtendedInfo(extendedInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem - withKpisHealths(Map kpisHealths) { - super.withKpisHealths(kpisHealths); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem withNodesList(List nodesList) { - super.withNodesList(nodesList); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem withContainerName(String containerName) { - super.withContainerName(containerName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem withPolicyId(String policyId) { - super.withPolicyId(policyId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { - super.withLastRecoveryPoint(lastRecoveryPoint); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem withBackupSetName(String backupSetName) { - super.withBackupSetName(backupSetName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem - withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { - super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem - withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { - super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem - withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { - super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem - withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { - super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem withIsRehydrate(Boolean isRehydrate) { - super.withIsRehydrate(isRehydrate); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem withIsArchiveEnabled(Boolean isArchiveEnabled) { - super.withIsArchiveEnabled(isArchiveEnabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem withPolicyName(String policyName) { - super.withPolicyName(policyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem - withSoftDeleteRetentionPeriodInDays(Integer softDeleteRetentionPeriodInDays) { - super.withSoftDeleteRetentionPeriodInDays(softDeleteRetentionPeriodInDays); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDBInstanceProtectedItem withSourceSideScanInfo(SourceSideScanInfo sourceSideScanInfo) { - super.withSourceSideScanInfo(sourceSideScanInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("containerName", containerName()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("policyId", policyId()); - jsonWriter.writeStringField("lastRecoveryPoint", - lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint())); - jsonWriter.writeStringField("backupSetName", backupSetName()); - jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString()); - jsonWriter.writeStringField("deferredDeleteTimeInUTC", - deferredDeleteTimeInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc())); - jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete()); - jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining()); - jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming()); - jsonWriter.writeBooleanField("isRehydrate", isRehydrate()); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled()); - jsonWriter.writeStringField("policyName", policyName()); - jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriodInDays()); - jsonWriter.writeJsonField("sourceSideScanInfo", sourceSideScanInfo()); - jsonWriter.writeStringField("serverName", serverName()); - jsonWriter.writeStringField("parentName", parentName()); - jsonWriter.writeStringField("parentType", parentType()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("lastBackupStatus", - lastBackupStatus() == null ? null : lastBackupStatus().toString()); - jsonWriter.writeStringField("lastBackupTime", - lastBackupTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastBackupTime())); - jsonWriter.writeJsonField("lastBackupErrorDetail", lastBackupErrorDetail()); - jsonWriter.writeStringField("protectedItemDataSourceId", protectedItemDataSourceId()); - jsonWriter.writeStringField("protectedItemHealthStatus", - protectedItemHealthStatus() == null ? null : protectedItemHealthStatus().toString()); - jsonWriter.writeJsonField("extendedInfo", extendedInfo()); - jsonWriter.writeMapField("kpisHealths", kpisHealths(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("nodesList", nodesList(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("protectedItemType", this.protectedItemType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadSapHanaDBInstanceProtectedItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadSapHanaDBInstanceProtectedItem 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 AzureVmWorkloadSapHanaDBInstanceProtectedItem. - */ - public static AzureVmWorkloadSapHanaDBInstanceProtectedItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadSapHanaDBInstanceProtectedItem deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem - = new AzureVmWorkloadSapHanaDBInstanceProtectedItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem - .withWorkloadType(DataSourceType.fromString(reader.getString())); - } else if ("containerName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withContainerName(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withSourceResourceId(reader.getString()); - } else if ("policyId".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withPolicyId(reader.getString()); - } else if ("lastRecoveryPoint".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withLastRecoveryPoint(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("backupSetName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withBackupSetName(reader.getString()); - } else if ("createMode".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem - .withCreateMode(CreateMode.fromString(reader.getString())); - } else if ("deferredDeleteTimeInUTC".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withDeferredDeleteTimeInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("isScheduledForDeferredDelete".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem - .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean)); - } else if ("deferredDeleteTimeRemaining".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem - .withDeferredDeleteTimeRemaining(reader.getString()); - } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem - .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean)); - } else if ("isRehydrate".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem - .withIsRehydrate(reader.getNullable(JsonReader::getBoolean)); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("isArchiveEnabled".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem - .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("policyName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withPolicyName(reader.getString()); - } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem - .withSoftDeleteRetentionPeriodInDays(reader.getNullable(JsonReader::getInt)); - } else if ("vaultId".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withVaultId(reader.getString()); - } else if ("sourceSideScanInfo".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem - .withSourceSideScanInfo(SourceSideScanInfo.fromJson(reader)); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withFriendlyName(reader.getString()); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withServerName(reader.getString()); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withParentName(reader.getString()); - } else if ("parentType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withParentType(reader.getString()); - } else if ("protectionStatus".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withProtectionStatus(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem - .withProtectionState(ProtectionState.fromString(reader.getString())); - } else if ("lastBackupStatus".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem - .withLastBackupStatus(LastBackupStatus.fromString(reader.getString())); - } else if ("lastBackupTime".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withLastBackupTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("lastBackupErrorDetail".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem - .withLastBackupErrorDetail(ErrorDetail.fromJson(reader)); - } else if ("protectedItemDataSourceId".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem - .withProtectedItemDataSourceId(reader.getString()); - } else if ("protectedItemHealthStatus".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem - .withProtectedItemHealthStatus(ProtectedItemHealthStatus.fromString(reader.getString())); - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem - .withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo.fromJson(reader)); - } else if ("kpisHealths".equals(fieldName)) { - Map kpisHealths - = reader.readMap(reader1 -> KpiResourceHealthDetails.fromJson(reader1)); - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withKpisHealths(kpisHealths); - } else if ("nodesList".equals(fieldName)) { - List nodesList - = reader.readArray(reader1 -> DistributedNodesInfo.fromJson(reader1)); - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.withNodesList(nodesList); - } else if ("protectedItemType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem.protectedItemType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadSapHanaDBInstanceProtectedItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectableItem.java deleted file mode 100644 index cf8664717a1b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectableItem.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure VM workload-specific protectable item representing SAP HANA Database. - */ -@Immutable -public final class AzureVmWorkloadSapHanaDatabaseProtectableItem extends AzureVmWorkloadProtectableItem { - /* - * Type of the backup item. - */ - private String protectableItemType = "SAPHanaDatabase"; - - /** - * Creates an instance of AzureVmWorkloadSapHanaDatabaseProtectableItem class. - */ - private AzureVmWorkloadSapHanaDatabaseProtectableItem() { - } - - /** - * Get the protectableItemType property: Type of the backup item. - * - * @return the protectableItemType value. - */ - @Override - public String protectableItemType() { - return this.protectableItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("parentName", parentName()); - jsonWriter.writeStringField("parentUniqueName", parentUniqueName()); - jsonWriter.writeStringField("serverName", serverName()); - jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable()); - jsonWriter.writeBooleanField("isAutoProtected", isAutoProtected()); - jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount()); - jsonWriter.writeNumberField("subprotectableitemcount", subprotectableitemcount()); - jsonWriter.writeJsonField("prebackupvalidation", prebackupvalidation()); - jsonWriter.writeBooleanField("isProtectable", isProtectable()); - jsonWriter.writeStringField("protectableItemType", this.protectableItemType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadSapHanaDatabaseProtectableItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadSapHanaDatabaseProtectableItem 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 AzureVmWorkloadSapHanaDatabaseProtectableItem. - */ - public static AzureVmWorkloadSapHanaDatabaseProtectableItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadSapHanaDatabaseProtectableItem deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem - = new AzureVmWorkloadSapHanaDatabaseProtectableItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem - .withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem.withParentName(reader.getString()); - } else if ("parentUniqueName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem.withParentUniqueName(reader.getString()); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem.withServerName(reader.getString()); - } else if ("isAutoProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem - .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("isAutoProtected".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem - .withIsAutoProtected(reader.getNullable(JsonReader::getBoolean)); - } else if ("subinquireditemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem - .withSubinquireditemcount(reader.getNullable(JsonReader::getInt)); - } else if ("subprotectableitemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem - .withSubprotectableitemcount(reader.getNullable(JsonReader::getInt)); - } else if ("prebackupvalidation".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem - .withPrebackupvalidation(PreBackupValidation.fromJson(reader)); - } else if ("isProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem - .withIsProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("protectableItemType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem.protectableItemType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadSapHanaDatabaseProtectableItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectedItem.java deleted file mode 100644 index 9b351215daac..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseProtectedItem.java +++ /dev/null @@ -1,468 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * Azure VM workload-specific protected item representing SAP HANA Database. - */ -@Fluent -public final class AzureVmWorkloadSapHanaDatabaseProtectedItem extends AzureVmWorkloadProtectedItem { - /* - * backup item type. - */ - private String protectedItemType = "AzureVmWorkloadSAPHanaDatabase"; - - /** - * Creates an instance of AzureVmWorkloadSapHanaDatabaseProtectedItem class. - */ - public AzureVmWorkloadSapHanaDatabaseProtectedItem() { - } - - /** - * Get the protectedItemType property: backup item type. - * - * @return the protectedItemType value. - */ - @Override - public String protectedItemType() { - return this.protectedItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem withServerName(String serverName) { - super.withServerName(serverName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem withParentName(String parentName) { - super.withParentName(parentName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem withParentType(String parentType) { - super.withParentType(parentType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem withProtectionState(ProtectionState protectionState) { - super.withProtectionState(protectionState); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem withLastBackupStatus(LastBackupStatus lastBackupStatus) { - super.withLastBackupStatus(lastBackupStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) { - super.withLastBackupTime(lastBackupTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem withLastBackupErrorDetail(ErrorDetail lastBackupErrorDetail) { - super.withLastBackupErrorDetail(lastBackupErrorDetail); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem withProtectedItemDataSourceId(String protectedItemDataSourceId) { - super.withProtectedItemDataSourceId(protectedItemDataSourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem - withProtectedItemHealthStatus(ProtectedItemHealthStatus protectedItemHealthStatus) { - super.withProtectedItemHealthStatus(protectedItemHealthStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem - withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo extendedInfo) { - super.withExtendedInfo(extendedInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem - withKpisHealths(Map kpisHealths) { - super.withKpisHealths(kpisHealths); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem withNodesList(List nodesList) { - super.withNodesList(nodesList); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem withContainerName(String containerName) { - super.withContainerName(containerName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem withPolicyId(String policyId) { - super.withPolicyId(policyId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { - super.withLastRecoveryPoint(lastRecoveryPoint); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem withBackupSetName(String backupSetName) { - super.withBackupSetName(backupSetName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem - withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { - super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem - withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { - super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem - withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { - super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem - withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { - super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem withIsRehydrate(Boolean isRehydrate) { - super.withIsRehydrate(isRehydrate); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem withIsArchiveEnabled(Boolean isArchiveEnabled) { - super.withIsArchiveEnabled(isArchiveEnabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem withPolicyName(String policyName) { - super.withPolicyName(policyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem - withSoftDeleteRetentionPeriodInDays(Integer softDeleteRetentionPeriodInDays) { - super.withSoftDeleteRetentionPeriodInDays(softDeleteRetentionPeriodInDays); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSapHanaDatabaseProtectedItem withSourceSideScanInfo(SourceSideScanInfo sourceSideScanInfo) { - super.withSourceSideScanInfo(sourceSideScanInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("containerName", containerName()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("policyId", policyId()); - jsonWriter.writeStringField("lastRecoveryPoint", - lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint())); - jsonWriter.writeStringField("backupSetName", backupSetName()); - jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString()); - jsonWriter.writeStringField("deferredDeleteTimeInUTC", - deferredDeleteTimeInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc())); - jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete()); - jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining()); - jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming()); - jsonWriter.writeBooleanField("isRehydrate", isRehydrate()); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled()); - jsonWriter.writeStringField("policyName", policyName()); - jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriodInDays()); - jsonWriter.writeJsonField("sourceSideScanInfo", sourceSideScanInfo()); - jsonWriter.writeStringField("serverName", serverName()); - jsonWriter.writeStringField("parentName", parentName()); - jsonWriter.writeStringField("parentType", parentType()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("lastBackupStatus", - lastBackupStatus() == null ? null : lastBackupStatus().toString()); - jsonWriter.writeStringField("lastBackupTime", - lastBackupTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastBackupTime())); - jsonWriter.writeJsonField("lastBackupErrorDetail", lastBackupErrorDetail()); - jsonWriter.writeStringField("protectedItemDataSourceId", protectedItemDataSourceId()); - jsonWriter.writeStringField("protectedItemHealthStatus", - protectedItemHealthStatus() == null ? null : protectedItemHealthStatus().toString()); - jsonWriter.writeJsonField("extendedInfo", extendedInfo()); - jsonWriter.writeMapField("kpisHealths", kpisHealths(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("nodesList", nodesList(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("protectedItemType", this.protectedItemType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadSapHanaDatabaseProtectedItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadSapHanaDatabaseProtectedItem 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 AzureVmWorkloadSapHanaDatabaseProtectedItem. - */ - public static AzureVmWorkloadSapHanaDatabaseProtectedItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadSapHanaDatabaseProtectedItem deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem - = new AzureVmWorkloadSapHanaDatabaseProtectedItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem - .withWorkloadType(DataSourceType.fromString(reader.getString())); - } else if ("containerName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withContainerName(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withSourceResourceId(reader.getString()); - } else if ("policyId".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withPolicyId(reader.getString()); - } else if ("lastRecoveryPoint".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withLastRecoveryPoint(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("backupSetName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withBackupSetName(reader.getString()); - } else if ("createMode".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem - .withCreateMode(CreateMode.fromString(reader.getString())); - } else if ("deferredDeleteTimeInUTC".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withDeferredDeleteTimeInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("isScheduledForDeferredDelete".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem - .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean)); - } else if ("deferredDeleteTimeRemaining".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem - .withDeferredDeleteTimeRemaining(reader.getString()); - } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem - .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean)); - } else if ("isRehydrate".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem - .withIsRehydrate(reader.getNullable(JsonReader::getBoolean)); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("isArchiveEnabled".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem - .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("policyName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withPolicyName(reader.getString()); - } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem - .withSoftDeleteRetentionPeriodInDays(reader.getNullable(JsonReader::getInt)); - } else if ("vaultId".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withVaultId(reader.getString()); - } else if ("sourceSideScanInfo".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem - .withSourceSideScanInfo(SourceSideScanInfo.fromJson(reader)); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withFriendlyName(reader.getString()); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withServerName(reader.getString()); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withParentName(reader.getString()); - } else if ("parentType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withParentType(reader.getString()); - } else if ("protectionStatus".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withProtectionStatus(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem - .withProtectionState(ProtectionState.fromString(reader.getString())); - } else if ("lastBackupStatus".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem - .withLastBackupStatus(LastBackupStatus.fromString(reader.getString())); - } else if ("lastBackupTime".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withLastBackupTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("lastBackupErrorDetail".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem - .withLastBackupErrorDetail(ErrorDetail.fromJson(reader)); - } else if ("protectedItemDataSourceId".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem - .withProtectedItemDataSourceId(reader.getString()); - } else if ("protectedItemHealthStatus".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem - .withProtectedItemHealthStatus(ProtectedItemHealthStatus.fromString(reader.getString())); - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem - .withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo.fromJson(reader)); - } else if ("kpisHealths".equals(fieldName)) { - Map kpisHealths - = reader.readMap(reader1 -> KpiResourceHealthDetails.fromJson(reader1)); - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withKpisHealths(kpisHealths); - } else if ("nodesList".equals(fieldName)) { - List nodesList - = reader.readArray(reader1 -> DistributedNodesInfo.fromJson(reader1)); - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.withNodesList(nodesList); - } else if ("protectedItemType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem.protectedItemType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadSapHanaDatabaseProtectedItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseWorkloadItem.java deleted file mode 100644 index 19dc0a570f1e..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaDatabaseWorkloadItem.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure VM workload-specific workload item representing SAP HANA Database. - */ -@Immutable -public final class AzureVmWorkloadSapHanaDatabaseWorkloadItem extends AzureVmWorkloadItem { - /* - * Type of the backup item. - */ - private String workloadItemType = "SAPHanaDatabase"; - - /** - * Creates an instance of AzureVmWorkloadSapHanaDatabaseWorkloadItem class. - */ - private AzureVmWorkloadSapHanaDatabaseWorkloadItem() { - } - - /** - * Get the workloadItemType property: Type of the backup item. - * - * @return the workloadItemType value. - */ - @Override - public String workloadItemType() { - return this.workloadItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("parentName", parentName()); - jsonWriter.writeStringField("serverName", serverName()); - jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable()); - jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount()); - jsonWriter.writeNumberField("subWorkloadItemCount", subWorkloadItemCount()); - jsonWriter.writeStringField("workloadItemType", this.workloadItemType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadSapHanaDatabaseWorkloadItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadSapHanaDatabaseWorkloadItem 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 AzureVmWorkloadSapHanaDatabaseWorkloadItem. - */ - public static AzureVmWorkloadSapHanaDatabaseWorkloadItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadSapHanaDatabaseWorkloadItem deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem - = new AzureVmWorkloadSapHanaDatabaseWorkloadItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem.withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem.withParentName(reader.getString()); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem.withServerName(reader.getString()); - } else if ("isAutoProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem - .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("subinquireditemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem - .withSubinquireditemcount(reader.getNullable(JsonReader::getInt)); - } else if ("subWorkloadItemCount".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem - .withSubWorkloadItemCount(reader.getNullable(JsonReader::getInt)); - } else if ("workloadItemType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem.workloadItemType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadSapHanaDatabaseWorkloadItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaHsr.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaHsr.java deleted file mode 100644 index 5961374d5bff..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaHsr.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure VM workload-specific protectable item representing HANA HSR. - */ -@Immutable -public final class AzureVmWorkloadSapHanaHsr extends AzureVmWorkloadProtectableItem { - /* - * Type of the backup item. - */ - private String protectableItemType = "HanaHSRContainer"; - - /** - * Creates an instance of AzureVmWorkloadSapHanaHsr class. - */ - private AzureVmWorkloadSapHanaHsr() { - } - - /** - * Get the protectableItemType property: Type of the backup item. - * - * @return the protectableItemType value. - */ - @Override - public String protectableItemType() { - return this.protectableItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("parentName", parentName()); - jsonWriter.writeStringField("parentUniqueName", parentUniqueName()); - jsonWriter.writeStringField("serverName", serverName()); - jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable()); - jsonWriter.writeBooleanField("isAutoProtected", isAutoProtected()); - jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount()); - jsonWriter.writeNumberField("subprotectableitemcount", subprotectableitemcount()); - jsonWriter.writeJsonField("prebackupvalidation", prebackupvalidation()); - jsonWriter.writeBooleanField("isProtectable", isProtectable()); - jsonWriter.writeStringField("protectableItemType", this.protectableItemType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadSapHanaHsr from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadSapHanaHsr 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 AzureVmWorkloadSapHanaHsr. - */ - public static AzureVmWorkloadSapHanaHsr fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadSapHanaHsr deserializedAzureVmWorkloadSapHanaHsr = new AzureVmWorkloadSapHanaHsr(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaHsr.withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaHsr.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaHsr.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaHsr - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaHsr.withParentName(reader.getString()); - } else if ("parentUniqueName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaHsr.withParentUniqueName(reader.getString()); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaHsr.withServerName(reader.getString()); - } else if ("isAutoProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaHsr - .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("isAutoProtected".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaHsr - .withIsAutoProtected(reader.getNullable(JsonReader::getBoolean)); - } else if ("subinquireditemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaHsr - .withSubinquireditemcount(reader.getNullable(JsonReader::getInt)); - } else if ("subprotectableitemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaHsr - .withSubprotectableitemcount(reader.getNullable(JsonReader::getInt)); - } else if ("prebackupvalidation".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaHsr.withPrebackupvalidation(PreBackupValidation.fromJson(reader)); - } else if ("isProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaHsr.withIsProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("protectableItemType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaHsr.protectableItemType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadSapHanaHsr; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemProtectableItem.java deleted file mode 100644 index 0cdba4a0d199..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemProtectableItem.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure VM workload-specific protectable item representing SAP HANA System. - */ -@Immutable -public final class AzureVmWorkloadSapHanaSystemProtectableItem extends AzureVmWorkloadProtectableItem { - /* - * Type of the backup item. - */ - private String protectableItemType = "SAPHanaSystem"; - - /** - * Creates an instance of AzureVmWorkloadSapHanaSystemProtectableItem class. - */ - private AzureVmWorkloadSapHanaSystemProtectableItem() { - } - - /** - * Get the protectableItemType property: Type of the backup item. - * - * @return the protectableItemType value. - */ - @Override - public String protectableItemType() { - return this.protectableItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("parentName", parentName()); - jsonWriter.writeStringField("parentUniqueName", parentUniqueName()); - jsonWriter.writeStringField("serverName", serverName()); - jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable()); - jsonWriter.writeBooleanField("isAutoProtected", isAutoProtected()); - jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount()); - jsonWriter.writeNumberField("subprotectableitemcount", subprotectableitemcount()); - jsonWriter.writeJsonField("prebackupvalidation", prebackupvalidation()); - jsonWriter.writeBooleanField("isProtectable", isProtectable()); - jsonWriter.writeStringField("protectableItemType", this.protectableItemType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadSapHanaSystemProtectableItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadSapHanaSystemProtectableItem 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 AzureVmWorkloadSapHanaSystemProtectableItem. - */ - public static AzureVmWorkloadSapHanaSystemProtectableItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadSapHanaSystemProtectableItem deserializedAzureVmWorkloadSapHanaSystemProtectableItem - = new AzureVmWorkloadSapHanaSystemProtectableItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemProtectableItem - .withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemProtectableItem.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemProtectableItem.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemProtectableItem - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemProtectableItem.withParentName(reader.getString()); - } else if ("parentUniqueName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemProtectableItem.withParentUniqueName(reader.getString()); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemProtectableItem.withServerName(reader.getString()); - } else if ("isAutoProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemProtectableItem - .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("isAutoProtected".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemProtectableItem - .withIsAutoProtected(reader.getNullable(JsonReader::getBoolean)); - } else if ("subinquireditemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemProtectableItem - .withSubinquireditemcount(reader.getNullable(JsonReader::getInt)); - } else if ("subprotectableitemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemProtectableItem - .withSubprotectableitemcount(reader.getNullable(JsonReader::getInt)); - } else if ("prebackupvalidation".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemProtectableItem - .withPrebackupvalidation(PreBackupValidation.fromJson(reader)); - } else if ("isProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemProtectableItem - .withIsProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("protectableItemType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemProtectableItem.protectableItemType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadSapHanaSystemProtectableItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemWorkloadItem.java deleted file mode 100644 index 5a5f641e9ea4..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSapHanaSystemWorkloadItem.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure VM workload-specific workload item representing SAP HANA System. - */ -@Immutable -public final class AzureVmWorkloadSapHanaSystemWorkloadItem extends AzureVmWorkloadItem { - /* - * Type of the backup item. - */ - private String workloadItemType = "SAPHanaSystem"; - - /** - * Creates an instance of AzureVmWorkloadSapHanaSystemWorkloadItem class. - */ - private AzureVmWorkloadSapHanaSystemWorkloadItem() { - } - - /** - * Get the workloadItemType property: Type of the backup item. - * - * @return the workloadItemType value. - */ - @Override - public String workloadItemType() { - return this.workloadItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("parentName", parentName()); - jsonWriter.writeStringField("serverName", serverName()); - jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable()); - jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount()); - jsonWriter.writeNumberField("subWorkloadItemCount", subWorkloadItemCount()); - jsonWriter.writeStringField("workloadItemType", this.workloadItemType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadSapHanaSystemWorkloadItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadSapHanaSystemWorkloadItem 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 AzureVmWorkloadSapHanaSystemWorkloadItem. - */ - public static AzureVmWorkloadSapHanaSystemWorkloadItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadSapHanaSystemWorkloadItem deserializedAzureVmWorkloadSapHanaSystemWorkloadItem - = new AzureVmWorkloadSapHanaSystemWorkloadItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemWorkloadItem.withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemWorkloadItem.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemWorkloadItem.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemWorkloadItem - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemWorkloadItem.withParentName(reader.getString()); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemWorkloadItem.withServerName(reader.getString()); - } else if ("isAutoProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemWorkloadItem - .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("subinquireditemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemWorkloadItem - .withSubinquireditemcount(reader.getNullable(JsonReader::getInt)); - } else if ("subWorkloadItemCount".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemWorkloadItem - .withSubWorkloadItemCount(reader.getNullable(JsonReader::getInt)); - } else if ("workloadItemType".equals(fieldName)) { - deserializedAzureVmWorkloadSapHanaSystemWorkloadItem.workloadItemType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadSapHanaSystemWorkloadItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlAvailabilityGroupProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlAvailabilityGroupProtectableItem.java deleted file mode 100644 index 9908ae2af55d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlAvailabilityGroupProtectableItem.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Azure VM workload-specific protectable item representing SQL Availability Group. - */ -@Immutable -public final class AzureVmWorkloadSqlAvailabilityGroupProtectableItem extends AzureVmWorkloadProtectableItem { - /* - * Type of the backup item. - */ - private String protectableItemType = "SQLAvailabilityGroupContainer"; - - /* - * List of the nodes in case of distributed container. - */ - private List nodesList; - - /** - * Creates an instance of AzureVmWorkloadSqlAvailabilityGroupProtectableItem class. - */ - private AzureVmWorkloadSqlAvailabilityGroupProtectableItem() { - } - - /** - * Get the protectableItemType property: Type of the backup item. - * - * @return the protectableItemType value. - */ - @Override - public String protectableItemType() { - return this.protectableItemType; - } - - /** - * Get the nodesList property: List of the nodes in case of distributed container. - * - * @return the nodesList value. - */ - public List nodesList() { - return this.nodesList; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("parentName", parentName()); - jsonWriter.writeStringField("parentUniqueName", parentUniqueName()); - jsonWriter.writeStringField("serverName", serverName()); - jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable()); - jsonWriter.writeBooleanField("isAutoProtected", isAutoProtected()); - jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount()); - jsonWriter.writeNumberField("subprotectableitemcount", subprotectableitemcount()); - jsonWriter.writeJsonField("prebackupvalidation", prebackupvalidation()); - jsonWriter.writeBooleanField("isProtectable", isProtectable()); - jsonWriter.writeStringField("protectableItemType", this.protectableItemType); - jsonWriter.writeArrayField("nodesList", this.nodesList, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadSqlAvailabilityGroupProtectableItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadSqlAvailabilityGroupProtectableItem 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 AzureVmWorkloadSqlAvailabilityGroupProtectableItem. - */ - public static AzureVmWorkloadSqlAvailabilityGroupProtectableItem fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadSqlAvailabilityGroupProtectableItem deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem - = new AzureVmWorkloadSqlAvailabilityGroupProtectableItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem - .withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem.withParentName(reader.getString()); - } else if ("parentUniqueName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem - .withParentUniqueName(reader.getString()); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem.withServerName(reader.getString()); - } else if ("isAutoProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem - .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("isAutoProtected".equals(fieldName)) { - deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem - .withIsAutoProtected(reader.getNullable(JsonReader::getBoolean)); - } else if ("subinquireditemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem - .withSubinquireditemcount(reader.getNullable(JsonReader::getInt)); - } else if ("subprotectableitemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem - .withSubprotectableitemcount(reader.getNullable(JsonReader::getInt)); - } else if ("prebackupvalidation".equals(fieldName)) { - deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem - .withPrebackupvalidation(PreBackupValidation.fromJson(reader)); - } else if ("isProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem - .withIsProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("protectableItemType".equals(fieldName)) { - deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem.protectableItemType - = reader.getString(); - } else if ("nodesList".equals(fieldName)) { - List nodesList - = reader.readArray(reader1 -> DistributedNodesInfo.fromJson(reader1)); - deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem.nodesList = nodesList; - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadSqlAvailabilityGroupProtectableItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectableItem.java deleted file mode 100644 index ede63831386d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectableItem.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure VM workload-specific protectable item representing SQL Database. - */ -@Immutable -public final class AzureVmWorkloadSqlDatabaseProtectableItem extends AzureVmWorkloadProtectableItem { - /* - * Type of the backup item. - */ - private String protectableItemType = "SQLDataBase"; - - /** - * Creates an instance of AzureVmWorkloadSqlDatabaseProtectableItem class. - */ - private AzureVmWorkloadSqlDatabaseProtectableItem() { - } - - /** - * Get the protectableItemType property: Type of the backup item. - * - * @return the protectableItemType value. - */ - @Override - public String protectableItemType() { - return this.protectableItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("parentName", parentName()); - jsonWriter.writeStringField("parentUniqueName", parentUniqueName()); - jsonWriter.writeStringField("serverName", serverName()); - jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable()); - jsonWriter.writeBooleanField("isAutoProtected", isAutoProtected()); - jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount()); - jsonWriter.writeNumberField("subprotectableitemcount", subprotectableitemcount()); - jsonWriter.writeJsonField("prebackupvalidation", prebackupvalidation()); - jsonWriter.writeBooleanField("isProtectable", isProtectable()); - jsonWriter.writeStringField("protectableItemType", this.protectableItemType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadSqlDatabaseProtectableItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadSqlDatabaseProtectableItem 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 AzureVmWorkloadSqlDatabaseProtectableItem. - */ - public static AzureVmWorkloadSqlDatabaseProtectableItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadSqlDatabaseProtectableItem deserializedAzureVmWorkloadSqlDatabaseProtectableItem - = new AzureVmWorkloadSqlDatabaseProtectableItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectableItem.withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectableItem.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectableItem.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectableItem - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectableItem.withParentName(reader.getString()); - } else if ("parentUniqueName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectableItem.withParentUniqueName(reader.getString()); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectableItem.withServerName(reader.getString()); - } else if ("isAutoProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectableItem - .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("isAutoProtected".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectableItem - .withIsAutoProtected(reader.getNullable(JsonReader::getBoolean)); - } else if ("subinquireditemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectableItem - .withSubinquireditemcount(reader.getNullable(JsonReader::getInt)); - } else if ("subprotectableitemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectableItem - .withSubprotectableitemcount(reader.getNullable(JsonReader::getInt)); - } else if ("prebackupvalidation".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectableItem - .withPrebackupvalidation(PreBackupValidation.fromJson(reader)); - } else if ("isProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectableItem - .withIsProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("protectableItemType".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectableItem.protectableItemType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadSqlDatabaseProtectableItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectedItem.java deleted file mode 100644 index 85f9e6290398..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseProtectedItem.java +++ /dev/null @@ -1,525 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * Azure VM workload-specific protected item representing SQL Database. - */ -@Fluent -public final class AzureVmWorkloadSqlDatabaseProtectedItem extends AzureVmWorkloadProtectedItem { - /* - * backup item type. - */ - private String protectedItemType = "AzureVmWorkloadSQLDatabase"; - - /* - * Name of the parent protected item (e.g., SQL Instance name) when this database is protected as part of a parent. - */ - private String parentProtectedItem; - - /* - * Protection type in case protected as part of a parent. - */ - private ProtectionLevel protectionLevel; - - /** - * Creates an instance of AzureVmWorkloadSqlDatabaseProtectedItem class. - */ - public AzureVmWorkloadSqlDatabaseProtectedItem() { - } - - /** - * Get the protectedItemType property: backup item type. - * - * @return the protectedItemType value. - */ - @Override - public String protectedItemType() { - return this.protectedItemType; - } - - /** - * Get the parentProtectedItem property: Name of the parent protected item (e.g., SQL Instance name) when this - * database is protected as part of a parent. - * - * @return the parentProtectedItem value. - */ - public String parentProtectedItem() { - return this.parentProtectedItem; - } - - /** - * Set the parentProtectedItem property: Name of the parent protected item (e.g., SQL Instance name) when this - * database is protected as part of a parent. - * - * @param parentProtectedItem the parentProtectedItem value to set. - * @return the AzureVmWorkloadSqlDatabaseProtectedItem object itself. - */ - public AzureVmWorkloadSqlDatabaseProtectedItem withParentProtectedItem(String parentProtectedItem) { - this.parentProtectedItem = parentProtectedItem; - return this; - } - - /** - * Get the protectionLevel property: Protection type in case protected as part of a parent. - * - * @return the protectionLevel value. - */ - public ProtectionLevel protectionLevel() { - return this.protectionLevel; - } - - /** - * Set the protectionLevel property: Protection type in case protected as part of a parent. - * - * @param protectionLevel the protectionLevel value to set. - * @return the AzureVmWorkloadSqlDatabaseProtectedItem object itself. - */ - public AzureVmWorkloadSqlDatabaseProtectedItem withProtectionLevel(ProtectionLevel protectionLevel) { - this.protectionLevel = protectionLevel; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withServerName(String serverName) { - super.withServerName(serverName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withParentName(String parentName) { - super.withParentName(parentName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withParentType(String parentType) { - super.withParentType(parentType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withProtectionState(ProtectionState protectionState) { - super.withProtectionState(protectionState); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withLastBackupStatus(LastBackupStatus lastBackupStatus) { - super.withLastBackupStatus(lastBackupStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) { - super.withLastBackupTime(lastBackupTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withLastBackupErrorDetail(ErrorDetail lastBackupErrorDetail) { - super.withLastBackupErrorDetail(lastBackupErrorDetail); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withProtectedItemDataSourceId(String protectedItemDataSourceId) { - super.withProtectedItemDataSourceId(protectedItemDataSourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem - withProtectedItemHealthStatus(ProtectedItemHealthStatus protectedItemHealthStatus) { - super.withProtectedItemHealthStatus(protectedItemHealthStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem - withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo extendedInfo) { - super.withExtendedInfo(extendedInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withKpisHealths(Map kpisHealths) { - super.withKpisHealths(kpisHealths); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withNodesList(List nodesList) { - super.withNodesList(nodesList); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withContainerName(String containerName) { - super.withContainerName(containerName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withPolicyId(String policyId) { - super.withPolicyId(policyId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { - super.withLastRecoveryPoint(lastRecoveryPoint); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withBackupSetName(String backupSetName) { - super.withBackupSetName(backupSetName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { - super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem - withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { - super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { - super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem - withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { - super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withIsRehydrate(Boolean isRehydrate) { - super.withIsRehydrate(isRehydrate); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withIsArchiveEnabled(Boolean isArchiveEnabled) { - super.withIsArchiveEnabled(isArchiveEnabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withPolicyName(String policyName) { - super.withPolicyName(policyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem - withSoftDeleteRetentionPeriodInDays(Integer softDeleteRetentionPeriodInDays) { - super.withSoftDeleteRetentionPeriodInDays(softDeleteRetentionPeriodInDays); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureVmWorkloadSqlDatabaseProtectedItem withSourceSideScanInfo(SourceSideScanInfo sourceSideScanInfo) { - super.withSourceSideScanInfo(sourceSideScanInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("containerName", containerName()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("policyId", policyId()); - jsonWriter.writeStringField("lastRecoveryPoint", - lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint())); - jsonWriter.writeStringField("backupSetName", backupSetName()); - jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString()); - jsonWriter.writeStringField("deferredDeleteTimeInUTC", - deferredDeleteTimeInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc())); - jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete()); - jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining()); - jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming()); - jsonWriter.writeBooleanField("isRehydrate", isRehydrate()); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled()); - jsonWriter.writeStringField("policyName", policyName()); - jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriodInDays()); - jsonWriter.writeJsonField("sourceSideScanInfo", sourceSideScanInfo()); - jsonWriter.writeStringField("serverName", serverName()); - jsonWriter.writeStringField("parentName", parentName()); - jsonWriter.writeStringField("parentType", parentType()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("lastBackupStatus", - lastBackupStatus() == null ? null : lastBackupStatus().toString()); - jsonWriter.writeStringField("lastBackupTime", - lastBackupTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastBackupTime())); - jsonWriter.writeJsonField("lastBackupErrorDetail", lastBackupErrorDetail()); - jsonWriter.writeStringField("protectedItemDataSourceId", protectedItemDataSourceId()); - jsonWriter.writeStringField("protectedItemHealthStatus", - protectedItemHealthStatus() == null ? null : protectedItemHealthStatus().toString()); - jsonWriter.writeJsonField("extendedInfo", extendedInfo()); - jsonWriter.writeMapField("kpisHealths", kpisHealths(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("nodesList", nodesList(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("protectedItemType", this.protectedItemType); - jsonWriter.writeStringField("parentProtectedItem", this.parentProtectedItem); - jsonWriter.writeStringField("protectionLevel", - this.protectionLevel == null ? null : this.protectionLevel.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadSqlDatabaseProtectedItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadSqlDatabaseProtectedItem 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 AzureVmWorkloadSqlDatabaseProtectedItem. - */ - public static AzureVmWorkloadSqlDatabaseProtectedItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadSqlDatabaseProtectedItem deserializedAzureVmWorkloadSqlDatabaseProtectedItem - = new AzureVmWorkloadSqlDatabaseProtectedItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem - .withWorkloadType(DataSourceType.fromString(reader.getString())); - } else if ("containerName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withContainerName(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withSourceResourceId(reader.getString()); - } else if ("policyId".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withPolicyId(reader.getString()); - } else if ("lastRecoveryPoint".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withLastRecoveryPoint(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("backupSetName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withBackupSetName(reader.getString()); - } else if ("createMode".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem - .withCreateMode(CreateMode.fromString(reader.getString())); - } else if ("deferredDeleteTimeInUTC".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withDeferredDeleteTimeInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("isScheduledForDeferredDelete".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem - .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean)); - } else if ("deferredDeleteTimeRemaining".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem - .withDeferredDeleteTimeRemaining(reader.getString()); - } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem - .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean)); - } else if ("isRehydrate".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem - .withIsRehydrate(reader.getNullable(JsonReader::getBoolean)); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureVmWorkloadSqlDatabaseProtectedItem - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("isArchiveEnabled".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem - .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("policyName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withPolicyName(reader.getString()); - } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem - .withSoftDeleteRetentionPeriodInDays(reader.getNullable(JsonReader::getInt)); - } else if ("vaultId".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withVaultId(reader.getString()); - } else if ("sourceSideScanInfo".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem - .withSourceSideScanInfo(SourceSideScanInfo.fromJson(reader)); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withFriendlyName(reader.getString()); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withServerName(reader.getString()); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withParentName(reader.getString()); - } else if ("parentType".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withParentType(reader.getString()); - } else if ("protectionStatus".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withProtectionStatus(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem - .withProtectionState(ProtectionState.fromString(reader.getString())); - } else if ("lastBackupStatus".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem - .withLastBackupStatus(LastBackupStatus.fromString(reader.getString())); - } else if ("lastBackupTime".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withLastBackupTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("lastBackupErrorDetail".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem - .withLastBackupErrorDetail(ErrorDetail.fromJson(reader)); - } else if ("protectedItemDataSourceId".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem - .withProtectedItemDataSourceId(reader.getString()); - } else if ("protectedItemHealthStatus".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem - .withProtectedItemHealthStatus(ProtectedItemHealthStatus.fromString(reader.getString())); - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem - .withExtendedInfo(AzureVmWorkloadProtectedItemExtendedInfo.fromJson(reader)); - } else if ("kpisHealths".equals(fieldName)) { - Map kpisHealths - = reader.readMap(reader1 -> KpiResourceHealthDetails.fromJson(reader1)); - deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withKpisHealths(kpisHealths); - } else if ("nodesList".equals(fieldName)) { - List nodesList - = reader.readArray(reader1 -> DistributedNodesInfo.fromJson(reader1)); - deserializedAzureVmWorkloadSqlDatabaseProtectedItem.withNodesList(nodesList); - } else if ("protectedItemType".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem.protectedItemType = reader.getString(); - } else if ("parentProtectedItem".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem.parentProtectedItem = reader.getString(); - } else if ("protectionLevel".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseProtectedItem.protectionLevel - = ProtectionLevel.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadSqlDatabaseProtectedItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseWorkloadItem.java deleted file mode 100644 index 38b2409b1e17..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlDatabaseWorkloadItem.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure VM workload-specific workload item representing SQL Database. - */ -@Immutable -public final class AzureVmWorkloadSqlDatabaseWorkloadItem extends AzureVmWorkloadItem { - /* - * Type of the backup item. - */ - private String workloadItemType = "SQLDataBase"; - - /** - * Creates an instance of AzureVmWorkloadSqlDatabaseWorkloadItem class. - */ - private AzureVmWorkloadSqlDatabaseWorkloadItem() { - } - - /** - * Get the workloadItemType property: Type of the backup item. - * - * @return the workloadItemType value. - */ - @Override - public String workloadItemType() { - return this.workloadItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("parentName", parentName()); - jsonWriter.writeStringField("serverName", serverName()); - jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable()); - jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount()); - jsonWriter.writeNumberField("subWorkloadItemCount", subWorkloadItemCount()); - jsonWriter.writeStringField("workloadItemType", this.workloadItemType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadSqlDatabaseWorkloadItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadSqlDatabaseWorkloadItem 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 AzureVmWorkloadSqlDatabaseWorkloadItem. - */ - public static AzureVmWorkloadSqlDatabaseWorkloadItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadSqlDatabaseWorkloadItem deserializedAzureVmWorkloadSqlDatabaseWorkloadItem - = new AzureVmWorkloadSqlDatabaseWorkloadItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseWorkloadItem.withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseWorkloadItem.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseWorkloadItem.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseWorkloadItem - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseWorkloadItem.withParentName(reader.getString()); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseWorkloadItem.withServerName(reader.getString()); - } else if ("isAutoProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseWorkloadItem - .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("subinquireditemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseWorkloadItem - .withSubinquireditemcount(reader.getNullable(JsonReader::getInt)); - } else if ("subWorkloadItemCount".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseWorkloadItem - .withSubWorkloadItemCount(reader.getNullable(JsonReader::getInt)); - } else if ("workloadItemType".equals(fieldName)) { - deserializedAzureVmWorkloadSqlDatabaseWorkloadItem.workloadItemType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadSqlDatabaseWorkloadItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceProtectableItem.java deleted file mode 100644 index ebde9670d096..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceProtectableItem.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure VM workload-specific protectable item representing SQL Instance. - */ -@Immutable -public final class AzureVmWorkloadSqlInstanceProtectableItem extends AzureVmWorkloadProtectableItem { - /* - * Type of the backup item. - */ - private String protectableItemType = "SQLInstance"; - - /** - * Creates an instance of AzureVmWorkloadSqlInstanceProtectableItem class. - */ - private AzureVmWorkloadSqlInstanceProtectableItem() { - } - - /** - * Get the protectableItemType property: Type of the backup item. - * - * @return the protectableItemType value. - */ - @Override - public String protectableItemType() { - return this.protectableItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("parentName", parentName()); - jsonWriter.writeStringField("parentUniqueName", parentUniqueName()); - jsonWriter.writeStringField("serverName", serverName()); - jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable()); - jsonWriter.writeBooleanField("isAutoProtected", isAutoProtected()); - jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount()); - jsonWriter.writeNumberField("subprotectableitemcount", subprotectableitemcount()); - jsonWriter.writeJsonField("prebackupvalidation", prebackupvalidation()); - jsonWriter.writeBooleanField("isProtectable", isProtectable()); - jsonWriter.writeStringField("protectableItemType", this.protectableItemType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadSqlInstanceProtectableItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadSqlInstanceProtectableItem 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 AzureVmWorkloadSqlInstanceProtectableItem. - */ - public static AzureVmWorkloadSqlInstanceProtectableItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadSqlInstanceProtectableItem deserializedAzureVmWorkloadSqlInstanceProtectableItem - = new AzureVmWorkloadSqlInstanceProtectableItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceProtectableItem.withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceProtectableItem.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceProtectableItem.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceProtectableItem - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceProtectableItem.withParentName(reader.getString()); - } else if ("parentUniqueName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceProtectableItem.withParentUniqueName(reader.getString()); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceProtectableItem.withServerName(reader.getString()); - } else if ("isAutoProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceProtectableItem - .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("isAutoProtected".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceProtectableItem - .withIsAutoProtected(reader.getNullable(JsonReader::getBoolean)); - } else if ("subinquireditemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceProtectableItem - .withSubinquireditemcount(reader.getNullable(JsonReader::getInt)); - } else if ("subprotectableitemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceProtectableItem - .withSubprotectableitemcount(reader.getNullable(JsonReader::getInt)); - } else if ("prebackupvalidation".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceProtectableItem - .withPrebackupvalidation(PreBackupValidation.fromJson(reader)); - } else if ("isProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceProtectableItem - .withIsProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("protectableItemType".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceProtectableItem.protectableItemType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadSqlInstanceProtectableItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceWorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceWorkloadItem.java deleted file mode 100644 index 706f7b612ac3..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureVmWorkloadSqlInstanceWorkloadItem.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Azure VM workload-specific workload item representing SQL Instance. - */ -@Immutable -public final class AzureVmWorkloadSqlInstanceWorkloadItem extends AzureVmWorkloadItem { - /* - * Type of the backup item. - */ - private String workloadItemType = "SQLInstance"; - - /* - * Data Directory Paths for default directories - */ - private List dataDirectoryPaths; - - /** - * Creates an instance of AzureVmWorkloadSqlInstanceWorkloadItem class. - */ - private AzureVmWorkloadSqlInstanceWorkloadItem() { - } - - /** - * Get the workloadItemType property: Type of the backup item. - * - * @return the workloadItemType value. - */ - @Override - public String workloadItemType() { - return this.workloadItemType; - } - - /** - * Get the dataDirectoryPaths property: Data Directory Paths for default directories. - * - * @return the dataDirectoryPaths value. - */ - public List dataDirectoryPaths() { - return this.dataDirectoryPaths; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("parentName", parentName()); - jsonWriter.writeStringField("serverName", serverName()); - jsonWriter.writeBooleanField("isAutoProtectable", isAutoProtectable()); - jsonWriter.writeNumberField("subinquireditemcount", subinquireditemcount()); - jsonWriter.writeNumberField("subWorkloadItemCount", subWorkloadItemCount()); - jsonWriter.writeStringField("workloadItemType", this.workloadItemType); - jsonWriter.writeArrayField("dataDirectoryPaths", this.dataDirectoryPaths, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureVmWorkloadSqlInstanceWorkloadItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureVmWorkloadSqlInstanceWorkloadItem 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 AzureVmWorkloadSqlInstanceWorkloadItem. - */ - public static AzureVmWorkloadSqlInstanceWorkloadItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureVmWorkloadSqlInstanceWorkloadItem deserializedAzureVmWorkloadSqlInstanceWorkloadItem - = new AzureVmWorkloadSqlInstanceWorkloadItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceWorkloadItem.withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceWorkloadItem.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceWorkloadItem.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceWorkloadItem - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("parentName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceWorkloadItem.withParentName(reader.getString()); - } else if ("serverName".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceWorkloadItem.withServerName(reader.getString()); - } else if ("isAutoProtectable".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceWorkloadItem - .withIsAutoProtectable(reader.getNullable(JsonReader::getBoolean)); - } else if ("subinquireditemcount".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceWorkloadItem - .withSubinquireditemcount(reader.getNullable(JsonReader::getInt)); - } else if ("subWorkloadItemCount".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceWorkloadItem - .withSubWorkloadItemCount(reader.getNullable(JsonReader::getInt)); - } else if ("workloadItemType".equals(fieldName)) { - deserializedAzureVmWorkloadSqlInstanceWorkloadItem.workloadItemType = reader.getString(); - } else if ("dataDirectoryPaths".equals(fieldName)) { - List dataDirectoryPaths - = reader.readArray(reader1 -> SqlDataDirectory.fromJson(reader1)); - deserializedAzureVmWorkloadSqlInstanceWorkloadItem.dataDirectoryPaths = dataDirectoryPaths; - } else { - reader.skipChildren(); - } - } - - return deserializedAzureVmWorkloadSqlInstanceWorkloadItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAutoProtectionIntent.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAutoProtectionIntent.java deleted file mode 100644 index 312f441f7857..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadAutoProtectionIntent.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure Recovery Services Vault specific protection intent item. - */ -@Fluent -public class AzureWorkloadAutoProtectionIntent extends AzureRecoveryServiceVaultProtectionIntent { - /* - * backup protectionIntent type. - */ - private ProtectionIntentItemType protectionIntentItemType - = ProtectionIntentItemType.AZURE_WORKLOAD_AUTO_PROTECTION_INTENT; - - /** - * Creates an instance of AzureWorkloadAutoProtectionIntent class. - */ - public AzureWorkloadAutoProtectionIntent() { - } - - /** - * Get the protectionIntentItemType property: backup protectionIntent type. - * - * @return the protectionIntentItemType value. - */ - @Override - public ProtectionIntentItemType protectionIntentItemType() { - return this.protectionIntentItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadAutoProtectionIntent withBackupManagementType(BackupManagementType backupManagementType) { - super.withBackupManagementType(backupManagementType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadAutoProtectionIntent withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadAutoProtectionIntent withItemId(String itemId) { - super.withItemId(itemId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadAutoProtectionIntent withPolicyId(String policyId) { - super.withPolicyId(policyId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadAutoProtectionIntent withProtectionState(ProtectionStatus protectionState) { - super.withProtectionState(protectionState); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("itemId", itemId()); - jsonWriter.writeStringField("policyId", policyId()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("protectionIntentItemType", - this.protectionIntentItemType == null ? null : this.protectionIntentItemType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadAutoProtectionIntent from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadAutoProtectionIntent 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 AzureWorkloadAutoProtectionIntent. - */ - public static AzureWorkloadAutoProtectionIntent fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("protectionIntentItemType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureWorkloadSQLAutoProtectionIntent".equals(discriminatorValue)) { - return AzureWorkloadSqlAutoProtectionIntent.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AzureWorkloadAutoProtectionIntent fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadAutoProtectionIntent deserializedAzureWorkloadAutoProtectionIntent - = new AzureWorkloadAutoProtectionIntent(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureWorkloadAutoProtectionIntent - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureWorkloadAutoProtectionIntent.withSourceResourceId(reader.getString()); - } else if ("itemId".equals(fieldName)) { - deserializedAzureWorkloadAutoProtectionIntent.withItemId(reader.getString()); - } else if ("policyId".equals(fieldName)) { - deserializedAzureWorkloadAutoProtectionIntent.withPolicyId(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureWorkloadAutoProtectionIntent - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("protectionIntentItemType".equals(fieldName)) { - deserializedAzureWorkloadAutoProtectionIntent.protectionIntentItemType - = ProtectionIntentItemType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadAutoProtectionIntent; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadBackupRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadBackupRequest.java deleted file mode 100644 index ba9d4e38b737..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadBackupRequest.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * AzureWorkload workload-specific backup request. - */ -@Fluent -public final class AzureWorkloadBackupRequest extends BackupRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureWorkloadBackupRequest"; - - /* - * Type of backup, viz. Full, Differential, Log or CopyOnlyFull - */ - private BackupType backupType; - - /* - * Bool for Compression setting - */ - private Boolean enableCompression; - - /* - * Backup copy will expire after the time specified (UTC). - */ - private OffsetDateTime recoveryPointExpiryTimeInUtc; - - /** - * Creates an instance of AzureWorkloadBackupRequest class. - */ - public AzureWorkloadBackupRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the backupType property: Type of backup, viz. Full, Differential, Log or CopyOnlyFull. - * - * @return the backupType value. - */ - public BackupType backupType() { - return this.backupType; - } - - /** - * Set the backupType property: Type of backup, viz. Full, Differential, Log or CopyOnlyFull. - * - * @param backupType the backupType value to set. - * @return the AzureWorkloadBackupRequest object itself. - */ - public AzureWorkloadBackupRequest withBackupType(BackupType backupType) { - this.backupType = backupType; - return this; - } - - /** - * Get the enableCompression property: Bool for Compression setting. - * - * @return the enableCompression value. - */ - public Boolean enableCompression() { - return this.enableCompression; - } - - /** - * Set the enableCompression property: Bool for Compression setting. - * - * @param enableCompression the enableCompression value to set. - * @return the AzureWorkloadBackupRequest object itself. - */ - public AzureWorkloadBackupRequest withEnableCompression(Boolean enableCompression) { - this.enableCompression = enableCompression; - return this; - } - - /** - * Get the recoveryPointExpiryTimeInUtc property: Backup copy will expire after the time specified (UTC). - * - * @return the recoveryPointExpiryTimeInUtc value. - */ - public OffsetDateTime recoveryPointExpiryTimeInUtc() { - return this.recoveryPointExpiryTimeInUtc; - } - - /** - * Set the recoveryPointExpiryTimeInUtc property: Backup copy will expire after the time specified (UTC). - * - * @param recoveryPointExpiryTimeInUtc the recoveryPointExpiryTimeInUtc value to set. - * @return the AzureWorkloadBackupRequest object itself. - */ - public AzureWorkloadBackupRequest withRecoveryPointExpiryTimeInUtc(OffsetDateTime recoveryPointExpiryTimeInUtc) { - this.recoveryPointExpiryTimeInUtc = recoveryPointExpiryTimeInUtc; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("backupType", this.backupType == null ? null : this.backupType.toString()); - jsonWriter.writeBooleanField("enableCompression", this.enableCompression); - jsonWriter.writeStringField("recoveryPointExpiryTimeInUTC", - this.recoveryPointExpiryTimeInUtc == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.recoveryPointExpiryTimeInUtc)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadBackupRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadBackupRequest 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 AzureWorkloadBackupRequest. - */ - public static AzureWorkloadBackupRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadBackupRequest deserializedAzureWorkloadBackupRequest = new AzureWorkloadBackupRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedAzureWorkloadBackupRequest.objectType = reader.getString(); - } else if ("backupType".equals(fieldName)) { - deserializedAzureWorkloadBackupRequest.backupType = BackupType.fromString(reader.getString()); - } else if ("enableCompression".equals(fieldName)) { - deserializedAzureWorkloadBackupRequest.enableCompression - = reader.getNullable(JsonReader::getBoolean); - } else if ("recoveryPointExpiryTimeInUTC".equals(fieldName)) { - deserializedAzureWorkloadBackupRequest.recoveryPointExpiryTimeInUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadBackupRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainer.java deleted file mode 100644 index 0f8cb771fa9f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainer.java +++ /dev/null @@ -1,318 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Container for the workloads running inside Azure Compute or Classic Compute. - */ -@Fluent -public class AzureWorkloadContainer extends ProtectionContainer { - /* - * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines - * 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer - */ - private ProtectableContainerType containerType = ProtectableContainerType.AZURE_WORKLOAD_CONTAINER; - - /* - * ARM ID of the virtual machine represented by this Azure Workload Container - */ - private String sourceResourceId; - - /* - * Time stamp when this container was updated. - */ - private OffsetDateTime lastUpdatedTime; - - /* - * Additional details of a workload container. - */ - private AzureWorkloadContainerExtendedInfo extendedInfo; - - /* - * Workload type for which registration was sent. - */ - private WorkloadType workloadType; - - /* - * Re-Do Operation - */ - private OperationType operationType; - - /** - * Creates an instance of AzureWorkloadContainer class. - */ - public AzureWorkloadContainer() { - } - - /** - * Get the containerType property: Type of the container. The value of this property for: 1. Compute Azure VM is - * Microsoft.Compute/virtualMachines 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer. - * - * @return the containerType value. - */ - @Override - public ProtectableContainerType containerType() { - return this.containerType; - } - - /** - * Get the sourceResourceId property: ARM ID of the virtual machine represented by this Azure Workload Container. - * - * @return the sourceResourceId value. - */ - public String sourceResourceId() { - return this.sourceResourceId; - } - - /** - * Set the sourceResourceId property: ARM ID of the virtual machine represented by this Azure Workload Container. - * - * @param sourceResourceId the sourceResourceId value to set. - * @return the AzureWorkloadContainer object itself. - */ - public AzureWorkloadContainer withSourceResourceId(String sourceResourceId) { - this.sourceResourceId = sourceResourceId; - return this; - } - - /** - * Get the lastUpdatedTime property: Time stamp when this container was updated. - * - * @return the lastUpdatedTime value. - */ - public OffsetDateTime lastUpdatedTime() { - return this.lastUpdatedTime; - } - - /** - * Set the lastUpdatedTime property: Time stamp when this container was updated. - * - * @param lastUpdatedTime the lastUpdatedTime value to set. - * @return the AzureWorkloadContainer object itself. - */ - public AzureWorkloadContainer withLastUpdatedTime(OffsetDateTime lastUpdatedTime) { - this.lastUpdatedTime = lastUpdatedTime; - return this; - } - - /** - * Get the extendedInfo property: Additional details of a workload container. - * - * @return the extendedInfo value. - */ - public AzureWorkloadContainerExtendedInfo extendedInfo() { - return this.extendedInfo; - } - - /** - * Set the extendedInfo property: Additional details of a workload container. - * - * @param extendedInfo the extendedInfo value to set. - * @return the AzureWorkloadContainer object itself. - */ - public AzureWorkloadContainer withExtendedInfo(AzureWorkloadContainerExtendedInfo extendedInfo) { - this.extendedInfo = extendedInfo; - return this; - } - - /** - * Get the workloadType property: Workload type for which registration was sent. - * - * @return the workloadType value. - */ - public WorkloadType workloadType() { - return this.workloadType; - } - - /** - * Set the workloadType property: Workload type for which registration was sent. - * - * @param workloadType the workloadType value to set. - * @return the AzureWorkloadContainer object itself. - */ - public AzureWorkloadContainer withWorkloadType(WorkloadType workloadType) { - this.workloadType = workloadType; - return this; - } - - /** - * Get the operationType property: Re-Do Operation. - * - * @return the operationType value. - */ - public OperationType operationType() { - return this.operationType; - } - - /** - * Set the operationType property: Re-Do Operation. - * - * @param operationType the operationType value to set. - * @return the AzureWorkloadContainer object itself. - */ - public AzureWorkloadContainer withOperationType(OperationType operationType) { - this.operationType = operationType; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadContainer withFriendlyName(String friendlyName) { - super.withFriendlyName(friendlyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadContainer withBackupManagementType(BackupManagementType backupManagementType) { - super.withBackupManagementType(backupManagementType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadContainer withRegistrationStatus(String registrationStatus) { - super.withRegistrationStatus(registrationStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadContainer withHealthStatus(String healthStatus) { - super.withHealthStatus(healthStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadContainer withProtectableObjectType(String protectableObjectType) { - super.withProtectableObjectType(protectableObjectType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("registrationStatus", registrationStatus()); - jsonWriter.writeStringField("healthStatus", healthStatus()); - jsonWriter.writeStringField("protectableObjectType", protectableObjectType()); - jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString()); - jsonWriter.writeStringField("sourceResourceId", this.sourceResourceId); - jsonWriter.writeStringField("lastUpdatedTime", - this.lastUpdatedTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedTime)); - jsonWriter.writeJsonField("extendedInfo", this.extendedInfo); - jsonWriter.writeStringField("workloadType", this.workloadType == null ? null : this.workloadType.toString()); - jsonWriter.writeStringField("operationType", this.operationType == null ? null : this.operationType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadContainer from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadContainer 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 AzureWorkloadContainer. - */ - public static AzureWorkloadContainer fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("containerType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("VMAppContainer".equals(discriminatorValue)) { - return AzureVMAppContainerProtectionContainer.fromJson(readerToUse.reset()); - } else if ("SQLAGWorkLoadContainer".equals(discriminatorValue)) { - return AzureSqlagWorkloadContainerProtectionContainer.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AzureWorkloadContainer fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadContainer deserializedAzureWorkloadContainer = new AzureWorkloadContainer(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("friendlyName".equals(fieldName)) { - deserializedAzureWorkloadContainer.withFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedAzureWorkloadContainer - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("registrationStatus".equals(fieldName)) { - deserializedAzureWorkloadContainer.withRegistrationStatus(reader.getString()); - } else if ("healthStatus".equals(fieldName)) { - deserializedAzureWorkloadContainer.withHealthStatus(reader.getString()); - } else if ("protectableObjectType".equals(fieldName)) { - deserializedAzureWorkloadContainer.withProtectableObjectType(reader.getString()); - } else if ("containerType".equals(fieldName)) { - deserializedAzureWorkloadContainer.containerType - = ProtectableContainerType.fromString(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureWorkloadContainer.sourceResourceId = reader.getString(); - } else if ("lastUpdatedTime".equals(fieldName)) { - deserializedAzureWorkloadContainer.lastUpdatedTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureWorkloadContainer.extendedInfo - = AzureWorkloadContainerExtendedInfo.fromJson(reader); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureWorkloadContainer.workloadType = WorkloadType.fromString(reader.getString()); - } else if ("operationType".equals(fieldName)) { - deserializedAzureWorkloadContainer.operationType = OperationType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadContainer; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainerAutoProtectionIntent.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainerAutoProtectionIntent.java deleted file mode 100644 index 7886ed2c0874..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainerAutoProtectionIntent.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure workload specific protection intent item. - */ -@Fluent -public final class AzureWorkloadContainerAutoProtectionIntent extends ProtectionIntent { - /* - * backup protectionIntent type. - */ - private ProtectionIntentItemType protectionIntentItemType - = ProtectionIntentItemType.AZURE_WORKLOAD_CONTAINER_AUTO_PROTECTION_INTENT; - - /** - * Creates an instance of AzureWorkloadContainerAutoProtectionIntent class. - */ - public AzureWorkloadContainerAutoProtectionIntent() { - } - - /** - * Get the protectionIntentItemType property: backup protectionIntent type. - * - * @return the protectionIntentItemType value. - */ - @Override - public ProtectionIntentItemType protectionIntentItemType() { - return this.protectionIntentItemType; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadContainerAutoProtectionIntent - withBackupManagementType(BackupManagementType backupManagementType) { - super.withBackupManagementType(backupManagementType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadContainerAutoProtectionIntent withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadContainerAutoProtectionIntent withItemId(String itemId) { - super.withItemId(itemId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadContainerAutoProtectionIntent withPolicyId(String policyId) { - super.withPolicyId(policyId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadContainerAutoProtectionIntent withProtectionState(ProtectionStatus protectionState) { - super.withProtectionState(protectionState); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("itemId", itemId()); - jsonWriter.writeStringField("policyId", policyId()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("protectionIntentItemType", - this.protectionIntentItemType == null ? null : this.protectionIntentItemType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadContainerAutoProtectionIntent from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadContainerAutoProtectionIntent 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 AzureWorkloadContainerAutoProtectionIntent. - */ - public static AzureWorkloadContainerAutoProtectionIntent fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadContainerAutoProtectionIntent deserializedAzureWorkloadContainerAutoProtectionIntent - = new AzureWorkloadContainerAutoProtectionIntent(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureWorkloadContainerAutoProtectionIntent - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureWorkloadContainerAutoProtectionIntent.withSourceResourceId(reader.getString()); - } else if ("itemId".equals(fieldName)) { - deserializedAzureWorkloadContainerAutoProtectionIntent.withItemId(reader.getString()); - } else if ("policyId".equals(fieldName)) { - deserializedAzureWorkloadContainerAutoProtectionIntent.withPolicyId(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureWorkloadContainerAutoProtectionIntent - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("protectionIntentItemType".equals(fieldName)) { - deserializedAzureWorkloadContainerAutoProtectionIntent.protectionIntentItemType - = ProtectionIntentItemType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadContainerAutoProtectionIntent; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainerExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainerExtendedInfo.java deleted file mode 100644 index 5636e2d1a1f0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadContainerExtendedInfo.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Extended information of the container. - */ -@Fluent -public final class AzureWorkloadContainerExtendedInfo implements JsonSerializable { - /* - * Host Os Name in case of Stand Alone and Cluster Name in case of distributed container. - */ - private String hostServerName; - - /* - * Inquiry Status for the container. - */ - private InquiryInfo inquiryInfo; - - /* - * List of the nodes in case of distributed container. - */ - private List nodesList; - - /** - * Creates an instance of AzureWorkloadContainerExtendedInfo class. - */ - public AzureWorkloadContainerExtendedInfo() { - } - - /** - * Get the hostServerName property: Host Os Name in case of Stand Alone and Cluster Name in case of distributed - * container. - * - * @return the hostServerName value. - */ - public String hostServerName() { - return this.hostServerName; - } - - /** - * Set the hostServerName property: Host Os Name in case of Stand Alone and Cluster Name in case of distributed - * container. - * - * @param hostServerName the hostServerName value to set. - * @return the AzureWorkloadContainerExtendedInfo object itself. - */ - public AzureWorkloadContainerExtendedInfo withHostServerName(String hostServerName) { - this.hostServerName = hostServerName; - return this; - } - - /** - * Get the inquiryInfo property: Inquiry Status for the container. - * - * @return the inquiryInfo value. - */ - public InquiryInfo inquiryInfo() { - return this.inquiryInfo; - } - - /** - * Set the inquiryInfo property: Inquiry Status for the container. - * - * @param inquiryInfo the inquiryInfo value to set. - * @return the AzureWorkloadContainerExtendedInfo object itself. - */ - public AzureWorkloadContainerExtendedInfo withInquiryInfo(InquiryInfo inquiryInfo) { - this.inquiryInfo = inquiryInfo; - return this; - } - - /** - * Get the nodesList property: List of the nodes in case of distributed container. - * - * @return the nodesList value. - */ - public List nodesList() { - return this.nodesList; - } - - /** - * Set the nodesList property: List of the nodes in case of distributed container. - * - * @param nodesList the nodesList value to set. - * @return the AzureWorkloadContainerExtendedInfo object itself. - */ - public AzureWorkloadContainerExtendedInfo withNodesList(List nodesList) { - this.nodesList = nodesList; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("hostServerName", this.hostServerName); - jsonWriter.writeJsonField("inquiryInfo", this.inquiryInfo); - jsonWriter.writeArrayField("nodesList", this.nodesList, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadContainerExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadContainerExtendedInfo 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 AzureWorkloadContainerExtendedInfo. - */ - public static AzureWorkloadContainerExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadContainerExtendedInfo deserializedAzureWorkloadContainerExtendedInfo - = new AzureWorkloadContainerExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("hostServerName".equals(fieldName)) { - deserializedAzureWorkloadContainerExtendedInfo.hostServerName = reader.getString(); - } else if ("inquiryInfo".equals(fieldName)) { - deserializedAzureWorkloadContainerExtendedInfo.inquiryInfo = InquiryInfo.fromJson(reader); - } else if ("nodesList".equals(fieldName)) { - List nodesList - = reader.readArray(reader1 -> DistributedNodesInfo.fromJson(reader1)); - deserializedAzureWorkloadContainerExtendedInfo.nodesList = nodesList; - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadContainerExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadErrorInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadErrorInfo.java deleted file mode 100644 index f3699bbb39e6..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadErrorInfo.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Azure storage specific error information. - */ -@Immutable -public final class AzureWorkloadErrorInfo implements JsonSerializable { - /* - * Error code. - */ - private Integer errorCode; - - /* - * Localized error string. - */ - private String errorString; - - /* - * Title: Typically, the entity that the error pertains to. - */ - private String errorTitle; - - /* - * List of localized recommendations for above error code. - */ - private List recommendations; - - /* - * Additional details for above error code. - */ - private String additionalDetails; - - /** - * Creates an instance of AzureWorkloadErrorInfo class. - */ - private AzureWorkloadErrorInfo() { - } - - /** - * Get the errorCode property: Error code. - * - * @return the errorCode value. - */ - public Integer errorCode() { - return this.errorCode; - } - - /** - * Get the errorString property: Localized error string. - * - * @return the errorString value. - */ - public String errorString() { - return this.errorString; - } - - /** - * Get the errorTitle property: Title: Typically, the entity that the error pertains to. - * - * @return the errorTitle value. - */ - public String errorTitle() { - return this.errorTitle; - } - - /** - * Get the recommendations property: List of localized recommendations for above error code. - * - * @return the recommendations value. - */ - public List recommendations() { - return this.recommendations; - } - - /** - * Get the additionalDetails property: Additional details for above error code. - * - * @return the additionalDetails value. - */ - public String additionalDetails() { - return this.additionalDetails; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("errorCode", this.errorCode); - jsonWriter.writeStringField("errorString", this.errorString); - jsonWriter.writeStringField("errorTitle", this.errorTitle); - jsonWriter.writeArrayField("recommendations", this.recommendations, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("additionalDetails", this.additionalDetails); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadErrorInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadErrorInfo 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 AzureWorkloadErrorInfo. - */ - public static AzureWorkloadErrorInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadErrorInfo deserializedAzureWorkloadErrorInfo = new AzureWorkloadErrorInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("errorCode".equals(fieldName)) { - deserializedAzureWorkloadErrorInfo.errorCode = reader.getNullable(JsonReader::getInt); - } else if ("errorString".equals(fieldName)) { - deserializedAzureWorkloadErrorInfo.errorString = reader.getString(); - } else if ("errorTitle".equals(fieldName)) { - deserializedAzureWorkloadErrorInfo.errorTitle = reader.getString(); - } else if ("recommendations".equals(fieldName)) { - List recommendations = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureWorkloadErrorInfo.recommendations = recommendations; - } else if ("additionalDetails".equals(fieldName)) { - deserializedAzureWorkloadErrorInfo.additionalDetails = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadErrorInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJob.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJob.java deleted file mode 100644 index b26472678809..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJob.java +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.Duration; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Azure storage specific job. - */ -@Immutable -public final class AzureWorkloadJob extends Job { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String jobType = "AzureWorkloadJob"; - - /* - * Workload type of the job - */ - private String workloadType; - - /* - * Time elapsed during the execution of this job. - */ - private Duration duration; - - /* - * Gets or sets the state/actions applicable on this job like cancel/retry. - */ - private List actionsInfo; - - /* - * Error details on execution of this job. - */ - private List errorDetails; - - /* - * Additional information about the job. - */ - private AzureWorkloadJobExtendedInfo extendedInfo; - - /** - * Creates an instance of AzureWorkloadJob class. - */ - private AzureWorkloadJob() { - } - - /** - * Get the jobType property: This property will be used as the discriminator for deciding the specific types in the - * polymorphic chain of types. - * - * @return the jobType value. - */ - @Override - public String jobType() { - return this.jobType; - } - - /** - * Get the workloadType property: Workload type of the job. - * - * @return the workloadType value. - */ - public String workloadType() { - return this.workloadType; - } - - /** - * Get the duration property: Time elapsed during the execution of this job. - * - * @return the duration value. - */ - public Duration duration() { - return this.duration; - } - - /** - * Get the actionsInfo property: Gets or sets the state/actions applicable on this job like cancel/retry. - * - * @return the actionsInfo value. - */ - public List actionsInfo() { - return this.actionsInfo; - } - - /** - * Get the errorDetails property: Error details on execution of this job. - * - * @return the errorDetails value. - */ - public List errorDetails() { - return this.errorDetails; - } - - /** - * Get the extendedInfo property: Additional information about the job. - * - * @return the extendedInfo value. - */ - public AzureWorkloadJobExtendedInfo extendedInfo() { - return this.extendedInfo; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("entityFriendlyName", entityFriendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("operation", operation()); - jsonWriter.writeStringField("status", status()); - jsonWriter.writeStringField("startTime", - startTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(startTime())); - jsonWriter.writeStringField("endTime", - endTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(endTime())); - jsonWriter.writeStringField("activityId", activityId()); - jsonWriter.writeStringField("jobType", this.jobType); - jsonWriter.writeStringField("workloadType", this.workloadType); - jsonWriter.writeStringField("duration", CoreUtils.durationToStringWithDays(this.duration)); - jsonWriter.writeArrayField("actionsInfo", this.actionsInfo, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("errorDetails", this.errorDetails, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("extendedInfo", this.extendedInfo); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadJob from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadJob 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 AzureWorkloadJob. - */ - public static AzureWorkloadJob fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadJob deserializedAzureWorkloadJob = new AzureWorkloadJob(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("entityFriendlyName".equals(fieldName)) { - deserializedAzureWorkloadJob.withEntityFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedAzureWorkloadJob - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("operation".equals(fieldName)) { - deserializedAzureWorkloadJob.withOperation(reader.getString()); - } else if ("status".equals(fieldName)) { - deserializedAzureWorkloadJob.withStatus(reader.getString()); - } else if ("startTime".equals(fieldName)) { - deserializedAzureWorkloadJob.withStartTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("endTime".equals(fieldName)) { - deserializedAzureWorkloadJob.withEndTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("activityId".equals(fieldName)) { - deserializedAzureWorkloadJob.withActivityId(reader.getString()); - } else if ("jobType".equals(fieldName)) { - deserializedAzureWorkloadJob.jobType = reader.getString(); - } else if ("workloadType".equals(fieldName)) { - deserializedAzureWorkloadJob.workloadType = reader.getString(); - } else if ("duration".equals(fieldName)) { - deserializedAzureWorkloadJob.duration - = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); - } else if ("actionsInfo".equals(fieldName)) { - List actionsInfo - = reader.readArray(reader1 -> JobSupportedAction.fromString(reader1.getString())); - deserializedAzureWorkloadJob.actionsInfo = actionsInfo; - } else if ("errorDetails".equals(fieldName)) { - List errorDetails - = reader.readArray(reader1 -> AzureWorkloadErrorInfo.fromJson(reader1)); - deserializedAzureWorkloadJob.errorDetails = errorDetails; - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureWorkloadJob.extendedInfo = AzureWorkloadJobExtendedInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadJob; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobExtendedInfo.java deleted file mode 100644 index d2b876579f02..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobExtendedInfo.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; -import java.util.Map; - -/** - * Azure VM workload-specific additional information for job. - */ -@Immutable -public final class AzureWorkloadJobExtendedInfo implements JsonSerializable { - /* - * List of tasks for this job - */ - private List tasksList; - - /* - * Job properties. - */ - private Map propertyBag; - - /* - * Non localized error message on job execution. - */ - private String dynamicErrorMessage; - - /** - * Creates an instance of AzureWorkloadJobExtendedInfo class. - */ - private AzureWorkloadJobExtendedInfo() { - } - - /** - * Get the tasksList property: List of tasks for this job. - * - * @return the tasksList value. - */ - public List tasksList() { - return this.tasksList; - } - - /** - * Get the propertyBag property: Job properties. - * - * @return the propertyBag value. - */ - public Map propertyBag() { - return this.propertyBag; - } - - /** - * Get the dynamicErrorMessage property: Non localized error message on job execution. - * - * @return the dynamicErrorMessage value. - */ - public String dynamicErrorMessage() { - return this.dynamicErrorMessage; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("tasksList", this.tasksList, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeMapField("propertyBag", this.propertyBag, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("dynamicErrorMessage", this.dynamicErrorMessage); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadJobExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadJobExtendedInfo 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 AzureWorkloadJobExtendedInfo. - */ - public static AzureWorkloadJobExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadJobExtendedInfo deserializedAzureWorkloadJobExtendedInfo = new AzureWorkloadJobExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("tasksList".equals(fieldName)) { - List tasksList - = reader.readArray(reader1 -> AzureWorkloadJobTaskDetails.fromJson(reader1)); - deserializedAzureWorkloadJobExtendedInfo.tasksList = tasksList; - } else if ("propertyBag".equals(fieldName)) { - Map propertyBag = reader.readMap(reader1 -> reader1.getString()); - deserializedAzureWorkloadJobExtendedInfo.propertyBag = propertyBag; - } else if ("dynamicErrorMessage".equals(fieldName)) { - deserializedAzureWorkloadJobExtendedInfo.dynamicErrorMessage = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadJobExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobTaskDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobTaskDetails.java deleted file mode 100644 index 483bbdc982c0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadJobTaskDetails.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Azure VM workload specific job task details. - */ -@Immutable -public final class AzureWorkloadJobTaskDetails implements JsonSerializable { - /* - * The task display name. - */ - private String taskId; - - /* - * The status. - */ - private String status; - - /** - * Creates an instance of AzureWorkloadJobTaskDetails class. - */ - private AzureWorkloadJobTaskDetails() { - } - - /** - * Get the taskId property: The task display name. - * - * @return the taskId value. - */ - public String taskId() { - return this.taskId; - } - - /** - * Get the status property: The status. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskId", this.taskId); - jsonWriter.writeStringField("status", this.status); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadJobTaskDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadJobTaskDetails 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 AzureWorkloadJobTaskDetails. - */ - public static AzureWorkloadJobTaskDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadJobTaskDetails deserializedAzureWorkloadJobTaskDetails = new AzureWorkloadJobTaskDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("taskId".equals(fieldName)) { - deserializedAzureWorkloadJobTaskDetails.taskId = reader.getString(); - } else if ("status".equals(fieldName)) { - deserializedAzureWorkloadJobTaskDetails.status = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadJobTaskDetails; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRecoveryPoint.java deleted file mode 100644 index 6582e0d3117e..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRecoveryPoint.java +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * Recovery point specific to PointInTime. - */ -@Immutable -public class AzureWorkloadPointInTimeRecoveryPoint extends AzureWorkloadRecoveryPoint { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureWorkloadPointInTimeRecoveryPoint"; - - /* - * List of log ranges - */ - private List timeRanges; - - /** - * Creates an instance of AzureWorkloadPointInTimeRecoveryPoint class. - */ - protected AzureWorkloadPointInTimeRecoveryPoint() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the timeRanges property: List of log ranges. - * - * @return the timeRanges value. - */ - public List timeRanges() { - return this.timeRanges; - } - - /** - * Set the timeRanges property: List of log ranges. - * - * @param timeRanges the timeRanges value to set. - * @return the AzureWorkloadPointInTimeRecoveryPoint object itself. - */ - AzureWorkloadPointInTimeRecoveryPoint withTimeRanges(List timeRanges) { - this.timeRanges = timeRanges; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("threatStatus", threatStatus() == null ? null : threatStatus().toString()); - jsonWriter.writeArrayField("threatInfo", threatInfo(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("recoveryPointTimeInUTC", - recoveryPointTimeInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(recoveryPointTimeInUtc())); - jsonWriter.writeStringField("type", type() == null ? null : type().toString()); - jsonWriter.writeArrayField("recoveryPointTierDetails", recoveryPointTierDetails(), - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeMapField("recoveryPointMoveReadinessInfo", recoveryPointMoveReadinessInfo(), - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("recoveryPointProperties", recoveryPointProperties()); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeArrayField("timeRanges", this.timeRanges, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadPointInTimeRecoveryPoint from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadPointInTimeRecoveryPoint 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 AzureWorkloadPointInTimeRecoveryPoint. - */ - public static AzureWorkloadPointInTimeRecoveryPoint fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureWorkloadSAPHanaPointInTimeRecoveryPoint".equals(discriminatorValue)) { - return AzureWorkloadSapHanaPointInTimeRecoveryPoint.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadSAPAsePointInTimeRecoveryPoint".equals(discriminatorValue)) { - return AzureWorkloadSapAsePointInTimeRecoveryPoint.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AzureWorkloadPointInTimeRecoveryPoint fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadPointInTimeRecoveryPoint deserializedAzureWorkloadPointInTimeRecoveryPoint - = new AzureWorkloadPointInTimeRecoveryPoint(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("threatStatus".equals(fieldName)) { - deserializedAzureWorkloadPointInTimeRecoveryPoint - .withThreatStatus(ThreatStatus.fromString(reader.getString())); - } else if ("threatInfo".equals(fieldName)) { - List threatInfo = reader.readArray(reader1 -> ThreatInfo.fromJson(reader1)); - deserializedAzureWorkloadPointInTimeRecoveryPoint.withThreatInfo(threatInfo); - } else if ("recoveryPointTimeInUTC".equals(fieldName)) { - deserializedAzureWorkloadPointInTimeRecoveryPoint.withRecoveryPointTimeInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("type".equals(fieldName)) { - deserializedAzureWorkloadPointInTimeRecoveryPoint - .withType(RestorePointType.fromString(reader.getString())); - } else if ("recoveryPointTierDetails".equals(fieldName)) { - List recoveryPointTierDetails - = reader.readArray(reader1 -> RecoveryPointTierInformationV2.fromJson(reader1)); - deserializedAzureWorkloadPointInTimeRecoveryPoint - .withRecoveryPointTierDetails(recoveryPointTierDetails); - } else if ("recoveryPointMoveReadinessInfo".equals(fieldName)) { - Map recoveryPointMoveReadinessInfo - = reader.readMap(reader1 -> RecoveryPointMoveReadinessInfo.fromJson(reader1)); - deserializedAzureWorkloadPointInTimeRecoveryPoint - .withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); - } else if ("recoveryPointProperties".equals(fieldName)) { - deserializedAzureWorkloadPointInTimeRecoveryPoint - .withRecoveryPointProperties(RecoveryPointProperties.fromJson(reader)); - } else if ("objectType".equals(fieldName)) { - deserializedAzureWorkloadPointInTimeRecoveryPoint.objectType = reader.getString(); - } else if ("timeRanges".equals(fieldName)) { - List timeRanges = reader.readArray(reader1 -> PointInTimeRange.fromJson(reader1)); - deserializedAzureWorkloadPointInTimeRecoveryPoint.timeRanges = timeRanges; - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadPointInTimeRecoveryPoint; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRestoreRequest.java deleted file mode 100644 index 4afeb025fdb5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadPointInTimeRestoreRequest.java +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore. - */ -@Fluent -public final class AzureWorkloadPointInTimeRestoreRequest extends AzureWorkloadRestoreRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureWorkloadPointInTimeRestoreRequest"; - - /* - * PointInTime value - */ - private OffsetDateTime pointInTime; - - /** - * Creates an instance of AzureWorkloadPointInTimeRestoreRequest class. - */ - public AzureWorkloadPointInTimeRestoreRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the pointInTime property: PointInTime value. - * - * @return the pointInTime value. - */ - public OffsetDateTime pointInTime() { - return this.pointInTime; - } - - /** - * Set the pointInTime property: PointInTime value. - * - * @param pointInTime the pointInTime value to set. - * @return the AzureWorkloadPointInTimeRestoreRequest object itself. - */ - public AzureWorkloadPointInTimeRestoreRequest withPointInTime(OffsetDateTime pointInTime) { - this.pointInTime = pointInTime; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadPointInTimeRestoreRequest withRecoveryType(RecoveryType recoveryType) { - super.withRecoveryType(recoveryType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadPointInTimeRestoreRequest withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadPointInTimeRestoreRequest withPropertyBag(Map propertyBag) { - super.withPropertyBag(propertyBag); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadPointInTimeRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) { - super.withTargetInfo(targetInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadPointInTimeRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) { - super.withRecoveryMode(recoveryMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadPointInTimeRestoreRequest withTargetResourceGroupName(String targetResourceGroupName) { - super.withTargetResourceGroupName(targetResourceGroupName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadPointInTimeRestoreRequest - withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails) { - super.withUserAssignedManagedIdentityDetails(userAssignedManagedIdentityDetails); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadPointInTimeRestoreRequest - withSnapshotRestoreParameters(SnapshotRestoreParameters snapshotRestoreParameters) { - super.withSnapshotRestoreParameters(snapshotRestoreParameters); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadPointInTimeRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { - super.withTargetVirtualMachineId(targetVirtualMachineId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadPointInTimeRestoreRequest - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("recoveryType", recoveryType() == null ? null : recoveryType().toString()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeMapField("propertyBag", propertyBag(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("targetInfo", targetInfo()); - jsonWriter.writeStringField("recoveryMode", recoveryMode() == null ? null : recoveryMode().toString()); - jsonWriter.writeStringField("targetResourceGroupName", targetResourceGroupName()); - jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", userAssignedManagedIdentityDetails()); - jsonWriter.writeJsonField("snapshotRestoreParameters", snapshotRestoreParameters()); - jsonWriter.writeStringField("targetVirtualMachineId", targetVirtualMachineId()); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("pointInTime", - this.pointInTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.pointInTime)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadPointInTimeRestoreRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadPointInTimeRestoreRequest 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 AzureWorkloadPointInTimeRestoreRequest. - */ - public static AzureWorkloadPointInTimeRestoreRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadPointInTimeRestoreRequest deserializedAzureWorkloadPointInTimeRestoreRequest - = new AzureWorkloadPointInTimeRestoreRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureWorkloadPointInTimeRestoreRequest - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("recoveryType".equals(fieldName)) { - deserializedAzureWorkloadPointInTimeRestoreRequest - .withRecoveryType(RecoveryType.fromString(reader.getString())); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureWorkloadPointInTimeRestoreRequest.withSourceResourceId(reader.getString()); - } else if ("propertyBag".equals(fieldName)) { - Map propertyBag = reader.readMap(reader1 -> reader1.getString()); - deserializedAzureWorkloadPointInTimeRestoreRequest.withPropertyBag(propertyBag); - } else if ("targetInfo".equals(fieldName)) { - deserializedAzureWorkloadPointInTimeRestoreRequest - .withTargetInfo(TargetRestoreInfo.fromJson(reader)); - } else if ("recoveryMode".equals(fieldName)) { - deserializedAzureWorkloadPointInTimeRestoreRequest - .withRecoveryMode(RecoveryMode.fromString(reader.getString())); - } else if ("targetResourceGroupName".equals(fieldName)) { - deserializedAzureWorkloadPointInTimeRestoreRequest.withTargetResourceGroupName(reader.getString()); - } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) { - deserializedAzureWorkloadPointInTimeRestoreRequest - .withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails.fromJson(reader)); - } else if ("snapshotRestoreParameters".equals(fieldName)) { - deserializedAzureWorkloadPointInTimeRestoreRequest - .withSnapshotRestoreParameters(SnapshotRestoreParameters.fromJson(reader)); - } else if ("targetVirtualMachineId".equals(fieldName)) { - deserializedAzureWorkloadPointInTimeRestoreRequest.withTargetVirtualMachineId(reader.getString()); - } else if ("objectType".equals(fieldName)) { - deserializedAzureWorkloadPointInTimeRestoreRequest.objectType = reader.getString(); - } else if ("pointInTime".equals(fieldName)) { - deserializedAzureWorkloadPointInTimeRestoreRequest.pointInTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadPointInTimeRestoreRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPoint.java deleted file mode 100644 index f81e9aefd35e..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRecoveryPoint.java +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * Workload specific recovery point, specifically encapsulates full/diff recovery point. - */ -@Immutable -public class AzureWorkloadRecoveryPoint extends RecoveryPoint { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureWorkloadRecoveryPoint"; - - /* - * UTC time at which recovery point was created - */ - private OffsetDateTime recoveryPointTimeInUtc; - - /* - * Type of restore point - */ - private RestorePointType type; - - /* - * Recovery point tier information. - */ - private List recoveryPointTierDetails; - - /* - * Eligibility of RP to be moved to another tier - */ - private Map recoveryPointMoveReadinessInfo; - - /* - * Properties of Recovery Point - */ - private RecoveryPointProperties recoveryPointProperties; - - /** - * Creates an instance of AzureWorkloadRecoveryPoint class. - */ - protected AzureWorkloadRecoveryPoint() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the recoveryPointTimeInUtc property: UTC time at which recovery point was created. - * - * @return the recoveryPointTimeInUtc value. - */ - public OffsetDateTime recoveryPointTimeInUtc() { - return this.recoveryPointTimeInUtc; - } - - /** - * Set the recoveryPointTimeInUtc property: UTC time at which recovery point was created. - * - * @param recoveryPointTimeInUtc the recoveryPointTimeInUtc value to set. - * @return the AzureWorkloadRecoveryPoint object itself. - */ - AzureWorkloadRecoveryPoint withRecoveryPointTimeInUtc(OffsetDateTime recoveryPointTimeInUtc) { - this.recoveryPointTimeInUtc = recoveryPointTimeInUtc; - return this; - } - - /** - * Get the type property: Type of restore point. - * - * @return the type value. - */ - public RestorePointType type() { - return this.type; - } - - /** - * Set the type property: Type of restore point. - * - * @param type the type value to set. - * @return the AzureWorkloadRecoveryPoint object itself. - */ - AzureWorkloadRecoveryPoint withType(RestorePointType type) { - this.type = type; - return this; - } - - /** - * Get the recoveryPointTierDetails property: Recovery point tier information. - * - * @return the recoveryPointTierDetails value. - */ - public List recoveryPointTierDetails() { - return this.recoveryPointTierDetails; - } - - /** - * Set the recoveryPointTierDetails property: Recovery point tier information. - * - * @param recoveryPointTierDetails the recoveryPointTierDetails value to set. - * @return the AzureWorkloadRecoveryPoint object itself. - */ - AzureWorkloadRecoveryPoint - withRecoveryPointTierDetails(List recoveryPointTierDetails) { - this.recoveryPointTierDetails = recoveryPointTierDetails; - return this; - } - - /** - * Get the recoveryPointMoveReadinessInfo property: Eligibility of RP to be moved to another tier. - * - * @return the recoveryPointMoveReadinessInfo value. - */ - public Map recoveryPointMoveReadinessInfo() { - return this.recoveryPointMoveReadinessInfo; - } - - /** - * Set the recoveryPointMoveReadinessInfo property: Eligibility of RP to be moved to another tier. - * - * @param recoveryPointMoveReadinessInfo the recoveryPointMoveReadinessInfo value to set. - * @return the AzureWorkloadRecoveryPoint object itself. - */ - AzureWorkloadRecoveryPoint - withRecoveryPointMoveReadinessInfo(Map recoveryPointMoveReadinessInfo) { - this.recoveryPointMoveReadinessInfo = recoveryPointMoveReadinessInfo; - return this; - } - - /** - * Get the recoveryPointProperties property: Properties of Recovery Point. - * - * @return the recoveryPointProperties value. - */ - public RecoveryPointProperties recoveryPointProperties() { - return this.recoveryPointProperties; - } - - /** - * Set the recoveryPointProperties property: Properties of Recovery Point. - * - * @param recoveryPointProperties the recoveryPointProperties value to set. - * @return the AzureWorkloadRecoveryPoint object itself. - */ - AzureWorkloadRecoveryPoint withRecoveryPointProperties(RecoveryPointProperties recoveryPointProperties) { - this.recoveryPointProperties = recoveryPointProperties; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("threatStatus", threatStatus() == null ? null : threatStatus().toString()); - jsonWriter.writeArrayField("threatInfo", threatInfo(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("recoveryPointTimeInUTC", - this.recoveryPointTimeInUtc == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.recoveryPointTimeInUtc)); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeArrayField("recoveryPointTierDetails", this.recoveryPointTierDetails, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeMapField("recoveryPointMoveReadinessInfo", this.recoveryPointMoveReadinessInfo, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("recoveryPointProperties", this.recoveryPointProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadRecoveryPoint from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadRecoveryPoint 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 AzureWorkloadRecoveryPoint. - */ - public static AzureWorkloadRecoveryPoint fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureWorkloadSAPHanaRecoveryPoint".equals(discriminatorValue)) { - return AzureWorkloadSapHanaRecoveryPoint.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadSAPAseRecoveryPoint".equals(discriminatorValue)) { - return AzureWorkloadSapAseRecoveryPoint.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadSQLRecoveryPoint".equals(discriminatorValue)) { - return AzureWorkloadSqlRecoveryPoint.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureWorkloadSQLPointInTimeRecoveryPoint".equals(discriminatorValue)) { - return AzureWorkloadSqlPointInTimeRecoveryPoint.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadPointInTimeRecoveryPoint".equals(discriminatorValue)) { - return AzureWorkloadPointInTimeRecoveryPoint.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureWorkloadSAPHanaPointInTimeRecoveryPoint".equals(discriminatorValue)) { - return AzureWorkloadSapHanaPointInTimeRecoveryPoint.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadSAPAsePointInTimeRecoveryPoint".equals(discriminatorValue)) { - return AzureWorkloadSapAsePointInTimeRecoveryPoint.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AzureWorkloadRecoveryPoint fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadRecoveryPoint deserializedAzureWorkloadRecoveryPoint = new AzureWorkloadRecoveryPoint(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("threatStatus".equals(fieldName)) { - deserializedAzureWorkloadRecoveryPoint - .withThreatStatus(ThreatStatus.fromString(reader.getString())); - } else if ("threatInfo".equals(fieldName)) { - List threatInfo = reader.readArray(reader1 -> ThreatInfo.fromJson(reader1)); - deserializedAzureWorkloadRecoveryPoint.withThreatInfo(threatInfo); - } else if ("objectType".equals(fieldName)) { - deserializedAzureWorkloadRecoveryPoint.objectType = reader.getString(); - } else if ("recoveryPointTimeInUTC".equals(fieldName)) { - deserializedAzureWorkloadRecoveryPoint.recoveryPointTimeInUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("type".equals(fieldName)) { - deserializedAzureWorkloadRecoveryPoint.type = RestorePointType.fromString(reader.getString()); - } else if ("recoveryPointTierDetails".equals(fieldName)) { - List recoveryPointTierDetails - = reader.readArray(reader1 -> RecoveryPointTierInformationV2.fromJson(reader1)); - deserializedAzureWorkloadRecoveryPoint.recoveryPointTierDetails = recoveryPointTierDetails; - } else if ("recoveryPointMoveReadinessInfo".equals(fieldName)) { - Map recoveryPointMoveReadinessInfo - = reader.readMap(reader1 -> RecoveryPointMoveReadinessInfo.fromJson(reader1)); - deserializedAzureWorkloadRecoveryPoint.recoveryPointMoveReadinessInfo - = recoveryPointMoveReadinessInfo; - } else if ("recoveryPointProperties".equals(fieldName)) { - deserializedAzureWorkloadRecoveryPoint.recoveryPointProperties - = RecoveryPointProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadRecoveryPoint; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRestoreRequest.java deleted file mode 100644 index bcde1223aae8..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadRestoreRequest.java +++ /dev/null @@ -1,407 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * AzureWorkload-specific restore. - */ -@Fluent -public class AzureWorkloadRestoreRequest extends RestoreRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureWorkloadRestoreRequest"; - - /* - * Type of this recovery. - */ - private RecoveryType recoveryType; - - /* - * Fully qualified ARM ID of the VM on which workload that was running is being recovered. - */ - private String sourceResourceId; - - /* - * Workload specific property bag. - */ - private Map propertyBag; - - /* - * Details of target database - */ - private TargetRestoreInfo targetInfo; - - /* - * Defines whether the current recovery mode is file restore or database restore - */ - private RecoveryMode recoveryMode; - - /* - * Defines the Resource group of the Target VM - */ - private String targetResourceGroupName; - - /* - * User Assigned managed identity details - * Currently used for snapshot. - */ - private UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails; - - /* - * Additional details for snapshot recovery - * Currently used for snapshot for SAP Hana. - */ - private SnapshotRestoreParameters snapshotRestoreParameters; - - /* - * This is the complete ARM Id of the target VM - * For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} - */ - private String targetVirtualMachineId; - - /** - * Creates an instance of AzureWorkloadRestoreRequest class. - */ - public AzureWorkloadRestoreRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the recoveryType property: Type of this recovery. - * - * @return the recoveryType value. - */ - public RecoveryType recoveryType() { - return this.recoveryType; - } - - /** - * Set the recoveryType property: Type of this recovery. - * - * @param recoveryType the recoveryType value to set. - * @return the AzureWorkloadRestoreRequest object itself. - */ - public AzureWorkloadRestoreRequest withRecoveryType(RecoveryType recoveryType) { - this.recoveryType = recoveryType; - return this; - } - - /** - * Get the sourceResourceId property: Fully qualified ARM ID of the VM on which workload that was running is being - * recovered. - * - * @return the sourceResourceId value. - */ - public String sourceResourceId() { - return this.sourceResourceId; - } - - /** - * Set the sourceResourceId property: Fully qualified ARM ID of the VM on which workload that was running is being - * recovered. - * - * @param sourceResourceId the sourceResourceId value to set. - * @return the AzureWorkloadRestoreRequest object itself. - */ - public AzureWorkloadRestoreRequest withSourceResourceId(String sourceResourceId) { - this.sourceResourceId = sourceResourceId; - return this; - } - - /** - * Get the propertyBag property: Workload specific property bag. - * - * @return the propertyBag value. - */ - public Map propertyBag() { - return this.propertyBag; - } - - /** - * Set the propertyBag property: Workload specific property bag. - * - * @param propertyBag the propertyBag value to set. - * @return the AzureWorkloadRestoreRequest object itself. - */ - public AzureWorkloadRestoreRequest withPropertyBag(Map propertyBag) { - this.propertyBag = propertyBag; - return this; - } - - /** - * Get the targetInfo property: Details of target database. - * - * @return the targetInfo value. - */ - public TargetRestoreInfo targetInfo() { - return this.targetInfo; - } - - /** - * Set the targetInfo property: Details of target database. - * - * @param targetInfo the targetInfo value to set. - * @return the AzureWorkloadRestoreRequest object itself. - */ - public AzureWorkloadRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) { - this.targetInfo = targetInfo; - return this; - } - - /** - * Get the recoveryMode property: Defines whether the current recovery mode is file restore or database restore. - * - * @return the recoveryMode value. - */ - public RecoveryMode recoveryMode() { - return this.recoveryMode; - } - - /** - * Set the recoveryMode property: Defines whether the current recovery mode is file restore or database restore. - * - * @param recoveryMode the recoveryMode value to set. - * @return the AzureWorkloadRestoreRequest object itself. - */ - public AzureWorkloadRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) { - this.recoveryMode = recoveryMode; - return this; - } - - /** - * Get the targetResourceGroupName property: Defines the Resource group of the Target VM. - * - * @return the targetResourceGroupName value. - */ - public String targetResourceGroupName() { - return this.targetResourceGroupName; - } - - /** - * Set the targetResourceGroupName property: Defines the Resource group of the Target VM. - * - * @param targetResourceGroupName the targetResourceGroupName value to set. - * @return the AzureWorkloadRestoreRequest object itself. - */ - public AzureWorkloadRestoreRequest withTargetResourceGroupName(String targetResourceGroupName) { - this.targetResourceGroupName = targetResourceGroupName; - return this; - } - - /** - * Get the userAssignedManagedIdentityDetails property: User Assigned managed identity details - * Currently used for snapshot. - * - * @return the userAssignedManagedIdentityDetails value. - */ - public UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails() { - return this.userAssignedManagedIdentityDetails; - } - - /** - * Set the userAssignedManagedIdentityDetails property: User Assigned managed identity details - * Currently used for snapshot. - * - * @param userAssignedManagedIdentityDetails the userAssignedManagedIdentityDetails value to set. - * @return the AzureWorkloadRestoreRequest object itself. - */ - public AzureWorkloadRestoreRequest - withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails) { - this.userAssignedManagedIdentityDetails = userAssignedManagedIdentityDetails; - return this; - } - - /** - * Get the snapshotRestoreParameters property: Additional details for snapshot recovery - * Currently used for snapshot for SAP Hana. - * - * @return the snapshotRestoreParameters value. - */ - public SnapshotRestoreParameters snapshotRestoreParameters() { - return this.snapshotRestoreParameters; - } - - /** - * Set the snapshotRestoreParameters property: Additional details for snapshot recovery - * Currently used for snapshot for SAP Hana. - * - * @param snapshotRestoreParameters the snapshotRestoreParameters value to set. - * @return the AzureWorkloadRestoreRequest object itself. - */ - public AzureWorkloadRestoreRequest - withSnapshotRestoreParameters(SnapshotRestoreParameters snapshotRestoreParameters) { - this.snapshotRestoreParameters = snapshotRestoreParameters; - return this; - } - - /** - * Get the targetVirtualMachineId property: This is the complete ARM Id of the target VM - * For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. - * - * @return the targetVirtualMachineId value. - */ - public String targetVirtualMachineId() { - return this.targetVirtualMachineId; - } - - /** - * Set the targetVirtualMachineId property: This is the complete ARM Id of the target VM - * For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. - * - * @param targetVirtualMachineId the targetVirtualMachineId value to set. - * @return the AzureWorkloadRestoreRequest object itself. - */ - public AzureWorkloadRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { - this.targetVirtualMachineId = targetVirtualMachineId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadRestoreRequest withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("recoveryType", this.recoveryType == null ? null : this.recoveryType.toString()); - jsonWriter.writeStringField("sourceResourceId", this.sourceResourceId); - jsonWriter.writeMapField("propertyBag", this.propertyBag, (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("targetInfo", this.targetInfo); - jsonWriter.writeStringField("recoveryMode", this.recoveryMode == null ? null : this.recoveryMode.toString()); - jsonWriter.writeStringField("targetResourceGroupName", this.targetResourceGroupName); - jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", this.userAssignedManagedIdentityDetails); - jsonWriter.writeJsonField("snapshotRestoreParameters", this.snapshotRestoreParameters); - jsonWriter.writeStringField("targetVirtualMachineId", this.targetVirtualMachineId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadRestoreRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadRestoreRequest 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 AzureWorkloadRestoreRequest. - */ - public static AzureWorkloadRestoreRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureWorkloadSAPHanaRestoreRequest".equals(discriminatorValue)) { - return AzureWorkloadSapHanaRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureWorkloadSAPHanaRestoreWithRehydrateRequest".equals(discriminatorValue)) { - return AzureWorkloadSapHanaRestoreWithRehydrateRequest.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadSAPHanaPointInTimeRestoreRequest".equals(discriminatorValue)) { - return AzureWorkloadSapHanaPointInTimeRestoreRequest - .fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest".equals(discriminatorValue)) { - return AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadSAPAseRestoreRequest".equals(discriminatorValue)) { - return AzureWorkloadSapAseRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureWorkloadSAPAsePointInTimeRestoreRequest".equals(discriminatorValue)) { - return AzureWorkloadSapAsePointInTimeRestoreRequest.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadSQLRestoreRequest".equals(discriminatorValue)) { - return AzureWorkloadSqlRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureWorkloadSQLRestoreWithRehydrateRequest".equals(discriminatorValue)) { - return AzureWorkloadSqlRestoreWithRehydrateRequest.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadSQLPointInTimeRestoreRequest".equals(discriminatorValue)) { - return AzureWorkloadSqlPointInTimeRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest".equals(discriminatorValue)) { - return AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadPointInTimeRestoreRequest".equals(discriminatorValue)) { - return AzureWorkloadPointInTimeRestoreRequest.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AzureWorkloadRestoreRequest fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadRestoreRequest deserializedAzureWorkloadRestoreRequest = new AzureWorkloadRestoreRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureWorkloadRestoreRequest - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("objectType".equals(fieldName)) { - deserializedAzureWorkloadRestoreRequest.objectType = reader.getString(); - } else if ("recoveryType".equals(fieldName)) { - deserializedAzureWorkloadRestoreRequest.recoveryType = RecoveryType.fromString(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureWorkloadRestoreRequest.sourceResourceId = reader.getString(); - } else if ("propertyBag".equals(fieldName)) { - Map propertyBag = reader.readMap(reader1 -> reader1.getString()); - deserializedAzureWorkloadRestoreRequest.propertyBag = propertyBag; - } else if ("targetInfo".equals(fieldName)) { - deserializedAzureWorkloadRestoreRequest.targetInfo = TargetRestoreInfo.fromJson(reader); - } else if ("recoveryMode".equals(fieldName)) { - deserializedAzureWorkloadRestoreRequest.recoveryMode = RecoveryMode.fromString(reader.getString()); - } else if ("targetResourceGroupName".equals(fieldName)) { - deserializedAzureWorkloadRestoreRequest.targetResourceGroupName = reader.getString(); - } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) { - deserializedAzureWorkloadRestoreRequest.userAssignedManagedIdentityDetails - = UserAssignedManagedIdentityDetails.fromJson(reader); - } else if ("snapshotRestoreParameters".equals(fieldName)) { - deserializedAzureWorkloadRestoreRequest.snapshotRestoreParameters - = SnapshotRestoreParameters.fromJson(reader); - } else if ("targetVirtualMachineId".equals(fieldName)) { - deserializedAzureWorkloadRestoreRequest.targetVirtualMachineId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadRestoreRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapAsePointInTimeRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapAsePointInTimeRecoveryPoint.java deleted file mode 100644 index 74bfada53cb1..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapAsePointInTimeRecoveryPoint.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * Recovery point specific to PointInTime in SAPAse. - */ -@Immutable -public final class AzureWorkloadSapAsePointInTimeRecoveryPoint extends AzureWorkloadPointInTimeRecoveryPoint { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureWorkloadSAPAsePointInTimeRecoveryPoint"; - - /** - * Creates an instance of AzureWorkloadSapAsePointInTimeRecoveryPoint class. - */ - private AzureWorkloadSapAsePointInTimeRecoveryPoint() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("threatStatus", threatStatus() == null ? null : threatStatus().toString()); - jsonWriter.writeArrayField("threatInfo", threatInfo(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("recoveryPointTimeInUTC", - recoveryPointTimeInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(recoveryPointTimeInUtc())); - jsonWriter.writeStringField("type", type() == null ? null : type().toString()); - jsonWriter.writeArrayField("recoveryPointTierDetails", recoveryPointTierDetails(), - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeMapField("recoveryPointMoveReadinessInfo", recoveryPointMoveReadinessInfo(), - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("recoveryPointProperties", recoveryPointProperties()); - jsonWriter.writeArrayField("timeRanges", timeRanges(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadSapAsePointInTimeRecoveryPoint from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadSapAsePointInTimeRecoveryPoint 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 AzureWorkloadSapAsePointInTimeRecoveryPoint. - */ - public static AzureWorkloadSapAsePointInTimeRecoveryPoint fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadSapAsePointInTimeRecoveryPoint deserializedAzureWorkloadSapAsePointInTimeRecoveryPoint - = new AzureWorkloadSapAsePointInTimeRecoveryPoint(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("threatStatus".equals(fieldName)) { - deserializedAzureWorkloadSapAsePointInTimeRecoveryPoint - .withThreatStatus(ThreatStatus.fromString(reader.getString())); - } else if ("threatInfo".equals(fieldName)) { - List threatInfo = reader.readArray(reader1 -> ThreatInfo.fromJson(reader1)); - deserializedAzureWorkloadSapAsePointInTimeRecoveryPoint.withThreatInfo(threatInfo); - } else if ("recoveryPointTimeInUTC".equals(fieldName)) { - deserializedAzureWorkloadSapAsePointInTimeRecoveryPoint.withRecoveryPointTimeInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("type".equals(fieldName)) { - deserializedAzureWorkloadSapAsePointInTimeRecoveryPoint - .withType(RestorePointType.fromString(reader.getString())); - } else if ("recoveryPointTierDetails".equals(fieldName)) { - List recoveryPointTierDetails - = reader.readArray(reader1 -> RecoveryPointTierInformationV2.fromJson(reader1)); - deserializedAzureWorkloadSapAsePointInTimeRecoveryPoint - .withRecoveryPointTierDetails(recoveryPointTierDetails); - } else if ("recoveryPointMoveReadinessInfo".equals(fieldName)) { - Map recoveryPointMoveReadinessInfo - = reader.readMap(reader1 -> RecoveryPointMoveReadinessInfo.fromJson(reader1)); - deserializedAzureWorkloadSapAsePointInTimeRecoveryPoint - .withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); - } else if ("recoveryPointProperties".equals(fieldName)) { - deserializedAzureWorkloadSapAsePointInTimeRecoveryPoint - .withRecoveryPointProperties(RecoveryPointProperties.fromJson(reader)); - } else if ("timeRanges".equals(fieldName)) { - List timeRanges = reader.readArray(reader1 -> PointInTimeRange.fromJson(reader1)); - deserializedAzureWorkloadSapAsePointInTimeRecoveryPoint.withTimeRanges(timeRanges); - } else if ("objectType".equals(fieldName)) { - deserializedAzureWorkloadSapAsePointInTimeRecoveryPoint.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadSapAsePointInTimeRecoveryPoint; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapAsePointInTimeRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapAsePointInTimeRestoreRequest.java deleted file mode 100644 index acc2ee3cf647..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapAsePointInTimeRestoreRequest.java +++ /dev/null @@ -1,246 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * AzureWorkload SAP Ase-specific restore. Specifically for PointInTime/Log restore. - */ -@Fluent -public final class AzureWorkloadSapAsePointInTimeRestoreRequest extends AzureWorkloadSapAseRestoreRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureWorkloadSAPAsePointInTimeRestoreRequest"; - - /* - * PointInTime value - */ - private OffsetDateTime pointInTime; - - /** - * Creates an instance of AzureWorkloadSapAsePointInTimeRestoreRequest class. - */ - public AzureWorkloadSapAsePointInTimeRestoreRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the pointInTime property: PointInTime value. - * - * @return the pointInTime value. - */ - public OffsetDateTime pointInTime() { - return this.pointInTime; - } - - /** - * Set the pointInTime property: PointInTime value. - * - * @param pointInTime the pointInTime value to set. - * @return the AzureWorkloadSapAsePointInTimeRestoreRequest object itself. - */ - public AzureWorkloadSapAsePointInTimeRestoreRequest withPointInTime(OffsetDateTime pointInTime) { - this.pointInTime = pointInTime; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapAsePointInTimeRestoreRequest withRecoveryType(RecoveryType recoveryType) { - super.withRecoveryType(recoveryType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapAsePointInTimeRestoreRequest withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapAsePointInTimeRestoreRequest withPropertyBag(Map propertyBag) { - super.withPropertyBag(propertyBag); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapAsePointInTimeRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) { - super.withTargetInfo(targetInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapAsePointInTimeRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) { - super.withRecoveryMode(recoveryMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapAsePointInTimeRestoreRequest withTargetResourceGroupName(String targetResourceGroupName) { - super.withTargetResourceGroupName(targetResourceGroupName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapAsePointInTimeRestoreRequest - withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails) { - super.withUserAssignedManagedIdentityDetails(userAssignedManagedIdentityDetails); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapAsePointInTimeRestoreRequest - withSnapshotRestoreParameters(SnapshotRestoreParameters snapshotRestoreParameters) { - super.withSnapshotRestoreParameters(snapshotRestoreParameters); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapAsePointInTimeRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { - super.withTargetVirtualMachineId(targetVirtualMachineId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapAsePointInTimeRestoreRequest - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("recoveryType", recoveryType() == null ? null : recoveryType().toString()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeMapField("propertyBag", propertyBag(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("targetInfo", targetInfo()); - jsonWriter.writeStringField("recoveryMode", recoveryMode() == null ? null : recoveryMode().toString()); - jsonWriter.writeStringField("targetResourceGroupName", targetResourceGroupName()); - jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", userAssignedManagedIdentityDetails()); - jsonWriter.writeJsonField("snapshotRestoreParameters", snapshotRestoreParameters()); - jsonWriter.writeStringField("targetVirtualMachineId", targetVirtualMachineId()); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("pointInTime", - this.pointInTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.pointInTime)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadSapAsePointInTimeRestoreRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadSapAsePointInTimeRestoreRequest 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 AzureWorkloadSapAsePointInTimeRestoreRequest. - */ - public static AzureWorkloadSapAsePointInTimeRestoreRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadSapAsePointInTimeRestoreRequest deserializedAzureWorkloadSapAsePointInTimeRestoreRequest - = new AzureWorkloadSapAsePointInTimeRestoreRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureWorkloadSapAsePointInTimeRestoreRequest - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("recoveryType".equals(fieldName)) { - deserializedAzureWorkloadSapAsePointInTimeRestoreRequest - .withRecoveryType(RecoveryType.fromString(reader.getString())); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureWorkloadSapAsePointInTimeRestoreRequest.withSourceResourceId(reader.getString()); - } else if ("propertyBag".equals(fieldName)) { - Map propertyBag = reader.readMap(reader1 -> reader1.getString()); - deserializedAzureWorkloadSapAsePointInTimeRestoreRequest.withPropertyBag(propertyBag); - } else if ("targetInfo".equals(fieldName)) { - deserializedAzureWorkloadSapAsePointInTimeRestoreRequest - .withTargetInfo(TargetRestoreInfo.fromJson(reader)); - } else if ("recoveryMode".equals(fieldName)) { - deserializedAzureWorkloadSapAsePointInTimeRestoreRequest - .withRecoveryMode(RecoveryMode.fromString(reader.getString())); - } else if ("targetResourceGroupName".equals(fieldName)) { - deserializedAzureWorkloadSapAsePointInTimeRestoreRequest - .withTargetResourceGroupName(reader.getString()); - } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) { - deserializedAzureWorkloadSapAsePointInTimeRestoreRequest - .withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails.fromJson(reader)); - } else if ("snapshotRestoreParameters".equals(fieldName)) { - deserializedAzureWorkloadSapAsePointInTimeRestoreRequest - .withSnapshotRestoreParameters(SnapshotRestoreParameters.fromJson(reader)); - } else if ("targetVirtualMachineId".equals(fieldName)) { - deserializedAzureWorkloadSapAsePointInTimeRestoreRequest - .withTargetVirtualMachineId(reader.getString()); - } else if ("objectType".equals(fieldName)) { - deserializedAzureWorkloadSapAsePointInTimeRestoreRequest.objectType = reader.getString(); - } else if ("pointInTime".equals(fieldName)) { - deserializedAzureWorkloadSapAsePointInTimeRestoreRequest.pointInTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadSapAsePointInTimeRestoreRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapAseRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapAseRecoveryPoint.java deleted file mode 100644 index ebe47f261ae1..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapAseRecoveryPoint.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * SAPAse specific recoverypoint, specifically encapsulates full/diff recoverypoints. - */ -@Immutable -public final class AzureWorkloadSapAseRecoveryPoint extends AzureWorkloadRecoveryPoint { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureWorkloadSAPAseRecoveryPoint"; - - /** - * Creates an instance of AzureWorkloadSapAseRecoveryPoint class. - */ - private AzureWorkloadSapAseRecoveryPoint() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("threatStatus", threatStatus() == null ? null : threatStatus().toString()); - jsonWriter.writeArrayField("threatInfo", threatInfo(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("recoveryPointTimeInUTC", - recoveryPointTimeInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(recoveryPointTimeInUtc())); - jsonWriter.writeStringField("type", type() == null ? null : type().toString()); - jsonWriter.writeArrayField("recoveryPointTierDetails", recoveryPointTierDetails(), - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeMapField("recoveryPointMoveReadinessInfo", recoveryPointMoveReadinessInfo(), - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("recoveryPointProperties", recoveryPointProperties()); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadSapAseRecoveryPoint from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadSapAseRecoveryPoint 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 AzureWorkloadSapAseRecoveryPoint. - */ - public static AzureWorkloadSapAseRecoveryPoint fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadSapAseRecoveryPoint deserializedAzureWorkloadSapAseRecoveryPoint - = new AzureWorkloadSapAseRecoveryPoint(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("threatStatus".equals(fieldName)) { - deserializedAzureWorkloadSapAseRecoveryPoint - .withThreatStatus(ThreatStatus.fromString(reader.getString())); - } else if ("threatInfo".equals(fieldName)) { - List threatInfo = reader.readArray(reader1 -> ThreatInfo.fromJson(reader1)); - deserializedAzureWorkloadSapAseRecoveryPoint.withThreatInfo(threatInfo); - } else if ("recoveryPointTimeInUTC".equals(fieldName)) { - deserializedAzureWorkloadSapAseRecoveryPoint.withRecoveryPointTimeInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("type".equals(fieldName)) { - deserializedAzureWorkloadSapAseRecoveryPoint - .withType(RestorePointType.fromString(reader.getString())); - } else if ("recoveryPointTierDetails".equals(fieldName)) { - List recoveryPointTierDetails - = reader.readArray(reader1 -> RecoveryPointTierInformationV2.fromJson(reader1)); - deserializedAzureWorkloadSapAseRecoveryPoint.withRecoveryPointTierDetails(recoveryPointTierDetails); - } else if ("recoveryPointMoveReadinessInfo".equals(fieldName)) { - Map recoveryPointMoveReadinessInfo - = reader.readMap(reader1 -> RecoveryPointMoveReadinessInfo.fromJson(reader1)); - deserializedAzureWorkloadSapAseRecoveryPoint - .withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); - } else if ("recoveryPointProperties".equals(fieldName)) { - deserializedAzureWorkloadSapAseRecoveryPoint - .withRecoveryPointProperties(RecoveryPointProperties.fromJson(reader)); - } else if ("objectType".equals(fieldName)) { - deserializedAzureWorkloadSapAseRecoveryPoint.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadSapAseRecoveryPoint; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapAseRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapAseRestoreRequest.java deleted file mode 100644 index f82d7d706864..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapAseRestoreRequest.java +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * AzureWorkload SAP Ase-specific restore. - */ -@Fluent -public class AzureWorkloadSapAseRestoreRequest extends AzureWorkloadRestoreRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureWorkloadSAPAseRestoreRequest"; - - /** - * Creates an instance of AzureWorkloadSapAseRestoreRequest class. - */ - public AzureWorkloadSapAseRestoreRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapAseRestoreRequest withRecoveryType(RecoveryType recoveryType) { - super.withRecoveryType(recoveryType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapAseRestoreRequest withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapAseRestoreRequest withPropertyBag(Map propertyBag) { - super.withPropertyBag(propertyBag); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapAseRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) { - super.withTargetInfo(targetInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapAseRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) { - super.withRecoveryMode(recoveryMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapAseRestoreRequest withTargetResourceGroupName(String targetResourceGroupName) { - super.withTargetResourceGroupName(targetResourceGroupName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapAseRestoreRequest - withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails) { - super.withUserAssignedManagedIdentityDetails(userAssignedManagedIdentityDetails); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapAseRestoreRequest - withSnapshotRestoreParameters(SnapshotRestoreParameters snapshotRestoreParameters) { - super.withSnapshotRestoreParameters(snapshotRestoreParameters); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapAseRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { - super.withTargetVirtualMachineId(targetVirtualMachineId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapAseRestoreRequest - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("recoveryType", recoveryType() == null ? null : recoveryType().toString()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeMapField("propertyBag", propertyBag(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("targetInfo", targetInfo()); - jsonWriter.writeStringField("recoveryMode", recoveryMode() == null ? null : recoveryMode().toString()); - jsonWriter.writeStringField("targetResourceGroupName", targetResourceGroupName()); - jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", userAssignedManagedIdentityDetails()); - jsonWriter.writeJsonField("snapshotRestoreParameters", snapshotRestoreParameters()); - jsonWriter.writeStringField("targetVirtualMachineId", targetVirtualMachineId()); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadSapAseRestoreRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadSapAseRestoreRequest 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 AzureWorkloadSapAseRestoreRequest. - */ - public static AzureWorkloadSapAseRestoreRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureWorkloadSAPAsePointInTimeRestoreRequest".equals(discriminatorValue)) { - return AzureWorkloadSapAsePointInTimeRestoreRequest.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AzureWorkloadSapAseRestoreRequest fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadSapAseRestoreRequest deserializedAzureWorkloadSapAseRestoreRequest - = new AzureWorkloadSapAseRestoreRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureWorkloadSapAseRestoreRequest - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("recoveryType".equals(fieldName)) { - deserializedAzureWorkloadSapAseRestoreRequest - .withRecoveryType(RecoveryType.fromString(reader.getString())); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureWorkloadSapAseRestoreRequest.withSourceResourceId(reader.getString()); - } else if ("propertyBag".equals(fieldName)) { - Map propertyBag = reader.readMap(reader1 -> reader1.getString()); - deserializedAzureWorkloadSapAseRestoreRequest.withPropertyBag(propertyBag); - } else if ("targetInfo".equals(fieldName)) { - deserializedAzureWorkloadSapAseRestoreRequest.withTargetInfo(TargetRestoreInfo.fromJson(reader)); - } else if ("recoveryMode".equals(fieldName)) { - deserializedAzureWorkloadSapAseRestoreRequest - .withRecoveryMode(RecoveryMode.fromString(reader.getString())); - } else if ("targetResourceGroupName".equals(fieldName)) { - deserializedAzureWorkloadSapAseRestoreRequest.withTargetResourceGroupName(reader.getString()); - } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) { - deserializedAzureWorkloadSapAseRestoreRequest - .withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails.fromJson(reader)); - } else if ("snapshotRestoreParameters".equals(fieldName)) { - deserializedAzureWorkloadSapAseRestoreRequest - .withSnapshotRestoreParameters(SnapshotRestoreParameters.fromJson(reader)); - } else if ("targetVirtualMachineId".equals(fieldName)) { - deserializedAzureWorkloadSapAseRestoreRequest.withTargetVirtualMachineId(reader.getString()); - } else if ("objectType".equals(fieldName)) { - deserializedAzureWorkloadSapAseRestoreRequest.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadSapAseRestoreRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRecoveryPoint.java deleted file mode 100644 index 9ec6e6a06cf0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRecoveryPoint.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * Recovery point specific to PointInTime in SAPHana. - */ -@Immutable -public final class AzureWorkloadSapHanaPointInTimeRecoveryPoint extends AzureWorkloadPointInTimeRecoveryPoint { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureWorkloadSAPHanaPointInTimeRecoveryPoint"; - - /** - * Creates an instance of AzureWorkloadSapHanaPointInTimeRecoveryPoint class. - */ - private AzureWorkloadSapHanaPointInTimeRecoveryPoint() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("threatStatus", threatStatus() == null ? null : threatStatus().toString()); - jsonWriter.writeArrayField("threatInfo", threatInfo(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("recoveryPointTimeInUTC", - recoveryPointTimeInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(recoveryPointTimeInUtc())); - jsonWriter.writeStringField("type", type() == null ? null : type().toString()); - jsonWriter.writeArrayField("recoveryPointTierDetails", recoveryPointTierDetails(), - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeMapField("recoveryPointMoveReadinessInfo", recoveryPointMoveReadinessInfo(), - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("recoveryPointProperties", recoveryPointProperties()); - jsonWriter.writeArrayField("timeRanges", timeRanges(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadSapHanaPointInTimeRecoveryPoint from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadSapHanaPointInTimeRecoveryPoint 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 AzureWorkloadSapHanaPointInTimeRecoveryPoint. - */ - public static AzureWorkloadSapHanaPointInTimeRecoveryPoint fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadSapHanaPointInTimeRecoveryPoint deserializedAzureWorkloadSapHanaPointInTimeRecoveryPoint - = new AzureWorkloadSapHanaPointInTimeRecoveryPoint(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("threatStatus".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRecoveryPoint - .withThreatStatus(ThreatStatus.fromString(reader.getString())); - } else if ("threatInfo".equals(fieldName)) { - List threatInfo = reader.readArray(reader1 -> ThreatInfo.fromJson(reader1)); - deserializedAzureWorkloadSapHanaPointInTimeRecoveryPoint.withThreatInfo(threatInfo); - } else if ("recoveryPointTimeInUTC".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRecoveryPoint.withRecoveryPointTimeInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("type".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRecoveryPoint - .withType(RestorePointType.fromString(reader.getString())); - } else if ("recoveryPointTierDetails".equals(fieldName)) { - List recoveryPointTierDetails - = reader.readArray(reader1 -> RecoveryPointTierInformationV2.fromJson(reader1)); - deserializedAzureWorkloadSapHanaPointInTimeRecoveryPoint - .withRecoveryPointTierDetails(recoveryPointTierDetails); - } else if ("recoveryPointMoveReadinessInfo".equals(fieldName)) { - Map recoveryPointMoveReadinessInfo - = reader.readMap(reader1 -> RecoveryPointMoveReadinessInfo.fromJson(reader1)); - deserializedAzureWorkloadSapHanaPointInTimeRecoveryPoint - .withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); - } else if ("recoveryPointProperties".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRecoveryPoint - .withRecoveryPointProperties(RecoveryPointProperties.fromJson(reader)); - } else if ("timeRanges".equals(fieldName)) { - List timeRanges = reader.readArray(reader1 -> PointInTimeRange.fromJson(reader1)); - deserializedAzureWorkloadSapHanaPointInTimeRecoveryPoint.withTimeRanges(timeRanges); - } else if ("objectType".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRecoveryPoint.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadSapHanaPointInTimeRecoveryPoint; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreRequest.java deleted file mode 100644 index 5e49814513a3..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreRequest.java +++ /dev/null @@ -1,272 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log restore. - */ -@Fluent -public class AzureWorkloadSapHanaPointInTimeRestoreRequest extends AzureWorkloadSapHanaRestoreRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureWorkloadSAPHanaPointInTimeRestoreRequest"; - - /* - * PointInTime value - */ - private OffsetDateTime pointInTime; - - /** - * Creates an instance of AzureWorkloadSapHanaPointInTimeRestoreRequest class. - */ - public AzureWorkloadSapHanaPointInTimeRestoreRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the pointInTime property: PointInTime value. - * - * @return the pointInTime value. - */ - public OffsetDateTime pointInTime() { - return this.pointInTime; - } - - /** - * Set the pointInTime property: PointInTime value. - * - * @param pointInTime the pointInTime value to set. - * @return the AzureWorkloadSapHanaPointInTimeRestoreRequest object itself. - */ - public AzureWorkloadSapHanaPointInTimeRestoreRequest withPointInTime(OffsetDateTime pointInTime) { - this.pointInTime = pointInTime; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreRequest withRecoveryType(RecoveryType recoveryType) { - super.withRecoveryType(recoveryType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreRequest withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreRequest withPropertyBag(Map propertyBag) { - super.withPropertyBag(propertyBag); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) { - super.withTargetInfo(targetInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) { - super.withRecoveryMode(recoveryMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreRequest withTargetResourceGroupName(String targetResourceGroupName) { - super.withTargetResourceGroupName(targetResourceGroupName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreRequest - withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails) { - super.withUserAssignedManagedIdentityDetails(userAssignedManagedIdentityDetails); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreRequest - withSnapshotRestoreParameters(SnapshotRestoreParameters snapshotRestoreParameters) { - super.withSnapshotRestoreParameters(snapshotRestoreParameters); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { - super.withTargetVirtualMachineId(targetVirtualMachineId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreRequest - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("recoveryType", recoveryType() == null ? null : recoveryType().toString()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeMapField("propertyBag", propertyBag(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("targetInfo", targetInfo()); - jsonWriter.writeStringField("recoveryMode", recoveryMode() == null ? null : recoveryMode().toString()); - jsonWriter.writeStringField("targetResourceGroupName", targetResourceGroupName()); - jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", userAssignedManagedIdentityDetails()); - jsonWriter.writeJsonField("snapshotRestoreParameters", snapshotRestoreParameters()); - jsonWriter.writeStringField("targetVirtualMachineId", targetVirtualMachineId()); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("pointInTime", - this.pointInTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.pointInTime)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadSapHanaPointInTimeRestoreRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadSapHanaPointInTimeRestoreRequest 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 AzureWorkloadSapHanaPointInTimeRestoreRequest. - */ - public static AzureWorkloadSapHanaPointInTimeRestoreRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest".equals(discriminatorValue)) { - return AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AzureWorkloadSapHanaPointInTimeRestoreRequest fromJsonKnownDiscriminator(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadSapHanaPointInTimeRestoreRequest deserializedAzureWorkloadSapHanaPointInTimeRestoreRequest - = new AzureWorkloadSapHanaPointInTimeRestoreRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureWorkloadSapHanaPointInTimeRestoreRequest - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("recoveryType".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRestoreRequest - .withRecoveryType(RecoveryType.fromString(reader.getString())); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRestoreRequest.withSourceResourceId(reader.getString()); - } else if ("propertyBag".equals(fieldName)) { - Map propertyBag = reader.readMap(reader1 -> reader1.getString()); - deserializedAzureWorkloadSapHanaPointInTimeRestoreRequest.withPropertyBag(propertyBag); - } else if ("targetInfo".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRestoreRequest - .withTargetInfo(TargetRestoreInfo.fromJson(reader)); - } else if ("recoveryMode".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRestoreRequest - .withRecoveryMode(RecoveryMode.fromString(reader.getString())); - } else if ("targetResourceGroupName".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRestoreRequest - .withTargetResourceGroupName(reader.getString()); - } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRestoreRequest - .withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails.fromJson(reader)); - } else if ("snapshotRestoreParameters".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRestoreRequest - .withSnapshotRestoreParameters(SnapshotRestoreParameters.fromJson(reader)); - } else if ("targetVirtualMachineId".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRestoreRequest - .withTargetVirtualMachineId(reader.getString()); - } else if ("objectType".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRestoreRequest.objectType = reader.getString(); - } else if ("pointInTime".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRestoreRequest.pointInTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadSapHanaPointInTimeRestoreRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.java deleted file mode 100644 index 839faaf051e9..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.java +++ /dev/null @@ -1,267 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * AzureWorkload SAP Hana-specific restore with integrated rehydration of recovery point. - */ -@Fluent -public final class AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest - extends AzureWorkloadSapHanaPointInTimeRestoreRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest"; - - /* - * RP Rehydration Info - */ - private RecoveryPointRehydrationInfo recoveryPointRehydrationInfo; - - /** - * Creates an instance of AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest class. - */ - public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the recoveryPointRehydrationInfo property: RP Rehydration Info. - * - * @return the recoveryPointRehydrationInfo value. - */ - public RecoveryPointRehydrationInfo recoveryPointRehydrationInfo() { - return this.recoveryPointRehydrationInfo; - } - - /** - * Set the recoveryPointRehydrationInfo property: RP Rehydration Info. - * - * @param recoveryPointRehydrationInfo the recoveryPointRehydrationInfo value to set. - * @return the AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest object itself. - */ - public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest - withRecoveryPointRehydrationInfo(RecoveryPointRehydrationInfo recoveryPointRehydrationInfo) { - this.recoveryPointRehydrationInfo = recoveryPointRehydrationInfo; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest withPointInTime(OffsetDateTime pointInTime) { - super.withPointInTime(pointInTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest withRecoveryType(RecoveryType recoveryType) { - super.withRecoveryType(recoveryType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest withPropertyBag(Map propertyBag) { - super.withPropertyBag(propertyBag); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest withTargetInfo(TargetRestoreInfo targetInfo) { - super.withTargetInfo(targetInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest withRecoveryMode(RecoveryMode recoveryMode) { - super.withRecoveryMode(recoveryMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest - withTargetResourceGroupName(String targetResourceGroupName) { - super.withTargetResourceGroupName(targetResourceGroupName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest - withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails) { - super.withUserAssignedManagedIdentityDetails(userAssignedManagedIdentityDetails); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest - withSnapshotRestoreParameters(SnapshotRestoreParameters snapshotRestoreParameters) { - super.withSnapshotRestoreParameters(snapshotRestoreParameters); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest - withTargetVirtualMachineId(String targetVirtualMachineId) { - super.withTargetVirtualMachineId(targetVirtualMachineId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("recoveryType", recoveryType() == null ? null : recoveryType().toString()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeMapField("propertyBag", propertyBag(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("targetInfo", targetInfo()); - jsonWriter.writeStringField("recoveryMode", recoveryMode() == null ? null : recoveryMode().toString()); - jsonWriter.writeStringField("targetResourceGroupName", targetResourceGroupName()); - jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", userAssignedManagedIdentityDetails()); - jsonWriter.writeJsonField("snapshotRestoreParameters", snapshotRestoreParameters()); - jsonWriter.writeStringField("targetVirtualMachineId", targetVirtualMachineId()); - jsonWriter.writeStringField("pointInTime", - pointInTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(pointInTime())); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeJsonField("recoveryPointRehydrationInfo", this.recoveryPointRehydrationInfo); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest 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 - * AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest. - */ - public static AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest deserializedAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest - = new AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("recoveryType".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest - .withRecoveryType(RecoveryType.fromString(reader.getString())); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest - .withSourceResourceId(reader.getString()); - } else if ("propertyBag".equals(fieldName)) { - Map propertyBag = reader.readMap(reader1 -> reader1.getString()); - deserializedAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.withPropertyBag(propertyBag); - } else if ("targetInfo".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest - .withTargetInfo(TargetRestoreInfo.fromJson(reader)); - } else if ("recoveryMode".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest - .withRecoveryMode(RecoveryMode.fromString(reader.getString())); - } else if ("targetResourceGroupName".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest - .withTargetResourceGroupName(reader.getString()); - } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest - .withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails.fromJson(reader)); - } else if ("snapshotRestoreParameters".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest - .withSnapshotRestoreParameters(SnapshotRestoreParameters.fromJson(reader)); - } else if ("targetVirtualMachineId".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest - .withTargetVirtualMachineId(reader.getString()); - } else if ("pointInTime".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.withPointInTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("objectType".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.objectType - = reader.getString(); - } else if ("recoveryPointRehydrationInfo".equals(fieldName)) { - deserializedAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.recoveryPointRehydrationInfo - = RecoveryPointRehydrationInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRecoveryPoint.java deleted file mode 100644 index 09458f1bca18..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRecoveryPoint.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * SAPHana specific recoverypoint, specifically encapsulates full/diff recoverypoints. - */ -@Immutable -public final class AzureWorkloadSapHanaRecoveryPoint extends AzureWorkloadRecoveryPoint { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureWorkloadSAPHanaRecoveryPoint"; - - /** - * Creates an instance of AzureWorkloadSapHanaRecoveryPoint class. - */ - private AzureWorkloadSapHanaRecoveryPoint() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("threatStatus", threatStatus() == null ? null : threatStatus().toString()); - jsonWriter.writeArrayField("threatInfo", threatInfo(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("recoveryPointTimeInUTC", - recoveryPointTimeInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(recoveryPointTimeInUtc())); - jsonWriter.writeStringField("type", type() == null ? null : type().toString()); - jsonWriter.writeArrayField("recoveryPointTierDetails", recoveryPointTierDetails(), - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeMapField("recoveryPointMoveReadinessInfo", recoveryPointMoveReadinessInfo(), - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("recoveryPointProperties", recoveryPointProperties()); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadSapHanaRecoveryPoint from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadSapHanaRecoveryPoint 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 AzureWorkloadSapHanaRecoveryPoint. - */ - public static AzureWorkloadSapHanaRecoveryPoint fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadSapHanaRecoveryPoint deserializedAzureWorkloadSapHanaRecoveryPoint - = new AzureWorkloadSapHanaRecoveryPoint(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("threatStatus".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRecoveryPoint - .withThreatStatus(ThreatStatus.fromString(reader.getString())); - } else if ("threatInfo".equals(fieldName)) { - List threatInfo = reader.readArray(reader1 -> ThreatInfo.fromJson(reader1)); - deserializedAzureWorkloadSapHanaRecoveryPoint.withThreatInfo(threatInfo); - } else if ("recoveryPointTimeInUTC".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRecoveryPoint.withRecoveryPointTimeInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("type".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRecoveryPoint - .withType(RestorePointType.fromString(reader.getString())); - } else if ("recoveryPointTierDetails".equals(fieldName)) { - List recoveryPointTierDetails - = reader.readArray(reader1 -> RecoveryPointTierInformationV2.fromJson(reader1)); - deserializedAzureWorkloadSapHanaRecoveryPoint - .withRecoveryPointTierDetails(recoveryPointTierDetails); - } else if ("recoveryPointMoveReadinessInfo".equals(fieldName)) { - Map recoveryPointMoveReadinessInfo - = reader.readMap(reader1 -> RecoveryPointMoveReadinessInfo.fromJson(reader1)); - deserializedAzureWorkloadSapHanaRecoveryPoint - .withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); - } else if ("recoveryPointProperties".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRecoveryPoint - .withRecoveryPointProperties(RecoveryPointProperties.fromJson(reader)); - } else if ("objectType".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRecoveryPoint.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadSapHanaRecoveryPoint; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreRequest.java deleted file mode 100644 index a35dc020201b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreRequest.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * AzureWorkload SAP Hana-specific restore. - */ -@Fluent -public class AzureWorkloadSapHanaRestoreRequest extends AzureWorkloadRestoreRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureWorkloadSAPHanaRestoreRequest"; - - /** - * Creates an instance of AzureWorkloadSapHanaRestoreRequest class. - */ - public AzureWorkloadSapHanaRestoreRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaRestoreRequest withRecoveryType(RecoveryType recoveryType) { - super.withRecoveryType(recoveryType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaRestoreRequest withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaRestoreRequest withPropertyBag(Map propertyBag) { - super.withPropertyBag(propertyBag); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) { - super.withTargetInfo(targetInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) { - super.withRecoveryMode(recoveryMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaRestoreRequest withTargetResourceGroupName(String targetResourceGroupName) { - super.withTargetResourceGroupName(targetResourceGroupName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaRestoreRequest - withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails) { - super.withUserAssignedManagedIdentityDetails(userAssignedManagedIdentityDetails); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaRestoreRequest - withSnapshotRestoreParameters(SnapshotRestoreParameters snapshotRestoreParameters) { - super.withSnapshotRestoreParameters(snapshotRestoreParameters); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { - super.withTargetVirtualMachineId(targetVirtualMachineId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaRestoreRequest - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("recoveryType", recoveryType() == null ? null : recoveryType().toString()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeMapField("propertyBag", propertyBag(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("targetInfo", targetInfo()); - jsonWriter.writeStringField("recoveryMode", recoveryMode() == null ? null : recoveryMode().toString()); - jsonWriter.writeStringField("targetResourceGroupName", targetResourceGroupName()); - jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", userAssignedManagedIdentityDetails()); - jsonWriter.writeJsonField("snapshotRestoreParameters", snapshotRestoreParameters()); - jsonWriter.writeStringField("targetVirtualMachineId", targetVirtualMachineId()); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadSapHanaRestoreRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadSapHanaRestoreRequest 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 AzureWorkloadSapHanaRestoreRequest. - */ - public static AzureWorkloadSapHanaRestoreRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureWorkloadSAPHanaRestoreWithRehydrateRequest".equals(discriminatorValue)) { - return AzureWorkloadSapHanaRestoreWithRehydrateRequest.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadSAPHanaPointInTimeRestoreRequest".equals(discriminatorValue)) { - return AzureWorkloadSapHanaPointInTimeRestoreRequest - .fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest".equals(discriminatorValue)) { - return AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AzureWorkloadSapHanaRestoreRequest fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadSapHanaRestoreRequest deserializedAzureWorkloadSapHanaRestoreRequest - = new AzureWorkloadSapHanaRestoreRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureWorkloadSapHanaRestoreRequest - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("recoveryType".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRestoreRequest - .withRecoveryType(RecoveryType.fromString(reader.getString())); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRestoreRequest.withSourceResourceId(reader.getString()); - } else if ("propertyBag".equals(fieldName)) { - Map propertyBag = reader.readMap(reader1 -> reader1.getString()); - deserializedAzureWorkloadSapHanaRestoreRequest.withPropertyBag(propertyBag); - } else if ("targetInfo".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRestoreRequest.withTargetInfo(TargetRestoreInfo.fromJson(reader)); - } else if ("recoveryMode".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRestoreRequest - .withRecoveryMode(RecoveryMode.fromString(reader.getString())); - } else if ("targetResourceGroupName".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRestoreRequest.withTargetResourceGroupName(reader.getString()); - } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRestoreRequest - .withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails.fromJson(reader)); - } else if ("snapshotRestoreParameters".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRestoreRequest - .withSnapshotRestoreParameters(SnapshotRestoreParameters.fromJson(reader)); - } else if ("targetVirtualMachineId".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRestoreRequest.withTargetVirtualMachineId(reader.getString()); - } else if ("objectType".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRestoreRequest.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadSapHanaRestoreRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreWithRehydrateRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreWithRehydrateRequest.java deleted file mode 100644 index 4f3c8f261c6a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSapHanaRestoreWithRehydrateRequest.java +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * AzureWorkload SAP Hana-specific restore with integrated rehydration of recovery point. - */ -@Fluent -public final class AzureWorkloadSapHanaRestoreWithRehydrateRequest extends AzureWorkloadSapHanaRestoreRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureWorkloadSAPHanaRestoreWithRehydrateRequest"; - - /* - * RP Rehydration Info - */ - private RecoveryPointRehydrationInfo recoveryPointRehydrationInfo; - - /** - * Creates an instance of AzureWorkloadSapHanaRestoreWithRehydrateRequest class. - */ - public AzureWorkloadSapHanaRestoreWithRehydrateRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the recoveryPointRehydrationInfo property: RP Rehydration Info. - * - * @return the recoveryPointRehydrationInfo value. - */ - public RecoveryPointRehydrationInfo recoveryPointRehydrationInfo() { - return this.recoveryPointRehydrationInfo; - } - - /** - * Set the recoveryPointRehydrationInfo property: RP Rehydration Info. - * - * @param recoveryPointRehydrationInfo the recoveryPointRehydrationInfo value to set. - * @return the AzureWorkloadSapHanaRestoreWithRehydrateRequest object itself. - */ - public AzureWorkloadSapHanaRestoreWithRehydrateRequest - withRecoveryPointRehydrationInfo(RecoveryPointRehydrationInfo recoveryPointRehydrationInfo) { - this.recoveryPointRehydrationInfo = recoveryPointRehydrationInfo; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaRestoreWithRehydrateRequest withRecoveryType(RecoveryType recoveryType) { - super.withRecoveryType(recoveryType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaRestoreWithRehydrateRequest withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaRestoreWithRehydrateRequest withPropertyBag(Map propertyBag) { - super.withPropertyBag(propertyBag); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaRestoreWithRehydrateRequest withTargetInfo(TargetRestoreInfo targetInfo) { - super.withTargetInfo(targetInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaRestoreWithRehydrateRequest withRecoveryMode(RecoveryMode recoveryMode) { - super.withRecoveryMode(recoveryMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaRestoreWithRehydrateRequest withTargetResourceGroupName(String targetResourceGroupName) { - super.withTargetResourceGroupName(targetResourceGroupName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaRestoreWithRehydrateRequest - withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails) { - super.withUserAssignedManagedIdentityDetails(userAssignedManagedIdentityDetails); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaRestoreWithRehydrateRequest - withSnapshotRestoreParameters(SnapshotRestoreParameters snapshotRestoreParameters) { - super.withSnapshotRestoreParameters(snapshotRestoreParameters); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaRestoreWithRehydrateRequest withTargetVirtualMachineId(String targetVirtualMachineId) { - super.withTargetVirtualMachineId(targetVirtualMachineId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSapHanaRestoreWithRehydrateRequest - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("recoveryType", recoveryType() == null ? null : recoveryType().toString()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeMapField("propertyBag", propertyBag(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("targetInfo", targetInfo()); - jsonWriter.writeStringField("recoveryMode", recoveryMode() == null ? null : recoveryMode().toString()); - jsonWriter.writeStringField("targetResourceGroupName", targetResourceGroupName()); - jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", userAssignedManagedIdentityDetails()); - jsonWriter.writeJsonField("snapshotRestoreParameters", snapshotRestoreParameters()); - jsonWriter.writeStringField("targetVirtualMachineId", targetVirtualMachineId()); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeJsonField("recoveryPointRehydrationInfo", this.recoveryPointRehydrationInfo); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadSapHanaRestoreWithRehydrateRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadSapHanaRestoreWithRehydrateRequest 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 AzureWorkloadSapHanaRestoreWithRehydrateRequest. - */ - public static AzureWorkloadSapHanaRestoreWithRehydrateRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadSapHanaRestoreWithRehydrateRequest deserializedAzureWorkloadSapHanaRestoreWithRehydrateRequest - = new AzureWorkloadSapHanaRestoreWithRehydrateRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureWorkloadSapHanaRestoreWithRehydrateRequest - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("recoveryType".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRestoreWithRehydrateRequest - .withRecoveryType(RecoveryType.fromString(reader.getString())); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRestoreWithRehydrateRequest - .withSourceResourceId(reader.getString()); - } else if ("propertyBag".equals(fieldName)) { - Map propertyBag = reader.readMap(reader1 -> reader1.getString()); - deserializedAzureWorkloadSapHanaRestoreWithRehydrateRequest.withPropertyBag(propertyBag); - } else if ("targetInfo".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRestoreWithRehydrateRequest - .withTargetInfo(TargetRestoreInfo.fromJson(reader)); - } else if ("recoveryMode".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRestoreWithRehydrateRequest - .withRecoveryMode(RecoveryMode.fromString(reader.getString())); - } else if ("targetResourceGroupName".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRestoreWithRehydrateRequest - .withTargetResourceGroupName(reader.getString()); - } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRestoreWithRehydrateRequest - .withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails.fromJson(reader)); - } else if ("snapshotRestoreParameters".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRestoreWithRehydrateRequest - .withSnapshotRestoreParameters(SnapshotRestoreParameters.fromJson(reader)); - } else if ("targetVirtualMachineId".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRestoreWithRehydrateRequest - .withTargetVirtualMachineId(reader.getString()); - } else if ("objectType".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRestoreWithRehydrateRequest.objectType = reader.getString(); - } else if ("recoveryPointRehydrationInfo".equals(fieldName)) { - deserializedAzureWorkloadSapHanaRestoreWithRehydrateRequest.recoveryPointRehydrationInfo - = RecoveryPointRehydrationInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadSapHanaRestoreWithRehydrateRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlAutoProtectionIntent.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlAutoProtectionIntent.java deleted file mode 100644 index b7757d5e5f6b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlAutoProtectionIntent.java +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure Workload SQL Auto Protection intent item. - */ -@Fluent -public final class AzureWorkloadSqlAutoProtectionIntent extends AzureWorkloadAutoProtectionIntent { - /* - * backup protectionIntent type. - */ - private ProtectionIntentItemType protectionIntentItemType - = ProtectionIntentItemType.AZURE_WORKLOAD_SQLAUTO_PROTECTION_INTENT; - - /* - * Workload item type of the item for which intent is to be set - */ - private WorkloadItemType workloadItemType; - - /** - * Creates an instance of AzureWorkloadSqlAutoProtectionIntent class. - */ - public AzureWorkloadSqlAutoProtectionIntent() { - } - - /** - * Get the protectionIntentItemType property: backup protectionIntent type. - * - * @return the protectionIntentItemType value. - */ - @Override - public ProtectionIntentItemType protectionIntentItemType() { - return this.protectionIntentItemType; - } - - /** - * Get the workloadItemType property: Workload item type of the item for which intent is to be set. - * - * @return the workloadItemType value. - */ - public WorkloadItemType workloadItemType() { - return this.workloadItemType; - } - - /** - * Set the workloadItemType property: Workload item type of the item for which intent is to be set. - * - * @param workloadItemType the workloadItemType value to set. - * @return the AzureWorkloadSqlAutoProtectionIntent object itself. - */ - public AzureWorkloadSqlAutoProtectionIntent withWorkloadItemType(WorkloadItemType workloadItemType) { - this.workloadItemType = workloadItemType; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlAutoProtectionIntent withBackupManagementType(BackupManagementType backupManagementType) { - super.withBackupManagementType(backupManagementType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlAutoProtectionIntent withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlAutoProtectionIntent withItemId(String itemId) { - super.withItemId(itemId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlAutoProtectionIntent withPolicyId(String policyId) { - super.withPolicyId(policyId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlAutoProtectionIntent withProtectionState(ProtectionStatus protectionState) { - super.withProtectionState(protectionState); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("itemId", itemId()); - jsonWriter.writeStringField("policyId", policyId()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("protectionIntentItemType", - this.protectionIntentItemType == null ? null : this.protectionIntentItemType.toString()); - jsonWriter.writeStringField("workloadItemType", - this.workloadItemType == null ? null : this.workloadItemType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadSqlAutoProtectionIntent from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadSqlAutoProtectionIntent 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 AzureWorkloadSqlAutoProtectionIntent. - */ - public static AzureWorkloadSqlAutoProtectionIntent fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadSqlAutoProtectionIntent deserializedAzureWorkloadSqlAutoProtectionIntent - = new AzureWorkloadSqlAutoProtectionIntent(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedAzureWorkloadSqlAutoProtectionIntent - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureWorkloadSqlAutoProtectionIntent.withSourceResourceId(reader.getString()); - } else if ("itemId".equals(fieldName)) { - deserializedAzureWorkloadSqlAutoProtectionIntent.withItemId(reader.getString()); - } else if ("policyId".equals(fieldName)) { - deserializedAzureWorkloadSqlAutoProtectionIntent.withPolicyId(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedAzureWorkloadSqlAutoProtectionIntent - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("protectionIntentItemType".equals(fieldName)) { - deserializedAzureWorkloadSqlAutoProtectionIntent.protectionIntentItemType - = ProtectionIntentItemType.fromString(reader.getString()); - } else if ("workloadItemType".equals(fieldName)) { - deserializedAzureWorkloadSqlAutoProtectionIntent.workloadItemType - = WorkloadItemType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadSqlAutoProtectionIntent; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRecoveryPoint.java deleted file mode 100644 index b18a4bdf409a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRecoveryPoint.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * Recovery point specific to PointInTime. - */ -@Immutable -public final class AzureWorkloadSqlPointInTimeRecoveryPoint extends AzureWorkloadSqlRecoveryPoint { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureWorkloadSQLPointInTimeRecoveryPoint"; - - /* - * List of log ranges - */ - private List timeRanges; - - /** - * Creates an instance of AzureWorkloadSqlPointInTimeRecoveryPoint class. - */ - private AzureWorkloadSqlPointInTimeRecoveryPoint() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the timeRanges property: List of log ranges. - * - * @return the timeRanges value. - */ - public List timeRanges() { - return this.timeRanges; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("threatStatus", threatStatus() == null ? null : threatStatus().toString()); - jsonWriter.writeArrayField("threatInfo", threatInfo(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("recoveryPointTimeInUTC", - recoveryPointTimeInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(recoveryPointTimeInUtc())); - jsonWriter.writeStringField("type", type() == null ? null : type().toString()); - jsonWriter.writeArrayField("recoveryPointTierDetails", recoveryPointTierDetails(), - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeMapField("recoveryPointMoveReadinessInfo", recoveryPointMoveReadinessInfo(), - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("recoveryPointProperties", recoveryPointProperties()); - jsonWriter.writeJsonField("extendedInfo", extendedInfo()); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeArrayField("timeRanges", this.timeRanges, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadSqlPointInTimeRecoveryPoint from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadSqlPointInTimeRecoveryPoint 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 AzureWorkloadSqlPointInTimeRecoveryPoint. - */ - public static AzureWorkloadSqlPointInTimeRecoveryPoint fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadSqlPointInTimeRecoveryPoint deserializedAzureWorkloadSqlPointInTimeRecoveryPoint - = new AzureWorkloadSqlPointInTimeRecoveryPoint(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("threatStatus".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRecoveryPoint - .withThreatStatus(ThreatStatus.fromString(reader.getString())); - } else if ("threatInfo".equals(fieldName)) { - List threatInfo = reader.readArray(reader1 -> ThreatInfo.fromJson(reader1)); - deserializedAzureWorkloadSqlPointInTimeRecoveryPoint.withThreatInfo(threatInfo); - } else if ("recoveryPointTimeInUTC".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRecoveryPoint.withRecoveryPointTimeInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("type".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRecoveryPoint - .withType(RestorePointType.fromString(reader.getString())); - } else if ("recoveryPointTierDetails".equals(fieldName)) { - List recoveryPointTierDetails - = reader.readArray(reader1 -> RecoveryPointTierInformationV2.fromJson(reader1)); - deserializedAzureWorkloadSqlPointInTimeRecoveryPoint - .withRecoveryPointTierDetails(recoveryPointTierDetails); - } else if ("recoveryPointMoveReadinessInfo".equals(fieldName)) { - Map recoveryPointMoveReadinessInfo - = reader.readMap(reader1 -> RecoveryPointMoveReadinessInfo.fromJson(reader1)); - deserializedAzureWorkloadSqlPointInTimeRecoveryPoint - .withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); - } else if ("recoveryPointProperties".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRecoveryPoint - .withRecoveryPointProperties(RecoveryPointProperties.fromJson(reader)); - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRecoveryPoint - .withExtendedInfo(AzureWorkloadSqlRecoveryPointExtendedInfo.fromJson(reader)); - } else if ("objectType".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRecoveryPoint.objectType = reader.getString(); - } else if ("timeRanges".equals(fieldName)) { - List timeRanges = reader.readArray(reader1 -> PointInTimeRange.fromJson(reader1)); - deserializedAzureWorkloadSqlPointInTimeRecoveryPoint.timeRanges = timeRanges; - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadSqlPointInTimeRecoveryPoint; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreRequest.java deleted file mode 100644 index 096d51236979..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreRequest.java +++ /dev/null @@ -1,316 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * AzureWorkload SQL -specific restore. Specifically for PointInTime/Log restore. - */ -@Fluent -public class AzureWorkloadSqlPointInTimeRestoreRequest extends AzureWorkloadSqlRestoreRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureWorkloadSQLPointInTimeRestoreRequest"; - - /* - * PointInTime value - */ - private OffsetDateTime pointInTime; - - /** - * Creates an instance of AzureWorkloadSqlPointInTimeRestoreRequest class. - */ - public AzureWorkloadSqlPointInTimeRestoreRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the pointInTime property: PointInTime value. - * - * @return the pointInTime value. - */ - public OffsetDateTime pointInTime() { - return this.pointInTime; - } - - /** - * Set the pointInTime property: PointInTime value. - * - * @param pointInTime the pointInTime value to set. - * @return the AzureWorkloadSqlPointInTimeRestoreRequest object itself. - */ - public AzureWorkloadSqlPointInTimeRestoreRequest withPointInTime(OffsetDateTime pointInTime) { - this.pointInTime = pointInTime; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequest - withShouldUseAlternateTargetLocation(Boolean shouldUseAlternateTargetLocation) { - super.withShouldUseAlternateTargetLocation(shouldUseAlternateTargetLocation); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequest withIsNonRecoverable(Boolean isNonRecoverable) { - super.withIsNonRecoverable(isNonRecoverable); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequest - withAlternateDirectoryPaths(List alternateDirectoryPaths) { - super.withAlternateDirectoryPaths(alternateDirectoryPaths); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequest withRecoveryType(RecoveryType recoveryType) { - super.withRecoveryType(recoveryType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequest withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequest withPropertyBag(Map propertyBag) { - super.withPropertyBag(propertyBag); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) { - super.withTargetInfo(targetInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) { - super.withRecoveryMode(recoveryMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequest withTargetResourceGroupName(String targetResourceGroupName) { - super.withTargetResourceGroupName(targetResourceGroupName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequest - withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails) { - super.withUserAssignedManagedIdentityDetails(userAssignedManagedIdentityDetails); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequest - withSnapshotRestoreParameters(SnapshotRestoreParameters snapshotRestoreParameters) { - super.withSnapshotRestoreParameters(snapshotRestoreParameters); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { - super.withTargetVirtualMachineId(targetVirtualMachineId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreRequest - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("recoveryType", recoveryType() == null ? null : recoveryType().toString()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeMapField("propertyBag", propertyBag(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("targetInfo", targetInfo()); - jsonWriter.writeStringField("recoveryMode", recoveryMode() == null ? null : recoveryMode().toString()); - jsonWriter.writeStringField("targetResourceGroupName", targetResourceGroupName()); - jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", userAssignedManagedIdentityDetails()); - jsonWriter.writeJsonField("snapshotRestoreParameters", snapshotRestoreParameters()); - jsonWriter.writeStringField("targetVirtualMachineId", targetVirtualMachineId()); - jsonWriter.writeBooleanField("shouldUseAlternateTargetLocation", shouldUseAlternateTargetLocation()); - jsonWriter.writeBooleanField("isNonRecoverable", isNonRecoverable()); - jsonWriter.writeArrayField("alternateDirectoryPaths", alternateDirectoryPaths(), - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("pointInTime", - this.pointInTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.pointInTime)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadSqlPointInTimeRestoreRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadSqlPointInTimeRestoreRequest 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 AzureWorkloadSqlPointInTimeRestoreRequest. - */ - public static AzureWorkloadSqlPointInTimeRestoreRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest".equals(discriminatorValue)) { - return AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AzureWorkloadSqlPointInTimeRestoreRequest fromJsonKnownDiscriminator(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadSqlPointInTimeRestoreRequest deserializedAzureWorkloadSqlPointInTimeRestoreRequest - = new AzureWorkloadSqlPointInTimeRestoreRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureWorkloadSqlPointInTimeRestoreRequest - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("recoveryType".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreRequest - .withRecoveryType(RecoveryType.fromString(reader.getString())); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreRequest.withSourceResourceId(reader.getString()); - } else if ("propertyBag".equals(fieldName)) { - Map propertyBag = reader.readMap(reader1 -> reader1.getString()); - deserializedAzureWorkloadSqlPointInTimeRestoreRequest.withPropertyBag(propertyBag); - } else if ("targetInfo".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreRequest - .withTargetInfo(TargetRestoreInfo.fromJson(reader)); - } else if ("recoveryMode".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreRequest - .withRecoveryMode(RecoveryMode.fromString(reader.getString())); - } else if ("targetResourceGroupName".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreRequest - .withTargetResourceGroupName(reader.getString()); - } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreRequest - .withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails.fromJson(reader)); - } else if ("snapshotRestoreParameters".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreRequest - .withSnapshotRestoreParameters(SnapshotRestoreParameters.fromJson(reader)); - } else if ("targetVirtualMachineId".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreRequest - .withTargetVirtualMachineId(reader.getString()); - } else if ("shouldUseAlternateTargetLocation".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreRequest - .withShouldUseAlternateTargetLocation(reader.getNullable(JsonReader::getBoolean)); - } else if ("isNonRecoverable".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreRequest - .withIsNonRecoverable(reader.getNullable(JsonReader::getBoolean)); - } else if ("alternateDirectoryPaths".equals(fieldName)) { - List alternateDirectoryPaths - = reader.readArray(reader1 -> SqlDataDirectoryMapping.fromJson(reader1)); - deserializedAzureWorkloadSqlPointInTimeRestoreRequest - .withAlternateDirectoryPaths(alternateDirectoryPaths); - } else if ("objectType".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreRequest.objectType = reader.getString(); - } else if ("pointInTime".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreRequest.pointInTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadSqlPointInTimeRestoreRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.java deleted file mode 100644 index 560469279de2..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.java +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * AzureWorkload SQL-specific restore with integrated rehydration of recovery point. - */ -@Fluent -public final class AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - extends AzureWorkloadSqlPointInTimeRestoreRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest"; - - /* - * RP Rehydration Info - */ - private RecoveryPointRehydrationInfo recoveryPointRehydrationInfo; - - /** - * Creates an instance of AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest class. - */ - public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the recoveryPointRehydrationInfo property: RP Rehydration Info. - * - * @return the recoveryPointRehydrationInfo value. - */ - public RecoveryPointRehydrationInfo recoveryPointRehydrationInfo() { - return this.recoveryPointRehydrationInfo; - } - - /** - * Set the recoveryPointRehydrationInfo property: RP Rehydration Info. - * - * @param recoveryPointRehydrationInfo the recoveryPointRehydrationInfo value to set. - * @return the AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest object itself. - */ - public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - withRecoveryPointRehydrationInfo(RecoveryPointRehydrationInfo recoveryPointRehydrationInfo) { - this.recoveryPointRehydrationInfo = recoveryPointRehydrationInfo; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest withPointInTime(OffsetDateTime pointInTime) { - super.withPointInTime(pointInTime); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - withShouldUseAlternateTargetLocation(Boolean shouldUseAlternateTargetLocation) { - super.withShouldUseAlternateTargetLocation(shouldUseAlternateTargetLocation); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest withIsNonRecoverable(Boolean isNonRecoverable) { - super.withIsNonRecoverable(isNonRecoverable); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - withAlternateDirectoryPaths(List alternateDirectoryPaths) { - super.withAlternateDirectoryPaths(alternateDirectoryPaths); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest withRecoveryType(RecoveryType recoveryType) { - super.withRecoveryType(recoveryType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest withPropertyBag(Map propertyBag) { - super.withPropertyBag(propertyBag); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest withTargetInfo(TargetRestoreInfo targetInfo) { - super.withTargetInfo(targetInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest withRecoveryMode(RecoveryMode recoveryMode) { - super.withRecoveryMode(recoveryMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - withTargetResourceGroupName(String targetResourceGroupName) { - super.withTargetResourceGroupName(targetResourceGroupName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails) { - super.withUserAssignedManagedIdentityDetails(userAssignedManagedIdentityDetails); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - withSnapshotRestoreParameters(SnapshotRestoreParameters snapshotRestoreParameters) { - super.withSnapshotRestoreParameters(snapshotRestoreParameters); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - withTargetVirtualMachineId(String targetVirtualMachineId) { - super.withTargetVirtualMachineId(targetVirtualMachineId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("recoveryType", recoveryType() == null ? null : recoveryType().toString()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeMapField("propertyBag", propertyBag(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("targetInfo", targetInfo()); - jsonWriter.writeStringField("recoveryMode", recoveryMode() == null ? null : recoveryMode().toString()); - jsonWriter.writeStringField("targetResourceGroupName", targetResourceGroupName()); - jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", userAssignedManagedIdentityDetails()); - jsonWriter.writeJsonField("snapshotRestoreParameters", snapshotRestoreParameters()); - jsonWriter.writeStringField("targetVirtualMachineId", targetVirtualMachineId()); - jsonWriter.writeBooleanField("shouldUseAlternateTargetLocation", shouldUseAlternateTargetLocation()); - jsonWriter.writeBooleanField("isNonRecoverable", isNonRecoverable()); - jsonWriter.writeArrayField("alternateDirectoryPaths", alternateDirectoryPaths(), - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("pointInTime", - pointInTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(pointInTime())); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeJsonField("recoveryPointRehydrationInfo", this.recoveryPointRehydrationInfo); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest 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 AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest. - */ - public static AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest deserializedAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - = new AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("recoveryType".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - .withRecoveryType(RecoveryType.fromString(reader.getString())); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - .withSourceResourceId(reader.getString()); - } else if ("propertyBag".equals(fieldName)) { - Map propertyBag = reader.readMap(reader1 -> reader1.getString()); - deserializedAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.withPropertyBag(propertyBag); - } else if ("targetInfo".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - .withTargetInfo(TargetRestoreInfo.fromJson(reader)); - } else if ("recoveryMode".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - .withRecoveryMode(RecoveryMode.fromString(reader.getString())); - } else if ("targetResourceGroupName".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - .withTargetResourceGroupName(reader.getString()); - } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - .withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails.fromJson(reader)); - } else if ("snapshotRestoreParameters".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - .withSnapshotRestoreParameters(SnapshotRestoreParameters.fromJson(reader)); - } else if ("targetVirtualMachineId".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - .withTargetVirtualMachineId(reader.getString()); - } else if ("shouldUseAlternateTargetLocation".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - .withShouldUseAlternateTargetLocation(reader.getNullable(JsonReader::getBoolean)); - } else if ("isNonRecoverable".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - .withIsNonRecoverable(reader.getNullable(JsonReader::getBoolean)); - } else if ("alternateDirectoryPaths".equals(fieldName)) { - List alternateDirectoryPaths - = reader.readArray(reader1 -> SqlDataDirectoryMapping.fromJson(reader1)); - deserializedAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest - .withAlternateDirectoryPaths(alternateDirectoryPaths); - } else if ("pointInTime".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.withPointInTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("objectType".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.objectType = reader.getString(); - } else if ("recoveryPointRehydrationInfo".equals(fieldName)) { - deserializedAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.recoveryPointRehydrationInfo - = RecoveryPointRehydrationInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPoint.java deleted file mode 100644 index 41bb96362b43..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPoint.java +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint along with extended info. - */ -@Immutable -public class AzureWorkloadSqlRecoveryPoint extends AzureWorkloadRecoveryPoint { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureWorkloadSQLRecoveryPoint"; - - /* - * Extended Info that provides data directory details. Will be populated in two cases: - * When a specific recovery point is accessed using GetRecoveryPoint - * Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter - */ - private AzureWorkloadSqlRecoveryPointExtendedInfo extendedInfo; - - /** - * Creates an instance of AzureWorkloadSqlRecoveryPoint class. - */ - protected AzureWorkloadSqlRecoveryPoint() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the extendedInfo property: Extended Info that provides data directory details. Will be populated in two - * cases: - * When a specific recovery point is accessed using GetRecoveryPoint - * Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter. - * - * @return the extendedInfo value. - */ - public AzureWorkloadSqlRecoveryPointExtendedInfo extendedInfo() { - return this.extendedInfo; - } - - /** - * Set the extendedInfo property: Extended Info that provides data directory details. Will be populated in two - * cases: - * When a specific recovery point is accessed using GetRecoveryPoint - * Or when ListRecoveryPoints is called for Log RP only with ExtendedInfo query filter. - * - * @param extendedInfo the extendedInfo value to set. - * @return the AzureWorkloadSqlRecoveryPoint object itself. - */ - AzureWorkloadSqlRecoveryPoint withExtendedInfo(AzureWorkloadSqlRecoveryPointExtendedInfo extendedInfo) { - this.extendedInfo = extendedInfo; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("threatStatus", threatStatus() == null ? null : threatStatus().toString()); - jsonWriter.writeArrayField("threatInfo", threatInfo(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("recoveryPointTimeInUTC", - recoveryPointTimeInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(recoveryPointTimeInUtc())); - jsonWriter.writeStringField("type", type() == null ? null : type().toString()); - jsonWriter.writeArrayField("recoveryPointTierDetails", recoveryPointTierDetails(), - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeMapField("recoveryPointMoveReadinessInfo", recoveryPointMoveReadinessInfo(), - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("recoveryPointProperties", recoveryPointProperties()); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeJsonField("extendedInfo", this.extendedInfo); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadSqlRecoveryPoint from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadSqlRecoveryPoint 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 AzureWorkloadSqlRecoveryPoint. - */ - public static AzureWorkloadSqlRecoveryPoint fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureWorkloadSQLPointInTimeRecoveryPoint".equals(discriminatorValue)) { - return AzureWorkloadSqlPointInTimeRecoveryPoint.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AzureWorkloadSqlRecoveryPoint fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadSqlRecoveryPoint deserializedAzureWorkloadSqlRecoveryPoint - = new AzureWorkloadSqlRecoveryPoint(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("threatStatus".equals(fieldName)) { - deserializedAzureWorkloadSqlRecoveryPoint - .withThreatStatus(ThreatStatus.fromString(reader.getString())); - } else if ("threatInfo".equals(fieldName)) { - List threatInfo = reader.readArray(reader1 -> ThreatInfo.fromJson(reader1)); - deserializedAzureWorkloadSqlRecoveryPoint.withThreatInfo(threatInfo); - } else if ("recoveryPointTimeInUTC".equals(fieldName)) { - deserializedAzureWorkloadSqlRecoveryPoint.withRecoveryPointTimeInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("type".equals(fieldName)) { - deserializedAzureWorkloadSqlRecoveryPoint.withType(RestorePointType.fromString(reader.getString())); - } else if ("recoveryPointTierDetails".equals(fieldName)) { - List recoveryPointTierDetails - = reader.readArray(reader1 -> RecoveryPointTierInformationV2.fromJson(reader1)); - deserializedAzureWorkloadSqlRecoveryPoint.withRecoveryPointTierDetails(recoveryPointTierDetails); - } else if ("recoveryPointMoveReadinessInfo".equals(fieldName)) { - Map recoveryPointMoveReadinessInfo - = reader.readMap(reader1 -> RecoveryPointMoveReadinessInfo.fromJson(reader1)); - deserializedAzureWorkloadSqlRecoveryPoint - .withRecoveryPointMoveReadinessInfo(recoveryPointMoveReadinessInfo); - } else if ("recoveryPointProperties".equals(fieldName)) { - deserializedAzureWorkloadSqlRecoveryPoint - .withRecoveryPointProperties(RecoveryPointProperties.fromJson(reader)); - } else if ("objectType".equals(fieldName)) { - deserializedAzureWorkloadSqlRecoveryPoint.objectType = reader.getString(); - } else if ("extendedInfo".equals(fieldName)) { - deserializedAzureWorkloadSqlRecoveryPoint.extendedInfo - = AzureWorkloadSqlRecoveryPointExtendedInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadSqlRecoveryPoint; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPointExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPointExtendedInfo.java deleted file mode 100644 index 8ae1ec730bb6..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRecoveryPointExtendedInfo.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Extended info class details. - */ -@Immutable -public final class AzureWorkloadSqlRecoveryPointExtendedInfo - implements JsonSerializable { - /* - * UTC time at which data directory info was captured - */ - private OffsetDateTime dataDirectoryTimeInUtc; - - /* - * List of data directory paths during restore operation. - */ - private List dataDirectoryPaths; - - /* - * List of databases included in recovery point. - */ - private List includedDatabases; - - /** - * Creates an instance of AzureWorkloadSqlRecoveryPointExtendedInfo class. - */ - private AzureWorkloadSqlRecoveryPointExtendedInfo() { - } - - /** - * Get the dataDirectoryTimeInUtc property: UTC time at which data directory info was captured. - * - * @return the dataDirectoryTimeInUtc value. - */ - public OffsetDateTime dataDirectoryTimeInUtc() { - return this.dataDirectoryTimeInUtc; - } - - /** - * Get the dataDirectoryPaths property: List of data directory paths during restore operation. - * - * @return the dataDirectoryPaths value. - */ - public List dataDirectoryPaths() { - return this.dataDirectoryPaths; - } - - /** - * Get the includedDatabases property: List of databases included in recovery point. - * - * @return the includedDatabases value. - */ - public List includedDatabases() { - return this.includedDatabases; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("dataDirectoryTimeInUTC", - this.dataDirectoryTimeInUtc == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.dataDirectoryTimeInUtc)); - jsonWriter.writeArrayField("dataDirectoryPaths", this.dataDirectoryPaths, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("includedDatabases", this.includedDatabases, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadSqlRecoveryPointExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadSqlRecoveryPointExtendedInfo 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 AzureWorkloadSqlRecoveryPointExtendedInfo. - */ - public static AzureWorkloadSqlRecoveryPointExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadSqlRecoveryPointExtendedInfo deserializedAzureWorkloadSqlRecoveryPointExtendedInfo - = new AzureWorkloadSqlRecoveryPointExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("dataDirectoryTimeInUTC".equals(fieldName)) { - deserializedAzureWorkloadSqlRecoveryPointExtendedInfo.dataDirectoryTimeInUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("dataDirectoryPaths".equals(fieldName)) { - List dataDirectoryPaths - = reader.readArray(reader1 -> SqlDataDirectory.fromJson(reader1)); - deserializedAzureWorkloadSqlRecoveryPointExtendedInfo.dataDirectoryPaths = dataDirectoryPaths; - } else if ("includedDatabases".equals(fieldName)) { - List includedDatabases = reader.readArray(reader1 -> DatabaseInRP.fromJson(reader1)); - deserializedAzureWorkloadSqlRecoveryPointExtendedInfo.includedDatabases = includedDatabases; - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadSqlRecoveryPointExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreRequest.java deleted file mode 100644 index 1173f4998816..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreRequest.java +++ /dev/null @@ -1,334 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * AzureWorkload SQL -specific restore. Specifically for full/diff restore. - */ -@Fluent -public class AzureWorkloadSqlRestoreRequest extends AzureWorkloadRestoreRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureWorkloadSQLRestoreRequest"; - - /* - * Default option set to true. If this is set to false, alternate data directory must be provided - */ - private Boolean shouldUseAlternateTargetLocation; - - /* - * SQL specific property where user can chose to set no-recovery when restore operation is tried - */ - private Boolean isNonRecoverable; - - /* - * Data directory details - */ - private List alternateDirectoryPaths; - - /** - * Creates an instance of AzureWorkloadSqlRestoreRequest class. - */ - public AzureWorkloadSqlRestoreRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the shouldUseAlternateTargetLocation property: Default option set to true. If this is set to false, alternate - * data directory must be provided. - * - * @return the shouldUseAlternateTargetLocation value. - */ - public Boolean shouldUseAlternateTargetLocation() { - return this.shouldUseAlternateTargetLocation; - } - - /** - * Set the shouldUseAlternateTargetLocation property: Default option set to true. If this is set to false, alternate - * data directory must be provided. - * - * @param shouldUseAlternateTargetLocation the shouldUseAlternateTargetLocation value to set. - * @return the AzureWorkloadSqlRestoreRequest object itself. - */ - public AzureWorkloadSqlRestoreRequest - withShouldUseAlternateTargetLocation(Boolean shouldUseAlternateTargetLocation) { - this.shouldUseAlternateTargetLocation = shouldUseAlternateTargetLocation; - return this; - } - - /** - * Get the isNonRecoverable property: SQL specific property where user can chose to set no-recovery when restore - * operation is tried. - * - * @return the isNonRecoverable value. - */ - public Boolean isNonRecoverable() { - return this.isNonRecoverable; - } - - /** - * Set the isNonRecoverable property: SQL specific property where user can chose to set no-recovery when restore - * operation is tried. - * - * @param isNonRecoverable the isNonRecoverable value to set. - * @return the AzureWorkloadSqlRestoreRequest object itself. - */ - public AzureWorkloadSqlRestoreRequest withIsNonRecoverable(Boolean isNonRecoverable) { - this.isNonRecoverable = isNonRecoverable; - return this; - } - - /** - * Get the alternateDirectoryPaths property: Data directory details. - * - * @return the alternateDirectoryPaths value. - */ - public List alternateDirectoryPaths() { - return this.alternateDirectoryPaths; - } - - /** - * Set the alternateDirectoryPaths property: Data directory details. - * - * @param alternateDirectoryPaths the alternateDirectoryPaths value to set. - * @return the AzureWorkloadSqlRestoreRequest object itself. - */ - public AzureWorkloadSqlRestoreRequest - withAlternateDirectoryPaths(List alternateDirectoryPaths) { - this.alternateDirectoryPaths = alternateDirectoryPaths; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreRequest withRecoveryType(RecoveryType recoveryType) { - super.withRecoveryType(recoveryType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreRequest withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreRequest withPropertyBag(Map propertyBag) { - super.withPropertyBag(propertyBag); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreRequest withTargetInfo(TargetRestoreInfo targetInfo) { - super.withTargetInfo(targetInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreRequest withRecoveryMode(RecoveryMode recoveryMode) { - super.withRecoveryMode(recoveryMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreRequest withTargetResourceGroupName(String targetResourceGroupName) { - super.withTargetResourceGroupName(targetResourceGroupName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreRequest - withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails) { - super.withUserAssignedManagedIdentityDetails(userAssignedManagedIdentityDetails); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreRequest - withSnapshotRestoreParameters(SnapshotRestoreParameters snapshotRestoreParameters) { - super.withSnapshotRestoreParameters(snapshotRestoreParameters); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { - super.withTargetVirtualMachineId(targetVirtualMachineId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreRequest - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("recoveryType", recoveryType() == null ? null : recoveryType().toString()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeMapField("propertyBag", propertyBag(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("targetInfo", targetInfo()); - jsonWriter.writeStringField("recoveryMode", recoveryMode() == null ? null : recoveryMode().toString()); - jsonWriter.writeStringField("targetResourceGroupName", targetResourceGroupName()); - jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", userAssignedManagedIdentityDetails()); - jsonWriter.writeJsonField("snapshotRestoreParameters", snapshotRestoreParameters()); - jsonWriter.writeStringField("targetVirtualMachineId", targetVirtualMachineId()); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeBooleanField("shouldUseAlternateTargetLocation", this.shouldUseAlternateTargetLocation); - jsonWriter.writeBooleanField("isNonRecoverable", this.isNonRecoverable); - jsonWriter.writeArrayField("alternateDirectoryPaths", this.alternateDirectoryPaths, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadSqlRestoreRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadSqlRestoreRequest 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 AzureWorkloadSqlRestoreRequest. - */ - public static AzureWorkloadSqlRestoreRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureWorkloadSQLRestoreWithRehydrateRequest".equals(discriminatorValue)) { - return AzureWorkloadSqlRestoreWithRehydrateRequest.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadSQLPointInTimeRestoreRequest".equals(discriminatorValue)) { - return AzureWorkloadSqlPointInTimeRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest".equals(discriminatorValue)) { - return AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AzureWorkloadSqlRestoreRequest fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadSqlRestoreRequest deserializedAzureWorkloadSqlRestoreRequest - = new AzureWorkloadSqlRestoreRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureWorkloadSqlRestoreRequest - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("recoveryType".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreRequest - .withRecoveryType(RecoveryType.fromString(reader.getString())); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreRequest.withSourceResourceId(reader.getString()); - } else if ("propertyBag".equals(fieldName)) { - Map propertyBag = reader.readMap(reader1 -> reader1.getString()); - deserializedAzureWorkloadSqlRestoreRequest.withPropertyBag(propertyBag); - } else if ("targetInfo".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreRequest.withTargetInfo(TargetRestoreInfo.fromJson(reader)); - } else if ("recoveryMode".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreRequest - .withRecoveryMode(RecoveryMode.fromString(reader.getString())); - } else if ("targetResourceGroupName".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreRequest.withTargetResourceGroupName(reader.getString()); - } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreRequest - .withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails.fromJson(reader)); - } else if ("snapshotRestoreParameters".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreRequest - .withSnapshotRestoreParameters(SnapshotRestoreParameters.fromJson(reader)); - } else if ("targetVirtualMachineId".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreRequest.withTargetVirtualMachineId(reader.getString()); - } else if ("objectType".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreRequest.objectType = reader.getString(); - } else if ("shouldUseAlternateTargetLocation".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreRequest.shouldUseAlternateTargetLocation - = reader.getNullable(JsonReader::getBoolean); - } else if ("isNonRecoverable".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreRequest.isNonRecoverable - = reader.getNullable(JsonReader::getBoolean); - } else if ("alternateDirectoryPaths".equals(fieldName)) { - List alternateDirectoryPaths - = reader.readArray(reader1 -> SqlDataDirectoryMapping.fromJson(reader1)); - deserializedAzureWorkloadSqlRestoreRequest.alternateDirectoryPaths = alternateDirectoryPaths; - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadSqlRestoreRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreWithRehydrateRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreWithRehydrateRequest.java deleted file mode 100644 index 0807a2ee28b7..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureWorkloadSqlRestoreWithRehydrateRequest.java +++ /dev/null @@ -1,287 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * AzureWorkload SQL-specific restore with integrated rehydration of recovery point. - */ -@Fluent -public final class AzureWorkloadSqlRestoreWithRehydrateRequest extends AzureWorkloadSqlRestoreRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "AzureWorkloadSQLRestoreWithRehydrateRequest"; - - /* - * RP Rehydration Info - */ - private RecoveryPointRehydrationInfo recoveryPointRehydrationInfo; - - /** - * Creates an instance of AzureWorkloadSqlRestoreWithRehydrateRequest class. - */ - public AzureWorkloadSqlRestoreWithRehydrateRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the recoveryPointRehydrationInfo property: RP Rehydration Info. - * - * @return the recoveryPointRehydrationInfo value. - */ - public RecoveryPointRehydrationInfo recoveryPointRehydrationInfo() { - return this.recoveryPointRehydrationInfo; - } - - /** - * Set the recoveryPointRehydrationInfo property: RP Rehydration Info. - * - * @param recoveryPointRehydrationInfo the recoveryPointRehydrationInfo value to set. - * @return the AzureWorkloadSqlRestoreWithRehydrateRequest object itself. - */ - public AzureWorkloadSqlRestoreWithRehydrateRequest - withRecoveryPointRehydrationInfo(RecoveryPointRehydrationInfo recoveryPointRehydrationInfo) { - this.recoveryPointRehydrationInfo = recoveryPointRehydrationInfo; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreWithRehydrateRequest - withShouldUseAlternateTargetLocation(Boolean shouldUseAlternateTargetLocation) { - super.withShouldUseAlternateTargetLocation(shouldUseAlternateTargetLocation); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreWithRehydrateRequest withIsNonRecoverable(Boolean isNonRecoverable) { - super.withIsNonRecoverable(isNonRecoverable); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreWithRehydrateRequest - withAlternateDirectoryPaths(List alternateDirectoryPaths) { - super.withAlternateDirectoryPaths(alternateDirectoryPaths); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreWithRehydrateRequest withRecoveryType(RecoveryType recoveryType) { - super.withRecoveryType(recoveryType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreWithRehydrateRequest withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreWithRehydrateRequest withPropertyBag(Map propertyBag) { - super.withPropertyBag(propertyBag); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreWithRehydrateRequest withTargetInfo(TargetRestoreInfo targetInfo) { - super.withTargetInfo(targetInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreWithRehydrateRequest withRecoveryMode(RecoveryMode recoveryMode) { - super.withRecoveryMode(recoveryMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreWithRehydrateRequest withTargetResourceGroupName(String targetResourceGroupName) { - super.withTargetResourceGroupName(targetResourceGroupName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreWithRehydrateRequest - withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails) { - super.withUserAssignedManagedIdentityDetails(userAssignedManagedIdentityDetails); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreWithRehydrateRequest - withSnapshotRestoreParameters(SnapshotRestoreParameters snapshotRestoreParameters) { - super.withSnapshotRestoreParameters(snapshotRestoreParameters); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreWithRehydrateRequest withTargetVirtualMachineId(String targetVirtualMachineId) { - super.withTargetVirtualMachineId(targetVirtualMachineId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureWorkloadSqlRestoreWithRehydrateRequest - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("recoveryType", recoveryType() == null ? null : recoveryType().toString()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeMapField("propertyBag", propertyBag(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("targetInfo", targetInfo()); - jsonWriter.writeStringField("recoveryMode", recoveryMode() == null ? null : recoveryMode().toString()); - jsonWriter.writeStringField("targetResourceGroupName", targetResourceGroupName()); - jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", userAssignedManagedIdentityDetails()); - jsonWriter.writeJsonField("snapshotRestoreParameters", snapshotRestoreParameters()); - jsonWriter.writeStringField("targetVirtualMachineId", targetVirtualMachineId()); - jsonWriter.writeBooleanField("shouldUseAlternateTargetLocation", shouldUseAlternateTargetLocation()); - jsonWriter.writeBooleanField("isNonRecoverable", isNonRecoverable()); - jsonWriter.writeArrayField("alternateDirectoryPaths", alternateDirectoryPaths(), - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeJsonField("recoveryPointRehydrationInfo", this.recoveryPointRehydrationInfo); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureWorkloadSqlRestoreWithRehydrateRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureWorkloadSqlRestoreWithRehydrateRequest 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 AzureWorkloadSqlRestoreWithRehydrateRequest. - */ - public static AzureWorkloadSqlRestoreWithRehydrateRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureWorkloadSqlRestoreWithRehydrateRequest deserializedAzureWorkloadSqlRestoreWithRehydrateRequest - = new AzureWorkloadSqlRestoreWithRehydrateRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedAzureWorkloadSqlRestoreWithRehydrateRequest - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("recoveryType".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreWithRehydrateRequest - .withRecoveryType(RecoveryType.fromString(reader.getString())); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreWithRehydrateRequest.withSourceResourceId(reader.getString()); - } else if ("propertyBag".equals(fieldName)) { - Map propertyBag = reader.readMap(reader1 -> reader1.getString()); - deserializedAzureWorkloadSqlRestoreWithRehydrateRequest.withPropertyBag(propertyBag); - } else if ("targetInfo".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreWithRehydrateRequest - .withTargetInfo(TargetRestoreInfo.fromJson(reader)); - } else if ("recoveryMode".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreWithRehydrateRequest - .withRecoveryMode(RecoveryMode.fromString(reader.getString())); - } else if ("targetResourceGroupName".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreWithRehydrateRequest - .withTargetResourceGroupName(reader.getString()); - } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreWithRehydrateRequest - .withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails.fromJson(reader)); - } else if ("snapshotRestoreParameters".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreWithRehydrateRequest - .withSnapshotRestoreParameters(SnapshotRestoreParameters.fromJson(reader)); - } else if ("targetVirtualMachineId".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreWithRehydrateRequest - .withTargetVirtualMachineId(reader.getString()); - } else if ("shouldUseAlternateTargetLocation".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreWithRehydrateRequest - .withShouldUseAlternateTargetLocation(reader.getNullable(JsonReader::getBoolean)); - } else if ("isNonRecoverable".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreWithRehydrateRequest - .withIsNonRecoverable(reader.getNullable(JsonReader::getBoolean)); - } else if ("alternateDirectoryPaths".equals(fieldName)) { - List alternateDirectoryPaths - = reader.readArray(reader1 -> SqlDataDirectoryMapping.fromJson(reader1)); - deserializedAzureWorkloadSqlRestoreWithRehydrateRequest - .withAlternateDirectoryPaths(alternateDirectoryPaths); - } else if ("objectType".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreWithRehydrateRequest.objectType = reader.getString(); - } else if ("recoveryPointRehydrationInfo".equals(fieldName)) { - deserializedAzureWorkloadSqlRestoreWithRehydrateRequest.recoveryPointRehydrationInfo - = RecoveryPointRehydrationInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureWorkloadSqlRestoreWithRehydrateRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineBase.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineBase.java deleted file mode 100644 index f87fca89bf71..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineBase.java +++ /dev/null @@ -1,443 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The base backup engine class. All workload specific backup engines derive from this class. - */ -@Immutable -public class BackupEngineBase implements JsonSerializable { - /* - * Type of the backup engine. - */ - private BackupEngineType backupEngineType = BackupEngineType.fromString("BackupEngineBase"); - - /* - * Friendly name of the backup engine. - */ - private String friendlyName; - - /* - * Type of backup management for the backup engine. - */ - private BackupManagementType backupManagementType; - - /* - * Registration status of the backup engine with the Recovery Services Vault. - */ - private String registrationStatus; - - /* - * Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed} - */ - private String backupEngineState; - - /* - * Backup status of the backup engine. - */ - private String healthStatus; - - /* - * Flag indicating if the backup engine be registered, once already registered. - */ - private Boolean canReRegister; - - /* - * ID of the backup engine. - */ - private String backupEngineId; - - /* - * Backup engine version - */ - private String dpmVersion; - - /* - * Backup agent version - */ - private String azureBackupAgentVersion; - - /* - * To check if backup agent upgrade available - */ - private Boolean isAzureBackupAgentUpgradeAvailable; - - /* - * To check if backup engine upgrade available - */ - private Boolean isDpmUpgradeAvailable; - - /* - * Extended info of the backupengine - */ - private BackupEngineExtendedInfo extendedInfo; - - /** - * Creates an instance of BackupEngineBase class. - */ - protected BackupEngineBase() { - } - - /** - * Get the backupEngineType property: Type of the backup engine. - * - * @return the backupEngineType value. - */ - public BackupEngineType backupEngineType() { - return this.backupEngineType; - } - - /** - * Get the friendlyName property: Friendly name of the backup engine. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.friendlyName; - } - - /** - * Set the friendlyName property: Friendly name of the backup engine. - * - * @param friendlyName the friendlyName value to set. - * @return the BackupEngineBase object itself. - */ - BackupEngineBase withFriendlyName(String friendlyName) { - this.friendlyName = friendlyName; - return this; - } - - /** - * Get the backupManagementType property: Type of backup management for the backup engine. - * - * @return the backupManagementType value. - */ - public BackupManagementType backupManagementType() { - return this.backupManagementType; - } - - /** - * Set the backupManagementType property: Type of backup management for the backup engine. - * - * @param backupManagementType the backupManagementType value to set. - * @return the BackupEngineBase object itself. - */ - BackupEngineBase withBackupManagementType(BackupManagementType backupManagementType) { - this.backupManagementType = backupManagementType; - return this; - } - - /** - * Get the registrationStatus property: Registration status of the backup engine with the Recovery Services Vault. - * - * @return the registrationStatus value. - */ - public String registrationStatus() { - return this.registrationStatus; - } - - /** - * Set the registrationStatus property: Registration status of the backup engine with the Recovery Services Vault. - * - * @param registrationStatus the registrationStatus value to set. - * @return the BackupEngineBase object itself. - */ - BackupEngineBase withRegistrationStatus(String registrationStatus) { - this.registrationStatus = registrationStatus; - return this; - } - - /** - * Get the backupEngineState property: Status of the backup engine with the Recovery Services Vault. = - * {Active/Deleting/DeleteFailed}. - * - * @return the backupEngineState value. - */ - public String backupEngineState() { - return this.backupEngineState; - } - - /** - * Set the backupEngineState property: Status of the backup engine with the Recovery Services Vault. = - * {Active/Deleting/DeleteFailed}. - * - * @param backupEngineState the backupEngineState value to set. - * @return the BackupEngineBase object itself. - */ - BackupEngineBase withBackupEngineState(String backupEngineState) { - this.backupEngineState = backupEngineState; - return this; - } - - /** - * Get the healthStatus property: Backup status of the backup engine. - * - * @return the healthStatus value. - */ - public String healthStatus() { - return this.healthStatus; - } - - /** - * Set the healthStatus property: Backup status of the backup engine. - * - * @param healthStatus the healthStatus value to set. - * @return the BackupEngineBase object itself. - */ - BackupEngineBase withHealthStatus(String healthStatus) { - this.healthStatus = healthStatus; - return this; - } - - /** - * Get the canReRegister property: Flag indicating if the backup engine be registered, once already registered. - * - * @return the canReRegister value. - */ - public Boolean canReRegister() { - return this.canReRegister; - } - - /** - * Set the canReRegister property: Flag indicating if the backup engine be registered, once already registered. - * - * @param canReRegister the canReRegister value to set. - * @return the BackupEngineBase object itself. - */ - BackupEngineBase withCanReRegister(Boolean canReRegister) { - this.canReRegister = canReRegister; - return this; - } - - /** - * Get the backupEngineId property: ID of the backup engine. - * - * @return the backupEngineId value. - */ - public String backupEngineId() { - return this.backupEngineId; - } - - /** - * Set the backupEngineId property: ID of the backup engine. - * - * @param backupEngineId the backupEngineId value to set. - * @return the BackupEngineBase object itself. - */ - BackupEngineBase withBackupEngineId(String backupEngineId) { - this.backupEngineId = backupEngineId; - return this; - } - - /** - * Get the dpmVersion property: Backup engine version. - * - * @return the dpmVersion value. - */ - public String dpmVersion() { - return this.dpmVersion; - } - - /** - * Set the dpmVersion property: Backup engine version. - * - * @param dpmVersion the dpmVersion value to set. - * @return the BackupEngineBase object itself. - */ - BackupEngineBase withDpmVersion(String dpmVersion) { - this.dpmVersion = dpmVersion; - return this; - } - - /** - * Get the azureBackupAgentVersion property: Backup agent version. - * - * @return the azureBackupAgentVersion value. - */ - public String azureBackupAgentVersion() { - return this.azureBackupAgentVersion; - } - - /** - * Set the azureBackupAgentVersion property: Backup agent version. - * - * @param azureBackupAgentVersion the azureBackupAgentVersion value to set. - * @return the BackupEngineBase object itself. - */ - BackupEngineBase withAzureBackupAgentVersion(String azureBackupAgentVersion) { - this.azureBackupAgentVersion = azureBackupAgentVersion; - return this; - } - - /** - * Get the isAzureBackupAgentUpgradeAvailable property: To check if backup agent upgrade available. - * - * @return the isAzureBackupAgentUpgradeAvailable value. - */ - public Boolean isAzureBackupAgentUpgradeAvailable() { - return this.isAzureBackupAgentUpgradeAvailable; - } - - /** - * Set the isAzureBackupAgentUpgradeAvailable property: To check if backup agent upgrade available. - * - * @param isAzureBackupAgentUpgradeAvailable the isAzureBackupAgentUpgradeAvailable value to set. - * @return the BackupEngineBase object itself. - */ - BackupEngineBase withIsAzureBackupAgentUpgradeAvailable(Boolean isAzureBackupAgentUpgradeAvailable) { - this.isAzureBackupAgentUpgradeAvailable = isAzureBackupAgentUpgradeAvailable; - return this; - } - - /** - * Get the isDpmUpgradeAvailable property: To check if backup engine upgrade available. - * - * @return the isDpmUpgradeAvailable value. - */ - public Boolean isDpmUpgradeAvailable() { - return this.isDpmUpgradeAvailable; - } - - /** - * Set the isDpmUpgradeAvailable property: To check if backup engine upgrade available. - * - * @param isDpmUpgradeAvailable the isDpmUpgradeAvailable value to set. - * @return the BackupEngineBase object itself. - */ - BackupEngineBase withIsDpmUpgradeAvailable(Boolean isDpmUpgradeAvailable) { - this.isDpmUpgradeAvailable = isDpmUpgradeAvailable; - return this; - } - - /** - * Get the extendedInfo property: Extended info of the backupengine. - * - * @return the extendedInfo value. - */ - public BackupEngineExtendedInfo extendedInfo() { - return this.extendedInfo; - } - - /** - * Set the extendedInfo property: Extended info of the backupengine. - * - * @param extendedInfo the extendedInfo value to set. - * @return the BackupEngineBase object itself. - */ - BackupEngineBase withExtendedInfo(BackupEngineExtendedInfo extendedInfo) { - this.extendedInfo = extendedInfo; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupEngineType", - this.backupEngineType == null ? null : this.backupEngineType.toString()); - jsonWriter.writeStringField("friendlyName", this.friendlyName); - jsonWriter.writeStringField("backupManagementType", - this.backupManagementType == null ? null : this.backupManagementType.toString()); - jsonWriter.writeStringField("registrationStatus", this.registrationStatus); - jsonWriter.writeStringField("backupEngineState", this.backupEngineState); - jsonWriter.writeStringField("healthStatus", this.healthStatus); - jsonWriter.writeBooleanField("canReRegister", this.canReRegister); - jsonWriter.writeStringField("backupEngineId", this.backupEngineId); - jsonWriter.writeStringField("dpmVersion", this.dpmVersion); - jsonWriter.writeStringField("azureBackupAgentVersion", this.azureBackupAgentVersion); - jsonWriter.writeBooleanField("isAzureBackupAgentUpgradeAvailable", this.isAzureBackupAgentUpgradeAvailable); - jsonWriter.writeBooleanField("isDpmUpgradeAvailable", this.isDpmUpgradeAvailable); - jsonWriter.writeJsonField("extendedInfo", this.extendedInfo); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupEngineBase from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupEngineBase 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 BackupEngineBase. - */ - public static BackupEngineBase fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("backupEngineType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureBackupServerEngine".equals(discriminatorValue)) { - return AzureBackupServerEngine.fromJson(readerToUse.reset()); - } else if ("DpmBackupEngine".equals(discriminatorValue)) { - return DpmBackupEngine.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static BackupEngineBase fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupEngineBase deserializedBackupEngineBase = new BackupEngineBase(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupEngineType".equals(fieldName)) { - deserializedBackupEngineBase.backupEngineType = BackupEngineType.fromString(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedBackupEngineBase.friendlyName = reader.getString(); - } else if ("backupManagementType".equals(fieldName)) { - deserializedBackupEngineBase.backupManagementType - = BackupManagementType.fromString(reader.getString()); - } else if ("registrationStatus".equals(fieldName)) { - deserializedBackupEngineBase.registrationStatus = reader.getString(); - } else if ("backupEngineState".equals(fieldName)) { - deserializedBackupEngineBase.backupEngineState = reader.getString(); - } else if ("healthStatus".equals(fieldName)) { - deserializedBackupEngineBase.healthStatus = reader.getString(); - } else if ("canReRegister".equals(fieldName)) { - deserializedBackupEngineBase.canReRegister = reader.getNullable(JsonReader::getBoolean); - } else if ("backupEngineId".equals(fieldName)) { - deserializedBackupEngineBase.backupEngineId = reader.getString(); - } else if ("dpmVersion".equals(fieldName)) { - deserializedBackupEngineBase.dpmVersion = reader.getString(); - } else if ("azureBackupAgentVersion".equals(fieldName)) { - deserializedBackupEngineBase.azureBackupAgentVersion = reader.getString(); - } else if ("isAzureBackupAgentUpgradeAvailable".equals(fieldName)) { - deserializedBackupEngineBase.isAzureBackupAgentUpgradeAvailable - = reader.getNullable(JsonReader::getBoolean); - } else if ("isDpmUpgradeAvailable".equals(fieldName)) { - deserializedBackupEngineBase.isDpmUpgradeAvailable = reader.getNullable(JsonReader::getBoolean); - } else if ("extendedInfo".equals(fieldName)) { - deserializedBackupEngineBase.extendedInfo = BackupEngineExtendedInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupEngineBase; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineBaseResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineBaseResource.java deleted file mode 100644 index ee5afe58dd87..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineBaseResource.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupEngineBaseResourceInner; -import java.util.Map; - -/** - * An immutable client-side representation of BackupEngineBaseResource. - */ -public interface BackupEngineBaseResource { - /** - * 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: BackupEngineBaseResource properties. - * - * @return the properties value. - */ - BackupEngineBase properties(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the etag property: Optional ETag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupEngineBaseResourceInner - * object. - * - * @return the inner object. - */ - BackupEngineBaseResourceInner innerModel(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineExtendedInfo.java deleted file mode 100644 index 728c12108d2d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineExtendedInfo.java +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Additional information on backup engine. - */ -@Immutable -public final class BackupEngineExtendedInfo implements JsonSerializable { - /* - * Database name of backup engine. - */ - private String databaseName; - - /* - * Number of protected items in the backup engine. - */ - private Integer protectedItemsCount; - - /* - * Number of protected servers in the backup engine. - */ - private Integer protectedServersCount; - - /* - * Number of disks in the backup engine. - */ - private Integer diskCount; - - /* - * Disk space used in the backup engine. - */ - private Double usedDiskSpace; - - /* - * Disk space currently available in the backup engine. - */ - private Double availableDiskSpace; - - /* - * Last refresh time in the backup engine. - */ - private OffsetDateTime refreshedAt; - - /* - * Protected instances in the backup engine. - */ - private Integer azureProtectedInstances; - - /** - * Creates an instance of BackupEngineExtendedInfo class. - */ - private BackupEngineExtendedInfo() { - } - - /** - * Get the databaseName property: Database name of backup engine. - * - * @return the databaseName value. - */ - public String databaseName() { - return this.databaseName; - } - - /** - * Get the protectedItemsCount property: Number of protected items in the backup engine. - * - * @return the protectedItemsCount value. - */ - public Integer protectedItemsCount() { - return this.protectedItemsCount; - } - - /** - * Get the protectedServersCount property: Number of protected servers in the backup engine. - * - * @return the protectedServersCount value. - */ - public Integer protectedServersCount() { - return this.protectedServersCount; - } - - /** - * Get the diskCount property: Number of disks in the backup engine. - * - * @return the diskCount value. - */ - public Integer diskCount() { - return this.diskCount; - } - - /** - * Get the usedDiskSpace property: Disk space used in the backup engine. - * - * @return the usedDiskSpace value. - */ - public Double usedDiskSpace() { - return this.usedDiskSpace; - } - - /** - * Get the availableDiskSpace property: Disk space currently available in the backup engine. - * - * @return the availableDiskSpace value. - */ - public Double availableDiskSpace() { - return this.availableDiskSpace; - } - - /** - * Get the refreshedAt property: Last refresh time in the backup engine. - * - * @return the refreshedAt value. - */ - public OffsetDateTime refreshedAt() { - return this.refreshedAt; - } - - /** - * Get the azureProtectedInstances property: Protected instances in the backup engine. - * - * @return the azureProtectedInstances value. - */ - public Integer azureProtectedInstances() { - return this.azureProtectedInstances; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("databaseName", this.databaseName); - jsonWriter.writeNumberField("protectedItemsCount", this.protectedItemsCount); - jsonWriter.writeNumberField("protectedServersCount", this.protectedServersCount); - jsonWriter.writeNumberField("diskCount", this.diskCount); - jsonWriter.writeNumberField("usedDiskSpace", this.usedDiskSpace); - jsonWriter.writeNumberField("availableDiskSpace", this.availableDiskSpace); - jsonWriter.writeStringField("refreshedAt", - this.refreshedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.refreshedAt)); - jsonWriter.writeNumberField("azureProtectedInstances", this.azureProtectedInstances); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupEngineExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupEngineExtendedInfo 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 BackupEngineExtendedInfo. - */ - public static BackupEngineExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupEngineExtendedInfo deserializedBackupEngineExtendedInfo = new BackupEngineExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("databaseName".equals(fieldName)) { - deserializedBackupEngineExtendedInfo.databaseName = reader.getString(); - } else if ("protectedItemsCount".equals(fieldName)) { - deserializedBackupEngineExtendedInfo.protectedItemsCount = reader.getNullable(JsonReader::getInt); - } else if ("protectedServersCount".equals(fieldName)) { - deserializedBackupEngineExtendedInfo.protectedServersCount = reader.getNullable(JsonReader::getInt); - } else if ("diskCount".equals(fieldName)) { - deserializedBackupEngineExtendedInfo.diskCount = reader.getNullable(JsonReader::getInt); - } else if ("usedDiskSpace".equals(fieldName)) { - deserializedBackupEngineExtendedInfo.usedDiskSpace = reader.getNullable(JsonReader::getDouble); - } else if ("availableDiskSpace".equals(fieldName)) { - deserializedBackupEngineExtendedInfo.availableDiskSpace = reader.getNullable(JsonReader::getDouble); - } else if ("refreshedAt".equals(fieldName)) { - deserializedBackupEngineExtendedInfo.refreshedAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("azureProtectedInstances".equals(fieldName)) { - deserializedBackupEngineExtendedInfo.azureProtectedInstances - = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupEngineExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineType.java deleted file mode 100644 index 62a3bfaa71d0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngineType.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Type of the backup engine. - */ -public final class BackupEngineType extends ExpandableStringEnum { - /** - * Static value Invalid for BackupEngineType. - */ - public static final BackupEngineType INVALID = fromString("Invalid"); - - /** - * Static value DpmBackupEngine for BackupEngineType. - */ - public static final BackupEngineType DPM_BACKUP_ENGINE = fromString("DpmBackupEngine"); - - /** - * Static value AzureBackupServerEngine for BackupEngineType. - */ - public static final BackupEngineType AZURE_BACKUP_SERVER_ENGINE = fromString("AzureBackupServerEngine"); - - /** - * Creates a new instance of BackupEngineType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public BackupEngineType() { - } - - /** - * Creates or finds a BackupEngineType from its string representation. - * - * @param name a name to look for. - * @return the corresponding BackupEngineType. - */ - public static BackupEngineType fromString(String name) { - return fromString(name, BackupEngineType.class); - } - - /** - * Gets known BackupEngineType values. - * - * @return known BackupEngineType values. - */ - public static Collection values() { - return values(BackupEngineType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngines.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngines.java deleted file mode 100644 index ab70ec512e45..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupEngines.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of BackupEngines. - */ -public interface BackupEngines { - /** - * Returns backup management server registered to Recovery Services Vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param backupEngineName Name of the backup management server. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the base backup engine class along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, - String backupEngineName, String filter, String skipToken, Context context); - - /** - * Returns backup management server registered to Recovery Services Vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param backupEngineName Name of the backup management server. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the base backup engine class. - */ - BackupEngineBaseResource get(String vaultName, String resourceGroupName, String backupEngineName); - - /** - * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of BackupEngineBase resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName); - - /** - * Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of BackupEngineBase resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName, String filter, - String skipToken, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupItemType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupItemType.java deleted file mode 100644 index 57e21825e2e2..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupItemType.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Type of backup items associated with this container. - */ -public final class BackupItemType extends ExpandableStringEnum { - /** - * Static value Invalid for BackupItemType. - */ - public static final BackupItemType INVALID = fromString("Invalid"); - - /** - * Static value VM for BackupItemType. - */ - public static final BackupItemType VM = fromString("VM"); - - /** - * Static value FileFolder for BackupItemType. - */ - public static final BackupItemType FILE_FOLDER = fromString("FileFolder"); - - /** - * Static value AzureSqlDb for BackupItemType. - */ - public static final BackupItemType AZURE_SQL_DB = fromString("AzureSqlDb"); - - /** - * Static value SQLDB for BackupItemType. - */ - public static final BackupItemType SQLDB = fromString("SQLDB"); - - /** - * Static value Exchange for BackupItemType. - */ - public static final BackupItemType EXCHANGE = fromString("Exchange"); - - /** - * Static value Sharepoint for BackupItemType. - */ - public static final BackupItemType SHAREPOINT = fromString("Sharepoint"); - - /** - * Static value VMwareVM for BackupItemType. - */ - public static final BackupItemType VMWARE_VM = fromString("VMwareVM"); - - /** - * Static value SystemState for BackupItemType. - */ - public static final BackupItemType SYSTEM_STATE = fromString("SystemState"); - - /** - * Static value Client for BackupItemType. - */ - public static final BackupItemType CLIENT = fromString("Client"); - - /** - * Static value GenericDataSource for BackupItemType. - */ - public static final BackupItemType GENERIC_DATA_SOURCE = fromString("GenericDataSource"); - - /** - * Static value SQLDataBase for BackupItemType. - */ - public static final BackupItemType SQLDATA_BASE = fromString("SQLDataBase"); - - /** - * Static value AzureFileShare for BackupItemType. - */ - public static final BackupItemType AZURE_FILE_SHARE = fromString("AzureFileShare"); - - /** - * Static value SAPHanaDatabase for BackupItemType. - */ - public static final BackupItemType SAPHANA_DATABASE = fromString("SAPHanaDatabase"); - - /** - * Static value SAPAseDatabase for BackupItemType. - */ - public static final BackupItemType SAPASE_DATABASE = fromString("SAPAseDatabase"); - - /** - * Static value SAPHanaDBInstance for BackupItemType. - */ - public static final BackupItemType SAPHANA_DBINSTANCE = fromString("SAPHanaDBInstance"); - - /** - * Creates a new instance of BackupItemType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public BackupItemType() { - } - - /** - * Creates or finds a BackupItemType from its string representation. - * - * @param name a name to look for. - * @return the corresponding BackupItemType. - */ - public static BackupItemType fromString(String name) { - return fromString(name, BackupItemType.class); - } - - /** - * Gets known BackupItemType values. - * - * @return known BackupItemType values. - */ - public static Collection values() { - return values(BackupItemType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupJobs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupJobs.java deleted file mode 100644 index 951ff2131b49..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupJobs.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of BackupJobs. - */ -public interface BackupJobs { - /** - * Provides a pageable list of jobs. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Job resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName); - - /** - * Provides a pageable list of jobs. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Job resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName, String filter, String skipToken, - Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupManagementType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupManagementType.java deleted file mode 100644 index 6e2ff63383b7..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupManagementType.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Backup management type to execute the current job. - */ -public final class BackupManagementType extends ExpandableStringEnum { - /** - * Static value Invalid for BackupManagementType. - */ - public static final BackupManagementType INVALID = fromString("Invalid"); - - /** - * Static value AzureIaasVM for BackupManagementType. - */ - public static final BackupManagementType AZURE_IAAS_VM = fromString("AzureIaasVM"); - - /** - * Static value MAB for BackupManagementType. - */ - public static final BackupManagementType MAB = fromString("MAB"); - - /** - * Static value DPM for BackupManagementType. - */ - public static final BackupManagementType DPM = fromString("DPM"); - - /** - * Static value AzureBackupServer for BackupManagementType. - */ - public static final BackupManagementType AZURE_BACKUP_SERVER = fromString("AzureBackupServer"); - - /** - * Static value AzureSql for BackupManagementType. - */ - public static final BackupManagementType AZURE_SQL = fromString("AzureSql"); - - /** - * Static value AzureStorage for BackupManagementType. - */ - public static final BackupManagementType AZURE_STORAGE = fromString("AzureStorage"); - - /** - * Static value AzureWorkload for BackupManagementType. - */ - public static final BackupManagementType AZURE_WORKLOAD = fromString("AzureWorkload"); - - /** - * Static value DefaultBackup for BackupManagementType. - */ - public static final BackupManagementType DEFAULT_BACKUP = fromString("DefaultBackup"); - - /** - * Creates a new instance of BackupManagementType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public BackupManagementType() { - } - - /** - * Creates or finds a BackupManagementType from its string representation. - * - * @param name a name to look for. - * @return the corresponding BackupManagementType. - */ - public static BackupManagementType fromString(String name) { - return fromString(name, BackupManagementType.class); - } - - /** - * Gets known BackupManagementType values. - * - * @return known BackupManagementType values. - */ - public static Collection values() { - return values(BackupManagementType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupManagementUsage.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupManagementUsage.java deleted file mode 100644 index 6c921626e11f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupManagementUsage.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupManagementUsageInner; -import java.time.OffsetDateTime; - -/** - * An immutable client-side representation of BackupManagementUsage. - */ -public interface BackupManagementUsage { - /** - * Gets the unit property: Unit of the usage. - * - * @return the unit value. - */ - UsagesUnit unit(); - - /** - * Gets the quotaPeriod property: Quota period of usage. - * - * @return the quotaPeriod value. - */ - String quotaPeriod(); - - /** - * Gets the nextResetTime property: Next reset time of usage. - * - * @return the nextResetTime value. - */ - OffsetDateTime nextResetTime(); - - /** - * Gets the currentValue property: Current value of usage. - * - * @return the currentValue value. - */ - Long currentValue(); - - /** - * Gets the limit property: Limit of usage. - * - * @return the limit value. - */ - Long limit(); - - /** - * Gets the name property: Name of usage. - * - * @return the name value. - */ - NameInfo name(); - - /** - * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupManagementUsageInner object. - * - * @return the inner object. - */ - BackupManagementUsageInner innerModel(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupOperationResults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupOperationResults.java deleted file mode 100644 index cae3cb1a90bf..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupOperationResults.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of BackupOperationResults. - */ -public interface BackupOperationResults { - /** - * Provides the status of the delete operations such as deleting backed up item. Once the operation has started, the - * status code in the response would be Accepted. It will continue to be in this state till it reaches completion. - * On - * successful completion, the status code will be OK. This method expects OperationID as an argument. OperationID is - * part of the Location header of the operation response. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, String operationId, Context context); - - /** - * Provides the status of the delete operations such as deleting backed up item. Once the operation has started, the - * status code in the response would be Accepted. It will continue to be in this state till it reaches completion. - * On - * successful completion, the status code will be OK. This method expects OperationID as an argument. OperationID is - * part of the Location header of the operation response. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void get(String vaultName, String resourceGroupName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupOperationStatuses.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupOperationStatuses.java deleted file mode 100644 index d893305a0ffb..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupOperationStatuses.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of BackupOperationStatuses. - */ -public interface BackupOperationStatuses { - /** - * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations - * create jobs. This method returns the list of jobs when the operation is complete. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, String operationId, - Context context); - - /** - * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations - * create jobs. This method returns the list of jobs when the operation is complete. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status. - */ - OperationStatus get(String vaultName, String resourceGroupName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupPolicies.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupPolicies.java deleted file mode 100644 index 0c8052bdb9e5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupPolicies.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of BackupPolicies. - */ -public interface BackupPolicies { - /** - * Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch - * scoped results. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionPolicy resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName); - - /** - * Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch - * scoped results. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionPolicy resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName, String filter, - Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectableItems.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectableItems.java deleted file mode 100644 index 84e3f90029a6..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectableItems.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of BackupProtectableItems. - */ -public interface BackupProtectableItems { - /** - * Provides a pageable list of protectable objects within your subscription according to the query filter and the - * pagination parameters. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadProtectableItem resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName); - - /** - * Provides a pageable list of protectable objects within your subscription according to the query filter and the - * pagination parameters. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadProtectableItem resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName, String filter, - String skipToken, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectedItems.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectedItems.java deleted file mode 100644 index cf66e6f172c8..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectedItems.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of BackupProtectedItems. - */ -public interface BackupProtectedItems { - /** - * Provides a pageable list of all items that are backed up within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectedItem resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName); - - /** - * Provides a pageable list of all items that are backed up within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectedItem resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName, String filter, - String skipToken, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectionContainers.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectionContainers.java deleted file mode 100644 index ffe3cf241e25..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectionContainers.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of BackupProtectionContainers. - */ -public interface BackupProtectionContainers { - /** - * Lists the containers registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName); - - /** - * Lists the containers registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName, String filter, - Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectionIntents.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectionIntents.java deleted file mode 100644 index 6b9e8e4a31b0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectionIntents.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of BackupProtectionIntents. - */ -public interface BackupProtectionIntents { - /** - * Provides a pageable list of all intents that are present within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionIntent resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName); - - /** - * Provides a pageable list of all intents that are present within a vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionIntent resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName, String filter, - String skipToken, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupRequest.java deleted file mode 100644 index 7a7d27cc854a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupRequest.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Base class for backup request. Workload-specific backup requests are derived from this class. - */ -@Immutable -public class BackupRequest implements JsonSerializable { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "BackupRequest"; - - /** - * Creates an instance of BackupRequest class. - */ - public BackupRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - public String objectType() { - return this.objectType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupRequest 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 BackupRequest. - */ - public static BackupRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureFileShareBackupRequest".equals(discriminatorValue)) { - return AzureFileShareBackupRequest.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadBackupRequest".equals(discriminatorValue)) { - return AzureWorkloadBackupRequest.fromJson(readerToUse.reset()); - } else if ("IaasVMBackupRequest".equals(discriminatorValue)) { - return IaasVMBackupRequest.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static BackupRequest fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupRequest deserializedBackupRequest = new BackupRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedBackupRequest.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupRequestResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupRequestResource.java deleted file mode 100644 index 7627d631f9cf..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupRequestResource.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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 java.io.IOException; -import java.util.Map; - -/** - * Base class for backup request. Workload-specific backup requests are derived from this class. - */ -@Fluent -public final class BackupRequestResource extends ProxyResource { - /* - * Resource location. - */ - private String location; - - /* - * Resource tags. - */ - private Map tags; - - /* - * Optional ETag. - */ - private String eTag; - - /* - * BackupRequestResource properties - */ - private BackupRequest 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 BackupRequestResource class. - */ - public BackupRequestResource() { - } - - /** - * Get the location property: Resource location. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Resource location. - * - * @param location the location value to set. - * @return the BackupRequestResource object itself. - */ - public BackupRequestResource withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the BackupRequestResource object itself. - */ - public BackupRequestResource withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the eTag property: Optional ETag. - * - * @return the eTag value. - */ - public String eTag() { - return this.eTag; - } - - /** - * Set the eTag property: Optional ETag. - * - * @param eTag the eTag value to set. - * @return the BackupRequestResource object itself. - */ - public BackupRequestResource withETag(String eTag) { - this.eTag = eTag; - return this; - } - - /** - * Get the properties property: BackupRequestResource properties. - * - * @return the properties value. - */ - public BackupRequest properties() { - return this.properties; - } - - /** - * Set the properties property: BackupRequestResource properties. - * - * @param properties the properties value to set. - * @return the BackupRequestResource object itself. - */ - public BackupRequestResource withProperties(BackupRequest properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("eTag", this.eTag); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupRequestResource from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupRequestResource 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 BackupRequestResource. - */ - public static BackupRequestResource fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupRequestResource deserializedBackupRequestResource = new BackupRequestResource(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedBackupRequestResource.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedBackupRequestResource.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedBackupRequestResource.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedBackupRequestResource.location = reader.getString(); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedBackupRequestResource.tags = tags; - } else if ("eTag".equals(fieldName)) { - deserializedBackupRequestResource.eTag = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedBackupRequestResource.properties = BackupRequest.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedBackupRequestResource.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupRequestResource; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceConfig.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceConfig.java deleted file mode 100644 index 39d39618a3ba..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceConfig.java +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The resource storage details. - */ -@Fluent -public final class BackupResourceConfig implements JsonSerializable { - /* - * Storage type - */ - private StorageType storageModelType; - - /* - * Storage type. - */ - private StorageType storageType; - - /* - * Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. - */ - private StorageTypeState storageTypeState; - - /* - * Opt in details of Cross Region Restore feature. - */ - private Boolean crossRegionRestoreFlag; - - /* - * Vault Dedup state - */ - private DedupState dedupState; - - /* - * Vault x-cool state - */ - private XcoolState xcoolState; - - /** - * Creates an instance of BackupResourceConfig class. - */ - public BackupResourceConfig() { - } - - /** - * Get the storageModelType property: Storage type. - * - * @return the storageModelType value. - */ - public StorageType storageModelType() { - return this.storageModelType; - } - - /** - * Set the storageModelType property: Storage type. - * - * @param storageModelType the storageModelType value to set. - * @return the BackupResourceConfig object itself. - */ - public BackupResourceConfig withStorageModelType(StorageType storageModelType) { - this.storageModelType = storageModelType; - return this; - } - - /** - * Get the storageType property: Storage type. - * - * @return the storageType value. - */ - public StorageType storageType() { - return this.storageType; - } - - /** - * Set the storageType property: Storage type. - * - * @param storageType the storageType value to set. - * @return the BackupResourceConfig object itself. - */ - public BackupResourceConfig withStorageType(StorageType storageType) { - this.storageType = storageType; - return this; - } - - /** - * Get the storageTypeState property: Locked or Unlocked. Once a machine is registered against a resource, the - * storageTypeState is always Locked. - * - * @return the storageTypeState value. - */ - public StorageTypeState storageTypeState() { - return this.storageTypeState; - } - - /** - * Set the storageTypeState property: Locked or Unlocked. Once a machine is registered against a resource, the - * storageTypeState is always Locked. - * - * @param storageTypeState the storageTypeState value to set. - * @return the BackupResourceConfig object itself. - */ - public BackupResourceConfig withStorageTypeState(StorageTypeState storageTypeState) { - this.storageTypeState = storageTypeState; - return this; - } - - /** - * Get the crossRegionRestoreFlag property: Opt in details of Cross Region Restore feature. - * - * @return the crossRegionRestoreFlag value. - */ - public Boolean crossRegionRestoreFlag() { - return this.crossRegionRestoreFlag; - } - - /** - * Set the crossRegionRestoreFlag property: Opt in details of Cross Region Restore feature. - * - * @param crossRegionRestoreFlag the crossRegionRestoreFlag value to set. - * @return the BackupResourceConfig object itself. - */ - public BackupResourceConfig withCrossRegionRestoreFlag(Boolean crossRegionRestoreFlag) { - this.crossRegionRestoreFlag = crossRegionRestoreFlag; - return this; - } - - /** - * Get the dedupState property: Vault Dedup state. - * - * @return the dedupState value. - */ - public DedupState dedupState() { - return this.dedupState; - } - - /** - * Set the dedupState property: Vault Dedup state. - * - * @param dedupState the dedupState value to set. - * @return the BackupResourceConfig object itself. - */ - public BackupResourceConfig withDedupState(DedupState dedupState) { - this.dedupState = dedupState; - return this; - } - - /** - * Get the xcoolState property: Vault x-cool state. - * - * @return the xcoolState value. - */ - public XcoolState xcoolState() { - return this.xcoolState; - } - - /** - * Set the xcoolState property: Vault x-cool state. - * - * @param xcoolState the xcoolState value to set. - * @return the BackupResourceConfig object itself. - */ - public BackupResourceConfig withXcoolState(XcoolState xcoolState) { - this.xcoolState = xcoolState; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("storageModelType", - this.storageModelType == null ? null : this.storageModelType.toString()); - jsonWriter.writeStringField("storageType", this.storageType == null ? null : this.storageType.toString()); - jsonWriter.writeStringField("storageTypeState", - this.storageTypeState == null ? null : this.storageTypeState.toString()); - jsonWriter.writeBooleanField("crossRegionRestoreFlag", this.crossRegionRestoreFlag); - jsonWriter.writeStringField("dedupState", this.dedupState == null ? null : this.dedupState.toString()); - jsonWriter.writeStringField("xcoolState", this.xcoolState == null ? null : this.xcoolState.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupResourceConfig from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupResourceConfig 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 BackupResourceConfig. - */ - public static BackupResourceConfig fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupResourceConfig deserializedBackupResourceConfig = new BackupResourceConfig(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("storageModelType".equals(fieldName)) { - deserializedBackupResourceConfig.storageModelType = StorageType.fromString(reader.getString()); - } else if ("storageType".equals(fieldName)) { - deserializedBackupResourceConfig.storageType = StorageType.fromString(reader.getString()); - } else if ("storageTypeState".equals(fieldName)) { - deserializedBackupResourceConfig.storageTypeState = StorageTypeState.fromString(reader.getString()); - } else if ("crossRegionRestoreFlag".equals(fieldName)) { - deserializedBackupResourceConfig.crossRegionRestoreFlag - = reader.getNullable(JsonReader::getBoolean); - } else if ("dedupState".equals(fieldName)) { - deserializedBackupResourceConfig.dedupState = DedupState.fromString(reader.getString()); - } else if ("xcoolState".equals(fieldName)) { - deserializedBackupResourceConfig.xcoolState = XcoolState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupResourceConfig; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceConfigResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceConfigResource.java deleted file mode 100644 index 9c3ce93958ca..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceConfigResource.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner; -import java.util.Map; - -/** - * An immutable client-side representation of BackupResourceConfigResource. - */ -public interface BackupResourceConfigResource { - /** - * 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: BackupResourceConfigResource properties. - * - * @return the properties value. - */ - BackupResourceConfig properties(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the etag property: Optional ETag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner - * object. - * - * @return the inner object. - */ - BackupResourceConfigResourceInner innerModel(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfig.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfig.java deleted file mode 100644 index 348dfee5c634..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfig.java +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The BackupResourceEncryptionConfig model. - */ -@Fluent -public class BackupResourceEncryptionConfig implements JsonSerializable { - /* - * Encryption At Rest Type - */ - private EncryptionAtRestType encryptionAtRestType; - - /* - * Key Vault Key URI - */ - private String keyUri; - - /* - * Key Vault Subscription Id - */ - private String subscriptionId; - - /* - * The lastUpdateStatus property. - */ - private LastUpdateStatus lastUpdateStatus; - - /* - * The infrastructureEncryptionState property. - */ - private InfrastructureEncryptionState infrastructureEncryptionState; - - /** - * Creates an instance of BackupResourceEncryptionConfig class. - */ - public BackupResourceEncryptionConfig() { - } - - /** - * Get the encryptionAtRestType property: Encryption At Rest Type. - * - * @return the encryptionAtRestType value. - */ - public EncryptionAtRestType encryptionAtRestType() { - return this.encryptionAtRestType; - } - - /** - * Set the encryptionAtRestType property: Encryption At Rest Type. - * - * @param encryptionAtRestType the encryptionAtRestType value to set. - * @return the BackupResourceEncryptionConfig object itself. - */ - public BackupResourceEncryptionConfig withEncryptionAtRestType(EncryptionAtRestType encryptionAtRestType) { - this.encryptionAtRestType = encryptionAtRestType; - return this; - } - - /** - * Get the keyUri property: Key Vault Key URI. - * - * @return the keyUri value. - */ - public String keyUri() { - return this.keyUri; - } - - /** - * Set the keyUri property: Key Vault Key URI. - * - * @param keyUri the keyUri value to set. - * @return the BackupResourceEncryptionConfig object itself. - */ - public BackupResourceEncryptionConfig withKeyUri(String keyUri) { - this.keyUri = keyUri; - return this; - } - - /** - * Get the subscriptionId property: Key Vault Subscription Id. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Set the subscriptionId property: Key Vault Subscription Id. - * - * @param subscriptionId the subscriptionId value to set. - * @return the BackupResourceEncryptionConfig object itself. - */ - public BackupResourceEncryptionConfig withSubscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /** - * Get the lastUpdateStatus property: The lastUpdateStatus property. - * - * @return the lastUpdateStatus value. - */ - public LastUpdateStatus lastUpdateStatus() { - return this.lastUpdateStatus; - } - - /** - * Set the lastUpdateStatus property: The lastUpdateStatus property. - * - * @param lastUpdateStatus the lastUpdateStatus value to set. - * @return the BackupResourceEncryptionConfig object itself. - */ - public BackupResourceEncryptionConfig withLastUpdateStatus(LastUpdateStatus lastUpdateStatus) { - this.lastUpdateStatus = lastUpdateStatus; - return this; - } - - /** - * Get the infrastructureEncryptionState property: The infrastructureEncryptionState property. - * - * @return the infrastructureEncryptionState value. - */ - public InfrastructureEncryptionState infrastructureEncryptionState() { - return this.infrastructureEncryptionState; - } - - /** - * Set the infrastructureEncryptionState property: The infrastructureEncryptionState property. - * - * @param infrastructureEncryptionState the infrastructureEncryptionState value to set. - * @return the BackupResourceEncryptionConfig object itself. - */ - public BackupResourceEncryptionConfig - withInfrastructureEncryptionState(InfrastructureEncryptionState infrastructureEncryptionState) { - this.infrastructureEncryptionState = infrastructureEncryptionState; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("encryptionAtRestType", - this.encryptionAtRestType == null ? null : this.encryptionAtRestType.toString()); - jsonWriter.writeStringField("keyUri", this.keyUri); - jsonWriter.writeStringField("subscriptionId", this.subscriptionId); - jsonWriter.writeStringField("lastUpdateStatus", - this.lastUpdateStatus == null ? null : this.lastUpdateStatus.toString()); - jsonWriter.writeStringField("infrastructureEncryptionState", - this.infrastructureEncryptionState == null ? null : this.infrastructureEncryptionState.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupResourceEncryptionConfig from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupResourceEncryptionConfig 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 BackupResourceEncryptionConfig. - */ - public static BackupResourceEncryptionConfig fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupResourceEncryptionConfig deserializedBackupResourceEncryptionConfig - = new BackupResourceEncryptionConfig(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("encryptionAtRestType".equals(fieldName)) { - deserializedBackupResourceEncryptionConfig.encryptionAtRestType - = EncryptionAtRestType.fromString(reader.getString()); - } else if ("keyUri".equals(fieldName)) { - deserializedBackupResourceEncryptionConfig.keyUri = reader.getString(); - } else if ("subscriptionId".equals(fieldName)) { - deserializedBackupResourceEncryptionConfig.subscriptionId = reader.getString(); - } else if ("lastUpdateStatus".equals(fieldName)) { - deserializedBackupResourceEncryptionConfig.lastUpdateStatus - = LastUpdateStatus.fromString(reader.getString()); - } else if ("infrastructureEncryptionState".equals(fieldName)) { - deserializedBackupResourceEncryptionConfig.infrastructureEncryptionState - = InfrastructureEncryptionState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupResourceEncryptionConfig; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigExtended.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigExtended.java deleted file mode 100644 index f5fc6cc0f524..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigExtended.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The BackupResourceEncryptionConfigExtended model. - */ -@Immutable -public final class BackupResourceEncryptionConfigExtended extends BackupResourceEncryptionConfig { - /* - * User Assigned Identity Id - */ - private String userAssignedIdentity; - - /* - * bool to indicate whether to use system Assigned Identity or not - */ - private Boolean useSystemAssignedIdentity; - - /** - * Creates an instance of BackupResourceEncryptionConfigExtended class. - */ - private BackupResourceEncryptionConfigExtended() { - } - - /** - * Get the userAssignedIdentity property: User Assigned Identity Id. - * - * @return the userAssignedIdentity value. - */ - public String userAssignedIdentity() { - return this.userAssignedIdentity; - } - - /** - * Get the useSystemAssignedIdentity property: bool to indicate whether to use system Assigned Identity or not. - * - * @return the useSystemAssignedIdentity value. - */ - public Boolean useSystemAssignedIdentity() { - return this.useSystemAssignedIdentity; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("encryptionAtRestType", - encryptionAtRestType() == null ? null : encryptionAtRestType().toString()); - jsonWriter.writeStringField("keyUri", keyUri()); - jsonWriter.writeStringField("subscriptionId", subscriptionId()); - jsonWriter.writeStringField("lastUpdateStatus", - lastUpdateStatus() == null ? null : lastUpdateStatus().toString()); - jsonWriter.writeStringField("infrastructureEncryptionState", - infrastructureEncryptionState() == null ? null : infrastructureEncryptionState().toString()); - jsonWriter.writeStringField("userAssignedIdentity", this.userAssignedIdentity); - jsonWriter.writeBooleanField("useSystemAssignedIdentity", this.useSystemAssignedIdentity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupResourceEncryptionConfigExtended from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupResourceEncryptionConfigExtended 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 BackupResourceEncryptionConfigExtended. - */ - public static BackupResourceEncryptionConfigExtended fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupResourceEncryptionConfigExtended deserializedBackupResourceEncryptionConfigExtended - = new BackupResourceEncryptionConfigExtended(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("encryptionAtRestType".equals(fieldName)) { - deserializedBackupResourceEncryptionConfigExtended - .withEncryptionAtRestType(EncryptionAtRestType.fromString(reader.getString())); - } else if ("keyUri".equals(fieldName)) { - deserializedBackupResourceEncryptionConfigExtended.withKeyUri(reader.getString()); - } else if ("subscriptionId".equals(fieldName)) { - deserializedBackupResourceEncryptionConfigExtended.withSubscriptionId(reader.getString()); - } else if ("lastUpdateStatus".equals(fieldName)) { - deserializedBackupResourceEncryptionConfigExtended - .withLastUpdateStatus(LastUpdateStatus.fromString(reader.getString())); - } else if ("infrastructureEncryptionState".equals(fieldName)) { - deserializedBackupResourceEncryptionConfigExtended.withInfrastructureEncryptionState( - InfrastructureEncryptionState.fromString(reader.getString())); - } else if ("userAssignedIdentity".equals(fieldName)) { - deserializedBackupResourceEncryptionConfigExtended.userAssignedIdentity = reader.getString(); - } else if ("useSystemAssignedIdentity".equals(fieldName)) { - deserializedBackupResourceEncryptionConfigExtended.useSystemAssignedIdentity - = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupResourceEncryptionConfigExtended; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigExtendedResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigExtendedResource.java deleted file mode 100644 index 8a40dc9b4746..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigExtendedResource.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigExtendedResourceInner; -import java.util.Map; - -/** - * An immutable client-side representation of BackupResourceEncryptionConfigExtendedResource. - */ -public interface BackupResourceEncryptionConfigExtendedResource { - /** - * 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: The properties of the backup resource encryption config extended resource. - * - * @return the properties value. - */ - BackupResourceEncryptionConfigExtended properties(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the etag property: Optional ETag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the inner - * com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceEncryptionConfigExtendedResourceInner - * object. - * - * @return the inner object. - */ - BackupResourceEncryptionConfigExtendedResourceInner innerModel(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigResource.java deleted file mode 100644 index 2690d7ce9a10..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigResource.java +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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 java.io.IOException; -import java.util.Map; - -/** - * The BackupResourceEncryptionConfigResource model. - */ -@Fluent -public final class BackupResourceEncryptionConfigResource extends ProxyResource { - /* - * The properties of the backup resource encryption config - */ - private BackupResourceEncryptionConfig properties; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The geo-location where the resource lives - */ - private String location; - - /* - * Optional ETag. - */ - private String etag; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of BackupResourceEncryptionConfigResource class. - */ - public BackupResourceEncryptionConfigResource() { - } - - /** - * Get the properties property: The properties of the backup resource encryption config. - * - * @return the properties value. - */ - public BackupResourceEncryptionConfig properties() { - return this.properties; - } - - /** - * Set the properties property: The properties of the backup resource encryption config. - * - * @param properties the properties value to set. - * @return the BackupResourceEncryptionConfigResource object itself. - */ - public BackupResourceEncryptionConfigResource withProperties(BackupResourceEncryptionConfig properties) { - this.properties = properties; - return this; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the BackupResourceEncryptionConfigResource object itself. - */ - public BackupResourceEncryptionConfigResource withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The geo-location where the resource lives. - * - * @param location the location value to set. - * @return the BackupResourceEncryptionConfigResource object itself. - */ - public BackupResourceEncryptionConfigResource withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the etag property: Optional ETag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Optional ETag. - * - * @param etag the etag value to set. - * @return the BackupResourceEncryptionConfigResource object itself. - */ - public BackupResourceEncryptionConfigResource withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeStringField("eTag", this.etag); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupResourceEncryptionConfigResource from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupResourceEncryptionConfigResource 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 BackupResourceEncryptionConfigResource. - */ - public static BackupResourceEncryptionConfigResource fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupResourceEncryptionConfigResource deserializedBackupResourceEncryptionConfigResource - = new BackupResourceEncryptionConfigResource(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedBackupResourceEncryptionConfigResource.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedBackupResourceEncryptionConfigResource.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedBackupResourceEncryptionConfigResource.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedBackupResourceEncryptionConfigResource.properties - = BackupResourceEncryptionConfig.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedBackupResourceEncryptionConfigResource.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedBackupResourceEncryptionConfigResource.location = reader.getString(); - } else if ("eTag".equals(fieldName)) { - deserializedBackupResourceEncryptionConfigResource.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedBackupResourceEncryptionConfigResource.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupResourceEncryptionConfigResource; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigs.java deleted file mode 100644 index e77041a4fadc..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceEncryptionConfigs.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of BackupResourceEncryptionConfigs. - */ -public interface BackupResourceEncryptionConfigs { - /** - * Fetches Vault Encryption config. - * - * @param vaultName The name of the VaultResource. - * @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 the response body along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, - Context context); - - /** - * Fetches Vault Encryption config. - * - * @param vaultName The name of the VaultResource. - * @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 the response. - */ - BackupResourceEncryptionConfigExtendedResource get(String vaultName, String resourceGroupName); - - /** - * Updates Vault encryption config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault encryption input config request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response updateWithResponse(String vaultName, String resourceGroupName, - BackupResourceEncryptionConfigResource parameters, Context context); - - /** - * Updates Vault encryption config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault encryption input config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void update(String vaultName, String resourceGroupName, BackupResourceEncryptionConfigResource parameters); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceStorageConfigsNonCrrs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceStorageConfigsNonCrrs.java deleted file mode 100644 index f3b348228d5d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceStorageConfigsNonCrrs.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceConfigResourceInner; - -/** - * Resource collection API of BackupResourceStorageConfigsNonCrrs. - */ -public interface BackupResourceStorageConfigsNonCrrs { - /** - * Fetches resource storage config. - * - * @param vaultName The name of the VaultResource. - * @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 the resource storage details along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, Context context); - - /** - * Fetches resource storage config. - * - * @param vaultName The name of the VaultResource. - * @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 the resource storage details. - */ - BackupResourceConfigResource get(String vaultName, String resourceGroupName); - - /** - * Updates vault storage model type. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault storage config request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource storage details along with {@link Response}. - */ - Response updateWithResponse(String vaultName, String resourceGroupName, - BackupResourceConfigResourceInner parameters, Context context); - - /** - * Updates vault storage model type. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault storage config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource storage details. - */ - BackupResourceConfigResource update(String vaultName, String resourceGroupName, - BackupResourceConfigResourceInner parameters); - - /** - * Updates vault storage model type. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault storage config request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response patchWithResponse(String vaultName, String resourceGroupName, - BackupResourceConfigResourceInner parameters, Context context); - - /** - * Updates vault storage model type. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Vault storage config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void patch(String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfig.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfig.java deleted file mode 100644 index c339cfe858ad..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfig.java +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Backup resource vault config details. - */ -@Fluent -public final class BackupResourceVaultConfig implements JsonSerializable { - /* - * Storage type. - */ - private StorageType storageModelType; - - /* - * Storage type. - */ - private StorageType storageType; - - /* - * Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. - */ - private StorageTypeState storageTypeState; - - /* - * Enabled or Disabled. - */ - private EnhancedSecurityState enhancedSecurityState; - - /* - * Soft Delete feature state - */ - private SoftDeleteFeatureState softDeleteFeatureState; - - /* - * Soft delete retention period in days - */ - private Integer softDeleteRetentionPeriodInDays; - - /* - * ResourceGuard Operation Requests - */ - private List resourceGuardOperationRequests; - - /* - * This flag is no longer in use. Please use 'softDeleteFeatureState' to set the soft delete state for the vault - */ - private Boolean isSoftDeleteFeatureStateEditable; - - /** - * Creates an instance of BackupResourceVaultConfig class. - */ - public BackupResourceVaultConfig() { - } - - /** - * Get the storageModelType property: Storage type. - * - * @return the storageModelType value. - */ - public StorageType storageModelType() { - return this.storageModelType; - } - - /** - * Set the storageModelType property: Storage type. - * - * @param storageModelType the storageModelType value to set. - * @return the BackupResourceVaultConfig object itself. - */ - public BackupResourceVaultConfig withStorageModelType(StorageType storageModelType) { - this.storageModelType = storageModelType; - return this; - } - - /** - * Get the storageType property: Storage type. - * - * @return the storageType value. - */ - public StorageType storageType() { - return this.storageType; - } - - /** - * Set the storageType property: Storage type. - * - * @param storageType the storageType value to set. - * @return the BackupResourceVaultConfig object itself. - */ - public BackupResourceVaultConfig withStorageType(StorageType storageType) { - this.storageType = storageType; - return this; - } - - /** - * Get the storageTypeState property: Locked or Unlocked. Once a machine is registered against a resource, the - * storageTypeState is always Locked. - * - * @return the storageTypeState value. - */ - public StorageTypeState storageTypeState() { - return this.storageTypeState; - } - - /** - * Set the storageTypeState property: Locked or Unlocked. Once a machine is registered against a resource, the - * storageTypeState is always Locked. - * - * @param storageTypeState the storageTypeState value to set. - * @return the BackupResourceVaultConfig object itself. - */ - public BackupResourceVaultConfig withStorageTypeState(StorageTypeState storageTypeState) { - this.storageTypeState = storageTypeState; - return this; - } - - /** - * Get the enhancedSecurityState property: Enabled or Disabled. - * - * @return the enhancedSecurityState value. - */ - public EnhancedSecurityState enhancedSecurityState() { - return this.enhancedSecurityState; - } - - /** - * Set the enhancedSecurityState property: Enabled or Disabled. - * - * @param enhancedSecurityState the enhancedSecurityState value to set. - * @return the BackupResourceVaultConfig object itself. - */ - public BackupResourceVaultConfig withEnhancedSecurityState(EnhancedSecurityState enhancedSecurityState) { - this.enhancedSecurityState = enhancedSecurityState; - return this; - } - - /** - * Get the softDeleteFeatureState property: Soft Delete feature state. - * - * @return the softDeleteFeatureState value. - */ - public SoftDeleteFeatureState softDeleteFeatureState() { - return this.softDeleteFeatureState; - } - - /** - * Set the softDeleteFeatureState property: Soft Delete feature state. - * - * @param softDeleteFeatureState the softDeleteFeatureState value to set. - * @return the BackupResourceVaultConfig object itself. - */ - public BackupResourceVaultConfig withSoftDeleteFeatureState(SoftDeleteFeatureState softDeleteFeatureState) { - this.softDeleteFeatureState = softDeleteFeatureState; - return this; - } - - /** - * Get the softDeleteRetentionPeriodInDays property: Soft delete retention period in days. - * - * @return the softDeleteRetentionPeriodInDays value. - */ - public Integer softDeleteRetentionPeriodInDays() { - return this.softDeleteRetentionPeriodInDays; - } - - /** - * Set the softDeleteRetentionPeriodInDays property: Soft delete retention period in days. - * - * @param softDeleteRetentionPeriodInDays the softDeleteRetentionPeriodInDays value to set. - * @return the BackupResourceVaultConfig object itself. - */ - public BackupResourceVaultConfig withSoftDeleteRetentionPeriodInDays(Integer softDeleteRetentionPeriodInDays) { - this.softDeleteRetentionPeriodInDays = softDeleteRetentionPeriodInDays; - return this; - } - - /** - * Get the resourceGuardOperationRequests property: ResourceGuard Operation Requests. - * - * @return the resourceGuardOperationRequests value. - */ - public List resourceGuardOperationRequests() { - return this.resourceGuardOperationRequests; - } - - /** - * Set the resourceGuardOperationRequests property: ResourceGuard Operation Requests. - * - * @param resourceGuardOperationRequests the resourceGuardOperationRequests value to set. - * @return the BackupResourceVaultConfig object itself. - */ - public BackupResourceVaultConfig withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - this.resourceGuardOperationRequests = resourceGuardOperationRequests; - return this; - } - - /** - * Get the isSoftDeleteFeatureStateEditable property: This flag is no longer in use. Please use - * 'softDeleteFeatureState' to set the soft delete state for the vault. - * - * @return the isSoftDeleteFeatureStateEditable value. - */ - public Boolean isSoftDeleteFeatureStateEditable() { - return this.isSoftDeleteFeatureStateEditable; - } - - /** - * Set the isSoftDeleteFeatureStateEditable property: This flag is no longer in use. Please use - * 'softDeleteFeatureState' to set the soft delete state for the vault. - * - * @param isSoftDeleteFeatureStateEditable the isSoftDeleteFeatureStateEditable value to set. - * @return the BackupResourceVaultConfig object itself. - */ - public BackupResourceVaultConfig withIsSoftDeleteFeatureStateEditable(Boolean isSoftDeleteFeatureStateEditable) { - this.isSoftDeleteFeatureStateEditable = isSoftDeleteFeatureStateEditable; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("storageModelType", - this.storageModelType == null ? null : this.storageModelType.toString()); - jsonWriter.writeStringField("storageType", this.storageType == null ? null : this.storageType.toString()); - jsonWriter.writeStringField("storageTypeState", - this.storageTypeState == null ? null : this.storageTypeState.toString()); - jsonWriter.writeStringField("enhancedSecurityState", - this.enhancedSecurityState == null ? null : this.enhancedSecurityState.toString()); - jsonWriter.writeStringField("softDeleteFeatureState", - this.softDeleteFeatureState == null ? null : this.softDeleteFeatureState.toString()); - jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", this.softDeleteRetentionPeriodInDays); - jsonWriter.writeArrayField("resourceGuardOperationRequests", this.resourceGuardOperationRequests, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("isSoftDeleteFeatureStateEditable", this.isSoftDeleteFeatureStateEditable); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupResourceVaultConfig from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupResourceVaultConfig 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 BackupResourceVaultConfig. - */ - public static BackupResourceVaultConfig fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupResourceVaultConfig deserializedBackupResourceVaultConfig = new BackupResourceVaultConfig(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("storageModelType".equals(fieldName)) { - deserializedBackupResourceVaultConfig.storageModelType = StorageType.fromString(reader.getString()); - } else if ("storageType".equals(fieldName)) { - deserializedBackupResourceVaultConfig.storageType = StorageType.fromString(reader.getString()); - } else if ("storageTypeState".equals(fieldName)) { - deserializedBackupResourceVaultConfig.storageTypeState - = StorageTypeState.fromString(reader.getString()); - } else if ("enhancedSecurityState".equals(fieldName)) { - deserializedBackupResourceVaultConfig.enhancedSecurityState - = EnhancedSecurityState.fromString(reader.getString()); - } else if ("softDeleteFeatureState".equals(fieldName)) { - deserializedBackupResourceVaultConfig.softDeleteFeatureState - = SoftDeleteFeatureState.fromString(reader.getString()); - } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) { - deserializedBackupResourceVaultConfig.softDeleteRetentionPeriodInDays - = reader.getNullable(JsonReader::getInt); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedBackupResourceVaultConfig.resourceGuardOperationRequests - = resourceGuardOperationRequests; - } else if ("isSoftDeleteFeatureStateEditable".equals(fieldName)) { - deserializedBackupResourceVaultConfig.isSoftDeleteFeatureStateEditable - = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupResourceVaultConfig; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfigResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfigResource.java deleted file mode 100644 index 86433b678ddf..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfigResource.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceVaultConfigResourceInner; -import java.util.Map; - -/** - * An immutable client-side representation of BackupResourceVaultConfigResource. - */ -public interface BackupResourceVaultConfigResource { - /** - * 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: BackupResourceVaultConfigResource properties. - * - * @return the properties value. - */ - BackupResourceVaultConfig properties(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the etag property: Optional ETag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the inner - * com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceVaultConfigResourceInner object. - * - * @return the inner object. - */ - BackupResourceVaultConfigResourceInner innerModel(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfigs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfigs.java deleted file mode 100644 index ec72ae44ce14..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupResourceVaultConfigs.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceVaultConfigResourceInner; - -/** - * Resource collection API of BackupResourceVaultConfigs. - */ -public interface BackupResourceVaultConfigs { - /** - * Fetches resource vault config. - * - * @param vaultName The name of the VaultResource. - * @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 backup resource vault config details along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, - Context context); - - /** - * Fetches resource vault config. - * - * @param vaultName The name of the VaultResource. - * @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 backup resource vault config details. - */ - BackupResourceVaultConfigResource get(String vaultName, String resourceGroupName); - - /** - * Updates vault security config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource config request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup resource vault config details along with {@link Response}. - */ - Response putWithResponse(String vaultName, String resourceGroupName, - BackupResourceVaultConfigResourceInner parameters, Context context); - - /** - * Updates vault security config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup resource vault config details. - */ - BackupResourceVaultConfigResource put(String vaultName, String resourceGroupName, - BackupResourceVaultConfigResourceInner parameters); - - /** - * Updates vault security config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource config request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup resource vault config details along with {@link Response}. - */ - Response updateWithResponse(String vaultName, String resourceGroupName, - BackupResourceVaultConfigResourceInner parameters, Context context); - - /** - * Updates vault security config. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource config request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup resource vault config details. - */ - BackupResourceVaultConfigResource update(String vaultName, String resourceGroupName, - BackupResourceVaultConfigResourceInner parameters); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupStatus.java deleted file mode 100644 index 9fdff7dbabf8..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupStatus.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of BackupStatus. - */ -public interface BackupStatus { - /** - * Get the container backup status. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Container Backup Status Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the container backup status along with {@link Response}. - */ - Response getWithResponse(String azureRegion, BackupStatusRequest parameters, Context context); - - /** - * Get the container backup status. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Container Backup Status Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the container backup status. - */ - BackupStatusResponse get(String azureRegion, BackupStatusRequest parameters); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupStatusRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupStatusRequest.java deleted file mode 100644 index e72001bf78ea..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupStatusRequest.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * BackupStatus request. - */ -@Fluent -public final class BackupStatusRequest implements JsonSerializable { - /* - * Container Type - VM, SQLPaaS, DPM, AzureFileShare... - */ - private DataSourceType resourceType; - - /* - * Entire ARM resource id of the resource - */ - private String resourceId; - - /* - * Protectable Item Logical Name - */ - private String poLogicalName; - - /** - * Creates an instance of BackupStatusRequest class. - */ - public BackupStatusRequest() { - } - - /** - * Get the resourceType property: Container Type - VM, SQLPaaS, DPM, AzureFileShare... - * - * @return the resourceType value. - */ - public DataSourceType resourceType() { - return this.resourceType; - } - - /** - * Set the resourceType property: Container Type - VM, SQLPaaS, DPM, AzureFileShare... - * - * @param resourceType the resourceType value to set. - * @return the BackupStatusRequest object itself. - */ - public BackupStatusRequest withResourceType(DataSourceType resourceType) { - this.resourceType = resourceType; - return this; - } - - /** - * Get the resourceId property: Entire ARM resource id of the resource. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: Entire ARM resource id of the resource. - * - * @param resourceId the resourceId value to set. - * @return the BackupStatusRequest object itself. - */ - public BackupStatusRequest withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the poLogicalName property: Protectable Item Logical Name. - * - * @return the poLogicalName value. - */ - public String poLogicalName() { - return this.poLogicalName; - } - - /** - * Set the poLogicalName property: Protectable Item Logical Name. - * - * @param poLogicalName the poLogicalName value to set. - * @return the BackupStatusRequest object itself. - */ - public BackupStatusRequest withPoLogicalName(String poLogicalName) { - this.poLogicalName = poLogicalName; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("resourceType", this.resourceType == null ? null : this.resourceType.toString()); - jsonWriter.writeStringField("resourceId", this.resourceId); - jsonWriter.writeStringField("poLogicalName", this.poLogicalName); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BackupStatusRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BackupStatusRequest 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 BackupStatusRequest. - */ - public static BackupStatusRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BackupStatusRequest deserializedBackupStatusRequest = new BackupStatusRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceType".equals(fieldName)) { - deserializedBackupStatusRequest.resourceType = DataSourceType.fromString(reader.getString()); - } else if ("resourceId".equals(fieldName)) { - deserializedBackupStatusRequest.resourceId = reader.getString(); - } else if ("poLogicalName".equals(fieldName)) { - deserializedBackupStatusRequest.poLogicalName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedBackupStatusRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupStatusResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupStatusResponse.java deleted file mode 100644 index 4e36b7b99cc5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupStatusResponse.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupStatusResponseInner; - -/** - * An immutable client-side representation of BackupStatusResponse. - */ -public interface BackupStatusResponse { - /** - * Gets the protectionStatus property: Specifies whether the container is registered or not. - * - * @return the protectionStatus value. - */ - ProtectionStatus protectionStatus(); - - /** - * Gets the vaultId property: Specifies the arm resource id of the vault. - * - * @return the vaultId value. - */ - String vaultId(); - - /** - * Gets the fabricName property: Specifies the fabric name - Azure or AD. - * - * @return the fabricName value. - */ - FabricName fabricName(); - - /** - * Gets the containerName property: Specifies the product specific container name. E.g. - * iaasvmcontainer;iaasvmcontainer;csname;vmname. - * - * @return the containerName value. - */ - String containerName(); - - /** - * Gets the protectedItemName property: Specifies the product specific ds name. E.g. - * vm;iaasvmcontainer;csname;vmname. - * - * @return the protectedItemName value. - */ - String protectedItemName(); - - /** - * Gets the errorCode property: ErrorCode in case of intent failed. - * - * @return the errorCode value. - */ - String errorCode(); - - /** - * Gets the errorMessage property: ErrorMessage in case of intent failed. - * - * @return the errorMessage value. - */ - String errorMessage(); - - /** - * Gets the policyName property: Specifies the policy name which is used for protection. - * - * @return the policyName value. - */ - String policyName(); - - /** - * Gets the registrationStatus property: Container registration status. - * - * @return the registrationStatus value. - */ - String registrationStatus(); - - /** - * Gets the protectedItemsCount property: Number of protected items. - * - * @return the protectedItemsCount value. - */ - Integer protectedItemsCount(); - - /** - * Gets the acquireStorageAccountLock property: Specifies whether the storage account lock has been acquired or not. - * - * @return the acquireStorageAccountLock value. - */ - AcquireStorageAccountLock acquireStorageAccountLock(); - - /** - * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupStatusResponseInner object. - * - * @return the inner object. - */ - BackupStatusResponseInner innerModel(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupType.java deleted file mode 100644 index 4b2b2312d9b6..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupType.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Type of backup, viz. Full, Differential, Log or CopyOnlyFull. - */ -public final class BackupType extends ExpandableStringEnum { - /** - * Static value Invalid for BackupType. - */ - public static final BackupType INVALID = fromString("Invalid"); - - /** - * Static value Full for BackupType. - */ - public static final BackupType FULL = fromString("Full"); - - /** - * Static value Differential for BackupType. - */ - public static final BackupType DIFFERENTIAL = fromString("Differential"); - - /** - * Static value Log for BackupType. - */ - public static final BackupType LOG = fromString("Log"); - - /** - * Static value CopyOnlyFull for BackupType. - */ - public static final BackupType COPY_ONLY_FULL = fromString("CopyOnlyFull"); - - /** - * Static value Incremental for BackupType. - */ - public static final BackupType INCREMENTAL = fromString("Incremental"); - - /** - * Static value SnapshotFull for BackupType. - */ - public static final BackupType SNAPSHOT_FULL = fromString("SnapshotFull"); - - /** - * Static value SnapshotCopyOnlyFull for BackupType. - */ - public static final BackupType SNAPSHOT_COPY_ONLY_FULL = fromString("SnapshotCopyOnlyFull"); - - /** - * Creates a new instance of BackupType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public BackupType() { - } - - /** - * Creates or finds a BackupType from its string representation. - * - * @param name a name to look for. - * @return the corresponding BackupType. - */ - public static BackupType fromString(String name) { - return fromString(name, BackupType.class); - } - - /** - * Gets known BackupType values. - * - * @return known BackupType values. - */ - public static Collection values() { - return values(BackupType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupUsageSummaries.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupUsageSummaries.java deleted file mode 100644 index cec0e622513c..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupUsageSummaries.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of BackupUsageSummaries. - */ -public interface BackupUsageSummaries { - /** - * Fetches the backup management usage summaries of the vault. - * - * @param vaultName The name of the recovery services vault. - * @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 backup management usage for vault as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName); - - /** - * Fetches the backup management usage summaries of the vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup management usage for vault as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName, String filter, - String skipToken, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupWorkloadItems.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupWorkloadItems.java deleted file mode 100644 index c270c13193e5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupWorkloadItems.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of BackupWorkloadItems. - */ -public interface BackupWorkloadItems { - /** - * Provides a pageable list of workload item of a specific container according to the query filter and the - * pagination - * parameters. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadItem resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName); - - /** - * Provides a pageable list of workload item of a specific container according to the query filter and the - * pagination - * parameters. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param filter OData filter options. - * @param skipToken skipToken Filter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of WorkloadItem resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName, String filter, String skipToken, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Backups.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Backups.java deleted file mode 100644 index 1c66bc1ba282..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Backups.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of Backups. - */ -public interface Backups { - /** - * Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the - * operation, call GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters resource backup request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response triggerWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, BackupRequestResource parameters, Context context); - - /** - * Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the - * operation, call GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters resource backup request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void trigger(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, BackupRequestResource parameters); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BekDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BekDetails.java deleted file mode 100644 index 83fd58d9b116..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BekDetails.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * BEK is bitlocker encryption key. - */ -@Immutable -public final class BekDetails implements JsonSerializable { - /* - * Secret is BEK. - */ - private String secretUrl; - - /* - * ID of the Key Vault where this Secret is stored. - */ - private String secretVaultId; - - /* - * BEK data. - */ - private String secretData; - - /** - * Creates an instance of BekDetails class. - */ - private BekDetails() { - } - - /** - * Get the secretUrl property: Secret is BEK. - * - * @return the secretUrl value. - */ - public String secretUrl() { - return this.secretUrl; - } - - /** - * Get the secretVaultId property: ID of the Key Vault where this Secret is stored. - * - * @return the secretVaultId value. - */ - public String secretVaultId() { - return this.secretVaultId; - } - - /** - * Get the secretData property: BEK data. - * - * @return the secretData value. - */ - public String secretData() { - return this.secretData; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("secretUrl", this.secretUrl); - jsonWriter.writeStringField("secretVaultId", this.secretVaultId); - jsonWriter.writeStringField("secretData", this.secretData); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BekDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BekDetails 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 BekDetails. - */ - public static BekDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BekDetails deserializedBekDetails = new BekDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("secretUrl".equals(fieldName)) { - deserializedBekDetails.secretUrl = reader.getString(); - } else if ("secretVaultId".equals(fieldName)) { - deserializedBekDetails.secretVaultId = reader.getString(); - } else if ("secretData".equals(fieldName)) { - deserializedBekDetails.secretData = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedBekDetails; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BmsPrepareDataMoveOperationResults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BmsPrepareDataMoveOperationResults.java deleted file mode 100644 index ae06b41401b6..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BmsPrepareDataMoveOperationResults.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of BmsPrepareDataMoveOperationResults. - */ -public interface BmsPrepareDataMoveOperationResults { - /** - * Fetches operation status for data move operation on vault. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the BackupResourceConfigResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation result response for Vault Storage Config along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, - String operationId, Context context); - - /** - * Fetches operation status for data move operation on vault. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the BackupResourceConfigResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation result response for Vault Storage Config. - */ - VaultStorageConfigOperationResultResponse get(String vaultName, String resourceGroupName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryDisplay.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryDisplay.java deleted file mode 100644 index f6e000e76f89..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryDisplay.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Localized display information of an operation. - */ -@Immutable -public final class ClientDiscoveryDisplay implements JsonSerializable { - /* - * Name of the provider for display purposes - */ - private String provider; - - /* - * ResourceType for which this Operation can be performed. - */ - private String resource; - - /* - * Operations Name itself. - */ - private String operation; - - /* - * Description of the operation having details of what operation is about. - */ - private String description; - - /** - * Creates an instance of ClientDiscoveryDisplay class. - */ - private ClientDiscoveryDisplay() { - } - - /** - * Get the provider property: Name of the provider for display purposes. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Get the resource property: ResourceType for which this Operation can be performed. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Get the operation property: Operations Name itself. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Get the description property: Description of the operation having details of what operation is about. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("provider", this.provider); - jsonWriter.writeStringField("resource", this.resource); - jsonWriter.writeStringField("operation", this.operation); - jsonWriter.writeStringField("description", this.description); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ClientDiscoveryDisplay from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ClientDiscoveryDisplay 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 ClientDiscoveryDisplay. - */ - public static ClientDiscoveryDisplay fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ClientDiscoveryDisplay deserializedClientDiscoveryDisplay = new ClientDiscoveryDisplay(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provider".equals(fieldName)) { - deserializedClientDiscoveryDisplay.provider = reader.getString(); - } else if ("resource".equals(fieldName)) { - deserializedClientDiscoveryDisplay.resource = reader.getString(); - } else if ("operation".equals(fieldName)) { - deserializedClientDiscoveryDisplay.operation = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedClientDiscoveryDisplay.description = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedClientDiscoveryDisplay; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryForLogSpecification.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryForLogSpecification.java deleted file mode 100644 index 46d0c3551368..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryForLogSpecification.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Class to represent shoebox log specification in json client discovery. - */ -@Immutable -public final class ClientDiscoveryForLogSpecification implements JsonSerializable { - /* - * Name for shoebox log specification. - */ - private String name; - - /* - * Localized display name - */ - private String displayName; - - /* - * blob duration of shoebox log specification - */ - private String blobDuration; - - /** - * Creates an instance of ClientDiscoveryForLogSpecification class. - */ - private ClientDiscoveryForLogSpecification() { - } - - /** - * Get the name property: Name for shoebox log specification. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the displayName property: Localized display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the blobDuration property: blob duration of shoebox log specification. - * - * @return the blobDuration value. - */ - public String blobDuration() { - return this.blobDuration; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeStringField("blobDuration", this.blobDuration); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ClientDiscoveryForLogSpecification from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ClientDiscoveryForLogSpecification 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 ClientDiscoveryForLogSpecification. - */ - public static ClientDiscoveryForLogSpecification fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ClientDiscoveryForLogSpecification deserializedClientDiscoveryForLogSpecification - = new ClientDiscoveryForLogSpecification(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedClientDiscoveryForLogSpecification.name = reader.getString(); - } else if ("displayName".equals(fieldName)) { - deserializedClientDiscoveryForLogSpecification.displayName = reader.getString(); - } else if ("blobDuration".equals(fieldName)) { - deserializedClientDiscoveryForLogSpecification.blobDuration = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedClientDiscoveryForLogSpecification; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryForProperties.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryForProperties.java deleted file mode 100644 index 89ffbc971302..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryForProperties.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Class to represent shoebox properties in json client discovery. - */ -@Immutable -public final class ClientDiscoveryForProperties implements JsonSerializable { - /* - * Operation properties. - */ - private ClientDiscoveryForServiceSpecification serviceSpecification; - - /** - * Creates an instance of ClientDiscoveryForProperties class. - */ - private ClientDiscoveryForProperties() { - } - - /** - * Get the serviceSpecification property: Operation properties. - * - * @return the serviceSpecification value. - */ - public ClientDiscoveryForServiceSpecification serviceSpecification() { - return this.serviceSpecification; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("serviceSpecification", this.serviceSpecification); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ClientDiscoveryForProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ClientDiscoveryForProperties 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 ClientDiscoveryForProperties. - */ - public static ClientDiscoveryForProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ClientDiscoveryForProperties deserializedClientDiscoveryForProperties = new ClientDiscoveryForProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("serviceSpecification".equals(fieldName)) { - deserializedClientDiscoveryForProperties.serviceSpecification - = ClientDiscoveryForServiceSpecification.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedClientDiscoveryForProperties; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryForServiceSpecification.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryForServiceSpecification.java deleted file mode 100644 index bf838b3c0124..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryForServiceSpecification.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Class to represent shoebox service specification in json client discovery. - */ -@Immutable -public final class ClientDiscoveryForServiceSpecification - implements JsonSerializable { - /* - * List of log specifications of this operation. - */ - private List logSpecifications; - - /** - * Creates an instance of ClientDiscoveryForServiceSpecification class. - */ - private ClientDiscoveryForServiceSpecification() { - } - - /** - * Get the logSpecifications property: List of log specifications of this operation. - * - * @return the logSpecifications value. - */ - public List logSpecifications() { - return this.logSpecifications; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("logSpecifications", this.logSpecifications, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ClientDiscoveryForServiceSpecification from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ClientDiscoveryForServiceSpecification 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 ClientDiscoveryForServiceSpecification. - */ - public static ClientDiscoveryForServiceSpecification fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ClientDiscoveryForServiceSpecification deserializedClientDiscoveryForServiceSpecification - = new ClientDiscoveryForServiceSpecification(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("logSpecifications".equals(fieldName)) { - List logSpecifications - = reader.readArray(reader1 -> ClientDiscoveryForLogSpecification.fromJson(reader1)); - deserializedClientDiscoveryForServiceSpecification.logSpecifications = logSpecifications; - } else { - reader.skipChildren(); - } - } - - return deserializedClientDiscoveryForServiceSpecification; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryValueForSingleApi.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryValueForSingleApi.java deleted file mode 100644 index b43d8125b065..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientDiscoveryValueForSingleApi.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ClientDiscoveryValueForSingleApiInner; - -/** - * An immutable client-side representation of ClientDiscoveryValueForSingleApi. - */ -public interface ClientDiscoveryValueForSingleApi { - /** - * Gets the name property: Name of the Operation. - * - * @return the name value. - */ - String name(); - - /** - * Gets the display property: Contains the localized display information for this particular operation. - * - * @return the display value. - */ - ClientDiscoveryDisplay display(); - - /** - * Gets the origin property: The intended executor of the operation;governs the display of the operation in the RBAC - * UX and the audit logs UX. - * - * @return the origin value. - */ - String origin(); - - /** - * Gets the properties property: ShoeBox properties for the given operation. - * - * @return the properties value. - */ - ClientDiscoveryForProperties properties(); - - /** - * Gets the inner - * com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ClientDiscoveryValueForSingleApiInner object. - * - * @return the inner object. - */ - ClientDiscoveryValueForSingleApiInner innerModel(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientScriptForConnect.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientScriptForConnect.java deleted file mode 100644 index 34b6c4e8a8d7..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ClientScriptForConnect.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Client script details for file / folder restore. - */ -@Immutable -public final class ClientScriptForConnect implements JsonSerializable { - /* - * File content of the client script for file / folder restore. - */ - private String scriptContent; - - /* - * File extension of the client script for file / folder restore - .ps1 , .sh , etc. - */ - private String scriptExtension; - - /* - * OS type - Windows, Linux etc. for which this file / folder restore client script works. - */ - private String osType; - - /* - * URL of Executable from where to source the content. If this is not null then ScriptContent should not be used - */ - private String url; - - /* - * Mandatory suffix that should be added to the name of script that is given for download to user. - * If its null or empty then , ignore it. - */ - private String scriptNameSuffix; - - /** - * Creates an instance of ClientScriptForConnect class. - */ - private ClientScriptForConnect() { - } - - /** - * Get the scriptContent property: File content of the client script for file / folder restore. - * - * @return the scriptContent value. - */ - public String scriptContent() { - return this.scriptContent; - } - - /** - * Get the scriptExtension property: File extension of the client script for file / folder restore - .ps1 , .sh , - * etc. - * - * @return the scriptExtension value. - */ - public String scriptExtension() { - return this.scriptExtension; - } - - /** - * Get the osType property: OS type - Windows, Linux etc. for which this file / folder restore client script works. - * - * @return the osType value. - */ - public String osType() { - return this.osType; - } - - /** - * Get the url property: URL of Executable from where to source the content. If this is not null then ScriptContent - * should not be used. - * - * @return the url value. - */ - public String url() { - return this.url; - } - - /** - * Get the scriptNameSuffix property: Mandatory suffix that should be added to the name of script that is given for - * download to user. - * If its null or empty then , ignore it. - * - * @return the scriptNameSuffix value. - */ - public String scriptNameSuffix() { - return this.scriptNameSuffix; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("scriptContent", this.scriptContent); - jsonWriter.writeStringField("scriptExtension", this.scriptExtension); - jsonWriter.writeStringField("osType", this.osType); - jsonWriter.writeStringField("url", this.url); - jsonWriter.writeStringField("scriptNameSuffix", this.scriptNameSuffix); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ClientScriptForConnect from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ClientScriptForConnect 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 ClientScriptForConnect. - */ - public static ClientScriptForConnect fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ClientScriptForConnect deserializedClientScriptForConnect = new ClientScriptForConnect(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("scriptContent".equals(fieldName)) { - deserializedClientScriptForConnect.scriptContent = reader.getString(); - } else if ("scriptExtension".equals(fieldName)) { - deserializedClientScriptForConnect.scriptExtension = reader.getString(); - } else if ("osType".equals(fieldName)) { - deserializedClientScriptForConnect.osType = reader.getString(); - } else if ("url".equals(fieldName)) { - deserializedClientScriptForConnect.url = reader.getString(); - } else if ("scriptNameSuffix".equals(fieldName)) { - deserializedClientScriptForConnect.scriptNameSuffix = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedClientScriptForConnect; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ContainerIdentityInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ContainerIdentityInfo.java deleted file mode 100644 index 8dfd10914301..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ContainerIdentityInfo.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Container identity information. - */ -@Fluent -public final class ContainerIdentityInfo implements JsonSerializable { - /* - * Unique name of the container - */ - private String uniqueName; - - /* - * Protection container identity - AAD Tenant - */ - private String aadTenantId; - - /* - * Protection container identity - AAD Service Principal - */ - private String servicePrincipalClientId; - - /* - * Protection container identity - Audience - */ - private String audience; - - /** - * Creates an instance of ContainerIdentityInfo class. - */ - public ContainerIdentityInfo() { - } - - /** - * Get the uniqueName property: Unique name of the container. - * - * @return the uniqueName value. - */ - public String uniqueName() { - return this.uniqueName; - } - - /** - * Set the uniqueName property: Unique name of the container. - * - * @param uniqueName the uniqueName value to set. - * @return the ContainerIdentityInfo object itself. - */ - public ContainerIdentityInfo withUniqueName(String uniqueName) { - this.uniqueName = uniqueName; - return this; - } - - /** - * Get the aadTenantId property: Protection container identity - AAD Tenant. - * - * @return the aadTenantId value. - */ - public String aadTenantId() { - return this.aadTenantId; - } - - /** - * Set the aadTenantId property: Protection container identity - AAD Tenant. - * - * @param aadTenantId the aadTenantId value to set. - * @return the ContainerIdentityInfo object itself. - */ - public ContainerIdentityInfo withAadTenantId(String aadTenantId) { - this.aadTenantId = aadTenantId; - return this; - } - - /** - * Get the servicePrincipalClientId property: Protection container identity - AAD Service Principal. - * - * @return the servicePrincipalClientId value. - */ - public String servicePrincipalClientId() { - return this.servicePrincipalClientId; - } - - /** - * Set the servicePrincipalClientId property: Protection container identity - AAD Service Principal. - * - * @param servicePrincipalClientId the servicePrincipalClientId value to set. - * @return the ContainerIdentityInfo object itself. - */ - public ContainerIdentityInfo withServicePrincipalClientId(String servicePrincipalClientId) { - this.servicePrincipalClientId = servicePrincipalClientId; - return this; - } - - /** - * Get the audience property: Protection container identity - Audience. - * - * @return the audience value. - */ - public String audience() { - return this.audience; - } - - /** - * Set the audience property: Protection container identity - Audience. - * - * @param audience the audience value to set. - * @return the ContainerIdentityInfo object itself. - */ - public ContainerIdentityInfo withAudience(String audience) { - this.audience = audience; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("uniqueName", this.uniqueName); - jsonWriter.writeStringField("aadTenantId", this.aadTenantId); - jsonWriter.writeStringField("servicePrincipalClientId", this.servicePrincipalClientId); - jsonWriter.writeStringField("audience", this.audience); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ContainerIdentityInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ContainerIdentityInfo 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 ContainerIdentityInfo. - */ - public static ContainerIdentityInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ContainerIdentityInfo deserializedContainerIdentityInfo = new ContainerIdentityInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("uniqueName".equals(fieldName)) { - deserializedContainerIdentityInfo.uniqueName = reader.getString(); - } else if ("aadTenantId".equals(fieldName)) { - deserializedContainerIdentityInfo.aadTenantId = reader.getString(); - } else if ("servicePrincipalClientId".equals(fieldName)) { - deserializedContainerIdentityInfo.servicePrincipalClientId = reader.getString(); - } else if ("audience".equals(fieldName)) { - deserializedContainerIdentityInfo.audience = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedContainerIdentityInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CopyOptions.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CopyOptions.java deleted file mode 100644 index 7a8e6131d7f6..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CopyOptions.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Options to resolve copy conflicts. - */ -public final class CopyOptions extends ExpandableStringEnum { - /** - * Static value Invalid for CopyOptions. - */ - public static final CopyOptions INVALID = fromString("Invalid"); - - /** - * Static value CreateCopy for CopyOptions. - */ - public static final CopyOptions CREATE_COPY = fromString("CreateCopy"); - - /** - * Static value Skip for CopyOptions. - */ - public static final CopyOptions SKIP = fromString("Skip"); - - /** - * Static value Overwrite for CopyOptions. - */ - public static final CopyOptions OVERWRITE = fromString("Overwrite"); - - /** - * Static value FailOnConflict for CopyOptions. - */ - public static final CopyOptions FAIL_ON_CONFLICT = fromString("FailOnConflict"); - - /** - * Creates a new instance of CopyOptions value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public CopyOptions() { - } - - /** - * Creates or finds a CopyOptions from its string representation. - * - * @param name a name to look for. - * @return the corresponding CopyOptions. - */ - public static CopyOptions fromString(String name) { - return fromString(name, CopyOptions.class); - } - - /** - * Gets known CopyOptions values. - * - * @return known CopyOptions values. - */ - public static Collection values() { - return values(CopyOptions.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CreateMode.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CreateMode.java deleted file mode 100644 index fd3e288dab83..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CreateMode.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Create mode to indicate recovery of existing soft deleted data source or creation of new data source. - */ -public final class CreateMode extends ExpandableStringEnum { - /** - * Static value Invalid for CreateMode. - */ - public static final CreateMode INVALID = fromString("Invalid"); - - /** - * Static value Default for CreateMode. - */ - public static final CreateMode DEFAULT = fromString("Default"); - - /** - * Static value Recover for CreateMode. - */ - public static final CreateMode RECOVER = fromString("Recover"); - - /** - * Creates a new instance of CreateMode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public CreateMode() { - } - - /** - * Creates or finds a CreateMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding CreateMode. - */ - public static CreateMode fromString(String name) { - return fromString(name, CreateMode.class); - } - - /** - * Gets known CreateMode values. - * - * @return known CreateMode values. - */ - public static Collection values() { - return values(CreateMode.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DailyRetentionFormat.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DailyRetentionFormat.java deleted file mode 100644 index e0c32932bbc3..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DailyRetentionFormat.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Daily retention format. - */ -@Fluent -public final class DailyRetentionFormat implements JsonSerializable { - /* - * List of days of the month. - */ - private List daysOfTheMonth; - - /** - * Creates an instance of DailyRetentionFormat class. - */ - public DailyRetentionFormat() { - } - - /** - * Get the daysOfTheMonth property: List of days of the month. - * - * @return the daysOfTheMonth value. - */ - public List daysOfTheMonth() { - return this.daysOfTheMonth; - } - - /** - * Set the daysOfTheMonth property: List of days of the month. - * - * @param daysOfTheMonth the daysOfTheMonth value to set. - * @return the DailyRetentionFormat object itself. - */ - public DailyRetentionFormat withDaysOfTheMonth(List daysOfTheMonth) { - this.daysOfTheMonth = daysOfTheMonth; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("daysOfTheMonth", this.daysOfTheMonth, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DailyRetentionFormat from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DailyRetentionFormat 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 DailyRetentionFormat. - */ - public static DailyRetentionFormat fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DailyRetentionFormat deserializedDailyRetentionFormat = new DailyRetentionFormat(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("daysOfTheMonth".equals(fieldName)) { - List daysOfTheMonth = reader.readArray(reader1 -> Day.fromJson(reader1)); - deserializedDailyRetentionFormat.daysOfTheMonth = daysOfTheMonth; - } else { - reader.skipChildren(); - } - } - - return deserializedDailyRetentionFormat; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DailyRetentionSchedule.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DailyRetentionSchedule.java deleted file mode 100644 index 79dea7e60796..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DailyRetentionSchedule.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Daily retention schedule. - */ -@Fluent -public final class DailyRetentionSchedule implements JsonSerializable { - /* - * Retention times of retention policy. - */ - private List retentionTimes; - - /* - * Retention duration of retention Policy. - */ - private RetentionDuration retentionDuration; - - /** - * Creates an instance of DailyRetentionSchedule class. - */ - public DailyRetentionSchedule() { - } - - /** - * Get the retentionTimes property: Retention times of retention policy. - * - * @return the retentionTimes value. - */ - public List retentionTimes() { - return this.retentionTimes; - } - - /** - * Set the retentionTimes property: Retention times of retention policy. - * - * @param retentionTimes the retentionTimes value to set. - * @return the DailyRetentionSchedule object itself. - */ - public DailyRetentionSchedule withRetentionTimes(List retentionTimes) { - this.retentionTimes = retentionTimes; - return this; - } - - /** - * Get the retentionDuration property: Retention duration of retention Policy. - * - * @return the retentionDuration value. - */ - public RetentionDuration retentionDuration() { - return this.retentionDuration; - } - - /** - * Set the retentionDuration property: Retention duration of retention Policy. - * - * @param retentionDuration the retentionDuration value to set. - * @return the DailyRetentionSchedule object itself. - */ - public DailyRetentionSchedule withRetentionDuration(RetentionDuration retentionDuration) { - this.retentionDuration = retentionDuration; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("retentionTimes", this.retentionTimes, (writer, element) -> writer - .writeString(element == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(element))); - jsonWriter.writeJsonField("retentionDuration", this.retentionDuration); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DailyRetentionSchedule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DailyRetentionSchedule 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 DailyRetentionSchedule. - */ - public static DailyRetentionSchedule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DailyRetentionSchedule deserializedDailyRetentionSchedule = new DailyRetentionSchedule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("retentionTimes".equals(fieldName)) { - List retentionTimes = reader.readArray(reader1 -> reader1 - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - deserializedDailyRetentionSchedule.retentionTimes = retentionTimes; - } else if ("retentionDuration".equals(fieldName)) { - deserializedDailyRetentionSchedule.retentionDuration = RetentionDuration.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDailyRetentionSchedule; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DailySchedule.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DailySchedule.java deleted file mode 100644 index 140c68f1603c..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DailySchedule.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * The DailySchedule model. - */ -@Fluent -public final class DailySchedule implements JsonSerializable { - /* - * List of times of day this schedule has to be run. - */ - private List scheduleRunTimes; - - /** - * Creates an instance of DailySchedule class. - */ - public DailySchedule() { - } - - /** - * Get the scheduleRunTimes property: List of times of day this schedule has to be run. - * - * @return the scheduleRunTimes value. - */ - public List scheduleRunTimes() { - return this.scheduleRunTimes; - } - - /** - * Set the scheduleRunTimes property: List of times of day this schedule has to be run. - * - * @param scheduleRunTimes the scheduleRunTimes value to set. - * @return the DailySchedule object itself. - */ - public DailySchedule withScheduleRunTimes(List scheduleRunTimes) { - this.scheduleRunTimes = scheduleRunTimes; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("scheduleRunTimes", this.scheduleRunTimes, (writer, element) -> writer - .writeString(element == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(element))); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DailySchedule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DailySchedule 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 DailySchedule. - */ - public static DailySchedule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DailySchedule deserializedDailySchedule = new DailySchedule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("scheduleRunTimes".equals(fieldName)) { - List scheduleRunTimes = reader.readArray(reader1 -> reader1 - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - deserializedDailySchedule.scheduleRunTimes = scheduleRunTimes; - } else { - reader.skipChildren(); - } - } - - return deserializedDailySchedule; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DataMoveLevel.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DataMoveLevel.java deleted file mode 100644 index 25c60aa2d149..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DataMoveLevel.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * DataMove Level. - */ -public final class DataMoveLevel extends ExpandableStringEnum { - /** - * Static value Invalid for DataMoveLevel. - */ - public static final DataMoveLevel INVALID = fromString("Invalid"); - - /** - * Static value Vault for DataMoveLevel. - */ - public static final DataMoveLevel VAULT = fromString("Vault"); - - /** - * Static value Container for DataMoveLevel. - */ - public static final DataMoveLevel CONTAINER = fromString("Container"); - - /** - * Creates a new instance of DataMoveLevel value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DataMoveLevel() { - } - - /** - * Creates or finds a DataMoveLevel from its string representation. - * - * @param name a name to look for. - * @return the corresponding DataMoveLevel. - */ - public static DataMoveLevel fromString(String name) { - return fromString(name, DataMoveLevel.class); - } - - /** - * Gets known DataMoveLevel values. - * - * @return known DataMoveLevel values. - */ - public static Collection values() { - return values(DataMoveLevel.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DataSourceType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DataSourceType.java deleted file mode 100644 index 7e205170f505..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DataSourceType.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Type of workload this item represents. - */ -public final class DataSourceType extends ExpandableStringEnum { - /** - * Static value Invalid for DataSourceType. - */ - public static final DataSourceType INVALID = fromString("Invalid"); - - /** - * Static value VM for DataSourceType. - */ - public static final DataSourceType VM = fromString("VM"); - - /** - * Static value FileFolder for DataSourceType. - */ - public static final DataSourceType FILE_FOLDER = fromString("FileFolder"); - - /** - * Static value AzureSqlDb for DataSourceType. - */ - public static final DataSourceType AZURE_SQL_DB = fromString("AzureSqlDb"); - - /** - * Static value SQLDB for DataSourceType. - */ - public static final DataSourceType SQLDB = fromString("SQLDB"); - - /** - * Static value Exchange for DataSourceType. - */ - public static final DataSourceType EXCHANGE = fromString("Exchange"); - - /** - * Static value Sharepoint for DataSourceType. - */ - public static final DataSourceType SHAREPOINT = fromString("Sharepoint"); - - /** - * Static value VMwareVM for DataSourceType. - */ - public static final DataSourceType VMWARE_VM = fromString("VMwareVM"); - - /** - * Static value SystemState for DataSourceType. - */ - public static final DataSourceType SYSTEM_STATE = fromString("SystemState"); - - /** - * Static value Client for DataSourceType. - */ - public static final DataSourceType CLIENT = fromString("Client"); - - /** - * Static value GenericDataSource for DataSourceType. - */ - public static final DataSourceType GENERIC_DATA_SOURCE = fromString("GenericDataSource"); - - /** - * Static value SQLDataBase for DataSourceType. - */ - public static final DataSourceType SQLDATA_BASE = fromString("SQLDataBase"); - - /** - * Static value AzureFileShare for DataSourceType. - */ - public static final DataSourceType AZURE_FILE_SHARE = fromString("AzureFileShare"); - - /** - * Static value SAPHanaDatabase for DataSourceType. - */ - public static final DataSourceType SAPHANA_DATABASE = fromString("SAPHanaDatabase"); - - /** - * Static value SAPAseDatabase for DataSourceType. - */ - public static final DataSourceType SAPASE_DATABASE = fromString("SAPAseDatabase"); - - /** - * Static value SAPHanaDBInstance for DataSourceType. - */ - public static final DataSourceType SAPHANA_DBINSTANCE = fromString("SAPHanaDBInstance"); - - /** - * Creates a new instance of DataSourceType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DataSourceType() { - } - - /** - * Creates or finds a DataSourceType from its string representation. - * - * @param name a name to look for. - * @return the corresponding DataSourceType. - */ - public static DataSourceType fromString(String name) { - return fromString(name, DataSourceType.class); - } - - /** - * Gets known DataSourceType values. - * - * @return known DataSourceType values. - */ - public static Collection values() { - return values(DataSourceType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DatabaseInRP.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DatabaseInRP.java deleted file mode 100644 index 45bdac255da8..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DatabaseInRP.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Database included in RP. - */ -@Immutable -public final class DatabaseInRP implements JsonSerializable { - /* - * Datasource Id for the database. - */ - private String datasourceId; - - /* - * Datasource name for the database. - */ - private String datasourceName; - - /** - * Creates an instance of DatabaseInRP class. - */ - private DatabaseInRP() { - } - - /** - * Get the datasourceId property: Datasource Id for the database. - * - * @return the datasourceId value. - */ - public String datasourceId() { - return this.datasourceId; - } - - /** - * Get the datasourceName property: Datasource name for the database. - * - * @return the datasourceName value. - */ - public String datasourceName() { - return this.datasourceName; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("datasourceId", this.datasourceId); - jsonWriter.writeStringField("datasourceName", this.datasourceName); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DatabaseInRP from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DatabaseInRP 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 DatabaseInRP. - */ - public static DatabaseInRP fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DatabaseInRP deserializedDatabaseInRP = new DatabaseInRP(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("datasourceId".equals(fieldName)) { - deserializedDatabaseInRP.datasourceId = reader.getString(); - } else if ("datasourceName".equals(fieldName)) { - deserializedDatabaseInRP.datasourceName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDatabaseInRP; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Day.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Day.java deleted file mode 100644 index 4d0cb75b98b5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Day.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Day of the week. - */ -@Fluent -public final class Day implements JsonSerializable { - /* - * Date of the month - */ - private Integer date; - - /* - * Whether Date is last date of month - */ - private Boolean isLast; - - /** - * Creates an instance of Day class. - */ - public Day() { - } - - /** - * Get the date property: Date of the month. - * - * @return the date value. - */ - public Integer date() { - return this.date; - } - - /** - * Set the date property: Date of the month. - * - * @param date the date value to set. - * @return the Day object itself. - */ - public Day withDate(Integer date) { - this.date = date; - return this; - } - - /** - * Get the isLast property: Whether Date is last date of month. - * - * @return the isLast value. - */ - public Boolean isLast() { - return this.isLast; - } - - /** - * Set the isLast property: Whether Date is last date of month. - * - * @param isLast the isLast value to set. - * @return the Day object itself. - */ - public Day withIsLast(Boolean isLast) { - this.isLast = isLast; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("date", this.date); - jsonWriter.writeBooleanField("isLast", this.isLast); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Day from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Day 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 Day. - */ - public static Day fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Day deserializedDay = new Day(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("date".equals(fieldName)) { - deserializedDay.date = reader.getNullable(JsonReader::getInt); - } else if ("isLast".equals(fieldName)) { - deserializedDay.isLast = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedDay; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DayOfWeek.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DayOfWeek.java deleted file mode 100644 index 9b950a438c66..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DayOfWeek.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -/** - * Defines values for DayOfWeek. - */ -public enum DayOfWeek { - /** - * Enum value Sunday. - */ - SUNDAY("Sunday"), - - /** - * Enum value Monday. - */ - MONDAY("Monday"), - - /** - * Enum value Tuesday. - */ - TUESDAY("Tuesday"), - - /** - * Enum value Wednesday. - */ - WEDNESDAY("Wednesday"), - - /** - * Enum value Thursday. - */ - THURSDAY("Thursday"), - - /** - * Enum value Friday. - */ - FRIDAY("Friday"), - - /** - * Enum value Saturday. - */ - SATURDAY("Saturday"); - - /** - * The actual serialized value for a DayOfWeek instance. - */ - private final String value; - - DayOfWeek(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a DayOfWeek instance. - * - * @param value the serialized value to parse. - * @return the parsed DayOfWeek object, or null if unable to parse. - */ - public static DayOfWeek fromString(String value) { - if (value == null) { - return null; - } - DayOfWeek[] items = DayOfWeek.values(); - for (DayOfWeek item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DedupState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DedupState.java deleted file mode 100644 index 9673b77a615e..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DedupState.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Vault Dedup state. - */ -public final class DedupState extends ExpandableStringEnum { - /** - * Static value Invalid for DedupState. - */ - public static final DedupState INVALID = fromString("Invalid"); - - /** - * Static value Enabled for DedupState. - */ - public static final DedupState ENABLED = fromString("Enabled"); - - /** - * Static value Disabled for DedupState. - */ - public static final DedupState DISABLED = fromString("Disabled"); - - /** - * Creates a new instance of DedupState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DedupState() { - } - - /** - * Creates or finds a DedupState from its string representation. - * - * @param name a name to look for. - * @return the corresponding DedupState. - */ - public static DedupState fromString(String name) { - return fromString(name, DedupState.class); - } - - /** - * Gets known DedupState values. - * - * @return known DedupState values. - */ - public static Collection values() { - return values(DedupState.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DeletedProtectionContainers.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DeletedProtectionContainers.java deleted file mode 100644 index 151f79a86870..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DeletedProtectionContainers.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of DeletedProtectionContainers. - */ -public interface DeletedProtectionContainers { - /** - * Lists the soft deleted containers registered to Recovery Services Vault. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String vaultName); - - /** - * Lists the soft deleted containers registered to Recovery Services Vault. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectionContainer resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String vaultName, String filter, - Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DiskExclusionProperties.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DiskExclusionProperties.java deleted file mode 100644 index 4db8692fa4db..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DiskExclusionProperties.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The DiskExclusionProperties model. - */ -@Fluent -public final class DiskExclusionProperties implements JsonSerializable { - /* - * List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. - */ - private List diskLunList; - - /* - * Flag to indicate whether DiskLunList is to be included/ excluded from backup. - */ - private Boolean isInclusionList; - - /** - * Creates an instance of DiskExclusionProperties class. - */ - public DiskExclusionProperties() { - } - - /** - * Get the diskLunList property: List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. - * - * @return the diskLunList value. - */ - public List diskLunList() { - return this.diskLunList; - } - - /** - * Set the diskLunList property: List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. - * - * @param diskLunList the diskLunList value to set. - * @return the DiskExclusionProperties object itself. - */ - public DiskExclusionProperties withDiskLunList(List diskLunList) { - this.diskLunList = diskLunList; - return this; - } - - /** - * Get the isInclusionList property: Flag to indicate whether DiskLunList is to be included/ excluded from backup. - * - * @return the isInclusionList value. - */ - public Boolean isInclusionList() { - return this.isInclusionList; - } - - /** - * Set the isInclusionList property: Flag to indicate whether DiskLunList is to be included/ excluded from backup. - * - * @param isInclusionList the isInclusionList value to set. - * @return the DiskExclusionProperties object itself. - */ - public DiskExclusionProperties withIsInclusionList(Boolean isInclusionList) { - this.isInclusionList = isInclusionList; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("diskLunList", this.diskLunList, (writer, element) -> writer.writeInt(element)); - jsonWriter.writeBooleanField("isInclusionList", this.isInclusionList); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DiskExclusionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DiskExclusionProperties 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 DiskExclusionProperties. - */ - public static DiskExclusionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DiskExclusionProperties deserializedDiskExclusionProperties = new DiskExclusionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("diskLunList".equals(fieldName)) { - List diskLunList = reader.readArray(reader1 -> reader1.getInt()); - deserializedDiskExclusionProperties.diskLunList = diskLunList; - } else if ("isInclusionList".equals(fieldName)) { - deserializedDiskExclusionProperties.isInclusionList = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedDiskExclusionProperties; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DiskInformation.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DiskInformation.java deleted file mode 100644 index 3715a00c3159..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DiskInformation.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Disk information. - */ -@Immutable -public final class DiskInformation implements JsonSerializable { - /* - * The lun property. - */ - private Integer lun; - - /* - * The name property. - */ - private String name; - - /** - * Creates an instance of DiskInformation class. - */ - private DiskInformation() { - } - - /** - * Get the lun property: The lun property. - * - * @return the lun value. - */ - public Integer lun() { - return this.lun; - } - - /** - * Get the name property: The name property. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("lun", this.lun); - jsonWriter.writeStringField("name", this.name); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DiskInformation from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DiskInformation 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 DiskInformation. - */ - public static DiskInformation fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DiskInformation deserializedDiskInformation = new DiskInformation(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("lun".equals(fieldName)) { - deserializedDiskInformation.lun = reader.getNullable(JsonReader::getInt); - } else if ("name".equals(fieldName)) { - deserializedDiskInformation.name = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDiskInformation; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DistributedNodesInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DistributedNodesInfo.java deleted file mode 100644 index f6fa008d4918..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DistributedNodesInfo.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * This is used to represent the various nodes of the distributed container. - */ -@Fluent -public final class DistributedNodesInfo implements JsonSerializable { - /* - * Name of the node under a distributed container. - */ - private String nodeName; - - /* - * Status of this Node. - * Failed | Succeeded - */ - private String status; - - /* - * Error Details if the Status is non-success. - */ - private ErrorDetail errorDetail; - - /* - * ARM resource id of the node - */ - private String sourceResourceId; - - /** - * Creates an instance of DistributedNodesInfo class. - */ - public DistributedNodesInfo() { - } - - /** - * Get the nodeName property: Name of the node under a distributed container. - * - * @return the nodeName value. - */ - public String nodeName() { - return this.nodeName; - } - - /** - * Set the nodeName property: Name of the node under a distributed container. - * - * @param nodeName the nodeName value to set. - * @return the DistributedNodesInfo object itself. - */ - public DistributedNodesInfo withNodeName(String nodeName) { - this.nodeName = nodeName; - return this; - } - - /** - * Get the status property: Status of this Node. - * Failed | Succeeded. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: Status of this Node. - * Failed | Succeeded. - * - * @param status the status value to set. - * @return the DistributedNodesInfo object itself. - */ - public DistributedNodesInfo withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the errorDetail property: Error Details if the Status is non-success. - * - * @return the errorDetail value. - */ - public ErrorDetail errorDetail() { - return this.errorDetail; - } - - /** - * Set the errorDetail property: Error Details if the Status is non-success. - * - * @param errorDetail the errorDetail value to set. - * @return the DistributedNodesInfo object itself. - */ - public DistributedNodesInfo withErrorDetail(ErrorDetail errorDetail) { - this.errorDetail = errorDetail; - return this; - } - - /** - * Get the sourceResourceId property: ARM resource id of the node. - * - * @return the sourceResourceId value. - */ - public String sourceResourceId() { - return this.sourceResourceId; - } - - /** - * Set the sourceResourceId property: ARM resource id of the node. - * - * @param sourceResourceId the sourceResourceId value to set. - * @return the DistributedNodesInfo object itself. - */ - public DistributedNodesInfo withSourceResourceId(String sourceResourceId) { - this.sourceResourceId = sourceResourceId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nodeName", this.nodeName); - jsonWriter.writeStringField("status", this.status); - jsonWriter.writeJsonField("errorDetail", this.errorDetail); - jsonWriter.writeStringField("sourceResourceId", this.sourceResourceId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DistributedNodesInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DistributedNodesInfo 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 DistributedNodesInfo. - */ - public static DistributedNodesInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DistributedNodesInfo deserializedDistributedNodesInfo = new DistributedNodesInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nodeName".equals(fieldName)) { - deserializedDistributedNodesInfo.nodeName = reader.getString(); - } else if ("status".equals(fieldName)) { - deserializedDistributedNodesInfo.status = reader.getString(); - } else if ("errorDetail".equals(fieldName)) { - deserializedDistributedNodesInfo.errorDetail = ErrorDetail.fromJson(reader); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedDistributedNodesInfo.sourceResourceId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDistributedNodesInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmBackupEngine.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmBackupEngine.java deleted file mode 100644 index 9534ec46b3cb..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmBackupEngine.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Data Protection Manager (DPM) specific backup engine. - */ -@Immutable -public final class DpmBackupEngine extends BackupEngineBase { - /* - * Type of the backup engine. - */ - private BackupEngineType backupEngineType = BackupEngineType.DPM_BACKUP_ENGINE; - - /** - * Creates an instance of DpmBackupEngine class. - */ - private DpmBackupEngine() { - } - - /** - * Get the backupEngineType property: Type of the backup engine. - * - * @return the backupEngineType value. - */ - @Override - public BackupEngineType backupEngineType() { - return this.backupEngineType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("registrationStatus", registrationStatus()); - jsonWriter.writeStringField("backupEngineState", backupEngineState()); - jsonWriter.writeStringField("healthStatus", healthStatus()); - jsonWriter.writeBooleanField("canReRegister", canReRegister()); - jsonWriter.writeStringField("backupEngineId", backupEngineId()); - jsonWriter.writeStringField("dpmVersion", dpmVersion()); - jsonWriter.writeStringField("azureBackupAgentVersion", azureBackupAgentVersion()); - jsonWriter.writeBooleanField("isAzureBackupAgentUpgradeAvailable", isAzureBackupAgentUpgradeAvailable()); - jsonWriter.writeBooleanField("isDpmUpgradeAvailable", isDpmUpgradeAvailable()); - jsonWriter.writeJsonField("extendedInfo", extendedInfo()); - jsonWriter.writeStringField("backupEngineType", - this.backupEngineType == null ? null : this.backupEngineType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DpmBackupEngine from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DpmBackupEngine 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 DpmBackupEngine. - */ - public static DpmBackupEngine fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DpmBackupEngine deserializedDpmBackupEngine = new DpmBackupEngine(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("friendlyName".equals(fieldName)) { - deserializedDpmBackupEngine.withFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedDpmBackupEngine - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("registrationStatus".equals(fieldName)) { - deserializedDpmBackupEngine.withRegistrationStatus(reader.getString()); - } else if ("backupEngineState".equals(fieldName)) { - deserializedDpmBackupEngine.withBackupEngineState(reader.getString()); - } else if ("healthStatus".equals(fieldName)) { - deserializedDpmBackupEngine.withHealthStatus(reader.getString()); - } else if ("canReRegister".equals(fieldName)) { - deserializedDpmBackupEngine.withCanReRegister(reader.getNullable(JsonReader::getBoolean)); - } else if ("backupEngineId".equals(fieldName)) { - deserializedDpmBackupEngine.withBackupEngineId(reader.getString()); - } else if ("dpmVersion".equals(fieldName)) { - deserializedDpmBackupEngine.withDpmVersion(reader.getString()); - } else if ("azureBackupAgentVersion".equals(fieldName)) { - deserializedDpmBackupEngine.withAzureBackupAgentVersion(reader.getString()); - } else if ("isAzureBackupAgentUpgradeAvailable".equals(fieldName)) { - deserializedDpmBackupEngine - .withIsAzureBackupAgentUpgradeAvailable(reader.getNullable(JsonReader::getBoolean)); - } else if ("isDpmUpgradeAvailable".equals(fieldName)) { - deserializedDpmBackupEngine.withIsDpmUpgradeAvailable(reader.getNullable(JsonReader::getBoolean)); - } else if ("extendedInfo".equals(fieldName)) { - deserializedDpmBackupEngine.withExtendedInfo(BackupEngineExtendedInfo.fromJson(reader)); - } else if ("backupEngineType".equals(fieldName)) { - deserializedDpmBackupEngine.backupEngineType = BackupEngineType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDpmBackupEngine; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmContainer.java deleted file mode 100644 index 5fc05a304245..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmContainer.java +++ /dev/null @@ -1,395 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * DPM workload-specific protection container. - */ -@Fluent -public class DpmContainer extends ProtectionContainer { - /* - * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines - * 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer - */ - private ProtectableContainerType containerType = ProtectableContainerType.DPMCONTAINER; - - /* - * Specifies whether the container is re-registrable. - */ - private Boolean canReRegister; - - /* - * ID of container. - */ - private String containerId; - - /* - * Number of protected items in the BackupEngine - */ - private Long protectedItemCount; - - /* - * Backup engine Agent version - */ - private String dpmAgentVersion; - - /* - * List of BackupEngines protecting the container - */ - private List dpmServers; - - /* - * To check if upgrade available - */ - private Boolean upgradeAvailable; - - /* - * Protection status of the container. - */ - private String protectionStatus; - - /* - * Extended Info of the container. - */ - private DpmContainerExtendedInfo extendedInfo; - - /** - * Creates an instance of DpmContainer class. - */ - public DpmContainer() { - } - - /** - * Get the containerType property: Type of the container. The value of this property for: 1. Compute Azure VM is - * Microsoft.Compute/virtualMachines 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer. - * - * @return the containerType value. - */ - @Override - public ProtectableContainerType containerType() { - return this.containerType; - } - - /** - * Get the canReRegister property: Specifies whether the container is re-registrable. - * - * @return the canReRegister value. - */ - public Boolean canReRegister() { - return this.canReRegister; - } - - /** - * Set the canReRegister property: Specifies whether the container is re-registrable. - * - * @param canReRegister the canReRegister value to set. - * @return the DpmContainer object itself. - */ - public DpmContainer withCanReRegister(Boolean canReRegister) { - this.canReRegister = canReRegister; - return this; - } - - /** - * Get the containerId property: ID of container. - * - * @return the containerId value. - */ - public String containerId() { - return this.containerId; - } - - /** - * Set the containerId property: ID of container. - * - * @param containerId the containerId value to set. - * @return the DpmContainer object itself. - */ - public DpmContainer withContainerId(String containerId) { - this.containerId = containerId; - return this; - } - - /** - * Get the protectedItemCount property: Number of protected items in the BackupEngine. - * - * @return the protectedItemCount value. - */ - public Long protectedItemCount() { - return this.protectedItemCount; - } - - /** - * Set the protectedItemCount property: Number of protected items in the BackupEngine. - * - * @param protectedItemCount the protectedItemCount value to set. - * @return the DpmContainer object itself. - */ - public DpmContainer withProtectedItemCount(Long protectedItemCount) { - this.protectedItemCount = protectedItemCount; - return this; - } - - /** - * Get the dpmAgentVersion property: Backup engine Agent version. - * - * @return the dpmAgentVersion value. - */ - public String dpmAgentVersion() { - return this.dpmAgentVersion; - } - - /** - * Set the dpmAgentVersion property: Backup engine Agent version. - * - * @param dpmAgentVersion the dpmAgentVersion value to set. - * @return the DpmContainer object itself. - */ - public DpmContainer withDpmAgentVersion(String dpmAgentVersion) { - this.dpmAgentVersion = dpmAgentVersion; - return this; - } - - /** - * Get the dpmServers property: List of BackupEngines protecting the container. - * - * @return the dpmServers value. - */ - public List dpmServers() { - return this.dpmServers; - } - - /** - * Set the dpmServers property: List of BackupEngines protecting the container. - * - * @param dpmServers the dpmServers value to set. - * @return the DpmContainer object itself. - */ - public DpmContainer withDpmServers(List dpmServers) { - this.dpmServers = dpmServers; - return this; - } - - /** - * Get the upgradeAvailable property: To check if upgrade available. - * - * @return the upgradeAvailable value. - */ - public Boolean upgradeAvailable() { - return this.upgradeAvailable; - } - - /** - * Set the upgradeAvailable property: To check if upgrade available. - * - * @param upgradeAvailable the upgradeAvailable value to set. - * @return the DpmContainer object itself. - */ - public DpmContainer withUpgradeAvailable(Boolean upgradeAvailable) { - this.upgradeAvailable = upgradeAvailable; - return this; - } - - /** - * Get the protectionStatus property: Protection status of the container. - * - * @return the protectionStatus value. - */ - public String protectionStatus() { - return this.protectionStatus; - } - - /** - * Set the protectionStatus property: Protection status of the container. - * - * @param protectionStatus the protectionStatus value to set. - * @return the DpmContainer object itself. - */ - public DpmContainer withProtectionStatus(String protectionStatus) { - this.protectionStatus = protectionStatus; - return this; - } - - /** - * Get the extendedInfo property: Extended Info of the container. - * - * @return the extendedInfo value. - */ - public DpmContainerExtendedInfo extendedInfo() { - return this.extendedInfo; - } - - /** - * Set the extendedInfo property: Extended Info of the container. - * - * @param extendedInfo the extendedInfo value to set. - * @return the DpmContainer object itself. - */ - public DpmContainer withExtendedInfo(DpmContainerExtendedInfo extendedInfo) { - this.extendedInfo = extendedInfo; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DpmContainer withFriendlyName(String friendlyName) { - super.withFriendlyName(friendlyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DpmContainer withBackupManagementType(BackupManagementType backupManagementType) { - super.withBackupManagementType(backupManagementType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DpmContainer withRegistrationStatus(String registrationStatus) { - super.withRegistrationStatus(registrationStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DpmContainer withHealthStatus(String healthStatus) { - super.withHealthStatus(healthStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DpmContainer withProtectableObjectType(String protectableObjectType) { - super.withProtectableObjectType(protectableObjectType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("registrationStatus", registrationStatus()); - jsonWriter.writeStringField("healthStatus", healthStatus()); - jsonWriter.writeStringField("protectableObjectType", protectableObjectType()); - jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString()); - jsonWriter.writeBooleanField("canReRegister", this.canReRegister); - jsonWriter.writeStringField("containerId", this.containerId); - jsonWriter.writeNumberField("protectedItemCount", this.protectedItemCount); - jsonWriter.writeStringField("dpmAgentVersion", this.dpmAgentVersion); - jsonWriter.writeArrayField("dpmServers", this.dpmServers, (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("upgradeAvailable", this.upgradeAvailable); - jsonWriter.writeStringField("protectionStatus", this.protectionStatus); - jsonWriter.writeJsonField("extendedInfo", this.extendedInfo); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DpmContainer from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DpmContainer 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 DpmContainer. - */ - public static DpmContainer fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("containerType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureBackupServerContainer".equals(discriminatorValue)) { - return AzureBackupServerContainer.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static DpmContainer fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DpmContainer deserializedDpmContainer = new DpmContainer(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("friendlyName".equals(fieldName)) { - deserializedDpmContainer.withFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedDpmContainer - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("registrationStatus".equals(fieldName)) { - deserializedDpmContainer.withRegistrationStatus(reader.getString()); - } else if ("healthStatus".equals(fieldName)) { - deserializedDpmContainer.withHealthStatus(reader.getString()); - } else if ("protectableObjectType".equals(fieldName)) { - deserializedDpmContainer.withProtectableObjectType(reader.getString()); - } else if ("containerType".equals(fieldName)) { - deserializedDpmContainer.containerType = ProtectableContainerType.fromString(reader.getString()); - } else if ("canReRegister".equals(fieldName)) { - deserializedDpmContainer.canReRegister = reader.getNullable(JsonReader::getBoolean); - } else if ("containerId".equals(fieldName)) { - deserializedDpmContainer.containerId = reader.getString(); - } else if ("protectedItemCount".equals(fieldName)) { - deserializedDpmContainer.protectedItemCount = reader.getNullable(JsonReader::getLong); - } else if ("dpmAgentVersion".equals(fieldName)) { - deserializedDpmContainer.dpmAgentVersion = reader.getString(); - } else if ("dpmServers".equals(fieldName)) { - List dpmServers = reader.readArray(reader1 -> reader1.getString()); - deserializedDpmContainer.dpmServers = dpmServers; - } else if ("upgradeAvailable".equals(fieldName)) { - deserializedDpmContainer.upgradeAvailable = reader.getNullable(JsonReader::getBoolean); - } else if ("protectionStatus".equals(fieldName)) { - deserializedDpmContainer.protectionStatus = reader.getString(); - } else if ("extendedInfo".equals(fieldName)) { - deserializedDpmContainer.extendedInfo = DpmContainerExtendedInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDpmContainer; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmContainerExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmContainerExtendedInfo.java deleted file mode 100644 index f79cf242b7fc..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmContainerExtendedInfo.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Additional information of the DPMContainer. - */ -@Fluent -public final class DpmContainerExtendedInfo implements JsonSerializable { - /* - * Last refresh time of the DPMContainer. - */ - private OffsetDateTime lastRefreshedAt; - - /** - * Creates an instance of DpmContainerExtendedInfo class. - */ - public DpmContainerExtendedInfo() { - } - - /** - * Get the lastRefreshedAt property: Last refresh time of the DPMContainer. - * - * @return the lastRefreshedAt value. - */ - public OffsetDateTime lastRefreshedAt() { - return this.lastRefreshedAt; - } - - /** - * Set the lastRefreshedAt property: Last refresh time of the DPMContainer. - * - * @param lastRefreshedAt the lastRefreshedAt value to set. - * @return the DpmContainerExtendedInfo object itself. - */ - public DpmContainerExtendedInfo withLastRefreshedAt(OffsetDateTime lastRefreshedAt) { - this.lastRefreshedAt = lastRefreshedAt; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("lastRefreshedAt", - this.lastRefreshedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastRefreshedAt)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DpmContainerExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DpmContainerExtendedInfo 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 DpmContainerExtendedInfo. - */ - public static DpmContainerExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DpmContainerExtendedInfo deserializedDpmContainerExtendedInfo = new DpmContainerExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("lastRefreshedAt".equals(fieldName)) { - deserializedDpmContainerExtendedInfo.lastRefreshedAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedDpmContainerExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmErrorInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmErrorInfo.java deleted file mode 100644 index 989699665198..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmErrorInfo.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * DPM workload-specific error information. - */ -@Immutable -public final class DpmErrorInfo implements JsonSerializable { - /* - * Localized error string. - */ - private String errorString; - - /* - * List of localized recommendations for above error code. - */ - private List recommendations; - - /** - * Creates an instance of DpmErrorInfo class. - */ - private DpmErrorInfo() { - } - - /** - * Get the errorString property: Localized error string. - * - * @return the errorString value. - */ - public String errorString() { - return this.errorString; - } - - /** - * Get the recommendations property: List of localized recommendations for above error code. - * - * @return the recommendations value. - */ - public List recommendations() { - return this.recommendations; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("errorString", this.errorString); - jsonWriter.writeArrayField("recommendations", this.recommendations, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DpmErrorInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DpmErrorInfo 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 DpmErrorInfo. - */ - public static DpmErrorInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DpmErrorInfo deserializedDpmErrorInfo = new DpmErrorInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("errorString".equals(fieldName)) { - deserializedDpmErrorInfo.errorString = reader.getString(); - } else if ("recommendations".equals(fieldName)) { - List recommendations = reader.readArray(reader1 -> reader1.getString()); - deserializedDpmErrorInfo.recommendations = recommendations; - } else { - reader.skipChildren(); - } - } - - return deserializedDpmErrorInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJob.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJob.java deleted file mode 100644 index 263cbdd21474..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJob.java +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.Duration; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * DPM workload-specific job object. - */ -@Immutable -public final class DpmJob extends Job { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String jobType = "DpmJob"; - - /* - * Time elapsed for job. - */ - private Duration duration; - - /* - * DPM server name managing the backup item or backup job. - */ - private String dpmServerName; - - /* - * Name of cluster/server protecting current backup item, if any. - */ - private String containerName; - - /* - * Type of container. - */ - private String containerType; - - /* - * Type of backup item. - */ - private String workloadType; - - /* - * The state/actions applicable on this job like cancel/retry. - */ - private List actionsInfo; - - /* - * The errors. - */ - private List errorDetails; - - /* - * Additional information for this job. - */ - private DpmJobExtendedInfo extendedInfo; - - /** - * Creates an instance of DpmJob class. - */ - private DpmJob() { - } - - /** - * Get the jobType property: This property will be used as the discriminator for deciding the specific types in the - * polymorphic chain of types. - * - * @return the jobType value. - */ - @Override - public String jobType() { - return this.jobType; - } - - /** - * Get the duration property: Time elapsed for job. - * - * @return the duration value. - */ - public Duration duration() { - return this.duration; - } - - /** - * Get the dpmServerName property: DPM server name managing the backup item or backup job. - * - * @return the dpmServerName value. - */ - public String dpmServerName() { - return this.dpmServerName; - } - - /** - * Get the containerName property: Name of cluster/server protecting current backup item, if any. - * - * @return the containerName value. - */ - public String containerName() { - return this.containerName; - } - - /** - * Get the containerType property: Type of container. - * - * @return the containerType value. - */ - public String containerType() { - return this.containerType; - } - - /** - * Get the workloadType property: Type of backup item. - * - * @return the workloadType value. - */ - public String workloadType() { - return this.workloadType; - } - - /** - * Get the actionsInfo property: The state/actions applicable on this job like cancel/retry. - * - * @return the actionsInfo value. - */ - public List actionsInfo() { - return this.actionsInfo; - } - - /** - * Get the errorDetails property: The errors. - * - * @return the errorDetails value. - */ - public List errorDetails() { - return this.errorDetails; - } - - /** - * Get the extendedInfo property: Additional information for this job. - * - * @return the extendedInfo value. - */ - public DpmJobExtendedInfo extendedInfo() { - return this.extendedInfo; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("entityFriendlyName", entityFriendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("operation", operation()); - jsonWriter.writeStringField("status", status()); - jsonWriter.writeStringField("startTime", - startTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(startTime())); - jsonWriter.writeStringField("endTime", - endTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(endTime())); - jsonWriter.writeStringField("activityId", activityId()); - jsonWriter.writeStringField("jobType", this.jobType); - jsonWriter.writeStringField("duration", CoreUtils.durationToStringWithDays(this.duration)); - jsonWriter.writeStringField("dpmServerName", this.dpmServerName); - jsonWriter.writeStringField("containerName", this.containerName); - jsonWriter.writeStringField("containerType", this.containerType); - jsonWriter.writeStringField("workloadType", this.workloadType); - jsonWriter.writeArrayField("actionsInfo", this.actionsInfo, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("errorDetails", this.errorDetails, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("extendedInfo", this.extendedInfo); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DpmJob from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DpmJob 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 DpmJob. - */ - public static DpmJob fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DpmJob deserializedDpmJob = new DpmJob(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("entityFriendlyName".equals(fieldName)) { - deserializedDpmJob.withEntityFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedDpmJob.withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("operation".equals(fieldName)) { - deserializedDpmJob.withOperation(reader.getString()); - } else if ("status".equals(fieldName)) { - deserializedDpmJob.withStatus(reader.getString()); - } else if ("startTime".equals(fieldName)) { - deserializedDpmJob.withStartTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("endTime".equals(fieldName)) { - deserializedDpmJob.withEndTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("activityId".equals(fieldName)) { - deserializedDpmJob.withActivityId(reader.getString()); - } else if ("jobType".equals(fieldName)) { - deserializedDpmJob.jobType = reader.getString(); - } else if ("duration".equals(fieldName)) { - deserializedDpmJob.duration - = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); - } else if ("dpmServerName".equals(fieldName)) { - deserializedDpmJob.dpmServerName = reader.getString(); - } else if ("containerName".equals(fieldName)) { - deserializedDpmJob.containerName = reader.getString(); - } else if ("containerType".equals(fieldName)) { - deserializedDpmJob.containerType = reader.getString(); - } else if ("workloadType".equals(fieldName)) { - deserializedDpmJob.workloadType = reader.getString(); - } else if ("actionsInfo".equals(fieldName)) { - List actionsInfo - = reader.readArray(reader1 -> JobSupportedAction.fromString(reader1.getString())); - deserializedDpmJob.actionsInfo = actionsInfo; - } else if ("errorDetails".equals(fieldName)) { - List errorDetails = reader.readArray(reader1 -> DpmErrorInfo.fromJson(reader1)); - deserializedDpmJob.errorDetails = errorDetails; - } else if ("extendedInfo".equals(fieldName)) { - deserializedDpmJob.extendedInfo = DpmJobExtendedInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDpmJob; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJobExtendedInfo.java deleted file mode 100644 index 8169e6d783f3..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJobExtendedInfo.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; -import java.util.Map; - -/** - * Additional information on the DPM workload-specific job. - */ -@Immutable -public final class DpmJobExtendedInfo implements JsonSerializable { - /* - * List of tasks associated with this job. - */ - private List tasksList; - - /* - * The job properties. - */ - private Map propertyBag; - - /* - * Non localized error message on job execution. - */ - private String dynamicErrorMessage; - - /** - * Creates an instance of DpmJobExtendedInfo class. - */ - private DpmJobExtendedInfo() { - } - - /** - * Get the tasksList property: List of tasks associated with this job. - * - * @return the tasksList value. - */ - public List tasksList() { - return this.tasksList; - } - - /** - * Get the propertyBag property: The job properties. - * - * @return the propertyBag value. - */ - public Map propertyBag() { - return this.propertyBag; - } - - /** - * Get the dynamicErrorMessage property: Non localized error message on job execution. - * - * @return the dynamicErrorMessage value. - */ - public String dynamicErrorMessage() { - return this.dynamicErrorMessage; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("tasksList", this.tasksList, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeMapField("propertyBag", this.propertyBag, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("dynamicErrorMessage", this.dynamicErrorMessage); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DpmJobExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DpmJobExtendedInfo 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 DpmJobExtendedInfo. - */ - public static DpmJobExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DpmJobExtendedInfo deserializedDpmJobExtendedInfo = new DpmJobExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("tasksList".equals(fieldName)) { - List tasksList - = reader.readArray(reader1 -> DpmJobTaskDetails.fromJson(reader1)); - deserializedDpmJobExtendedInfo.tasksList = tasksList; - } else if ("propertyBag".equals(fieldName)) { - Map propertyBag = reader.readMap(reader1 -> reader1.getString()); - deserializedDpmJobExtendedInfo.propertyBag = propertyBag; - } else if ("dynamicErrorMessage".equals(fieldName)) { - deserializedDpmJobExtendedInfo.dynamicErrorMessage = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDpmJobExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJobTaskDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJobTaskDetails.java deleted file mode 100644 index a9e5b7a42f83..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmJobTaskDetails.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * DPM workload-specific job task details. - */ -@Immutable -public final class DpmJobTaskDetails implements JsonSerializable { - /* - * The task display name. - */ - private String taskId; - - /* - * The start time. - */ - private OffsetDateTime startTime; - - /* - * The end time. - */ - private OffsetDateTime endTime; - - /* - * Time elapsed for task. - */ - private Duration duration; - - /* - * The status. - */ - private String status; - - /** - * Creates an instance of DpmJobTaskDetails class. - */ - private DpmJobTaskDetails() { - } - - /** - * Get the taskId property: The task display name. - * - * @return the taskId value. - */ - public String taskId() { - return this.taskId; - } - - /** - * Get the startTime property: The start time. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Get the endTime property: The end time. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Get the duration property: Time elapsed for task. - * - * @return the duration value. - */ - public Duration duration() { - return this.duration; - } - - /** - * Get the status property: The status. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskId", this.taskId); - jsonWriter.writeStringField("startTime", - this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); - jsonWriter.writeStringField("endTime", - this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); - jsonWriter.writeStringField("duration", CoreUtils.durationToStringWithDays(this.duration)); - jsonWriter.writeStringField("status", this.status); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DpmJobTaskDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DpmJobTaskDetails 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 DpmJobTaskDetails. - */ - public static DpmJobTaskDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DpmJobTaskDetails deserializedDpmJobTaskDetails = new DpmJobTaskDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("taskId".equals(fieldName)) { - deserializedDpmJobTaskDetails.taskId = reader.getString(); - } else if ("startTime".equals(fieldName)) { - deserializedDpmJobTaskDetails.startTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("endTime".equals(fieldName)) { - deserializedDpmJobTaskDetails.endTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("duration".equals(fieldName)) { - deserializedDpmJobTaskDetails.duration - = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); - } else if ("status".equals(fieldName)) { - deserializedDpmJobTaskDetails.status = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDpmJobTaskDetails; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItem.java deleted file mode 100644 index ed9b1cad889e..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItem.java +++ /dev/null @@ -1,401 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Additional information on Backup engine specific backup item. - */ -@Fluent -public final class DpmProtectedItem extends ProtectedItem { - /* - * backup item type. - */ - private String protectedItemType = "DPMProtectedItem"; - - /* - * Friendly name of the managed item - */ - private String friendlyName; - - /* - * Backup Management server protecting this backup item - */ - private String backupEngineName; - - /* - * Protection state of the backup engine - */ - private ProtectedItemState protectionState; - - /* - * Extended info of the backup item. - */ - private DpmProtectedItemExtendedInfo extendedInfo; - - /** - * Creates an instance of DpmProtectedItem class. - */ - public DpmProtectedItem() { - } - - /** - * Get the protectedItemType property: backup item type. - * - * @return the protectedItemType value. - */ - @Override - public String protectedItemType() { - return this.protectedItemType; - } - - /** - * Get the friendlyName property: Friendly name of the managed item. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.friendlyName; - } - - /** - * Set the friendlyName property: Friendly name of the managed item. - * - * @param friendlyName the friendlyName value to set. - * @return the DpmProtectedItem object itself. - */ - public DpmProtectedItem withFriendlyName(String friendlyName) { - this.friendlyName = friendlyName; - return this; - } - - /** - * Get the backupEngineName property: Backup Management server protecting this backup item. - * - * @return the backupEngineName value. - */ - public String backupEngineName() { - return this.backupEngineName; - } - - /** - * Set the backupEngineName property: Backup Management server protecting this backup item. - * - * @param backupEngineName the backupEngineName value to set. - * @return the DpmProtectedItem object itself. - */ - public DpmProtectedItem withBackupEngineName(String backupEngineName) { - this.backupEngineName = backupEngineName; - return this; - } - - /** - * Get the protectionState property: Protection state of the backup engine. - * - * @return the protectionState value. - */ - public ProtectedItemState protectionState() { - return this.protectionState; - } - - /** - * Set the protectionState property: Protection state of the backup engine. - * - * @param protectionState the protectionState value to set. - * @return the DpmProtectedItem object itself. - */ - public DpmProtectedItem withProtectionState(ProtectedItemState protectionState) { - this.protectionState = protectionState; - return this; - } - - /** - * Get the extendedInfo property: Extended info of the backup item. - * - * @return the extendedInfo value. - */ - public DpmProtectedItemExtendedInfo extendedInfo() { - return this.extendedInfo; - } - - /** - * Set the extendedInfo property: Extended info of the backup item. - * - * @param extendedInfo the extendedInfo value to set. - * @return the DpmProtectedItem object itself. - */ - public DpmProtectedItem withExtendedInfo(DpmProtectedItemExtendedInfo extendedInfo) { - this.extendedInfo = extendedInfo; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DpmProtectedItem withContainerName(String containerName) { - super.withContainerName(containerName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DpmProtectedItem withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DpmProtectedItem withPolicyId(String policyId) { - super.withPolicyId(policyId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DpmProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { - super.withLastRecoveryPoint(lastRecoveryPoint); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DpmProtectedItem withBackupSetName(String backupSetName) { - super.withBackupSetName(backupSetName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DpmProtectedItem withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DpmProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { - super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DpmProtectedItem withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { - super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DpmProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { - super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DpmProtectedItem withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { - super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DpmProtectedItem withIsRehydrate(Boolean isRehydrate) { - super.withIsRehydrate(isRehydrate); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DpmProtectedItem withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DpmProtectedItem withIsArchiveEnabled(Boolean isArchiveEnabled) { - super.withIsArchiveEnabled(isArchiveEnabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DpmProtectedItem withPolicyName(String policyName) { - super.withPolicyName(policyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DpmProtectedItem withSoftDeleteRetentionPeriodInDays(Integer softDeleteRetentionPeriodInDays) { - super.withSoftDeleteRetentionPeriodInDays(softDeleteRetentionPeriodInDays); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DpmProtectedItem withSourceSideScanInfo(SourceSideScanInfo sourceSideScanInfo) { - super.withSourceSideScanInfo(sourceSideScanInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("containerName", containerName()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("policyId", policyId()); - jsonWriter.writeStringField("lastRecoveryPoint", - lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint())); - jsonWriter.writeStringField("backupSetName", backupSetName()); - jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString()); - jsonWriter.writeStringField("deferredDeleteTimeInUTC", - deferredDeleteTimeInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc())); - jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete()); - jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining()); - jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming()); - jsonWriter.writeBooleanField("isRehydrate", isRehydrate()); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled()); - jsonWriter.writeStringField("policyName", policyName()); - jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriodInDays()); - jsonWriter.writeJsonField("sourceSideScanInfo", sourceSideScanInfo()); - jsonWriter.writeStringField("protectedItemType", this.protectedItemType); - jsonWriter.writeStringField("friendlyName", this.friendlyName); - jsonWriter.writeStringField("backupEngineName", this.backupEngineName); - jsonWriter.writeStringField("protectionState", - this.protectionState == null ? null : this.protectionState.toString()); - jsonWriter.writeJsonField("extendedInfo", this.extendedInfo); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DpmProtectedItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DpmProtectedItem 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 DpmProtectedItem. - */ - public static DpmProtectedItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DpmProtectedItem deserializedDpmProtectedItem = new DpmProtectedItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedDpmProtectedItem - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("workloadType".equals(fieldName)) { - deserializedDpmProtectedItem.withWorkloadType(DataSourceType.fromString(reader.getString())); - } else if ("containerName".equals(fieldName)) { - deserializedDpmProtectedItem.withContainerName(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedDpmProtectedItem.withSourceResourceId(reader.getString()); - } else if ("policyId".equals(fieldName)) { - deserializedDpmProtectedItem.withPolicyId(reader.getString()); - } else if ("lastRecoveryPoint".equals(fieldName)) { - deserializedDpmProtectedItem.withLastRecoveryPoint(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("backupSetName".equals(fieldName)) { - deserializedDpmProtectedItem.withBackupSetName(reader.getString()); - } else if ("createMode".equals(fieldName)) { - deserializedDpmProtectedItem.withCreateMode(CreateMode.fromString(reader.getString())); - } else if ("deferredDeleteTimeInUTC".equals(fieldName)) { - deserializedDpmProtectedItem.withDeferredDeleteTimeInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("isScheduledForDeferredDelete".equals(fieldName)) { - deserializedDpmProtectedItem - .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean)); - } else if ("deferredDeleteTimeRemaining".equals(fieldName)) { - deserializedDpmProtectedItem.withDeferredDeleteTimeRemaining(reader.getString()); - } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) { - deserializedDpmProtectedItem - .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean)); - } else if ("isRehydrate".equals(fieldName)) { - deserializedDpmProtectedItem.withIsRehydrate(reader.getNullable(JsonReader::getBoolean)); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedDpmProtectedItem.withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("isArchiveEnabled".equals(fieldName)) { - deserializedDpmProtectedItem.withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("policyName".equals(fieldName)) { - deserializedDpmProtectedItem.withPolicyName(reader.getString()); - } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) { - deserializedDpmProtectedItem - .withSoftDeleteRetentionPeriodInDays(reader.getNullable(JsonReader::getInt)); - } else if ("vaultId".equals(fieldName)) { - deserializedDpmProtectedItem.withVaultId(reader.getString()); - } else if ("sourceSideScanInfo".equals(fieldName)) { - deserializedDpmProtectedItem.withSourceSideScanInfo(SourceSideScanInfo.fromJson(reader)); - } else if ("protectedItemType".equals(fieldName)) { - deserializedDpmProtectedItem.protectedItemType = reader.getString(); - } else if ("friendlyName".equals(fieldName)) { - deserializedDpmProtectedItem.friendlyName = reader.getString(); - } else if ("backupEngineName".equals(fieldName)) { - deserializedDpmProtectedItem.backupEngineName = reader.getString(); - } else if ("protectionState".equals(fieldName)) { - deserializedDpmProtectedItem.protectionState = ProtectedItemState.fromString(reader.getString()); - } else if ("extendedInfo".equals(fieldName)) { - deserializedDpmProtectedItem.extendedInfo = DpmProtectedItemExtendedInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDpmProtectedItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItemExtendedInfo.java deleted file mode 100644 index 50c23ea5a300..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/DpmProtectedItemExtendedInfo.java +++ /dev/null @@ -1,473 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.Map; - -/** - * Additional information of DPM Protected item. - */ -@Fluent -public final class DpmProtectedItemExtendedInfo implements JsonSerializable { - /* - * Attribute to provide information on various DBs. - */ - private Map protectableObjectLoadPath; - - /* - * To check if backup item is disk protected. - */ - private Boolean protectedProperty; - - /* - * To check if backup item is cloud protected. - */ - private Boolean isPresentOnCloud; - - /* - * Last backup status information on backup item. - */ - private String lastBackupStatus; - - /* - * Last refresh time on backup item. - */ - private OffsetDateTime lastRefreshedAt; - - /* - * Oldest cloud recovery point time. - */ - private OffsetDateTime oldestRecoveryPoint; - - /* - * cloud recovery point count. - */ - private Integer recoveryPointCount; - - /* - * Oldest disk recovery point time. - */ - private OffsetDateTime onPremiseOldestRecoveryPoint; - - /* - * latest disk recovery point time. - */ - private OffsetDateTime onPremiseLatestRecoveryPoint; - - /* - * disk recovery point count. - */ - private Integer onPremiseRecoveryPointCount; - - /* - * To check if backup item is collocated. - */ - private Boolean isCollocated; - - /* - * Protection group name of the backup item. - */ - private String protectionGroupName; - - /* - * Used Disk storage in bytes. - */ - private String diskStorageUsedInBytes; - - /* - * total Disk storage in bytes. - */ - private String totalDiskStorageSizeInBytes; - - /** - * Creates an instance of DpmProtectedItemExtendedInfo class. - */ - public DpmProtectedItemExtendedInfo() { - } - - /** - * Get the protectableObjectLoadPath property: Attribute to provide information on various DBs. - * - * @return the protectableObjectLoadPath value. - */ - public Map protectableObjectLoadPath() { - return this.protectableObjectLoadPath; - } - - /** - * Set the protectableObjectLoadPath property: Attribute to provide information on various DBs. - * - * @param protectableObjectLoadPath the protectableObjectLoadPath value to set. - * @return the DpmProtectedItemExtendedInfo object itself. - */ - public DpmProtectedItemExtendedInfo withProtectableObjectLoadPath(Map protectableObjectLoadPath) { - this.protectableObjectLoadPath = protectableObjectLoadPath; - return this; - } - - /** - * Get the protectedProperty property: To check if backup item is disk protected. - * - * @return the protectedProperty value. - */ - public Boolean protectedProperty() { - return this.protectedProperty; - } - - /** - * Set the protectedProperty property: To check if backup item is disk protected. - * - * @param protectedProperty the protectedProperty value to set. - * @return the DpmProtectedItemExtendedInfo object itself. - */ - public DpmProtectedItemExtendedInfo withProtectedProperty(Boolean protectedProperty) { - this.protectedProperty = protectedProperty; - return this; - } - - /** - * Get the isPresentOnCloud property: To check if backup item is cloud protected. - * - * @return the isPresentOnCloud value. - */ - public Boolean isPresentOnCloud() { - return this.isPresentOnCloud; - } - - /** - * Set the isPresentOnCloud property: To check if backup item is cloud protected. - * - * @param isPresentOnCloud the isPresentOnCloud value to set. - * @return the DpmProtectedItemExtendedInfo object itself. - */ - public DpmProtectedItemExtendedInfo withIsPresentOnCloud(Boolean isPresentOnCloud) { - this.isPresentOnCloud = isPresentOnCloud; - return this; - } - - /** - * Get the lastBackupStatus property: Last backup status information on backup item. - * - * @return the lastBackupStatus value. - */ - public String lastBackupStatus() { - return this.lastBackupStatus; - } - - /** - * Set the lastBackupStatus property: Last backup status information on backup item. - * - * @param lastBackupStatus the lastBackupStatus value to set. - * @return the DpmProtectedItemExtendedInfo object itself. - */ - public DpmProtectedItemExtendedInfo withLastBackupStatus(String lastBackupStatus) { - this.lastBackupStatus = lastBackupStatus; - return this; - } - - /** - * Get the lastRefreshedAt property: Last refresh time on backup item. - * - * @return the lastRefreshedAt value. - */ - public OffsetDateTime lastRefreshedAt() { - return this.lastRefreshedAt; - } - - /** - * Set the lastRefreshedAt property: Last refresh time on backup item. - * - * @param lastRefreshedAt the lastRefreshedAt value to set. - * @return the DpmProtectedItemExtendedInfo object itself. - */ - public DpmProtectedItemExtendedInfo withLastRefreshedAt(OffsetDateTime lastRefreshedAt) { - this.lastRefreshedAt = lastRefreshedAt; - return this; - } - - /** - * Get the oldestRecoveryPoint property: Oldest cloud recovery point time. - * - * @return the oldestRecoveryPoint value. - */ - public OffsetDateTime oldestRecoveryPoint() { - return this.oldestRecoveryPoint; - } - - /** - * Set the oldestRecoveryPoint property: Oldest cloud recovery point time. - * - * @param oldestRecoveryPoint the oldestRecoveryPoint value to set. - * @return the DpmProtectedItemExtendedInfo object itself. - */ - public DpmProtectedItemExtendedInfo withOldestRecoveryPoint(OffsetDateTime oldestRecoveryPoint) { - this.oldestRecoveryPoint = oldestRecoveryPoint; - return this; - } - - /** - * Get the recoveryPointCount property: cloud recovery point count. - * - * @return the recoveryPointCount value. - */ - public Integer recoveryPointCount() { - return this.recoveryPointCount; - } - - /** - * Set the recoveryPointCount property: cloud recovery point count. - * - * @param recoveryPointCount the recoveryPointCount value to set. - * @return the DpmProtectedItemExtendedInfo object itself. - */ - public DpmProtectedItemExtendedInfo withRecoveryPointCount(Integer recoveryPointCount) { - this.recoveryPointCount = recoveryPointCount; - return this; - } - - /** - * Get the onPremiseOldestRecoveryPoint property: Oldest disk recovery point time. - * - * @return the onPremiseOldestRecoveryPoint value. - */ - public OffsetDateTime onPremiseOldestRecoveryPoint() { - return this.onPremiseOldestRecoveryPoint; - } - - /** - * Set the onPremiseOldestRecoveryPoint property: Oldest disk recovery point time. - * - * @param onPremiseOldestRecoveryPoint the onPremiseOldestRecoveryPoint value to set. - * @return the DpmProtectedItemExtendedInfo object itself. - */ - public DpmProtectedItemExtendedInfo withOnPremiseOldestRecoveryPoint(OffsetDateTime onPremiseOldestRecoveryPoint) { - this.onPremiseOldestRecoveryPoint = onPremiseOldestRecoveryPoint; - return this; - } - - /** - * Get the onPremiseLatestRecoveryPoint property: latest disk recovery point time. - * - * @return the onPremiseLatestRecoveryPoint value. - */ - public OffsetDateTime onPremiseLatestRecoveryPoint() { - return this.onPremiseLatestRecoveryPoint; - } - - /** - * Set the onPremiseLatestRecoveryPoint property: latest disk recovery point time. - * - * @param onPremiseLatestRecoveryPoint the onPremiseLatestRecoveryPoint value to set. - * @return the DpmProtectedItemExtendedInfo object itself. - */ - public DpmProtectedItemExtendedInfo withOnPremiseLatestRecoveryPoint(OffsetDateTime onPremiseLatestRecoveryPoint) { - this.onPremiseLatestRecoveryPoint = onPremiseLatestRecoveryPoint; - return this; - } - - /** - * Get the onPremiseRecoveryPointCount property: disk recovery point count. - * - * @return the onPremiseRecoveryPointCount value. - */ - public Integer onPremiseRecoveryPointCount() { - return this.onPremiseRecoveryPointCount; - } - - /** - * Set the onPremiseRecoveryPointCount property: disk recovery point count. - * - * @param onPremiseRecoveryPointCount the onPremiseRecoveryPointCount value to set. - * @return the DpmProtectedItemExtendedInfo object itself. - */ - public DpmProtectedItemExtendedInfo withOnPremiseRecoveryPointCount(Integer onPremiseRecoveryPointCount) { - this.onPremiseRecoveryPointCount = onPremiseRecoveryPointCount; - return this; - } - - /** - * Get the isCollocated property: To check if backup item is collocated. - * - * @return the isCollocated value. - */ - public Boolean isCollocated() { - return this.isCollocated; - } - - /** - * Set the isCollocated property: To check if backup item is collocated. - * - * @param isCollocated the isCollocated value to set. - * @return the DpmProtectedItemExtendedInfo object itself. - */ - public DpmProtectedItemExtendedInfo withIsCollocated(Boolean isCollocated) { - this.isCollocated = isCollocated; - return this; - } - - /** - * Get the protectionGroupName property: Protection group name of the backup item. - * - * @return the protectionGroupName value. - */ - public String protectionGroupName() { - return this.protectionGroupName; - } - - /** - * Set the protectionGroupName property: Protection group name of the backup item. - * - * @param protectionGroupName the protectionGroupName value to set. - * @return the DpmProtectedItemExtendedInfo object itself. - */ - public DpmProtectedItemExtendedInfo withProtectionGroupName(String protectionGroupName) { - this.protectionGroupName = protectionGroupName; - return this; - } - - /** - * Get the diskStorageUsedInBytes property: Used Disk storage in bytes. - * - * @return the diskStorageUsedInBytes value. - */ - public String diskStorageUsedInBytes() { - return this.diskStorageUsedInBytes; - } - - /** - * Set the diskStorageUsedInBytes property: Used Disk storage in bytes. - * - * @param diskStorageUsedInBytes the diskStorageUsedInBytes value to set. - * @return the DpmProtectedItemExtendedInfo object itself. - */ - public DpmProtectedItemExtendedInfo withDiskStorageUsedInBytes(String diskStorageUsedInBytes) { - this.diskStorageUsedInBytes = diskStorageUsedInBytes; - return this; - } - - /** - * Get the totalDiskStorageSizeInBytes property: total Disk storage in bytes. - * - * @return the totalDiskStorageSizeInBytes value. - */ - public String totalDiskStorageSizeInBytes() { - return this.totalDiskStorageSizeInBytes; - } - - /** - * Set the totalDiskStorageSizeInBytes property: total Disk storage in bytes. - * - * @param totalDiskStorageSizeInBytes the totalDiskStorageSizeInBytes value to set. - * @return the DpmProtectedItemExtendedInfo object itself. - */ - public DpmProtectedItemExtendedInfo withTotalDiskStorageSizeInBytes(String totalDiskStorageSizeInBytes) { - this.totalDiskStorageSizeInBytes = totalDiskStorageSizeInBytes; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeMapField("protectableObjectLoadPath", this.protectableObjectLoadPath, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("protected", this.protectedProperty); - jsonWriter.writeBooleanField("isPresentOnCloud", this.isPresentOnCloud); - jsonWriter.writeStringField("lastBackupStatus", this.lastBackupStatus); - jsonWriter.writeStringField("lastRefreshedAt", - this.lastRefreshedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastRefreshedAt)); - jsonWriter.writeStringField("oldestRecoveryPoint", - this.oldestRecoveryPoint == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.oldestRecoveryPoint)); - jsonWriter.writeNumberField("recoveryPointCount", this.recoveryPointCount); - jsonWriter.writeStringField("onPremiseOldestRecoveryPoint", - this.onPremiseOldestRecoveryPoint == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.onPremiseOldestRecoveryPoint)); - jsonWriter.writeStringField("onPremiseLatestRecoveryPoint", - this.onPremiseLatestRecoveryPoint == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.onPremiseLatestRecoveryPoint)); - jsonWriter.writeNumberField("onPremiseRecoveryPointCount", this.onPremiseRecoveryPointCount); - jsonWriter.writeBooleanField("isCollocated", this.isCollocated); - jsonWriter.writeStringField("protectionGroupName", this.protectionGroupName); - jsonWriter.writeStringField("diskStorageUsedInBytes", this.diskStorageUsedInBytes); - jsonWriter.writeStringField("totalDiskStorageSizeInBytes", this.totalDiskStorageSizeInBytes); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DpmProtectedItemExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DpmProtectedItemExtendedInfo 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 DpmProtectedItemExtendedInfo. - */ - public static DpmProtectedItemExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DpmProtectedItemExtendedInfo deserializedDpmProtectedItemExtendedInfo = new DpmProtectedItemExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("protectableObjectLoadPath".equals(fieldName)) { - Map protectableObjectLoadPath = reader.readMap(reader1 -> reader1.getString()); - deserializedDpmProtectedItemExtendedInfo.protectableObjectLoadPath = protectableObjectLoadPath; - } else if ("protected".equals(fieldName)) { - deserializedDpmProtectedItemExtendedInfo.protectedProperty - = reader.getNullable(JsonReader::getBoolean); - } else if ("isPresentOnCloud".equals(fieldName)) { - deserializedDpmProtectedItemExtendedInfo.isPresentOnCloud - = reader.getNullable(JsonReader::getBoolean); - } else if ("lastBackupStatus".equals(fieldName)) { - deserializedDpmProtectedItemExtendedInfo.lastBackupStatus = reader.getString(); - } else if ("lastRefreshedAt".equals(fieldName)) { - deserializedDpmProtectedItemExtendedInfo.lastRefreshedAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("oldestRecoveryPoint".equals(fieldName)) { - deserializedDpmProtectedItemExtendedInfo.oldestRecoveryPoint = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("recoveryPointCount".equals(fieldName)) { - deserializedDpmProtectedItemExtendedInfo.recoveryPointCount - = reader.getNullable(JsonReader::getInt); - } else if ("onPremiseOldestRecoveryPoint".equals(fieldName)) { - deserializedDpmProtectedItemExtendedInfo.onPremiseOldestRecoveryPoint = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("onPremiseLatestRecoveryPoint".equals(fieldName)) { - deserializedDpmProtectedItemExtendedInfo.onPremiseLatestRecoveryPoint = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("onPremiseRecoveryPointCount".equals(fieldName)) { - deserializedDpmProtectedItemExtendedInfo.onPremiseRecoveryPointCount - = reader.getNullable(JsonReader::getInt); - } else if ("isCollocated".equals(fieldName)) { - deserializedDpmProtectedItemExtendedInfo.isCollocated = reader.getNullable(JsonReader::getBoolean); - } else if ("protectionGroupName".equals(fieldName)) { - deserializedDpmProtectedItemExtendedInfo.protectionGroupName = reader.getString(); - } else if ("diskStorageUsedInBytes".equals(fieldName)) { - deserializedDpmProtectedItemExtendedInfo.diskStorageUsedInBytes = reader.getString(); - } else if ("totalDiskStorageSizeInBytes".equals(fieldName)) { - deserializedDpmProtectedItemExtendedInfo.totalDiskStorageSizeInBytes = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDpmProtectedItemExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/EncryptionAtRestType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/EncryptionAtRestType.java deleted file mode 100644 index 0ee9cee51e5e..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/EncryptionAtRestType.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Encryption At Rest Type. - */ -public final class EncryptionAtRestType extends ExpandableStringEnum { - /** - * Static value Invalid for EncryptionAtRestType. - */ - public static final EncryptionAtRestType INVALID = fromString("Invalid"); - - /** - * Static value MicrosoftManaged for EncryptionAtRestType. - */ - public static final EncryptionAtRestType MICROSOFT_MANAGED = fromString("MicrosoftManaged"); - - /** - * Static value CustomerManaged for EncryptionAtRestType. - */ - public static final EncryptionAtRestType CUSTOMER_MANAGED = fromString("CustomerManaged"); - - /** - * Creates a new instance of EncryptionAtRestType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public EncryptionAtRestType() { - } - - /** - * Creates or finds a EncryptionAtRestType from its string representation. - * - * @param name a name to look for. - * @return the corresponding EncryptionAtRestType. - */ - public static EncryptionAtRestType fromString(String name) { - return fromString(name, EncryptionAtRestType.class); - } - - /** - * Gets known EncryptionAtRestType values. - * - * @return known EncryptionAtRestType values. - */ - public static Collection values() { - return values(EncryptionAtRestType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/EncryptionDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/EncryptionDetails.java deleted file mode 100644 index c271f538a45d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/EncryptionDetails.java +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Details needed if the VM was encrypted at the time of backup. - */ -@Fluent -public final class EncryptionDetails implements JsonSerializable { - /* - * Identifies whether this backup copy represents an encrypted VM at the time of backup. - */ - private Boolean encryptionEnabled; - - /* - * Key Url. - */ - private String kekUrl; - - /* - * Secret Url. - */ - private String secretKeyUrl; - - /* - * ID of Key Vault where KEK is stored. - */ - private String kekVaultId; - - /* - * ID of Key Vault where Secret is stored. - */ - private String secretKeyVaultId; - - /** - * Creates an instance of EncryptionDetails class. - */ - public EncryptionDetails() { - } - - /** - * Get the encryptionEnabled property: Identifies whether this backup copy represents an encrypted VM at the time of - * backup. - * - * @return the encryptionEnabled value. - */ - public Boolean encryptionEnabled() { - return this.encryptionEnabled; - } - - /** - * Set the encryptionEnabled property: Identifies whether this backup copy represents an encrypted VM at the time of - * backup. - * - * @param encryptionEnabled the encryptionEnabled value to set. - * @return the EncryptionDetails object itself. - */ - public EncryptionDetails withEncryptionEnabled(Boolean encryptionEnabled) { - this.encryptionEnabled = encryptionEnabled; - return this; - } - - /** - * Get the kekUrl property: Key Url. - * - * @return the kekUrl value. - */ - public String kekUrl() { - return this.kekUrl; - } - - /** - * Set the kekUrl property: Key Url. - * - * @param kekUrl the kekUrl value to set. - * @return the EncryptionDetails object itself. - */ - public EncryptionDetails withKekUrl(String kekUrl) { - this.kekUrl = kekUrl; - return this; - } - - /** - * Get the secretKeyUrl property: Secret Url. - * - * @return the secretKeyUrl value. - */ - public String secretKeyUrl() { - return this.secretKeyUrl; - } - - /** - * Set the secretKeyUrl property: Secret Url. - * - * @param secretKeyUrl the secretKeyUrl value to set. - * @return the EncryptionDetails object itself. - */ - public EncryptionDetails withSecretKeyUrl(String secretKeyUrl) { - this.secretKeyUrl = secretKeyUrl; - return this; - } - - /** - * Get the kekVaultId property: ID of Key Vault where KEK is stored. - * - * @return the kekVaultId value. - */ - public String kekVaultId() { - return this.kekVaultId; - } - - /** - * Set the kekVaultId property: ID of Key Vault where KEK is stored. - * - * @param kekVaultId the kekVaultId value to set. - * @return the EncryptionDetails object itself. - */ - public EncryptionDetails withKekVaultId(String kekVaultId) { - this.kekVaultId = kekVaultId; - return this; - } - - /** - * Get the secretKeyVaultId property: ID of Key Vault where Secret is stored. - * - * @return the secretKeyVaultId value. - */ - public String secretKeyVaultId() { - return this.secretKeyVaultId; - } - - /** - * Set the secretKeyVaultId property: ID of Key Vault where Secret is stored. - * - * @param secretKeyVaultId the secretKeyVaultId value to set. - * @return the EncryptionDetails object itself. - */ - public EncryptionDetails withSecretKeyVaultId(String secretKeyVaultId) { - this.secretKeyVaultId = secretKeyVaultId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("encryptionEnabled", this.encryptionEnabled); - jsonWriter.writeStringField("kekUrl", this.kekUrl); - jsonWriter.writeStringField("secretKeyUrl", this.secretKeyUrl); - jsonWriter.writeStringField("kekVaultId", this.kekVaultId); - jsonWriter.writeStringField("secretKeyVaultId", this.secretKeyVaultId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EncryptionDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EncryptionDetails 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 EncryptionDetails. - */ - public static EncryptionDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EncryptionDetails deserializedEncryptionDetails = new EncryptionDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("encryptionEnabled".equals(fieldName)) { - deserializedEncryptionDetails.encryptionEnabled = reader.getNullable(JsonReader::getBoolean); - } else if ("kekUrl".equals(fieldName)) { - deserializedEncryptionDetails.kekUrl = reader.getString(); - } else if ("secretKeyUrl".equals(fieldName)) { - deserializedEncryptionDetails.secretKeyUrl = reader.getString(); - } else if ("kekVaultId".equals(fieldName)) { - deserializedEncryptionDetails.kekVaultId = reader.getString(); - } else if ("secretKeyVaultId".equals(fieldName)) { - deserializedEncryptionDetails.secretKeyVaultId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedEncryptionDetails; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/EnhancedSecurityState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/EnhancedSecurityState.java deleted file mode 100644 index 53ad7f73efcb..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/EnhancedSecurityState.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Enabled or Disabled. - */ -public final class EnhancedSecurityState extends ExpandableStringEnum { - /** - * Static value Invalid for EnhancedSecurityState. - */ - public static final EnhancedSecurityState INVALID = fromString("Invalid"); - - /** - * Static value Enabled for EnhancedSecurityState. - */ - public static final EnhancedSecurityState ENABLED = fromString("Enabled"); - - /** - * Static value Disabled for EnhancedSecurityState. - */ - public static final EnhancedSecurityState DISABLED = fromString("Disabled"); - - /** - * Creates a new instance of EnhancedSecurityState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public EnhancedSecurityState() { - } - - /** - * Creates or finds a EnhancedSecurityState from its string representation. - * - * @param name a name to look for. - * @return the corresponding EnhancedSecurityState. - */ - public static EnhancedSecurityState fromString(String name) { - return fromString(name, EnhancedSecurityState.class); - } - - /** - * Gets known EnhancedSecurityState values. - * - * @return known EnhancedSecurityState values. - */ - public static Collection values() { - return values(EnhancedSecurityState.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ErrorDetail.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ErrorDetail.java deleted file mode 100644 index 9d0e07e7ed6b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ErrorDetail.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Error Detail class which encapsulates Code, Message and Recommendations. - */ -@Immutable -public final class ErrorDetail implements JsonSerializable { - /* - * Error code. - */ - private String code; - - /* - * Error Message related to the Code. - */ - private String message; - - /* - * List of recommendation strings. - */ - private List recommendations; - - /** - * Creates an instance of ErrorDetail class. - */ - public ErrorDetail() { - } - - /** - * Get the code property: Error code. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Get the message property: Error Message related to the Code. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Get the recommendations property: List of recommendation strings. - * - * @return the recommendations value. - */ - public List recommendations() { - return this.recommendations; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ErrorDetail from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ErrorDetail 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 ErrorDetail. - */ - public static ErrorDetail fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ErrorDetail deserializedErrorDetail = new ErrorDetail(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("code".equals(fieldName)) { - deserializedErrorDetail.code = reader.getString(); - } else if ("message".equals(fieldName)) { - deserializedErrorDetail.message = reader.getString(); - } else if ("recommendations".equals(fieldName)) { - List recommendations = reader.readArray(reader1 -> reader1.getString()); - deserializedErrorDetail.recommendations = recommendations; - } else { - reader.skipChildren(); - } - } - - return deserializedErrorDetail; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExportJobsOperationResultInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExportJobsOperationResultInfo.java deleted file mode 100644 index 204dee6f654b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExportJobsOperationResultInfo.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * This class is used to send blob details after exporting jobs. - */ -@Immutable -public final class ExportJobsOperationResultInfo extends OperationResultInfoBase { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "ExportJobsOperationResultInfo"; - - /* - * URL of the blob into which the serialized string of list of jobs is exported. - */ - private String blobUrl; - - /* - * SAS key to access the blob. It expires in 15 mins. - */ - private String blobSasKey; - - /* - * URL of the blob into which the ExcelFile is uploaded. - */ - private String excelFileBlobUrl; - - /* - * SAS key to access the blob. It expires in 15 mins. - */ - private String excelFileBlobSasKey; - - /** - * Creates an instance of ExportJobsOperationResultInfo class. - */ - private ExportJobsOperationResultInfo() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the blobUrl property: URL of the blob into which the serialized string of list of jobs is exported. - * - * @return the blobUrl value. - */ - public String blobUrl() { - return this.blobUrl; - } - - /** - * Get the blobSasKey property: SAS key to access the blob. It expires in 15 mins. - * - * @return the blobSasKey value. - */ - public String blobSasKey() { - return this.blobSasKey; - } - - /** - * Get the excelFileBlobUrl property: URL of the blob into which the ExcelFile is uploaded. - * - * @return the excelFileBlobUrl value. - */ - public String excelFileBlobUrl() { - return this.excelFileBlobUrl; - } - - /** - * Get the excelFileBlobSasKey property: SAS key to access the blob. It expires in 15 mins. - * - * @return the excelFileBlobSasKey value. - */ - public String excelFileBlobSasKey() { - return this.excelFileBlobSasKey; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("blobUrl", this.blobUrl); - jsonWriter.writeStringField("blobSasKey", this.blobSasKey); - jsonWriter.writeStringField("excelFileBlobUrl", this.excelFileBlobUrl); - jsonWriter.writeStringField("excelFileBlobSasKey", this.excelFileBlobSasKey); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ExportJobsOperationResultInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ExportJobsOperationResultInfo 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 ExportJobsOperationResultInfo. - */ - public static ExportJobsOperationResultInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ExportJobsOperationResultInfo deserializedExportJobsOperationResultInfo - = new ExportJobsOperationResultInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedExportJobsOperationResultInfo.objectType = reader.getString(); - } else if ("blobUrl".equals(fieldName)) { - deserializedExportJobsOperationResultInfo.blobUrl = reader.getString(); - } else if ("blobSasKey".equals(fieldName)) { - deserializedExportJobsOperationResultInfo.blobSasKey = reader.getString(); - } else if ("excelFileBlobUrl".equals(fieldName)) { - deserializedExportJobsOperationResultInfo.excelFileBlobUrl = reader.getString(); - } else if ("excelFileBlobSasKey".equals(fieldName)) { - deserializedExportJobsOperationResultInfo.excelFileBlobSasKey = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedExportJobsOperationResultInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExportJobsOperationResults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExportJobsOperationResults.java deleted file mode 100644 index f03a714c8973..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExportJobsOperationResults.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ExportJobsOperationResults. - */ -public interface ExportJobsOperationResults { - /** - * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also - * contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized - * format. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the JobResource. - * @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 operation result of operation triggered by Export Jobs API along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, - String operationId, Context context); - - /** - * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also - * contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized - * format. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the JobResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation result of operation triggered by Export Jobs API. - */ - OperationResultInfoBaseResource get(String vaultName, String resourceGroupName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExtendedLocation.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExtendedLocation.java deleted file mode 100644 index 20fa26553a10..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExtendedLocation.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The extended location of Recovery point where VM was present. - */ -@Fluent -public final class ExtendedLocation implements JsonSerializable { - /* - * Name of the extended location. - */ - private String name; - - /* - * Type of the extended location. Possible values include: 'EdgeZone' - */ - private String type; - - /** - * Creates an instance of ExtendedLocation class. - */ - public ExtendedLocation() { - } - - /** - * Get the name property: Name of the extended location. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the extended location. - * - * @param name the name value to set. - * @return the ExtendedLocation object itself. - */ - public ExtendedLocation withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: Type of the extended location. Possible values include: 'EdgeZone'. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type of the extended location. Possible values include: 'EdgeZone'. - * - * @param type the type value to set. - * @return the ExtendedLocation object itself. - */ - public ExtendedLocation withType(String type) { - this.type = type; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("type", this.type); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ExtendedLocation from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ExtendedLocation 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 ExtendedLocation. - */ - public static ExtendedLocation fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ExtendedLocation deserializedExtendedLocation = new ExtendedLocation(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedExtendedLocation.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedExtendedLocation.type = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedExtendedLocation; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExtendedProperties.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExtendedProperties.java deleted file mode 100644 index 5b3f62801f07..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ExtendedProperties.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Extended Properties for Azure IaasVM Backup. - */ -@Fluent -public final class ExtendedProperties implements JsonSerializable { - /* - * Extended Properties for Disk Exclusion. - */ - private DiskExclusionProperties diskExclusionProperties; - - /* - * Linux VM name - */ - private String linuxVmApplicationName; - - /** - * Creates an instance of ExtendedProperties class. - */ - public ExtendedProperties() { - } - - /** - * Get the diskExclusionProperties property: Extended Properties for Disk Exclusion. - * - * @return the diskExclusionProperties value. - */ - public DiskExclusionProperties diskExclusionProperties() { - return this.diskExclusionProperties; - } - - /** - * Set the diskExclusionProperties property: Extended Properties for Disk Exclusion. - * - * @param diskExclusionProperties the diskExclusionProperties value to set. - * @return the ExtendedProperties object itself. - */ - public ExtendedProperties withDiskExclusionProperties(DiskExclusionProperties diskExclusionProperties) { - this.diskExclusionProperties = diskExclusionProperties; - return this; - } - - /** - * Get the linuxVmApplicationName property: Linux VM name. - * - * @return the linuxVmApplicationName value. - */ - public String linuxVmApplicationName() { - return this.linuxVmApplicationName; - } - - /** - * Set the linuxVmApplicationName property: Linux VM name. - * - * @param linuxVmApplicationName the linuxVmApplicationName value to set. - * @return the ExtendedProperties object itself. - */ - public ExtendedProperties withLinuxVmApplicationName(String linuxVmApplicationName) { - this.linuxVmApplicationName = linuxVmApplicationName; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("diskExclusionProperties", this.diskExclusionProperties); - jsonWriter.writeStringField("linuxVmApplicationName", this.linuxVmApplicationName); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ExtendedProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ExtendedProperties 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 ExtendedProperties. - */ - public static ExtendedProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ExtendedProperties deserializedExtendedProperties = new ExtendedProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("diskExclusionProperties".equals(fieldName)) { - deserializedExtendedProperties.diskExclusionProperties = DiskExclusionProperties.fromJson(reader); - } else if ("linuxVmApplicationName".equals(fieldName)) { - deserializedExtendedProperties.linuxVmApplicationName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedExtendedProperties; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FabricName.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FabricName.java deleted file mode 100644 index 27312fb41daf..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FabricName.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Specifies the fabric name - Azure or AD. - */ -public final class FabricName extends ExpandableStringEnum { - /** - * Static value Invalid for FabricName. - */ - public static final FabricName INVALID = fromString("Invalid"); - - /** - * Static value Azure for FabricName. - */ - public static final FabricName AZURE = fromString("Azure"); - - /** - * Creates a new instance of FabricName value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public FabricName() { - } - - /** - * Creates or finds a FabricName from its string representation. - * - * @param name a name to look for. - * @return the corresponding FabricName. - */ - public static FabricName fromString(String name) { - return fromString(name, FabricName.class); - } - - /** - * Gets known FabricName values. - * - * @return known FabricName values. - */ - public static Collection values() { - return values(FabricName.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FeatureSupportRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FeatureSupportRequest.java deleted file mode 100644 index 8988e8cae4da..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FeatureSupportRequest.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Base class for feature request. - */ -@Immutable -public class FeatureSupportRequest implements JsonSerializable { - /* - * backup support feature type. - */ - private String featureType = "FeatureSupportRequest"; - - /** - * Creates an instance of FeatureSupportRequest class. - */ - public FeatureSupportRequest() { - } - - /** - * Get the featureType property: backup support feature type. - * - * @return the featureType value. - */ - public String featureType() { - return this.featureType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("featureType", this.featureType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FeatureSupportRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FeatureSupportRequest 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 FeatureSupportRequest. - */ - public static FeatureSupportRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("featureType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureBackupGoals".equals(discriminatorValue)) { - return AzureBackupGoalFeatureSupportRequest.fromJson(readerToUse.reset()); - } else if ("AzureVMResourceBackup".equals(discriminatorValue)) { - return AzureVMResourceFeatureSupportRequest.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static FeatureSupportRequest fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FeatureSupportRequest deserializedFeatureSupportRequest = new FeatureSupportRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("featureType".equals(fieldName)) { - deserializedFeatureSupportRequest.featureType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedFeatureSupportRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FeatureSupports.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FeatureSupports.java deleted file mode 100644 index 8b88cf42bbf3..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FeatureSupports.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of FeatureSupports. - */ -public interface FeatureSupports { - /** - * It will validate if given feature with resource properties is supported in service. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Feature support request object. - * @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 response for feature support requests for Azure IaasVm along with {@link Response}. - */ - Response validateWithResponse(String azureRegion, - FeatureSupportRequest parameters, Context context); - - /** - * It will validate if given feature with resource properties is supported in service. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Feature support request object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 for feature support requests for Azure IaasVm. - */ - AzureVMResourceFeatureSupportResponse validate(String azureRegion, FeatureSupportRequest parameters); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCostInfoForRehydrationRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCostInfoForRehydrationRequest.java deleted file mode 100644 index b326933413bb..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCostInfoForRehydrationRequest.java +++ /dev/null @@ -1,218 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Request parameters for fetching cost info of rehydration. - */ -@Fluent -public final class FetchTieringCostInfoForRehydrationRequest extends FetchTieringCostInfoRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "FetchTieringCostInfoForRehydrationRequest"; - - /* - * Name of the protected item container - */ - private String containerName; - - /* - * Name of the protectedItemName - */ - private String protectedItemName; - - /* - * ID of the backup copy for rehydration cost info needs to be fetched. - */ - private String recoveryPointId; - - /* - * Rehydration Priority - */ - private RehydrationPriority rehydrationPriority; - - /** - * Creates an instance of FetchTieringCostInfoForRehydrationRequest class. - */ - public FetchTieringCostInfoForRehydrationRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the containerName property: Name of the protected item container. - * - * @return the containerName value. - */ - public String containerName() { - return this.containerName; - } - - /** - * Set the containerName property: Name of the protected item container. - * - * @param containerName the containerName value to set. - * @return the FetchTieringCostInfoForRehydrationRequest object itself. - */ - public FetchTieringCostInfoForRehydrationRequest withContainerName(String containerName) { - this.containerName = containerName; - return this; - } - - /** - * Get the protectedItemName property: Name of the protectedItemName. - * - * @return the protectedItemName value. - */ - public String protectedItemName() { - return this.protectedItemName; - } - - /** - * Set the protectedItemName property: Name of the protectedItemName. - * - * @param protectedItemName the protectedItemName value to set. - * @return the FetchTieringCostInfoForRehydrationRequest object itself. - */ - public FetchTieringCostInfoForRehydrationRequest withProtectedItemName(String protectedItemName) { - this.protectedItemName = protectedItemName; - return this; - } - - /** - * Get the recoveryPointId property: ID of the backup copy for rehydration cost info needs to be fetched. - * - * @return the recoveryPointId value. - */ - public String recoveryPointId() { - return this.recoveryPointId; - } - - /** - * Set the recoveryPointId property: ID of the backup copy for rehydration cost info needs to be fetched. - * - * @param recoveryPointId the recoveryPointId value to set. - * @return the FetchTieringCostInfoForRehydrationRequest object itself. - */ - public FetchTieringCostInfoForRehydrationRequest withRecoveryPointId(String recoveryPointId) { - this.recoveryPointId = recoveryPointId; - return this; - } - - /** - * Get the rehydrationPriority property: Rehydration Priority. - * - * @return the rehydrationPriority value. - */ - public RehydrationPriority rehydrationPriority() { - return this.rehydrationPriority; - } - - /** - * Set the rehydrationPriority property: Rehydration Priority. - * - * @param rehydrationPriority the rehydrationPriority value to set. - * @return the FetchTieringCostInfoForRehydrationRequest object itself. - */ - public FetchTieringCostInfoForRehydrationRequest withRehydrationPriority(RehydrationPriority rehydrationPriority) { - this.rehydrationPriority = rehydrationPriority; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public FetchTieringCostInfoForRehydrationRequest withSourceTierType(RecoveryPointTierType sourceTierType) { - super.withSourceTierType(sourceTierType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public FetchTieringCostInfoForRehydrationRequest withTargetTierType(RecoveryPointTierType targetTierType) { - super.withTargetTierType(targetTierType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("sourceTierType", sourceTierType() == null ? null : sourceTierType().toString()); - jsonWriter.writeStringField("targetTierType", targetTierType() == null ? null : targetTierType().toString()); - jsonWriter.writeStringField("containerName", this.containerName); - jsonWriter.writeStringField("protectedItemName", this.protectedItemName); - jsonWriter.writeStringField("recoveryPointId", this.recoveryPointId); - jsonWriter.writeStringField("rehydrationPriority", - this.rehydrationPriority == null ? null : this.rehydrationPriority.toString()); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FetchTieringCostInfoForRehydrationRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FetchTieringCostInfoForRehydrationRequest 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 FetchTieringCostInfoForRehydrationRequest. - */ - public static FetchTieringCostInfoForRehydrationRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FetchTieringCostInfoForRehydrationRequest deserializedFetchTieringCostInfoForRehydrationRequest - = new FetchTieringCostInfoForRehydrationRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sourceTierType".equals(fieldName)) { - deserializedFetchTieringCostInfoForRehydrationRequest - .withSourceTierType(RecoveryPointTierType.fromString(reader.getString())); - } else if ("targetTierType".equals(fieldName)) { - deserializedFetchTieringCostInfoForRehydrationRequest - .withTargetTierType(RecoveryPointTierType.fromString(reader.getString())); - } else if ("containerName".equals(fieldName)) { - deserializedFetchTieringCostInfoForRehydrationRequest.containerName = reader.getString(); - } else if ("protectedItemName".equals(fieldName)) { - deserializedFetchTieringCostInfoForRehydrationRequest.protectedItemName = reader.getString(); - } else if ("recoveryPointId".equals(fieldName)) { - deserializedFetchTieringCostInfoForRehydrationRequest.recoveryPointId = reader.getString(); - } else if ("rehydrationPriority".equals(fieldName)) { - deserializedFetchTieringCostInfoForRehydrationRequest.rehydrationPriority - = RehydrationPriority.fromString(reader.getString()); - } else if ("objectType".equals(fieldName)) { - deserializedFetchTieringCostInfoForRehydrationRequest.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedFetchTieringCostInfoForRehydrationRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCostInfoRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCostInfoRequest.java deleted file mode 100644 index 3c5437595b20..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCostInfoRequest.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Base class for tiering cost request. - * Specific cost request types are derived from this class. - */ -@Fluent -public class FetchTieringCostInfoRequest implements JsonSerializable { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "FetchTieringCostInfoRequest"; - - /* - * Source tier for the request - */ - private RecoveryPointTierType sourceTierType; - - /* - * target tier for the request - */ - private RecoveryPointTierType targetTierType; - - /** - * Creates an instance of FetchTieringCostInfoRequest class. - */ - public FetchTieringCostInfoRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - public String objectType() { - return this.objectType; - } - - /** - * Get the sourceTierType property: Source tier for the request. - * - * @return the sourceTierType value. - */ - public RecoveryPointTierType sourceTierType() { - return this.sourceTierType; - } - - /** - * Set the sourceTierType property: Source tier for the request. - * - * @param sourceTierType the sourceTierType value to set. - * @return the FetchTieringCostInfoRequest object itself. - */ - public FetchTieringCostInfoRequest withSourceTierType(RecoveryPointTierType sourceTierType) { - this.sourceTierType = sourceTierType; - return this; - } - - /** - * Get the targetTierType property: target tier for the request. - * - * @return the targetTierType value. - */ - public RecoveryPointTierType targetTierType() { - return this.targetTierType; - } - - /** - * Set the targetTierType property: target tier for the request. - * - * @param targetTierType the targetTierType value to set. - * @return the FetchTieringCostInfoRequest object itself. - */ - public FetchTieringCostInfoRequest withTargetTierType(RecoveryPointTierType targetTierType) { - this.targetTierType = targetTierType; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("sourceTierType", - this.sourceTierType == null ? null : this.sourceTierType.toString()); - jsonWriter.writeStringField("targetTierType", - this.targetTierType == null ? null : this.targetTierType.toString()); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FetchTieringCostInfoRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FetchTieringCostInfoRequest 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 FetchTieringCostInfoRequest. - */ - public static FetchTieringCostInfoRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("FetchTieringCostInfoForRehydrationRequest".equals(discriminatorValue)) { - return FetchTieringCostInfoForRehydrationRequest.fromJson(readerToUse.reset()); - } else if ("FetchTieringCostSavingsInfoForPolicyRequest".equals(discriminatorValue)) { - return FetchTieringCostSavingsInfoForPolicyRequest.fromJson(readerToUse.reset()); - } else if ("FetchTieringCostSavingsInfoForProtectedItemRequest".equals(discriminatorValue)) { - return FetchTieringCostSavingsInfoForProtectedItemRequest.fromJson(readerToUse.reset()); - } else if ("FetchTieringCostSavingsInfoForVaultRequest".equals(discriminatorValue)) { - return FetchTieringCostSavingsInfoForVaultRequest.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static FetchTieringCostInfoRequest fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FetchTieringCostInfoRequest deserializedFetchTieringCostInfoRequest = new FetchTieringCostInfoRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sourceTierType".equals(fieldName)) { - deserializedFetchTieringCostInfoRequest.sourceTierType - = RecoveryPointTierType.fromString(reader.getString()); - } else if ("targetTierType".equals(fieldName)) { - deserializedFetchTieringCostInfoRequest.targetTierType - = RecoveryPointTierType.fromString(reader.getString()); - } else if ("objectType".equals(fieldName)) { - deserializedFetchTieringCostInfoRequest.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedFetchTieringCostInfoRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCostSavingsInfoForPolicyRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCostSavingsInfoForPolicyRequest.java deleted file mode 100644 index ef5da5e33dbb..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCostSavingsInfoForPolicyRequest.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Request parameters for tiering cost info for policy. - */ -@Fluent -public final class FetchTieringCostSavingsInfoForPolicyRequest extends FetchTieringCostInfoRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "FetchTieringCostSavingsInfoForPolicyRequest"; - - /* - * Name of the backup policy for which the cost savings information is requested - */ - private String policyName; - - /** - * Creates an instance of FetchTieringCostSavingsInfoForPolicyRequest class. - */ - public FetchTieringCostSavingsInfoForPolicyRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the policyName property: Name of the backup policy for which the cost savings information is requested. - * - * @return the policyName value. - */ - public String policyName() { - return this.policyName; - } - - /** - * Set the policyName property: Name of the backup policy for which the cost savings information is requested. - * - * @param policyName the policyName value to set. - * @return the FetchTieringCostSavingsInfoForPolicyRequest object itself. - */ - public FetchTieringCostSavingsInfoForPolicyRequest withPolicyName(String policyName) { - this.policyName = policyName; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public FetchTieringCostSavingsInfoForPolicyRequest withSourceTierType(RecoveryPointTierType sourceTierType) { - super.withSourceTierType(sourceTierType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public FetchTieringCostSavingsInfoForPolicyRequest withTargetTierType(RecoveryPointTierType targetTierType) { - super.withTargetTierType(targetTierType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("sourceTierType", sourceTierType() == null ? null : sourceTierType().toString()); - jsonWriter.writeStringField("targetTierType", targetTierType() == null ? null : targetTierType().toString()); - jsonWriter.writeStringField("policyName", this.policyName); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FetchTieringCostSavingsInfoForPolicyRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FetchTieringCostSavingsInfoForPolicyRequest 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 FetchTieringCostSavingsInfoForPolicyRequest. - */ - public static FetchTieringCostSavingsInfoForPolicyRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FetchTieringCostSavingsInfoForPolicyRequest deserializedFetchTieringCostSavingsInfoForPolicyRequest - = new FetchTieringCostSavingsInfoForPolicyRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sourceTierType".equals(fieldName)) { - deserializedFetchTieringCostSavingsInfoForPolicyRequest - .withSourceTierType(RecoveryPointTierType.fromString(reader.getString())); - } else if ("targetTierType".equals(fieldName)) { - deserializedFetchTieringCostSavingsInfoForPolicyRequest - .withTargetTierType(RecoveryPointTierType.fromString(reader.getString())); - } else if ("policyName".equals(fieldName)) { - deserializedFetchTieringCostSavingsInfoForPolicyRequest.policyName = reader.getString(); - } else if ("objectType".equals(fieldName)) { - deserializedFetchTieringCostSavingsInfoForPolicyRequest.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedFetchTieringCostSavingsInfoForPolicyRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCostSavingsInfoForProtectedItemRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCostSavingsInfoForProtectedItemRequest.java deleted file mode 100644 index dd323f99ac4d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCostSavingsInfoForProtectedItemRequest.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Request parameters for tiering cost info for protected item. - */ -@Fluent -public final class FetchTieringCostSavingsInfoForProtectedItemRequest extends FetchTieringCostInfoRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "FetchTieringCostSavingsInfoForProtectedItemRequest"; - - /* - * Name of the protected item container - */ - private String containerName; - - /* - * Name of the protectedItemName - */ - private String protectedItemName; - - /** - * Creates an instance of FetchTieringCostSavingsInfoForProtectedItemRequest class. - */ - public FetchTieringCostSavingsInfoForProtectedItemRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the containerName property: Name of the protected item container. - * - * @return the containerName value. - */ - public String containerName() { - return this.containerName; - } - - /** - * Set the containerName property: Name of the protected item container. - * - * @param containerName the containerName value to set. - * @return the FetchTieringCostSavingsInfoForProtectedItemRequest object itself. - */ - public FetchTieringCostSavingsInfoForProtectedItemRequest withContainerName(String containerName) { - this.containerName = containerName; - return this; - } - - /** - * Get the protectedItemName property: Name of the protectedItemName. - * - * @return the protectedItemName value. - */ - public String protectedItemName() { - return this.protectedItemName; - } - - /** - * Set the protectedItemName property: Name of the protectedItemName. - * - * @param protectedItemName the protectedItemName value to set. - * @return the FetchTieringCostSavingsInfoForProtectedItemRequest object itself. - */ - public FetchTieringCostSavingsInfoForProtectedItemRequest withProtectedItemName(String protectedItemName) { - this.protectedItemName = protectedItemName; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public FetchTieringCostSavingsInfoForProtectedItemRequest withSourceTierType(RecoveryPointTierType sourceTierType) { - super.withSourceTierType(sourceTierType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public FetchTieringCostSavingsInfoForProtectedItemRequest withTargetTierType(RecoveryPointTierType targetTierType) { - super.withTargetTierType(targetTierType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("sourceTierType", sourceTierType() == null ? null : sourceTierType().toString()); - jsonWriter.writeStringField("targetTierType", targetTierType() == null ? null : targetTierType().toString()); - jsonWriter.writeStringField("containerName", this.containerName); - jsonWriter.writeStringField("protectedItemName", this.protectedItemName); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FetchTieringCostSavingsInfoForProtectedItemRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FetchTieringCostSavingsInfoForProtectedItemRequest 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 FetchTieringCostSavingsInfoForProtectedItemRequest. - */ - public static FetchTieringCostSavingsInfoForProtectedItemRequest fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - FetchTieringCostSavingsInfoForProtectedItemRequest deserializedFetchTieringCostSavingsInfoForProtectedItemRequest - = new FetchTieringCostSavingsInfoForProtectedItemRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sourceTierType".equals(fieldName)) { - deserializedFetchTieringCostSavingsInfoForProtectedItemRequest - .withSourceTierType(RecoveryPointTierType.fromString(reader.getString())); - } else if ("targetTierType".equals(fieldName)) { - deserializedFetchTieringCostSavingsInfoForProtectedItemRequest - .withTargetTierType(RecoveryPointTierType.fromString(reader.getString())); - } else if ("containerName".equals(fieldName)) { - deserializedFetchTieringCostSavingsInfoForProtectedItemRequest.containerName = reader.getString(); - } else if ("protectedItemName".equals(fieldName)) { - deserializedFetchTieringCostSavingsInfoForProtectedItemRequest.protectedItemName - = reader.getString(); - } else if ("objectType".equals(fieldName)) { - deserializedFetchTieringCostSavingsInfoForProtectedItemRequest.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedFetchTieringCostSavingsInfoForProtectedItemRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCostSavingsInfoForVaultRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCostSavingsInfoForVaultRequest.java deleted file mode 100644 index f928078252e0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCostSavingsInfoForVaultRequest.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Request parameters for tiering cost info for vault. - */ -@Fluent -public final class FetchTieringCostSavingsInfoForVaultRequest extends FetchTieringCostInfoRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "FetchTieringCostSavingsInfoForVaultRequest"; - - /** - * Creates an instance of FetchTieringCostSavingsInfoForVaultRequest class. - */ - public FetchTieringCostSavingsInfoForVaultRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * {@inheritDoc} - */ - @Override - public FetchTieringCostSavingsInfoForVaultRequest withSourceTierType(RecoveryPointTierType sourceTierType) { - super.withSourceTierType(sourceTierType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public FetchTieringCostSavingsInfoForVaultRequest withTargetTierType(RecoveryPointTierType targetTierType) { - super.withTargetTierType(targetTierType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("sourceTierType", sourceTierType() == null ? null : sourceTierType().toString()); - jsonWriter.writeStringField("targetTierType", targetTierType() == null ? null : targetTierType().toString()); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FetchTieringCostSavingsInfoForVaultRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FetchTieringCostSavingsInfoForVaultRequest 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 FetchTieringCostSavingsInfoForVaultRequest. - */ - public static FetchTieringCostSavingsInfoForVaultRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FetchTieringCostSavingsInfoForVaultRequest deserializedFetchTieringCostSavingsInfoForVaultRequest - = new FetchTieringCostSavingsInfoForVaultRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sourceTierType".equals(fieldName)) { - deserializedFetchTieringCostSavingsInfoForVaultRequest - .withSourceTierType(RecoveryPointTierType.fromString(reader.getString())); - } else if ("targetTierType".equals(fieldName)) { - deserializedFetchTieringCostSavingsInfoForVaultRequest - .withTargetTierType(RecoveryPointTierType.fromString(reader.getString())); - } else if ("objectType".equals(fieldName)) { - deserializedFetchTieringCostSavingsInfoForVaultRequest.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedFetchTieringCostSavingsInfoForVaultRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCosts.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCosts.java deleted file mode 100644 index 4cc6dd1ff15d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/FetchTieringCosts.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.Context; - -/** - * Resource collection API of FetchTieringCosts. - */ -public interface FetchTieringCosts { - /** - * Provides the details of the tiering related sizes and cost. - * Status of the operation can be fetched using GetTieringCostOperationStatus API and result using - * GetTieringCostOperationResult API. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param parameters Fetch Tiering Cost Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for tiering cost response. - */ - TieringCostInfo post(String resourceGroupName, String vaultName, FetchTieringCostInfoRequest parameters); - - /** - * Provides the details of the tiering related sizes and cost. - * Status of the operation can be fetched using GetTieringCostOperationStatus API and result using - * GetTieringCostOperationResult API. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param parameters Fetch Tiering Cost Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for tiering cost response. - */ - TieringCostInfo post(String resourceGroupName, String vaultName, FetchTieringCostInfoRequest parameters, - Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericContainer.java deleted file mode 100644 index f56d042f2826..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericContainer.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Base class for generic container of backup items. - */ -@Fluent -public final class GenericContainer extends ProtectionContainer { - /* - * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines - * 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer - */ - private ProtectableContainerType containerType = ProtectableContainerType.GENERIC_CONTAINER; - - /* - * Name of the container's fabric - */ - private String fabricName; - - /* - * Extended information (not returned in List container API calls) - */ - private GenericContainerExtendedInfo extendedInformation; - - /** - * Creates an instance of GenericContainer class. - */ - public GenericContainer() { - } - - /** - * Get the containerType property: Type of the container. The value of this property for: 1. Compute Azure VM is - * Microsoft.Compute/virtualMachines 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer. - * - * @return the containerType value. - */ - @Override - public ProtectableContainerType containerType() { - return this.containerType; - } - - /** - * Get the fabricName property: Name of the container's fabric. - * - * @return the fabricName value. - */ - public String fabricName() { - return this.fabricName; - } - - /** - * Set the fabricName property: Name of the container's fabric. - * - * @param fabricName the fabricName value to set. - * @return the GenericContainer object itself. - */ - public GenericContainer withFabricName(String fabricName) { - this.fabricName = fabricName; - return this; - } - - /** - * Get the extendedInformation property: Extended information (not returned in List container API calls). - * - * @return the extendedInformation value. - */ - public GenericContainerExtendedInfo extendedInformation() { - return this.extendedInformation; - } - - /** - * Set the extendedInformation property: Extended information (not returned in List container API calls). - * - * @param extendedInformation the extendedInformation value to set. - * @return the GenericContainer object itself. - */ - public GenericContainer withExtendedInformation(GenericContainerExtendedInfo extendedInformation) { - this.extendedInformation = extendedInformation; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericContainer withFriendlyName(String friendlyName) { - super.withFriendlyName(friendlyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericContainer withBackupManagementType(BackupManagementType backupManagementType) { - super.withBackupManagementType(backupManagementType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericContainer withRegistrationStatus(String registrationStatus) { - super.withRegistrationStatus(registrationStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericContainer withHealthStatus(String healthStatus) { - super.withHealthStatus(healthStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericContainer withProtectableObjectType(String protectableObjectType) { - super.withProtectableObjectType(protectableObjectType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("registrationStatus", registrationStatus()); - jsonWriter.writeStringField("healthStatus", healthStatus()); - jsonWriter.writeStringField("protectableObjectType", protectableObjectType()); - jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString()); - jsonWriter.writeStringField("fabricName", this.fabricName); - jsonWriter.writeJsonField("extendedInformation", this.extendedInformation); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GenericContainer from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GenericContainer 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 GenericContainer. - */ - public static GenericContainer fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GenericContainer deserializedGenericContainer = new GenericContainer(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("friendlyName".equals(fieldName)) { - deserializedGenericContainer.withFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedGenericContainer - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("registrationStatus".equals(fieldName)) { - deserializedGenericContainer.withRegistrationStatus(reader.getString()); - } else if ("healthStatus".equals(fieldName)) { - deserializedGenericContainer.withHealthStatus(reader.getString()); - } else if ("protectableObjectType".equals(fieldName)) { - deserializedGenericContainer.withProtectableObjectType(reader.getString()); - } else if ("containerType".equals(fieldName)) { - deserializedGenericContainer.containerType - = ProtectableContainerType.fromString(reader.getString()); - } else if ("fabricName".equals(fieldName)) { - deserializedGenericContainer.fabricName = reader.getString(); - } else if ("extendedInformation".equals(fieldName)) { - deserializedGenericContainer.extendedInformation = GenericContainerExtendedInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGenericContainer; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericContainerExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericContainerExtendedInfo.java deleted file mode 100644 index eb324fedec4a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericContainerExtendedInfo.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.Map; - -/** - * Container extended information. - */ -@Fluent -public final class GenericContainerExtendedInfo implements JsonSerializable { - /* - * Public key of container cert - */ - private String rawCertData; - - /* - * Container identity information - */ - private ContainerIdentityInfo containerIdentityInfo; - - /* - * Azure Backup Service Endpoints for the container - */ - private Map serviceEndpoints; - - /** - * Creates an instance of GenericContainerExtendedInfo class. - */ - public GenericContainerExtendedInfo() { - } - - /** - * Get the rawCertData property: Public key of container cert. - * - * @return the rawCertData value. - */ - public String rawCertData() { - return this.rawCertData; - } - - /** - * Set the rawCertData property: Public key of container cert. - * - * @param rawCertData the rawCertData value to set. - * @return the GenericContainerExtendedInfo object itself. - */ - public GenericContainerExtendedInfo withRawCertData(String rawCertData) { - this.rawCertData = rawCertData; - return this; - } - - /** - * Get the containerIdentityInfo property: Container identity information. - * - * @return the containerIdentityInfo value. - */ - public ContainerIdentityInfo containerIdentityInfo() { - return this.containerIdentityInfo; - } - - /** - * Set the containerIdentityInfo property: Container identity information. - * - * @param containerIdentityInfo the containerIdentityInfo value to set. - * @return the GenericContainerExtendedInfo object itself. - */ - public GenericContainerExtendedInfo withContainerIdentityInfo(ContainerIdentityInfo containerIdentityInfo) { - this.containerIdentityInfo = containerIdentityInfo; - return this; - } - - /** - * Get the serviceEndpoints property: Azure Backup Service Endpoints for the container. - * - * @return the serviceEndpoints value. - */ - public Map serviceEndpoints() { - return this.serviceEndpoints; - } - - /** - * Set the serviceEndpoints property: Azure Backup Service Endpoints for the container. - * - * @param serviceEndpoints the serviceEndpoints value to set. - * @return the GenericContainerExtendedInfo object itself. - */ - public GenericContainerExtendedInfo withServiceEndpoints(Map serviceEndpoints) { - this.serviceEndpoints = serviceEndpoints; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("rawCertData", this.rawCertData); - jsonWriter.writeJsonField("containerIdentityInfo", this.containerIdentityInfo); - jsonWriter.writeMapField("serviceEndpoints", this.serviceEndpoints, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GenericContainerExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GenericContainerExtendedInfo 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 GenericContainerExtendedInfo. - */ - public static GenericContainerExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GenericContainerExtendedInfo deserializedGenericContainerExtendedInfo = new GenericContainerExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("rawCertData".equals(fieldName)) { - deserializedGenericContainerExtendedInfo.rawCertData = reader.getString(); - } else if ("containerIdentityInfo".equals(fieldName)) { - deserializedGenericContainerExtendedInfo.containerIdentityInfo - = ContainerIdentityInfo.fromJson(reader); - } else if ("serviceEndpoints".equals(fieldName)) { - Map serviceEndpoints = reader.readMap(reader1 -> reader1.getString()); - deserializedGenericContainerExtendedInfo.serviceEndpoints = serviceEndpoints; - } else { - reader.skipChildren(); - } - } - - return deserializedGenericContainerExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectedItem.java deleted file mode 100644 index 352a3c8cceb7..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectedItem.java +++ /dev/null @@ -1,462 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * Base class for backup items. - */ -@Fluent -public final class GenericProtectedItem extends ProtectedItem { - /* - * backup item type. - */ - private String protectedItemType = "GenericProtectedItem"; - - /* - * Friendly name of the container. - */ - private String friendlyName; - - /* - * Indicates consistency of policy object and policy applied to this backup item. - */ - private String policyState; - - /* - * Backup state of this backup item. - */ - private ProtectionState protectionState; - - /* - * Data Plane Service ID of the protected item. - */ - private Long protectedItemId; - - /* - * Loosely coupled (type, value) associations (example - parent of a protected item) - */ - private Map sourceAssociations; - - /* - * Name of this backup item's fabric. - */ - private String fabricName; - - /** - * Creates an instance of GenericProtectedItem class. - */ - public GenericProtectedItem() { - } - - /** - * Get the protectedItemType property: backup item type. - * - * @return the protectedItemType value. - */ - @Override - public String protectedItemType() { - return this.protectedItemType; - } - - /** - * Get the friendlyName property: Friendly name of the container. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.friendlyName; - } - - /** - * Set the friendlyName property: Friendly name of the container. - * - * @param friendlyName the friendlyName value to set. - * @return the GenericProtectedItem object itself. - */ - public GenericProtectedItem withFriendlyName(String friendlyName) { - this.friendlyName = friendlyName; - return this; - } - - /** - * Get the policyState property: Indicates consistency of policy object and policy applied to this backup item. - * - * @return the policyState value. - */ - public String policyState() { - return this.policyState; - } - - /** - * Set the policyState property: Indicates consistency of policy object and policy applied to this backup item. - * - * @param policyState the policyState value to set. - * @return the GenericProtectedItem object itself. - */ - public GenericProtectedItem withPolicyState(String policyState) { - this.policyState = policyState; - return this; - } - - /** - * Get the protectionState property: Backup state of this backup item. - * - * @return the protectionState value. - */ - public ProtectionState protectionState() { - return this.protectionState; - } - - /** - * Set the protectionState property: Backup state of this backup item. - * - * @param protectionState the protectionState value to set. - * @return the GenericProtectedItem object itself. - */ - public GenericProtectedItem withProtectionState(ProtectionState protectionState) { - this.protectionState = protectionState; - return this; - } - - /** - * Get the protectedItemId property: Data Plane Service ID of the protected item. - * - * @return the protectedItemId value. - */ - public Long protectedItemId() { - return this.protectedItemId; - } - - /** - * Set the protectedItemId property: Data Plane Service ID of the protected item. - * - * @param protectedItemId the protectedItemId value to set. - * @return the GenericProtectedItem object itself. - */ - public GenericProtectedItem withProtectedItemId(Long protectedItemId) { - this.protectedItemId = protectedItemId; - return this; - } - - /** - * Get the sourceAssociations property: Loosely coupled (type, value) associations (example - parent of a protected - * item). - * - * @return the sourceAssociations value. - */ - public Map sourceAssociations() { - return this.sourceAssociations; - } - - /** - * Set the sourceAssociations property: Loosely coupled (type, value) associations (example - parent of a protected - * item). - * - * @param sourceAssociations the sourceAssociations value to set. - * @return the GenericProtectedItem object itself. - */ - public GenericProtectedItem withSourceAssociations(Map sourceAssociations) { - this.sourceAssociations = sourceAssociations; - return this; - } - - /** - * Get the fabricName property: Name of this backup item's fabric. - * - * @return the fabricName value. - */ - public String fabricName() { - return this.fabricName; - } - - /** - * Set the fabricName property: Name of this backup item's fabric. - * - * @param fabricName the fabricName value to set. - * @return the GenericProtectedItem object itself. - */ - public GenericProtectedItem withFabricName(String fabricName) { - this.fabricName = fabricName; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericProtectedItem withContainerName(String containerName) { - super.withContainerName(containerName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericProtectedItem withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericProtectedItem withPolicyId(String policyId) { - super.withPolicyId(policyId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { - super.withLastRecoveryPoint(lastRecoveryPoint); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericProtectedItem withBackupSetName(String backupSetName) { - super.withBackupSetName(backupSetName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericProtectedItem withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { - super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericProtectedItem withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { - super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { - super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericProtectedItem withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { - super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericProtectedItem withIsRehydrate(Boolean isRehydrate) { - super.withIsRehydrate(isRehydrate); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericProtectedItem withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericProtectedItem withIsArchiveEnabled(Boolean isArchiveEnabled) { - super.withIsArchiveEnabled(isArchiveEnabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericProtectedItem withPolicyName(String policyName) { - super.withPolicyName(policyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericProtectedItem withSoftDeleteRetentionPeriodInDays(Integer softDeleteRetentionPeriodInDays) { - super.withSoftDeleteRetentionPeriodInDays(softDeleteRetentionPeriodInDays); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericProtectedItem withSourceSideScanInfo(SourceSideScanInfo sourceSideScanInfo) { - super.withSourceSideScanInfo(sourceSideScanInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("containerName", containerName()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("policyId", policyId()); - jsonWriter.writeStringField("lastRecoveryPoint", - lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint())); - jsonWriter.writeStringField("backupSetName", backupSetName()); - jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString()); - jsonWriter.writeStringField("deferredDeleteTimeInUTC", - deferredDeleteTimeInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc())); - jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete()); - jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining()); - jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming()); - jsonWriter.writeBooleanField("isRehydrate", isRehydrate()); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled()); - jsonWriter.writeStringField("policyName", policyName()); - jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriodInDays()); - jsonWriter.writeJsonField("sourceSideScanInfo", sourceSideScanInfo()); - jsonWriter.writeStringField("protectedItemType", this.protectedItemType); - jsonWriter.writeStringField("friendlyName", this.friendlyName); - jsonWriter.writeStringField("policyState", this.policyState); - jsonWriter.writeStringField("protectionState", - this.protectionState == null ? null : this.protectionState.toString()); - jsonWriter.writeNumberField("protectedItemId", this.protectedItemId); - jsonWriter.writeMapField("sourceAssociations", this.sourceAssociations, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("fabricName", this.fabricName); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GenericProtectedItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GenericProtectedItem 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 GenericProtectedItem. - */ - public static GenericProtectedItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GenericProtectedItem deserializedGenericProtectedItem = new GenericProtectedItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedGenericProtectedItem - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("workloadType".equals(fieldName)) { - deserializedGenericProtectedItem.withWorkloadType(DataSourceType.fromString(reader.getString())); - } else if ("containerName".equals(fieldName)) { - deserializedGenericProtectedItem.withContainerName(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedGenericProtectedItem.withSourceResourceId(reader.getString()); - } else if ("policyId".equals(fieldName)) { - deserializedGenericProtectedItem.withPolicyId(reader.getString()); - } else if ("lastRecoveryPoint".equals(fieldName)) { - deserializedGenericProtectedItem.withLastRecoveryPoint(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("backupSetName".equals(fieldName)) { - deserializedGenericProtectedItem.withBackupSetName(reader.getString()); - } else if ("createMode".equals(fieldName)) { - deserializedGenericProtectedItem.withCreateMode(CreateMode.fromString(reader.getString())); - } else if ("deferredDeleteTimeInUTC".equals(fieldName)) { - deserializedGenericProtectedItem.withDeferredDeleteTimeInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("isScheduledForDeferredDelete".equals(fieldName)) { - deserializedGenericProtectedItem - .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean)); - } else if ("deferredDeleteTimeRemaining".equals(fieldName)) { - deserializedGenericProtectedItem.withDeferredDeleteTimeRemaining(reader.getString()); - } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) { - deserializedGenericProtectedItem - .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean)); - } else if ("isRehydrate".equals(fieldName)) { - deserializedGenericProtectedItem.withIsRehydrate(reader.getNullable(JsonReader::getBoolean)); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedGenericProtectedItem.withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("isArchiveEnabled".equals(fieldName)) { - deserializedGenericProtectedItem.withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("policyName".equals(fieldName)) { - deserializedGenericProtectedItem.withPolicyName(reader.getString()); - } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) { - deserializedGenericProtectedItem - .withSoftDeleteRetentionPeriodInDays(reader.getNullable(JsonReader::getInt)); - } else if ("vaultId".equals(fieldName)) { - deserializedGenericProtectedItem.withVaultId(reader.getString()); - } else if ("sourceSideScanInfo".equals(fieldName)) { - deserializedGenericProtectedItem.withSourceSideScanInfo(SourceSideScanInfo.fromJson(reader)); - } else if ("protectedItemType".equals(fieldName)) { - deserializedGenericProtectedItem.protectedItemType = reader.getString(); - } else if ("friendlyName".equals(fieldName)) { - deserializedGenericProtectedItem.friendlyName = reader.getString(); - } else if ("policyState".equals(fieldName)) { - deserializedGenericProtectedItem.policyState = reader.getString(); - } else if ("protectionState".equals(fieldName)) { - deserializedGenericProtectedItem.protectionState = ProtectionState.fromString(reader.getString()); - } else if ("protectedItemId".equals(fieldName)) { - deserializedGenericProtectedItem.protectedItemId = reader.getNullable(JsonReader::getLong); - } else if ("sourceAssociations".equals(fieldName)) { - Map sourceAssociations = reader.readMap(reader1 -> reader1.getString()); - deserializedGenericProtectedItem.sourceAssociations = sourceAssociations; - } else if ("fabricName".equals(fieldName)) { - deserializedGenericProtectedItem.fabricName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGenericProtectedItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectionPolicy.java deleted file mode 100644 index 2260fd1c9514..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericProtectionPolicy.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Azure VM (Mercury) workload-specific backup policy. - */ -@Fluent -public final class GenericProtectionPolicy extends ProtectionPolicy { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String backupManagementType = "GenericProtectionPolicy"; - - /* - * List of sub-protection policies which includes schedule and retention - */ - private List subProtectionPolicy; - - /* - * TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - */ - private String timeZone; - - /* - * Name of this policy's fabric. - */ - private String fabricName; - - /** - * Creates an instance of GenericProtectionPolicy class. - */ - public GenericProtectionPolicy() { - } - - /** - * Get the backupManagementType property: This property will be used as the discriminator for deciding the specific - * types in the polymorphic chain of types. - * - * @return the backupManagementType value. - */ - @Override - public String backupManagementType() { - return this.backupManagementType; - } - - /** - * Get the subProtectionPolicy property: List of sub-protection policies which includes schedule and retention. - * - * @return the subProtectionPolicy value. - */ - public List subProtectionPolicy() { - return this.subProtectionPolicy; - } - - /** - * Set the subProtectionPolicy property: List of sub-protection policies which includes schedule and retention. - * - * @param subProtectionPolicy the subProtectionPolicy value to set. - * @return the GenericProtectionPolicy object itself. - */ - public GenericProtectionPolicy withSubProtectionPolicy(List subProtectionPolicy) { - this.subProtectionPolicy = subProtectionPolicy; - return this; - } - - /** - * Get the timeZone property: TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - * - * @return the timeZone value. - */ - public String timeZone() { - return this.timeZone; - } - - /** - * Set the timeZone property: TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - * - * @param timeZone the timeZone value to set. - * @return the GenericProtectionPolicy object itself. - */ - public GenericProtectionPolicy withTimeZone(String timeZone) { - this.timeZone = timeZone; - return this; - } - - /** - * Get the fabricName property: Name of this policy's fabric. - * - * @return the fabricName value. - */ - public String fabricName() { - return this.fabricName; - } - - /** - * Set the fabricName property: Name of this policy's fabric. - * - * @param fabricName the fabricName value to set. - * @return the GenericProtectionPolicy object itself. - */ - public GenericProtectionPolicy withFabricName(String fabricName) { - this.fabricName = fabricName; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericProtectionPolicy withProtectedItemsCount(Integer protectedItemsCount) { - super.withProtectedItemsCount(protectedItemsCount); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GenericProtectionPolicy withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("protectedItemsCount", protectedItemsCount()); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("backupManagementType", this.backupManagementType); - jsonWriter.writeArrayField("subProtectionPolicy", this.subProtectionPolicy, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("timeZone", this.timeZone); - jsonWriter.writeStringField("fabricName", this.fabricName); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GenericProtectionPolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GenericProtectionPolicy 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 GenericProtectionPolicy. - */ - public static GenericProtectionPolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GenericProtectionPolicy deserializedGenericProtectionPolicy = new GenericProtectionPolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("protectedItemsCount".equals(fieldName)) { - deserializedGenericProtectionPolicy.withProtectedItemsCount(reader.getNullable(JsonReader::getInt)); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedGenericProtectionPolicy - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("backupManagementType".equals(fieldName)) { - deserializedGenericProtectionPolicy.backupManagementType = reader.getString(); - } else if ("subProtectionPolicy".equals(fieldName)) { - List subProtectionPolicy - = reader.readArray(reader1 -> SubProtectionPolicy.fromJson(reader1)); - deserializedGenericProtectionPolicy.subProtectionPolicy = subProtectionPolicy; - } else if ("timeZone".equals(fieldName)) { - deserializedGenericProtectionPolicy.timeZone = reader.getString(); - } else if ("fabricName".equals(fieldName)) { - deserializedGenericProtectionPolicy.fabricName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGenericProtectionPolicy; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericRecoveryPoint.java deleted file mode 100644 index a23d0cbdc6b6..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GenericRecoveryPoint.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Generic backup copy. - */ -@Immutable -public final class GenericRecoveryPoint extends RecoveryPoint { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "GenericRecoveryPoint"; - - /* - * Friendly name of the backup copy. - */ - private String friendlyName; - - /* - * Type of the backup copy. - */ - private String recoveryPointType; - - /* - * Time at which this backup copy was created. - */ - private OffsetDateTime recoveryPointTime; - - /* - * Additional information associated with this backup copy. - */ - private String recoveryPointAdditionalInfo; - - /* - * Properties of Recovery Point - */ - private RecoveryPointProperties recoveryPointProperties; - - /** - * Creates an instance of GenericRecoveryPoint class. - */ - private GenericRecoveryPoint() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the friendlyName property: Friendly name of the backup copy. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.friendlyName; - } - - /** - * Get the recoveryPointType property: Type of the backup copy. - * - * @return the recoveryPointType value. - */ - public String recoveryPointType() { - return this.recoveryPointType; - } - - /** - * Get the recoveryPointTime property: Time at which this backup copy was created. - * - * @return the recoveryPointTime value. - */ - public OffsetDateTime recoveryPointTime() { - return this.recoveryPointTime; - } - - /** - * Get the recoveryPointAdditionalInfo property: Additional information associated with this backup copy. - * - * @return the recoveryPointAdditionalInfo value. - */ - public String recoveryPointAdditionalInfo() { - return this.recoveryPointAdditionalInfo; - } - - /** - * Get the recoveryPointProperties property: Properties of Recovery Point. - * - * @return the recoveryPointProperties value. - */ - public RecoveryPointProperties recoveryPointProperties() { - return this.recoveryPointProperties; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("threatStatus", threatStatus() == null ? null : threatStatus().toString()); - jsonWriter.writeArrayField("threatInfo", threatInfo(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("friendlyName", this.friendlyName); - jsonWriter.writeStringField("recoveryPointType", this.recoveryPointType); - jsonWriter.writeStringField("recoveryPointTime", - this.recoveryPointTime == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.recoveryPointTime)); - jsonWriter.writeStringField("recoveryPointAdditionalInfo", this.recoveryPointAdditionalInfo); - jsonWriter.writeJsonField("recoveryPointProperties", this.recoveryPointProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GenericRecoveryPoint from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GenericRecoveryPoint 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 GenericRecoveryPoint. - */ - public static GenericRecoveryPoint fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GenericRecoveryPoint deserializedGenericRecoveryPoint = new GenericRecoveryPoint(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("threatStatus".equals(fieldName)) { - deserializedGenericRecoveryPoint.withThreatStatus(ThreatStatus.fromString(reader.getString())); - } else if ("threatInfo".equals(fieldName)) { - List threatInfo = reader.readArray(reader1 -> ThreatInfo.fromJson(reader1)); - deserializedGenericRecoveryPoint.withThreatInfo(threatInfo); - } else if ("objectType".equals(fieldName)) { - deserializedGenericRecoveryPoint.objectType = reader.getString(); - } else if ("friendlyName".equals(fieldName)) { - deserializedGenericRecoveryPoint.friendlyName = reader.getString(); - } else if ("recoveryPointType".equals(fieldName)) { - deserializedGenericRecoveryPoint.recoveryPointType = reader.getString(); - } else if ("recoveryPointTime".equals(fieldName)) { - deserializedGenericRecoveryPoint.recoveryPointTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("recoveryPointAdditionalInfo".equals(fieldName)) { - deserializedGenericRecoveryPoint.recoveryPointAdditionalInfo = reader.getString(); - } else if ("recoveryPointProperties".equals(fieldName)) { - deserializedGenericRecoveryPoint.recoveryPointProperties = RecoveryPointProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGenericRecoveryPoint; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GetTieringCostOperationResults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GetTieringCostOperationResults.java deleted file mode 100644 index 59c3e59e5aaa..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/GetTieringCostOperationResults.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of GetTieringCostOperationResults. - */ -public interface GetTieringCostOperationResults { - /** - * Gets the result of async operation for tiering cost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param operationId The operationId 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 result of async operation for tiering cost along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String vaultName, String operationId, - Context context); - - /** - * Gets the result of async operation for tiering cost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param operationId The operationId 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 result of async operation for tiering cost. - */ - TieringCostInfo get(String resourceGroupName, String vaultName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HealthStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HealthStatus.java deleted file mode 100644 index 7df349ed0447..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HealthStatus.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Health status of protected item. - */ -public final class HealthStatus extends ExpandableStringEnum { - /** - * Static value Passed for HealthStatus. - */ - public static final HealthStatus PASSED = fromString("Passed"); - - /** - * Static value ActionRequired for HealthStatus. - */ - public static final HealthStatus ACTION_REQUIRED = fromString("ActionRequired"); - - /** - * Static value ActionSuggested for HealthStatus. - */ - public static final HealthStatus ACTION_SUGGESTED = fromString("ActionSuggested"); - - /** - * Static value Invalid for HealthStatus. - */ - public static final HealthStatus INVALID = fromString("Invalid"); - - /** - * Creates a new instance of HealthStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public HealthStatus() { - } - - /** - * Creates or finds a HealthStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding HealthStatus. - */ - public static HealthStatus fromString(String name) { - return fromString(name, HealthStatus.class); - } - - /** - * Gets known HealthStatus values. - * - * @return known HealthStatus values. - */ - public static Collection values() { - return values(HealthStatus.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HourlySchedule.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HourlySchedule.java deleted file mode 100644 index 218ad0084760..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HourlySchedule.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * The HourlySchedule model. - */ -@Fluent -public final class HourlySchedule implements JsonSerializable { - /* - * Interval at which backup needs to be triggered. For hourly the value - * can be 4/6/8/12 - */ - private Integer interval; - - /* - * To specify start time of the backup window - */ - private OffsetDateTime scheduleWindowStartTime; - - /* - * To specify duration of the backup window - */ - private Integer scheduleWindowDuration; - - /** - * Creates an instance of HourlySchedule class. - */ - public HourlySchedule() { - } - - /** - * Get the interval property: Interval at which backup needs to be triggered. For hourly the value - * can be 4/6/8/12. - * - * @return the interval value. - */ - public Integer interval() { - return this.interval; - } - - /** - * Set the interval property: Interval at which backup needs to be triggered. For hourly the value - * can be 4/6/8/12. - * - * @param interval the interval value to set. - * @return the HourlySchedule object itself. - */ - public HourlySchedule withInterval(Integer interval) { - this.interval = interval; - return this; - } - - /** - * Get the scheduleWindowStartTime property: To specify start time of the backup window. - * - * @return the scheduleWindowStartTime value. - */ - public OffsetDateTime scheduleWindowStartTime() { - return this.scheduleWindowStartTime; - } - - /** - * Set the scheduleWindowStartTime property: To specify start time of the backup window. - * - * @param scheduleWindowStartTime the scheduleWindowStartTime value to set. - * @return the HourlySchedule object itself. - */ - public HourlySchedule withScheduleWindowStartTime(OffsetDateTime scheduleWindowStartTime) { - this.scheduleWindowStartTime = scheduleWindowStartTime; - return this; - } - - /** - * Get the scheduleWindowDuration property: To specify duration of the backup window. - * - * @return the scheduleWindowDuration value. - */ - public Integer scheduleWindowDuration() { - return this.scheduleWindowDuration; - } - - /** - * Set the scheduleWindowDuration property: To specify duration of the backup window. - * - * @param scheduleWindowDuration the scheduleWindowDuration value to set. - * @return the HourlySchedule object itself. - */ - public HourlySchedule withScheduleWindowDuration(Integer scheduleWindowDuration) { - this.scheduleWindowDuration = scheduleWindowDuration; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("interval", this.interval); - jsonWriter.writeStringField("scheduleWindowStartTime", - this.scheduleWindowStartTime == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.scheduleWindowStartTime)); - jsonWriter.writeNumberField("scheduleWindowDuration", this.scheduleWindowDuration); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of HourlySchedule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HourlySchedule 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 HourlySchedule. - */ - public static HourlySchedule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HourlySchedule deserializedHourlySchedule = new HourlySchedule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("interval".equals(fieldName)) { - deserializedHourlySchedule.interval = reader.getNullable(JsonReader::getInt); - } else if ("scheduleWindowStartTime".equals(fieldName)) { - deserializedHourlySchedule.scheduleWindowStartTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("scheduleWindowDuration".equals(fieldName)) { - deserializedHourlySchedule.scheduleWindowDuration = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedHourlySchedule; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HttpStatusCode.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HttpStatusCode.java deleted file mode 100644 index d2b317f7a9d7..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HttpStatusCode.java +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -/** - * HTTP Status Code of the operation. - */ -public enum HttpStatusCode { - /** - * Enum value Continue. - */ - CONTINUE("Continue"), - - /** - * Enum value SwitchingProtocols. - */ - SWITCHING_PROTOCOLS("SwitchingProtocols"), - - /** - * Enum value OK. - */ - OK("OK"), - - /** - * Enum value Created. - */ - CREATED("Created"), - - /** - * Enum value Accepted. - */ - ACCEPTED("Accepted"), - - /** - * Enum value NonAuthoritativeInformation. - */ - NON_AUTHORITATIVE_INFORMATION("NonAuthoritativeInformation"), - - /** - * Enum value NoContent. - */ - NO_CONTENT("NoContent"), - - /** - * Enum value ResetContent. - */ - RESET_CONTENT("ResetContent"), - - /** - * Enum value PartialContent. - */ - PARTIAL_CONTENT("PartialContent"), - - /** - * Enum value MultipleChoices. - */ - MULTIPLE_CHOICES("MultipleChoices"), - - /** - * Enum value Ambiguous. - */ - AMBIGUOUS("Ambiguous"), - - /** - * Enum value MovedPermanently. - */ - MOVED_PERMANENTLY("MovedPermanently"), - - /** - * Enum value Moved. - */ - MOVED("Moved"), - - /** - * Enum value Found. - */ - FOUND("Found"), - - /** - * Enum value Redirect. - */ - REDIRECT("Redirect"), - - /** - * Enum value SeeOther. - */ - SEE_OTHER("SeeOther"), - - /** - * Enum value RedirectMethod. - */ - REDIRECT_METHOD("RedirectMethod"), - - /** - * Enum value NotModified. - */ - NOT_MODIFIED("NotModified"), - - /** - * Enum value UseProxy. - */ - USE_PROXY("UseProxy"), - - /** - * Enum value Unused. - */ - UNUSED("Unused"), - - /** - * Enum value TemporaryRedirect. - */ - TEMPORARY_REDIRECT("TemporaryRedirect"), - - /** - * Enum value RedirectKeepVerb. - */ - REDIRECT_KEEP_VERB("RedirectKeepVerb"), - - /** - * Enum value BadRequest. - */ - BAD_REQUEST("BadRequest"), - - /** - * Enum value Unauthorized. - */ - UNAUTHORIZED("Unauthorized"), - - /** - * Enum value PaymentRequired. - */ - PAYMENT_REQUIRED("PaymentRequired"), - - /** - * Enum value Forbidden. - */ - FORBIDDEN("Forbidden"), - - /** - * Enum value NotFound. - */ - NOT_FOUND("NotFound"), - - /** - * Enum value MethodNotAllowed. - */ - METHOD_NOT_ALLOWED("MethodNotAllowed"), - - /** - * Enum value NotAcceptable. - */ - NOT_ACCEPTABLE("NotAcceptable"), - - /** - * Enum value ProxyAuthenticationRequired. - */ - PROXY_AUTHENTICATION_REQUIRED("ProxyAuthenticationRequired"), - - /** - * Enum value RequestTimeout. - */ - REQUEST_TIMEOUT("RequestTimeout"), - - /** - * Enum value Conflict. - */ - CONFLICT("Conflict"), - - /** - * Enum value Gone. - */ - GONE("Gone"), - - /** - * Enum value LengthRequired. - */ - LENGTH_REQUIRED("LengthRequired"), - - /** - * Enum value PreconditionFailed. - */ - PRECONDITION_FAILED("PreconditionFailed"), - - /** - * Enum value RequestEntityTooLarge. - */ - REQUEST_ENTITY_TOO_LARGE("RequestEntityTooLarge"), - - /** - * Enum value RequestUriTooLong. - */ - REQUEST_URI_TOO_LONG("RequestUriTooLong"), - - /** - * Enum value UnsupportedMediaType. - */ - UNSUPPORTED_MEDIA_TYPE("UnsupportedMediaType"), - - /** - * Enum value RequestedRangeNotSatisfiable. - */ - REQUESTED_RANGE_NOT_SATISFIABLE("RequestedRangeNotSatisfiable"), - - /** - * Enum value ExpectationFailed. - */ - EXPECTATION_FAILED("ExpectationFailed"), - - /** - * Enum value UpgradeRequired. - */ - UPGRADE_REQUIRED("UpgradeRequired"), - - /** - * Enum value InternalServerError. - */ - INTERNAL_SERVER_ERROR("InternalServerError"), - - /** - * Enum value NotImplemented. - */ - NOT_IMPLEMENTED("NotImplemented"), - - /** - * Enum value BadGateway. - */ - BAD_GATEWAY("BadGateway"), - - /** - * Enum value ServiceUnavailable. - */ - SERVICE_UNAVAILABLE("ServiceUnavailable"), - - /** - * Enum value GatewayTimeout. - */ - GATEWAY_TIMEOUT("GatewayTimeout"), - - /** - * Enum value HttpVersionNotSupported. - */ - HTTP_VERSION_NOT_SUPPORTED("HttpVersionNotSupported"); - - /** - * The actual serialized value for a HttpStatusCode instance. - */ - private final String value; - - HttpStatusCode(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a HttpStatusCode instance. - * - * @param value the serialized value to parse. - * @return the parsed HttpStatusCode object, or null if unable to parse. - */ - public static HttpStatusCode fromString(String value) { - if (value == null) { - return null; - } - HttpStatusCode[] items = HttpStatusCode.values(); - for (HttpStatusCode item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaaSvmContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaaSvmContainer.java deleted file mode 100644 index cc1d91f249d5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaaSvmContainer.java +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * IaaS VM workload-specific container. - */ -@Fluent -public class IaaSvmContainer extends ProtectionContainer { - /* - * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines - * 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer - */ - private ProtectableContainerType containerType = ProtectableContainerType.IAAS_VMCONTAINER; - - /* - * Fully qualified ARM url of the virtual machine represented by this Azure IaaS VM container. - */ - private String virtualMachineId; - - /* - * Specifies whether the container represents a Classic or an Azure Resource Manager VM. - */ - private String virtualMachineVersion; - - /* - * Resource group name of Recovery Services Vault. - */ - private String resourceGroup; - - /** - * Creates an instance of IaaSvmContainer class. - */ - public IaaSvmContainer() { - } - - /** - * Get the containerType property: Type of the container. The value of this property for: 1. Compute Azure VM is - * Microsoft.Compute/virtualMachines 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer. - * - * @return the containerType value. - */ - @Override - public ProtectableContainerType containerType() { - return this.containerType; - } - - /** - * Get the virtualMachineId property: Fully qualified ARM url of the virtual machine represented by this Azure IaaS - * VM container. - * - * @return the virtualMachineId value. - */ - public String virtualMachineId() { - return this.virtualMachineId; - } - - /** - * Set the virtualMachineId property: Fully qualified ARM url of the virtual machine represented by this Azure IaaS - * VM container. - * - * @param virtualMachineId the virtualMachineId value to set. - * @return the IaaSvmContainer object itself. - */ - public IaaSvmContainer withVirtualMachineId(String virtualMachineId) { - this.virtualMachineId = virtualMachineId; - return this; - } - - /** - * Get the virtualMachineVersion property: Specifies whether the container represents a Classic or an Azure Resource - * Manager VM. - * - * @return the virtualMachineVersion value. - */ - public String virtualMachineVersion() { - return this.virtualMachineVersion; - } - - /** - * Set the virtualMachineVersion property: Specifies whether the container represents a Classic or an Azure Resource - * Manager VM. - * - * @param virtualMachineVersion the virtualMachineVersion value to set. - * @return the IaaSvmContainer object itself. - */ - public IaaSvmContainer withVirtualMachineVersion(String virtualMachineVersion) { - this.virtualMachineVersion = virtualMachineVersion; - return this; - } - - /** - * Get the resourceGroup property: Resource group name of Recovery Services Vault. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.resourceGroup; - } - - /** - * Set the resourceGroup property: Resource group name of Recovery Services Vault. - * - * @param resourceGroup the resourceGroup value to set. - * @return the IaaSvmContainer object itself. - */ - public IaaSvmContainer withResourceGroup(String resourceGroup) { - this.resourceGroup = resourceGroup; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaaSvmContainer withFriendlyName(String friendlyName) { - super.withFriendlyName(friendlyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaaSvmContainer withBackupManagementType(BackupManagementType backupManagementType) { - super.withBackupManagementType(backupManagementType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaaSvmContainer withRegistrationStatus(String registrationStatus) { - super.withRegistrationStatus(registrationStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaaSvmContainer withHealthStatus(String healthStatus) { - super.withHealthStatus(healthStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaaSvmContainer withProtectableObjectType(String protectableObjectType) { - super.withProtectableObjectType(protectableObjectType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("registrationStatus", registrationStatus()); - jsonWriter.writeStringField("healthStatus", healthStatus()); - jsonWriter.writeStringField("protectableObjectType", protectableObjectType()); - jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString()); - jsonWriter.writeStringField("virtualMachineId", this.virtualMachineId); - jsonWriter.writeStringField("virtualMachineVersion", this.virtualMachineVersion); - jsonWriter.writeStringField("resourceGroup", this.resourceGroup); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IaaSvmContainer from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IaaSvmContainer 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 IaaSvmContainer. - */ - public static IaaSvmContainer fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("containerType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("Microsoft.Compute/virtualMachines".equals(discriminatorValue)) { - return AzureIaaSComputeVMContainer.fromJson(readerToUse.reset()); - } else if ("Microsoft.ClassicCompute/virtualMachines".equals(discriminatorValue)) { - return AzureIaaSClassicComputeVMContainer.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static IaaSvmContainer fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IaaSvmContainer deserializedIaaSvmContainer = new IaaSvmContainer(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("friendlyName".equals(fieldName)) { - deserializedIaaSvmContainer.withFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedIaaSvmContainer - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("registrationStatus".equals(fieldName)) { - deserializedIaaSvmContainer.withRegistrationStatus(reader.getString()); - } else if ("healthStatus".equals(fieldName)) { - deserializedIaaSvmContainer.withHealthStatus(reader.getString()); - } else if ("protectableObjectType".equals(fieldName)) { - deserializedIaaSvmContainer.withProtectableObjectType(reader.getString()); - } else if ("containerType".equals(fieldName)) { - deserializedIaaSvmContainer.containerType = ProtectableContainerType.fromString(reader.getString()); - } else if ("virtualMachineId".equals(fieldName)) { - deserializedIaaSvmContainer.virtualMachineId = reader.getString(); - } else if ("virtualMachineVersion".equals(fieldName)) { - deserializedIaaSvmContainer.virtualMachineVersion = reader.getString(); - } else if ("resourceGroup".equals(fieldName)) { - deserializedIaaSvmContainer.resourceGroup = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedIaaSvmContainer; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMBackupRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMBackupRequest.java deleted file mode 100644 index cab052906248..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMBackupRequest.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * IaaS VM workload-specific backup request. - */ -@Fluent -public final class IaasVMBackupRequest extends BackupRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "IaasVMBackupRequest"; - - /* - * Backup copy will expire after the time specified (UTC). - */ - private OffsetDateTime recoveryPointExpiryTimeInUtc; - - /** - * Creates an instance of IaasVMBackupRequest class. - */ - public IaasVMBackupRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the recoveryPointExpiryTimeInUtc property: Backup copy will expire after the time specified (UTC). - * - * @return the recoveryPointExpiryTimeInUtc value. - */ - public OffsetDateTime recoveryPointExpiryTimeInUtc() { - return this.recoveryPointExpiryTimeInUtc; - } - - /** - * Set the recoveryPointExpiryTimeInUtc property: Backup copy will expire after the time specified (UTC). - * - * @param recoveryPointExpiryTimeInUtc the recoveryPointExpiryTimeInUtc value to set. - * @return the IaasVMBackupRequest object itself. - */ - public IaasVMBackupRequest withRecoveryPointExpiryTimeInUtc(OffsetDateTime recoveryPointExpiryTimeInUtc) { - this.recoveryPointExpiryTimeInUtc = recoveryPointExpiryTimeInUtc; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("recoveryPointExpiryTimeInUTC", - this.recoveryPointExpiryTimeInUtc == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.recoveryPointExpiryTimeInUtc)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IaasVMBackupRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IaasVMBackupRequest 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 IaasVMBackupRequest. - */ - public static IaasVMBackupRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IaasVMBackupRequest deserializedIaasVMBackupRequest = new IaasVMBackupRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedIaasVMBackupRequest.objectType = reader.getString(); - } else if ("recoveryPointExpiryTimeInUTC".equals(fieldName)) { - deserializedIaasVMBackupRequest.recoveryPointExpiryTimeInUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedIaasVMBackupRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRecoveryPoint.java deleted file mode 100644 index c9fbfd7eb0db..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRecoveryPoint.java +++ /dev/null @@ -1,431 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; -import java.util.Map; - -/** - * IaaS VM workload specific backup copy. - */ -@Immutable -public final class IaasVMRecoveryPoint extends RecoveryPoint { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "IaasVMRecoveryPoint"; - - /* - * Type of the backup copy. - */ - private String recoveryPointType; - - /* - * Time at which this backup copy was created. - */ - private OffsetDateTime recoveryPointTime; - - /* - * Additional information associated with this backup copy. - */ - private String recoveryPointAdditionalInfo; - - /* - * Storage type of the VM whose backup copy is created. - */ - private String sourceVMStorageType; - - /* - * Identifies whether the VM was encrypted when the backup copy is created. - */ - private Boolean isSourceVMEncrypted; - - /* - * Required details for recovering an encrypted VM. Applicable only when IsSourceVMEncrypted is true. - */ - private KeyAndSecretDetails keyAndSecret; - - /* - * Is the session to recover items from this backup copy still active. - */ - private Boolean isInstantIlrSessionActive; - - /* - * Recovery point tier information. - */ - private List recoveryPointTierDetails; - - /* - * Whether VM is with Managed Disks - */ - private Boolean isManagedVirtualMachine; - - /* - * Virtual Machine Size - */ - private String virtualMachineSize; - - /* - * Original Storage Account Option - */ - private Boolean originalStorageAccountOption; - - /* - * OS type - */ - private String osType; - - /* - * Disk configuration - */ - private RecoveryPointDiskConfiguration recoveryPointDiskConfiguration; - - /* - * Identifies the zone of the VM at the time of backup. Applicable only for zone-pinned Vms - */ - private List zones; - - /* - * Eligibility of RP to be moved to another tier - */ - private Map recoveryPointMoveReadinessInfo; - - /* - * Security Type of the Disk - */ - private String securityType; - - /* - * Properties of Recovery Point - */ - private RecoveryPointProperties recoveryPointProperties; - - /* - * This flag denotes if any of the disks in the VM are using Private access network setting - */ - private Boolean isPrivateAccessEnabledOnAnyDisk; - - /* - * Extended location of the VM recovery point, - * should be null if VM is in public cloud - */ - private ExtendedLocation extendedLocation; - - /** - * Creates an instance of IaasVMRecoveryPoint class. - */ - private IaasVMRecoveryPoint() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the recoveryPointType property: Type of the backup copy. - * - * @return the recoveryPointType value. - */ - public String recoveryPointType() { - return this.recoveryPointType; - } - - /** - * Get the recoveryPointTime property: Time at which this backup copy was created. - * - * @return the recoveryPointTime value. - */ - public OffsetDateTime recoveryPointTime() { - return this.recoveryPointTime; - } - - /** - * Get the recoveryPointAdditionalInfo property: Additional information associated with this backup copy. - * - * @return the recoveryPointAdditionalInfo value. - */ - public String recoveryPointAdditionalInfo() { - return this.recoveryPointAdditionalInfo; - } - - /** - * Get the sourceVMStorageType property: Storage type of the VM whose backup copy is created. - * - * @return the sourceVMStorageType value. - */ - public String sourceVMStorageType() { - return this.sourceVMStorageType; - } - - /** - * Get the isSourceVMEncrypted property: Identifies whether the VM was encrypted when the backup copy is created. - * - * @return the isSourceVMEncrypted value. - */ - public Boolean isSourceVMEncrypted() { - return this.isSourceVMEncrypted; - } - - /** - * Get the keyAndSecret property: Required details for recovering an encrypted VM. Applicable only when - * IsSourceVMEncrypted is true. - * - * @return the keyAndSecret value. - */ - public KeyAndSecretDetails keyAndSecret() { - return this.keyAndSecret; - } - - /** - * Get the isInstantIlrSessionActive property: Is the session to recover items from this backup copy still active. - * - * @return the isInstantIlrSessionActive value. - */ - public Boolean isInstantIlrSessionActive() { - return this.isInstantIlrSessionActive; - } - - /** - * Get the recoveryPointTierDetails property: Recovery point tier information. - * - * @return the recoveryPointTierDetails value. - */ - public List recoveryPointTierDetails() { - return this.recoveryPointTierDetails; - } - - /** - * Get the isManagedVirtualMachine property: Whether VM is with Managed Disks. - * - * @return the isManagedVirtualMachine value. - */ - public Boolean isManagedVirtualMachine() { - return this.isManagedVirtualMachine; - } - - /** - * Get the virtualMachineSize property: Virtual Machine Size. - * - * @return the virtualMachineSize value. - */ - public String virtualMachineSize() { - return this.virtualMachineSize; - } - - /** - * Get the originalStorageAccountOption property: Original Storage Account Option. - * - * @return the originalStorageAccountOption value. - */ - public Boolean originalStorageAccountOption() { - return this.originalStorageAccountOption; - } - - /** - * Get the osType property: OS type. - * - * @return the osType value. - */ - public String osType() { - return this.osType; - } - - /** - * Get the recoveryPointDiskConfiguration property: Disk configuration. - * - * @return the recoveryPointDiskConfiguration value. - */ - public RecoveryPointDiskConfiguration recoveryPointDiskConfiguration() { - return this.recoveryPointDiskConfiguration; - } - - /** - * Get the zones property: Identifies the zone of the VM at the time of backup. Applicable only for zone-pinned Vms. - * - * @return the zones value. - */ - public List zones() { - return this.zones; - } - - /** - * Get the recoveryPointMoveReadinessInfo property: Eligibility of RP to be moved to another tier. - * - * @return the recoveryPointMoveReadinessInfo value. - */ - public Map recoveryPointMoveReadinessInfo() { - return this.recoveryPointMoveReadinessInfo; - } - - /** - * Get the securityType property: Security Type of the Disk. - * - * @return the securityType value. - */ - public String securityType() { - return this.securityType; - } - - /** - * Get the recoveryPointProperties property: Properties of Recovery Point. - * - * @return the recoveryPointProperties value. - */ - public RecoveryPointProperties recoveryPointProperties() { - return this.recoveryPointProperties; - } - - /** - * Get the isPrivateAccessEnabledOnAnyDisk property: This flag denotes if any of the disks in the VM are using - * Private access network setting. - * - * @return the isPrivateAccessEnabledOnAnyDisk value. - */ - public Boolean isPrivateAccessEnabledOnAnyDisk() { - return this.isPrivateAccessEnabledOnAnyDisk; - } - - /** - * Get the extendedLocation property: Extended location of the VM recovery point, - * should be null if VM is in public cloud. - * - * @return the extendedLocation value. - */ - public ExtendedLocation extendedLocation() { - return this.extendedLocation; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("threatStatus", threatStatus() == null ? null : threatStatus().toString()); - jsonWriter.writeArrayField("threatInfo", threatInfo(), (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("recoveryPointType", this.recoveryPointType); - jsonWriter.writeStringField("recoveryPointTime", - this.recoveryPointTime == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.recoveryPointTime)); - jsonWriter.writeStringField("recoveryPointAdditionalInfo", this.recoveryPointAdditionalInfo); - jsonWriter.writeStringField("sourceVMStorageType", this.sourceVMStorageType); - jsonWriter.writeBooleanField("isSourceVMEncrypted", this.isSourceVMEncrypted); - jsonWriter.writeJsonField("keyAndSecret", this.keyAndSecret); - jsonWriter.writeBooleanField("isInstantIlrSessionActive", this.isInstantIlrSessionActive); - jsonWriter.writeArrayField("recoveryPointTierDetails", this.recoveryPointTierDetails, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeBooleanField("isManagedVirtualMachine", this.isManagedVirtualMachine); - jsonWriter.writeStringField("virtualMachineSize", this.virtualMachineSize); - jsonWriter.writeBooleanField("originalStorageAccountOption", this.originalStorageAccountOption); - jsonWriter.writeStringField("osType", this.osType); - jsonWriter.writeJsonField("recoveryPointDiskConfiguration", this.recoveryPointDiskConfiguration); - jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); - jsonWriter.writeMapField("recoveryPointMoveReadinessInfo", this.recoveryPointMoveReadinessInfo, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("securityType", this.securityType); - jsonWriter.writeJsonField("recoveryPointProperties", this.recoveryPointProperties); - jsonWriter.writeBooleanField("isPrivateAccessEnabledOnAnyDisk", this.isPrivateAccessEnabledOnAnyDisk); - jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IaasVMRecoveryPoint from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IaasVMRecoveryPoint 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 IaasVMRecoveryPoint. - */ - public static IaasVMRecoveryPoint fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IaasVMRecoveryPoint deserializedIaasVMRecoveryPoint = new IaasVMRecoveryPoint(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("threatStatus".equals(fieldName)) { - deserializedIaasVMRecoveryPoint.withThreatStatus(ThreatStatus.fromString(reader.getString())); - } else if ("threatInfo".equals(fieldName)) { - List threatInfo = reader.readArray(reader1 -> ThreatInfo.fromJson(reader1)); - deserializedIaasVMRecoveryPoint.withThreatInfo(threatInfo); - } else if ("objectType".equals(fieldName)) { - deserializedIaasVMRecoveryPoint.objectType = reader.getString(); - } else if ("recoveryPointType".equals(fieldName)) { - deserializedIaasVMRecoveryPoint.recoveryPointType = reader.getString(); - } else if ("recoveryPointTime".equals(fieldName)) { - deserializedIaasVMRecoveryPoint.recoveryPointTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("recoveryPointAdditionalInfo".equals(fieldName)) { - deserializedIaasVMRecoveryPoint.recoveryPointAdditionalInfo = reader.getString(); - } else if ("sourceVMStorageType".equals(fieldName)) { - deserializedIaasVMRecoveryPoint.sourceVMStorageType = reader.getString(); - } else if ("isSourceVMEncrypted".equals(fieldName)) { - deserializedIaasVMRecoveryPoint.isSourceVMEncrypted = reader.getNullable(JsonReader::getBoolean); - } else if ("keyAndSecret".equals(fieldName)) { - deserializedIaasVMRecoveryPoint.keyAndSecret = KeyAndSecretDetails.fromJson(reader); - } else if ("isInstantIlrSessionActive".equals(fieldName)) { - deserializedIaasVMRecoveryPoint.isInstantIlrSessionActive - = reader.getNullable(JsonReader::getBoolean); - } else if ("recoveryPointTierDetails".equals(fieldName)) { - List recoveryPointTierDetails - = reader.readArray(reader1 -> RecoveryPointTierInformationV2.fromJson(reader1)); - deserializedIaasVMRecoveryPoint.recoveryPointTierDetails = recoveryPointTierDetails; - } else if ("isManagedVirtualMachine".equals(fieldName)) { - deserializedIaasVMRecoveryPoint.isManagedVirtualMachine - = reader.getNullable(JsonReader::getBoolean); - } else if ("virtualMachineSize".equals(fieldName)) { - deserializedIaasVMRecoveryPoint.virtualMachineSize = reader.getString(); - } else if ("originalStorageAccountOption".equals(fieldName)) { - deserializedIaasVMRecoveryPoint.originalStorageAccountOption - = reader.getNullable(JsonReader::getBoolean); - } else if ("osType".equals(fieldName)) { - deserializedIaasVMRecoveryPoint.osType = reader.getString(); - } else if ("recoveryPointDiskConfiguration".equals(fieldName)) { - deserializedIaasVMRecoveryPoint.recoveryPointDiskConfiguration - = RecoveryPointDiskConfiguration.fromJson(reader); - } else if ("zones".equals(fieldName)) { - List zones = reader.readArray(reader1 -> reader1.getString()); - deserializedIaasVMRecoveryPoint.zones = zones; - } else if ("recoveryPointMoveReadinessInfo".equals(fieldName)) { - Map recoveryPointMoveReadinessInfo - = reader.readMap(reader1 -> RecoveryPointMoveReadinessInfo.fromJson(reader1)); - deserializedIaasVMRecoveryPoint.recoveryPointMoveReadinessInfo = recoveryPointMoveReadinessInfo; - } else if ("securityType".equals(fieldName)) { - deserializedIaasVMRecoveryPoint.securityType = reader.getString(); - } else if ("recoveryPointProperties".equals(fieldName)) { - deserializedIaasVMRecoveryPoint.recoveryPointProperties = RecoveryPointProperties.fromJson(reader); - } else if ("isPrivateAccessEnabledOnAnyDisk".equals(fieldName)) { - deserializedIaasVMRecoveryPoint.isPrivateAccessEnabledOnAnyDisk - = reader.getNullable(JsonReader::getBoolean); - } else if ("extendedLocation".equals(fieldName)) { - deserializedIaasVMRecoveryPoint.extendedLocation = ExtendedLocation.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedIaasVMRecoveryPoint; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreRequest.java deleted file mode 100644 index a1a6c7093b45..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreRequest.java +++ /dev/null @@ -1,818 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * IaaS VM workload-specific restore. - */ -@Fluent -public class IaasVMRestoreRequest extends RestoreRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "IaasVMRestoreRequest"; - - /* - * ID of the backup copy to be recovered. - */ - private String recoveryPointId; - - /* - * Type of this recovery. - */ - private RecoveryType recoveryType; - - /* - * Fully qualified ARM ID of the VM which is being recovered. - */ - private String sourceResourceId; - - /* - * This is the complete ARM Id of the VM that will be created. - * For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} - */ - private String targetVirtualMachineId; - - /* - * This is the ARM Id of the resource group that you want to create for this Virtual machine and other artifacts. - * For e.g. /subscriptions/{subId}/resourcegroups/{rg} - */ - private String targetResourceGroupId; - - /* - * Fully qualified ARM ID of the storage account to which the VM has to be restored. - */ - private String storageAccountId; - - /* - * This is the virtual network Id of the vnet that will be attached to the virtual machine. - * User will be validated for join action permissions in the linked access. - */ - private String virtualNetworkId; - - /* - * Subnet ID, is the subnet ID associated with the to be restored VM. For Classic VMs it would be - * {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource ID used to - * represent - * the subnet. - */ - private String subnetId; - - /* - * Fully qualified ARM ID of the domain name to be associated to the VM being restored. This applies only to Classic - * Virtual Machines. - */ - private String targetDomainNameId; - - /* - * Region in which the virtual machine is restored. - */ - private String region; - - /* - * Affinity group associated to VM to be restored. Used only for Classic Compute Virtual Machines. - */ - private String affinityGroup; - - /* - * Should a new cloud service be created while restoring the VM. If this is false, VM will be restored to the same - * cloud service as it was at the time of backup. - */ - private Boolean createNewCloudService; - - /* - * Original Storage Account Option - */ - private Boolean originalStorageAccountOption; - - /* - * Details needed if the VM was encrypted at the time of backup. - */ - private EncryptionDetails encryptionDetails; - - /* - * List of Disk LUNs for partial restore - */ - private List restoreDiskLunList; - - /* - * Flag to denote of an Unmanaged disk VM should be restored with Managed disks. - */ - private Boolean restoreWithManagedDisks; - - /* - * DiskEncryptionSet's ID - needed if the VM needs to be encrypted at rest during restore with customer managed key. - */ - private String diskEncryptionSetId; - - /* - * Target zone where the VM and its disks should be restored. - */ - private List zones; - - /* - * Managed Identity information required to access customer storage account. - */ - private IdentityInfo identityInfo; - - /* - * IaaS VM workload specific restore details for restores using managed identity. - */ - private IdentityBasedRestoreDetails identityBasedRestoreDetails; - - /* - * Target extended location where the VM should be restored, - * should be null if restore is to be done in public cloud - */ - private ExtendedLocation extendedLocation; - - /* - * Stores Secured VM Details - */ - private SecuredVMDetails securedVMDetails; - - /* - * Specifies target network access settings for disks of VM to be restored, - */ - private TargetDiskNetworkAccessSettings targetDiskNetworkAccessSettings; - - /** - * Creates an instance of IaasVMRestoreRequest class. - */ - public IaasVMRestoreRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the recoveryPointId property: ID of the backup copy to be recovered. - * - * @return the recoveryPointId value. - */ - public String recoveryPointId() { - return this.recoveryPointId; - } - - /** - * Set the recoveryPointId property: ID of the backup copy to be recovered. - * - * @param recoveryPointId the recoveryPointId value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest withRecoveryPointId(String recoveryPointId) { - this.recoveryPointId = recoveryPointId; - return this; - } - - /** - * Get the recoveryType property: Type of this recovery. - * - * @return the recoveryType value. - */ - public RecoveryType recoveryType() { - return this.recoveryType; - } - - /** - * Set the recoveryType property: Type of this recovery. - * - * @param recoveryType the recoveryType value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest withRecoveryType(RecoveryType recoveryType) { - this.recoveryType = recoveryType; - return this; - } - - /** - * Get the sourceResourceId property: Fully qualified ARM ID of the VM which is being recovered. - * - * @return the sourceResourceId value. - */ - public String sourceResourceId() { - return this.sourceResourceId; - } - - /** - * Set the sourceResourceId property: Fully qualified ARM ID of the VM which is being recovered. - * - * @param sourceResourceId the sourceResourceId value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest withSourceResourceId(String sourceResourceId) { - this.sourceResourceId = sourceResourceId; - return this; - } - - /** - * Get the targetVirtualMachineId property: This is the complete ARM Id of the VM that will be created. - * For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. - * - * @return the targetVirtualMachineId value. - */ - public String targetVirtualMachineId() { - return this.targetVirtualMachineId; - } - - /** - * Set the targetVirtualMachineId property: This is the complete ARM Id of the VM that will be created. - * For e.g. /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}. - * - * @param targetVirtualMachineId the targetVirtualMachineId value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest withTargetVirtualMachineId(String targetVirtualMachineId) { - this.targetVirtualMachineId = targetVirtualMachineId; - return this; - } - - /** - * Get the targetResourceGroupId property: This is the ARM Id of the resource group that you want to create for this - * Virtual machine and other artifacts. - * For e.g. /subscriptions/{subId}/resourcegroups/{rg}. - * - * @return the targetResourceGroupId value. - */ - public String targetResourceGroupId() { - return this.targetResourceGroupId; - } - - /** - * Set the targetResourceGroupId property: This is the ARM Id of the resource group that you want to create for this - * Virtual machine and other artifacts. - * For e.g. /subscriptions/{subId}/resourcegroups/{rg}. - * - * @param targetResourceGroupId the targetResourceGroupId value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest withTargetResourceGroupId(String targetResourceGroupId) { - this.targetResourceGroupId = targetResourceGroupId; - return this; - } - - /** - * Get the storageAccountId property: Fully qualified ARM ID of the storage account to which the VM has to be - * restored. - * - * @return the storageAccountId value. - */ - public String storageAccountId() { - return this.storageAccountId; - } - - /** - * Set the storageAccountId property: Fully qualified ARM ID of the storage account to which the VM has to be - * restored. - * - * @param storageAccountId the storageAccountId value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest withStorageAccountId(String storageAccountId) { - this.storageAccountId = storageAccountId; - return this; - } - - /** - * Get the virtualNetworkId property: This is the virtual network Id of the vnet that will be attached to the - * virtual machine. - * User will be validated for join action permissions in the linked access. - * - * @return the virtualNetworkId value. - */ - public String virtualNetworkId() { - return this.virtualNetworkId; - } - - /** - * Set the virtualNetworkId property: This is the virtual network Id of the vnet that will be attached to the - * virtual machine. - * User will be validated for join action permissions in the linked access. - * - * @param virtualNetworkId the virtualNetworkId value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest withVirtualNetworkId(String virtualNetworkId) { - this.virtualNetworkId = virtualNetworkId; - return this; - } - - /** - * Get the subnetId property: Subnet ID, is the subnet ID associated with the to be restored VM. For Classic VMs it - * would be - * {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource ID used to - * represent - * the subnet. - * - * @return the subnetId value. - */ - public String subnetId() { - return this.subnetId; - } - - /** - * Set the subnetId property: Subnet ID, is the subnet ID associated with the to be restored VM. For Classic VMs it - * would be - * {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it would be ARM resource ID used to - * represent - * the subnet. - * - * @param subnetId the subnetId value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest withSubnetId(String subnetId) { - this.subnetId = subnetId; - return this; - } - - /** - * Get the targetDomainNameId property: Fully qualified ARM ID of the domain name to be associated to the VM being - * restored. This applies only to Classic - * Virtual Machines. - * - * @return the targetDomainNameId value. - */ - public String targetDomainNameId() { - return this.targetDomainNameId; - } - - /** - * Set the targetDomainNameId property: Fully qualified ARM ID of the domain name to be associated to the VM being - * restored. This applies only to Classic - * Virtual Machines. - * - * @param targetDomainNameId the targetDomainNameId value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest withTargetDomainNameId(String targetDomainNameId) { - this.targetDomainNameId = targetDomainNameId; - return this; - } - - /** - * Get the region property: Region in which the virtual machine is restored. - * - * @return the region value. - */ - public String region() { - return this.region; - } - - /** - * Set the region property: Region in which the virtual machine is restored. - * - * @param region the region value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest withRegion(String region) { - this.region = region; - return this; - } - - /** - * Get the affinityGroup property: Affinity group associated to VM to be restored. Used only for Classic Compute - * Virtual Machines. - * - * @return the affinityGroup value. - */ - public String affinityGroup() { - return this.affinityGroup; - } - - /** - * Set the affinityGroup property: Affinity group associated to VM to be restored. Used only for Classic Compute - * Virtual Machines. - * - * @param affinityGroup the affinityGroup value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest withAffinityGroup(String affinityGroup) { - this.affinityGroup = affinityGroup; - return this; - } - - /** - * Get the createNewCloudService property: Should a new cloud service be created while restoring the VM. If this is - * false, VM will be restored to the same - * cloud service as it was at the time of backup. - * - * @return the createNewCloudService value. - */ - public Boolean createNewCloudService() { - return this.createNewCloudService; - } - - /** - * Set the createNewCloudService property: Should a new cloud service be created while restoring the VM. If this is - * false, VM will be restored to the same - * cloud service as it was at the time of backup. - * - * @param createNewCloudService the createNewCloudService value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest withCreateNewCloudService(Boolean createNewCloudService) { - this.createNewCloudService = createNewCloudService; - return this; - } - - /** - * Get the originalStorageAccountOption property: Original Storage Account Option. - * - * @return the originalStorageAccountOption value. - */ - public Boolean originalStorageAccountOption() { - return this.originalStorageAccountOption; - } - - /** - * Set the originalStorageAccountOption property: Original Storage Account Option. - * - * @param originalStorageAccountOption the originalStorageAccountOption value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest withOriginalStorageAccountOption(Boolean originalStorageAccountOption) { - this.originalStorageAccountOption = originalStorageAccountOption; - return this; - } - - /** - * Get the encryptionDetails property: Details needed if the VM was encrypted at the time of backup. - * - * @return the encryptionDetails value. - */ - public EncryptionDetails encryptionDetails() { - return this.encryptionDetails; - } - - /** - * Set the encryptionDetails property: Details needed if the VM was encrypted at the time of backup. - * - * @param encryptionDetails the encryptionDetails value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest withEncryptionDetails(EncryptionDetails encryptionDetails) { - this.encryptionDetails = encryptionDetails; - return this; - } - - /** - * Get the restoreDiskLunList property: List of Disk LUNs for partial restore. - * - * @return the restoreDiskLunList value. - */ - public List restoreDiskLunList() { - return this.restoreDiskLunList; - } - - /** - * Set the restoreDiskLunList property: List of Disk LUNs for partial restore. - * - * @param restoreDiskLunList the restoreDiskLunList value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest withRestoreDiskLunList(List restoreDiskLunList) { - this.restoreDiskLunList = restoreDiskLunList; - return this; - } - - /** - * Get the restoreWithManagedDisks property: Flag to denote of an Unmanaged disk VM should be restored with Managed - * disks. - * - * @return the restoreWithManagedDisks value. - */ - public Boolean restoreWithManagedDisks() { - return this.restoreWithManagedDisks; - } - - /** - * Set the restoreWithManagedDisks property: Flag to denote of an Unmanaged disk VM should be restored with Managed - * disks. - * - * @param restoreWithManagedDisks the restoreWithManagedDisks value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest withRestoreWithManagedDisks(Boolean restoreWithManagedDisks) { - this.restoreWithManagedDisks = restoreWithManagedDisks; - return this; - } - - /** - * Get the diskEncryptionSetId property: DiskEncryptionSet's ID - needed if the VM needs to be encrypted at rest - * during restore with customer managed key. - * - * @return the diskEncryptionSetId value. - */ - public String diskEncryptionSetId() { - return this.diskEncryptionSetId; - } - - /** - * Set the diskEncryptionSetId property: DiskEncryptionSet's ID - needed if the VM needs to be encrypted at rest - * during restore with customer managed key. - * - * @param diskEncryptionSetId the diskEncryptionSetId value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest withDiskEncryptionSetId(String diskEncryptionSetId) { - this.diskEncryptionSetId = diskEncryptionSetId; - return this; - } - - /** - * Get the zones property: Target zone where the VM and its disks should be restored. - * - * @return the zones value. - */ - public List zones() { - return this.zones; - } - - /** - * Set the zones property: Target zone where the VM and its disks should be restored. - * - * @param zones the zones value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest withZones(List zones) { - this.zones = zones; - return this; - } - - /** - * Get the identityInfo property: Managed Identity information required to access customer storage account. - * - * @return the identityInfo value. - */ - public IdentityInfo identityInfo() { - return this.identityInfo; - } - - /** - * Set the identityInfo property: Managed Identity information required to access customer storage account. - * - * @param identityInfo the identityInfo value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest withIdentityInfo(IdentityInfo identityInfo) { - this.identityInfo = identityInfo; - return this; - } - - /** - * Get the identityBasedRestoreDetails property: IaaS VM workload specific restore details for restores using - * managed identity. - * - * @return the identityBasedRestoreDetails value. - */ - public IdentityBasedRestoreDetails identityBasedRestoreDetails() { - return this.identityBasedRestoreDetails; - } - - /** - * Set the identityBasedRestoreDetails property: IaaS VM workload specific restore details for restores using - * managed identity. - * - * @param identityBasedRestoreDetails the identityBasedRestoreDetails value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest - withIdentityBasedRestoreDetails(IdentityBasedRestoreDetails identityBasedRestoreDetails) { - this.identityBasedRestoreDetails = identityBasedRestoreDetails; - return this; - } - - /** - * Get the extendedLocation property: Target extended location where the VM should be restored, - * should be null if restore is to be done in public cloud. - * - * @return the extendedLocation value. - */ - public ExtendedLocation extendedLocation() { - return this.extendedLocation; - } - - /** - * Set the extendedLocation property: Target extended location where the VM should be restored, - * should be null if restore is to be done in public cloud. - * - * @param extendedLocation the extendedLocation value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest withExtendedLocation(ExtendedLocation extendedLocation) { - this.extendedLocation = extendedLocation; - return this; - } - - /** - * Get the securedVMDetails property: Stores Secured VM Details. - * - * @return the securedVMDetails value. - */ - public SecuredVMDetails securedVMDetails() { - return this.securedVMDetails; - } - - /** - * Set the securedVMDetails property: Stores Secured VM Details. - * - * @param securedVMDetails the securedVMDetails value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest withSecuredVMDetails(SecuredVMDetails securedVMDetails) { - this.securedVMDetails = securedVMDetails; - return this; - } - - /** - * Get the targetDiskNetworkAccessSettings property: Specifies target network access settings for disks of VM to be - * restored,. - * - * @return the targetDiskNetworkAccessSettings value. - */ - public TargetDiskNetworkAccessSettings targetDiskNetworkAccessSettings() { - return this.targetDiskNetworkAccessSettings; - } - - /** - * Set the targetDiskNetworkAccessSettings property: Specifies target network access settings for disks of VM to be - * restored,. - * - * @param targetDiskNetworkAccessSettings the targetDiskNetworkAccessSettings value to set. - * @return the IaasVMRestoreRequest object itself. - */ - public IaasVMRestoreRequest - withTargetDiskNetworkAccessSettings(TargetDiskNetworkAccessSettings targetDiskNetworkAccessSettings) { - this.targetDiskNetworkAccessSettings = targetDiskNetworkAccessSettings; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreRequest withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("recoveryPointId", this.recoveryPointId); - jsonWriter.writeStringField("recoveryType", this.recoveryType == null ? null : this.recoveryType.toString()); - jsonWriter.writeStringField("sourceResourceId", this.sourceResourceId); - jsonWriter.writeStringField("targetVirtualMachineId", this.targetVirtualMachineId); - jsonWriter.writeStringField("targetResourceGroupId", this.targetResourceGroupId); - jsonWriter.writeStringField("storageAccountId", this.storageAccountId); - jsonWriter.writeStringField("virtualNetworkId", this.virtualNetworkId); - jsonWriter.writeStringField("subnetId", this.subnetId); - jsonWriter.writeStringField("targetDomainNameId", this.targetDomainNameId); - jsonWriter.writeStringField("region", this.region); - jsonWriter.writeStringField("affinityGroup", this.affinityGroup); - jsonWriter.writeBooleanField("createNewCloudService", this.createNewCloudService); - jsonWriter.writeBooleanField("originalStorageAccountOption", this.originalStorageAccountOption); - jsonWriter.writeJsonField("encryptionDetails", this.encryptionDetails); - jsonWriter.writeArrayField("restoreDiskLunList", this.restoreDiskLunList, - (writer, element) -> writer.writeInt(element)); - jsonWriter.writeBooleanField("restoreWithManagedDisks", this.restoreWithManagedDisks); - jsonWriter.writeStringField("diskEncryptionSetId", this.diskEncryptionSetId); - jsonWriter.writeArrayField("zones", this.zones, (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("identityInfo", this.identityInfo); - jsonWriter.writeJsonField("identityBasedRestoreDetails", this.identityBasedRestoreDetails); - jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); - jsonWriter.writeJsonField("securedVMDetails", this.securedVMDetails); - jsonWriter.writeJsonField("targetDiskNetworkAccessSettings", this.targetDiskNetworkAccessSettings); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IaasVMRestoreRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IaasVMRestoreRequest 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 IaasVMRestoreRequest. - */ - public static IaasVMRestoreRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("IaasVMRestoreWithRehydrationRequest".equals(discriminatorValue)) { - return IaasVMRestoreWithRehydrationRequest.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static IaasVMRestoreRequest fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IaasVMRestoreRequest deserializedIaasVMRestoreRequest = new IaasVMRestoreRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedIaasVMRestoreRequest.withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("objectType".equals(fieldName)) { - deserializedIaasVMRestoreRequest.objectType = reader.getString(); - } else if ("recoveryPointId".equals(fieldName)) { - deserializedIaasVMRestoreRequest.recoveryPointId = reader.getString(); - } else if ("recoveryType".equals(fieldName)) { - deserializedIaasVMRestoreRequest.recoveryType = RecoveryType.fromString(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedIaasVMRestoreRequest.sourceResourceId = reader.getString(); - } else if ("targetVirtualMachineId".equals(fieldName)) { - deserializedIaasVMRestoreRequest.targetVirtualMachineId = reader.getString(); - } else if ("targetResourceGroupId".equals(fieldName)) { - deserializedIaasVMRestoreRequest.targetResourceGroupId = reader.getString(); - } else if ("storageAccountId".equals(fieldName)) { - deserializedIaasVMRestoreRequest.storageAccountId = reader.getString(); - } else if ("virtualNetworkId".equals(fieldName)) { - deserializedIaasVMRestoreRequest.virtualNetworkId = reader.getString(); - } else if ("subnetId".equals(fieldName)) { - deserializedIaasVMRestoreRequest.subnetId = reader.getString(); - } else if ("targetDomainNameId".equals(fieldName)) { - deserializedIaasVMRestoreRequest.targetDomainNameId = reader.getString(); - } else if ("region".equals(fieldName)) { - deserializedIaasVMRestoreRequest.region = reader.getString(); - } else if ("affinityGroup".equals(fieldName)) { - deserializedIaasVMRestoreRequest.affinityGroup = reader.getString(); - } else if ("createNewCloudService".equals(fieldName)) { - deserializedIaasVMRestoreRequest.createNewCloudService = reader.getNullable(JsonReader::getBoolean); - } else if ("originalStorageAccountOption".equals(fieldName)) { - deserializedIaasVMRestoreRequest.originalStorageAccountOption - = reader.getNullable(JsonReader::getBoolean); - } else if ("encryptionDetails".equals(fieldName)) { - deserializedIaasVMRestoreRequest.encryptionDetails = EncryptionDetails.fromJson(reader); - } else if ("restoreDiskLunList".equals(fieldName)) { - List restoreDiskLunList = reader.readArray(reader1 -> reader1.getInt()); - deserializedIaasVMRestoreRequest.restoreDiskLunList = restoreDiskLunList; - } else if ("restoreWithManagedDisks".equals(fieldName)) { - deserializedIaasVMRestoreRequest.restoreWithManagedDisks - = reader.getNullable(JsonReader::getBoolean); - } else if ("diskEncryptionSetId".equals(fieldName)) { - deserializedIaasVMRestoreRequest.diskEncryptionSetId = reader.getString(); - } else if ("zones".equals(fieldName)) { - List zones = reader.readArray(reader1 -> reader1.getString()); - deserializedIaasVMRestoreRequest.zones = zones; - } else if ("identityInfo".equals(fieldName)) { - deserializedIaasVMRestoreRequest.identityInfo = IdentityInfo.fromJson(reader); - } else if ("identityBasedRestoreDetails".equals(fieldName)) { - deserializedIaasVMRestoreRequest.identityBasedRestoreDetails - = IdentityBasedRestoreDetails.fromJson(reader); - } else if ("extendedLocation".equals(fieldName)) { - deserializedIaasVMRestoreRequest.extendedLocation = ExtendedLocation.fromJson(reader); - } else if ("securedVMDetails".equals(fieldName)) { - deserializedIaasVMRestoreRequest.securedVMDetails = SecuredVMDetails.fromJson(reader); - } else if ("targetDiskNetworkAccessSettings".equals(fieldName)) { - deserializedIaasVMRestoreRequest.targetDiskNetworkAccessSettings - = TargetDiskNetworkAccessSettings.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedIaasVMRestoreRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreWithRehydrationRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreWithRehydrationRequest.java deleted file mode 100644 index 4f419f730b26..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMRestoreWithRehydrationRequest.java +++ /dev/null @@ -1,414 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * IaaS VM workload-specific restore with integrated rehydration of recovery point. - */ -@Fluent -public final class IaasVMRestoreWithRehydrationRequest extends IaasVMRestoreRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "IaasVMRestoreWithRehydrationRequest"; - - /* - * RP Rehydration Info - */ - private RecoveryPointRehydrationInfo recoveryPointRehydrationInfo; - - /** - * Creates an instance of IaasVMRestoreWithRehydrationRequest class. - */ - public IaasVMRestoreWithRehydrationRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the recoveryPointRehydrationInfo property: RP Rehydration Info. - * - * @return the recoveryPointRehydrationInfo value. - */ - public RecoveryPointRehydrationInfo recoveryPointRehydrationInfo() { - return this.recoveryPointRehydrationInfo; - } - - /** - * Set the recoveryPointRehydrationInfo property: RP Rehydration Info. - * - * @param recoveryPointRehydrationInfo the recoveryPointRehydrationInfo value to set. - * @return the IaasVMRestoreWithRehydrationRequest object itself. - */ - public IaasVMRestoreWithRehydrationRequest - withRecoveryPointRehydrationInfo(RecoveryPointRehydrationInfo recoveryPointRehydrationInfo) { - this.recoveryPointRehydrationInfo = recoveryPointRehydrationInfo; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest withRecoveryPointId(String recoveryPointId) { - super.withRecoveryPointId(recoveryPointId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest withRecoveryType(RecoveryType recoveryType) { - super.withRecoveryType(recoveryType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest withTargetVirtualMachineId(String targetVirtualMachineId) { - super.withTargetVirtualMachineId(targetVirtualMachineId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest withTargetResourceGroupId(String targetResourceGroupId) { - super.withTargetResourceGroupId(targetResourceGroupId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest withStorageAccountId(String storageAccountId) { - super.withStorageAccountId(storageAccountId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest withVirtualNetworkId(String virtualNetworkId) { - super.withVirtualNetworkId(virtualNetworkId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest withSubnetId(String subnetId) { - super.withSubnetId(subnetId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest withTargetDomainNameId(String targetDomainNameId) { - super.withTargetDomainNameId(targetDomainNameId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest withRegion(String region) { - super.withRegion(region); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest withAffinityGroup(String affinityGroup) { - super.withAffinityGroup(affinityGroup); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest withCreateNewCloudService(Boolean createNewCloudService) { - super.withCreateNewCloudService(createNewCloudService); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest withOriginalStorageAccountOption(Boolean originalStorageAccountOption) { - super.withOriginalStorageAccountOption(originalStorageAccountOption); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest withEncryptionDetails(EncryptionDetails encryptionDetails) { - super.withEncryptionDetails(encryptionDetails); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest withRestoreDiskLunList(List restoreDiskLunList) { - super.withRestoreDiskLunList(restoreDiskLunList); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest withRestoreWithManagedDisks(Boolean restoreWithManagedDisks) { - super.withRestoreWithManagedDisks(restoreWithManagedDisks); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest withDiskEncryptionSetId(String diskEncryptionSetId) { - super.withDiskEncryptionSetId(diskEncryptionSetId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest withZones(List zones) { - super.withZones(zones); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest withIdentityInfo(IdentityInfo identityInfo) { - super.withIdentityInfo(identityInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest - withIdentityBasedRestoreDetails(IdentityBasedRestoreDetails identityBasedRestoreDetails) { - super.withIdentityBasedRestoreDetails(identityBasedRestoreDetails); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest withExtendedLocation(ExtendedLocation extendedLocation) { - super.withExtendedLocation(extendedLocation); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest withSecuredVMDetails(SecuredVMDetails securedVMDetails) { - super.withSecuredVMDetails(securedVMDetails); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest - withTargetDiskNetworkAccessSettings(TargetDiskNetworkAccessSettings targetDiskNetworkAccessSettings) { - super.withTargetDiskNetworkAccessSettings(targetDiskNetworkAccessSettings); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public IaasVMRestoreWithRehydrationRequest - withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("recoveryPointId", recoveryPointId()); - jsonWriter.writeStringField("recoveryType", recoveryType() == null ? null : recoveryType().toString()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("targetVirtualMachineId", targetVirtualMachineId()); - jsonWriter.writeStringField("targetResourceGroupId", targetResourceGroupId()); - jsonWriter.writeStringField("storageAccountId", storageAccountId()); - jsonWriter.writeStringField("virtualNetworkId", virtualNetworkId()); - jsonWriter.writeStringField("subnetId", subnetId()); - jsonWriter.writeStringField("targetDomainNameId", targetDomainNameId()); - jsonWriter.writeStringField("region", region()); - jsonWriter.writeStringField("affinityGroup", affinityGroup()); - jsonWriter.writeBooleanField("createNewCloudService", createNewCloudService()); - jsonWriter.writeBooleanField("originalStorageAccountOption", originalStorageAccountOption()); - jsonWriter.writeJsonField("encryptionDetails", encryptionDetails()); - jsonWriter.writeArrayField("restoreDiskLunList", restoreDiskLunList(), - (writer, element) -> writer.writeInt(element)); - jsonWriter.writeBooleanField("restoreWithManagedDisks", restoreWithManagedDisks()); - jsonWriter.writeStringField("diskEncryptionSetId", diskEncryptionSetId()); - jsonWriter.writeArrayField("zones", zones(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("identityInfo", identityInfo()); - jsonWriter.writeJsonField("identityBasedRestoreDetails", identityBasedRestoreDetails()); - jsonWriter.writeJsonField("extendedLocation", extendedLocation()); - jsonWriter.writeJsonField("securedVMDetails", securedVMDetails()); - jsonWriter.writeJsonField("targetDiskNetworkAccessSettings", targetDiskNetworkAccessSettings()); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeJsonField("recoveryPointRehydrationInfo", this.recoveryPointRehydrationInfo); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IaasVMRestoreWithRehydrationRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IaasVMRestoreWithRehydrationRequest 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 IaasVMRestoreWithRehydrationRequest. - */ - public static IaasVMRestoreWithRehydrationRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IaasVMRestoreWithRehydrationRequest deserializedIaasVMRestoreWithRehydrationRequest - = new IaasVMRestoreWithRehydrationRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedIaasVMRestoreWithRehydrationRequest - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("recoveryPointId".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest.withRecoveryPointId(reader.getString()); - } else if ("recoveryType".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest - .withRecoveryType(RecoveryType.fromString(reader.getString())); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest.withSourceResourceId(reader.getString()); - } else if ("targetVirtualMachineId".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest.withTargetVirtualMachineId(reader.getString()); - } else if ("targetResourceGroupId".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest.withTargetResourceGroupId(reader.getString()); - } else if ("storageAccountId".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest.withStorageAccountId(reader.getString()); - } else if ("virtualNetworkId".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest.withVirtualNetworkId(reader.getString()); - } else if ("subnetId".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest.withSubnetId(reader.getString()); - } else if ("targetDomainNameId".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest.withTargetDomainNameId(reader.getString()); - } else if ("region".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest.withRegion(reader.getString()); - } else if ("affinityGroup".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest.withAffinityGroup(reader.getString()); - } else if ("createNewCloudService".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest - .withCreateNewCloudService(reader.getNullable(JsonReader::getBoolean)); - } else if ("originalStorageAccountOption".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest - .withOriginalStorageAccountOption(reader.getNullable(JsonReader::getBoolean)); - } else if ("encryptionDetails".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest - .withEncryptionDetails(EncryptionDetails.fromJson(reader)); - } else if ("restoreDiskLunList".equals(fieldName)) { - List restoreDiskLunList = reader.readArray(reader1 -> reader1.getInt()); - deserializedIaasVMRestoreWithRehydrationRequest.withRestoreDiskLunList(restoreDiskLunList); - } else if ("restoreWithManagedDisks".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest - .withRestoreWithManagedDisks(reader.getNullable(JsonReader::getBoolean)); - } else if ("diskEncryptionSetId".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest.withDiskEncryptionSetId(reader.getString()); - } else if ("zones".equals(fieldName)) { - List zones = reader.readArray(reader1 -> reader1.getString()); - deserializedIaasVMRestoreWithRehydrationRequest.withZones(zones); - } else if ("identityInfo".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest.withIdentityInfo(IdentityInfo.fromJson(reader)); - } else if ("identityBasedRestoreDetails".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest - .withIdentityBasedRestoreDetails(IdentityBasedRestoreDetails.fromJson(reader)); - } else if ("extendedLocation".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest - .withExtendedLocation(ExtendedLocation.fromJson(reader)); - } else if ("securedVMDetails".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest - .withSecuredVMDetails(SecuredVMDetails.fromJson(reader)); - } else if ("targetDiskNetworkAccessSettings".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest - .withTargetDiskNetworkAccessSettings(TargetDiskNetworkAccessSettings.fromJson(reader)); - } else if ("objectType".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest.objectType = reader.getString(); - } else if ("recoveryPointRehydrationInfo".equals(fieldName)) { - deserializedIaasVMRestoreWithRehydrationRequest.recoveryPointRehydrationInfo - = RecoveryPointRehydrationInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedIaasVMRestoreWithRehydrationRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMSnapshotConsistencyType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMSnapshotConsistencyType.java deleted file mode 100644 index a332fa1d0ce1..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVMSnapshotConsistencyType.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for IaasVMSnapshotConsistencyType. - */ -public final class IaasVMSnapshotConsistencyType extends ExpandableStringEnum { - /** - * Static value OnlyCrashConsistent for IaasVMSnapshotConsistencyType. - */ - public static final IaasVMSnapshotConsistencyType ONLY_CRASH_CONSISTENT = fromString("OnlyCrashConsistent"); - - /** - * Creates a new instance of IaasVMSnapshotConsistencyType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public IaasVMSnapshotConsistencyType() { - } - - /** - * Creates or finds a IaasVMSnapshotConsistencyType from its string representation. - * - * @param name a name to look for. - * @return the corresponding IaasVMSnapshotConsistencyType. - */ - public static IaasVMSnapshotConsistencyType fromString(String name) { - return fromString(name, IaasVMSnapshotConsistencyType.class); - } - - /** - * Gets known IaasVMSnapshotConsistencyType values. - * - * @return known IaasVMSnapshotConsistencyType values. - */ - public static Collection values() { - return values(IaasVMSnapshotConsistencyType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVmProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVmProtectableItem.java deleted file mode 100644 index ed4fa63ff6a1..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVmProtectableItem.java +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * IaaS VM workload-specific backup item. - */ -@Immutable -public class IaasVmProtectableItem extends WorkloadProtectableItem { - /* - * Type of the backup item. - */ - private String protectableItemType = "IaaSVMProtectableItem"; - - /* - * Fully qualified ARM ID of the virtual machine. - */ - private String virtualMachineId; - - /* - * Specifies whether the container represents a Classic or an Azure Resource Manager VM. - */ - private String virtualMachineVersion; - - /* - * Resource group name of Recovery Services Vault. - */ - private String resourceGroup; - - /** - * Creates an instance of IaasVmProtectableItem class. - */ - protected IaasVmProtectableItem() { - } - - /** - * Get the protectableItemType property: Type of the backup item. - * - * @return the protectableItemType value. - */ - @Override - public String protectableItemType() { - return this.protectableItemType; - } - - /** - * Get the virtualMachineId property: Fully qualified ARM ID of the virtual machine. - * - * @return the virtualMachineId value. - */ - public String virtualMachineId() { - return this.virtualMachineId; - } - - /** - * Set the virtualMachineId property: Fully qualified ARM ID of the virtual machine. - * - * @param virtualMachineId the virtualMachineId value to set. - * @return the IaasVmProtectableItem object itself. - */ - IaasVmProtectableItem withVirtualMachineId(String virtualMachineId) { - this.virtualMachineId = virtualMachineId; - return this; - } - - /** - * Get the virtualMachineVersion property: Specifies whether the container represents a Classic or an Azure Resource - * Manager VM. - * - * @return the virtualMachineVersion value. - */ - public String virtualMachineVersion() { - return this.virtualMachineVersion; - } - - /** - * Set the virtualMachineVersion property: Specifies whether the container represents a Classic or an Azure Resource - * Manager VM. - * - * @param virtualMachineVersion the virtualMachineVersion value to set. - * @return the IaasVmProtectableItem object itself. - */ - IaasVmProtectableItem withVirtualMachineVersion(String virtualMachineVersion) { - this.virtualMachineVersion = virtualMachineVersion; - return this; - } - - /** - * Get the resourceGroup property: Resource group name of Recovery Services Vault. - * - * @return the resourceGroup value. - */ - public String resourceGroup() { - return this.resourceGroup; - } - - /** - * Set the resourceGroup property: Resource group name of Recovery Services Vault. - * - * @param resourceGroup the resourceGroup value to set. - * @return the IaasVmProtectableItem object itself. - */ - IaasVmProtectableItem withResourceGroup(String resourceGroup) { - this.resourceGroup = resourceGroup; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", backupManagementType()); - jsonWriter.writeStringField("workloadType", workloadType()); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("protectionState", protectionState() == null ? null : protectionState().toString()); - jsonWriter.writeStringField("protectableItemType", this.protectableItemType); - jsonWriter.writeStringField("virtualMachineId", this.virtualMachineId); - jsonWriter.writeStringField("virtualMachineVersion", this.virtualMachineVersion); - jsonWriter.writeStringField("resourceGroup", this.resourceGroup); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IaasVmProtectableItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IaasVmProtectableItem 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 IaasVmProtectableItem. - */ - public static IaasVmProtectableItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("protectableItemType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("Microsoft.Compute/virtualMachines".equals(discriminatorValue)) { - return AzureIaaSComputeVMProtectableItem.fromJson(readerToUse.reset()); - } else if ("Microsoft.ClassicCompute/virtualMachines".equals(discriminatorValue)) { - return AzureIaaSClassicComputeVMProtectableItem.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static IaasVmProtectableItem fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IaasVmProtectableItem deserializedIaasVmProtectableItem = new IaasVmProtectableItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedIaasVmProtectableItem.withBackupManagementType(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedIaasVmProtectableItem.withWorkloadType(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedIaasVmProtectableItem.withFriendlyName(reader.getString()); - } else if ("protectionState".equals(fieldName)) { - deserializedIaasVmProtectableItem - .withProtectionState(ProtectionStatus.fromString(reader.getString())); - } else if ("protectableItemType".equals(fieldName)) { - deserializedIaasVmProtectableItem.protectableItemType = reader.getString(); - } else if ("virtualMachineId".equals(fieldName)) { - deserializedIaasVmProtectableItem.virtualMachineId = reader.getString(); - } else if ("virtualMachineVersion".equals(fieldName)) { - deserializedIaasVmProtectableItem.virtualMachineVersion = reader.getString(); - } else if ("resourceGroup".equals(fieldName)) { - deserializedIaasVmProtectableItem.resourceGroup = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedIaasVmProtectableItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVmilrRegistrationRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVmilrRegistrationRequest.java deleted file mode 100644 index 6c24d3272bfd..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasVmilrRegistrationRequest.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Restore files/folders from a backup copy of IaaS VM. - */ -@Fluent -public final class IaasVmilrRegistrationRequest extends IlrRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "IaasVMILRRegistrationRequest"; - - /* - * ID of the IaaS VM backup copy from where the files/folders have to be restored. - */ - private String recoveryPointId; - - /* - * Fully qualified ARM ID of the virtual machine whose the files / folders have to be restored. - */ - private String virtualMachineId; - - /* - * iSCSI initiator name. - */ - private String initiatorName; - - /* - * Whether to renew existing registration with the iSCSI server. - */ - private Boolean renewExistingRegistration; - - /** - * Creates an instance of IaasVmilrRegistrationRequest class. - */ - public IaasVmilrRegistrationRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the recoveryPointId property: ID of the IaaS VM backup copy from where the files/folders have to be restored. - * - * @return the recoveryPointId value. - */ - public String recoveryPointId() { - return this.recoveryPointId; - } - - /** - * Set the recoveryPointId property: ID of the IaaS VM backup copy from where the files/folders have to be restored. - * - * @param recoveryPointId the recoveryPointId value to set. - * @return the IaasVmilrRegistrationRequest object itself. - */ - public IaasVmilrRegistrationRequest withRecoveryPointId(String recoveryPointId) { - this.recoveryPointId = recoveryPointId; - return this; - } - - /** - * Get the virtualMachineId property: Fully qualified ARM ID of the virtual machine whose the files / folders have - * to be restored. - * - * @return the virtualMachineId value. - */ - public String virtualMachineId() { - return this.virtualMachineId; - } - - /** - * Set the virtualMachineId property: Fully qualified ARM ID of the virtual machine whose the files / folders have - * to be restored. - * - * @param virtualMachineId the virtualMachineId value to set. - * @return the IaasVmilrRegistrationRequest object itself. - */ - public IaasVmilrRegistrationRequest withVirtualMachineId(String virtualMachineId) { - this.virtualMachineId = virtualMachineId; - return this; - } - - /** - * Get the initiatorName property: iSCSI initiator name. - * - * @return the initiatorName value. - */ - public String initiatorName() { - return this.initiatorName; - } - - /** - * Set the initiatorName property: iSCSI initiator name. - * - * @param initiatorName the initiatorName value to set. - * @return the IaasVmilrRegistrationRequest object itself. - */ - public IaasVmilrRegistrationRequest withInitiatorName(String initiatorName) { - this.initiatorName = initiatorName; - return this; - } - - /** - * Get the renewExistingRegistration property: Whether to renew existing registration with the iSCSI server. - * - * @return the renewExistingRegistration value. - */ - public Boolean renewExistingRegistration() { - return this.renewExistingRegistration; - } - - /** - * Set the renewExistingRegistration property: Whether to renew existing registration with the iSCSI server. - * - * @param renewExistingRegistration the renewExistingRegistration value to set. - * @return the IaasVmilrRegistrationRequest object itself. - */ - public IaasVmilrRegistrationRequest withRenewExistingRegistration(Boolean renewExistingRegistration) { - this.renewExistingRegistration = renewExistingRegistration; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("recoveryPointId", this.recoveryPointId); - jsonWriter.writeStringField("virtualMachineId", this.virtualMachineId); - jsonWriter.writeStringField("initiatorName", this.initiatorName); - jsonWriter.writeBooleanField("renewExistingRegistration", this.renewExistingRegistration); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IaasVmilrRegistrationRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IaasVmilrRegistrationRequest 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 IaasVmilrRegistrationRequest. - */ - public static IaasVmilrRegistrationRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IaasVmilrRegistrationRequest deserializedIaasVmilrRegistrationRequest = new IaasVmilrRegistrationRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedIaasVmilrRegistrationRequest.objectType = reader.getString(); - } else if ("recoveryPointId".equals(fieldName)) { - deserializedIaasVmilrRegistrationRequest.recoveryPointId = reader.getString(); - } else if ("virtualMachineId".equals(fieldName)) { - deserializedIaasVmilrRegistrationRequest.virtualMachineId = reader.getString(); - } else if ("initiatorName".equals(fieldName)) { - deserializedIaasVmilrRegistrationRequest.initiatorName = reader.getString(); - } else if ("renewExistingRegistration".equals(fieldName)) { - deserializedIaasVmilrRegistrationRequest.renewExistingRegistration - = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedIaasVmilrRegistrationRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasvmPolicyType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasvmPolicyType.java deleted file mode 100644 index b85be2f529d5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IaasvmPolicyType.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for IaasvmPolicyType. - */ -public final class IaasvmPolicyType extends ExpandableStringEnum { - /** - * Static value Invalid for IaasvmPolicyType. - */ - public static final IaasvmPolicyType INVALID = fromString("Invalid"); - - /** - * Static value V1 for IaasvmPolicyType. - */ - public static final IaasvmPolicyType V1 = fromString("V1"); - - /** - * Static value V2 for IaasvmPolicyType. - */ - public static final IaasvmPolicyType V2 = fromString("V2"); - - /** - * Creates a new instance of IaasvmPolicyType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public IaasvmPolicyType() { - } - - /** - * Creates or finds a IaasvmPolicyType from its string representation. - * - * @param name a name to look for. - * @return the corresponding IaasvmPolicyType. - */ - public static IaasvmPolicyType fromString(String name) { - return fromString(name, IaasvmPolicyType.class); - } - - /** - * Gets known IaasvmPolicyType values. - * - * @return known IaasvmPolicyType values. - */ - public static Collection values() { - return values(IaasvmPolicyType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IdentityBasedRestoreDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IdentityBasedRestoreDetails.java deleted file mode 100644 index f8e8446d872a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IdentityBasedRestoreDetails.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * IaaS VM workload specific restore details for restores using managed identity. - */ -@Fluent -public final class IdentityBasedRestoreDetails implements JsonSerializable { - /* - * Gets the class type. - */ - private String objectType; - - /* - * Fully qualified ARM ID of the target storage account. - */ - private String targetStorageAccountId; - - /** - * Creates an instance of IdentityBasedRestoreDetails class. - */ - public IdentityBasedRestoreDetails() { - } - - /** - * Get the objectType property: Gets the class type. - * - * @return the objectType value. - */ - public String objectType() { - return this.objectType; - } - - /** - * Set the objectType property: Gets the class type. - * - * @param objectType the objectType value to set. - * @return the IdentityBasedRestoreDetails object itself. - */ - public IdentityBasedRestoreDetails withObjectType(String objectType) { - this.objectType = objectType; - return this; - } - - /** - * Get the targetStorageAccountId property: Fully qualified ARM ID of the target storage account. - * - * @return the targetStorageAccountId value. - */ - public String targetStorageAccountId() { - return this.targetStorageAccountId; - } - - /** - * Set the targetStorageAccountId property: Fully qualified ARM ID of the target storage account. - * - * @param targetStorageAccountId the targetStorageAccountId value to set. - * @return the IdentityBasedRestoreDetails object itself. - */ - public IdentityBasedRestoreDetails withTargetStorageAccountId(String targetStorageAccountId) { - this.targetStorageAccountId = targetStorageAccountId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("targetStorageAccountId", this.targetStorageAccountId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IdentityBasedRestoreDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IdentityBasedRestoreDetails 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 IdentityBasedRestoreDetails. - */ - public static IdentityBasedRestoreDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IdentityBasedRestoreDetails deserializedIdentityBasedRestoreDetails = new IdentityBasedRestoreDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedIdentityBasedRestoreDetails.objectType = reader.getString(); - } else if ("targetStorageAccountId".equals(fieldName)) { - deserializedIdentityBasedRestoreDetails.targetStorageAccountId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedIdentityBasedRestoreDetails; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IdentityInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IdentityInfo.java deleted file mode 100644 index c351f0ef4410..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IdentityInfo.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Encapsulates Managed Identity related information. - */ -@Fluent -public final class IdentityInfo implements JsonSerializable { - /* - * To differentiate if the managed identity is system assigned or user assigned - */ - private Boolean isSystemAssignedIdentity; - - /* - * Managed Identity Resource Id - * Optional: Might not be required in the case of system assigned managed identity - */ - private String managedIdentityResourceId; - - /** - * Creates an instance of IdentityInfo class. - */ - public IdentityInfo() { - } - - /** - * Get the isSystemAssignedIdentity property: To differentiate if the managed identity is system assigned or user - * assigned. - * - * @return the isSystemAssignedIdentity value. - */ - public Boolean isSystemAssignedIdentity() { - return this.isSystemAssignedIdentity; - } - - /** - * Set the isSystemAssignedIdentity property: To differentiate if the managed identity is system assigned or user - * assigned. - * - * @param isSystemAssignedIdentity the isSystemAssignedIdentity value to set. - * @return the IdentityInfo object itself. - */ - public IdentityInfo withIsSystemAssignedIdentity(Boolean isSystemAssignedIdentity) { - this.isSystemAssignedIdentity = isSystemAssignedIdentity; - return this; - } - - /** - * Get the managedIdentityResourceId property: Managed Identity Resource Id - * Optional: Might not be required in the case of system assigned managed identity. - * - * @return the managedIdentityResourceId value. - */ - public String managedIdentityResourceId() { - return this.managedIdentityResourceId; - } - - /** - * Set the managedIdentityResourceId property: Managed Identity Resource Id - * Optional: Might not be required in the case of system assigned managed identity. - * - * @param managedIdentityResourceId the managedIdentityResourceId value to set. - * @return the IdentityInfo object itself. - */ - public IdentityInfo withManagedIdentityResourceId(String managedIdentityResourceId) { - this.managedIdentityResourceId = managedIdentityResourceId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("isSystemAssignedIdentity", this.isSystemAssignedIdentity); - jsonWriter.writeStringField("managedIdentityResourceId", this.managedIdentityResourceId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IdentityInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IdentityInfo 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 IdentityInfo. - */ - public static IdentityInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IdentityInfo deserializedIdentityInfo = new IdentityInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("isSystemAssignedIdentity".equals(fieldName)) { - deserializedIdentityInfo.isSystemAssignedIdentity = reader.getNullable(JsonReader::getBoolean); - } else if ("managedIdentityResourceId".equals(fieldName)) { - deserializedIdentityInfo.managedIdentityResourceId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedIdentityInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IlrRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IlrRequest.java deleted file mode 100644 index e5f7e36ffc28..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IlrRequest.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Parameters to Provision ILR API. - */ -@Immutable -public class IlrRequest implements JsonSerializable { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "IlrRequest"; - - /** - * Creates an instance of IlrRequest class. - */ - public IlrRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - public String objectType() { - return this.objectType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IlrRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IlrRequest 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 IlrRequest. - */ - public static IlrRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureFileShareProvisionILRRequest".equals(discriminatorValue)) { - return AzureFileShareProvisionIlrRequest.fromJson(readerToUse.reset()); - } else if ("IaasVMILRRegistrationRequest".equals(discriminatorValue)) { - return IaasVmilrRegistrationRequest.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static IlrRequest fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IlrRequest deserializedIlrRequest = new IlrRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedIlrRequest.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedIlrRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IlrRequestResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IlrRequestResource.java deleted file mode 100644 index 877516d79e5a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/IlrRequestResource.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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 java.io.IOException; -import java.util.Map; - -/** - * Parameters to Provision ILR API. - */ -@Fluent -public final class IlrRequestResource extends ProxyResource { - /* - * Resource location. - */ - private String location; - - /* - * Resource tags. - */ - private Map tags; - - /* - * Optional ETag. - */ - private String eTag; - - /* - * ILRRequestResource properties - */ - private IlrRequest 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 IlrRequestResource class. - */ - public IlrRequestResource() { - } - - /** - * Get the location property: Resource location. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Resource location. - * - * @param location the location value to set. - * @return the IlrRequestResource object itself. - */ - public IlrRequestResource withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the IlrRequestResource object itself. - */ - public IlrRequestResource withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the eTag property: Optional ETag. - * - * @return the eTag value. - */ - public String eTag() { - return this.eTag; - } - - /** - * Set the eTag property: Optional ETag. - * - * @param eTag the eTag value to set. - * @return the IlrRequestResource object itself. - */ - public IlrRequestResource withETag(String eTag) { - this.eTag = eTag; - return this; - } - - /** - * Get the properties property: ILRRequestResource properties. - * - * @return the properties value. - */ - public IlrRequest properties() { - return this.properties; - } - - /** - * Set the properties property: ILRRequestResource properties. - * - * @param properties the properties value to set. - * @return the IlrRequestResource object itself. - */ - public IlrRequestResource withProperties(IlrRequest properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("eTag", this.eTag); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IlrRequestResource from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IlrRequestResource 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 IlrRequestResource. - */ - public static IlrRequestResource fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IlrRequestResource deserializedIlrRequestResource = new IlrRequestResource(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedIlrRequestResource.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedIlrRequestResource.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedIlrRequestResource.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedIlrRequestResource.location = reader.getString(); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedIlrRequestResource.tags = tags; - } else if ("eTag".equals(fieldName)) { - deserializedIlrRequestResource.eTag = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedIlrRequestResource.properties = IlrRequest.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedIlrRequestResource.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedIlrRequestResource; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InfrastructureEncryptionState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InfrastructureEncryptionState.java deleted file mode 100644 index 2ee2d039fb8f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InfrastructureEncryptionState.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for InfrastructureEncryptionState. - */ -public final class InfrastructureEncryptionState extends ExpandableStringEnum { - /** - * Static value Invalid for InfrastructureEncryptionState. - */ - public static final InfrastructureEncryptionState INVALID = fromString("Invalid"); - - /** - * Static value Disabled for InfrastructureEncryptionState. - */ - public static final InfrastructureEncryptionState DISABLED = fromString("Disabled"); - - /** - * Static value Enabled for InfrastructureEncryptionState. - */ - public static final InfrastructureEncryptionState ENABLED = fromString("Enabled"); - - /** - * Creates a new instance of InfrastructureEncryptionState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public InfrastructureEncryptionState() { - } - - /** - * Creates or finds a InfrastructureEncryptionState from its string representation. - * - * @param name a name to look for. - * @return the corresponding InfrastructureEncryptionState. - */ - public static InfrastructureEncryptionState fromString(String name) { - return fromString(name, InfrastructureEncryptionState.class); - } - - /** - * Gets known InfrastructureEncryptionState values. - * - * @return known InfrastructureEncryptionState values. - */ - public static Collection values() { - return values(InfrastructureEncryptionState.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InquiryInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InquiryInfo.java deleted file mode 100644 index 4e21511c6bd1..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InquiryInfo.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Details about inquired protectable items under a given container. - */ -@Fluent -public final class InquiryInfo implements JsonSerializable { - /* - * Inquiry Status for this container such as - * InProgress | Failed | Succeeded - */ - private String status; - - /* - * Error Details if the Status is non-success. - */ - private ErrorDetail errorDetail; - - /* - * Inquiry Details which will have workload specific details. - * For e.g. - For SQL and oracle this will contain different details. - */ - private List inquiryDetails; - - /** - * Creates an instance of InquiryInfo class. - */ - public InquiryInfo() { - } - - /** - * Get the status property: Inquiry Status for this container such as - * InProgress | Failed | Succeeded. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: Inquiry Status for this container such as - * InProgress | Failed | Succeeded. - * - * @param status the status value to set. - * @return the InquiryInfo object itself. - */ - public InquiryInfo withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the errorDetail property: Error Details if the Status is non-success. - * - * @return the errorDetail value. - */ - public ErrorDetail errorDetail() { - return this.errorDetail; - } - - /** - * Set the errorDetail property: Error Details if the Status is non-success. - * - * @param errorDetail the errorDetail value to set. - * @return the InquiryInfo object itself. - */ - public InquiryInfo withErrorDetail(ErrorDetail errorDetail) { - this.errorDetail = errorDetail; - return this; - } - - /** - * Get the inquiryDetails property: Inquiry Details which will have workload specific details. - * For e.g. - For SQL and oracle this will contain different details. - * - * @return the inquiryDetails value. - */ - public List inquiryDetails() { - return this.inquiryDetails; - } - - /** - * Set the inquiryDetails property: Inquiry Details which will have workload specific details. - * For e.g. - For SQL and oracle this will contain different details. - * - * @param inquiryDetails the inquiryDetails value to set. - * @return the InquiryInfo object itself. - */ - public InquiryInfo withInquiryDetails(List inquiryDetails) { - this.inquiryDetails = inquiryDetails; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", this.status); - jsonWriter.writeJsonField("errorDetail", this.errorDetail); - jsonWriter.writeArrayField("inquiryDetails", this.inquiryDetails, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InquiryInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InquiryInfo 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 InquiryInfo. - */ - public static InquiryInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - InquiryInfo deserializedInquiryInfo = new InquiryInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedInquiryInfo.status = reader.getString(); - } else if ("errorDetail".equals(fieldName)) { - deserializedInquiryInfo.errorDetail = ErrorDetail.fromJson(reader); - } else if ("inquiryDetails".equals(fieldName)) { - List inquiryDetails - = reader.readArray(reader1 -> WorkloadInquiryDetails.fromJson(reader1)); - deserializedInquiryInfo.inquiryDetails = inquiryDetails; - } else { - reader.skipChildren(); - } - } - - return deserializedInquiryInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InquiryStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InquiryStatus.java deleted file mode 100644 index 7f1f8e4f9873..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InquiryStatus.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Status of protectable item, i.e. InProgress,Succeeded,Failed. - */ -public final class InquiryStatus extends ExpandableStringEnum { - /** - * Static value Invalid for InquiryStatus. - */ - public static final InquiryStatus INVALID = fromString("Invalid"); - - /** - * Static value Success for InquiryStatus. - */ - public static final InquiryStatus SUCCESS = fromString("Success"); - - /** - * Static value Failed for InquiryStatus. - */ - public static final InquiryStatus FAILED = fromString("Failed"); - - /** - * Creates a new instance of InquiryStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public InquiryStatus() { - } - - /** - * Creates or finds a InquiryStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding InquiryStatus. - */ - public static InquiryStatus fromString(String name) { - return fromString(name, InquiryStatus.class); - } - - /** - * Gets known InquiryStatus values. - * - * @return known InquiryStatus values. - */ - public static Collection values() { - return values(InquiryStatus.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InquiryValidation.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InquiryValidation.java deleted file mode 100644 index d660b3697d02..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InquiryValidation.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Validation for inquired protectable items under a given container. - */ -@Fluent -public final class InquiryValidation implements JsonSerializable { - /* - * Status for the Inquiry Validation. - */ - private String status; - - /* - * Error Detail in case the status is non-success. - */ - private ErrorDetail errorDetail; - - /* - * Error Additional Detail in case the status is non-success. - */ - private String additionalDetail; - - /* - * Dictionary to store the count of ProtectableItems with key POType. - */ - private Object protectableItemCount; - - /** - * Creates an instance of InquiryValidation class. - */ - public InquiryValidation() { - } - - /** - * Get the status property: Status for the Inquiry Validation. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: Status for the Inquiry Validation. - * - * @param status the status value to set. - * @return the InquiryValidation object itself. - */ - public InquiryValidation withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the errorDetail property: Error Detail in case the status is non-success. - * - * @return the errorDetail value. - */ - public ErrorDetail errorDetail() { - return this.errorDetail; - } - - /** - * Set the errorDetail property: Error Detail in case the status is non-success. - * - * @param errorDetail the errorDetail value to set. - * @return the InquiryValidation object itself. - */ - public InquiryValidation withErrorDetail(ErrorDetail errorDetail) { - this.errorDetail = errorDetail; - return this; - } - - /** - * Get the additionalDetail property: Error Additional Detail in case the status is non-success. - * - * @return the additionalDetail value. - */ - public String additionalDetail() { - return this.additionalDetail; - } - - /** - * Get the protectableItemCount property: Dictionary to store the count of ProtectableItems with key POType. - * - * @return the protectableItemCount value. - */ - public Object protectableItemCount() { - return this.protectableItemCount; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", this.status); - jsonWriter.writeJsonField("errorDetail", this.errorDetail); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InquiryValidation from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InquiryValidation 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 InquiryValidation. - */ - public static InquiryValidation fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - InquiryValidation deserializedInquiryValidation = new InquiryValidation(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedInquiryValidation.status = reader.getString(); - } else if ("errorDetail".equals(fieldName)) { - deserializedInquiryValidation.errorDetail = ErrorDetail.fromJson(reader); - } else if ("additionalDetail".equals(fieldName)) { - deserializedInquiryValidation.additionalDetail = reader.getString(); - } else if ("protectableItemCount".equals(fieldName)) { - deserializedInquiryValidation.protectableItemCount = reader.readUntyped(); - } else { - reader.skipChildren(); - } - } - - return deserializedInquiryValidation; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InstanceProtectionReadiness.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InstanceProtectionReadiness.java deleted file mode 100644 index 6b43efa5b74a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InstanceProtectionReadiness.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The state of instance protection. - */ -public final class InstanceProtectionReadiness extends ExpandableStringEnum { - /** - * Instance protection readiness is unknown. - */ - public static final InstanceProtectionReadiness UNKNOWN = fromString("Unknown"); - - /** - * Instance is ready for protection. - */ - public static final InstanceProtectionReadiness READY = fromString("Ready"); - - /** - * Backup schedule is disabled for this instance. - */ - public static final InstanceProtectionReadiness SCHEDULE_DISABLED = fromString("ScheduleDisabled"); - - /** - * Instance is partially protected. - */ - public static final InstanceProtectionReadiness PARTIAL_PROTECTION = fromString("PartialProtection"); - - /** - * Instance protection encountered an error. - */ - public static final InstanceProtectionReadiness PROTECTION_ERROR = fromString("ProtectionError"); - - /** - * Creates a new instance of InstanceProtectionReadiness value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public InstanceProtectionReadiness() { - } - - /** - * Creates or finds a InstanceProtectionReadiness from its string representation. - * - * @param name a name to look for. - * @return the corresponding InstanceProtectionReadiness. - */ - public static InstanceProtectionReadiness fromString(String name) { - return fromString(name, InstanceProtectionReadiness.class); - } - - /** - * Gets known InstanceProtectionReadiness values. - * - * @return known InstanceProtectionReadiness values. - */ - public static Collection values() { - return values(InstanceProtectionReadiness.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InstantItemRecoveryTarget.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InstantItemRecoveryTarget.java deleted file mode 100644 index 9e79d00d9d34..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InstantItemRecoveryTarget.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Target details for file / folder restore. - */ -@Immutable -public final class InstantItemRecoveryTarget implements JsonSerializable { - /* - * List of client scripts. - */ - private List clientScripts; - - /** - * Creates an instance of InstantItemRecoveryTarget class. - */ - private InstantItemRecoveryTarget() { - } - - /** - * Get the clientScripts property: List of client scripts. - * - * @return the clientScripts value. - */ - public List clientScripts() { - return this.clientScripts; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("clientScripts", this.clientScripts, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InstantItemRecoveryTarget from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InstantItemRecoveryTarget 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 InstantItemRecoveryTarget. - */ - public static InstantItemRecoveryTarget fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - InstantItemRecoveryTarget deserializedInstantItemRecoveryTarget = new InstantItemRecoveryTarget(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("clientScripts".equals(fieldName)) { - List clientScripts - = reader.readArray(reader1 -> ClientScriptForConnect.fromJson(reader1)); - deserializedInstantItemRecoveryTarget.clientScripts = clientScripts; - } else { - reader.skipChildren(); - } - } - - return deserializedInstantItemRecoveryTarget; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InstantRPAdditionalDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InstantRPAdditionalDetails.java deleted file mode 100644 index 067afcdd53f2..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/InstantRPAdditionalDetails.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The InstantRPAdditionalDetails model. - */ -@Fluent -public final class InstantRPAdditionalDetails implements JsonSerializable { - /* - * The azureBackupRGNamePrefix property. - */ - private String azureBackupRGNamePrefix; - - /* - * The azureBackupRGNameSuffix property. - */ - private String azureBackupRGNameSuffix; - - /** - * Creates an instance of InstantRPAdditionalDetails class. - */ - public InstantRPAdditionalDetails() { - } - - /** - * Get the azureBackupRGNamePrefix property: The azureBackupRGNamePrefix property. - * - * @return the azureBackupRGNamePrefix value. - */ - public String azureBackupRGNamePrefix() { - return this.azureBackupRGNamePrefix; - } - - /** - * Set the azureBackupRGNamePrefix property: The azureBackupRGNamePrefix property. - * - * @param azureBackupRGNamePrefix the azureBackupRGNamePrefix value to set. - * @return the InstantRPAdditionalDetails object itself. - */ - public InstantRPAdditionalDetails withAzureBackupRGNamePrefix(String azureBackupRGNamePrefix) { - this.azureBackupRGNamePrefix = azureBackupRGNamePrefix; - return this; - } - - /** - * Get the azureBackupRGNameSuffix property: The azureBackupRGNameSuffix property. - * - * @return the azureBackupRGNameSuffix value. - */ - public String azureBackupRGNameSuffix() { - return this.azureBackupRGNameSuffix; - } - - /** - * Set the azureBackupRGNameSuffix property: The azureBackupRGNameSuffix property. - * - * @param azureBackupRGNameSuffix the azureBackupRGNameSuffix value to set. - * @return the InstantRPAdditionalDetails object itself. - */ - public InstantRPAdditionalDetails withAzureBackupRGNameSuffix(String azureBackupRGNameSuffix) { - this.azureBackupRGNameSuffix = azureBackupRGNameSuffix; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("azureBackupRGNamePrefix", this.azureBackupRGNamePrefix); - jsonWriter.writeStringField("azureBackupRGNameSuffix", this.azureBackupRGNameSuffix); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InstantRPAdditionalDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InstantRPAdditionalDetails 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 InstantRPAdditionalDetails. - */ - public static InstantRPAdditionalDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - InstantRPAdditionalDetails deserializedInstantRPAdditionalDetails = new InstantRPAdditionalDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("azureBackupRGNamePrefix".equals(fieldName)) { - deserializedInstantRPAdditionalDetails.azureBackupRGNamePrefix = reader.getString(); - } else if ("azureBackupRGNameSuffix".equals(fieldName)) { - deserializedInstantRPAdditionalDetails.azureBackupRGNameSuffix = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedInstantRPAdditionalDetails; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ItemLevelRecoveryConnections.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ItemLevelRecoveryConnections.java deleted file mode 100644 index 4349fc2dd96a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ItemLevelRecoveryConnections.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ItemLevelRecoveryConnections. - */ -public interface ItemLevelRecoveryConnections { - /** - * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a file - * explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status - * of - * provisioning, call GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource ILR request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response provisionWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId, IlrRequestResource parameters, - Context context); - - /** - * Provisions a script which invokes an iSCSI connection to the backup data. Executing this script opens a file - * explorer displaying all the recoverable files and folders. This is an asynchronous operation. To know the status - * of - * provisioning, call GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource ILR request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void provision(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, IlrRequestResource parameters); - - /** - * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer - * displaying all recoverable files and folders. This is an asynchronous operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response revokeWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId, Context context); - - /** - * Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer - * displaying all recoverable files and folders. This is an asynchronous operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void revoke(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Job.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Job.java deleted file mode 100644 index 5e82a6e45c92..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Job.java +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Defines workload agnostic properties for a job. - */ -@Immutable -public class Job implements JsonSerializable { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String jobType = "Job"; - - /* - * Friendly name of the entity on which the current job is executing. - */ - private String entityFriendlyName; - - /* - * Backup management type to execute the current job. - */ - private BackupManagementType backupManagementType; - - /* - * The operation name. - */ - private String operation; - - /* - * Job status. - */ - private String status; - - /* - * The start time. - */ - private OffsetDateTime startTime; - - /* - * The end time. - */ - private OffsetDateTime endTime; - - /* - * ActivityId of job. - */ - private String activityId; - - /** - * Creates an instance of Job class. - */ - protected Job() { - } - - /** - * Get the jobType property: This property will be used as the discriminator for deciding the specific types in the - * polymorphic chain of types. - * - * @return the jobType value. - */ - public String jobType() { - return this.jobType; - } - - /** - * Get the entityFriendlyName property: Friendly name of the entity on which the current job is executing. - * - * @return the entityFriendlyName value. - */ - public String entityFriendlyName() { - return this.entityFriendlyName; - } - - /** - * Set the entityFriendlyName property: Friendly name of the entity on which the current job is executing. - * - * @param entityFriendlyName the entityFriendlyName value to set. - * @return the Job object itself. - */ - Job withEntityFriendlyName(String entityFriendlyName) { - this.entityFriendlyName = entityFriendlyName; - return this; - } - - /** - * Get the backupManagementType property: Backup management type to execute the current job. - * - * @return the backupManagementType value. - */ - public BackupManagementType backupManagementType() { - return this.backupManagementType; - } - - /** - * Set the backupManagementType property: Backup management type to execute the current job. - * - * @param backupManagementType the backupManagementType value to set. - * @return the Job object itself. - */ - Job withBackupManagementType(BackupManagementType backupManagementType) { - this.backupManagementType = backupManagementType; - return this; - } - - /** - * Get the operation property: The operation name. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Set the operation property: The operation name. - * - * @param operation the operation value to set. - * @return the Job object itself. - */ - Job withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the status property: Job status. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: Job status. - * - * @param status the status value to set. - * @return the Job object itself. - */ - Job withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the startTime property: The start time. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: The start time. - * - * @param startTime the startTime value to set. - * @return the Job object itself. - */ - Job withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: The end time. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: The end time. - * - * @param endTime the endTime value to set. - * @return the Job object itself. - */ - Job withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the activityId property: ActivityId of job. - * - * @return the activityId value. - */ - public String activityId() { - return this.activityId; - } - - /** - * Set the activityId property: ActivityId of job. - * - * @param activityId the activityId value to set. - * @return the Job object itself. - */ - Job withActivityId(String activityId) { - this.activityId = activityId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("jobType", this.jobType); - jsonWriter.writeStringField("entityFriendlyName", this.entityFriendlyName); - jsonWriter.writeStringField("backupManagementType", - this.backupManagementType == null ? null : this.backupManagementType.toString()); - jsonWriter.writeStringField("operation", this.operation); - jsonWriter.writeStringField("status", this.status); - jsonWriter.writeStringField("startTime", - this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); - jsonWriter.writeStringField("endTime", - this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); - jsonWriter.writeStringField("activityId", this.activityId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Job from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Job 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 Job. - */ - public static Job fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("jobType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureIaaSVMJob".equals(discriminatorValue)) { - return AzureIaaSvmJob.fromJson(readerToUse.reset()); - } else if ("AzureIaaSVMJobV2".equals(discriminatorValue)) { - return AzureIaaSvmJobV2.fromJson(readerToUse.reset()); - } else if ("AzureStorageJob".equals(discriminatorValue)) { - return AzureStorageJob.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadJob".equals(discriminatorValue)) { - return AzureWorkloadJob.fromJson(readerToUse.reset()); - } else if ("DpmJob".equals(discriminatorValue)) { - return DpmJob.fromJson(readerToUse.reset()); - } else if ("MabJob".equals(discriminatorValue)) { - return MabJob.fromJson(readerToUse.reset()); - } else if ("VaultJob".equals(discriminatorValue)) { - return VaultJob.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static Job fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Job deserializedJob = new Job(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("jobType".equals(fieldName)) { - deserializedJob.jobType = reader.getString(); - } else if ("entityFriendlyName".equals(fieldName)) { - deserializedJob.entityFriendlyName = reader.getString(); - } else if ("backupManagementType".equals(fieldName)) { - deserializedJob.backupManagementType = BackupManagementType.fromString(reader.getString()); - } else if ("operation".equals(fieldName)) { - deserializedJob.operation = reader.getString(); - } else if ("status".equals(fieldName)) { - deserializedJob.status = reader.getString(); - } else if ("startTime".equals(fieldName)) { - deserializedJob.startTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("endTime".equals(fieldName)) { - deserializedJob.endTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("activityId".equals(fieldName)) { - deserializedJob.activityId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedJob; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobCancellations.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobCancellations.java deleted file mode 100644 index ad4f2901454c..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobCancellations.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of JobCancellations. - */ -public interface JobCancellations { - /** - * Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call - * GetCancelOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Name of the job whose details are to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response triggerWithResponse(String vaultName, String resourceGroupName, String jobName, Context context); - - /** - * Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call - * GetCancelOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Name of the job whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void trigger(String vaultName, String resourceGroupName, String jobName); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobDetails.java deleted file mode 100644 index 0a7441fbfd81..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobDetails.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of JobDetails. - */ -public interface JobDetails { - /** - * Gets extended information associated with the job. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Name of the job whose details are to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extended information associated with the job along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, String jobName, Context context); - - /** - * Gets extended information associated with the job. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName Name of the job whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return extended information associated with the job. - */ - JobResource get(String vaultName, String resourceGroupName, String jobName); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobOperationResults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobOperationResults.java deleted file mode 100644 index 9c8cf811ab5c..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobOperationResults.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of JobOperationResults. - */ -public interface JobOperationResults { - /** - * Fetches the result of any operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName The name of the JobResource. - * @param operationId The name of the JobResource. - * @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 getWithResponse(String vaultName, String resourceGroupName, String jobName, String operationId, - Context context); - - /** - * Fetches the result of any operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param jobName The name of the JobResource. - * @param operationId The name of the JobResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void get(String vaultName, String resourceGroupName, String jobName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobResource.java deleted file mode 100644 index 197fbef7aa01..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobResource.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; -import java.util.Map; - -/** - * An immutable client-side representation of JobResource. - */ -public interface JobResource { - /** - * 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: JobResource properties. - * - * @return the properties value. - */ - Job properties(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the etag property: Optional ETag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner object. - * - * @return the inner object. - */ - JobResourceInner innerModel(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobSupportedAction.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobSupportedAction.java deleted file mode 100644 index 7e1aca0eaebd..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobSupportedAction.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -/** - * Defines values for JobSupportedAction. - */ -public enum JobSupportedAction { - /** - * Enum value Invalid. - */ - INVALID("Invalid"), - - /** - * Enum value Cancellable. - */ - CANCELLABLE("Cancellable"), - - /** - * Enum value Retriable. - */ - RETRIABLE("Retriable"); - - /** - * The actual serialized value for a JobSupportedAction instance. - */ - private final String value; - - JobSupportedAction(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a JobSupportedAction instance. - * - * @param value the serialized value to parse. - * @return the parsed JobSupportedAction object, or null if unable to parse. - */ - public static JobSupportedAction fromString(String value) { - if (value == null) { - return null; - } - JobSupportedAction[] items = JobSupportedAction.values(); - for (JobSupportedAction item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Jobs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Jobs.java deleted file mode 100644 index 84899bde5488..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Jobs.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of Jobs. - */ -public interface Jobs { - /** - * Triggers export of jobs specified by filters and returns an OperationID to track. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response exportWithResponse(String vaultName, String resourceGroupName, String filter, Context context); - - /** - * Triggers export of jobs specified by filters and returns an OperationID to track. - * - * @param vaultName The name of the recovery services vault. - * @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. - */ - void export(String vaultName, String resourceGroupName); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/KekDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/KekDetails.java deleted file mode 100644 index d40ec4fb2da8..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/KekDetails.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * KEK is encryption key for BEK. - */ -@Immutable -public final class KekDetails implements JsonSerializable { - /* - * Key is KEK. - */ - private String keyUrl; - - /* - * Key Vault ID where this Key is stored. - */ - private String keyVaultId; - - /* - * KEK data. - */ - private String keyBackupData; - - /** - * Creates an instance of KekDetails class. - */ - private KekDetails() { - } - - /** - * Get the keyUrl property: Key is KEK. - * - * @return the keyUrl value. - */ - public String keyUrl() { - return this.keyUrl; - } - - /** - * Get the keyVaultId property: Key Vault ID where this Key is stored. - * - * @return the keyVaultId value. - */ - public String keyVaultId() { - return this.keyVaultId; - } - - /** - * Get the keyBackupData property: KEK data. - * - * @return the keyBackupData value. - */ - public String keyBackupData() { - return this.keyBackupData; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("keyUrl", this.keyUrl); - jsonWriter.writeStringField("keyVaultId", this.keyVaultId); - jsonWriter.writeStringField("keyBackupData", this.keyBackupData); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of KekDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of KekDetails 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 KekDetails. - */ - public static KekDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - KekDetails deserializedKekDetails = new KekDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("keyUrl".equals(fieldName)) { - deserializedKekDetails.keyUrl = reader.getString(); - } else if ("keyVaultId".equals(fieldName)) { - deserializedKekDetails.keyVaultId = reader.getString(); - } else if ("keyBackupData".equals(fieldName)) { - deserializedKekDetails.keyBackupData = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedKekDetails; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/KeyAndSecretDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/KeyAndSecretDetails.java deleted file mode 100644 index 067505682b1d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/KeyAndSecretDetails.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * BEK is bitlocker key. - * KEK is encryption key for BEK - * If the VM was encrypted then we will store following details : - * 1. Secret(BEK) - Url + Backup Data + vaultId. - * 2. Key(KEK) - Url + Backup Data + vaultId. - * 3. EncryptionMechanism - * BEK and KEK can potentially have different vault ids. - */ -@Immutable -public final class KeyAndSecretDetails implements JsonSerializable { - /* - * KEK is encryption key for BEK. - */ - private KekDetails kekDetails; - - /* - * BEK is bitlocker encryption key. - */ - private BekDetails bekDetails; - - /* - * Encryption mechanism: None/ SinglePass/ DoublePass - */ - private String encryptionMechanism; - - /** - * Creates an instance of KeyAndSecretDetails class. - */ - private KeyAndSecretDetails() { - } - - /** - * Get the kekDetails property: KEK is encryption key for BEK. - * - * @return the kekDetails value. - */ - public KekDetails kekDetails() { - return this.kekDetails; - } - - /** - * Get the bekDetails property: BEK is bitlocker encryption key. - * - * @return the bekDetails value. - */ - public BekDetails bekDetails() { - return this.bekDetails; - } - - /** - * Get the encryptionMechanism property: Encryption mechanism: None/ SinglePass/ DoublePass. - * - * @return the encryptionMechanism value. - */ - public String encryptionMechanism() { - return this.encryptionMechanism; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("kekDetails", this.kekDetails); - jsonWriter.writeJsonField("bekDetails", this.bekDetails); - jsonWriter.writeStringField("encryptionMechanism", this.encryptionMechanism); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of KeyAndSecretDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of KeyAndSecretDetails 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 KeyAndSecretDetails. - */ - public static KeyAndSecretDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - KeyAndSecretDetails deserializedKeyAndSecretDetails = new KeyAndSecretDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("kekDetails".equals(fieldName)) { - deserializedKeyAndSecretDetails.kekDetails = KekDetails.fromJson(reader); - } else if ("bekDetails".equals(fieldName)) { - deserializedKeyAndSecretDetails.bekDetails = BekDetails.fromJson(reader); - } else if ("encryptionMechanism".equals(fieldName)) { - deserializedKeyAndSecretDetails.encryptionMechanism = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedKeyAndSecretDetails; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/KpiResourceHealthDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/KpiResourceHealthDetails.java deleted file mode 100644 index a2f31bd5387d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/KpiResourceHealthDetails.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * KPI Resource Health Details. - */ -@Fluent -public final class KpiResourceHealthDetails implements JsonSerializable { - /* - * Resource Health Status - */ - private ResourceHealthStatus resourceHealthStatus; - - /* - * Resource Health Status - */ - private List resourceHealthDetails; - - /** - * Creates an instance of KpiResourceHealthDetails class. - */ - public KpiResourceHealthDetails() { - } - - /** - * Get the resourceHealthStatus property: Resource Health Status. - * - * @return the resourceHealthStatus value. - */ - public ResourceHealthStatus resourceHealthStatus() { - return this.resourceHealthStatus; - } - - /** - * Set the resourceHealthStatus property: Resource Health Status. - * - * @param resourceHealthStatus the resourceHealthStatus value to set. - * @return the KpiResourceHealthDetails object itself. - */ - public KpiResourceHealthDetails withResourceHealthStatus(ResourceHealthStatus resourceHealthStatus) { - this.resourceHealthStatus = resourceHealthStatus; - return this; - } - - /** - * Get the resourceHealthDetails property: Resource Health Status. - * - * @return the resourceHealthDetails value. - */ - public List resourceHealthDetails() { - return this.resourceHealthDetails; - } - - /** - * Set the resourceHealthDetails property: Resource Health Status. - * - * @param resourceHealthDetails the resourceHealthDetails value to set. - * @return the KpiResourceHealthDetails object itself. - */ - public KpiResourceHealthDetails withResourceHealthDetails(List resourceHealthDetails) { - this.resourceHealthDetails = resourceHealthDetails; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("resourceHealthStatus", - this.resourceHealthStatus == null ? null : this.resourceHealthStatus.toString()); - jsonWriter.writeArrayField("resourceHealthDetails", this.resourceHealthDetails, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of KpiResourceHealthDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of KpiResourceHealthDetails 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 KpiResourceHealthDetails. - */ - public static KpiResourceHealthDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - KpiResourceHealthDetails deserializedKpiResourceHealthDetails = new KpiResourceHealthDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceHealthStatus".equals(fieldName)) { - deserializedKpiResourceHealthDetails.resourceHealthStatus - = ResourceHealthStatus.fromString(reader.getString()); - } else if ("resourceHealthDetails".equals(fieldName)) { - List resourceHealthDetails - = reader.readArray(reader1 -> ResourceHealthDetails.fromJson(reader1)); - deserializedKpiResourceHealthDetails.resourceHealthDetails = resourceHealthDetails; - } else { - reader.skipChildren(); - } - } - - return deserializedKpiResourceHealthDetails; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LastBackupStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LastBackupStatus.java deleted file mode 100644 index b7c3e1de38c5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LastBackupStatus.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Last backup operation status. Possible values: Healthy, Unhealthy. - */ -public final class LastBackupStatus extends ExpandableStringEnum { - /** - * Static value Invalid for LastBackupStatus. - */ - public static final LastBackupStatus INVALID = fromString("Invalid"); - - /** - * Static value Healthy for LastBackupStatus. - */ - public static final LastBackupStatus HEALTHY = fromString("Healthy"); - - /** - * Static value Unhealthy for LastBackupStatus. - */ - public static final LastBackupStatus UNHEALTHY = fromString("Unhealthy"); - - /** - * Static value IRPending for LastBackupStatus. - */ - public static final LastBackupStatus IRPENDING = fromString("IRPending"); - - /** - * Creates a new instance of LastBackupStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public LastBackupStatus() { - } - - /** - * Creates or finds a LastBackupStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding LastBackupStatus. - */ - public static LastBackupStatus fromString(String name) { - return fromString(name, LastBackupStatus.class); - } - - /** - * Gets known LastBackupStatus values. - * - * @return known LastBackupStatus values. - */ - public static Collection values() { - return values(LastBackupStatus.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LastUpdateStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LastUpdateStatus.java deleted file mode 100644 index f1295d57aded..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LastUpdateStatus.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for LastUpdateStatus. - */ -public final class LastUpdateStatus extends ExpandableStringEnum { - /** - * Static value Invalid for LastUpdateStatus. - */ - public static final LastUpdateStatus INVALID = fromString("Invalid"); - - /** - * Static value NotEnabled for LastUpdateStatus. - */ - public static final LastUpdateStatus NOT_ENABLED = fromString("NotEnabled"); - - /** - * Static value PartiallySucceeded for LastUpdateStatus. - */ - public static final LastUpdateStatus PARTIALLY_SUCCEEDED = fromString("PartiallySucceeded"); - - /** - * Static value PartiallyFailed for LastUpdateStatus. - */ - public static final LastUpdateStatus PARTIALLY_FAILED = fromString("PartiallyFailed"); - - /** - * Static value Failed for LastUpdateStatus. - */ - public static final LastUpdateStatus FAILED = fromString("Failed"); - - /** - * Static value Succeeded for LastUpdateStatus. - */ - public static final LastUpdateStatus SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Initialized for LastUpdateStatus. - */ - public static final LastUpdateStatus INITIALIZED = fromString("Initialized"); - - /** - * Static value FirstInitialization for LastUpdateStatus. - */ - public static final LastUpdateStatus FIRST_INITIALIZATION = fromString("FirstInitialization"); - - /** - * Creates a new instance of LastUpdateStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public LastUpdateStatus() { - } - - /** - * Creates or finds a LastUpdateStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding LastUpdateStatus. - */ - public static LastUpdateStatus fromString(String name) { - return fromString(name, LastUpdateStatus.class); - } - - /** - * Gets known LastUpdateStatus values. - * - * @return known LastUpdateStatus values. - */ - public static Collection values() { - return values(LastUpdateStatus.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ListRecoveryPointsRecommendedForMoveRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ListRecoveryPointsRecommendedForMoveRequest.java deleted file mode 100644 index b5dc42e7a515..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ListRecoveryPointsRecommendedForMoveRequest.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * ListRecoveryPointsRecommendedForMoveRequest Request. - */ -@Fluent -public final class ListRecoveryPointsRecommendedForMoveRequest - implements JsonSerializable { - /* - * Gets the class type. - */ - private String objectType; - - /* - * List of Recovery Points excluded from Move - */ - private List excludedRPList; - - /** - * Creates an instance of ListRecoveryPointsRecommendedForMoveRequest class. - */ - public ListRecoveryPointsRecommendedForMoveRequest() { - } - - /** - * Get the objectType property: Gets the class type. - * - * @return the objectType value. - */ - public String objectType() { - return this.objectType; - } - - /** - * Set the objectType property: Gets the class type. - * - * @param objectType the objectType value to set. - * @return the ListRecoveryPointsRecommendedForMoveRequest object itself. - */ - public ListRecoveryPointsRecommendedForMoveRequest withObjectType(String objectType) { - this.objectType = objectType; - return this; - } - - /** - * Get the excludedRPList property: List of Recovery Points excluded from Move. - * - * @return the excludedRPList value. - */ - public List excludedRPList() { - return this.excludedRPList; - } - - /** - * Set the excludedRPList property: List of Recovery Points excluded from Move. - * - * @param excludedRPList the excludedRPList value to set. - * @return the ListRecoveryPointsRecommendedForMoveRequest object itself. - */ - public ListRecoveryPointsRecommendedForMoveRequest withExcludedRPList(List excludedRPList) { - this.excludedRPList = excludedRPList; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeArrayField("excludedRPList", this.excludedRPList, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ListRecoveryPointsRecommendedForMoveRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ListRecoveryPointsRecommendedForMoveRequest 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 ListRecoveryPointsRecommendedForMoveRequest. - */ - public static ListRecoveryPointsRecommendedForMoveRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ListRecoveryPointsRecommendedForMoveRequest deserializedListRecoveryPointsRecommendedForMoveRequest - = new ListRecoveryPointsRecommendedForMoveRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedListRecoveryPointsRecommendedForMoveRequest.objectType = reader.getString(); - } else if ("excludedRPList".equals(fieldName)) { - List excludedRPList = reader.readArray(reader1 -> reader1.getString()); - deserializedListRecoveryPointsRecommendedForMoveRequest.excludedRPList = excludedRPList; - } else { - reader.skipChildren(); - } - } - - return deserializedListRecoveryPointsRecommendedForMoveRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LogSchedulePolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LogSchedulePolicy.java deleted file mode 100644 index 441ddf4a173a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LogSchedulePolicy.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Log policy schedule. - */ -@Fluent -public final class LogSchedulePolicy extends SchedulePolicy { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String schedulePolicyType = "LogSchedulePolicy"; - - /* - * Frequency of the log schedule operation of this policy in minutes. - */ - private Integer scheduleFrequencyInMins; - - /** - * Creates an instance of LogSchedulePolicy class. - */ - public LogSchedulePolicy() { - } - - /** - * Get the schedulePolicyType property: This property will be used as the discriminator for deciding the specific - * types in the polymorphic chain of types. - * - * @return the schedulePolicyType value. - */ - @Override - public String schedulePolicyType() { - return this.schedulePolicyType; - } - - /** - * Get the scheduleFrequencyInMins property: Frequency of the log schedule operation of this policy in minutes. - * - * @return the scheduleFrequencyInMins value. - */ - public Integer scheduleFrequencyInMins() { - return this.scheduleFrequencyInMins; - } - - /** - * Set the scheduleFrequencyInMins property: Frequency of the log schedule operation of this policy in minutes. - * - * @param scheduleFrequencyInMins the scheduleFrequencyInMins value to set. - * @return the LogSchedulePolicy object itself. - */ - public LogSchedulePolicy withScheduleFrequencyInMins(Integer scheduleFrequencyInMins) { - this.scheduleFrequencyInMins = scheduleFrequencyInMins; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("schedulePolicyType", this.schedulePolicyType); - jsonWriter.writeNumberField("scheduleFrequencyInMins", this.scheduleFrequencyInMins); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LogSchedulePolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LogSchedulePolicy 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 LogSchedulePolicy. - */ - public static LogSchedulePolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LogSchedulePolicy deserializedLogSchedulePolicy = new LogSchedulePolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("schedulePolicyType".equals(fieldName)) { - deserializedLogSchedulePolicy.schedulePolicyType = reader.getString(); - } else if ("scheduleFrequencyInMins".equals(fieldName)) { - deserializedLogSchedulePolicy.scheduleFrequencyInMins = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedLogSchedulePolicy; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LongTermRetentionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LongTermRetentionPolicy.java deleted file mode 100644 index 9e0532264fcc..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LongTermRetentionPolicy.java +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Long term retention policy. - */ -@Fluent -public final class LongTermRetentionPolicy extends RetentionPolicy { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String retentionPolicyType = "LongTermRetentionPolicy"; - - /* - * Daily retention schedule of the protection policy. - */ - private DailyRetentionSchedule dailySchedule; - - /* - * Weekly retention schedule of the protection policy. - */ - private WeeklyRetentionSchedule weeklySchedule; - - /* - * Monthly retention schedule of the protection policy. - */ - private MonthlyRetentionSchedule monthlySchedule; - - /* - * Yearly retention schedule of the protection policy. - */ - private YearlyRetentionSchedule yearlySchedule; - - /** - * Creates an instance of LongTermRetentionPolicy class. - */ - public LongTermRetentionPolicy() { - } - - /** - * Get the retentionPolicyType property: This property will be used as the discriminator for deciding the specific - * types in the polymorphic chain of types. - * - * @return the retentionPolicyType value. - */ - @Override - public String retentionPolicyType() { - return this.retentionPolicyType; - } - - /** - * Get the dailySchedule property: Daily retention schedule of the protection policy. - * - * @return the dailySchedule value. - */ - public DailyRetentionSchedule dailySchedule() { - return this.dailySchedule; - } - - /** - * Set the dailySchedule property: Daily retention schedule of the protection policy. - * - * @param dailySchedule the dailySchedule value to set. - * @return the LongTermRetentionPolicy object itself. - */ - public LongTermRetentionPolicy withDailySchedule(DailyRetentionSchedule dailySchedule) { - this.dailySchedule = dailySchedule; - return this; - } - - /** - * Get the weeklySchedule property: Weekly retention schedule of the protection policy. - * - * @return the weeklySchedule value. - */ - public WeeklyRetentionSchedule weeklySchedule() { - return this.weeklySchedule; - } - - /** - * Set the weeklySchedule property: Weekly retention schedule of the protection policy. - * - * @param weeklySchedule the weeklySchedule value to set. - * @return the LongTermRetentionPolicy object itself. - */ - public LongTermRetentionPolicy withWeeklySchedule(WeeklyRetentionSchedule weeklySchedule) { - this.weeklySchedule = weeklySchedule; - return this; - } - - /** - * Get the monthlySchedule property: Monthly retention schedule of the protection policy. - * - * @return the monthlySchedule value. - */ - public MonthlyRetentionSchedule monthlySchedule() { - return this.monthlySchedule; - } - - /** - * Set the monthlySchedule property: Monthly retention schedule of the protection policy. - * - * @param monthlySchedule the monthlySchedule value to set. - * @return the LongTermRetentionPolicy object itself. - */ - public LongTermRetentionPolicy withMonthlySchedule(MonthlyRetentionSchedule monthlySchedule) { - this.monthlySchedule = monthlySchedule; - return this; - } - - /** - * Get the yearlySchedule property: Yearly retention schedule of the protection policy. - * - * @return the yearlySchedule value. - */ - public YearlyRetentionSchedule yearlySchedule() { - return this.yearlySchedule; - } - - /** - * Set the yearlySchedule property: Yearly retention schedule of the protection policy. - * - * @param yearlySchedule the yearlySchedule value to set. - * @return the LongTermRetentionPolicy object itself. - */ - public LongTermRetentionPolicy withYearlySchedule(YearlyRetentionSchedule yearlySchedule) { - this.yearlySchedule = yearlySchedule; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("retentionPolicyType", this.retentionPolicyType); - jsonWriter.writeJsonField("dailySchedule", this.dailySchedule); - jsonWriter.writeJsonField("weeklySchedule", this.weeklySchedule); - jsonWriter.writeJsonField("monthlySchedule", this.monthlySchedule); - jsonWriter.writeJsonField("yearlySchedule", this.yearlySchedule); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LongTermRetentionPolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LongTermRetentionPolicy 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 LongTermRetentionPolicy. - */ - public static LongTermRetentionPolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LongTermRetentionPolicy deserializedLongTermRetentionPolicy = new LongTermRetentionPolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("retentionPolicyType".equals(fieldName)) { - deserializedLongTermRetentionPolicy.retentionPolicyType = reader.getString(); - } else if ("dailySchedule".equals(fieldName)) { - deserializedLongTermRetentionPolicy.dailySchedule = DailyRetentionSchedule.fromJson(reader); - } else if ("weeklySchedule".equals(fieldName)) { - deserializedLongTermRetentionPolicy.weeklySchedule = WeeklyRetentionSchedule.fromJson(reader); - } else if ("monthlySchedule".equals(fieldName)) { - deserializedLongTermRetentionPolicy.monthlySchedule = MonthlyRetentionSchedule.fromJson(reader); - } else if ("yearlySchedule".equals(fieldName)) { - deserializedLongTermRetentionPolicy.yearlySchedule = YearlyRetentionSchedule.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedLongTermRetentionPolicy; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LongTermSchedulePolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LongTermSchedulePolicy.java deleted file mode 100644 index 986c7ce203ef..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/LongTermSchedulePolicy.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Long term policy schedule. - */ -@Immutable -public final class LongTermSchedulePolicy extends SchedulePolicy { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String schedulePolicyType = "LongTermSchedulePolicy"; - - /** - * Creates an instance of LongTermSchedulePolicy class. - */ - public LongTermSchedulePolicy() { - } - - /** - * Get the schedulePolicyType property: This property will be used as the discriminator for deciding the specific - * types in the polymorphic chain of types. - * - * @return the schedulePolicyType value. - */ - @Override - public String schedulePolicyType() { - return this.schedulePolicyType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("schedulePolicyType", this.schedulePolicyType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LongTermSchedulePolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LongTermSchedulePolicy 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 LongTermSchedulePolicy. - */ - public static LongTermSchedulePolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LongTermSchedulePolicy deserializedLongTermSchedulePolicy = new LongTermSchedulePolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("schedulePolicyType".equals(fieldName)) { - deserializedLongTermSchedulePolicy.schedulePolicyType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedLongTermSchedulePolicy; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabContainer.java deleted file mode 100644 index 69bbc1a4315d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabContainer.java +++ /dev/null @@ -1,344 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Container with items backed up using MAB backup engine. - */ -@Fluent -public final class MabContainer extends ProtectionContainer { - /* - * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines - * 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer - */ - private ProtectableContainerType containerType = ProtectableContainerType.WINDOWS; - - /* - * Can the container be registered one more time. - */ - private Boolean canReRegister; - - /* - * ContainerID represents the container. - */ - private Long containerId; - - /* - * Number of items backed up in this container. - */ - private Long protectedItemCount; - - /* - * Agent version of this container. - */ - private String agentVersion; - - /* - * Additional information for this container - */ - private MabContainerExtendedInfo extendedInfo; - - /* - * Health details on this mab container. - */ - private List mabContainerHealthDetails; - - /* - * Health state of mab container. - */ - private String containerHealthState; - - /** - * Creates an instance of MabContainer class. - */ - public MabContainer() { - } - - /** - * Get the containerType property: Type of the container. The value of this property for: 1. Compute Azure VM is - * Microsoft.Compute/virtualMachines 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer. - * - * @return the containerType value. - */ - @Override - public ProtectableContainerType containerType() { - return this.containerType; - } - - /** - * Get the canReRegister property: Can the container be registered one more time. - * - * @return the canReRegister value. - */ - public Boolean canReRegister() { - return this.canReRegister; - } - - /** - * Set the canReRegister property: Can the container be registered one more time. - * - * @param canReRegister the canReRegister value to set. - * @return the MabContainer object itself. - */ - public MabContainer withCanReRegister(Boolean canReRegister) { - this.canReRegister = canReRegister; - return this; - } - - /** - * Get the containerId property: ContainerID represents the container. - * - * @return the containerId value. - */ - public Long containerId() { - return this.containerId; - } - - /** - * Set the containerId property: ContainerID represents the container. - * - * @param containerId the containerId value to set. - * @return the MabContainer object itself. - */ - public MabContainer withContainerId(Long containerId) { - this.containerId = containerId; - return this; - } - - /** - * Get the protectedItemCount property: Number of items backed up in this container. - * - * @return the protectedItemCount value. - */ - public Long protectedItemCount() { - return this.protectedItemCount; - } - - /** - * Set the protectedItemCount property: Number of items backed up in this container. - * - * @param protectedItemCount the protectedItemCount value to set. - * @return the MabContainer object itself. - */ - public MabContainer withProtectedItemCount(Long protectedItemCount) { - this.protectedItemCount = protectedItemCount; - return this; - } - - /** - * Get the agentVersion property: Agent version of this container. - * - * @return the agentVersion value. - */ - public String agentVersion() { - return this.agentVersion; - } - - /** - * Set the agentVersion property: Agent version of this container. - * - * @param agentVersion the agentVersion value to set. - * @return the MabContainer object itself. - */ - public MabContainer withAgentVersion(String agentVersion) { - this.agentVersion = agentVersion; - return this; - } - - /** - * Get the extendedInfo property: Additional information for this container. - * - * @return the extendedInfo value. - */ - public MabContainerExtendedInfo extendedInfo() { - return this.extendedInfo; - } - - /** - * Set the extendedInfo property: Additional information for this container. - * - * @param extendedInfo the extendedInfo value to set. - * @return the MabContainer object itself. - */ - public MabContainer withExtendedInfo(MabContainerExtendedInfo extendedInfo) { - this.extendedInfo = extendedInfo; - return this; - } - - /** - * Get the mabContainerHealthDetails property: Health details on this mab container. - * - * @return the mabContainerHealthDetails value. - */ - public List mabContainerHealthDetails() { - return this.mabContainerHealthDetails; - } - - /** - * Set the mabContainerHealthDetails property: Health details on this mab container. - * - * @param mabContainerHealthDetails the mabContainerHealthDetails value to set. - * @return the MabContainer object itself. - */ - public MabContainer withMabContainerHealthDetails(List mabContainerHealthDetails) { - this.mabContainerHealthDetails = mabContainerHealthDetails; - return this; - } - - /** - * Get the containerHealthState property: Health state of mab container. - * - * @return the containerHealthState value. - */ - public String containerHealthState() { - return this.containerHealthState; - } - - /** - * Set the containerHealthState property: Health state of mab container. - * - * @param containerHealthState the containerHealthState value to set. - * @return the MabContainer object itself. - */ - public MabContainer withContainerHealthState(String containerHealthState) { - this.containerHealthState = containerHealthState; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabContainer withFriendlyName(String friendlyName) { - super.withFriendlyName(friendlyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabContainer withBackupManagementType(BackupManagementType backupManagementType) { - super.withBackupManagementType(backupManagementType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabContainer withRegistrationStatus(String registrationStatus) { - super.withRegistrationStatus(registrationStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabContainer withHealthStatus(String healthStatus) { - super.withHealthStatus(healthStatus); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabContainer withProtectableObjectType(String protectableObjectType) { - super.withProtectableObjectType(protectableObjectType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("friendlyName", friendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("registrationStatus", registrationStatus()); - jsonWriter.writeStringField("healthStatus", healthStatus()); - jsonWriter.writeStringField("protectableObjectType", protectableObjectType()); - jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString()); - jsonWriter.writeBooleanField("canReRegister", this.canReRegister); - jsonWriter.writeNumberField("containerId", this.containerId); - jsonWriter.writeNumberField("protectedItemCount", this.protectedItemCount); - jsonWriter.writeStringField("agentVersion", this.agentVersion); - jsonWriter.writeJsonField("extendedInfo", this.extendedInfo); - jsonWriter.writeArrayField("mabContainerHealthDetails", this.mabContainerHealthDetails, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("containerHealthState", this.containerHealthState); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MabContainer from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MabContainer 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 MabContainer. - */ - public static MabContainer fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MabContainer deserializedMabContainer = new MabContainer(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("friendlyName".equals(fieldName)) { - deserializedMabContainer.withFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedMabContainer - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("registrationStatus".equals(fieldName)) { - deserializedMabContainer.withRegistrationStatus(reader.getString()); - } else if ("healthStatus".equals(fieldName)) { - deserializedMabContainer.withHealthStatus(reader.getString()); - } else if ("protectableObjectType".equals(fieldName)) { - deserializedMabContainer.withProtectableObjectType(reader.getString()); - } else if ("containerType".equals(fieldName)) { - deserializedMabContainer.containerType = ProtectableContainerType.fromString(reader.getString()); - } else if ("canReRegister".equals(fieldName)) { - deserializedMabContainer.canReRegister = reader.getNullable(JsonReader::getBoolean); - } else if ("containerId".equals(fieldName)) { - deserializedMabContainer.containerId = reader.getNullable(JsonReader::getLong); - } else if ("protectedItemCount".equals(fieldName)) { - deserializedMabContainer.protectedItemCount = reader.getNullable(JsonReader::getLong); - } else if ("agentVersion".equals(fieldName)) { - deserializedMabContainer.agentVersion = reader.getString(); - } else if ("extendedInfo".equals(fieldName)) { - deserializedMabContainer.extendedInfo = MabContainerExtendedInfo.fromJson(reader); - } else if ("mabContainerHealthDetails".equals(fieldName)) { - List mabContainerHealthDetails - = reader.readArray(reader1 -> MabContainerHealthDetails.fromJson(reader1)); - deserializedMabContainer.mabContainerHealthDetails = mabContainerHealthDetails; - } else if ("containerHealthState".equals(fieldName)) { - deserializedMabContainer.containerHealthState = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedMabContainer; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabContainerExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabContainerExtendedInfo.java deleted file mode 100644 index 303b366ec2e8..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabContainerExtendedInfo.java +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Additional information of the container. - */ -@Fluent -public final class MabContainerExtendedInfo implements JsonSerializable { - /* - * Time stamp when this container was refreshed. - */ - private OffsetDateTime lastRefreshedAt; - - /* - * Type of backup items associated with this container. - */ - private BackupItemType backupItemType; - - /* - * List of backup items associated with this container. - */ - private List backupItems; - - /* - * Backup policy associated with this container. - */ - private String policyName; - - /* - * Latest backup status of this container. - */ - private String lastBackupStatus; - - /** - * Creates an instance of MabContainerExtendedInfo class. - */ - public MabContainerExtendedInfo() { - } - - /** - * Get the lastRefreshedAt property: Time stamp when this container was refreshed. - * - * @return the lastRefreshedAt value. - */ - public OffsetDateTime lastRefreshedAt() { - return this.lastRefreshedAt; - } - - /** - * Set the lastRefreshedAt property: Time stamp when this container was refreshed. - * - * @param lastRefreshedAt the lastRefreshedAt value to set. - * @return the MabContainerExtendedInfo object itself. - */ - public MabContainerExtendedInfo withLastRefreshedAt(OffsetDateTime lastRefreshedAt) { - this.lastRefreshedAt = lastRefreshedAt; - return this; - } - - /** - * Get the backupItemType property: Type of backup items associated with this container. - * - * @return the backupItemType value. - */ - public BackupItemType backupItemType() { - return this.backupItemType; - } - - /** - * Set the backupItemType property: Type of backup items associated with this container. - * - * @param backupItemType the backupItemType value to set. - * @return the MabContainerExtendedInfo object itself. - */ - public MabContainerExtendedInfo withBackupItemType(BackupItemType backupItemType) { - this.backupItemType = backupItemType; - return this; - } - - /** - * Get the backupItems property: List of backup items associated with this container. - * - * @return the backupItems value. - */ - public List backupItems() { - return this.backupItems; - } - - /** - * Set the backupItems property: List of backup items associated with this container. - * - * @param backupItems the backupItems value to set. - * @return the MabContainerExtendedInfo object itself. - */ - public MabContainerExtendedInfo withBackupItems(List backupItems) { - this.backupItems = backupItems; - return this; - } - - /** - * Get the policyName property: Backup policy associated with this container. - * - * @return the policyName value. - */ - public String policyName() { - return this.policyName; - } - - /** - * Set the policyName property: Backup policy associated with this container. - * - * @param policyName the policyName value to set. - * @return the MabContainerExtendedInfo object itself. - */ - public MabContainerExtendedInfo withPolicyName(String policyName) { - this.policyName = policyName; - return this; - } - - /** - * Get the lastBackupStatus property: Latest backup status of this container. - * - * @return the lastBackupStatus value. - */ - public String lastBackupStatus() { - return this.lastBackupStatus; - } - - /** - * Set the lastBackupStatus property: Latest backup status of this container. - * - * @param lastBackupStatus the lastBackupStatus value to set. - * @return the MabContainerExtendedInfo object itself. - */ - public MabContainerExtendedInfo withLastBackupStatus(String lastBackupStatus) { - this.lastBackupStatus = lastBackupStatus; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("lastRefreshedAt", - this.lastRefreshedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastRefreshedAt)); - jsonWriter.writeStringField("backupItemType", - this.backupItemType == null ? null : this.backupItemType.toString()); - jsonWriter.writeArrayField("backupItems", this.backupItems, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("policyName", this.policyName); - jsonWriter.writeStringField("lastBackupStatus", this.lastBackupStatus); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MabContainerExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MabContainerExtendedInfo 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 MabContainerExtendedInfo. - */ - public static MabContainerExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MabContainerExtendedInfo deserializedMabContainerExtendedInfo = new MabContainerExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("lastRefreshedAt".equals(fieldName)) { - deserializedMabContainerExtendedInfo.lastRefreshedAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("backupItemType".equals(fieldName)) { - deserializedMabContainerExtendedInfo.backupItemType = BackupItemType.fromString(reader.getString()); - } else if ("backupItems".equals(fieldName)) { - List backupItems = reader.readArray(reader1 -> reader1.getString()); - deserializedMabContainerExtendedInfo.backupItems = backupItems; - } else if ("policyName".equals(fieldName)) { - deserializedMabContainerExtendedInfo.policyName = reader.getString(); - } else if ("lastBackupStatus".equals(fieldName)) { - deserializedMabContainerExtendedInfo.lastBackupStatus = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedMabContainerExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabContainerHealthDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabContainerHealthDetails.java deleted file mode 100644 index 6b903a909724..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabContainerHealthDetails.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * MAB workload-specific Health Details. - */ -@Fluent -public final class MabContainerHealthDetails implements JsonSerializable { - /* - * Health Code - */ - private Integer code; - - /* - * Health Title - */ - private String title; - - /* - * Health Message - */ - private String message; - - /* - * Health Recommended Actions - */ - private List recommendations; - - /** - * Creates an instance of MabContainerHealthDetails class. - */ - public MabContainerHealthDetails() { - } - - /** - * Get the code property: Health Code. - * - * @return the code value. - */ - public Integer code() { - return this.code; - } - - /** - * Set the code property: Health Code. - * - * @param code the code value to set. - * @return the MabContainerHealthDetails object itself. - */ - public MabContainerHealthDetails withCode(Integer code) { - this.code = code; - return this; - } - - /** - * Get the title property: Health Title. - * - * @return the title value. - */ - public String title() { - return this.title; - } - - /** - * Set the title property: Health Title. - * - * @param title the title value to set. - * @return the MabContainerHealthDetails object itself. - */ - public MabContainerHealthDetails withTitle(String title) { - this.title = title; - return this; - } - - /** - * Get the message property: Health Message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: Health Message. - * - * @param message the message value to set. - * @return the MabContainerHealthDetails object itself. - */ - public MabContainerHealthDetails withMessage(String message) { - this.message = message; - return this; - } - - /** - * Get the recommendations property: Health Recommended Actions. - * - * @return the recommendations value. - */ - public List recommendations() { - return this.recommendations; - } - - /** - * Set the recommendations property: Health Recommended Actions. - * - * @param recommendations the recommendations value to set. - * @return the MabContainerHealthDetails object itself. - */ - public MabContainerHealthDetails withRecommendations(List recommendations) { - this.recommendations = recommendations; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("code", this.code); - jsonWriter.writeStringField("title", this.title); - jsonWriter.writeStringField("message", this.message); - jsonWriter.writeArrayField("recommendations", this.recommendations, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MabContainerHealthDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MabContainerHealthDetails 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 MabContainerHealthDetails. - */ - public static MabContainerHealthDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MabContainerHealthDetails deserializedMabContainerHealthDetails = new MabContainerHealthDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("code".equals(fieldName)) { - deserializedMabContainerHealthDetails.code = reader.getNullable(JsonReader::getInt); - } else if ("title".equals(fieldName)) { - deserializedMabContainerHealthDetails.title = reader.getString(); - } else if ("message".equals(fieldName)) { - deserializedMabContainerHealthDetails.message = reader.getString(); - } else if ("recommendations".equals(fieldName)) { - List recommendations = reader.readArray(reader1 -> reader1.getString()); - deserializedMabContainerHealthDetails.recommendations = recommendations; - } else { - reader.skipChildren(); - } - } - - return deserializedMabContainerHealthDetails; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabErrorInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabErrorInfo.java deleted file mode 100644 index d9eef78675a6..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabErrorInfo.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * MAB workload-specific error information. - */ -@Immutable -public final class MabErrorInfo implements JsonSerializable { - /* - * Localized error string. - */ - private String errorString; - - /* - * List of localized recommendations. - */ - private List recommendations; - - /** - * Creates an instance of MabErrorInfo class. - */ - private MabErrorInfo() { - } - - /** - * Get the errorString property: Localized error string. - * - * @return the errorString value. - */ - public String errorString() { - return this.errorString; - } - - /** - * Get the recommendations property: List of localized recommendations. - * - * @return the recommendations value. - */ - public List recommendations() { - return this.recommendations; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MabErrorInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MabErrorInfo 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 MabErrorInfo. - */ - public static MabErrorInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MabErrorInfo deserializedMabErrorInfo = new MabErrorInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("errorString".equals(fieldName)) { - deserializedMabErrorInfo.errorString = reader.getString(); - } else if ("recommendations".equals(fieldName)) { - List recommendations = reader.readArray(reader1 -> reader1.getString()); - deserializedMabErrorInfo.recommendations = recommendations; - } else { - reader.skipChildren(); - } - } - - return deserializedMabErrorInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabFileFolderProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabFileFolderProtectedItem.java deleted file mode 100644 index 89282b50d884..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabFileFolderProtectedItem.java +++ /dev/null @@ -1,491 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * MAB workload-specific backup item. - */ -@Fluent -public final class MabFileFolderProtectedItem extends ProtectedItem { - /* - * backup item type. - */ - private String protectedItemType = "MabFileFolderProtectedItem"; - - /* - * Friendly name of this backup item. - */ - private String friendlyName; - - /* - * Name of the computer associated with this backup item. - */ - private String computerName; - - /* - * Status of last backup operation. - */ - private String lastBackupStatus; - - /* - * Timestamp of the last backup operation on this backup item. - */ - private OffsetDateTime lastBackupTime; - - /* - * Protected, ProtectionStopped, IRPending or ProtectionError - */ - private String protectionState; - - /* - * Sync time for deferred deletion in UTC - */ - private Long deferredDeleteSyncTimeInUtc; - - /* - * Additional information with this backup item. - */ - private MabFileFolderProtectedItemExtendedInfo extendedInfo; - - /** - * Creates an instance of MabFileFolderProtectedItem class. - */ - public MabFileFolderProtectedItem() { - } - - /** - * Get the protectedItemType property: backup item type. - * - * @return the protectedItemType value. - */ - @Override - public String protectedItemType() { - return this.protectedItemType; - } - - /** - * Get the friendlyName property: Friendly name of this backup item. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.friendlyName; - } - - /** - * Set the friendlyName property: Friendly name of this backup item. - * - * @param friendlyName the friendlyName value to set. - * @return the MabFileFolderProtectedItem object itself. - */ - public MabFileFolderProtectedItem withFriendlyName(String friendlyName) { - this.friendlyName = friendlyName; - return this; - } - - /** - * Get the computerName property: Name of the computer associated with this backup item. - * - * @return the computerName value. - */ - public String computerName() { - return this.computerName; - } - - /** - * Set the computerName property: Name of the computer associated with this backup item. - * - * @param computerName the computerName value to set. - * @return the MabFileFolderProtectedItem object itself. - */ - public MabFileFolderProtectedItem withComputerName(String computerName) { - this.computerName = computerName; - return this; - } - - /** - * Get the lastBackupStatus property: Status of last backup operation. - * - * @return the lastBackupStatus value. - */ - public String lastBackupStatus() { - return this.lastBackupStatus; - } - - /** - * Set the lastBackupStatus property: Status of last backup operation. - * - * @param lastBackupStatus the lastBackupStatus value to set. - * @return the MabFileFolderProtectedItem object itself. - */ - public MabFileFolderProtectedItem withLastBackupStatus(String lastBackupStatus) { - this.lastBackupStatus = lastBackupStatus; - return this; - } - - /** - * Get the lastBackupTime property: Timestamp of the last backup operation on this backup item. - * - * @return the lastBackupTime value. - */ - public OffsetDateTime lastBackupTime() { - return this.lastBackupTime; - } - - /** - * Set the lastBackupTime property: Timestamp of the last backup operation on this backup item. - * - * @param lastBackupTime the lastBackupTime value to set. - * @return the MabFileFolderProtectedItem object itself. - */ - public MabFileFolderProtectedItem withLastBackupTime(OffsetDateTime lastBackupTime) { - this.lastBackupTime = lastBackupTime; - return this; - } - - /** - * Get the protectionState property: Protected, ProtectionStopped, IRPending or ProtectionError. - * - * @return the protectionState value. - */ - public String protectionState() { - return this.protectionState; - } - - /** - * Set the protectionState property: Protected, ProtectionStopped, IRPending or ProtectionError. - * - * @param protectionState the protectionState value to set. - * @return the MabFileFolderProtectedItem object itself. - */ - public MabFileFolderProtectedItem withProtectionState(String protectionState) { - this.protectionState = protectionState; - return this; - } - - /** - * Get the deferredDeleteSyncTimeInUtc property: Sync time for deferred deletion in UTC. - * - * @return the deferredDeleteSyncTimeInUtc value. - */ - public Long deferredDeleteSyncTimeInUtc() { - return this.deferredDeleteSyncTimeInUtc; - } - - /** - * Set the deferredDeleteSyncTimeInUtc property: Sync time for deferred deletion in UTC. - * - * @param deferredDeleteSyncTimeInUtc the deferredDeleteSyncTimeInUtc value to set. - * @return the MabFileFolderProtectedItem object itself. - */ - public MabFileFolderProtectedItem withDeferredDeleteSyncTimeInUtc(Long deferredDeleteSyncTimeInUtc) { - this.deferredDeleteSyncTimeInUtc = deferredDeleteSyncTimeInUtc; - return this; - } - - /** - * Get the extendedInfo property: Additional information with this backup item. - * - * @return the extendedInfo value. - */ - public MabFileFolderProtectedItemExtendedInfo extendedInfo() { - return this.extendedInfo; - } - - /** - * Set the extendedInfo property: Additional information with this backup item. - * - * @param extendedInfo the extendedInfo value to set. - * @return the MabFileFolderProtectedItem object itself. - */ - public MabFileFolderProtectedItem withExtendedInfo(MabFileFolderProtectedItemExtendedInfo extendedInfo) { - this.extendedInfo = extendedInfo; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabFileFolderProtectedItem withContainerName(String containerName) { - super.withContainerName(containerName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabFileFolderProtectedItem withSourceResourceId(String sourceResourceId) { - super.withSourceResourceId(sourceResourceId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabFileFolderProtectedItem withPolicyId(String policyId) { - super.withPolicyId(policyId); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabFileFolderProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { - super.withLastRecoveryPoint(lastRecoveryPoint); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabFileFolderProtectedItem withBackupSetName(String backupSetName) { - super.withBackupSetName(backupSetName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabFileFolderProtectedItem withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabFileFolderProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { - super.withDeferredDeleteTimeInUtc(deferredDeleteTimeInUtc); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabFileFolderProtectedItem withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { - super.withIsScheduledForDeferredDelete(isScheduledForDeferredDelete); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabFileFolderProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { - super.withDeferredDeleteTimeRemaining(deferredDeleteTimeRemaining); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabFileFolderProtectedItem withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { - super.withIsDeferredDeleteScheduleUpcoming(isDeferredDeleteScheduleUpcoming); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabFileFolderProtectedItem withIsRehydrate(Boolean isRehydrate) { - super.withIsRehydrate(isRehydrate); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabFileFolderProtectedItem withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabFileFolderProtectedItem withIsArchiveEnabled(Boolean isArchiveEnabled) { - super.withIsArchiveEnabled(isArchiveEnabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabFileFolderProtectedItem withPolicyName(String policyName) { - super.withPolicyName(policyName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabFileFolderProtectedItem withSoftDeleteRetentionPeriodInDays(Integer softDeleteRetentionPeriodInDays) { - super.withSoftDeleteRetentionPeriodInDays(softDeleteRetentionPeriodInDays); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabFileFolderProtectedItem withSourceSideScanInfo(SourceSideScanInfo sourceSideScanInfo) { - super.withSourceSideScanInfo(sourceSideScanInfo); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("containerName", containerName()); - jsonWriter.writeStringField("sourceResourceId", sourceResourceId()); - jsonWriter.writeStringField("policyId", policyId()); - jsonWriter.writeStringField("lastRecoveryPoint", - lastRecoveryPoint() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(lastRecoveryPoint())); - jsonWriter.writeStringField("backupSetName", backupSetName()); - jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString()); - jsonWriter.writeStringField("deferredDeleteTimeInUTC", - deferredDeleteTimeInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(deferredDeleteTimeInUtc())); - jsonWriter.writeBooleanField("isScheduledForDeferredDelete", isScheduledForDeferredDelete()); - jsonWriter.writeStringField("deferredDeleteTimeRemaining", deferredDeleteTimeRemaining()); - jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", isDeferredDeleteScheduleUpcoming()); - jsonWriter.writeBooleanField("isRehydrate", isRehydrate()); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("isArchiveEnabled", isArchiveEnabled()); - jsonWriter.writeStringField("policyName", policyName()); - jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", softDeleteRetentionPeriodInDays()); - jsonWriter.writeJsonField("sourceSideScanInfo", sourceSideScanInfo()); - jsonWriter.writeStringField("protectedItemType", this.protectedItemType); - jsonWriter.writeStringField("friendlyName", this.friendlyName); - jsonWriter.writeStringField("computerName", this.computerName); - jsonWriter.writeStringField("lastBackupStatus", this.lastBackupStatus); - jsonWriter.writeStringField("lastBackupTime", - this.lastBackupTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastBackupTime)); - jsonWriter.writeStringField("protectionState", this.protectionState); - jsonWriter.writeNumberField("deferredDeleteSyncTimeInUTC", this.deferredDeleteSyncTimeInUtc); - jsonWriter.writeJsonField("extendedInfo", this.extendedInfo); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MabFileFolderProtectedItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MabFileFolderProtectedItem 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 MabFileFolderProtectedItem. - */ - public static MabFileFolderProtectedItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MabFileFolderProtectedItem deserializedMabFileFolderProtectedItem = new MabFileFolderProtectedItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedMabFileFolderProtectedItem - .withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("workloadType".equals(fieldName)) { - deserializedMabFileFolderProtectedItem - .withWorkloadType(DataSourceType.fromString(reader.getString())); - } else if ("containerName".equals(fieldName)) { - deserializedMabFileFolderProtectedItem.withContainerName(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedMabFileFolderProtectedItem.withSourceResourceId(reader.getString()); - } else if ("policyId".equals(fieldName)) { - deserializedMabFileFolderProtectedItem.withPolicyId(reader.getString()); - } else if ("lastRecoveryPoint".equals(fieldName)) { - deserializedMabFileFolderProtectedItem.withLastRecoveryPoint(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("backupSetName".equals(fieldName)) { - deserializedMabFileFolderProtectedItem.withBackupSetName(reader.getString()); - } else if ("createMode".equals(fieldName)) { - deserializedMabFileFolderProtectedItem.withCreateMode(CreateMode.fromString(reader.getString())); - } else if ("deferredDeleteTimeInUTC".equals(fieldName)) { - deserializedMabFileFolderProtectedItem.withDeferredDeleteTimeInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("isScheduledForDeferredDelete".equals(fieldName)) { - deserializedMabFileFolderProtectedItem - .withIsScheduledForDeferredDelete(reader.getNullable(JsonReader::getBoolean)); - } else if ("deferredDeleteTimeRemaining".equals(fieldName)) { - deserializedMabFileFolderProtectedItem.withDeferredDeleteTimeRemaining(reader.getString()); - } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) { - deserializedMabFileFolderProtectedItem - .withIsDeferredDeleteScheduleUpcoming(reader.getNullable(JsonReader::getBoolean)); - } else if ("isRehydrate".equals(fieldName)) { - deserializedMabFileFolderProtectedItem.withIsRehydrate(reader.getNullable(JsonReader::getBoolean)); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedMabFileFolderProtectedItem - .withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("isArchiveEnabled".equals(fieldName)) { - deserializedMabFileFolderProtectedItem - .withIsArchiveEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("policyName".equals(fieldName)) { - deserializedMabFileFolderProtectedItem.withPolicyName(reader.getString()); - } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) { - deserializedMabFileFolderProtectedItem - .withSoftDeleteRetentionPeriodInDays(reader.getNullable(JsonReader::getInt)); - } else if ("vaultId".equals(fieldName)) { - deserializedMabFileFolderProtectedItem.withVaultId(reader.getString()); - } else if ("sourceSideScanInfo".equals(fieldName)) { - deserializedMabFileFolderProtectedItem.withSourceSideScanInfo(SourceSideScanInfo.fromJson(reader)); - } else if ("protectedItemType".equals(fieldName)) { - deserializedMabFileFolderProtectedItem.protectedItemType = reader.getString(); - } else if ("friendlyName".equals(fieldName)) { - deserializedMabFileFolderProtectedItem.friendlyName = reader.getString(); - } else if ("computerName".equals(fieldName)) { - deserializedMabFileFolderProtectedItem.computerName = reader.getString(); - } else if ("lastBackupStatus".equals(fieldName)) { - deserializedMabFileFolderProtectedItem.lastBackupStatus = reader.getString(); - } else if ("lastBackupTime".equals(fieldName)) { - deserializedMabFileFolderProtectedItem.lastBackupTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("protectionState".equals(fieldName)) { - deserializedMabFileFolderProtectedItem.protectionState = reader.getString(); - } else if ("deferredDeleteSyncTimeInUTC".equals(fieldName)) { - deserializedMabFileFolderProtectedItem.deferredDeleteSyncTimeInUtc - = reader.getNullable(JsonReader::getLong); - } else if ("extendedInfo".equals(fieldName)) { - deserializedMabFileFolderProtectedItem.extendedInfo - = MabFileFolderProtectedItemExtendedInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedMabFileFolderProtectedItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabFileFolderProtectedItemExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabFileFolderProtectedItemExtendedInfo.java deleted file mode 100644 index 97a3fddf3232..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabFileFolderProtectedItemExtendedInfo.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Additional information on the backed up item. - */ -@Fluent -public final class MabFileFolderProtectedItemExtendedInfo - implements JsonSerializable { - /* - * Last time when the agent data synced to service. - */ - private OffsetDateTime lastRefreshedAt; - - /* - * The oldest backup copy available. - */ - private OffsetDateTime oldestRecoveryPoint; - - /* - * Number of backup copies associated with the backup item. - */ - private Integer recoveryPointCount; - - /** - * Creates an instance of MabFileFolderProtectedItemExtendedInfo class. - */ - public MabFileFolderProtectedItemExtendedInfo() { - } - - /** - * Get the lastRefreshedAt property: Last time when the agent data synced to service. - * - * @return the lastRefreshedAt value. - */ - public OffsetDateTime lastRefreshedAt() { - return this.lastRefreshedAt; - } - - /** - * Set the lastRefreshedAt property: Last time when the agent data synced to service. - * - * @param lastRefreshedAt the lastRefreshedAt value to set. - * @return the MabFileFolderProtectedItemExtendedInfo object itself. - */ - public MabFileFolderProtectedItemExtendedInfo withLastRefreshedAt(OffsetDateTime lastRefreshedAt) { - this.lastRefreshedAt = lastRefreshedAt; - return this; - } - - /** - * Get the oldestRecoveryPoint property: The oldest backup copy available. - * - * @return the oldestRecoveryPoint value. - */ - public OffsetDateTime oldestRecoveryPoint() { - return this.oldestRecoveryPoint; - } - - /** - * Set the oldestRecoveryPoint property: The oldest backup copy available. - * - * @param oldestRecoveryPoint the oldestRecoveryPoint value to set. - * @return the MabFileFolderProtectedItemExtendedInfo object itself. - */ - public MabFileFolderProtectedItemExtendedInfo withOldestRecoveryPoint(OffsetDateTime oldestRecoveryPoint) { - this.oldestRecoveryPoint = oldestRecoveryPoint; - return this; - } - - /** - * Get the recoveryPointCount property: Number of backup copies associated with the backup item. - * - * @return the recoveryPointCount value. - */ - public Integer recoveryPointCount() { - return this.recoveryPointCount; - } - - /** - * Set the recoveryPointCount property: Number of backup copies associated with the backup item. - * - * @param recoveryPointCount the recoveryPointCount value to set. - * @return the MabFileFolderProtectedItemExtendedInfo object itself. - */ - public MabFileFolderProtectedItemExtendedInfo withRecoveryPointCount(Integer recoveryPointCount) { - this.recoveryPointCount = recoveryPointCount; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("lastRefreshedAt", - this.lastRefreshedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastRefreshedAt)); - jsonWriter.writeStringField("oldestRecoveryPoint", - this.oldestRecoveryPoint == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.oldestRecoveryPoint)); - jsonWriter.writeNumberField("recoveryPointCount", this.recoveryPointCount); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MabFileFolderProtectedItemExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MabFileFolderProtectedItemExtendedInfo 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 MabFileFolderProtectedItemExtendedInfo. - */ - public static MabFileFolderProtectedItemExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MabFileFolderProtectedItemExtendedInfo deserializedMabFileFolderProtectedItemExtendedInfo - = new MabFileFolderProtectedItemExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("lastRefreshedAt".equals(fieldName)) { - deserializedMabFileFolderProtectedItemExtendedInfo.lastRefreshedAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("oldestRecoveryPoint".equals(fieldName)) { - deserializedMabFileFolderProtectedItemExtendedInfo.oldestRecoveryPoint = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("recoveryPointCount".equals(fieldName)) { - deserializedMabFileFolderProtectedItemExtendedInfo.recoveryPointCount - = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedMabFileFolderProtectedItemExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJob.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJob.java deleted file mode 100644 index 4bfeed7cabe2..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJob.java +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.Duration; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * MAB workload-specific job. - */ -@Immutable -public final class MabJob extends Job { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String jobType = "MabJob"; - - /* - * Time taken by job to run. - */ - private Duration duration; - - /* - * The state/actions applicable on jobs like cancel/retry. - */ - private List actionsInfo; - - /* - * Name of server protecting the DS. - */ - private String mabServerName; - - /* - * Server type of MAB container. - */ - private MabServerType mabServerType; - - /* - * Workload type of backup item. - */ - private WorkloadType workloadType; - - /* - * The errors. - */ - private List errorDetails; - - /* - * Additional information on the job. - */ - private MabJobExtendedInfo extendedInfo; - - /** - * Creates an instance of MabJob class. - */ - private MabJob() { - } - - /** - * Get the jobType property: This property will be used as the discriminator for deciding the specific types in the - * polymorphic chain of types. - * - * @return the jobType value. - */ - @Override - public String jobType() { - return this.jobType; - } - - /** - * Get the duration property: Time taken by job to run. - * - * @return the duration value. - */ - public Duration duration() { - return this.duration; - } - - /** - * Get the actionsInfo property: The state/actions applicable on jobs like cancel/retry. - * - * @return the actionsInfo value. - */ - public List actionsInfo() { - return this.actionsInfo; - } - - /** - * Get the mabServerName property: Name of server protecting the DS. - * - * @return the mabServerName value. - */ - public String mabServerName() { - return this.mabServerName; - } - - /** - * Get the mabServerType property: Server type of MAB container. - * - * @return the mabServerType value. - */ - public MabServerType mabServerType() { - return this.mabServerType; - } - - /** - * Get the workloadType property: Workload type of backup item. - * - * @return the workloadType value. - */ - public WorkloadType workloadType() { - return this.workloadType; - } - - /** - * Get the errorDetails property: The errors. - * - * @return the errorDetails value. - */ - public List errorDetails() { - return this.errorDetails; - } - - /** - * Get the extendedInfo property: Additional information on the job. - * - * @return the extendedInfo value. - */ - public MabJobExtendedInfo extendedInfo() { - return this.extendedInfo; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("entityFriendlyName", entityFriendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("operation", operation()); - jsonWriter.writeStringField("status", status()); - jsonWriter.writeStringField("startTime", - startTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(startTime())); - jsonWriter.writeStringField("endTime", - endTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(endTime())); - jsonWriter.writeStringField("activityId", activityId()); - jsonWriter.writeStringField("jobType", this.jobType); - jsonWriter.writeStringField("duration", CoreUtils.durationToStringWithDays(this.duration)); - jsonWriter.writeArrayField("actionsInfo", this.actionsInfo, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeStringField("mabServerName", this.mabServerName); - jsonWriter.writeStringField("mabServerType", this.mabServerType == null ? null : this.mabServerType.toString()); - jsonWriter.writeStringField("workloadType", this.workloadType == null ? null : this.workloadType.toString()); - jsonWriter.writeArrayField("errorDetails", this.errorDetails, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("extendedInfo", this.extendedInfo); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MabJob from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MabJob 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 MabJob. - */ - public static MabJob fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MabJob deserializedMabJob = new MabJob(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("entityFriendlyName".equals(fieldName)) { - deserializedMabJob.withEntityFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedMabJob.withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("operation".equals(fieldName)) { - deserializedMabJob.withOperation(reader.getString()); - } else if ("status".equals(fieldName)) { - deserializedMabJob.withStatus(reader.getString()); - } else if ("startTime".equals(fieldName)) { - deserializedMabJob.withStartTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("endTime".equals(fieldName)) { - deserializedMabJob.withEndTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("activityId".equals(fieldName)) { - deserializedMabJob.withActivityId(reader.getString()); - } else if ("jobType".equals(fieldName)) { - deserializedMabJob.jobType = reader.getString(); - } else if ("duration".equals(fieldName)) { - deserializedMabJob.duration - = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); - } else if ("actionsInfo".equals(fieldName)) { - List actionsInfo - = reader.readArray(reader1 -> JobSupportedAction.fromString(reader1.getString())); - deserializedMabJob.actionsInfo = actionsInfo; - } else if ("mabServerName".equals(fieldName)) { - deserializedMabJob.mabServerName = reader.getString(); - } else if ("mabServerType".equals(fieldName)) { - deserializedMabJob.mabServerType = MabServerType.fromString(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedMabJob.workloadType = WorkloadType.fromString(reader.getString()); - } else if ("errorDetails".equals(fieldName)) { - List errorDetails = reader.readArray(reader1 -> MabErrorInfo.fromJson(reader1)); - deserializedMabJob.errorDetails = errorDetails; - } else if ("extendedInfo".equals(fieldName)) { - deserializedMabJob.extendedInfo = MabJobExtendedInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedMabJob; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJobExtendedInfo.java deleted file mode 100644 index 6621a23893b8..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJobExtendedInfo.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; -import java.util.Map; - -/** - * Additional information for the MAB workload-specific job. - */ -@Immutable -public final class MabJobExtendedInfo implements JsonSerializable { - /* - * List of tasks for this job. - */ - private List tasksList; - - /* - * The job properties. - */ - private Map propertyBag; - - /* - * Non localized error message specific to this job. - */ - private String dynamicErrorMessage; - - /** - * Creates an instance of MabJobExtendedInfo class. - */ - private MabJobExtendedInfo() { - } - - /** - * Get the tasksList property: List of tasks for this job. - * - * @return the tasksList value. - */ - public List tasksList() { - return this.tasksList; - } - - /** - * Get the propertyBag property: The job properties. - * - * @return the propertyBag value. - */ - public Map propertyBag() { - return this.propertyBag; - } - - /** - * Get the dynamicErrorMessage property: Non localized error message specific to this job. - * - * @return the dynamicErrorMessage value. - */ - public String dynamicErrorMessage() { - return this.dynamicErrorMessage; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("tasksList", this.tasksList, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeMapField("propertyBag", this.propertyBag, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("dynamicErrorMessage", this.dynamicErrorMessage); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MabJobExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MabJobExtendedInfo 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 MabJobExtendedInfo. - */ - public static MabJobExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MabJobExtendedInfo deserializedMabJobExtendedInfo = new MabJobExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("tasksList".equals(fieldName)) { - List tasksList - = reader.readArray(reader1 -> MabJobTaskDetails.fromJson(reader1)); - deserializedMabJobExtendedInfo.tasksList = tasksList; - } else if ("propertyBag".equals(fieldName)) { - Map propertyBag = reader.readMap(reader1 -> reader1.getString()); - deserializedMabJobExtendedInfo.propertyBag = propertyBag; - } else if ("dynamicErrorMessage".equals(fieldName)) { - deserializedMabJobExtendedInfo.dynamicErrorMessage = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedMabJobExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJobTaskDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJobTaskDetails.java deleted file mode 100644 index e5553ca84911..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabJobTaskDetails.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * MAB workload-specific job task details. - */ -@Immutable -public final class MabJobTaskDetails implements JsonSerializable { - /* - * The task display name. - */ - private String taskId; - - /* - * The start time. - */ - private OffsetDateTime startTime; - - /* - * The end time. - */ - private OffsetDateTime endTime; - - /* - * Time elapsed for task. - */ - private Duration duration; - - /* - * The status. - */ - private String status; - - /** - * Creates an instance of MabJobTaskDetails class. - */ - private MabJobTaskDetails() { - } - - /** - * Get the taskId property: The task display name. - * - * @return the taskId value. - */ - public String taskId() { - return this.taskId; - } - - /** - * Get the startTime property: The start time. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Get the endTime property: The end time. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Get the duration property: Time elapsed for task. - * - * @return the duration value. - */ - public Duration duration() { - return this.duration; - } - - /** - * Get the status property: The status. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("taskId", this.taskId); - jsonWriter.writeStringField("startTime", - this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); - jsonWriter.writeStringField("endTime", - this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); - jsonWriter.writeStringField("duration", CoreUtils.durationToStringWithDays(this.duration)); - jsonWriter.writeStringField("status", this.status); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MabJobTaskDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MabJobTaskDetails 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 MabJobTaskDetails. - */ - public static MabJobTaskDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MabJobTaskDetails deserializedMabJobTaskDetails = new MabJobTaskDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("taskId".equals(fieldName)) { - deserializedMabJobTaskDetails.taskId = reader.getString(); - } else if ("startTime".equals(fieldName)) { - deserializedMabJobTaskDetails.startTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("endTime".equals(fieldName)) { - deserializedMabJobTaskDetails.endTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("duration".equals(fieldName)) { - deserializedMabJobTaskDetails.duration - = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); - } else if ("status".equals(fieldName)) { - deserializedMabJobTaskDetails.status = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedMabJobTaskDetails; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabProtectionPolicy.java deleted file mode 100644 index 3766a9faea46..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabProtectionPolicy.java +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Mab container-specific backup policy. - */ -@Fluent -public final class MabProtectionPolicy extends ProtectionPolicy { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String backupManagementType = "MAB"; - - /* - * Backup schedule of backup policy. - */ - private SchedulePolicy schedulePolicy; - - /* - * Retention policy details. - */ - private RetentionPolicy retentionPolicy; - - /** - * Creates an instance of MabProtectionPolicy class. - */ - public MabProtectionPolicy() { - } - - /** - * Get the backupManagementType property: This property will be used as the discriminator for deciding the specific - * types in the polymorphic chain of types. - * - * @return the backupManagementType value. - */ - @Override - public String backupManagementType() { - return this.backupManagementType; - } - - /** - * Get the schedulePolicy property: Backup schedule of backup policy. - * - * @return the schedulePolicy value. - */ - public SchedulePolicy schedulePolicy() { - return this.schedulePolicy; - } - - /** - * Set the schedulePolicy property: Backup schedule of backup policy. - * - * @param schedulePolicy the schedulePolicy value to set. - * @return the MabProtectionPolicy object itself. - */ - public MabProtectionPolicy withSchedulePolicy(SchedulePolicy schedulePolicy) { - this.schedulePolicy = schedulePolicy; - return this; - } - - /** - * Get the retentionPolicy property: Retention policy details. - * - * @return the retentionPolicy value. - */ - public RetentionPolicy retentionPolicy() { - return this.retentionPolicy; - } - - /** - * Set the retentionPolicy property: Retention policy details. - * - * @param retentionPolicy the retentionPolicy value to set. - * @return the MabProtectionPolicy object itself. - */ - public MabProtectionPolicy withRetentionPolicy(RetentionPolicy retentionPolicy) { - this.retentionPolicy = retentionPolicy; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabProtectionPolicy withProtectedItemsCount(Integer protectedItemsCount) { - super.withProtectedItemsCount(protectedItemsCount); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MabProtectionPolicy withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - super.withResourceGuardOperationRequests(resourceGuardOperationRequests); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("protectedItemsCount", protectedItemsCount()); - jsonWriter.writeArrayField("resourceGuardOperationRequests", resourceGuardOperationRequests(), - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("backupManagementType", this.backupManagementType); - jsonWriter.writeJsonField("schedulePolicy", this.schedulePolicy); - jsonWriter.writeJsonField("retentionPolicy", this.retentionPolicy); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MabProtectionPolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MabProtectionPolicy 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 MabProtectionPolicy. - */ - public static MabProtectionPolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MabProtectionPolicy deserializedMabProtectionPolicy = new MabProtectionPolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("protectedItemsCount".equals(fieldName)) { - deserializedMabProtectionPolicy.withProtectedItemsCount(reader.getNullable(JsonReader::getInt)); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedMabProtectionPolicy.withResourceGuardOperationRequests(resourceGuardOperationRequests); - } else if ("backupManagementType".equals(fieldName)) { - deserializedMabProtectionPolicy.backupManagementType = reader.getString(); - } else if ("schedulePolicy".equals(fieldName)) { - deserializedMabProtectionPolicy.schedulePolicy = SchedulePolicy.fromJson(reader); - } else if ("retentionPolicy".equals(fieldName)) { - deserializedMabProtectionPolicy.retentionPolicy = RetentionPolicy.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedMabProtectionPolicy; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabServerType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabServerType.java deleted file mode 100644 index 8d9bf8bf64e9..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MabServerType.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Server type of MAB container. - */ -public final class MabServerType extends ExpandableStringEnum { - /** - * Static value Invalid for MabServerType. - */ - public static final MabServerType INVALID = fromString("Invalid"); - - /** - * Static value Unknown for MabServerType. - */ - public static final MabServerType UNKNOWN = fromString("Unknown"); - - /** - * Static value IaasVMContainer for MabServerType. - */ - public static final MabServerType IAAS_VMCONTAINER = fromString("IaasVMContainer"); - - /** - * Static value IaasVMServiceContainer for MabServerType. - */ - public static final MabServerType IAAS_VMSERVICE_CONTAINER = fromString("IaasVMServiceContainer"); - - /** - * Static value DPMContainer for MabServerType. - */ - public static final MabServerType DPMCONTAINER = fromString("DPMContainer"); - - /** - * Static value AzureBackupServerContainer for MabServerType. - */ - public static final MabServerType AZURE_BACKUP_SERVER_CONTAINER = fromString("AzureBackupServerContainer"); - - /** - * Static value MABContainer for MabServerType. - */ - public static final MabServerType MABCONTAINER = fromString("MABContainer"); - - /** - * Static value Cluster for MabServerType. - */ - public static final MabServerType CLUSTER = fromString("Cluster"); - - /** - * Static value AzureSqlContainer for MabServerType. - */ - public static final MabServerType AZURE_SQL_CONTAINER = fromString("AzureSqlContainer"); - - /** - * Static value Windows for MabServerType. - */ - public static final MabServerType WINDOWS = fromString("Windows"); - - /** - * Static value VCenter for MabServerType. - */ - public static final MabServerType VCENTER = fromString("VCenter"); - - /** - * Static value VMAppContainer for MabServerType. - */ - public static final MabServerType VMAPP_CONTAINER = fromString("VMAppContainer"); - - /** - * Static value SQLAGWorkLoadContainer for MabServerType. - */ - public static final MabServerType SQLAGWORK_LOAD_CONTAINER = fromString("SQLAGWorkLoadContainer"); - - /** - * Static value StorageContainer for MabServerType. - */ - public static final MabServerType STORAGE_CONTAINER = fromString("StorageContainer"); - - /** - * Static value GenericContainer for MabServerType. - */ - public static final MabServerType GENERIC_CONTAINER = fromString("GenericContainer"); - - /** - * Creates a new instance of MabServerType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public MabServerType() { - } - - /** - * Creates or finds a MabServerType from its string representation. - * - * @param name a name to look for. - * @return the corresponding MabServerType. - */ - public static MabServerType fromString(String name) { - return fromString(name, MabServerType.class); - } - - /** - * Gets known MabServerType values. - * - * @return known MabServerType values. - */ - public static Collection values() { - return values(MabServerType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MonthOfYear.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MonthOfYear.java deleted file mode 100644 index 5d2a02adee53..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MonthOfYear.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -/** - * Defines values for MonthOfYear. - */ -public enum MonthOfYear { - /** - * Enum value Invalid. - */ - INVALID("Invalid"), - - /** - * Enum value January. - */ - JANUARY("January"), - - /** - * Enum value February. - */ - FEBRUARY("February"), - - /** - * Enum value March. - */ - MARCH("March"), - - /** - * Enum value April. - */ - APRIL("April"), - - /** - * Enum value May. - */ - MAY("May"), - - /** - * Enum value June. - */ - JUNE("June"), - - /** - * Enum value July. - */ - JULY("July"), - - /** - * Enum value August. - */ - AUGUST("August"), - - /** - * Enum value September. - */ - SEPTEMBER("September"), - - /** - * Enum value October. - */ - OCTOBER("October"), - - /** - * Enum value November. - */ - NOVEMBER("November"), - - /** - * Enum value December. - */ - DECEMBER("December"); - - /** - * The actual serialized value for a MonthOfYear instance. - */ - private final String value; - - MonthOfYear(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a MonthOfYear instance. - * - * @param value the serialized value to parse. - * @return the parsed MonthOfYear object, or null if unable to parse. - */ - public static MonthOfYear fromString(String value) { - if (value == null) { - return null; - } - MonthOfYear[] items = MonthOfYear.values(); - for (MonthOfYear item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MonthlyRetentionSchedule.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MonthlyRetentionSchedule.java deleted file mode 100644 index 726020728cef..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MonthlyRetentionSchedule.java +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Monthly retention schedule. - */ -@Fluent -public final class MonthlyRetentionSchedule implements JsonSerializable { - /* - * Retention schedule format type for monthly retention policy. - */ - private RetentionScheduleFormat retentionScheduleFormatType; - - /* - * Daily retention format for monthly retention policy. - */ - private DailyRetentionFormat retentionScheduleDaily; - - /* - * Weekly retention format for monthly retention policy. - */ - private WeeklyRetentionFormat retentionScheduleWeekly; - - /* - * Retention times of retention policy. - */ - private List retentionTimes; - - /* - * Retention duration of retention Policy. - */ - private RetentionDuration retentionDuration; - - /** - * Creates an instance of MonthlyRetentionSchedule class. - */ - public MonthlyRetentionSchedule() { - } - - /** - * Get the retentionScheduleFormatType property: Retention schedule format type for monthly retention policy. - * - * @return the retentionScheduleFormatType value. - */ - public RetentionScheduleFormat retentionScheduleFormatType() { - return this.retentionScheduleFormatType; - } - - /** - * Set the retentionScheduleFormatType property: Retention schedule format type for monthly retention policy. - * - * @param retentionScheduleFormatType the retentionScheduleFormatType value to set. - * @return the MonthlyRetentionSchedule object itself. - */ - public MonthlyRetentionSchedule - withRetentionScheduleFormatType(RetentionScheduleFormat retentionScheduleFormatType) { - this.retentionScheduleFormatType = retentionScheduleFormatType; - return this; - } - - /** - * Get the retentionScheduleDaily property: Daily retention format for monthly retention policy. - * - * @return the retentionScheduleDaily value. - */ - public DailyRetentionFormat retentionScheduleDaily() { - return this.retentionScheduleDaily; - } - - /** - * Set the retentionScheduleDaily property: Daily retention format for monthly retention policy. - * - * @param retentionScheduleDaily the retentionScheduleDaily value to set. - * @return the MonthlyRetentionSchedule object itself. - */ - public MonthlyRetentionSchedule withRetentionScheduleDaily(DailyRetentionFormat retentionScheduleDaily) { - this.retentionScheduleDaily = retentionScheduleDaily; - return this; - } - - /** - * Get the retentionScheduleWeekly property: Weekly retention format for monthly retention policy. - * - * @return the retentionScheduleWeekly value. - */ - public WeeklyRetentionFormat retentionScheduleWeekly() { - return this.retentionScheduleWeekly; - } - - /** - * Set the retentionScheduleWeekly property: Weekly retention format for monthly retention policy. - * - * @param retentionScheduleWeekly the retentionScheduleWeekly value to set. - * @return the MonthlyRetentionSchedule object itself. - */ - public MonthlyRetentionSchedule withRetentionScheduleWeekly(WeeklyRetentionFormat retentionScheduleWeekly) { - this.retentionScheduleWeekly = retentionScheduleWeekly; - return this; - } - - /** - * Get the retentionTimes property: Retention times of retention policy. - * - * @return the retentionTimes value. - */ - public List retentionTimes() { - return this.retentionTimes; - } - - /** - * Set the retentionTimes property: Retention times of retention policy. - * - * @param retentionTimes the retentionTimes value to set. - * @return the MonthlyRetentionSchedule object itself. - */ - public MonthlyRetentionSchedule withRetentionTimes(List retentionTimes) { - this.retentionTimes = retentionTimes; - return this; - } - - /** - * Get the retentionDuration property: Retention duration of retention Policy. - * - * @return the retentionDuration value. - */ - public RetentionDuration retentionDuration() { - return this.retentionDuration; - } - - /** - * Set the retentionDuration property: Retention duration of retention Policy. - * - * @param retentionDuration the retentionDuration value to set. - * @return the MonthlyRetentionSchedule object itself. - */ - public MonthlyRetentionSchedule withRetentionDuration(RetentionDuration retentionDuration) { - this.retentionDuration = retentionDuration; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("retentionScheduleFormatType", - this.retentionScheduleFormatType == null ? null : this.retentionScheduleFormatType.toString()); - jsonWriter.writeJsonField("retentionScheduleDaily", this.retentionScheduleDaily); - jsonWriter.writeJsonField("retentionScheduleWeekly", this.retentionScheduleWeekly); - jsonWriter.writeArrayField("retentionTimes", this.retentionTimes, (writer, element) -> writer - .writeString(element == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(element))); - jsonWriter.writeJsonField("retentionDuration", this.retentionDuration); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MonthlyRetentionSchedule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MonthlyRetentionSchedule 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 MonthlyRetentionSchedule. - */ - public static MonthlyRetentionSchedule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MonthlyRetentionSchedule deserializedMonthlyRetentionSchedule = new MonthlyRetentionSchedule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("retentionScheduleFormatType".equals(fieldName)) { - deserializedMonthlyRetentionSchedule.retentionScheduleFormatType - = RetentionScheduleFormat.fromString(reader.getString()); - } else if ("retentionScheduleDaily".equals(fieldName)) { - deserializedMonthlyRetentionSchedule.retentionScheduleDaily = DailyRetentionFormat.fromJson(reader); - } else if ("retentionScheduleWeekly".equals(fieldName)) { - deserializedMonthlyRetentionSchedule.retentionScheduleWeekly - = WeeklyRetentionFormat.fromJson(reader); - } else if ("retentionTimes".equals(fieldName)) { - List retentionTimes = reader.readArray(reader1 -> reader1 - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - deserializedMonthlyRetentionSchedule.retentionTimes = retentionTimes; - } else if ("retentionDuration".equals(fieldName)) { - deserializedMonthlyRetentionSchedule.retentionDuration = RetentionDuration.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedMonthlyRetentionSchedule; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MoveRPAcrossTiersRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MoveRPAcrossTiersRequest.java deleted file mode 100644 index 231ebc3a8039..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/MoveRPAcrossTiersRequest.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The MoveRPAcrossTiersRequest model. - */ -@Fluent -public final class MoveRPAcrossTiersRequest implements JsonSerializable { - /* - * Gets the class type. - */ - private String objectType; - - /* - * Source tier from where RP needs to be moved - */ - private RecoveryPointTierType sourceTierType; - - /* - * Target tier where RP needs to be moved - */ - private RecoveryPointTierType targetTierType; - - /** - * Creates an instance of MoveRPAcrossTiersRequest class. - */ - public MoveRPAcrossTiersRequest() { - } - - /** - * Get the objectType property: Gets the class type. - * - * @return the objectType value. - */ - public String objectType() { - return this.objectType; - } - - /** - * Set the objectType property: Gets the class type. - * - * @param objectType the objectType value to set. - * @return the MoveRPAcrossTiersRequest object itself. - */ - public MoveRPAcrossTiersRequest withObjectType(String objectType) { - this.objectType = objectType; - return this; - } - - /** - * Get the sourceTierType property: Source tier from where RP needs to be moved. - * - * @return the sourceTierType value. - */ - public RecoveryPointTierType sourceTierType() { - return this.sourceTierType; - } - - /** - * Set the sourceTierType property: Source tier from where RP needs to be moved. - * - * @param sourceTierType the sourceTierType value to set. - * @return the MoveRPAcrossTiersRequest object itself. - */ - public MoveRPAcrossTiersRequest withSourceTierType(RecoveryPointTierType sourceTierType) { - this.sourceTierType = sourceTierType; - return this; - } - - /** - * Get the targetTierType property: Target tier where RP needs to be moved. - * - * @return the targetTierType value. - */ - public RecoveryPointTierType targetTierType() { - return this.targetTierType; - } - - /** - * Set the targetTierType property: Target tier where RP needs to be moved. - * - * @param targetTierType the targetTierType value to set. - * @return the MoveRPAcrossTiersRequest object itself. - */ - public MoveRPAcrossTiersRequest withTargetTierType(RecoveryPointTierType targetTierType) { - this.targetTierType = targetTierType; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("sourceTierType", - this.sourceTierType == null ? null : this.sourceTierType.toString()); - jsonWriter.writeStringField("targetTierType", - this.targetTierType == null ? null : this.targetTierType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MoveRPAcrossTiersRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MoveRPAcrossTiersRequest 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 MoveRPAcrossTiersRequest. - */ - public static MoveRPAcrossTiersRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MoveRPAcrossTiersRequest deserializedMoveRPAcrossTiersRequest = new MoveRPAcrossTiersRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedMoveRPAcrossTiersRequest.objectType = reader.getString(); - } else if ("sourceTierType".equals(fieldName)) { - deserializedMoveRPAcrossTiersRequest.sourceTierType - = RecoveryPointTierType.fromString(reader.getString()); - } else if ("targetTierType".equals(fieldName)) { - deserializedMoveRPAcrossTiersRequest.targetTierType - = RecoveryPointTierType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedMoveRPAcrossTiersRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/NameInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/NameInfo.java deleted file mode 100644 index 1048289ec65e..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/NameInfo.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The name of usage. - */ -@Immutable -public final class NameInfo implements JsonSerializable { - /* - * Value of usage. - */ - private String value; - - /* - * Localized value of usage. - */ - private String localizedValue; - - /** - * Creates an instance of NameInfo class. - */ - private NameInfo() { - } - - /** - * Get the value property: Value of usage. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Get the localizedValue property: Localized value of usage. - * - * @return the localizedValue value. - */ - public String localizedValue() { - return this.localizedValue; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("value", this.value); - jsonWriter.writeStringField("localizedValue", this.localizedValue); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of NameInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of NameInfo 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 NameInfo. - */ - public static NameInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - NameInfo deserializedNameInfo = new NameInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - deserializedNameInfo.value = reader.getString(); - } else if ("localizedValue".equals(fieldName)) { - deserializedNameInfo.localizedValue = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedNameInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationOperations.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationOperations.java deleted file mode 100644 index a80e2807ac2b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationOperations.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of OperationOperations. - */ -public interface OperationOperations { - /** - * Validate operation for specified backed up item. This is a synchronous operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - Response validateWithResponse(String vaultName, String resourceGroupName, - ValidateOperationRequestResource parameters, Context context); - - /** - * Validate operation for specified backed up item. This is a synchronous operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - ValidateOperationsResponse validate(String vaultName, String resourceGroupName, - ValidateOperationRequestResource parameters); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationResultInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationResultInfo.java deleted file mode 100644 index 8ba580c064d9..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationResultInfo.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Operation result info. - */ -@Immutable -public final class OperationResultInfo extends OperationResultInfoBase { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "OperationResultInfo"; - - /* - * List of jobs created by this operation. - */ - private List jobList; - - /** - * Creates an instance of OperationResultInfo class. - */ - private OperationResultInfo() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the jobList property: List of jobs created by this operation. - * - * @return the jobList value. - */ - public List jobList() { - return this.jobList; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeArrayField("jobList", this.jobList, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationResultInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationResultInfo 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 OperationResultInfo. - */ - public static OperationResultInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationResultInfo deserializedOperationResultInfo = new OperationResultInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedOperationResultInfo.objectType = reader.getString(); - } else if ("jobList".equals(fieldName)) { - List jobList = reader.readArray(reader1 -> reader1.getString()); - deserializedOperationResultInfo.jobList = jobList; - } else { - reader.skipChildren(); - } - } - - return deserializedOperationResultInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationResultInfoBase.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationResultInfoBase.java deleted file mode 100644 index b0bf29ea9391..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationResultInfoBase.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Base class for operation result info. - */ -@Immutable -public class OperationResultInfoBase implements JsonSerializable { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "OperationResultInfoBase"; - - /** - * Creates an instance of OperationResultInfoBase class. - */ - protected OperationResultInfoBase() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - public String objectType() { - return this.objectType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationResultInfoBase from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationResultInfoBase 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 OperationResultInfoBase. - */ - public static OperationResultInfoBase fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("ExportJobsOperationResultInfo".equals(discriminatorValue)) { - return ExportJobsOperationResultInfo.fromJson(readerToUse.reset()); - } else if ("OperationResultInfo".equals(discriminatorValue)) { - return OperationResultInfo.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static OperationResultInfoBase fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationResultInfoBase deserializedOperationResultInfoBase = new OperationResultInfoBase(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedOperationResultInfoBase.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationResultInfoBase; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationResultInfoBaseResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationResultInfoBaseResource.java deleted file mode 100644 index 87737c58ac0c..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationResultInfoBaseResource.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationResultInfoBaseResourceInner; -import java.util.List; -import java.util.Map; - -/** - * An immutable client-side representation of OperationResultInfoBaseResource. - */ -public interface OperationResultInfoBaseResource { - /** - * Gets the statusCode property: HTTP Status Code of the operation. - * - * @return the statusCode value. - */ - HttpStatusCode statusCode(); - - /** - * Gets the headers property: HTTP headers associated with this operation. - * - * @return the headers value. - */ - Map> headers(); - - /** - * Gets the operation property: OperationResultInfoBaseResource operation. - * - * @return the operation value. - */ - OperationResultInfoBase operation(); - - /** - * Gets the inner - * com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationResultInfoBaseResourceInner object. - * - * @return the inner object. - */ - OperationResultInfoBaseResourceInner innerModel(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatus.java deleted file mode 100644 index b1223f3564ea..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatus.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; -import java.time.OffsetDateTime; - -/** - * An immutable client-side representation of OperationStatus. - */ -public interface OperationStatus { - /** - * Gets the id property: ID of the operation. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: Name of the operation. - * - * @return the name value. - */ - String name(); - - /** - * Gets the status property: Operation status. - * - * @return the status value. - */ - OperationStatusValues status(); - - /** - * Gets the startTime property: Operation start time. Format: ISO-8601. - * - * @return the startTime value. - */ - OffsetDateTime startTime(); - - /** - * Gets the endTime property: Operation end time. Format: ISO-8601. - * - * @return the endTime value. - */ - OffsetDateTime endTime(); - - /** - * Gets the error property: Error information related to this operation. - * - * @return the error value. - */ - OperationStatusError error(); - - /** - * Gets the properties property: Additional information associated with this operation. - * - * @return the properties value. - */ - OperationStatusExtendedInfo properties(); - - /** - * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner object. - * - * @return the inner object. - */ - OperationStatusInner innerModel(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusError.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusError.java deleted file mode 100644 index e670721a1486..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusError.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Error information associated with operation status call. - */ -@Immutable -public final class OperationStatusError implements JsonSerializable { - /* - * Error code of the operation failure. - */ - private String code; - - /* - * Error message displayed if the operation failure. - */ - private String message; - - /** - * Creates an instance of OperationStatusError class. - */ - private OperationStatusError() { - } - - /** - * Get the code property: Error code of the operation failure. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Get the message property: Error message displayed if the operation failure. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("code", this.code); - jsonWriter.writeStringField("message", this.message); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationStatusError from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationStatusError 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 OperationStatusError. - */ - public static OperationStatusError fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationStatusError deserializedOperationStatusError = new OperationStatusError(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("code".equals(fieldName)) { - deserializedOperationStatusError.code = reader.getString(); - } else if ("message".equals(fieldName)) { - deserializedOperationStatusError.message = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationStatusError; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusExtendedInfo.java deleted file mode 100644 index efd2de8cd6cd..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusExtendedInfo.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Base class for additional information of operation status. - */ -@Immutable -public class OperationStatusExtendedInfo implements JsonSerializable { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "OperationStatusExtendedInfo"; - - /** - * Creates an instance of OperationStatusExtendedInfo class. - */ - protected OperationStatusExtendedInfo() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - public String objectType() { - return this.objectType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationStatusExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationStatusExtendedInfo 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 OperationStatusExtendedInfo. - */ - public static OperationStatusExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("OperationStatusJobExtendedInfo".equals(discriminatorValue)) { - return OperationStatusJobExtendedInfo.fromJson(readerToUse.reset()); - } else if ("OperationStatusJobsExtendedInfo".equals(discriminatorValue)) { - return OperationStatusJobsExtendedInfo.fromJson(readerToUse.reset()); - } else if ("OperationStatusProvisionILRExtendedInfo".equals(discriminatorValue)) { - return OperationStatusProvisionIlrExtendedInfo.fromJson(readerToUse.reset()); - } else if ("OperationStatusValidateOperationExtendedInfo".equals(discriminatorValue)) { - return OperationStatusValidateOperationExtendedInfo.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static OperationStatusExtendedInfo fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationStatusExtendedInfo deserializedOperationStatusExtendedInfo = new OperationStatusExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedOperationStatusExtendedInfo.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationStatusExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusJobExtendedInfo.java deleted file mode 100644 index 35c31bb97e20..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusJobExtendedInfo.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Operation status job extended info. - */ -@Immutable -public final class OperationStatusJobExtendedInfo extends OperationStatusExtendedInfo { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "OperationStatusJobExtendedInfo"; - - /* - * ID of the job created for this protected item. - */ - private String jobId; - - /** - * Creates an instance of OperationStatusJobExtendedInfo class. - */ - private OperationStatusJobExtendedInfo() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the jobId property: ID of the job created for this protected item. - * - * @return the jobId value. - */ - public String jobId() { - return this.jobId; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("jobId", this.jobId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationStatusJobExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationStatusJobExtendedInfo 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 OperationStatusJobExtendedInfo. - */ - public static OperationStatusJobExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationStatusJobExtendedInfo deserializedOperationStatusJobExtendedInfo - = new OperationStatusJobExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedOperationStatusJobExtendedInfo.objectType = reader.getString(); - } else if ("jobId".equals(fieldName)) { - deserializedOperationStatusJobExtendedInfo.jobId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationStatusJobExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusJobsExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusJobsExtendedInfo.java deleted file mode 100644 index 2ae2be7e0219..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusJobsExtendedInfo.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * Operation status extended info for list of jobs. - */ -@Immutable -public final class OperationStatusJobsExtendedInfo extends OperationStatusExtendedInfo { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "OperationStatusJobsExtendedInfo"; - - /* - * IDs of the jobs created for the protected item. - */ - private List jobIds; - - /* - * Stores all the failed jobs along with the corresponding error codes. - */ - private Map failedJobsError; - - /** - * Creates an instance of OperationStatusJobsExtendedInfo class. - */ - private OperationStatusJobsExtendedInfo() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the jobIds property: IDs of the jobs created for the protected item. - * - * @return the jobIds value. - */ - public List jobIds() { - return this.jobIds; - } - - /** - * Get the failedJobsError property: Stores all the failed jobs along with the corresponding error codes. - * - * @return the failedJobsError value. - */ - public Map failedJobsError() { - return this.failedJobsError; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeArrayField("jobIds", this.jobIds, (writer, element) -> writer.writeString(element)); - jsonWriter.writeMapField("failedJobsError", this.failedJobsError, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationStatusJobsExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationStatusJobsExtendedInfo 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 OperationStatusJobsExtendedInfo. - */ - public static OperationStatusJobsExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationStatusJobsExtendedInfo deserializedOperationStatusJobsExtendedInfo - = new OperationStatusJobsExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedOperationStatusJobsExtendedInfo.objectType = reader.getString(); - } else if ("jobIds".equals(fieldName)) { - List jobIds = reader.readArray(reader1 -> reader1.getString()); - deserializedOperationStatusJobsExtendedInfo.jobIds = jobIds; - } else if ("failedJobsError".equals(fieldName)) { - Map failedJobsError = reader.readMap(reader1 -> reader1.getString()); - deserializedOperationStatusJobsExtendedInfo.failedJobsError = failedJobsError; - } else { - reader.skipChildren(); - } - } - - return deserializedOperationStatusJobsExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusProvisionIlrExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusProvisionIlrExtendedInfo.java deleted file mode 100644 index 30e38ce091c7..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusProvisionIlrExtendedInfo.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Operation status extended info for ILR provision action. - */ -@Immutable -public final class OperationStatusProvisionIlrExtendedInfo extends OperationStatusExtendedInfo { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "OperationStatusProvisionILRExtendedInfo"; - - /* - * Target details for file / folder restore. - */ - private InstantItemRecoveryTarget recoveryTarget; - - /** - * Creates an instance of OperationStatusProvisionIlrExtendedInfo class. - */ - private OperationStatusProvisionIlrExtendedInfo() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the recoveryTarget property: Target details for file / folder restore. - * - * @return the recoveryTarget value. - */ - public InstantItemRecoveryTarget recoveryTarget() { - return this.recoveryTarget; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeJsonField("recoveryTarget", this.recoveryTarget); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationStatusProvisionIlrExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationStatusProvisionIlrExtendedInfo 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 OperationStatusProvisionIlrExtendedInfo. - */ - public static OperationStatusProvisionIlrExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationStatusProvisionIlrExtendedInfo deserializedOperationStatusProvisionIlrExtendedInfo - = new OperationStatusProvisionIlrExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedOperationStatusProvisionIlrExtendedInfo.objectType = reader.getString(); - } else if ("recoveryTarget".equals(fieldName)) { - deserializedOperationStatusProvisionIlrExtendedInfo.recoveryTarget - = InstantItemRecoveryTarget.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationStatusProvisionIlrExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusValidateOperationExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusValidateOperationExtendedInfo.java deleted file mode 100644 index 5ec921598044..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusValidateOperationExtendedInfo.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Operation status extended info for ValidateOperation action. - */ -@Immutable -public final class OperationStatusValidateOperationExtendedInfo extends OperationStatusExtendedInfo { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "OperationStatusValidateOperationExtendedInfo"; - - /* - * Gets the validation operation response - */ - private ValidateOperationResponse validateOperationResponse; - - /** - * Creates an instance of OperationStatusValidateOperationExtendedInfo class. - */ - private OperationStatusValidateOperationExtendedInfo() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the validateOperationResponse property: Gets the validation operation response. - * - * @return the validateOperationResponse value. - */ - public ValidateOperationResponse validateOperationResponse() { - return this.validateOperationResponse; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeJsonField("validateOperationResponse", this.validateOperationResponse); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationStatusValidateOperationExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationStatusValidateOperationExtendedInfo 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 OperationStatusValidateOperationExtendedInfo. - */ - public static OperationStatusValidateOperationExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationStatusValidateOperationExtendedInfo deserializedOperationStatusValidateOperationExtendedInfo - = new OperationStatusValidateOperationExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedOperationStatusValidateOperationExtendedInfo.objectType = reader.getString(); - } else if ("validateOperationResponse".equals(fieldName)) { - deserializedOperationStatusValidateOperationExtendedInfo.validateOperationResponse - = ValidateOperationResponse.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationStatusValidateOperationExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusValues.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusValues.java deleted file mode 100644 index e3f225cbadfd..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationStatusValues.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Operation status. - */ -public final class OperationStatusValues extends ExpandableStringEnum { - /** - * Static value Invalid for OperationStatusValues. - */ - public static final OperationStatusValues INVALID = fromString("Invalid"); - - /** - * Static value InProgress for OperationStatusValues. - */ - public static final OperationStatusValues IN_PROGRESS = fromString("InProgress"); - - /** - * Static value Succeeded for OperationStatusValues. - */ - public static final OperationStatusValues SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Failed for OperationStatusValues. - */ - public static final OperationStatusValues FAILED = fromString("Failed"); - - /** - * Static value Canceled for OperationStatusValues. - */ - public static final OperationStatusValues CANCELED = fromString("Canceled"); - - /** - * Creates a new instance of OperationStatusValues value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public OperationStatusValues() { - } - - /** - * Creates or finds a OperationStatusValues from its string representation. - * - * @param name a name to look for. - * @return the corresponding OperationStatusValues. - */ - public static OperationStatusValues fromString(String name) { - return fromString(name, OperationStatusValues.class); - } - - /** - * Gets known OperationStatusValues values. - * - * @return known OperationStatusValues values. - */ - public static Collection values() { - return values(OperationStatusValues.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationType.java deleted file mode 100644 index 208c9c6b8967..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationType.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Re-Do Operation. - */ -public final class OperationType extends ExpandableStringEnum { - /** - * Static value Invalid for OperationType. - */ - public static final OperationType INVALID = fromString("Invalid"); - - /** - * Static value Register for OperationType. - */ - public static final OperationType REGISTER = fromString("Register"); - - /** - * Static value Reregister for OperationType. - */ - public static final OperationType REREGISTER = fromString("Reregister"); - - /** - * Static value Rehydrate for OperationType. - */ - public static final OperationType REHYDRATE = fromString("Rehydrate"); - - /** - * Creates a new instance of OperationType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public OperationType() { - } - - /** - * Creates or finds a OperationType from its string representation. - * - * @param name a name to look for. - * @return the corresponding OperationType. - */ - public static OperationType fromString(String name) { - return fromString(name, OperationType.class); - } - - /** - * Gets known OperationType values. - * - * @return known OperationType values. - */ - public static Collection values() { - return values(OperationType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationWorkerResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationWorkerResponse.java deleted file mode 100644 index edfd99dcbca7..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationWorkerResponse.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; -import java.util.Map; - -/** - * This is the base class for operation result responses. - */ -@Immutable -public class OperationWorkerResponse implements JsonSerializable { - /* - * HTTP Status Code of the operation. - */ - private HttpStatusCode statusCode; - - /* - * HTTP headers associated with this operation. - */ - private Map> headers; - - /** - * Creates an instance of OperationWorkerResponse class. - */ - protected OperationWorkerResponse() { - } - - /** - * Get the statusCode property: HTTP Status Code of the operation. - * - * @return the statusCode value. - */ - public HttpStatusCode statusCode() { - return this.statusCode; - } - - /** - * Set the statusCode property: HTTP Status Code of the operation. - * - * @param statusCode the statusCode value to set. - * @return the OperationWorkerResponse object itself. - */ - OperationWorkerResponse withStatusCode(HttpStatusCode statusCode) { - this.statusCode = statusCode; - return this; - } - - /** - * Get the headers property: HTTP headers associated with this operation. - * - * @return the headers value. - */ - public Map> headers() { - return this.headers; - } - - /** - * Set the headers property: HTTP headers associated with this operation. - * - * @param headers the headers value to set. - * @return the OperationWorkerResponse object itself. - */ - OperationWorkerResponse withHeaders(Map> headers) { - this.headers = headers; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("statusCode", this.statusCode == null ? null : this.statusCode.toString()); - jsonWriter.writeMapField("headers", this.headers, - (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeString(element1))); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationWorkerResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationWorkerResponse 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 OperationWorkerResponse. - */ - public static OperationWorkerResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationWorkerResponse deserializedOperationWorkerResponse = new OperationWorkerResponse(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("statusCode".equals(fieldName)) { - deserializedOperationWorkerResponse.statusCode = HttpStatusCode.fromString(reader.getString()); - } else if ("headers".equals(fieldName)) { - Map> headers - = reader.readMap(reader1 -> reader1.readArray(reader2 -> reader2.getString())); - deserializedOperationWorkerResponse.headers = headers; - } else { - reader.skipChildren(); - } - } - - return deserializedOperationWorkerResponse; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Operations.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Operations.java deleted file mode 100644 index 0ea505dfe640..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Operations.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of Operations. - */ -public interface Operations { - /** - * List the operations for the provider. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operations List response which contains list of available APIs as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List the operations for the provider. - * - * @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 operations List response which contains list of available APIs as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OverwriteOptions.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OverwriteOptions.java deleted file mode 100644 index d0925f87b516..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OverwriteOptions.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Can Overwrite if Target DataBase already exists. - */ -public final class OverwriteOptions extends ExpandableStringEnum { - /** - * Static value Invalid for OverwriteOptions. - */ - public static final OverwriteOptions INVALID = fromString("Invalid"); - - /** - * Static value FailOnConflict for OverwriteOptions. - */ - public static final OverwriteOptions FAIL_ON_CONFLICT = fromString("FailOnConflict"); - - /** - * Static value Overwrite for OverwriteOptions. - */ - public static final OverwriteOptions OVERWRITE = fromString("Overwrite"); - - /** - * Creates a new instance of OverwriteOptions value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public OverwriteOptions() { - } - - /** - * Creates or finds a OverwriteOptions from its string representation. - * - * @param name a name to look for. - * @return the corresponding OverwriteOptions. - */ - public static OverwriteOptions fromString(String name) { - return fromString(name, OverwriteOptions.class); - } - - /** - * Gets known OverwriteOptions values. - * - * @return known OverwriteOptions values. - */ - public static Collection values() { - return values(OverwriteOptions.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PatchRecoveryPointInput.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PatchRecoveryPointInput.java deleted file mode 100644 index e356ad41c610..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PatchRecoveryPointInput.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Recovery Point Contract for Update Recovery Point API. - */ -@Fluent -public final class PatchRecoveryPointInput implements JsonSerializable { - /* - * Properties of Recovery Point - */ - private PatchRecoveryPointPropertiesInput recoveryPointProperties; - - /** - * Creates an instance of PatchRecoveryPointInput class. - */ - public PatchRecoveryPointInput() { - } - - /** - * Get the recoveryPointProperties property: Properties of Recovery Point. - * - * @return the recoveryPointProperties value. - */ - public PatchRecoveryPointPropertiesInput recoveryPointProperties() { - return this.recoveryPointProperties; - } - - /** - * Set the recoveryPointProperties property: Properties of Recovery Point. - * - * @param recoveryPointProperties the recoveryPointProperties value to set. - * @return the PatchRecoveryPointInput object itself. - */ - public PatchRecoveryPointInput - withRecoveryPointProperties(PatchRecoveryPointPropertiesInput recoveryPointProperties) { - this.recoveryPointProperties = recoveryPointProperties; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("recoveryPointProperties", this.recoveryPointProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PatchRecoveryPointInput from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PatchRecoveryPointInput 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 PatchRecoveryPointInput. - */ - public static PatchRecoveryPointInput fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PatchRecoveryPointInput deserializedPatchRecoveryPointInput = new PatchRecoveryPointInput(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("recoveryPointProperties".equals(fieldName)) { - deserializedPatchRecoveryPointInput.recoveryPointProperties - = PatchRecoveryPointPropertiesInput.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedPatchRecoveryPointInput; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PatchRecoveryPointPropertiesInput.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PatchRecoveryPointPropertiesInput.java deleted file mode 100644 index 6af4b9a44890..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PatchRecoveryPointPropertiesInput.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Recovery Point Properties Contract for Update Recovery Point API. - */ -@Fluent -public final class PatchRecoveryPointPropertiesInput implements JsonSerializable { - /* - * Expiry time of Recovery Point in UTC. - */ - private OffsetDateTime expiryTime; - - /** - * Creates an instance of PatchRecoveryPointPropertiesInput class. - */ - public PatchRecoveryPointPropertiesInput() { - } - - /** - * Get the expiryTime property: Expiry time of Recovery Point in UTC. - * - * @return the expiryTime value. - */ - public OffsetDateTime expiryTime() { - return this.expiryTime; - } - - /** - * Set the expiryTime property: Expiry time of Recovery Point in UTC. - * - * @param expiryTime the expiryTime value to set. - * @return the PatchRecoveryPointPropertiesInput object itself. - */ - public PatchRecoveryPointPropertiesInput withExpiryTime(OffsetDateTime expiryTime) { - this.expiryTime = expiryTime; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("expiryTime", - this.expiryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiryTime)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PatchRecoveryPointPropertiesInput from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PatchRecoveryPointPropertiesInput 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 PatchRecoveryPointPropertiesInput. - */ - public static PatchRecoveryPointPropertiesInput fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PatchRecoveryPointPropertiesInput deserializedPatchRecoveryPointPropertiesInput - = new PatchRecoveryPointPropertiesInput(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("expiryTime".equals(fieldName)) { - deserializedPatchRecoveryPointPropertiesInput.expiryTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedPatchRecoveryPointPropertiesInput; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PointInTimeRange.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PointInTimeRange.java deleted file mode 100644 index 568568813345..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PointInTimeRange.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Provides details for log ranges. - */ -@Immutable -public final class PointInTimeRange implements JsonSerializable { - /* - * Start time of the time range for log recovery. - */ - private OffsetDateTime startTime; - - /* - * End time of the time range for log recovery. - */ - private OffsetDateTime endTime; - - /** - * Creates an instance of PointInTimeRange class. - */ - private PointInTimeRange() { - } - - /** - * Get the startTime property: Start time of the time range for log recovery. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Get the endTime property: End time of the time range for log recovery. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("startTime", - this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); - jsonWriter.writeStringField("endTime", - this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PointInTimeRange from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PointInTimeRange 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 PointInTimeRange. - */ - public static PointInTimeRange fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PointInTimeRange deserializedPointInTimeRange = new PointInTimeRange(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("startTime".equals(fieldName)) { - deserializedPointInTimeRange.startTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("endTime".equals(fieldName)) { - deserializedPointInTimeRange.endTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedPointInTimeRange; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PolicyType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PolicyType.java deleted file mode 100644 index 9428b610980c..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PolicyType.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Type of backup policy type. - */ -public final class PolicyType extends ExpandableStringEnum { - /** - * Static value Invalid for PolicyType. - */ - public static final PolicyType INVALID = fromString("Invalid"); - - /** - * Static value Full for PolicyType. - */ - public static final PolicyType FULL = fromString("Full"); - - /** - * Static value Differential for PolicyType. - */ - public static final PolicyType DIFFERENTIAL = fromString("Differential"); - - /** - * Static value Log for PolicyType. - */ - public static final PolicyType LOG = fromString("Log"); - - /** - * Static value CopyOnlyFull for PolicyType. - */ - public static final PolicyType COPY_ONLY_FULL = fromString("CopyOnlyFull"); - - /** - * Static value Incremental for PolicyType. - */ - public static final PolicyType INCREMENTAL = fromString("Incremental"); - - /** - * Static value SnapshotFull for PolicyType. - */ - public static final PolicyType SNAPSHOT_FULL = fromString("SnapshotFull"); - - /** - * Static value SnapshotCopyOnlyFull for PolicyType. - */ - public static final PolicyType SNAPSHOT_COPY_ONLY_FULL = fromString("SnapshotCopyOnlyFull"); - - /** - * Creates a new instance of PolicyType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public PolicyType() { - } - - /** - * Creates or finds a PolicyType from its string representation. - * - * @param name a name to look for. - * @return the corresponding PolicyType. - */ - public static PolicyType fromString(String name) { - return fromString(name, PolicyType.class); - } - - /** - * Gets known PolicyType values. - * - * @return known PolicyType values. - */ - public static Collection values() { - return values(PolicyType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PreBackupValidation.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PreBackupValidation.java deleted file mode 100644 index d604f8e562cc..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PreBackupValidation.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Pre-backup validation for Azure VM Workload provider. - */ -@Immutable -public final class PreBackupValidation implements JsonSerializable { - /* - * Status of protectable item, i.e. InProgress,Succeeded,Failed - */ - private InquiryStatus status; - - /* - * Error code of protectable item - */ - private String code; - - /* - * Message corresponding to the error code for the protectable item - */ - private String message; - - /** - * Creates an instance of PreBackupValidation class. - */ - private PreBackupValidation() { - } - - /** - * Get the status property: Status of protectable item, i.e. InProgress,Succeeded,Failed. - * - * @return the status value. - */ - public InquiryStatus status() { - return this.status; - } - - /** - * Get the code property: Error code of protectable item. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Get the message property: Message corresponding to the error code for the protectable item. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeStringField("code", this.code); - jsonWriter.writeStringField("message", this.message); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PreBackupValidation from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PreBackupValidation 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 PreBackupValidation. - */ - public static PreBackupValidation fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PreBackupValidation deserializedPreBackupValidation = new PreBackupValidation(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedPreBackupValidation.status = InquiryStatus.fromString(reader.getString()); - } else if ("code".equals(fieldName)) { - deserializedPreBackupValidation.code = reader.getString(); - } else if ("message".equals(fieldName)) { - deserializedPreBackupValidation.message = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPreBackupValidation; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PreValidateEnableBackupRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PreValidateEnableBackupRequest.java deleted file mode 100644 index b5d1f841d25c..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PreValidateEnableBackupRequest.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Contract to validate if backup can be enabled on the given resource in a given vault and given configuration. - * It will validate followings - * 1. Vault capacity - * 2. VM is already protected - * 3. Any VM related configuration passed in properties. - */ -@Fluent -public final class PreValidateEnableBackupRequest implements JsonSerializable { - /* - * ProtectedItem Type- VM, SqlDataBase, AzureFileShare etc - */ - private DataSourceType resourceType; - - /* - * ARM Virtual Machine Id - */ - private String resourceId; - - /* - * ARM id of the Recovery Services Vault - */ - private String vaultId; - - /* - * Configuration of VM if any needs to be validated like OS type etc - */ - private String properties; - - /** - * Creates an instance of PreValidateEnableBackupRequest class. - */ - public PreValidateEnableBackupRequest() { - } - - /** - * Get the resourceType property: ProtectedItem Type- VM, SqlDataBase, AzureFileShare etc. - * - * @return the resourceType value. - */ - public DataSourceType resourceType() { - return this.resourceType; - } - - /** - * Set the resourceType property: ProtectedItem Type- VM, SqlDataBase, AzureFileShare etc. - * - * @param resourceType the resourceType value to set. - * @return the PreValidateEnableBackupRequest object itself. - */ - public PreValidateEnableBackupRequest withResourceType(DataSourceType resourceType) { - this.resourceType = resourceType; - return this; - } - - /** - * Get the resourceId property: ARM Virtual Machine Id. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: ARM Virtual Machine Id. - * - * @param resourceId the resourceId value to set. - * @return the PreValidateEnableBackupRequest object itself. - */ - public PreValidateEnableBackupRequest withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the vaultId property: ARM id of the Recovery Services Vault. - * - * @return the vaultId value. - */ - public String vaultId() { - return this.vaultId; - } - - /** - * Set the vaultId property: ARM id of the Recovery Services Vault. - * - * @param vaultId the vaultId value to set. - * @return the PreValidateEnableBackupRequest object itself. - */ - public PreValidateEnableBackupRequest withVaultId(String vaultId) { - this.vaultId = vaultId; - return this; - } - - /** - * Get the properties property: Configuration of VM if any needs to be validated like OS type etc. - * - * @return the properties value. - */ - public String properties() { - return this.properties; - } - - /** - * Set the properties property: Configuration of VM if any needs to be validated like OS type etc. - * - * @param properties the properties value to set. - * @return the PreValidateEnableBackupRequest object itself. - */ - public PreValidateEnableBackupRequest withProperties(String properties) { - this.properties = properties; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("resourceType", this.resourceType == null ? null : this.resourceType.toString()); - jsonWriter.writeStringField("resourceId", this.resourceId); - jsonWriter.writeStringField("vaultId", this.vaultId); - jsonWriter.writeStringField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PreValidateEnableBackupRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PreValidateEnableBackupRequest 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 PreValidateEnableBackupRequest. - */ - public static PreValidateEnableBackupRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PreValidateEnableBackupRequest deserializedPreValidateEnableBackupRequest - = new PreValidateEnableBackupRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceType".equals(fieldName)) { - deserializedPreValidateEnableBackupRequest.resourceType - = DataSourceType.fromString(reader.getString()); - } else if ("resourceId".equals(fieldName)) { - deserializedPreValidateEnableBackupRequest.resourceId = reader.getString(); - } else if ("vaultId".equals(fieldName)) { - deserializedPreValidateEnableBackupRequest.vaultId = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedPreValidateEnableBackupRequest.properties = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPreValidateEnableBackupRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PreValidateEnableBackupResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PreValidateEnableBackupResponse.java deleted file mode 100644 index e88edbcc4e43..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PreValidateEnableBackupResponse.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.PreValidateEnableBackupResponseInner; - -/** - * An immutable client-side representation of PreValidateEnableBackupResponse. - */ -public interface PreValidateEnableBackupResponse { - /** - * Gets the status property: Validation Status. - * - * @return the status value. - */ - ValidationStatus status(); - - /** - * Gets the errorCode property: Response error code. - * - * @return the errorCode value. - */ - String errorCode(); - - /** - * Gets the errorMessage property: Response error message. - * - * @return the errorMessage value. - */ - String errorMessage(); - - /** - * Gets the recommendation property: Recommended action for user. - * - * @return the recommendation value. - */ - String recommendation(); - - /** - * Gets the containerName property: Specifies the product specific container name. E.g. - * iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required - * for portal. - * - * @return the containerName value. - */ - String containerName(); - - /** - * Gets the protectedItemName property: Specifies the product specific ds name. E.g. - * vm;iaasvmcontainer;rgname;vmname. This is required for portal. - * - * @return the protectedItemName value. - */ - String protectedItemName(); - - /** - * Gets the inner - * com.azure.resourcemanager.recoveryservicesbackup.fluent.models.PreValidateEnableBackupResponseInner object. - * - * @return the inner object. - */ - PreValidateEnableBackupResponseInner innerModel(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrepareDataMoveRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrepareDataMoveRequest.java deleted file mode 100644 index af0be041046a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrepareDataMoveRequest.java +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Prepare DataMove Request. - */ -@Fluent -public final class PrepareDataMoveRequest implements JsonSerializable { - /* - * ARM Id of target vault - */ - private String targetResourceId; - - /* - * Target Region - */ - private String targetRegion; - - /* - * DataMove Level - */ - private DataMoveLevel dataMoveLevel; - - /* - * Source Container ArmIds - * This needs to be populated only if DataMoveLevel is set to container - */ - private List sourceContainerArmIds; - - /* - * Ignore the artifacts which are already moved. - */ - private Boolean ignoreMoved; - - /** - * Creates an instance of PrepareDataMoveRequest class. - */ - public PrepareDataMoveRequest() { - } - - /** - * Get the targetResourceId property: ARM Id of target vault. - * - * @return the targetResourceId value. - */ - public String targetResourceId() { - return this.targetResourceId; - } - - /** - * Set the targetResourceId property: ARM Id of target vault. - * - * @param targetResourceId the targetResourceId value to set. - * @return the PrepareDataMoveRequest object itself. - */ - public PrepareDataMoveRequest withTargetResourceId(String targetResourceId) { - this.targetResourceId = targetResourceId; - return this; - } - - /** - * Get the targetRegion property: Target Region. - * - * @return the targetRegion value. - */ - public String targetRegion() { - return this.targetRegion; - } - - /** - * Set the targetRegion property: Target Region. - * - * @param targetRegion the targetRegion value to set. - * @return the PrepareDataMoveRequest object itself. - */ - public PrepareDataMoveRequest withTargetRegion(String targetRegion) { - this.targetRegion = targetRegion; - return this; - } - - /** - * Get the dataMoveLevel property: DataMove Level. - * - * @return the dataMoveLevel value. - */ - public DataMoveLevel dataMoveLevel() { - return this.dataMoveLevel; - } - - /** - * Set the dataMoveLevel property: DataMove Level. - * - * @param dataMoveLevel the dataMoveLevel value to set. - * @return the PrepareDataMoveRequest object itself. - */ - public PrepareDataMoveRequest withDataMoveLevel(DataMoveLevel dataMoveLevel) { - this.dataMoveLevel = dataMoveLevel; - return this; - } - - /** - * Get the sourceContainerArmIds property: Source Container ArmIds - * This needs to be populated only if DataMoveLevel is set to container. - * - * @return the sourceContainerArmIds value. - */ - public List sourceContainerArmIds() { - return this.sourceContainerArmIds; - } - - /** - * Set the sourceContainerArmIds property: Source Container ArmIds - * This needs to be populated only if DataMoveLevel is set to container. - * - * @param sourceContainerArmIds the sourceContainerArmIds value to set. - * @return the PrepareDataMoveRequest object itself. - */ - public PrepareDataMoveRequest withSourceContainerArmIds(List sourceContainerArmIds) { - this.sourceContainerArmIds = sourceContainerArmIds; - return this; - } - - /** - * Get the ignoreMoved property: Ignore the artifacts which are already moved. - * - * @return the ignoreMoved value. - */ - public Boolean ignoreMoved() { - return this.ignoreMoved; - } - - /** - * Set the ignoreMoved property: Ignore the artifacts which are already moved. - * - * @param ignoreMoved the ignoreMoved value to set. - * @return the PrepareDataMoveRequest object itself. - */ - public PrepareDataMoveRequest withIgnoreMoved(Boolean ignoreMoved) { - this.ignoreMoved = ignoreMoved; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("targetResourceId", this.targetResourceId); - jsonWriter.writeStringField("targetRegion", this.targetRegion); - jsonWriter.writeStringField("dataMoveLevel", this.dataMoveLevel == null ? null : this.dataMoveLevel.toString()); - jsonWriter.writeArrayField("sourceContainerArmIds", this.sourceContainerArmIds, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("ignoreMoved", this.ignoreMoved); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrepareDataMoveRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrepareDataMoveRequest 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 PrepareDataMoveRequest. - */ - public static PrepareDataMoveRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrepareDataMoveRequest deserializedPrepareDataMoveRequest = new PrepareDataMoveRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("targetResourceId".equals(fieldName)) { - deserializedPrepareDataMoveRequest.targetResourceId = reader.getString(); - } else if ("targetRegion".equals(fieldName)) { - deserializedPrepareDataMoveRequest.targetRegion = reader.getString(); - } else if ("dataMoveLevel".equals(fieldName)) { - deserializedPrepareDataMoveRequest.dataMoveLevel = DataMoveLevel.fromString(reader.getString()); - } else if ("sourceContainerArmIds".equals(fieldName)) { - List sourceContainerArmIds = reader.readArray(reader1 -> reader1.getString()); - deserializedPrepareDataMoveRequest.sourceContainerArmIds = sourceContainerArmIds; - } else if ("ignoreMoved".equals(fieldName)) { - deserializedPrepareDataMoveRequest.ignoreMoved = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedPrepareDataMoveRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrepareDataMoveResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrepareDataMoveResponse.java deleted file mode 100644 index 4d105b87cab2..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrepareDataMoveResponse.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.VaultStorageConfigOperationResultResponseInner; -import java.io.IOException; -import java.util.Map; - -/** - * Prepare DataMove Response. - */ -@Immutable -public final class PrepareDataMoveResponse extends VaultStorageConfigOperationResultResponseInner { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "PrepareDataMoveResponse"; - - /* - * Co-relationId for move operation - */ - private String correlationId; - - /* - * Source Vault Properties - */ - private Map sourceVaultProperties; - - /** - * Creates an instance of PrepareDataMoveResponse class. - */ - private PrepareDataMoveResponse() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the correlationId property: Co-relationId for move operation. - * - * @return the correlationId value. - */ - public String correlationId() { - return this.correlationId; - } - - /** - * Get the sourceVaultProperties property: Source Vault Properties. - * - * @return the sourceVaultProperties value. - */ - public Map sourceVaultProperties() { - return this.sourceVaultProperties; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("correlationId", this.correlationId); - jsonWriter.writeMapField("sourceVaultProperties", this.sourceVaultProperties, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrepareDataMoveResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrepareDataMoveResponse 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 PrepareDataMoveResponse. - */ - public static PrepareDataMoveResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrepareDataMoveResponse deserializedPrepareDataMoveResponse = new PrepareDataMoveResponse(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedPrepareDataMoveResponse.objectType = reader.getString(); - } else if ("correlationId".equals(fieldName)) { - deserializedPrepareDataMoveResponse.correlationId = reader.getString(); - } else if ("sourceVaultProperties".equals(fieldName)) { - Map sourceVaultProperties = reader.readMap(reader1 -> reader1.getString()); - deserializedPrepareDataMoveResponse.sourceVaultProperties = sourceVaultProperties; - } else { - reader.skipChildren(); - } - } - - return deserializedPrepareDataMoveResponse; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpoint.java deleted file mode 100644 index 4b5898084bd8..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpoint.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Private Endpoint network resource that is linked to the Private Endpoint connection. - */ -@Fluent -public final class PrivateEndpoint implements JsonSerializable { - /* - * Gets or sets id - */ - private String id; - - /** - * Creates an instance of PrivateEndpoint class. - */ - public PrivateEndpoint() { - } - - /** - * Get the id property: Gets or sets id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Gets or sets id. - * - * @param id the id value to set. - * @return the PrivateEndpoint object itself. - */ - public PrivateEndpoint withId(String id) { - this.id = id; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateEndpoint from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpoint 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 PrivateEndpoint. - */ - public static PrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpoint deserializedPrivateEndpoint = new PrivateEndpoint(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedPrivateEndpoint.id = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpoint; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnection.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnection.java deleted file mode 100644 index 2752d61f23a9..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnection.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Private Endpoint Connection Response Properties. - */ -@Fluent -public final class PrivateEndpointConnection implements JsonSerializable { - /* - * Gets or sets provisioning state of the private endpoint connection - */ - private ProvisioningState provisioningState; - - /* - * Gets or sets private endpoint associated with the private endpoint connection - */ - private PrivateEndpoint privateEndpoint; - - /* - * Group Ids for the Private Endpoint - */ - private List groupIds; - - /* - * Gets or sets private link service connection state - */ - private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; - - /** - * Creates an instance of PrivateEndpointConnection class. - */ - public PrivateEndpointConnection() { - } - - /** - * Get the provisioningState property: Gets or sets provisioning state of the private endpoint connection. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: Gets or sets provisioning state of the private endpoint connection. - * - * @param provisioningState the provisioningState value to set. - * @return the PrivateEndpointConnection object itself. - */ - public PrivateEndpointConnection withProvisioningState(ProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the privateEndpoint property: Gets or sets private endpoint associated with the private endpoint connection. - * - * @return the privateEndpoint value. - */ - public PrivateEndpoint privateEndpoint() { - return this.privateEndpoint; - } - - /** - * Set the privateEndpoint property: Gets or sets private endpoint associated with the private endpoint connection. - * - * @param privateEndpoint the privateEndpoint value to set. - * @return the PrivateEndpointConnection object itself. - */ - public PrivateEndpointConnection withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - this.privateEndpoint = privateEndpoint; - return this; - } - - /** - * Get the groupIds property: Group Ids for the Private Endpoint. - * - * @return the groupIds value. - */ - public List groupIds() { - return this.groupIds; - } - - /** - * Set the groupIds property: Group Ids for the Private Endpoint. - * - * @param groupIds the groupIds value to set. - * @return the PrivateEndpointConnection object itself. - */ - public PrivateEndpointConnection withGroupIds(List groupIds) { - this.groupIds = groupIds; - return this; - } - - /** - * Get the privateLinkServiceConnectionState property: Gets or sets private link service connection state. - * - * @return the privateLinkServiceConnectionState value. - */ - public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { - return this.privateLinkServiceConnectionState; - } - - /** - * Set the privateLinkServiceConnectionState property: Gets or sets private link service connection state. - * - * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. - * @return the PrivateEndpointConnection object itself. - */ - public PrivateEndpointConnection - withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { - this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("provisioningState", - this.provisioningState == null ? null : this.provisioningState.toString()); - jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); - jsonWriter.writeArrayField("groupIds", this.groupIds, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateEndpointConnection from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpointConnection 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 PrivateEndpointConnection. - */ - public static PrivateEndpointConnection fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpointConnection deserializedPrivateEndpointConnection = new PrivateEndpointConnection(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningState".equals(fieldName)) { - deserializedPrivateEndpointConnection.provisioningState - = ProvisioningState.fromString(reader.getString()); - } else if ("privateEndpoint".equals(fieldName)) { - deserializedPrivateEndpointConnection.privateEndpoint = PrivateEndpoint.fromJson(reader); - } else if ("groupIds".equals(fieldName)) { - List groupIds - = reader.readArray(reader1 -> VaultSubResourceType.fromString(reader1.getString())); - deserializedPrivateEndpointConnection.groupIds = groupIds; - } else if ("privateLinkServiceConnectionState".equals(fieldName)) { - deserializedPrivateEndpointConnection.privateLinkServiceConnectionState - = PrivateLinkServiceConnectionState.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpointConnection; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnectionResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnectionResource.java deleted file mode 100644 index 3f605cf3a353..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnectionResource.java +++ /dev/null @@ -1,301 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.PrivateEndpointConnectionResourceInner; -import java.util.Map; - -/** - * An immutable client-side representation of PrivateEndpointConnectionResource. - */ -public interface PrivateEndpointConnectionResource { - /** - * 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: PrivateEndpointConnectionResource properties. - * - * @return the properties value. - */ - PrivateEndpointConnection properties(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the etag property: Optional ETag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner - * com.azure.resourcemanager.recoveryservicesbackup.fluent.models.PrivateEndpointConnectionResourceInner object. - * - * @return the inner object. - */ - PrivateEndpointConnectionResourceInner innerModel(); - - /** - * The entirety of the PrivateEndpointConnectionResource definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The PrivateEndpointConnectionResource definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the PrivateEndpointConnectionResource definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the PrivateEndpointConnectionResource definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies vaultName, resourceGroupName. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @return the next definition stage. - */ - WithCreate withExistingVault(String vaultName, String resourceGroupName); - } - - /** - * The stage of the PrivateEndpointConnectionResource 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.WithLocation, DefinitionStages.WithTags, - DefinitionStages.WithProperties, DefinitionStages.WithEtag { - /** - * Executes the create request. - * - * @return the created resource. - */ - PrivateEndpointConnectionResource create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - PrivateEndpointConnectionResource create(Context context); - } - - /** - * The stage of the PrivateEndpointConnectionResource definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(String location); - } - - /** - * The stage of the PrivateEndpointConnectionResource definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the PrivateEndpointConnectionResource definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: PrivateEndpointConnectionResource properties. - * - * @param properties PrivateEndpointConnectionResource properties. - * @return the next definition stage. - */ - WithCreate withProperties(PrivateEndpointConnection properties); - } - - /** - * The stage of the PrivateEndpointConnectionResource definition allowing to specify etag. - */ - interface WithEtag { - /** - * Specifies the etag property: Optional ETag.. - * - * @param etag Optional ETag. - * @return the next definition stage. - */ - WithCreate withEtag(String etag); - } - } - - /** - * Begins update for the PrivateEndpointConnectionResource resource. - * - * @return the stage of resource update. - */ - PrivateEndpointConnectionResource.Update update(); - - /** - * The template for PrivateEndpointConnectionResource update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithEtag { - /** - * Executes the update request. - * - * @return the updated resource. - */ - PrivateEndpointConnectionResource apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - PrivateEndpointConnectionResource apply(Context context); - } - - /** - * The PrivateEndpointConnectionResource update stages. - */ - interface UpdateStages { - /** - * The stage of the PrivateEndpointConnectionResource update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the PrivateEndpointConnectionResource update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: PrivateEndpointConnectionResource properties. - * - * @param properties PrivateEndpointConnectionResource properties. - * @return the next definition stage. - */ - Update withProperties(PrivateEndpointConnection properties); - } - - /** - * The stage of the PrivateEndpointConnectionResource update allowing to specify etag. - */ - interface WithEtag { - /** - * Specifies the etag property: Optional ETag.. - * - * @param etag Optional ETag. - * @return the next definition stage. - */ - Update withEtag(String etag); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - PrivateEndpointConnectionResource refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - PrivateEndpointConnectionResource refresh(Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnectionStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnectionStatus.java deleted file mode 100644 index 56b1c7159f0d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnectionStatus.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Gets or sets the status. - */ -public final class PrivateEndpointConnectionStatus extends ExpandableStringEnum { - /** - * Static value Pending for PrivateEndpointConnectionStatus. - */ - public static final PrivateEndpointConnectionStatus PENDING = fromString("Pending"); - - /** - * Static value Approved for PrivateEndpointConnectionStatus. - */ - public static final PrivateEndpointConnectionStatus APPROVED = fromString("Approved"); - - /** - * Static value Rejected for PrivateEndpointConnectionStatus. - */ - public static final PrivateEndpointConnectionStatus REJECTED = fromString("Rejected"); - - /** - * Static value Disconnected for PrivateEndpointConnectionStatus. - */ - public static final PrivateEndpointConnectionStatus DISCONNECTED = fromString("Disconnected"); - - /** - * Creates a new instance of PrivateEndpointConnectionStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public PrivateEndpointConnectionStatus() { - } - - /** - * Creates or finds a PrivateEndpointConnectionStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding PrivateEndpointConnectionStatus. - */ - public static PrivateEndpointConnectionStatus fromString(String name) { - return fromString(name, PrivateEndpointConnectionStatus.class); - } - - /** - * Gets known PrivateEndpointConnectionStatus values. - * - * @return known PrivateEndpointConnectionStatus values. - */ - public static Collection values() { - return values(PrivateEndpointConnectionStatus.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnections.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnections.java deleted file mode 100644 index 5125bf2e54bd..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpointConnections.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of PrivateEndpointConnections. - */ -public interface PrivateEndpointConnections { - /** - * Get Private Endpoint Connection. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @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 private Endpoint Connection along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, - String privateEndpointConnectionName, Context context); - - /** - * Get Private Endpoint Connection. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection. - */ - PrivateEndpointConnectionResource get(String vaultName, String resourceGroupName, - String privateEndpointConnectionName); - - /** - * Delete Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 vaultName, String resourceGroupName, String privateEndpointConnectionName); - - /** - * Delete Private Endpoint requests. This call is made by Backup Admin. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the private endpoint connection. - * @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 vaultName, String resourceGroupName, String privateEndpointConnectionName, Context context); - - /** - * Get Private Endpoint Connection. This call is made by Backup Admin. - * - * @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 private Endpoint Connection along with {@link Response}. - */ - PrivateEndpointConnectionResource getById(String id); - - /** - * Get Private Endpoint Connection. This call is made by Backup Admin. - * - * @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 private Endpoint Connection along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete Private Endpoint requests. This call is made by Backup Admin. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete Private Endpoint requests. This call is made by Backup Admin. - * - * @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 PrivateEndpointConnectionResource resource. - * - * @param name resource name. - * @return the first stage of the new PrivateEndpointConnectionResource definition. - */ - PrivateEndpointConnectionResource.DefinitionStages.Blank define(String name); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpoints.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpoints.java deleted file mode 100644 index 1a7803df7d5f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateEndpoints.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of PrivateEndpoints. - */ -public interface PrivateEndpoints { - /** - * Gets the operation status for a private endpoint connection. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the PrivateEndpointConnectionResource. - * @param operationId The name of the PrivateEndpointConnectionResource. - * @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 operation status for a private endpoint connection along with {@link Response}. - */ - Response getOperationStatusWithResponse(String vaultName, String resourceGroupName, - String privateEndpointConnectionName, String operationId, Context context); - - /** - * Gets the operation status for a private endpoint connection. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateEndpointConnectionName The name of the PrivateEndpointConnectionResource. - * @param operationId The name of the PrivateEndpointConnectionResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the operation status for a private endpoint connection. - */ - OperationStatus getOperationStatus(String vaultName, String resourceGroupName, String privateEndpointConnectionName, - String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateLinkServiceConnectionState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateLinkServiceConnectionState.java deleted file mode 100644 index 8c75219ed8e6..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/PrivateLinkServiceConnectionState.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Private Link Service Connection State. - */ -@Fluent -public final class PrivateLinkServiceConnectionState implements JsonSerializable { - /* - * Gets or sets the status - */ - private PrivateEndpointConnectionStatus status; - - /* - * Gets or sets description - */ - private String description; - - /* - * Gets or sets actions required - */ - private String actionRequired; - - /** - * Creates an instance of PrivateLinkServiceConnectionState class. - */ - public PrivateLinkServiceConnectionState() { - } - - /** - * Get the status property: Gets or sets the status. - * - * @return the status value. - */ - public PrivateEndpointConnectionStatus status() { - return this.status; - } - - /** - * Set the status property: Gets or sets the status. - * - * @param status the status value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withStatus(PrivateEndpointConnectionStatus status) { - this.status = status; - return this; - } - - /** - * Get the description property: Gets or sets description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Gets or sets description. - * - * @param description the description value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the actionRequired property: Gets or sets actions required. - * - * @return the actionRequired value. - */ - public String actionRequired() { - return this.actionRequired; - } - - /** - * Set the actionRequired property: Gets or sets actions required. - * - * @param actionRequired the actionRequired value to set. - * @return the PrivateLinkServiceConnectionState object itself. - */ - public PrivateLinkServiceConnectionState withActionRequired(String actionRequired) { - this.actionRequired = actionRequired; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeStringField("actionsRequired", this.actionRequired); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateLinkServiceConnectionState from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateLinkServiceConnectionState 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 PrivateLinkServiceConnectionState. - */ - public static PrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateLinkServiceConnectionState deserializedPrivateLinkServiceConnectionState - = new PrivateLinkServiceConnectionState(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedPrivateLinkServiceConnectionState.status - = PrivateEndpointConnectionStatus.fromString(reader.getString()); - } else if ("description".equals(fieldName)) { - deserializedPrivateLinkServiceConnectionState.description = reader.getString(); - } else if ("actionsRequired".equals(fieldName)) { - deserializedPrivateLinkServiceConnectionState.actionRequired = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateLinkServiceConnectionState; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainer.java deleted file mode 100644 index 4e7faf4345b0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainer.java +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Protectable Container Class. - */ -@Immutable -public class ProtectableContainer implements JsonSerializable { - /* - * Type of the container. The value of this property for - * 1. Compute Azure VM is Microsoft.Compute/virtualMachines - * 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines - */ - private ProtectableContainerType protectableContainerType; - - /* - * Friendly name of the container. - */ - private String friendlyName; - - /* - * Type of backup management for the container. - */ - private BackupManagementType backupManagementType; - - /* - * Status of health of the container. - */ - private String healthStatus; - - /* - * Fabric Id of the container such as ARM Id. - */ - private String containerId; - - /** - * Creates an instance of ProtectableContainer class. - */ - protected ProtectableContainer() { - } - - /** - * Get the protectableContainerType property: Type of the container. The value of this property for - * 1. Compute Azure VM is Microsoft.Compute/virtualMachines - * 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines. - * - * @return the protectableContainerType value. - */ - public ProtectableContainerType protectableContainerType() { - return this.protectableContainerType; - } - - /** - * Get the friendlyName property: Friendly name of the container. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.friendlyName; - } - - /** - * Set the friendlyName property: Friendly name of the container. - * - * @param friendlyName the friendlyName value to set. - * @return the ProtectableContainer object itself. - */ - ProtectableContainer withFriendlyName(String friendlyName) { - this.friendlyName = friendlyName; - return this; - } - - /** - * Get the backupManagementType property: Type of backup management for the container. - * - * @return the backupManagementType value. - */ - public BackupManagementType backupManagementType() { - return this.backupManagementType; - } - - /** - * Set the backupManagementType property: Type of backup management for the container. - * - * @param backupManagementType the backupManagementType value to set. - * @return the ProtectableContainer object itself. - */ - ProtectableContainer withBackupManagementType(BackupManagementType backupManagementType) { - this.backupManagementType = backupManagementType; - return this; - } - - /** - * Get the healthStatus property: Status of health of the container. - * - * @return the healthStatus value. - */ - public String healthStatus() { - return this.healthStatus; - } - - /** - * Set the healthStatus property: Status of health of the container. - * - * @param healthStatus the healthStatus value to set. - * @return the ProtectableContainer object itself. - */ - ProtectableContainer withHealthStatus(String healthStatus) { - this.healthStatus = healthStatus; - return this; - } - - /** - * Get the containerId property: Fabric Id of the container such as ARM Id. - * - * @return the containerId value. - */ - public String containerId() { - return this.containerId; - } - - /** - * Set the containerId property: Fabric Id of the container such as ARM Id. - * - * @param containerId the containerId value to set. - * @return the ProtectableContainer object itself. - */ - ProtectableContainer withContainerId(String containerId) { - this.containerId = containerId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("protectableContainerType", - this.protectableContainerType == null ? null : this.protectableContainerType.toString()); - jsonWriter.writeStringField("friendlyName", this.friendlyName); - jsonWriter.writeStringField("backupManagementType", - this.backupManagementType == null ? null : this.backupManagementType.toString()); - jsonWriter.writeStringField("healthStatus", this.healthStatus); - jsonWriter.writeStringField("containerId", this.containerId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ProtectableContainer from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProtectableContainer 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 ProtectableContainer. - */ - public static ProtectableContainer fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("protectableContainerType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("StorageContainer".equals(discriminatorValue)) { - return AzureStorageProtectableContainer.fromJson(readerToUse.reset()); - } else if ("VMAppContainer".equals(discriminatorValue)) { - return AzureVMAppContainerProtectableContainer.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static ProtectableContainer fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProtectableContainer deserializedProtectableContainer = new ProtectableContainer(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("protectableContainerType".equals(fieldName)) { - deserializedProtectableContainer.protectableContainerType - = ProtectableContainerType.fromString(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedProtectableContainer.friendlyName = reader.getString(); - } else if ("backupManagementType".equals(fieldName)) { - deserializedProtectableContainer.backupManagementType - = BackupManagementType.fromString(reader.getString()); - } else if ("healthStatus".equals(fieldName)) { - deserializedProtectableContainer.healthStatus = reader.getString(); - } else if ("containerId".equals(fieldName)) { - deserializedProtectableContainer.containerId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedProtectableContainer; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainerResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainerResource.java deleted file mode 100644 index 65af9937b299..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainerResource.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectableContainerResourceInner; -import java.util.Map; - -/** - * An immutable client-side representation of ProtectableContainerResource. - */ -public interface ProtectableContainerResource { - /** - * 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 location property: Resource location. - * - * @return the location value. - */ - String location(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the eTag property: Optional ETag. - * - * @return the eTag value. - */ - String eTag(); - - /** - * Gets the properties property: ProtectableContainerResource properties. - * - * @return the properties value. - */ - ProtectableContainer 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.recoveryservicesbackup.fluent.models.ProtectableContainerResourceInner - * object. - * - * @return the inner object. - */ - ProtectableContainerResourceInner innerModel(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainerType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainerType.java deleted file mode 100644 index a43d620946f0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainerType.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -/** - * Type of the container. The value of this property for - * 1. Compute Azure VM is Microsoft.Compute/virtualMachines - * 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines. - */ -public enum ProtectableContainerType { - /** - * Enum value Invalid. - */ - INVALID("Invalid"), - - /** - * Enum value Unknown. - */ - UNKNOWN("Unknown"), - - /** - * Enum value IaasVMContainer. - */ - IAAS_VMCONTAINER("IaasVMContainer"), - - /** - * Enum value IaasVMServiceContainer. - */ - IAAS_VMSERVICE_CONTAINER("IaasVMServiceContainer"), - - /** - * Enum value DPMContainer. - */ - DPMCONTAINER("DPMContainer"), - - /** - * Enum value AzureBackupServerContainer. - */ - AZURE_BACKUP_SERVER_CONTAINER("AzureBackupServerContainer"), - - /** - * Enum value MABContainer. - */ - MABCONTAINER("MABContainer"), - - /** - * Enum value Cluster. - */ - CLUSTER("Cluster"), - - /** - * Enum value AzureSqlContainer. - */ - AZURE_SQL_CONTAINER("AzureSqlContainer"), - - /** - * Enum value Windows. - */ - WINDOWS("Windows"), - - /** - * Enum value VCenter. - */ - VCENTER("VCenter"), - - /** - * Enum value VMAppContainer. - */ - VMAPP_CONTAINER("VMAppContainer"), - - /** - * Enum value SQLAGWorkLoadContainer. - */ - SQLAGWORK_LOAD_CONTAINER("SQLAGWorkLoadContainer"), - - /** - * Enum value StorageContainer. - */ - STORAGE_CONTAINER("StorageContainer"), - - /** - * Enum value GenericContainer. - */ - GENERIC_CONTAINER("GenericContainer"), - - /** - * Enum value Microsoft.ClassicCompute/virtualMachines. - */ - MICROSOFT_CLASSIC_COMPUTE_VIRTUAL_MACHINES("Microsoft.ClassicCompute/virtualMachines"), - - /** - * Enum value Microsoft.Compute/virtualMachines. - */ - MICROSOFT_COMPUTE_VIRTUAL_MACHINES("Microsoft.Compute/virtualMachines"), - - /** - * Enum value AzureWorkloadContainer. - */ - AZURE_WORKLOAD_CONTAINER("AzureWorkloadContainer"); - - /** - * The actual serialized value for a ProtectableContainerType instance. - */ - private final String value; - - ProtectableContainerType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ProtectableContainerType instance. - * - * @param value the serialized value to parse. - * @return the parsed ProtectableContainerType object, or null if unable to parse. - */ - public static ProtectableContainerType fromString(String value) { - if (value == null) { - return null; - } - ProtectableContainerType[] items = ProtectableContainerType.values(); - for (ProtectableContainerType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainers.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainers.java deleted file mode 100644 index 3ba9d8754088..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectableContainers.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of ProtectableContainers. - */ -public interface ProtectableContainers { - /** - * Lists the containers that can be registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The fabricName 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 list of ProtectableContainer resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName, String fabricName); - - /** - * Lists the containers that can be registered to Recovery Services Vault. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The fabricName parameter. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ProtectableContainer resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String filter, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItem.java deleted file mode 100644 index f470c9a8cce1..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItem.java +++ /dev/null @@ -1,680 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Base class for backup items. - */ -@Fluent -public class ProtectedItem implements JsonSerializable { - /* - * backup item type. - */ - private String protectedItemType = "ProtectedItem"; - - /* - * Type of backup management for the backed up item. - */ - private BackupManagementType backupManagementType; - - /* - * Type of workload this item represents. - */ - private DataSourceType workloadType; - - /* - * Unique name of container - */ - private String containerName; - - /* - * ARM ID of the resource to be backed up. - */ - private String sourceResourceId; - - /* - * ID of the backup policy with which this item is backed up. - */ - private String policyId; - - /* - * Timestamp when the last (latest) backup copy was created for this backup item. - */ - private OffsetDateTime lastRecoveryPoint; - - /* - * Name of the backup set the backup item belongs to - */ - private String backupSetName; - - /* - * Create mode to indicate recovery of existing soft deleted data source or creation of new data source. - */ - private CreateMode createMode; - - /* - * Time for deferred deletion in UTC - */ - private OffsetDateTime deferredDeleteTimeInUtc; - - /* - * Flag to identify whether the DS is scheduled for deferred delete - */ - private Boolean isScheduledForDeferredDelete; - - /* - * Time remaining before the DS marked for deferred delete is permanently deleted - */ - private String deferredDeleteTimeRemaining; - - /* - * Flag to identify whether the deferred deleted DS is to be purged soon - */ - private Boolean isDeferredDeleteScheduleUpcoming; - - /* - * Flag to identify that deferred deleted DS is to be moved into Pause state - */ - private Boolean isRehydrate; - - /* - * ResourceGuardOperationRequests on which LAC check will be performed - */ - private List resourceGuardOperationRequests; - - /* - * Flag to identify whether datasource is protected in archive - */ - private Boolean isArchiveEnabled; - - /* - * Name of the policy used for protection - */ - private String policyName; - - /* - * Soft delete retention period in days - */ - private Integer softDeleteRetentionPeriodInDays; - - /* - * ID of the vault which protects this item - */ - private String vaultId; - - /* - * Source side threat information - */ - private SourceSideScanInfo sourceSideScanInfo; - - /** - * Creates an instance of ProtectedItem class. - */ - public ProtectedItem() { - } - - /** - * Get the protectedItemType property: backup item type. - * - * @return the protectedItemType value. - */ - public String protectedItemType() { - return this.protectedItemType; - } - - /** - * Get the backupManagementType property: Type of backup management for the backed up item. - * - * @return the backupManagementType value. - */ - public BackupManagementType backupManagementType() { - return this.backupManagementType; - } - - /** - * Set the backupManagementType property: Type of backup management for the backed up item. - * - * @param backupManagementType the backupManagementType value to set. - * @return the ProtectedItem object itself. - */ - ProtectedItem withBackupManagementType(BackupManagementType backupManagementType) { - this.backupManagementType = backupManagementType; - return this; - } - - /** - * Get the workloadType property: Type of workload this item represents. - * - * @return the workloadType value. - */ - public DataSourceType workloadType() { - return this.workloadType; - } - - /** - * Set the workloadType property: Type of workload this item represents. - * - * @param workloadType the workloadType value to set. - * @return the ProtectedItem object itself. - */ - ProtectedItem withWorkloadType(DataSourceType workloadType) { - this.workloadType = workloadType; - return this; - } - - /** - * Get the containerName property: Unique name of container. - * - * @return the containerName value. - */ - public String containerName() { - return this.containerName; - } - - /** - * Set the containerName property: Unique name of container. - * - * @param containerName the containerName value to set. - * @return the ProtectedItem object itself. - */ - public ProtectedItem withContainerName(String containerName) { - this.containerName = containerName; - return this; - } - - /** - * Get the sourceResourceId property: ARM ID of the resource to be backed up. - * - * @return the sourceResourceId value. - */ - public String sourceResourceId() { - return this.sourceResourceId; - } - - /** - * Set the sourceResourceId property: ARM ID of the resource to be backed up. - * - * @param sourceResourceId the sourceResourceId value to set. - * @return the ProtectedItem object itself. - */ - public ProtectedItem withSourceResourceId(String sourceResourceId) { - this.sourceResourceId = sourceResourceId; - return this; - } - - /** - * Get the policyId property: ID of the backup policy with which this item is backed up. - * - * @return the policyId value. - */ - public String policyId() { - return this.policyId; - } - - /** - * Set the policyId property: ID of the backup policy with which this item is backed up. - * - * @param policyId the policyId value to set. - * @return the ProtectedItem object itself. - */ - public ProtectedItem withPolicyId(String policyId) { - this.policyId = policyId; - return this; - } - - /** - * Get the lastRecoveryPoint property: Timestamp when the last (latest) backup copy was created for this backup - * item. - * - * @return the lastRecoveryPoint value. - */ - public OffsetDateTime lastRecoveryPoint() { - return this.lastRecoveryPoint; - } - - /** - * Set the lastRecoveryPoint property: Timestamp when the last (latest) backup copy was created for this backup - * item. - * - * @param lastRecoveryPoint the lastRecoveryPoint value to set. - * @return the ProtectedItem object itself. - */ - public ProtectedItem withLastRecoveryPoint(OffsetDateTime lastRecoveryPoint) { - this.lastRecoveryPoint = lastRecoveryPoint; - return this; - } - - /** - * Get the backupSetName property: Name of the backup set the backup item belongs to. - * - * @return the backupSetName value. - */ - public String backupSetName() { - return this.backupSetName; - } - - /** - * Set the backupSetName property: Name of the backup set the backup item belongs to. - * - * @param backupSetName the backupSetName value to set. - * @return the ProtectedItem object itself. - */ - public ProtectedItem withBackupSetName(String backupSetName) { - this.backupSetName = backupSetName; - return this; - } - - /** - * Get the createMode property: Create mode to indicate recovery of existing soft deleted data source or creation of - * new data source. - * - * @return the createMode value. - */ - public CreateMode createMode() { - return this.createMode; - } - - /** - * Set the createMode property: Create mode to indicate recovery of existing soft deleted data source or creation of - * new data source. - * - * @param createMode the createMode value to set. - * @return the ProtectedItem object itself. - */ - public ProtectedItem withCreateMode(CreateMode createMode) { - this.createMode = createMode; - return this; - } - - /** - * Get the deferredDeleteTimeInUtc property: Time for deferred deletion in UTC. - * - * @return the deferredDeleteTimeInUtc value. - */ - public OffsetDateTime deferredDeleteTimeInUtc() { - return this.deferredDeleteTimeInUtc; - } - - /** - * Set the deferredDeleteTimeInUtc property: Time for deferred deletion in UTC. - * - * @param deferredDeleteTimeInUtc the deferredDeleteTimeInUtc value to set. - * @return the ProtectedItem object itself. - */ - public ProtectedItem withDeferredDeleteTimeInUtc(OffsetDateTime deferredDeleteTimeInUtc) { - this.deferredDeleteTimeInUtc = deferredDeleteTimeInUtc; - return this; - } - - /** - * Get the isScheduledForDeferredDelete property: Flag to identify whether the DS is scheduled for deferred delete. - * - * @return the isScheduledForDeferredDelete value. - */ - public Boolean isScheduledForDeferredDelete() { - return this.isScheduledForDeferredDelete; - } - - /** - * Set the isScheduledForDeferredDelete property: Flag to identify whether the DS is scheduled for deferred delete. - * - * @param isScheduledForDeferredDelete the isScheduledForDeferredDelete value to set. - * @return the ProtectedItem object itself. - */ - public ProtectedItem withIsScheduledForDeferredDelete(Boolean isScheduledForDeferredDelete) { - this.isScheduledForDeferredDelete = isScheduledForDeferredDelete; - return this; - } - - /** - * Get the deferredDeleteTimeRemaining property: Time remaining before the DS marked for deferred delete is - * permanently deleted. - * - * @return the deferredDeleteTimeRemaining value. - */ - public String deferredDeleteTimeRemaining() { - return this.deferredDeleteTimeRemaining; - } - - /** - * Set the deferredDeleteTimeRemaining property: Time remaining before the DS marked for deferred delete is - * permanently deleted. - * - * @param deferredDeleteTimeRemaining the deferredDeleteTimeRemaining value to set. - * @return the ProtectedItem object itself. - */ - public ProtectedItem withDeferredDeleteTimeRemaining(String deferredDeleteTimeRemaining) { - this.deferredDeleteTimeRemaining = deferredDeleteTimeRemaining; - return this; - } - - /** - * Get the isDeferredDeleteScheduleUpcoming property: Flag to identify whether the deferred deleted DS is to be - * purged soon. - * - * @return the isDeferredDeleteScheduleUpcoming value. - */ - public Boolean isDeferredDeleteScheduleUpcoming() { - return this.isDeferredDeleteScheduleUpcoming; - } - - /** - * Set the isDeferredDeleteScheduleUpcoming property: Flag to identify whether the deferred deleted DS is to be - * purged soon. - * - * @param isDeferredDeleteScheduleUpcoming the isDeferredDeleteScheduleUpcoming value to set. - * @return the ProtectedItem object itself. - */ - public ProtectedItem withIsDeferredDeleteScheduleUpcoming(Boolean isDeferredDeleteScheduleUpcoming) { - this.isDeferredDeleteScheduleUpcoming = isDeferredDeleteScheduleUpcoming; - return this; - } - - /** - * Get the isRehydrate property: Flag to identify that deferred deleted DS is to be moved into Pause state. - * - * @return the isRehydrate value. - */ - public Boolean isRehydrate() { - return this.isRehydrate; - } - - /** - * Set the isRehydrate property: Flag to identify that deferred deleted DS is to be moved into Pause state. - * - * @param isRehydrate the isRehydrate value to set. - * @return the ProtectedItem object itself. - */ - public ProtectedItem withIsRehydrate(Boolean isRehydrate) { - this.isRehydrate = isRehydrate; - return this; - } - - /** - * Get the resourceGuardOperationRequests property: ResourceGuardOperationRequests on which LAC check will be - * performed. - * - * @return the resourceGuardOperationRequests value. - */ - public List resourceGuardOperationRequests() { - return this.resourceGuardOperationRequests; - } - - /** - * Set the resourceGuardOperationRequests property: ResourceGuardOperationRequests on which LAC check will be - * performed. - * - * @param resourceGuardOperationRequests the resourceGuardOperationRequests value to set. - * @return the ProtectedItem object itself. - */ - public ProtectedItem withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - this.resourceGuardOperationRequests = resourceGuardOperationRequests; - return this; - } - - /** - * Get the isArchiveEnabled property: Flag to identify whether datasource is protected in archive. - * - * @return the isArchiveEnabled value. - */ - public Boolean isArchiveEnabled() { - return this.isArchiveEnabled; - } - - /** - * Set the isArchiveEnabled property: Flag to identify whether datasource is protected in archive. - * - * @param isArchiveEnabled the isArchiveEnabled value to set. - * @return the ProtectedItem object itself. - */ - public ProtectedItem withIsArchiveEnabled(Boolean isArchiveEnabled) { - this.isArchiveEnabled = isArchiveEnabled; - return this; - } - - /** - * Get the policyName property: Name of the policy used for protection. - * - * @return the policyName value. - */ - public String policyName() { - return this.policyName; - } - - /** - * Set the policyName property: Name of the policy used for protection. - * - * @param policyName the policyName value to set. - * @return the ProtectedItem object itself. - */ - public ProtectedItem withPolicyName(String policyName) { - this.policyName = policyName; - return this; - } - - /** - * Get the softDeleteRetentionPeriodInDays property: Soft delete retention period in days. - * - * @return the softDeleteRetentionPeriodInDays value. - */ - public Integer softDeleteRetentionPeriodInDays() { - return this.softDeleteRetentionPeriodInDays; - } - - /** - * Set the softDeleteRetentionPeriodInDays property: Soft delete retention period in days. - * - * @param softDeleteRetentionPeriodInDays the softDeleteRetentionPeriodInDays value to set. - * @return the ProtectedItem object itself. - */ - public ProtectedItem withSoftDeleteRetentionPeriodInDays(Integer softDeleteRetentionPeriodInDays) { - this.softDeleteRetentionPeriodInDays = softDeleteRetentionPeriodInDays; - return this; - } - - /** - * Get the vaultId property: ID of the vault which protects this item. - * - * @return the vaultId value. - */ - public String vaultId() { - return this.vaultId; - } - - /** - * Set the vaultId property: ID of the vault which protects this item. - * - * @param vaultId the vaultId value to set. - * @return the ProtectedItem object itself. - */ - ProtectedItem withVaultId(String vaultId) { - this.vaultId = vaultId; - return this; - } - - /** - * Get the sourceSideScanInfo property: Source side threat information. - * - * @return the sourceSideScanInfo value. - */ - public SourceSideScanInfo sourceSideScanInfo() { - return this.sourceSideScanInfo; - } - - /** - * Set the sourceSideScanInfo property: Source side threat information. - * - * @param sourceSideScanInfo the sourceSideScanInfo value to set. - * @return the ProtectedItem object itself. - */ - public ProtectedItem withSourceSideScanInfo(SourceSideScanInfo sourceSideScanInfo) { - this.sourceSideScanInfo = sourceSideScanInfo; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("protectedItemType", this.protectedItemType); - jsonWriter.writeStringField("containerName", this.containerName); - jsonWriter.writeStringField("sourceResourceId", this.sourceResourceId); - jsonWriter.writeStringField("policyId", this.policyId); - jsonWriter.writeStringField("lastRecoveryPoint", - this.lastRecoveryPoint == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastRecoveryPoint)); - jsonWriter.writeStringField("backupSetName", this.backupSetName); - jsonWriter.writeStringField("createMode", this.createMode == null ? null : this.createMode.toString()); - jsonWriter.writeStringField("deferredDeleteTimeInUTC", - this.deferredDeleteTimeInUtc == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.deferredDeleteTimeInUtc)); - jsonWriter.writeBooleanField("isScheduledForDeferredDelete", this.isScheduledForDeferredDelete); - jsonWriter.writeStringField("deferredDeleteTimeRemaining", this.deferredDeleteTimeRemaining); - jsonWriter.writeBooleanField("isDeferredDeleteScheduleUpcoming", this.isDeferredDeleteScheduleUpcoming); - jsonWriter.writeBooleanField("isRehydrate", this.isRehydrate); - jsonWriter.writeArrayField("resourceGuardOperationRequests", this.resourceGuardOperationRequests, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("isArchiveEnabled", this.isArchiveEnabled); - jsonWriter.writeStringField("policyName", this.policyName); - jsonWriter.writeNumberField("softDeleteRetentionPeriodInDays", this.softDeleteRetentionPeriodInDays); - jsonWriter.writeJsonField("sourceSideScanInfo", this.sourceSideScanInfo); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ProtectedItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProtectedItem 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 ProtectedItem. - */ - public static ProtectedItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("protectedItemType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureFileShareProtectedItem".equals(discriminatorValue)) { - return AzureFileshareProtectedItem.fromJson(readerToUse.reset()); - } else if ("AzureIaaSVMProtectedItem".equals(discriminatorValue)) { - return AzureIaaSvmProtectedItem.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("Microsoft.Compute/virtualMachines".equals(discriminatorValue)) { - return AzureIaaSComputeVMProtectedItem.fromJson(readerToUse.reset()); - } else if ("Microsoft.ClassicCompute/virtualMachines".equals(discriminatorValue)) { - return AzureIaaSClassicComputeVMProtectedItem.fromJson(readerToUse.reset()); - } else if ("Microsoft.Sql/servers/databases".equals(discriminatorValue)) { - return AzureSqlProtectedItem.fromJson(readerToUse.reset()); - } else if ("AzureVmWorkloadProtectedItem".equals(discriminatorValue)) { - return AzureVmWorkloadProtectedItem.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureVmWorkloadSAPAseDatabase".equals(discriminatorValue)) { - return AzureVmWorkloadSapAseDatabaseProtectedItem.fromJson(readerToUse.reset()); - } else if ("AzureVmWorkloadSAPHanaDatabase".equals(discriminatorValue)) { - return AzureVmWorkloadSapHanaDatabaseProtectedItem.fromJson(readerToUse.reset()); - } else if ("AzureVmWorkloadSAPHanaDBInstance".equals(discriminatorValue)) { - return AzureVmWorkloadSapHanaDBInstanceProtectedItem.fromJson(readerToUse.reset()); - } else if ("AzureVmWorkloadSQLDatabase".equals(discriminatorValue)) { - return AzureVmWorkloadSqlDatabaseProtectedItem.fromJson(readerToUse.reset()); - } else if ("AzureVmWorkloadSQLInstance".equals(discriminatorValue)) { - return AzureVmWorkloadSQLInstanceProtectedItem.fromJson(readerToUse.reset()); - } else if ("DPMProtectedItem".equals(discriminatorValue)) { - return DpmProtectedItem.fromJson(readerToUse.reset()); - } else if ("GenericProtectedItem".equals(discriminatorValue)) { - return GenericProtectedItem.fromJson(readerToUse.reset()); - } else if ("MabFileFolderProtectedItem".equals(discriminatorValue)) { - return MabFileFolderProtectedItem.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static ProtectedItem fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProtectedItem deserializedProtectedItem = new ProtectedItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("protectedItemType".equals(fieldName)) { - deserializedProtectedItem.protectedItemType = reader.getString(); - } else if ("backupManagementType".equals(fieldName)) { - deserializedProtectedItem.backupManagementType - = BackupManagementType.fromString(reader.getString()); - } else if ("workloadType".equals(fieldName)) { - deserializedProtectedItem.workloadType = DataSourceType.fromString(reader.getString()); - } else if ("containerName".equals(fieldName)) { - deserializedProtectedItem.containerName = reader.getString(); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedProtectedItem.sourceResourceId = reader.getString(); - } else if ("policyId".equals(fieldName)) { - deserializedProtectedItem.policyId = reader.getString(); - } else if ("lastRecoveryPoint".equals(fieldName)) { - deserializedProtectedItem.lastRecoveryPoint = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("backupSetName".equals(fieldName)) { - deserializedProtectedItem.backupSetName = reader.getString(); - } else if ("createMode".equals(fieldName)) { - deserializedProtectedItem.createMode = CreateMode.fromString(reader.getString()); - } else if ("deferredDeleteTimeInUTC".equals(fieldName)) { - deserializedProtectedItem.deferredDeleteTimeInUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("isScheduledForDeferredDelete".equals(fieldName)) { - deserializedProtectedItem.isScheduledForDeferredDelete = reader.getNullable(JsonReader::getBoolean); - } else if ("deferredDeleteTimeRemaining".equals(fieldName)) { - deserializedProtectedItem.deferredDeleteTimeRemaining = reader.getString(); - } else if ("isDeferredDeleteScheduleUpcoming".equals(fieldName)) { - deserializedProtectedItem.isDeferredDeleteScheduleUpcoming - = reader.getNullable(JsonReader::getBoolean); - } else if ("isRehydrate".equals(fieldName)) { - deserializedProtectedItem.isRehydrate = reader.getNullable(JsonReader::getBoolean); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedProtectedItem.resourceGuardOperationRequests = resourceGuardOperationRequests; - } else if ("isArchiveEnabled".equals(fieldName)) { - deserializedProtectedItem.isArchiveEnabled = reader.getNullable(JsonReader::getBoolean); - } else if ("policyName".equals(fieldName)) { - deserializedProtectedItem.policyName = reader.getString(); - } else if ("softDeleteRetentionPeriodInDays".equals(fieldName)) { - deserializedProtectedItem.softDeleteRetentionPeriodInDays = reader.getNullable(JsonReader::getInt); - } else if ("vaultId".equals(fieldName)) { - deserializedProtectedItem.vaultId = reader.getString(); - } else if ("sourceSideScanInfo".equals(fieldName)) { - deserializedProtectedItem.sourceSideScanInfo = SourceSideScanInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedProtectedItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemHealthStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemHealthStatus.java deleted file mode 100644 index efe151820ef8..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemHealthStatus.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Health status of the backup item, evaluated based on last heartbeat received. - */ -public final class ProtectedItemHealthStatus extends ExpandableStringEnum { - /** - * Static value Invalid for ProtectedItemHealthStatus. - */ - public static final ProtectedItemHealthStatus INVALID = fromString("Invalid"); - - /** - * Static value Healthy for ProtectedItemHealthStatus. - */ - public static final ProtectedItemHealthStatus HEALTHY = fromString("Healthy"); - - /** - * Static value Unhealthy for ProtectedItemHealthStatus. - */ - public static final ProtectedItemHealthStatus UNHEALTHY = fromString("Unhealthy"); - - /** - * Static value NotReachable for ProtectedItemHealthStatus. - */ - public static final ProtectedItemHealthStatus NOT_REACHABLE = fromString("NotReachable"); - - /** - * Static value IRPending for ProtectedItemHealthStatus. - */ - public static final ProtectedItemHealthStatus IRPENDING = fromString("IRPending"); - - /** - * Creates a new instance of ProtectedItemHealthStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ProtectedItemHealthStatus() { - } - - /** - * Creates or finds a ProtectedItemHealthStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProtectedItemHealthStatus. - */ - public static ProtectedItemHealthStatus fromString(String name) { - return fromString(name, ProtectedItemHealthStatus.class); - } - - /** - * Gets known ProtectedItemHealthStatus values. - * - * @return known ProtectedItemHealthStatus values. - */ - public static Collection values() { - return values(ProtectedItemHealthStatus.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemOperationResults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemOperationResults.java deleted file mode 100644 index b946541e97b1..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemOperationResults.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ProtectedItemOperationResults. - */ -public interface ProtectedItemOperationResults { - /** - * Fetches the result of any operation on the backup item. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param protectedItemName The name of the ProtectedItemResource. - * @param operationId The name of the ProtectedItemResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String operationId, Context context); - - /** - * Fetches the result of any operation on the backup item. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param protectedItemName The name of the ProtectedItemResource. - * @param operationId The name of the ProtectedItemResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items. - */ - ProtectedItemResource get(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemOperationStatuses.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemOperationStatuses.java deleted file mode 100644 index 067222e37c94..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemOperationStatuses.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ProtectedItemOperationStatuses. - */ -public interface ProtectedItemOperationStatuses { - /** - * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some - * operations - * create jobs. This method returns the list of jobs associated with the operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param protectedItemName The name of the ProtectedItemResource. - * @param operationId The name of the ProtectedItemResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String operationId, Context context); - - /** - * Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. Some - * operations - * create jobs. This method returns the list of jobs associated with the operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param protectedItemName The name of the ProtectedItemResource. - * @param operationId The name of the ProtectedItemResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status. - */ - OperationStatus get(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemResource.java deleted file mode 100644 index bb6d77343172..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemResource.java +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; -import java.util.Map; - -/** - * An immutable client-side representation of ProtectedItemResource. - */ -public interface ProtectedItemResource { - /** - * 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: ProtectedItemResource properties. - * - * @return the properties value. - */ - ProtectedItem properties(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the etag property: Optional ETag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner object. - * - * @return the inner object. - */ - ProtectedItemResourceInner innerModel(); - - /** - * The entirety of the ProtectedItemResource definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The ProtectedItemResource definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the ProtectedItemResource definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the ProtectedItemResource definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies vaultName, resourceGroupName, fabricName, containerName. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @return the next definition stage. - */ - WithCreate withExistingProtectionContainer(String vaultName, String resourceGroupName, String fabricName, - String containerName); - } - - /** - * The stage of the ProtectedItemResource 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.WithLocation, DefinitionStages.WithTags, - DefinitionStages.WithProperties, DefinitionStages.WithEtag { - /** - * Executes the create request. - * - * @return the created resource. - */ - ProtectedItemResource create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - ProtectedItemResource create(Context context); - } - - /** - * The stage of the ProtectedItemResource definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(String location); - } - - /** - * The stage of the ProtectedItemResource definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the ProtectedItemResource definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: ProtectedItemResource properties. - * - * @param properties ProtectedItemResource properties. - * @return the next definition stage. - */ - WithCreate withProperties(ProtectedItem properties); - } - - /** - * The stage of the ProtectedItemResource definition allowing to specify etag. - */ - interface WithEtag { - /** - * Specifies the etag property: Optional ETag.. - * - * @param etag Optional ETag. - * @return the next definition stage. - */ - WithCreate withEtag(String etag); - } - } - - /** - * Begins update for the ProtectedItemResource resource. - * - * @return the stage of resource update. - */ - ProtectedItemResource.Update update(); - - /** - * The template for ProtectedItemResource update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithEtag { - /** - * Executes the update request. - * - * @return the updated resource. - */ - ProtectedItemResource apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - ProtectedItemResource apply(Context context); - } - - /** - * The ProtectedItemResource update stages. - */ - interface UpdateStages { - /** - * The stage of the ProtectedItemResource update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the ProtectedItemResource update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: ProtectedItemResource properties. - * - * @param properties ProtectedItemResource properties. - * @return the next definition stage. - */ - Update withProperties(ProtectedItem properties); - } - - /** - * The stage of the ProtectedItemResource update allowing to specify etag. - */ - interface WithEtag { - /** - * Specifies the etag property: Optional ETag.. - * - * @param etag Optional ETag. - * @return the next definition stage. - */ - Update withEtag(String etag); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - ProtectedItemResource refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - ProtectedItemResource refresh(Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemState.java deleted file mode 100644 index 0dbbd72cf270..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemState.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Backup state of the backed up item. - */ -public final class ProtectedItemState extends ExpandableStringEnum { - /** - * Static value Invalid for ProtectedItemState. - */ - public static final ProtectedItemState INVALID = fromString("Invalid"); - - /** - * Static value IRPending for ProtectedItemState. - */ - public static final ProtectedItemState IRPENDING = fromString("IRPending"); - - /** - * Static value Protected for ProtectedItemState. - */ - public static final ProtectedItemState PROTECTED = fromString("Protected"); - - /** - * Static value ProtectionError for ProtectedItemState. - */ - public static final ProtectedItemState PROTECTION_ERROR = fromString("ProtectionError"); - - /** - * Static value ProtectionStopped for ProtectedItemState. - */ - public static final ProtectedItemState PROTECTION_STOPPED = fromString("ProtectionStopped"); - - /** - * Static value ProtectionPaused for ProtectedItemState. - */ - public static final ProtectedItemState PROTECTION_PAUSED = fromString("ProtectionPaused"); - - /** - * Static value BackupsSuspended for ProtectedItemState. - */ - public static final ProtectedItemState BACKUPS_SUSPENDED = fromString("BackupsSuspended"); - - /** - * Creates a new instance of ProtectedItemState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ProtectedItemState() { - } - - /** - * Creates or finds a ProtectedItemState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProtectedItemState. - */ - public static ProtectedItemState fromString(String name) { - return fromString(name, ProtectedItemState.class); - } - - /** - * Gets known ProtectedItemState values. - * - * @return known ProtectedItemState values. - */ - public static Collection values() { - return values(ProtectedItemState.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItems.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItems.java deleted file mode 100644 index 5539e2a0af82..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItems.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ProtectedItems. - */ -public interface ProtectedItems { - /** - * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the - * operation, - * call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String filter, Context context); - - /** - * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the - * operation, - * call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items. - */ - ProtectedItemResource get(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName); - - /** - * Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of - * the - * request, call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, Context context); - - /** - * Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of - * the - * request, call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName); - - /** - * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the - * operation, - * call the GetItemOperationResult API. - * - * @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 base class for backup items along with {@link Response}. - */ - ProtectedItemResource getById(String id); - - /** - * Provides the details of the backed up item. This is an asynchronous operation. To know the status of the - * operation, - * call the GetItemOperationResult API. - * - * @param id the resource ID. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup items along with {@link Response}. - */ - Response getByIdWithResponse(String id, String filter, Context context); - - /** - * Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of - * the - * request, call the GetItemOperationResult API. - * - * @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); - - /** - * Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of - * the - * request, call the GetItemOperationResult API. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new ProtectedItemResource resource. - * - * @param name resource name. - * @return the first stage of the new ProtectedItemResource definition. - */ - ProtectedItemResource.DefinitionStages.Blank define(String name); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainer.java deleted file mode 100644 index 991ef271c1e6..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainer.java +++ /dev/null @@ -1,272 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Base class for container with backup items. Containers with specific workloads are derived from this class. - */ -@Fluent -public class ProtectionContainer implements JsonSerializable { - /* - * Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines - * 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer - */ - private ProtectableContainerType containerType; - - /* - * Friendly name of the container. - */ - private String friendlyName; - - /* - * Type of backup management for the container. - */ - private BackupManagementType backupManagementType; - - /* - * Status of registration of the container with the Recovery Services Vault. - */ - private String registrationStatus; - - /* - * Status of health of the container. - */ - private String healthStatus; - - /* - * Type of the protectable object associated with this container - */ - private String protectableObjectType; - - /** - * Creates an instance of ProtectionContainer class. - */ - public ProtectionContainer() { - } - - /** - * Get the containerType property: Type of the container. The value of this property for: 1. Compute Azure VM is - * Microsoft.Compute/virtualMachines 2. - * Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows machines (like MAB, DPM etc) is - * Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. 6. Azure workload - * Backup is VMAppContainer. - * - * @return the containerType value. - */ - public ProtectableContainerType containerType() { - return this.containerType; - } - - /** - * Get the friendlyName property: Friendly name of the container. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.friendlyName; - } - - /** - * Set the friendlyName property: Friendly name of the container. - * - * @param friendlyName the friendlyName value to set. - * @return the ProtectionContainer object itself. - */ - public ProtectionContainer withFriendlyName(String friendlyName) { - this.friendlyName = friendlyName; - return this; - } - - /** - * Get the backupManagementType property: Type of backup management for the container. - * - * @return the backupManagementType value. - */ - public BackupManagementType backupManagementType() { - return this.backupManagementType; - } - - /** - * Set the backupManagementType property: Type of backup management for the container. - * - * @param backupManagementType the backupManagementType value to set. - * @return the ProtectionContainer object itself. - */ - public ProtectionContainer withBackupManagementType(BackupManagementType backupManagementType) { - this.backupManagementType = backupManagementType; - return this; - } - - /** - * Get the registrationStatus property: Status of registration of the container with the Recovery Services Vault. - * - * @return the registrationStatus value. - */ - public String registrationStatus() { - return this.registrationStatus; - } - - /** - * Set the registrationStatus property: Status of registration of the container with the Recovery Services Vault. - * - * @param registrationStatus the registrationStatus value to set. - * @return the ProtectionContainer object itself. - */ - public ProtectionContainer withRegistrationStatus(String registrationStatus) { - this.registrationStatus = registrationStatus; - return this; - } - - /** - * Get the healthStatus property: Status of health of the container. - * - * @return the healthStatus value. - */ - public String healthStatus() { - return this.healthStatus; - } - - /** - * Set the healthStatus property: Status of health of the container. - * - * @param healthStatus the healthStatus value to set. - * @return the ProtectionContainer object itself. - */ - public ProtectionContainer withHealthStatus(String healthStatus) { - this.healthStatus = healthStatus; - return this; - } - - /** - * Get the protectableObjectType property: Type of the protectable object associated with this container. - * - * @return the protectableObjectType value. - */ - public String protectableObjectType() { - return this.protectableObjectType; - } - - /** - * Set the protectableObjectType property: Type of the protectable object associated with this container. - * - * @param protectableObjectType the protectableObjectType value to set. - * @return the ProtectionContainer object itself. - */ - public ProtectionContainer withProtectableObjectType(String protectableObjectType) { - this.protectableObjectType = protectableObjectType; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("containerType", this.containerType == null ? null : this.containerType.toString()); - jsonWriter.writeStringField("friendlyName", this.friendlyName); - jsonWriter.writeStringField("backupManagementType", - this.backupManagementType == null ? null : this.backupManagementType.toString()); - jsonWriter.writeStringField("registrationStatus", this.registrationStatus); - jsonWriter.writeStringField("healthStatus", this.healthStatus); - jsonWriter.writeStringField("protectableObjectType", this.protectableObjectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ProtectionContainer from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProtectionContainer 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 ProtectionContainer. - */ - public static ProtectionContainer fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("containerType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("DPMContainer".equals(discriminatorValue)) { - return DpmContainer.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureBackupServerContainer".equals(discriminatorValue)) { - return AzureBackupServerContainer.fromJson(readerToUse.reset()); - } else if ("IaasVMContainer".equals(discriminatorValue)) { - return IaaSvmContainer.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("Microsoft.Compute/virtualMachines".equals(discriminatorValue)) { - return AzureIaaSComputeVMContainer.fromJson(readerToUse.reset()); - } else if ("Microsoft.ClassicCompute/virtualMachines".equals(discriminatorValue)) { - return AzureIaaSClassicComputeVMContainer.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadContainer".equals(discriminatorValue)) { - return AzureWorkloadContainer.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("VMAppContainer".equals(discriminatorValue)) { - return AzureVMAppContainerProtectionContainer.fromJson(readerToUse.reset()); - } else if ("SQLAGWorkLoadContainer".equals(discriminatorValue)) { - return AzureSqlagWorkloadContainerProtectionContainer.fromJson(readerToUse.reset()); - } else if ("AzureSqlContainer".equals(discriminatorValue)) { - return AzureSqlContainer.fromJson(readerToUse.reset()); - } else if ("StorageContainer".equals(discriminatorValue)) { - return AzureStorageContainer.fromJson(readerToUse.reset()); - } else if ("GenericContainer".equals(discriminatorValue)) { - return GenericContainer.fromJson(readerToUse.reset()); - } else if ("Windows".equals(discriminatorValue)) { - return MabContainer.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static ProtectionContainer fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProtectionContainer deserializedProtectionContainer = new ProtectionContainer(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("containerType".equals(fieldName)) { - deserializedProtectionContainer.containerType - = ProtectableContainerType.fromString(reader.getString()); - } else if ("friendlyName".equals(fieldName)) { - deserializedProtectionContainer.friendlyName = reader.getString(); - } else if ("backupManagementType".equals(fieldName)) { - deserializedProtectionContainer.backupManagementType - = BackupManagementType.fromString(reader.getString()); - } else if ("registrationStatus".equals(fieldName)) { - deserializedProtectionContainer.registrationStatus = reader.getString(); - } else if ("healthStatus".equals(fieldName)) { - deserializedProtectionContainer.healthStatus = reader.getString(); - } else if ("protectableObjectType".equals(fieldName)) { - deserializedProtectionContainer.protectableObjectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedProtectionContainer; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerOperationResults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerOperationResults.java deleted file mode 100644 index c2a996f67867..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerOperationResults.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ProtectionContainerOperationResults. - */ -public interface ProtectionContainerOperationResults { - /** - * Fetches the result of any operation on the container. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param operationId The name of the ProtectionContainerResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for container with backup items along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String operationId, Context context); - - /** - * Fetches the result of any operation on the container. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName backupFabrics. - * @param containerName The name of the ProtectionContainerResource. - * @param operationId The name of the ProtectionContainerResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for container with backup items. - */ - ProtectionContainerResource get(String vaultName, String resourceGroupName, String fabricName, String containerName, - String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerRefreshOperationResults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerRefreshOperationResults.java deleted file mode 100644 index 0181c6298920..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerRefreshOperationResults.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ProtectionContainerRefreshOperationResults. - */ -public interface ProtectionContainerRefreshOperationResults { - /** - * Provides the result of the refresh operation triggered by the BeginRefresh operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName Fabric name associated with the container. - * @param operationId Operation ID associated with the operation whose result needs to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, String fabricName, String operationId, - Context context); - - /** - * Provides the result of the refresh operation triggered by the BeginRefresh operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName Fabric name associated with the container. - * @param operationId Operation ID associated with the operation whose result needs to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void get(String vaultName, String resourceGroupName, String fabricName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerResource.java deleted file mode 100644 index 863beff98e74..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainerResource.java +++ /dev/null @@ -1,323 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner; -import java.util.Map; - -/** - * An immutable client-side representation of ProtectionContainerResource. - */ -public interface ProtectionContainerResource { - /** - * 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: ProtectionContainerResource properties. - * - * @return the properties value. - */ - ProtectionContainer properties(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the etag property: Optional ETag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionContainerResourceInner - * object. - * - * @return the inner object. - */ - ProtectionContainerResourceInner innerModel(); - - /** - * The entirety of the ProtectionContainerResource definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The ProtectionContainerResource definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the ProtectionContainerResource definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the ProtectionContainerResource definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies vaultName, resourceGroupName, fabricName. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @return the next definition stage. - */ - WithCreate withExistingBackupFabric(String vaultName, String resourceGroupName, String fabricName); - } - - /** - * The stage of the ProtectionContainerResource 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.WithLocation, DefinitionStages.WithTags, - DefinitionStages.WithProperties, DefinitionStages.WithEtag { - /** - * Executes the create request. - * - * @return the created resource. - */ - ProtectionContainerResource create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - ProtectionContainerResource create(Context context); - } - - /** - * The stage of the ProtectionContainerResource definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(String location); - } - - /** - * The stage of the ProtectionContainerResource definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the ProtectionContainerResource definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: ProtectionContainerResource properties. - * - * @param properties ProtectionContainerResource properties. - * @return the next definition stage. - */ - WithCreate withProperties(ProtectionContainer properties); - } - - /** - * The stage of the ProtectionContainerResource definition allowing to specify etag. - */ - interface WithEtag { - /** - * Specifies the etag property: Optional ETag.. - * - * @param etag Optional ETag. - * @return the next definition stage. - */ - WithCreate withEtag(String etag); - } - } - - /** - * Begins update for the ProtectionContainerResource resource. - * - * @return the stage of resource update. - */ - ProtectionContainerResource.Update update(); - - /** - * The template for ProtectionContainerResource update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithEtag { - /** - * Executes the update request. - * - * @return the updated resource. - */ - ProtectionContainerResource apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - ProtectionContainerResource apply(Context context); - } - - /** - * The ProtectionContainerResource update stages. - */ - interface UpdateStages { - /** - * The stage of the ProtectionContainerResource update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the ProtectionContainerResource update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: ProtectionContainerResource properties. - * - * @param properties ProtectionContainerResource properties. - * @return the next definition stage. - */ - Update withProperties(ProtectionContainer properties); - } - - /** - * The stage of the ProtectionContainerResource update allowing to specify etag. - */ - interface WithEtag { - /** - * Specifies the etag property: Optional ETag.. - * - * @param etag Optional ETag. - * @return the next definition stage. - */ - Update withEtag(String etag); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - ProtectionContainerResource refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - ProtectionContainerResource refresh(Context context); - - /** - * This is an async operation and the results should be tracked using location header or Azure-async-url. - * - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response inquireWithResponse(String filter, Context context); - - /** - * This is an async operation and the results should be tracked using location header or Azure-async-url. - * - * @throws com.azure.core.management.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 inquire(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainers.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainers.java deleted file mode 100644 index 54a3294c94e4..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionContainers.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ProtectionContainers. - */ -public interface ProtectionContainers { - /** - * Gets details of the specific container registered to your Recovery Services Vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of the specific container registered to your Recovery Services Vault along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, Context context); - - /** - * Gets details of the specific container registered to your Recovery Services Vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details of the specific container registered to your Recovery Services Vault. - */ - ProtectionContainerResource get(String vaultName, String resourceGroupName, String fabricName, - String containerName); - - /** - * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To - * determine - * whether the backend service has finished processing the request, call Get Container Operation Result API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response unregisterWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, Context context); - - /** - * Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To - * determine - * whether the backend service has finished processing the request, call Get Container Operation Result API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void unregister(String vaultName, String resourceGroupName, String fabricName, String containerName); - - /** - * This is an async operation and the results should be tracked using location header or Azure-async-url. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response inquireWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String filter, Context context); - - /** - * This is an async operation and the results should be tracked using location header or Azure-async-url. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void inquire(String vaultName, String resourceGroupName, String fabricName, String containerName); - - /** - * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an - * asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName Fabric name associated the container. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response refreshWithResponse(String vaultName, String resourceGroupName, String fabricName, String filter, - Context context); - - /** - * Discovers all the containers in the subscription that can be backed up to Recovery Services Vault. This is an - * asynchronous operation. To know the status of the operation, call GetRefreshOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName Fabric name associated the container. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 refresh(String vaultName, String resourceGroupName, String fabricName); - - /** - * Gets details of the specific container registered to your Recovery Services Vault. - * - * @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 details of the specific container registered to your Recovery Services Vault along with {@link Response}. - */ - ProtectionContainerResource getById(String id); - - /** - * Gets details of the specific container registered to your Recovery Services Vault. - * - * @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 details of the specific container registered to your Recovery Services Vault along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new ProtectionContainerResource resource. - * - * @param name resource name. - * @return the first stage of the new ProtectionContainerResource definition. - */ - ProtectionContainerResource.DefinitionStages.Blank define(String name); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntent.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntent.java deleted file mode 100644 index 8aa75882bbea..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntent.java +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Base class for backup ProtectionIntent. - */ -@Fluent -public class ProtectionIntent implements JsonSerializable { - /* - * backup protectionIntent type. - */ - private ProtectionIntentItemType protectionIntentItemType = ProtectionIntentItemType.fromString("ProtectionIntent"); - - /* - * Type of backup management for the backed up item. - */ - private BackupManagementType backupManagementType; - - /* - * ARM ID of the resource to be backed up. - */ - private String sourceResourceId; - - /* - * ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId - */ - private String itemId; - - /* - * ID of the backup policy with which this item is backed up. - */ - private String policyId; - - /* - * Backup state of this backup item. - */ - private ProtectionStatus protectionState; - - /** - * Creates an instance of ProtectionIntent class. - */ - public ProtectionIntent() { - } - - /** - * Get the protectionIntentItemType property: backup protectionIntent type. - * - * @return the protectionIntentItemType value. - */ - public ProtectionIntentItemType protectionIntentItemType() { - return this.protectionIntentItemType; - } - - /** - * Get the backupManagementType property: Type of backup management for the backed up item. - * - * @return the backupManagementType value. - */ - public BackupManagementType backupManagementType() { - return this.backupManagementType; - } - - /** - * Set the backupManagementType property: Type of backup management for the backed up item. - * - * @param backupManagementType the backupManagementType value to set. - * @return the ProtectionIntent object itself. - */ - public ProtectionIntent withBackupManagementType(BackupManagementType backupManagementType) { - this.backupManagementType = backupManagementType; - return this; - } - - /** - * Get the sourceResourceId property: ARM ID of the resource to be backed up. - * - * @return the sourceResourceId value. - */ - public String sourceResourceId() { - return this.sourceResourceId; - } - - /** - * Set the sourceResourceId property: ARM ID of the resource to be backed up. - * - * @param sourceResourceId the sourceResourceId value to set. - * @return the ProtectionIntent object itself. - */ - public ProtectionIntent withSourceResourceId(String sourceResourceId) { - this.sourceResourceId = sourceResourceId; - return this; - } - - /** - * Get the itemId property: ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId. - * - * @return the itemId value. - */ - public String itemId() { - return this.itemId; - } - - /** - * Set the itemId property: ID of the item which is getting protected, In case of Azure Vm , it is ProtectedItemId. - * - * @param itemId the itemId value to set. - * @return the ProtectionIntent object itself. - */ - public ProtectionIntent withItemId(String itemId) { - this.itemId = itemId; - return this; - } - - /** - * Get the policyId property: ID of the backup policy with which this item is backed up. - * - * @return the policyId value. - */ - public String policyId() { - return this.policyId; - } - - /** - * Set the policyId property: ID of the backup policy with which this item is backed up. - * - * @param policyId the policyId value to set. - * @return the ProtectionIntent object itself. - */ - public ProtectionIntent withPolicyId(String policyId) { - this.policyId = policyId; - return this; - } - - /** - * Get the protectionState property: Backup state of this backup item. - * - * @return the protectionState value. - */ - public ProtectionStatus protectionState() { - return this.protectionState; - } - - /** - * Set the protectionState property: Backup state of this backup item. - * - * @param protectionState the protectionState value to set. - * @return the ProtectionIntent object itself. - */ - public ProtectionIntent withProtectionState(ProtectionStatus protectionState) { - this.protectionState = protectionState; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("protectionIntentItemType", - this.protectionIntentItemType == null ? null : this.protectionIntentItemType.toString()); - jsonWriter.writeStringField("backupManagementType", - this.backupManagementType == null ? null : this.backupManagementType.toString()); - jsonWriter.writeStringField("sourceResourceId", this.sourceResourceId); - jsonWriter.writeStringField("itemId", this.itemId); - jsonWriter.writeStringField("policyId", this.policyId); - jsonWriter.writeStringField("protectionState", - this.protectionState == null ? null : this.protectionState.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ProtectionIntent from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProtectionIntent 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 ProtectionIntent. - */ - public static ProtectionIntent fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("protectionIntentItemType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("RecoveryServiceVaultItem".equals(discriminatorValue)) { - return AzureRecoveryServiceVaultProtectionIntent.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureWorkloadAutoProtectionIntent".equals(discriminatorValue)) { - return AzureWorkloadAutoProtectionIntent.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureWorkloadSQLAutoProtectionIntent".equals(discriminatorValue)) { - return AzureWorkloadSqlAutoProtectionIntent.fromJson(readerToUse.reset()); - } else if ("AzureResourceItem".equals(discriminatorValue)) { - return AzureResourceProtectionIntent.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadContainerAutoProtectionIntent".equals(discriminatorValue)) { - return AzureWorkloadContainerAutoProtectionIntent.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static ProtectionIntent fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProtectionIntent deserializedProtectionIntent = new ProtectionIntent(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("protectionIntentItemType".equals(fieldName)) { - deserializedProtectionIntent.protectionIntentItemType - = ProtectionIntentItemType.fromString(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedProtectionIntent.backupManagementType - = BackupManagementType.fromString(reader.getString()); - } else if ("sourceResourceId".equals(fieldName)) { - deserializedProtectionIntent.sourceResourceId = reader.getString(); - } else if ("itemId".equals(fieldName)) { - deserializedProtectionIntent.itemId = reader.getString(); - } else if ("policyId".equals(fieldName)) { - deserializedProtectionIntent.policyId = reader.getString(); - } else if ("protectionState".equals(fieldName)) { - deserializedProtectionIntent.protectionState = ProtectionStatus.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedProtectionIntent; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntentItemType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntentItemType.java deleted file mode 100644 index 2a6e89086b64..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntentItemType.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * backup protectionIntent type. - */ -public final class ProtectionIntentItemType extends ExpandableStringEnum { - /** - * Static value Invalid for ProtectionIntentItemType. - */ - public static final ProtectionIntentItemType INVALID = fromString("Invalid"); - - /** - * Static value AzureResourceItem for ProtectionIntentItemType. - */ - public static final ProtectionIntentItemType AZURE_RESOURCE_ITEM = fromString("AzureResourceItem"); - - /** - * Static value RecoveryServiceVaultItem for ProtectionIntentItemType. - */ - public static final ProtectionIntentItemType RECOVERY_SERVICE_VAULT_ITEM = fromString("RecoveryServiceVaultItem"); - - /** - * Static value AzureWorkloadContainerAutoProtectionIntent for ProtectionIntentItemType. - */ - public static final ProtectionIntentItemType AZURE_WORKLOAD_CONTAINER_AUTO_PROTECTION_INTENT - = fromString("AzureWorkloadContainerAutoProtectionIntent"); - - /** - * Static value AzureWorkloadAutoProtectionIntent for ProtectionIntentItemType. - */ - public static final ProtectionIntentItemType AZURE_WORKLOAD_AUTO_PROTECTION_INTENT - = fromString("AzureWorkloadAutoProtectionIntent"); - - /** - * Static value AzureWorkloadSQLAutoProtectionIntent for ProtectionIntentItemType. - */ - public static final ProtectionIntentItemType AZURE_WORKLOAD_SQLAUTO_PROTECTION_INTENT - = fromString("AzureWorkloadSQLAutoProtectionIntent"); - - /** - * Creates a new instance of ProtectionIntentItemType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ProtectionIntentItemType() { - } - - /** - * Creates or finds a ProtectionIntentItemType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProtectionIntentItemType. - */ - public static ProtectionIntentItemType fromString(String name) { - return fromString(name, ProtectionIntentItemType.class); - } - - /** - * Gets known ProtectionIntentItemType values. - * - * @return known ProtectionIntentItemType values. - */ - public static Collection values() { - return values(ProtectionIntentItemType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntentResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntentResource.java deleted file mode 100644 index f955595c72d0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntentResource.java +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionIntentResourceInner; -import java.util.Map; - -/** - * An immutable client-side representation of ProtectionIntentResource. - */ -public interface ProtectionIntentResource { - /** - * 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: ProtectionIntentResource properties. - * - * @return the properties value. - */ - ProtectionIntent properties(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the etag property: Optional ETag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionIntentResourceInner - * object. - * - * @return the inner object. - */ - ProtectionIntentResourceInner innerModel(); - - /** - * The entirety of the ProtectionIntentResource definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The ProtectionIntentResource definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the ProtectionIntentResource definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the ProtectionIntentResource definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies vaultName, resourceGroupName, fabricName. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @return the next definition stage. - */ - WithCreate withExistingBackupFabric(String vaultName, String resourceGroupName, String fabricName); - } - - /** - * The stage of the ProtectionIntentResource 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.WithLocation, DefinitionStages.WithTags, - DefinitionStages.WithProperties, DefinitionStages.WithEtag { - /** - * Executes the create request. - * - * @return the created resource. - */ - ProtectionIntentResource create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - ProtectionIntentResource create(Context context); - } - - /** - * The stage of the ProtectionIntentResource definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(String location); - } - - /** - * The stage of the ProtectionIntentResource definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the ProtectionIntentResource definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: ProtectionIntentResource properties. - * - * @param properties ProtectionIntentResource properties. - * @return the next definition stage. - */ - WithCreate withProperties(ProtectionIntent properties); - } - - /** - * The stage of the ProtectionIntentResource definition allowing to specify etag. - */ - interface WithEtag { - /** - * Specifies the etag property: Optional ETag.. - * - * @param etag Optional ETag. - * @return the next definition stage. - */ - WithCreate withEtag(String etag); - } - } - - /** - * Begins update for the ProtectionIntentResource resource. - * - * @return the stage of resource update. - */ - ProtectionIntentResource.Update update(); - - /** - * The template for ProtectionIntentResource update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithEtag { - /** - * Executes the update request. - * - * @return the updated resource. - */ - ProtectionIntentResource apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - ProtectionIntentResource apply(Context context); - } - - /** - * The ProtectionIntentResource update stages. - */ - interface UpdateStages { - /** - * The stage of the ProtectionIntentResource update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the ProtectionIntentResource update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: ProtectionIntentResource properties. - * - * @param properties ProtectionIntentResource properties. - * @return the next definition stage. - */ - Update withProperties(ProtectionIntent properties); - } - - /** - * The stage of the ProtectionIntentResource update allowing to specify etag. - */ - interface WithEtag { - /** - * Specifies the etag property: Optional ETag.. - * - * @param etag Optional ETag. - * @return the next definition stage. - */ - Update withEtag(String etag); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - ProtectionIntentResource refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - ProtectionIntentResource refresh(Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntents.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntents.java deleted file mode 100644 index f65e632f3b7b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionIntents.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ProtectionIntents. - */ -public interface ProtectionIntents { - /** - * Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of - * the operation, - * call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup ProtectionIntent along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, String fabricName, - String intentObjectName, Context context); - - /** - * Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of - * the operation, - * call the GetItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup ProtectionIntent. - */ - ProtectionIntentResource get(String vaultName, String resourceGroupName, String fabricName, - String intentObjectName); - - /** - * Used to remove intent from an item. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String vaultName, String resourceGroupName, String fabricName, - String intentObjectName, Context context); - - /** - * Used to remove intent from an item. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param intentObjectName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String vaultName, String resourceGroupName, String fabricName, String intentObjectName); - - /** - * It will validate followings - * 1. Vault capacity - * 2. VM is already protected - * 3. Any VM related configuration passed in properties. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Enable backup validation request on Virtual Machine. - * @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 response contract for enable backup validation request along with {@link Response}. - */ - Response validateWithResponse(String azureRegion, - PreValidateEnableBackupRequest parameters, Context context); - - /** - * It will validate followings - * 1. Vault capacity - * 2. VM is already protected - * 3. Any VM related configuration passed in properties. - * - * @param azureRegion Azure region to hit Api. - * @param parameters Enable backup validation request on Virtual Machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 contract for enable backup validation request. - */ - PreValidateEnableBackupResponse validate(String azureRegion, PreValidateEnableBackupRequest parameters); - - /** - * Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of - * the operation, - * call the GetItemOperationResult API. - * - * @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 base class for backup ProtectionIntent along with {@link Response}. - */ - ProtectionIntentResource getById(String id); - - /** - * Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of - * the operation, - * call the GetItemOperationResult API. - * - * @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 base class for backup ProtectionIntent along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Used to remove intent from an item. - * - * @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); - - /** - * Used to remove intent from an item. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new ProtectionIntentResource resource. - * - * @param name resource name. - * @return the first stage of the new ProtectionIntentResource definition. - */ - ProtectionIntentResource.DefinitionStages.Blank define(String name); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionLevel.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionLevel.java deleted file mode 100644 index b94aaf3fb459..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionLevel.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Protection type in case protected as part of a parent. - */ -public final class ProtectionLevel extends ExpandableStringEnum { - /** - * Protected at database level. - */ - public static final ProtectionLevel DATABASE = fromString("Database"); - - /** - * Database protected under an instance. - */ - public static final ProtectionLevel DATABASE_UNDER_INSTANCE = fromString("DatabaseUnderInstance"); - - /** - * Creates a new instance of ProtectionLevel value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ProtectionLevel() { - } - - /** - * Creates or finds a ProtectionLevel from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProtectionLevel. - */ - public static ProtectionLevel fromString(String name) { - return fromString(name, ProtectionLevel.class); - } - - /** - * Gets known ProtectionLevel values. - * - * @return known ProtectionLevel values. - */ - public static Collection values() { - return values(ProtectionLevel.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicies.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicies.java deleted file mode 100644 index dcab1da26e54..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicies.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ProtectionPolicies. - */ -public interface ProtectionPolicies { - /** - * Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous - * operation. Status of the operation can be fetched using GetPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, String policyName, - Context context); - - /** - * Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous - * operation. Status of the operation can be fetched using GetPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy. - */ - ProtectionPolicyResource get(String vaultName, String resourceGroupName, String policyName); - - /** - * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of - * the - * operation can be fetched using GetProtectionPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String vaultName, String resourceGroupName, String policyName); - - /** - * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of - * the - * operation can be fetched using GetProtectionPolicyOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName Backup policy information to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String vaultName, String resourceGroupName, String policyName, Context context); - - /** - * Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous - * operation. Status of the operation can be fetched using GetPolicyOperationResult API. - * - * @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 base class for backup policy along with {@link Response}. - */ - ProtectionPolicyResource getById(String id); - - /** - * Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous - * operation. Status of the operation can be fetched using GetPolicyOperationResult API. - * - * @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 base class for backup policy along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of - * the - * operation can be fetched using GetProtectionPolicyOperationResult API. - * - * @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 specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of - * the - * operation can be fetched using GetProtectionPolicyOperationResult API. - * - * @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 ProtectionPolicyResource resource. - * - * @param name resource name. - * @return the first stage of the new ProtectionPolicyResource definition. - */ - ProtectionPolicyResource.DefinitionStages.Blank define(String name); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicy.java deleted file mode 100644 index cba356eeb3a0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicy.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Base class for backup policy. Workload-specific backup policies are derived from this class. - */ -@Fluent -public class ProtectionPolicy implements JsonSerializable { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String backupManagementType = "ProtectionPolicy"; - - /* - * Number of items associated with this policy. - */ - private Integer protectedItemsCount; - - /* - * ResourceGuard Operation Requests - */ - private List resourceGuardOperationRequests; - - /** - * Creates an instance of ProtectionPolicy class. - */ - public ProtectionPolicy() { - } - - /** - * Get the backupManagementType property: This property will be used as the discriminator for deciding the specific - * types in the polymorphic chain of types. - * - * @return the backupManagementType value. - */ - public String backupManagementType() { - return this.backupManagementType; - } - - /** - * Get the protectedItemsCount property: Number of items associated with this policy. - * - * @return the protectedItemsCount value. - */ - public Integer protectedItemsCount() { - return this.protectedItemsCount; - } - - /** - * Set the protectedItemsCount property: Number of items associated with this policy. - * - * @param protectedItemsCount the protectedItemsCount value to set. - * @return the ProtectionPolicy object itself. - */ - public ProtectionPolicy withProtectedItemsCount(Integer protectedItemsCount) { - this.protectedItemsCount = protectedItemsCount; - return this; - } - - /** - * Get the resourceGuardOperationRequests property: ResourceGuard Operation Requests. - * - * @return the resourceGuardOperationRequests value. - */ - public List resourceGuardOperationRequests() { - return this.resourceGuardOperationRequests; - } - - /** - * Set the resourceGuardOperationRequests property: ResourceGuard Operation Requests. - * - * @param resourceGuardOperationRequests the resourceGuardOperationRequests value to set. - * @return the ProtectionPolicy object itself. - */ - public ProtectionPolicy withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - this.resourceGuardOperationRequests = resourceGuardOperationRequests; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("backupManagementType", this.backupManagementType); - jsonWriter.writeNumberField("protectedItemsCount", this.protectedItemsCount); - jsonWriter.writeArrayField("resourceGuardOperationRequests", this.resourceGuardOperationRequests, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ProtectionPolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ProtectionPolicy 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 ProtectionPolicy. - */ - public static ProtectionPolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("backupManagementType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureWorkload".equals(discriminatorValue)) { - return AzureVmWorkloadProtectionPolicy.fromJson(readerToUse.reset()); - } else if ("AzureStorage".equals(discriminatorValue)) { - return AzureFileShareProtectionPolicy.fromJson(readerToUse.reset()); - } else if ("AzureIaasVM".equals(discriminatorValue)) { - return AzureIaaSvmProtectionPolicy.fromJson(readerToUse.reset()); - } else if ("AzureSql".equals(discriminatorValue)) { - return AzureSqlProtectionPolicy.fromJson(readerToUse.reset()); - } else if ("GenericProtectionPolicy".equals(discriminatorValue)) { - return GenericProtectionPolicy.fromJson(readerToUse.reset()); - } else if ("MAB".equals(discriminatorValue)) { - return MabProtectionPolicy.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static ProtectionPolicy fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ProtectionPolicy deserializedProtectionPolicy = new ProtectionPolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("backupManagementType".equals(fieldName)) { - deserializedProtectionPolicy.backupManagementType = reader.getString(); - } else if ("protectedItemsCount".equals(fieldName)) { - deserializedProtectionPolicy.protectedItemsCount = reader.getNullable(JsonReader::getInt); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedProtectionPolicy.resourceGuardOperationRequests = resourceGuardOperationRequests; - } else { - reader.skipChildren(); - } - } - - return deserializedProtectionPolicy; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyOperationResults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyOperationResults.java deleted file mode 100644 index e8b40c23dd14..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyOperationResults.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ProtectionPolicyOperationResults. - */ -public interface ProtectionPolicyOperationResults { - /** - * Provides the result of an operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName The name of the ProtectionPolicyResource. - * @param operationId The name of the ProtectionPolicyResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, String policyName, - String operationId, Context context); - - /** - * Provides the result of an operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName The name of the ProtectionPolicyResource. - * @param operationId The name of the ProtectionPolicyResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup policy. - */ - ProtectionPolicyResource get(String vaultName, String resourceGroupName, String policyName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyOperationStatuses.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyOperationStatuses.java deleted file mode 100644 index dfa1c8c3dfbd..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyOperationStatuses.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ProtectionPolicyOperationStatuses. - */ -public interface ProtectionPolicyOperationStatuses { - /** - * Provides the status of the asynchronous operations like backup, restore. The status can be in progress, completed - * or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some - * operations - * create jobs. This method returns the list of jobs associated with operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName The name of the ProtectionPolicyResource. - * @param operationId The name of the ProtectionPolicyResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, String policyName, - String operationId, Context context); - - /** - * Provides the status of the asynchronous operations like backup, restore. The status can be in progress, completed - * or failed. You can refer to the Operation Status enum for all the possible states of an operation. Some - * operations - * create jobs. This method returns the list of jobs associated with operation. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param policyName The name of the ProtectionPolicyResource. - * @param operationId The name of the ProtectionPolicyResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status. - */ - OperationStatus get(String vaultName, String resourceGroupName, String policyName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyResource.java deleted file mode 100644 index 708d1c5231ee..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionPolicyResource.java +++ /dev/null @@ -1,301 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner; -import java.util.Map; - -/** - * An immutable client-side representation of ProtectionPolicyResource. - */ -public interface ProtectionPolicyResource { - /** - * 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: ProtectionPolicyResource properties. - * - * @return the properties value. - */ - ProtectionPolicy properties(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the etag property: Optional ETag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectionPolicyResourceInner - * object. - * - * @return the inner object. - */ - ProtectionPolicyResourceInner innerModel(); - - /** - * The entirety of the ProtectionPolicyResource definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The ProtectionPolicyResource definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the ProtectionPolicyResource definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the ProtectionPolicyResource definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies vaultName, resourceGroupName. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @return the next definition stage. - */ - WithCreate withExistingVault(String vaultName, String resourceGroupName); - } - - /** - * The stage of the ProtectionPolicyResource 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.WithLocation, DefinitionStages.WithTags, - DefinitionStages.WithProperties, DefinitionStages.WithEtag { - /** - * Executes the create request. - * - * @return the created resource. - */ - ProtectionPolicyResource create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - ProtectionPolicyResource create(Context context); - } - - /** - * The stage of the ProtectionPolicyResource definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(String location); - } - - /** - * The stage of the ProtectionPolicyResource definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the ProtectionPolicyResource definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: ProtectionPolicyResource properties. - * - * @param properties ProtectionPolicyResource properties. - * @return the next definition stage. - */ - WithCreate withProperties(ProtectionPolicy properties); - } - - /** - * The stage of the ProtectionPolicyResource definition allowing to specify etag. - */ - interface WithEtag { - /** - * Specifies the etag property: Optional ETag.. - * - * @param etag Optional ETag. - * @return the next definition stage. - */ - WithCreate withEtag(String etag); - } - } - - /** - * Begins update for the ProtectionPolicyResource resource. - * - * @return the stage of resource update. - */ - ProtectionPolicyResource.Update update(); - - /** - * The template for ProtectionPolicyResource update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithEtag { - /** - * Executes the update request. - * - * @return the updated resource. - */ - ProtectionPolicyResource apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - ProtectionPolicyResource apply(Context context); - } - - /** - * The ProtectionPolicyResource update stages. - */ - interface UpdateStages { - /** - * The stage of the ProtectionPolicyResource update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the ProtectionPolicyResource update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: ProtectionPolicyResource properties. - * - * @param properties ProtectionPolicyResource properties. - * @return the next definition stage. - */ - Update withProperties(ProtectionPolicy properties); - } - - /** - * The stage of the ProtectionPolicyResource update allowing to specify etag. - */ - interface WithEtag { - /** - * Specifies the etag property: Optional ETag.. - * - * @param etag Optional ETag. - * @return the next definition stage. - */ - Update withEtag(String etag); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - ProtectionPolicyResource refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - ProtectionPolicyResource refresh(Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionState.java deleted file mode 100644 index 57a0b943a069..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionState.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Backup state of this backup item. - */ -public final class ProtectionState extends ExpandableStringEnum { - /** - * Static value Invalid for ProtectionState. - */ - public static final ProtectionState INVALID = fromString("Invalid"); - - /** - * Static value IRPending for ProtectionState. - */ - public static final ProtectionState IRPENDING = fromString("IRPending"); - - /** - * Static value Protected for ProtectionState. - */ - public static final ProtectionState PROTECTED = fromString("Protected"); - - /** - * Static value ProtectionError for ProtectionState. - */ - public static final ProtectionState PROTECTION_ERROR = fromString("ProtectionError"); - - /** - * Static value ProtectionStopped for ProtectionState. - */ - public static final ProtectionState PROTECTION_STOPPED = fromString("ProtectionStopped"); - - /** - * Static value ProtectionPaused for ProtectionState. - */ - public static final ProtectionState PROTECTION_PAUSED = fromString("ProtectionPaused"); - - /** - * Static value BackupsSuspended for ProtectionState. - */ - public static final ProtectionState BACKUPS_SUSPENDED = fromString("BackupsSuspended"); - - /** - * Creates a new instance of ProtectionState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ProtectionState() { - } - - /** - * Creates or finds a ProtectionState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProtectionState. - */ - public static ProtectionState fromString(String name) { - return fromString(name, ProtectionState.class); - } - - /** - * Gets known ProtectionState values. - * - * @return known ProtectionState values. - */ - public static Collection values() { - return values(ProtectionState.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionStatus.java deleted file mode 100644 index 9d2b65ff8cca..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectionStatus.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Specifies whether the container is registered or not. - */ -public final class ProtectionStatus extends ExpandableStringEnum { - /** - * Static value Invalid for ProtectionStatus. - */ - public static final ProtectionStatus INVALID = fromString("Invalid"); - - /** - * Static value NotProtected for ProtectionStatus. - */ - public static final ProtectionStatus NOT_PROTECTED = fromString("NotProtected"); - - /** - * Static value Protecting for ProtectionStatus. - */ - public static final ProtectionStatus PROTECTING = fromString("Protecting"); - - /** - * Static value Protected for ProtectionStatus. - */ - public static final ProtectionStatus PROTECTED = fromString("Protected"); - - /** - * Static value ProtectionFailed for ProtectionStatus. - */ - public static final ProtectionStatus PROTECTION_FAILED = fromString("ProtectionFailed"); - - /** - * Creates a new instance of ProtectionStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ProtectionStatus() { - } - - /** - * Creates or finds a ProtectionStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProtectionStatus. - */ - public static ProtectionStatus fromString(String name) { - return fromString(name, ProtectionStatus.class); - } - - /** - * Gets known ProtectionStatus values. - * - * @return known ProtectionStatus values. - */ - public static Collection values() { - return values(ProtectionStatus.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProvisioningState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProvisioningState.java deleted file mode 100644 index 6e947c53eee1..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProvisioningState.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Gets or sets provisioning state of the private endpoint connection. - */ -public final class ProvisioningState extends ExpandableStringEnum { - /** - * Static value Succeeded for ProvisioningState. - */ - public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Deleting for ProvisioningState. - */ - public static final ProvisioningState DELETING = fromString("Deleting"); - - /** - * Static value Failed for ProvisioningState. - */ - public static final ProvisioningState FAILED = fromString("Failed"); - - /** - * Static value Pending for ProvisioningState. - */ - public static final ProvisioningState PENDING = fromString("Pending"); - - /** - * Creates a new instance of ProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ProvisioningState() { - } - - /** - * Creates or finds a ProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProvisioningState. - */ - public static ProvisioningState fromString(String name) { - return fromString(name, ProvisioningState.class); - } - - /** - * Gets known ProvisioningState values. - * - * @return known ProvisioningState values. - */ - public static Collection values() { - return values(ProvisioningState.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryMode.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryMode.java deleted file mode 100644 index cd6307d66cda..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryMode.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines whether the current recovery mode is file restore or database restore. - */ -public final class RecoveryMode extends ExpandableStringEnum { - /** - * Static value Invalid for RecoveryMode. - */ - public static final RecoveryMode INVALID = fromString("Invalid"); - - /** - * Static value FileRecovery for RecoveryMode. - */ - public static final RecoveryMode FILE_RECOVERY = fromString("FileRecovery"); - - /** - * Static value WorkloadRecovery for RecoveryMode. - */ - public static final RecoveryMode WORKLOAD_RECOVERY = fromString("WorkloadRecovery"); - - /** - * Static value SnapshotAttach for RecoveryMode. - */ - public static final RecoveryMode SNAPSHOT_ATTACH = fromString("SnapshotAttach"); - - /** - * Static value RecoveryUsingSnapshot for RecoveryMode. - */ - public static final RecoveryMode RECOVERY_USING_SNAPSHOT = fromString("RecoveryUsingSnapshot"); - - /** - * Static value SnapshotAttachAndRecover for RecoveryMode. - */ - public static final RecoveryMode SNAPSHOT_ATTACH_AND_RECOVER = fromString("SnapshotAttachAndRecover"); - - /** - * Creates a new instance of RecoveryMode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RecoveryMode() { - } - - /** - * Creates or finds a RecoveryMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding RecoveryMode. - */ - public static RecoveryMode fromString(String name) { - return fromString(name, RecoveryMode.class); - } - - /** - * Gets known RecoveryMode values. - * - * @return known RecoveryMode values. - */ - public static Collection values() { - return values(RecoveryMode.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoint.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoint.java deleted file mode 100644 index 91d72bef61e2..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoint.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Base class for backup copies. Workload-specific backup copies are derived from this class. - */ -@Immutable -public class RecoveryPoint implements JsonSerializable { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "RecoveryPoint"; - - /* - * Threat status of the recovery point - */ - private ThreatStatus threatStatus; - - /* - * Recovery point threat information. - */ - private List threatInfo; - - /** - * Creates an instance of RecoveryPoint class. - */ - protected RecoveryPoint() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - public String objectType() { - return this.objectType; - } - - /** - * Get the threatStatus property: Threat status of the recovery point. - * - * @return the threatStatus value. - */ - public ThreatStatus threatStatus() { - return this.threatStatus; - } - - /** - * Set the threatStatus property: Threat status of the recovery point. - * - * @param threatStatus the threatStatus value to set. - * @return the RecoveryPoint object itself. - */ - RecoveryPoint withThreatStatus(ThreatStatus threatStatus) { - this.threatStatus = threatStatus; - return this; - } - - /** - * Get the threatInfo property: Recovery point threat information. - * - * @return the threatInfo value. - */ - public List threatInfo() { - return this.threatInfo; - } - - /** - * Set the threatInfo property: Recovery point threat information. - * - * @param threatInfo the threatInfo value to set. - * @return the RecoveryPoint object itself. - */ - RecoveryPoint withThreatInfo(List threatInfo) { - this.threatInfo = threatInfo; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeStringField("threatStatus", this.threatStatus == null ? null : this.threatStatus.toString()); - jsonWriter.writeArrayField("threatInfo", this.threatInfo, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RecoveryPoint from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RecoveryPoint 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 RecoveryPoint. - */ - public static RecoveryPoint fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureFileShareRecoveryPoint".equals(discriminatorValue)) { - return AzureFileShareRecoveryPoint.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadRecoveryPoint".equals(discriminatorValue)) { - return AzureWorkloadRecoveryPoint.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureWorkloadSAPHanaRecoveryPoint".equals(discriminatorValue)) { - return AzureWorkloadSapHanaRecoveryPoint.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadSAPAseRecoveryPoint".equals(discriminatorValue)) { - return AzureWorkloadSapAseRecoveryPoint.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadSQLRecoveryPoint".equals(discriminatorValue)) { - return AzureWorkloadSqlRecoveryPoint.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureWorkloadSQLPointInTimeRecoveryPoint".equals(discriminatorValue)) { - return AzureWorkloadSqlPointInTimeRecoveryPoint.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadPointInTimeRecoveryPoint".equals(discriminatorValue)) { - return AzureWorkloadPointInTimeRecoveryPoint.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureWorkloadSAPHanaPointInTimeRecoveryPoint".equals(discriminatorValue)) { - return AzureWorkloadSapHanaPointInTimeRecoveryPoint.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadSAPAsePointInTimeRecoveryPoint".equals(discriminatorValue)) { - return AzureWorkloadSapAsePointInTimeRecoveryPoint.fromJson(readerToUse.reset()); - } else if ("GenericRecoveryPoint".equals(discriminatorValue)) { - return GenericRecoveryPoint.fromJson(readerToUse.reset()); - } else if ("IaasVMRecoveryPoint".equals(discriminatorValue)) { - return IaasVMRecoveryPoint.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static RecoveryPoint fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RecoveryPoint deserializedRecoveryPoint = new RecoveryPoint(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedRecoveryPoint.objectType = reader.getString(); - } else if ("threatStatus".equals(fieldName)) { - deserializedRecoveryPoint.threatStatus = ThreatStatus.fromString(reader.getString()); - } else if ("threatInfo".equals(fieldName)) { - List threatInfo = reader.readArray(reader1 -> ThreatInfo.fromJson(reader1)); - deserializedRecoveryPoint.threatInfo = threatInfo; - } else { - reader.skipChildren(); - } - } - - return deserializedRecoveryPoint; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointDiskConfiguration.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointDiskConfiguration.java deleted file mode 100644 index 63429cea0e5f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointDiskConfiguration.java +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Disk configuration. - */ -@Immutable -public final class RecoveryPointDiskConfiguration implements JsonSerializable { - /* - * Number of disks included in backup - */ - private Integer numberOfDisksIncludedInBackup; - - /* - * Number of disks attached to the VM - */ - private Integer numberOfDisksAttachedToVm; - - /* - * Information of disks included in backup - */ - private List includedDiskList; - - /* - * Information of disks excluded from backup - */ - private List excludedDiskList; - - /** - * Creates an instance of RecoveryPointDiskConfiguration class. - */ - private RecoveryPointDiskConfiguration() { - } - - /** - * Get the numberOfDisksIncludedInBackup property: Number of disks included in backup. - * - * @return the numberOfDisksIncludedInBackup value. - */ - public Integer numberOfDisksIncludedInBackup() { - return this.numberOfDisksIncludedInBackup; - } - - /** - * Get the numberOfDisksAttachedToVm property: Number of disks attached to the VM. - * - * @return the numberOfDisksAttachedToVm value. - */ - public Integer numberOfDisksAttachedToVm() { - return this.numberOfDisksAttachedToVm; - } - - /** - * Get the includedDiskList property: Information of disks included in backup. - * - * @return the includedDiskList value. - */ - public List includedDiskList() { - return this.includedDiskList; - } - - /** - * Get the excludedDiskList property: Information of disks excluded from backup. - * - * @return the excludedDiskList value. - */ - public List excludedDiskList() { - return this.excludedDiskList; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("numberOfDisksIncludedInBackup", this.numberOfDisksIncludedInBackup); - jsonWriter.writeNumberField("numberOfDisksAttachedToVm", this.numberOfDisksAttachedToVm); - jsonWriter.writeArrayField("includedDiskList", this.includedDiskList, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("excludedDiskList", this.excludedDiskList, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RecoveryPointDiskConfiguration from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RecoveryPointDiskConfiguration 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 RecoveryPointDiskConfiguration. - */ - public static RecoveryPointDiskConfiguration fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RecoveryPointDiskConfiguration deserializedRecoveryPointDiskConfiguration - = new RecoveryPointDiskConfiguration(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("numberOfDisksIncludedInBackup".equals(fieldName)) { - deserializedRecoveryPointDiskConfiguration.numberOfDisksIncludedInBackup - = reader.getNullable(JsonReader::getInt); - } else if ("numberOfDisksAttachedToVm".equals(fieldName)) { - deserializedRecoveryPointDiskConfiguration.numberOfDisksAttachedToVm - = reader.getNullable(JsonReader::getInt); - } else if ("includedDiskList".equals(fieldName)) { - List includedDiskList - = reader.readArray(reader1 -> DiskInformation.fromJson(reader1)); - deserializedRecoveryPointDiskConfiguration.includedDiskList = includedDiskList; - } else if ("excludedDiskList".equals(fieldName)) { - List excludedDiskList - = reader.readArray(reader1 -> DiskInformation.fromJson(reader1)); - deserializedRecoveryPointDiskConfiguration.excludedDiskList = excludedDiskList; - } else { - reader.skipChildren(); - } - } - - return deserializedRecoveryPointDiskConfiguration; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointMoveReadinessInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointMoveReadinessInfo.java deleted file mode 100644 index d7dc3f23341d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointMoveReadinessInfo.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The RecoveryPointMoveReadinessInfo model. - */ -@Immutable -public final class RecoveryPointMoveReadinessInfo implements JsonSerializable { - /* - * The isReadyForMove property. - */ - private Boolean isReadyForMove; - - /* - * The additionalInfo property. - */ - private String additionalInfo; - - /** - * Creates an instance of RecoveryPointMoveReadinessInfo class. - */ - private RecoveryPointMoveReadinessInfo() { - } - - /** - * Get the isReadyForMove property: The isReadyForMove property. - * - * @return the isReadyForMove value. - */ - public Boolean isReadyForMove() { - return this.isReadyForMove; - } - - /** - * Get the additionalInfo property: The additionalInfo property. - * - * @return the additionalInfo value. - */ - public String additionalInfo() { - return this.additionalInfo; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("isReadyForMove", this.isReadyForMove); - jsonWriter.writeStringField("additionalInfo", this.additionalInfo); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RecoveryPointMoveReadinessInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RecoveryPointMoveReadinessInfo 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 RecoveryPointMoveReadinessInfo. - */ - public static RecoveryPointMoveReadinessInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RecoveryPointMoveReadinessInfo deserializedRecoveryPointMoveReadinessInfo - = new RecoveryPointMoveReadinessInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("isReadyForMove".equals(fieldName)) { - deserializedRecoveryPointMoveReadinessInfo.isReadyForMove - = reader.getNullable(JsonReader::getBoolean); - } else if ("additionalInfo".equals(fieldName)) { - deserializedRecoveryPointMoveReadinessInfo.additionalInfo = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRecoveryPointMoveReadinessInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointProperties.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointProperties.java deleted file mode 100644 index 7692c678bc33..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointProperties.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Properties of Recovery Point. - */ -@Immutable -public final class RecoveryPointProperties implements JsonSerializable { - /* - * Expiry time of Recovery Point in UTC. - */ - private String expiryTime; - - /* - * Rule name tagged on Recovery Point that governs life cycle - */ - private String ruleName; - - /* - * Bool to indicate whether RP is in soft delete state or not - */ - private Boolean isSoftDeleted; - - /** - * Creates an instance of RecoveryPointProperties class. - */ - private RecoveryPointProperties() { - } - - /** - * Get the expiryTime property: Expiry time of Recovery Point in UTC. - * - * @return the expiryTime value. - */ - public String expiryTime() { - return this.expiryTime; - } - - /** - * Get the ruleName property: Rule name tagged on Recovery Point that governs life cycle. - * - * @return the ruleName value. - */ - public String ruleName() { - return this.ruleName; - } - - /** - * Get the isSoftDeleted property: Bool to indicate whether RP is in soft delete state or not. - * - * @return the isSoftDeleted value. - */ - public Boolean isSoftDeleted() { - return this.isSoftDeleted; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("expiryTime", this.expiryTime); - jsonWriter.writeStringField("ruleName", this.ruleName); - jsonWriter.writeBooleanField("isSoftDeleted", this.isSoftDeleted); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RecoveryPointProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RecoveryPointProperties 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 RecoveryPointProperties. - */ - public static RecoveryPointProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RecoveryPointProperties deserializedRecoveryPointProperties = new RecoveryPointProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("expiryTime".equals(fieldName)) { - deserializedRecoveryPointProperties.expiryTime = reader.getString(); - } else if ("ruleName".equals(fieldName)) { - deserializedRecoveryPointProperties.ruleName = reader.getString(); - } else if ("isSoftDeleted".equals(fieldName)) { - deserializedRecoveryPointProperties.isSoftDeleted = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedRecoveryPointProperties; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointRehydrationInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointRehydrationInfo.java deleted file mode 100644 index ac51b9b08f9b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointRehydrationInfo.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * RP Rehydration Info. - */ -@Fluent -public final class RecoveryPointRehydrationInfo implements JsonSerializable { - /* - * How long the rehydrated RP should be kept - * Should be ISO8601 Duration format e.g. "P7D" - */ - private String rehydrationRetentionDuration; - - /* - * Rehydration Priority - */ - private RehydrationPriority rehydrationPriority; - - /** - * Creates an instance of RecoveryPointRehydrationInfo class. - */ - public RecoveryPointRehydrationInfo() { - } - - /** - * Get the rehydrationRetentionDuration property: How long the rehydrated RP should be kept - * Should be ISO8601 Duration format e.g. "P7D". - * - * @return the rehydrationRetentionDuration value. - */ - public String rehydrationRetentionDuration() { - return this.rehydrationRetentionDuration; - } - - /** - * Set the rehydrationRetentionDuration property: How long the rehydrated RP should be kept - * Should be ISO8601 Duration format e.g. "P7D". - * - * @param rehydrationRetentionDuration the rehydrationRetentionDuration value to set. - * @return the RecoveryPointRehydrationInfo object itself. - */ - public RecoveryPointRehydrationInfo withRehydrationRetentionDuration(String rehydrationRetentionDuration) { - this.rehydrationRetentionDuration = rehydrationRetentionDuration; - return this; - } - - /** - * Get the rehydrationPriority property: Rehydration Priority. - * - * @return the rehydrationPriority value. - */ - public RehydrationPriority rehydrationPriority() { - return this.rehydrationPriority; - } - - /** - * Set the rehydrationPriority property: Rehydration Priority. - * - * @param rehydrationPriority the rehydrationPriority value to set. - * @return the RecoveryPointRehydrationInfo object itself. - */ - public RecoveryPointRehydrationInfo withRehydrationPriority(RehydrationPriority rehydrationPriority) { - this.rehydrationPriority = rehydrationPriority; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("rehydrationRetentionDuration", this.rehydrationRetentionDuration); - jsonWriter.writeStringField("rehydrationPriority", - this.rehydrationPriority == null ? null : this.rehydrationPriority.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RecoveryPointRehydrationInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RecoveryPointRehydrationInfo 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 RecoveryPointRehydrationInfo. - */ - public static RecoveryPointRehydrationInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RecoveryPointRehydrationInfo deserializedRecoveryPointRehydrationInfo = new RecoveryPointRehydrationInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("rehydrationRetentionDuration".equals(fieldName)) { - deserializedRecoveryPointRehydrationInfo.rehydrationRetentionDuration = reader.getString(); - } else if ("rehydrationPriority".equals(fieldName)) { - deserializedRecoveryPointRehydrationInfo.rehydrationPriority - = RehydrationPriority.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedRecoveryPointRehydrationInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointResource.java deleted file mode 100644 index 871dae6e2bec..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointResource.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; -import java.util.Map; - -/** - * An immutable client-side representation of RecoveryPointResource. - */ -public interface RecoveryPointResource { - /** - * 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: RecoveryPointResource properties. - * - * @return the properties value. - */ - RecoveryPoint properties(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the etag property: Optional ETag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner object. - * - * @return the inner object. - */ - RecoveryPointResourceInner innerModel(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierInformation.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierInformation.java deleted file mode 100644 index 56dd39e9b6c3..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierInformation.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.Map; - -/** - * Recovery point tier information. - */ -@Immutable -public class RecoveryPointTierInformation implements JsonSerializable { - /* - * Recovery point tier type. - */ - private RecoveryPointTierType type; - - /* - * Recovery point tier status. - */ - private RecoveryPointTierStatus status; - - /* - * Recovery point tier status. - */ - private Map extendedInfo; - - /** - * Creates an instance of RecoveryPointTierInformation class. - */ - protected RecoveryPointTierInformation() { - } - - /** - * Get the type property: Recovery point tier type. - * - * @return the type value. - */ - public RecoveryPointTierType type() { - return this.type; - } - - /** - * Set the type property: Recovery point tier type. - * - * @param type the type value to set. - * @return the RecoveryPointTierInformation object itself. - */ - RecoveryPointTierInformation withType(RecoveryPointTierType type) { - this.type = type; - return this; - } - - /** - * Get the status property: Recovery point tier status. - * - * @return the status value. - */ - public RecoveryPointTierStatus status() { - return this.status; - } - - /** - * Set the status property: Recovery point tier status. - * - * @param status the status value to set. - * @return the RecoveryPointTierInformation object itself. - */ - RecoveryPointTierInformation withStatus(RecoveryPointTierStatus status) { - this.status = status; - return this; - } - - /** - * Get the extendedInfo property: Recovery point tier status. - * - * @return the extendedInfo value. - */ - public Map extendedInfo() { - return this.extendedInfo; - } - - /** - * Set the extendedInfo property: Recovery point tier status. - * - * @param extendedInfo the extendedInfo value to set. - * @return the RecoveryPointTierInformation object itself. - */ - RecoveryPointTierInformation withExtendedInfo(Map extendedInfo) { - this.extendedInfo = extendedInfo; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeMapField("extendedInfo", this.extendedInfo, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RecoveryPointTierInformation from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RecoveryPointTierInformation 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 RecoveryPointTierInformation. - */ - public static RecoveryPointTierInformation fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RecoveryPointTierInformation deserializedRecoveryPointTierInformation = new RecoveryPointTierInformation(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedRecoveryPointTierInformation.type - = RecoveryPointTierType.fromString(reader.getString()); - } else if ("status".equals(fieldName)) { - deserializedRecoveryPointTierInformation.status - = RecoveryPointTierStatus.fromString(reader.getString()); - } else if ("extendedInfo".equals(fieldName)) { - Map extendedInfo = reader.readMap(reader1 -> reader1.getString()); - deserializedRecoveryPointTierInformation.extendedInfo = extendedInfo; - } else { - reader.skipChildren(); - } - } - - return deserializedRecoveryPointTierInformation; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierInformationV2.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierInformationV2.java deleted file mode 100644 index 0a522f634905..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierInformationV2.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.Map; - -/** - * RecoveryPoint Tier Information V2. - */ -@Immutable -public final class RecoveryPointTierInformationV2 extends RecoveryPointTierInformation { - /* - * Recovery point tier type. - */ - private RecoveryPointTierType type; - - /* - * Recovery point tier status. - */ - private RecoveryPointTierStatus status; - - /* - * Recovery point tier status. - */ - private Map extendedInfo; - - /** - * Creates an instance of RecoveryPointTierInformationV2 class. - */ - private RecoveryPointTierInformationV2() { - } - - /** - * Get the type property: Recovery point tier type. - * - * @return the type value. - */ - @Override - public RecoveryPointTierType type() { - return this.type; - } - - /** - * Get the status property: Recovery point tier status. - * - * @return the status value. - */ - @Override - public RecoveryPointTierStatus status() { - return this.status; - } - - /** - * Get the extendedInfo property: Recovery point tier status. - * - * @return the extendedInfo value. - */ - @Override - public Map extendedInfo() { - return this.extendedInfo; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeMapField("extendedInfo", extendedInfo(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RecoveryPointTierInformationV2 from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RecoveryPointTierInformationV2 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 RecoveryPointTierInformationV2. - */ - public static RecoveryPointTierInformationV2 fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RecoveryPointTierInformationV2 deserializedRecoveryPointTierInformationV2 - = new RecoveryPointTierInformationV2(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("extendedInfo".equals(fieldName)) { - Map extendedInfo = reader.readMap(reader1 -> reader1.getString()); - deserializedRecoveryPointTierInformationV2.extendedInfo = extendedInfo; - } else if ("type".equals(fieldName)) { - deserializedRecoveryPointTierInformationV2.type - = RecoveryPointTierType.fromString(reader.getString()); - } else if ("status".equals(fieldName)) { - deserializedRecoveryPointTierInformationV2.status - = RecoveryPointTierStatus.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedRecoveryPointTierInformationV2; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierStatus.java deleted file mode 100644 index 5eb3c87cef81..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierStatus.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Recovery point tier status. - */ -public final class RecoveryPointTierStatus extends ExpandableStringEnum { - /** - * Static value Invalid for RecoveryPointTierStatus. - */ - public static final RecoveryPointTierStatus INVALID = fromString("Invalid"); - - /** - * Static value Valid for RecoveryPointTierStatus. - */ - public static final RecoveryPointTierStatus VALID = fromString("Valid"); - - /** - * Static value Disabled for RecoveryPointTierStatus. - */ - public static final RecoveryPointTierStatus DISABLED = fromString("Disabled"); - - /** - * Static value Deleted for RecoveryPointTierStatus. - */ - public static final RecoveryPointTierStatus DELETED = fromString("Deleted"); - - /** - * Static value Rehydrated for RecoveryPointTierStatus. - */ - public static final RecoveryPointTierStatus REHYDRATED = fromString("Rehydrated"); - - /** - * Creates a new instance of RecoveryPointTierStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RecoveryPointTierStatus() { - } - - /** - * Creates or finds a RecoveryPointTierStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding RecoveryPointTierStatus. - */ - public static RecoveryPointTierStatus fromString(String name) { - return fromString(name, RecoveryPointTierStatus.class); - } - - /** - * Gets known RecoveryPointTierStatus values. - * - * @return known RecoveryPointTierStatus values. - */ - public static Collection values() { - return values(RecoveryPointTierStatus.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierType.java deleted file mode 100644 index 1eace244fafb..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointTierType.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -/** - * Recovery point tier type. - */ -public enum RecoveryPointTierType { - /** - * Enum value Invalid. - */ - INVALID("Invalid"), - - /** - * Enum value InstantRP. - */ - INSTANT_RP("InstantRP"), - - /** - * Enum value HardenedRP. - */ - HARDENED_RP("HardenedRP"), - - /** - * Enum value ArchivedRP. - */ - ARCHIVED_RP("ArchivedRP"); - - /** - * The actual serialized value for a RecoveryPointTierType instance. - */ - private final String value; - - RecoveryPointTierType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a RecoveryPointTierType instance. - * - * @param value the serialized value to parse. - * @return the parsed RecoveryPointTierType object, or null if unable to parse. - */ - public static RecoveryPointTierType fromString(String value) { - if (value == null) { - return null; - } - RecoveryPointTierType[] items = RecoveryPointTierType.values(); - for (RecoveryPointTierType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoints.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoints.java deleted file mode 100644 index 352b9304a644..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPoints.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of RecoveryPoints. - */ -public interface RecoveryPoints { - /** - * Provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous - * operation. - * To know the status of the operation, call the GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup copies along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId, Context context); - - /** - * Provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous - * operation. - * To know the status of the operation, call the GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup copies. - */ - RecoveryPointResource get(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId); - - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName); - - /** - * Lists the backup copies for the backed up item. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param filter OData filter options. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, String filter, Context context); - - /** - * UpdateRecoveryPoint to update recovery point for given RecoveryPointID. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the VaultResource. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Request body for operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup copies along with {@link Response}. - */ - Response updateWithResponse(String resourceGroupName, String vaultName, String fabricName, - String containerName, String protectedItemName, String recoveryPointId, UpdateRecoveryPointRequest parameters, - Context context); - - /** - * UpdateRecoveryPoint to update recovery point for given RecoveryPointID. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the VaultResource. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return base class for backup copies. - */ - RecoveryPointResource update(String resourceGroupName, String vaultName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, UpdateRecoveryPointRequest parameters); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointsRecommendedForMoves.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointsRecommendedForMoves.java deleted file mode 100644 index 89cd1a1a39d5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointsRecommendedForMoves.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of RecoveryPointsRecommendedForMoves. - */ -public interface RecoveryPointsRecommendedForMoves { - /** - * Lists the recovery points recommended for move to another tier. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters List Recovery points Recommended for Move Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, ListRecoveryPointsRecommendedForMoveRequest parameters); - - /** - * Lists the recovery points recommended for move to another tier. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param parameters List Recovery points Recommended for Move Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RecoveryPoint resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName, String fabricName, - String containerName, String protectedItemName, ListRecoveryPointsRecommendedForMoveRequest parameters, - Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryType.java deleted file mode 100644 index e02b18ba4e76..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryType.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Type of this recovery. - */ -public final class RecoveryType extends ExpandableStringEnum { - /** - * Static value Invalid for RecoveryType. - */ - public static final RecoveryType INVALID = fromString("Invalid"); - - /** - * Static value OriginalLocation for RecoveryType. - */ - public static final RecoveryType ORIGINAL_LOCATION = fromString("OriginalLocation"); - - /** - * Static value AlternateLocation for RecoveryType. - */ - public static final RecoveryType ALTERNATE_LOCATION = fromString("AlternateLocation"); - - /** - * Static value RestoreDisks for RecoveryType. - */ - public static final RecoveryType RESTORE_DISKS = fromString("RestoreDisks"); - - /** - * Static value Offline for RecoveryType. - */ - public static final RecoveryType OFFLINE = fromString("Offline"); - - /** - * Creates a new instance of RecoveryType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RecoveryType() { - } - - /** - * Creates or finds a RecoveryType from its string representation. - * - * @param name a name to look for. - * @return the corresponding RecoveryType. - */ - public static RecoveryType fromString(String name) { - return fromString(name, RecoveryType.class); - } - - /** - * Gets known RecoveryType values. - * - * @return known RecoveryType values. - */ - public static Collection values() { - return values(RecoveryType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RehydrationPriority.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RehydrationPriority.java deleted file mode 100644 index e07ffa8e4165..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RehydrationPriority.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Rehydration Priority. - */ -public final class RehydrationPriority extends ExpandableStringEnum { - /** - * Static value Standard for RehydrationPriority. - */ - public static final RehydrationPriority STANDARD = fromString("Standard"); - - /** - * Static value High for RehydrationPriority. - */ - public static final RehydrationPriority HIGH = fromString("High"); - - /** - * Creates a new instance of RehydrationPriority value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RehydrationPriority() { - } - - /** - * Creates or finds a RehydrationPriority from its string representation. - * - * @param name a name to look for. - * @return the corresponding RehydrationPriority. - */ - public static RehydrationPriority fromString(String name) { - return fromString(name, RehydrationPriority.class); - } - - /** - * Gets known RehydrationPriority values. - * - * @return known RehydrationPriority values. - */ - public static Collection values() { - return values(RehydrationPriority.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardOperationDetail.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardOperationDetail.java deleted file mode 100644 index 03d18fad4cdd..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardOperationDetail.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ResourceGuardOperationDetail model. - */ -@Fluent -public final class ResourceGuardOperationDetail implements JsonSerializable { - /* - * The vaultCriticalOperation property. - */ - private String vaultCriticalOperation; - - /* - * The defaultResourceRequest property. - */ - private String defaultResourceRequest; - - /** - * Creates an instance of ResourceGuardOperationDetail class. - */ - public ResourceGuardOperationDetail() { - } - - /** - * Get the vaultCriticalOperation property: The vaultCriticalOperation property. - * - * @return the vaultCriticalOperation value. - */ - public String vaultCriticalOperation() { - return this.vaultCriticalOperation; - } - - /** - * Set the vaultCriticalOperation property: The vaultCriticalOperation property. - * - * @param vaultCriticalOperation the vaultCriticalOperation value to set. - * @return the ResourceGuardOperationDetail object itself. - */ - public ResourceGuardOperationDetail withVaultCriticalOperation(String vaultCriticalOperation) { - this.vaultCriticalOperation = vaultCriticalOperation; - return this; - } - - /** - * Get the defaultResourceRequest property: The defaultResourceRequest property. - * - * @return the defaultResourceRequest value. - */ - public String defaultResourceRequest() { - return this.defaultResourceRequest; - } - - /** - * Set the defaultResourceRequest property: The defaultResourceRequest property. - * - * @param defaultResourceRequest the defaultResourceRequest value to set. - * @return the ResourceGuardOperationDetail object itself. - */ - public ResourceGuardOperationDetail withDefaultResourceRequest(String defaultResourceRequest) { - this.defaultResourceRequest = defaultResourceRequest; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("vaultCriticalOperation", this.vaultCriticalOperation); - jsonWriter.writeStringField("defaultResourceRequest", this.defaultResourceRequest); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceGuardOperationDetail from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceGuardOperationDetail 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 ResourceGuardOperationDetail. - */ - public static ResourceGuardOperationDetail fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceGuardOperationDetail deserializedResourceGuardOperationDetail = new ResourceGuardOperationDetail(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("vaultCriticalOperation".equals(fieldName)) { - deserializedResourceGuardOperationDetail.vaultCriticalOperation = reader.getString(); - } else if ("defaultResourceRequest".equals(fieldName)) { - deserializedResourceGuardOperationDetail.defaultResourceRequest = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedResourceGuardOperationDetail; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyBase.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyBase.java deleted file mode 100644 index e5e98dc9f82f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyBase.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The ResourceGuardProxyBase model. - */ -@Fluent -public final class ResourceGuardProxyBase implements JsonSerializable { - /* - * The resourceGuardResourceId property. - */ - private String resourceGuardResourceId; - - /* - * The resourceGuardOperationDetails property. - */ - private List resourceGuardOperationDetails; - - /* - * The lastUpdatedTime property. - */ - private String lastUpdatedTime; - - /* - * The description property. - */ - private String description; - - /** - * Creates an instance of ResourceGuardProxyBase class. - */ - public ResourceGuardProxyBase() { - } - - /** - * Get the resourceGuardResourceId property: The resourceGuardResourceId property. - * - * @return the resourceGuardResourceId value. - */ - public String resourceGuardResourceId() { - return this.resourceGuardResourceId; - } - - /** - * Set the resourceGuardResourceId property: The resourceGuardResourceId property. - * - * @param resourceGuardResourceId the resourceGuardResourceId value to set. - * @return the ResourceGuardProxyBase object itself. - */ - public ResourceGuardProxyBase withResourceGuardResourceId(String resourceGuardResourceId) { - this.resourceGuardResourceId = resourceGuardResourceId; - return this; - } - - /** - * Get the resourceGuardOperationDetails property: The resourceGuardOperationDetails property. - * - * @return the resourceGuardOperationDetails value. - */ - public List resourceGuardOperationDetails() { - return this.resourceGuardOperationDetails; - } - - /** - * Set the resourceGuardOperationDetails property: The resourceGuardOperationDetails property. - * - * @param resourceGuardOperationDetails the resourceGuardOperationDetails value to set. - * @return the ResourceGuardProxyBase object itself. - */ - public ResourceGuardProxyBase - withResourceGuardOperationDetails(List resourceGuardOperationDetails) { - this.resourceGuardOperationDetails = resourceGuardOperationDetails; - return this; - } - - /** - * Get the lastUpdatedTime property: The lastUpdatedTime property. - * - * @return the lastUpdatedTime value. - */ - public String lastUpdatedTime() { - return this.lastUpdatedTime; - } - - /** - * Set the lastUpdatedTime property: The lastUpdatedTime property. - * - * @param lastUpdatedTime the lastUpdatedTime value to set. - * @return the ResourceGuardProxyBase object itself. - */ - public ResourceGuardProxyBase withLastUpdatedTime(String lastUpdatedTime) { - this.lastUpdatedTime = lastUpdatedTime; - return this; - } - - /** - * Get the description property: The description property. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description property. - * - * @param description the description value to set. - * @return the ResourceGuardProxyBase object itself. - */ - public ResourceGuardProxyBase withDescription(String description) { - this.description = description; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("resourceGuardResourceId", this.resourceGuardResourceId); - jsonWriter.writeArrayField("resourceGuardOperationDetails", this.resourceGuardOperationDetails, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("lastUpdatedTime", this.lastUpdatedTime); - jsonWriter.writeStringField("description", this.description); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceGuardProxyBase from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceGuardProxyBase 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 ResourceGuardProxyBase. - */ - public static ResourceGuardProxyBase fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceGuardProxyBase deserializedResourceGuardProxyBase = new ResourceGuardProxyBase(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceGuardResourceId".equals(fieldName)) { - deserializedResourceGuardProxyBase.resourceGuardResourceId = reader.getString(); - } else if ("resourceGuardOperationDetails".equals(fieldName)) { - List resourceGuardOperationDetails - = reader.readArray(reader1 -> ResourceGuardOperationDetail.fromJson(reader1)); - deserializedResourceGuardProxyBase.resourceGuardOperationDetails = resourceGuardOperationDetails; - } else if ("lastUpdatedTime".equals(fieldName)) { - deserializedResourceGuardProxyBase.lastUpdatedTime = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedResourceGuardProxyBase.description = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedResourceGuardProxyBase; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyBaseResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyBaseResource.java deleted file mode 100644 index 7d9cdcf4716d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyBaseResource.java +++ /dev/null @@ -1,325 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ResourceGuardProxyBaseResourceInner; -import java.util.Map; - -/** - * An immutable client-side representation of ResourceGuardProxyBaseResource. - */ -public interface ResourceGuardProxyBaseResource { - /** - * 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: ResourceGuardProxyBaseResource properties. - * - * @return the properties value. - */ - ResourceGuardProxyBase properties(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the etag property: Optional ETag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ResourceGuardProxyBaseResourceInner - * object. - * - * @return the inner object. - */ - ResourceGuardProxyBaseResourceInner innerModel(); - - /** - * The entirety of the ResourceGuardProxyBaseResource definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The ResourceGuardProxyBaseResource definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the ResourceGuardProxyBaseResource definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the ResourceGuardProxyBaseResource definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies vaultName, resourceGroupName. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @return the next definition stage. - */ - WithCreate withExistingVault(String vaultName, String resourceGroupName); - } - - /** - * The stage of the ResourceGuardProxyBaseResource 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.WithLocation, DefinitionStages.WithTags, - DefinitionStages.WithProperties, DefinitionStages.WithEtag { - /** - * Executes the create request. - * - * @return the created resource. - */ - ResourceGuardProxyBaseResource create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - ResourceGuardProxyBaseResource create(Context context); - } - - /** - * The stage of the ResourceGuardProxyBaseResource definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(String location); - } - - /** - * The stage of the ResourceGuardProxyBaseResource definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the ResourceGuardProxyBaseResource definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: ResourceGuardProxyBaseResource properties. - * - * @param properties ResourceGuardProxyBaseResource properties. - * @return the next definition stage. - */ - WithCreate withProperties(ResourceGuardProxyBase properties); - } - - /** - * The stage of the ResourceGuardProxyBaseResource definition allowing to specify etag. - */ - interface WithEtag { - /** - * Specifies the etag property: Optional ETag.. - * - * @param etag Optional ETag. - * @return the next definition stage. - */ - WithCreate withEtag(String etag); - } - } - - /** - * Begins update for the ResourceGuardProxyBaseResource resource. - * - * @return the stage of resource update. - */ - ResourceGuardProxyBaseResource.Update update(); - - /** - * The template for ResourceGuardProxyBaseResource update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithEtag { - /** - * Executes the update request. - * - * @return the updated resource. - */ - ResourceGuardProxyBaseResource apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - ResourceGuardProxyBaseResource apply(Context context); - } - - /** - * The ResourceGuardProxyBaseResource update stages. - */ - interface UpdateStages { - /** - * The stage of the ResourceGuardProxyBaseResource update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the ResourceGuardProxyBaseResource update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: ResourceGuardProxyBaseResource properties. - * - * @param properties ResourceGuardProxyBaseResource properties. - * @return the next definition stage. - */ - Update withProperties(ResourceGuardProxyBase properties); - } - - /** - * The stage of the ResourceGuardProxyBaseResource update allowing to specify etag. - */ - interface WithEtag { - /** - * Specifies the etag property: Optional ETag.. - * - * @param etag Optional ETag. - * @return the next definition stage. - */ - Update withEtag(String etag); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - ResourceGuardProxyBaseResource refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - ResourceGuardProxyBaseResource refresh(Context context); - - /** - * Secures delete ResourceGuardProxy operations. - * - * @param parameters Request body for operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of Unlock Delete API along with {@link Response}. - */ - Response unlockDeleteWithResponse(UnlockDeleteRequest parameters, Context context); - - /** - * Secures delete ResourceGuardProxy operations. - * - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of Unlock Delete API. - */ - UnlockDeleteResponse unlockDelete(UnlockDeleteRequest parameters); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyOperations.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyOperations.java deleted file mode 100644 index c4b53d2f02bb..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceGuardProxyOperations.java +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ResourceGuardProxyOperations. - */ -public interface ResourceGuardProxyOperations { - /** - * Returns ResourceGuardProxy under vault and with the name referenced in request. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName 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 response body along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, - String resourceGuardProxyName, Context context); - - /** - * Returns ResourceGuardProxy under vault and with the name referenced in request. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName 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 response. - */ - ResourceGuardProxyBaseResource get(String vaultName, String resourceGroupName, String resourceGuardProxyName); - - /** - * Delete ResourceGuardProxy under vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName 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 Response}. - */ - Response deleteWithResponse(String vaultName, String resourceGroupName, String resourceGuardProxyName, - Context context); - - /** - * Delete ResourceGuardProxy under vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName 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. - */ - void delete(String vaultName, String resourceGroupName, String resourceGuardProxyName); - - /** - * Secures delete ResourceGuardProxy operations. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName parameter. - * @param parameters Request body for operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of Unlock Delete API along with {@link Response}. - */ - Response unlockDeleteWithResponse(String vaultName, String resourceGroupName, - String resourceGuardProxyName, UnlockDeleteRequest parameters, Context context); - - /** - * Secures delete ResourceGuardProxy operations. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceGuardProxyName The resourceGuardProxyName parameter. - * @param parameters Request body for operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of Unlock Delete API. - */ - UnlockDeleteResponse unlockDelete(String vaultName, String resourceGroupName, String resourceGuardProxyName, - UnlockDeleteRequest parameters); - - /** - * List the ResourceGuardProxies under vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ResourceGuardProxyBase resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName); - - /** - * List the ResourceGuardProxies under vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ResourceGuardProxyBase resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String vaultName, String resourceGroupName, Context context); - - /** - * Returns ResourceGuardProxy under vault and with the name referenced in request. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - ResourceGuardProxyBaseResource getById(String id); - - /** - * Returns ResourceGuardProxy under vault and with the name referenced in request. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete ResourceGuardProxy under vault. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete ResourceGuardProxy under vault. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new ResourceGuardProxyBaseResource resource. - * - * @param name resource name. - * @return the first stage of the new ResourceGuardProxyBaseResource definition. - */ - ResourceGuardProxyBaseResource.DefinitionStages.Blank define(String name); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceHealthDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceHealthDetails.java deleted file mode 100644 index 64e78a9f88ad..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceHealthDetails.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Health Details for backup items. - */ -@Immutable -public class ResourceHealthDetails implements JsonSerializable { - /* - * Health Code - */ - private Integer code; - - /* - * Health Title - */ - private String title; - - /* - * Health Message - */ - private String message; - - /* - * Health Recommended Actions - */ - private List recommendations; - - /** - * Creates an instance of ResourceHealthDetails class. - */ - public ResourceHealthDetails() { - } - - /** - * Get the code property: Health Code. - * - * @return the code value. - */ - public Integer code() { - return this.code; - } - - /** - * Set the code property: Health Code. - * - * @param code the code value to set. - * @return the ResourceHealthDetails object itself. - */ - ResourceHealthDetails withCode(Integer code) { - this.code = code; - return this; - } - - /** - * Get the title property: Health Title. - * - * @return the title value. - */ - public String title() { - return this.title; - } - - /** - * Set the title property: Health Title. - * - * @param title the title value to set. - * @return the ResourceHealthDetails object itself. - */ - ResourceHealthDetails withTitle(String title) { - this.title = title; - return this; - } - - /** - * Get the message property: Health Message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: Health Message. - * - * @param message the message value to set. - * @return the ResourceHealthDetails object itself. - */ - ResourceHealthDetails withMessage(String message) { - this.message = message; - return this; - } - - /** - * Get the recommendations property: Health Recommended Actions. - * - * @return the recommendations value. - */ - public List recommendations() { - return this.recommendations; - } - - /** - * Set the recommendations property: Health Recommended Actions. - * - * @param recommendations the recommendations value to set. - * @return the ResourceHealthDetails object itself. - */ - ResourceHealthDetails withRecommendations(List recommendations) { - this.recommendations = recommendations; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceHealthDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceHealthDetails 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 ResourceHealthDetails. - */ - public static ResourceHealthDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceHealthDetails deserializedResourceHealthDetails = new ResourceHealthDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("code".equals(fieldName)) { - deserializedResourceHealthDetails.code = reader.getNullable(JsonReader::getInt); - } else if ("title".equals(fieldName)) { - deserializedResourceHealthDetails.title = reader.getString(); - } else if ("message".equals(fieldName)) { - deserializedResourceHealthDetails.message = reader.getString(); - } else if ("recommendations".equals(fieldName)) { - List recommendations = reader.readArray(reader1 -> reader1.getString()); - deserializedResourceHealthDetails.recommendations = recommendations; - } else { - reader.skipChildren(); - } - } - - return deserializedResourceHealthDetails; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceHealthStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceHealthStatus.java deleted file mode 100644 index 8f0f25baefdb..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceHealthStatus.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Resource Health Status. - */ -public final class ResourceHealthStatus extends ExpandableStringEnum { - /** - * Static value Healthy for ResourceHealthStatus. - */ - public static final ResourceHealthStatus HEALTHY = fromString("Healthy"); - - /** - * Static value TransientDegraded for ResourceHealthStatus. - */ - public static final ResourceHealthStatus TRANSIENT_DEGRADED = fromString("TransientDegraded"); - - /** - * Static value PersistentDegraded for ResourceHealthStatus. - */ - public static final ResourceHealthStatus PERSISTENT_DEGRADED = fromString("PersistentDegraded"); - - /** - * Static value TransientUnhealthy for ResourceHealthStatus. - */ - public static final ResourceHealthStatus TRANSIENT_UNHEALTHY = fromString("TransientUnhealthy"); - - /** - * Static value PersistentUnhealthy for ResourceHealthStatus. - */ - public static final ResourceHealthStatus PERSISTENT_UNHEALTHY = fromString("PersistentUnhealthy"); - - /** - * Static value Invalid for ResourceHealthStatus. - */ - public static final ResourceHealthStatus INVALID = fromString("Invalid"); - - /** - * Creates a new instance of ResourceHealthStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ResourceHealthStatus() { - } - - /** - * Creates or finds a ResourceHealthStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding ResourceHealthStatus. - */ - public static ResourceHealthStatus fromString(String name) { - return fromString(name, ResourceHealthStatus.class); - } - - /** - * Gets known ResourceHealthStatus values. - * - * @return known ResourceHealthStatus values. - */ - public static Collection values() { - return values(ResourceHealthStatus.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceList.java deleted file mode 100644 index 26c15952adea..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceList.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Base for all lists of resources. - */ -@Immutable -public class ResourceList implements JsonSerializable { - /* - * The URI to fetch the next page of resources, with each API call returning up to 200 resources per page. Use - * ListNext() to fetch the next page if the total number of resources exceeds 200. - */ - private String nextLink; - - /** - * Creates an instance of ResourceList class. - */ - protected ResourceList() { - } - - /** - * Get the nextLink property: The URI to fetch the next page of resources, with each API call returning up to 200 - * resources per page. Use ListNext() to fetch the next page if the total number of resources exceeds 200. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI to fetch the next page of resources, with each API call returning up to 200 - * resources per page. Use ListNext() to fetch the next page if the total number of resources exceeds 200. - * - * @param nextLink the nextLink value to set. - * @return the ResourceList object itself. - */ - ResourceList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResourceList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResourceList 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 ResourceList. - */ - public static ResourceList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResourceList deserializedResourceList = new ResourceList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedResourceList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedResourceList; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceProviders.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceProviders.java deleted file mode 100644 index 7321ea88d4ac..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ResourceProviders.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ResourceProviders. - */ -public interface ResourceProviders { - /** - * Prepares source vault for Data Move operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Prepare data move request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void bmsPrepareDataMove(String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters); - - /** - * Prepares source vault for Data Move operation. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Prepare data move request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void bmsPrepareDataMove(String vaultName, String resourceGroupName, PrepareDataMoveRequest parameters, - Context context); - - /** - * Triggers Data Move Operation on target vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Trigger data move request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void bmsTriggerDataMove(String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters); - - /** - * Triggers Data Move Operation on target vault. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters Trigger data move request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void bmsTriggerDataMove(String vaultName, String resourceGroupName, TriggerDataMoveRequest parameters, - Context context); - - /** - * Fetches Operation Result for Prepare Data Move. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the BackupResourceConfigResource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status along with {@link Response}. - */ - Response getOperationStatusWithResponse(String vaultName, String resourceGroupName, - String operationId, Context context); - - /** - * Fetches Operation Result for Prepare Data Move. - * - * @param vaultName vaults. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId The name of the BackupResourceConfigResource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status. - */ - OperationStatus getOperationStatus(String vaultName, String resourceGroupName, String operationId); - - /** - * Move recovery point from one datastore to another store. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Move Resource Across Tiers Request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void moveRecoveryPoint(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, MoveRPAcrossTiersRequest parameters); - - /** - * Move recovery point from one datastore to another store. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters Move Resource Across Tiers Request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void moveRecoveryPoint(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, MoveRPAcrossTiersRequest parameters, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreFileSpecs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreFileSpecs.java deleted file mode 100644 index db4984bd2a38..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreFileSpecs.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Restore file specs like file path, type and target folder path info. - */ -@Fluent -public final class RestoreFileSpecs implements JsonSerializable { - /* - * Source File/Folder path - */ - private String path; - - /* - * Indicates what the Path variable stands for - */ - private String fileSpecType; - - /* - * Destination folder path in target FileShare - */ - private String targetFolderPath; - - /** - * Creates an instance of RestoreFileSpecs class. - */ - public RestoreFileSpecs() { - } - - /** - * Get the path property: Source File/Folder path. - * - * @return the path value. - */ - public String path() { - return this.path; - } - - /** - * Set the path property: Source File/Folder path. - * - * @param path the path value to set. - * @return the RestoreFileSpecs object itself. - */ - public RestoreFileSpecs withPath(String path) { - this.path = path; - return this; - } - - /** - * Get the fileSpecType property: Indicates what the Path variable stands for. - * - * @return the fileSpecType value. - */ - public String fileSpecType() { - return this.fileSpecType; - } - - /** - * Set the fileSpecType property: Indicates what the Path variable stands for. - * - * @param fileSpecType the fileSpecType value to set. - * @return the RestoreFileSpecs object itself. - */ - public RestoreFileSpecs withFileSpecType(String fileSpecType) { - this.fileSpecType = fileSpecType; - return this; - } - - /** - * Get the targetFolderPath property: Destination folder path in target FileShare. - * - * @return the targetFolderPath value. - */ - public String targetFolderPath() { - return this.targetFolderPath; - } - - /** - * Set the targetFolderPath property: Destination folder path in target FileShare. - * - * @param targetFolderPath the targetFolderPath value to set. - * @return the RestoreFileSpecs object itself. - */ - public RestoreFileSpecs withTargetFolderPath(String targetFolderPath) { - this.targetFolderPath = targetFolderPath; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("path", this.path); - jsonWriter.writeStringField("fileSpecType", this.fileSpecType); - jsonWriter.writeStringField("targetFolderPath", this.targetFolderPath); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RestoreFileSpecs from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RestoreFileSpecs 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 RestoreFileSpecs. - */ - public static RestoreFileSpecs fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RestoreFileSpecs deserializedRestoreFileSpecs = new RestoreFileSpecs(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("path".equals(fieldName)) { - deserializedRestoreFileSpecs.path = reader.getString(); - } else if ("fileSpecType".equals(fieldName)) { - deserializedRestoreFileSpecs.fileSpecType = reader.getString(); - } else if ("targetFolderPath".equals(fieldName)) { - deserializedRestoreFileSpecs.targetFolderPath = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRestoreFileSpecs; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestorePointType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestorePointType.java deleted file mode 100644 index 65e57518618d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestorePointType.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Type of restore point. - */ -public final class RestorePointType extends ExpandableStringEnum { - /** - * Static value Invalid for RestorePointType. - */ - public static final RestorePointType INVALID = fromString("Invalid"); - - /** - * Static value Full for RestorePointType. - */ - public static final RestorePointType FULL = fromString("Full"); - - /** - * Static value Log for RestorePointType. - */ - public static final RestorePointType LOG = fromString("Log"); - - /** - * Static value Differential for RestorePointType. - */ - public static final RestorePointType DIFFERENTIAL = fromString("Differential"); - - /** - * Static value Incremental for RestorePointType. - */ - public static final RestorePointType INCREMENTAL = fromString("Incremental"); - - /** - * Static value SnapshotFull for RestorePointType. - */ - public static final RestorePointType SNAPSHOT_FULL = fromString("SnapshotFull"); - - /** - * Static value SnapshotCopyOnlyFull for RestorePointType. - */ - public static final RestorePointType SNAPSHOT_COPY_ONLY_FULL = fromString("SnapshotCopyOnlyFull"); - - /** - * Creates a new instance of RestorePointType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RestorePointType() { - } - - /** - * Creates or finds a RestorePointType from its string representation. - * - * @param name a name to look for. - * @return the corresponding RestorePointType. - */ - public static RestorePointType fromString(String name) { - return fromString(name, RestorePointType.class); - } - - /** - * Gets known RestorePointType values. - * - * @return known RestorePointType values. - */ - public static Collection values() { - return values(RestorePointType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequest.java deleted file mode 100644 index ff454a99b499..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequest.java +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Base class for restore request. Workload-specific restore requests are derived from this class. - */ -@Fluent -public class RestoreRequest implements JsonSerializable { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "RestoreRequest"; - - /* - * ResourceGuardOperationRequests on which LAC check will be performed - */ - private List resourceGuardOperationRequests; - - /** - * Creates an instance of RestoreRequest class. - */ - public RestoreRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - public String objectType() { - return this.objectType; - } - - /** - * Get the resourceGuardOperationRequests property: ResourceGuardOperationRequests on which LAC check will be - * performed. - * - * @return the resourceGuardOperationRequests value. - */ - public List resourceGuardOperationRequests() { - return this.resourceGuardOperationRequests; - } - - /** - * Set the resourceGuardOperationRequests property: ResourceGuardOperationRequests on which LAC check will be - * performed. - * - * @param resourceGuardOperationRequests the resourceGuardOperationRequests value to set. - * @return the RestoreRequest object itself. - */ - public RestoreRequest withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - this.resourceGuardOperationRequests = resourceGuardOperationRequests; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeArrayField("resourceGuardOperationRequests", this.resourceGuardOperationRequests, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RestoreRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RestoreRequest 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 RestoreRequest. - */ - public static RestoreRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureFileShareRestoreRequest".equals(discriminatorValue)) { - return AzureFileShareRestoreRequest.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadRestoreRequest".equals(discriminatorValue)) { - return AzureWorkloadRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureWorkloadSAPHanaRestoreRequest".equals(discriminatorValue)) { - return AzureWorkloadSapHanaRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureWorkloadSAPHanaRestoreWithRehydrateRequest".equals(discriminatorValue)) { - return AzureWorkloadSapHanaRestoreWithRehydrateRequest.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadSAPHanaPointInTimeRestoreRequest".equals(discriminatorValue)) { - return AzureWorkloadSapHanaPointInTimeRestoreRequest - .fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest".equals(discriminatorValue)) { - return AzureWorkloadSapHanaPointInTimeRestoreWithRehydrateRequest.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadSAPAseRestoreRequest".equals(discriminatorValue)) { - return AzureWorkloadSapAseRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureWorkloadSAPAsePointInTimeRestoreRequest".equals(discriminatorValue)) { - return AzureWorkloadSapAsePointInTimeRestoreRequest.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadSQLRestoreRequest".equals(discriminatorValue)) { - return AzureWorkloadSqlRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureWorkloadSQLRestoreWithRehydrateRequest".equals(discriminatorValue)) { - return AzureWorkloadSqlRestoreWithRehydrateRequest.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadSQLPointInTimeRestoreRequest".equals(discriminatorValue)) { - return AzureWorkloadSqlPointInTimeRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest".equals(discriminatorValue)) { - return AzureWorkloadSqlPointInTimeRestoreWithRehydrateRequest.fromJson(readerToUse.reset()); - } else if ("AzureWorkloadPointInTimeRestoreRequest".equals(discriminatorValue)) { - return AzureWorkloadPointInTimeRestoreRequest.fromJson(readerToUse.reset()); - } else if ("IaasVMRestoreRequest".equals(discriminatorValue)) { - return IaasVMRestoreRequest.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("IaasVMRestoreWithRehydrationRequest".equals(discriminatorValue)) { - return IaasVMRestoreWithRehydrationRequest.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static RestoreRequest fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RestoreRequest deserializedRestoreRequest = new RestoreRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedRestoreRequest.objectType = reader.getString(); - } else if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedRestoreRequest.resourceGuardOperationRequests = resourceGuardOperationRequests; - } else { - reader.skipChildren(); - } - } - - return deserializedRestoreRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequestResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequestResource.java deleted file mode 100644 index b2cc28e698bd..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequestResource.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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 java.io.IOException; -import java.util.Map; - -/** - * Base class for restore request. Workload-specific restore requests are derived from this class. - */ -@Fluent -public final class RestoreRequestResource extends ProxyResource { - /* - * Resource location. - */ - private String location; - - /* - * Resource tags. - */ - private Map tags; - - /* - * Optional ETag. - */ - private String eTag; - - /* - * RestoreRequestResource properties - */ - private RestoreRequest 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 RestoreRequestResource class. - */ - public RestoreRequestResource() { - } - - /** - * Get the location property: Resource location. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Resource location. - * - * @param location the location value to set. - * @return the RestoreRequestResource object itself. - */ - public RestoreRequestResource withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the RestoreRequestResource object itself. - */ - public RestoreRequestResource withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the eTag property: Optional ETag. - * - * @return the eTag value. - */ - public String eTag() { - return this.eTag; - } - - /** - * Set the eTag property: Optional ETag. - * - * @param eTag the eTag value to set. - * @return the RestoreRequestResource object itself. - */ - public RestoreRequestResource withETag(String eTag) { - this.eTag = eTag; - return this; - } - - /** - * Get the properties property: RestoreRequestResource properties. - * - * @return the properties value. - */ - public RestoreRequest properties() { - return this.properties; - } - - /** - * Set the properties property: RestoreRequestResource properties. - * - * @param properties the properties value to set. - * @return the RestoreRequestResource object itself. - */ - public RestoreRequestResource withProperties(RestoreRequest properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("eTag", this.eTag); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RestoreRequestResource from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RestoreRequestResource 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 RestoreRequestResource. - */ - public static RestoreRequestResource fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RestoreRequestResource deserializedRestoreRequestResource = new RestoreRequestResource(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedRestoreRequestResource.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedRestoreRequestResource.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedRestoreRequestResource.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedRestoreRequestResource.location = reader.getString(); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedRestoreRequestResource.tags = tags; - } else if ("eTag".equals(fieldName)) { - deserializedRestoreRequestResource.eTag = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedRestoreRequestResource.properties = RestoreRequest.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedRestoreRequestResource.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRestoreRequestResource; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequestType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequestType.java deleted file mode 100644 index f87b7cb657f9..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoreRequestType.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Restore Type (FullShareRestore or ItemLevelRestore). - */ -public final class RestoreRequestType extends ExpandableStringEnum { - /** - * Static value Invalid for RestoreRequestType. - */ - public static final RestoreRequestType INVALID = fromString("Invalid"); - - /** - * Static value FullShareRestore for RestoreRequestType. - */ - public static final RestoreRequestType FULL_SHARE_RESTORE = fromString("FullShareRestore"); - - /** - * Static value ItemLevelRestore for RestoreRequestType. - */ - public static final RestoreRequestType ITEM_LEVEL_RESTORE = fromString("ItemLevelRestore"); - - /** - * Creates a new instance of RestoreRequestType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RestoreRequestType() { - } - - /** - * Creates or finds a RestoreRequestType from its string representation. - * - * @param name a name to look for. - * @return the corresponding RestoreRequestType. - */ - public static RestoreRequestType fromString(String name) { - return fromString(name, RestoreRequestType.class); - } - - /** - * Gets known RestoreRequestType values. - * - * @return known RestoreRequestType values. - */ - public static Collection values() { - return values(RestoreRequestType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Restores.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Restores.java deleted file mode 100644 index 82ff037ff41d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Restores.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.Context; - -/** - * Resource collection API of Restores. - */ -public interface Restores { - /** - * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, - * use - * GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void trigger(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, RestoreRequestResource parameters); - - /** - * Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, - * use - * GetProtectedItemOperationResult API. - * - * @param vaultName The name of the VaultResource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fabricName The name of the BackupFabricResource. - * @param containerName Name of the container whose details need to be fetched. - * @param protectedItemName Backed up item name whose details are to be fetched. - * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. - * @param parameters resource restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void trigger(String vaultName, String resourceGroupName, String fabricName, String containerName, - String protectedItemName, String recoveryPointId, RestoreRequestResource parameters, Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionDuration.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionDuration.java deleted file mode 100644 index 19134c729d89..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionDuration.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Retention duration. - */ -@Fluent -public final class RetentionDuration implements JsonSerializable { - /* - * Count of duration types. Retention duration is obtained by the counting the duration type Count times. - * For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks. - */ - private Integer count; - - /* - * Retention duration type of retention policy. - */ - private RetentionDurationType durationType; - - /** - * Creates an instance of RetentionDuration class. - */ - public RetentionDuration() { - } - - /** - * Get the count property: Count of duration types. Retention duration is obtained by the counting the duration type - * Count times. - * For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks. - * - * @return the count value. - */ - public Integer count() { - return this.count; - } - - /** - * Set the count property: Count of duration types. Retention duration is obtained by the counting the duration type - * Count times. - * For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks. - * - * @param count the count value to set. - * @return the RetentionDuration object itself. - */ - public RetentionDuration withCount(Integer count) { - this.count = count; - return this; - } - - /** - * Get the durationType property: Retention duration type of retention policy. - * - * @return the durationType value. - */ - public RetentionDurationType durationType() { - return this.durationType; - } - - /** - * Set the durationType property: Retention duration type of retention policy. - * - * @param durationType the durationType value to set. - * @return the RetentionDuration object itself. - */ - public RetentionDuration withDurationType(RetentionDurationType durationType) { - this.durationType = durationType; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("count", this.count); - jsonWriter.writeStringField("durationType", this.durationType == null ? null : this.durationType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RetentionDuration from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RetentionDuration 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 RetentionDuration. - */ - public static RetentionDuration fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RetentionDuration deserializedRetentionDuration = new RetentionDuration(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("count".equals(fieldName)) { - deserializedRetentionDuration.count = reader.getNullable(JsonReader::getInt); - } else if ("durationType".equals(fieldName)) { - deserializedRetentionDuration.durationType = RetentionDurationType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedRetentionDuration; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionDurationType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionDurationType.java deleted file mode 100644 index 6d328fff9dc0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionDurationType.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Retention duration type of retention policy. - */ -public final class RetentionDurationType extends ExpandableStringEnum { - /** - * Static value Invalid for RetentionDurationType. - */ - public static final RetentionDurationType INVALID = fromString("Invalid"); - - /** - * Static value Days for RetentionDurationType. - */ - public static final RetentionDurationType DAYS = fromString("Days"); - - /** - * Static value Weeks for RetentionDurationType. - */ - public static final RetentionDurationType WEEKS = fromString("Weeks"); - - /** - * Static value Months for RetentionDurationType. - */ - public static final RetentionDurationType MONTHS = fromString("Months"); - - /** - * Static value Years for RetentionDurationType. - */ - public static final RetentionDurationType YEARS = fromString("Years"); - - /** - * Creates a new instance of RetentionDurationType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RetentionDurationType() { - } - - /** - * Creates or finds a RetentionDurationType from its string representation. - * - * @param name a name to look for. - * @return the corresponding RetentionDurationType. - */ - public static RetentionDurationType fromString(String name) { - return fromString(name, RetentionDurationType.class); - } - - /** - * Gets known RetentionDurationType values. - * - * @return known RetentionDurationType values. - */ - public static Collection values() { - return values(RetentionDurationType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionPolicy.java deleted file mode 100644 index bb44c1ecc864..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionPolicy.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Base class for retention policy. - */ -@Immutable -public class RetentionPolicy implements JsonSerializable { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String retentionPolicyType = "RetentionPolicy"; - - /** - * Creates an instance of RetentionPolicy class. - */ - public RetentionPolicy() { - } - - /** - * Get the retentionPolicyType property: This property will be used as the discriminator for deciding the specific - * types in the polymorphic chain of types. - * - * @return the retentionPolicyType value. - */ - public String retentionPolicyType() { - return this.retentionPolicyType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("retentionPolicyType", this.retentionPolicyType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RetentionPolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RetentionPolicy 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 RetentionPolicy. - */ - public static RetentionPolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("retentionPolicyType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("LongTermRetentionPolicy".equals(discriminatorValue)) { - return LongTermRetentionPolicy.fromJson(readerToUse.reset()); - } else if ("SimpleRetentionPolicy".equals(discriminatorValue)) { - return SimpleRetentionPolicy.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static RetentionPolicy fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RetentionPolicy deserializedRetentionPolicy = new RetentionPolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("retentionPolicyType".equals(fieldName)) { - deserializedRetentionPolicy.retentionPolicyType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRetentionPolicy; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionScheduleFormat.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionScheduleFormat.java deleted file mode 100644 index f69aeade1cae..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RetentionScheduleFormat.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Retention schedule format type for monthly retention policy. - */ -public final class RetentionScheduleFormat extends ExpandableStringEnum { - /** - * Static value Invalid for RetentionScheduleFormat. - */ - public static final RetentionScheduleFormat INVALID = fromString("Invalid"); - - /** - * Static value Daily for RetentionScheduleFormat. - */ - public static final RetentionScheduleFormat DAILY = fromString("Daily"); - - /** - * Static value Weekly for RetentionScheduleFormat. - */ - public static final RetentionScheduleFormat WEEKLY = fromString("Weekly"); - - /** - * Creates a new instance of RetentionScheduleFormat value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RetentionScheduleFormat() { - } - - /** - * Creates or finds a RetentionScheduleFormat from its string representation. - * - * @param name a name to look for. - * @return the corresponding RetentionScheduleFormat. - */ - public static RetentionScheduleFormat fromString(String name) { - return fromString(name, RetentionScheduleFormat.class); - } - - /** - * Gets known RetentionScheduleFormat values. - * - * @return known RetentionScheduleFormat values. - */ - public static Collection values() { - return values(RetentionScheduleFormat.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SchedulePolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SchedulePolicy.java deleted file mode 100644 index 8b118fdc0114..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SchedulePolicy.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Base class for backup schedule. - */ -@Immutable -public class SchedulePolicy implements JsonSerializable { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String schedulePolicyType = "SchedulePolicy"; - - /** - * Creates an instance of SchedulePolicy class. - */ - public SchedulePolicy() { - } - - /** - * Get the schedulePolicyType property: This property will be used as the discriminator for deciding the specific - * types in the polymorphic chain of types. - * - * @return the schedulePolicyType value. - */ - public String schedulePolicyType() { - return this.schedulePolicyType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("schedulePolicyType", this.schedulePolicyType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SchedulePolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SchedulePolicy 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 SchedulePolicy. - */ - public static SchedulePolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("schedulePolicyType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("LogSchedulePolicy".equals(discriminatorValue)) { - return LogSchedulePolicy.fromJson(readerToUse.reset()); - } else if ("LongTermSchedulePolicy".equals(discriminatorValue)) { - return LongTermSchedulePolicy.fromJson(readerToUse.reset()); - } else if ("SimpleSchedulePolicy".equals(discriminatorValue)) { - return SimpleSchedulePolicy.fromJson(readerToUse.reset()); - } else if ("SimpleSchedulePolicyV2".equals(discriminatorValue)) { - return SimpleSchedulePolicyV2.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static SchedulePolicy fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SchedulePolicy deserializedSchedulePolicy = new SchedulePolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("schedulePolicyType".equals(fieldName)) { - deserializedSchedulePolicy.schedulePolicyType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSchedulePolicy; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ScheduleRunType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ScheduleRunType.java deleted file mode 100644 index fd22bf0893f1..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ScheduleRunType.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Frequency of the schedule operation of this policy. - */ -public final class ScheduleRunType extends ExpandableStringEnum { - /** - * Static value Invalid for ScheduleRunType. - */ - public static final ScheduleRunType INVALID = fromString("Invalid"); - - /** - * Static value Daily for ScheduleRunType. - */ - public static final ScheduleRunType DAILY = fromString("Daily"); - - /** - * Static value Weekly for ScheduleRunType. - */ - public static final ScheduleRunType WEEKLY = fromString("Weekly"); - - /** - * Static value Hourly for ScheduleRunType. - */ - public static final ScheduleRunType HOURLY = fromString("Hourly"); - - /** - * Creates a new instance of ScheduleRunType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ScheduleRunType() { - } - - /** - * Creates or finds a ScheduleRunType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ScheduleRunType. - */ - public static ScheduleRunType fromString(String name) { - return fromString(name, ScheduleRunType.class); - } - - /** - * Gets known ScheduleRunType values. - * - * @return known ScheduleRunType values. - */ - public static Collection values() { - return values(ScheduleRunType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecuredVMDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecuredVMDetails.java deleted file mode 100644 index 48b86dad3778..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecuredVMDetails.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Restore request parameters for Secured VMs. - */ -@Fluent -public final class SecuredVMDetails implements JsonSerializable { - /* - * Gets or Sets Disk Encryption Set Id for Secured VM OS Disk - */ - private String securedVmosDiskEncryptionSetId; - - /** - * Creates an instance of SecuredVMDetails class. - */ - public SecuredVMDetails() { - } - - /** - * Get the securedVmosDiskEncryptionSetId property: Gets or Sets Disk Encryption Set Id for Secured VM OS Disk. - * - * @return the securedVmosDiskEncryptionSetId value. - */ - public String securedVmosDiskEncryptionSetId() { - return this.securedVmosDiskEncryptionSetId; - } - - /** - * Set the securedVmosDiskEncryptionSetId property: Gets or Sets Disk Encryption Set Id for Secured VM OS Disk. - * - * @param securedVmosDiskEncryptionSetId the securedVmosDiskEncryptionSetId value to set. - * @return the SecuredVMDetails object itself. - */ - public SecuredVMDetails withSecuredVmosDiskEncryptionSetId(String securedVmosDiskEncryptionSetId) { - this.securedVmosDiskEncryptionSetId = securedVmosDiskEncryptionSetId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("securedVMOsDiskEncryptionSetId", this.securedVmosDiskEncryptionSetId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecuredVMDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecuredVMDetails 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 SecuredVMDetails. - */ - public static SecuredVMDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecuredVMDetails deserializedSecuredVMDetails = new SecuredVMDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("securedVMOsDiskEncryptionSetId".equals(fieldName)) { - deserializedSecuredVMDetails.securedVmosDiskEncryptionSetId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSecuredVMDetails; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecurityPINs.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecurityPINs.java deleted file mode 100644 index 3ed1792e7ed9..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecurityPINs.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of SecurityPINs. - */ -public interface SecurityPINs { - /** - * Get the security PIN. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters security pin request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security PIN along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, SecurityPinBase parameters, - Context context); - - /** - * Get the security PIN. - * - * @param vaultName The name of the recovery services vault. - * @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 the security PIN. - */ - TokenInformation get(String vaultName, String resourceGroupName); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecurityPinBase.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecurityPinBase.java deleted file mode 100644 index 9784f1a89679..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SecurityPinBase.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Base class for get security pin request body. - */ -@Fluent -public final class SecurityPinBase implements JsonSerializable { - /* - * ResourceGuard Operation Requests - */ - private List resourceGuardOperationRequests; - - /** - * Creates an instance of SecurityPinBase class. - */ - public SecurityPinBase() { - } - - /** - * Get the resourceGuardOperationRequests property: ResourceGuard Operation Requests. - * - * @return the resourceGuardOperationRequests value. - */ - public List resourceGuardOperationRequests() { - return this.resourceGuardOperationRequests; - } - - /** - * Set the resourceGuardOperationRequests property: ResourceGuard Operation Requests. - * - * @param resourceGuardOperationRequests the resourceGuardOperationRequests value to set. - * @return the SecurityPinBase object itself. - */ - public SecurityPinBase withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - this.resourceGuardOperationRequests = resourceGuardOperationRequests; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("resourceGuardOperationRequests", this.resourceGuardOperationRequests, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecurityPinBase from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityPinBase 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 SecurityPinBase. - */ - public static SecurityPinBase fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityPinBase deserializedSecurityPinBase = new SecurityPinBase(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedSecurityPinBase.resourceGuardOperationRequests = resourceGuardOperationRequests; - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityPinBase; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Settings.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Settings.java deleted file mode 100644 index 1891470d294b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/Settings.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Common settings field for backup management. - */ -@Fluent -public final class Settings implements JsonSerializable { - /* - * TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - */ - private String timeZone; - - /* - * SQL compression flag - */ - private Boolean issqlcompression; - - /* - * Workload compression flag. This has been added so that 'isSqlCompression' - * will be deprecated once clients upgrade to consider this flag. - */ - private Boolean isCompression; - - /** - * Creates an instance of Settings class. - */ - public Settings() { - } - - /** - * Get the timeZone property: TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - * - * @return the timeZone value. - */ - public String timeZone() { - return this.timeZone; - } - - /** - * Set the timeZone property: TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". - * - * @param timeZone the timeZone value to set. - * @return the Settings object itself. - */ - public Settings withTimeZone(String timeZone) { - this.timeZone = timeZone; - return this; - } - - /** - * Get the issqlcompression property: SQL compression flag. - * - * @return the issqlcompression value. - */ - public Boolean issqlcompression() { - return this.issqlcompression; - } - - /** - * Set the issqlcompression property: SQL compression flag. - * - * @param issqlcompression the issqlcompression value to set. - * @return the Settings object itself. - */ - public Settings withIssqlcompression(Boolean issqlcompression) { - this.issqlcompression = issqlcompression; - return this; - } - - /** - * Get the isCompression property: Workload compression flag. This has been added so that 'isSqlCompression' - * will be deprecated once clients upgrade to consider this flag. - * - * @return the isCompression value. - */ - public Boolean isCompression() { - return this.isCompression; - } - - /** - * Set the isCompression property: Workload compression flag. This has been added so that 'isSqlCompression' - * will be deprecated once clients upgrade to consider this flag. - * - * @param isCompression the isCompression value to set. - * @return the Settings object itself. - */ - public Settings withIsCompression(Boolean isCompression) { - this.isCompression = isCompression; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("timeZone", this.timeZone); - jsonWriter.writeBooleanField("issqlcompression", this.issqlcompression); - jsonWriter.writeBooleanField("isCompression", this.isCompression); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Settings from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Settings 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 Settings. - */ - public static Settings fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Settings deserializedSettings = new Settings(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("timeZone".equals(fieldName)) { - deserializedSettings.timeZone = reader.getString(); - } else if ("issqlcompression".equals(fieldName)) { - deserializedSettings.issqlcompression = reader.getNullable(JsonReader::getBoolean); - } else if ("isCompression".equals(fieldName)) { - deserializedSettings.isCompression = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedSettings; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SimpleRetentionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SimpleRetentionPolicy.java deleted file mode 100644 index d58369963f54..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SimpleRetentionPolicy.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Simple policy retention. - */ -@Fluent -public final class SimpleRetentionPolicy extends RetentionPolicy { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String retentionPolicyType = "SimpleRetentionPolicy"; - - /* - * Retention duration of the protection policy. - */ - private RetentionDuration retentionDuration; - - /** - * Creates an instance of SimpleRetentionPolicy class. - */ - public SimpleRetentionPolicy() { - } - - /** - * Get the retentionPolicyType property: This property will be used as the discriminator for deciding the specific - * types in the polymorphic chain of types. - * - * @return the retentionPolicyType value. - */ - @Override - public String retentionPolicyType() { - return this.retentionPolicyType; - } - - /** - * Get the retentionDuration property: Retention duration of the protection policy. - * - * @return the retentionDuration value. - */ - public RetentionDuration retentionDuration() { - return this.retentionDuration; - } - - /** - * Set the retentionDuration property: Retention duration of the protection policy. - * - * @param retentionDuration the retentionDuration value to set. - * @return the SimpleRetentionPolicy object itself. - */ - public SimpleRetentionPolicy withRetentionDuration(RetentionDuration retentionDuration) { - this.retentionDuration = retentionDuration; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("retentionPolicyType", this.retentionPolicyType); - jsonWriter.writeJsonField("retentionDuration", this.retentionDuration); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SimpleRetentionPolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SimpleRetentionPolicy 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 SimpleRetentionPolicy. - */ - public static SimpleRetentionPolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SimpleRetentionPolicy deserializedSimpleRetentionPolicy = new SimpleRetentionPolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("retentionPolicyType".equals(fieldName)) { - deserializedSimpleRetentionPolicy.retentionPolicyType = reader.getString(); - } else if ("retentionDuration".equals(fieldName)) { - deserializedSimpleRetentionPolicy.retentionDuration = RetentionDuration.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSimpleRetentionPolicy; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SimpleSchedulePolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SimpleSchedulePolicy.java deleted file mode 100644 index 09f4cdfc5759..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SimpleSchedulePolicy.java +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Simple policy schedule. - */ -@Fluent -public final class SimpleSchedulePolicy extends SchedulePolicy { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String schedulePolicyType = "SimpleSchedulePolicy"; - - /* - * Frequency of the schedule operation of this policy. - */ - private ScheduleRunType scheduleRunFrequency; - - /* - * List of days of week this schedule has to be run. - */ - private List scheduleRunDays; - - /* - * List of times of day this schedule has to be run. - */ - private List scheduleRunTimes; - - /* - * Hourly Schedule of this Policy - */ - private HourlySchedule hourlySchedule; - - /* - * At every number weeks this schedule has to be run. - */ - private Integer scheduleWeeklyFrequency; - - /** - * Creates an instance of SimpleSchedulePolicy class. - */ - public SimpleSchedulePolicy() { - } - - /** - * Get the schedulePolicyType property: This property will be used as the discriminator for deciding the specific - * types in the polymorphic chain of types. - * - * @return the schedulePolicyType value. - */ - @Override - public String schedulePolicyType() { - return this.schedulePolicyType; - } - - /** - * Get the scheduleRunFrequency property: Frequency of the schedule operation of this policy. - * - * @return the scheduleRunFrequency value. - */ - public ScheduleRunType scheduleRunFrequency() { - return this.scheduleRunFrequency; - } - - /** - * Set the scheduleRunFrequency property: Frequency of the schedule operation of this policy. - * - * @param scheduleRunFrequency the scheduleRunFrequency value to set. - * @return the SimpleSchedulePolicy object itself. - */ - public SimpleSchedulePolicy withScheduleRunFrequency(ScheduleRunType scheduleRunFrequency) { - this.scheduleRunFrequency = scheduleRunFrequency; - return this; - } - - /** - * Get the scheduleRunDays property: List of days of week this schedule has to be run. - * - * @return the scheduleRunDays value. - */ - public List scheduleRunDays() { - return this.scheduleRunDays; - } - - /** - * Set the scheduleRunDays property: List of days of week this schedule has to be run. - * - * @param scheduleRunDays the scheduleRunDays value to set. - * @return the SimpleSchedulePolicy object itself. - */ - public SimpleSchedulePolicy withScheduleRunDays(List scheduleRunDays) { - this.scheduleRunDays = scheduleRunDays; - return this; - } - - /** - * Get the scheduleRunTimes property: List of times of day this schedule has to be run. - * - * @return the scheduleRunTimes value. - */ - public List scheduleRunTimes() { - return this.scheduleRunTimes; - } - - /** - * Set the scheduleRunTimes property: List of times of day this schedule has to be run. - * - * @param scheduleRunTimes the scheduleRunTimes value to set. - * @return the SimpleSchedulePolicy object itself. - */ - public SimpleSchedulePolicy withScheduleRunTimes(List scheduleRunTimes) { - this.scheduleRunTimes = scheduleRunTimes; - return this; - } - - /** - * Get the hourlySchedule property: Hourly Schedule of this Policy. - * - * @return the hourlySchedule value. - */ - public HourlySchedule hourlySchedule() { - return this.hourlySchedule; - } - - /** - * Set the hourlySchedule property: Hourly Schedule of this Policy. - * - * @param hourlySchedule the hourlySchedule value to set. - * @return the SimpleSchedulePolicy object itself. - */ - public SimpleSchedulePolicy withHourlySchedule(HourlySchedule hourlySchedule) { - this.hourlySchedule = hourlySchedule; - return this; - } - - /** - * Get the scheduleWeeklyFrequency property: At every number weeks this schedule has to be run. - * - * @return the scheduleWeeklyFrequency value. - */ - public Integer scheduleWeeklyFrequency() { - return this.scheduleWeeklyFrequency; - } - - /** - * Set the scheduleWeeklyFrequency property: At every number weeks this schedule has to be run. - * - * @param scheduleWeeklyFrequency the scheduleWeeklyFrequency value to set. - * @return the SimpleSchedulePolicy object itself. - */ - public SimpleSchedulePolicy withScheduleWeeklyFrequency(Integer scheduleWeeklyFrequency) { - this.scheduleWeeklyFrequency = scheduleWeeklyFrequency; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("schedulePolicyType", this.schedulePolicyType); - jsonWriter.writeStringField("scheduleRunFrequency", - this.scheduleRunFrequency == null ? null : this.scheduleRunFrequency.toString()); - jsonWriter.writeArrayField("scheduleRunDays", this.scheduleRunDays, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("scheduleRunTimes", this.scheduleRunTimes, (writer, element) -> writer - .writeString(element == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(element))); - jsonWriter.writeJsonField("hourlySchedule", this.hourlySchedule); - jsonWriter.writeNumberField("scheduleWeeklyFrequency", this.scheduleWeeklyFrequency); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SimpleSchedulePolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SimpleSchedulePolicy 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 SimpleSchedulePolicy. - */ - public static SimpleSchedulePolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SimpleSchedulePolicy deserializedSimpleSchedulePolicy = new SimpleSchedulePolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("schedulePolicyType".equals(fieldName)) { - deserializedSimpleSchedulePolicy.schedulePolicyType = reader.getString(); - } else if ("scheduleRunFrequency".equals(fieldName)) { - deserializedSimpleSchedulePolicy.scheduleRunFrequency - = ScheduleRunType.fromString(reader.getString()); - } else if ("scheduleRunDays".equals(fieldName)) { - List scheduleRunDays - = reader.readArray(reader1 -> DayOfWeek.fromString(reader1.getString())); - deserializedSimpleSchedulePolicy.scheduleRunDays = scheduleRunDays; - } else if ("scheduleRunTimes".equals(fieldName)) { - List scheduleRunTimes = reader.readArray(reader1 -> reader1 - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - deserializedSimpleSchedulePolicy.scheduleRunTimes = scheduleRunTimes; - } else if ("hourlySchedule".equals(fieldName)) { - deserializedSimpleSchedulePolicy.hourlySchedule = HourlySchedule.fromJson(reader); - } else if ("scheduleWeeklyFrequency".equals(fieldName)) { - deserializedSimpleSchedulePolicy.scheduleWeeklyFrequency = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedSimpleSchedulePolicy; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SimpleSchedulePolicyV2.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SimpleSchedulePolicyV2.java deleted file mode 100644 index b94fae935bd5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SimpleSchedulePolicyV2.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The V2 policy schedule for IaaS that supports hourly backups. - */ -@Fluent -public final class SimpleSchedulePolicyV2 extends SchedulePolicy { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String schedulePolicyType = "SimpleSchedulePolicyV2"; - - /* - * Frequency of the schedule operation of this policy. - */ - private ScheduleRunType scheduleRunFrequency; - - /* - * hourly schedule of this policy - */ - private HourlySchedule hourlySchedule; - - /* - * Daily schedule of this policy - */ - private DailySchedule dailySchedule; - - /* - * Weekly schedule of this policy - */ - private WeeklySchedule weeklySchedule; - - /** - * Creates an instance of SimpleSchedulePolicyV2 class. - */ - public SimpleSchedulePolicyV2() { - } - - /** - * Get the schedulePolicyType property: This property will be used as the discriminator for deciding the specific - * types in the polymorphic chain of types. - * - * @return the schedulePolicyType value. - */ - @Override - public String schedulePolicyType() { - return this.schedulePolicyType; - } - - /** - * Get the scheduleRunFrequency property: Frequency of the schedule operation of this policy. - * - * @return the scheduleRunFrequency value. - */ - public ScheduleRunType scheduleRunFrequency() { - return this.scheduleRunFrequency; - } - - /** - * Set the scheduleRunFrequency property: Frequency of the schedule operation of this policy. - * - * @param scheduleRunFrequency the scheduleRunFrequency value to set. - * @return the SimpleSchedulePolicyV2 object itself. - */ - public SimpleSchedulePolicyV2 withScheduleRunFrequency(ScheduleRunType scheduleRunFrequency) { - this.scheduleRunFrequency = scheduleRunFrequency; - return this; - } - - /** - * Get the hourlySchedule property: hourly schedule of this policy. - * - * @return the hourlySchedule value. - */ - public HourlySchedule hourlySchedule() { - return this.hourlySchedule; - } - - /** - * Set the hourlySchedule property: hourly schedule of this policy. - * - * @param hourlySchedule the hourlySchedule value to set. - * @return the SimpleSchedulePolicyV2 object itself. - */ - public SimpleSchedulePolicyV2 withHourlySchedule(HourlySchedule hourlySchedule) { - this.hourlySchedule = hourlySchedule; - return this; - } - - /** - * Get the dailySchedule property: Daily schedule of this policy. - * - * @return the dailySchedule value. - */ - public DailySchedule dailySchedule() { - return this.dailySchedule; - } - - /** - * Set the dailySchedule property: Daily schedule of this policy. - * - * @param dailySchedule the dailySchedule value to set. - * @return the SimpleSchedulePolicyV2 object itself. - */ - public SimpleSchedulePolicyV2 withDailySchedule(DailySchedule dailySchedule) { - this.dailySchedule = dailySchedule; - return this; - } - - /** - * Get the weeklySchedule property: Weekly schedule of this policy. - * - * @return the weeklySchedule value. - */ - public WeeklySchedule weeklySchedule() { - return this.weeklySchedule; - } - - /** - * Set the weeklySchedule property: Weekly schedule of this policy. - * - * @param weeklySchedule the weeklySchedule value to set. - * @return the SimpleSchedulePolicyV2 object itself. - */ - public SimpleSchedulePolicyV2 withWeeklySchedule(WeeklySchedule weeklySchedule) { - this.weeklySchedule = weeklySchedule; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("schedulePolicyType", this.schedulePolicyType); - jsonWriter.writeStringField("scheduleRunFrequency", - this.scheduleRunFrequency == null ? null : this.scheduleRunFrequency.toString()); - jsonWriter.writeJsonField("hourlySchedule", this.hourlySchedule); - jsonWriter.writeJsonField("dailySchedule", this.dailySchedule); - jsonWriter.writeJsonField("weeklySchedule", this.weeklySchedule); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SimpleSchedulePolicyV2 from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SimpleSchedulePolicyV2 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 SimpleSchedulePolicyV2. - */ - public static SimpleSchedulePolicyV2 fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SimpleSchedulePolicyV2 deserializedSimpleSchedulePolicyV2 = new SimpleSchedulePolicyV2(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("schedulePolicyType".equals(fieldName)) { - deserializedSimpleSchedulePolicyV2.schedulePolicyType = reader.getString(); - } else if ("scheduleRunFrequency".equals(fieldName)) { - deserializedSimpleSchedulePolicyV2.scheduleRunFrequency - = ScheduleRunType.fromString(reader.getString()); - } else if ("hourlySchedule".equals(fieldName)) { - deserializedSimpleSchedulePolicyV2.hourlySchedule = HourlySchedule.fromJson(reader); - } else if ("dailySchedule".equals(fieldName)) { - deserializedSimpleSchedulePolicyV2.dailySchedule = DailySchedule.fromJson(reader); - } else if ("weeklySchedule".equals(fieldName)) { - deserializedSimpleSchedulePolicyV2.weeklySchedule = WeeklySchedule.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSimpleSchedulePolicyV2; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SnapshotBackupAdditionalDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SnapshotBackupAdditionalDetails.java deleted file mode 100644 index c410e9a93e8f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SnapshotBackupAdditionalDetails.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Snapshot Backup related fields for WorkloadType SaPHanaSystem. - */ -@Fluent -public final class SnapshotBackupAdditionalDetails implements JsonSerializable { - /* - * The instantRpRetentionRangeInDays property. - */ - private Integer instantRpRetentionRangeInDays; - - /* - * The instantRPDetails property. - */ - private String instantRPDetails; - - /* - * User assigned managed identity details - */ - private UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails; - - /** - * Creates an instance of SnapshotBackupAdditionalDetails class. - */ - public SnapshotBackupAdditionalDetails() { - } - - /** - * Get the instantRpRetentionRangeInDays property: The instantRpRetentionRangeInDays property. - * - * @return the instantRpRetentionRangeInDays value. - */ - public Integer instantRpRetentionRangeInDays() { - return this.instantRpRetentionRangeInDays; - } - - /** - * Set the instantRpRetentionRangeInDays property: The instantRpRetentionRangeInDays property. - * - * @param instantRpRetentionRangeInDays the instantRpRetentionRangeInDays value to set. - * @return the SnapshotBackupAdditionalDetails object itself. - */ - public SnapshotBackupAdditionalDetails withInstantRpRetentionRangeInDays(Integer instantRpRetentionRangeInDays) { - this.instantRpRetentionRangeInDays = instantRpRetentionRangeInDays; - return this; - } - - /** - * Get the instantRPDetails property: The instantRPDetails property. - * - * @return the instantRPDetails value. - */ - public String instantRPDetails() { - return this.instantRPDetails; - } - - /** - * Set the instantRPDetails property: The instantRPDetails property. - * - * @param instantRPDetails the instantRPDetails value to set. - * @return the SnapshotBackupAdditionalDetails object itself. - */ - public SnapshotBackupAdditionalDetails withInstantRPDetails(String instantRPDetails) { - this.instantRPDetails = instantRPDetails; - return this; - } - - /** - * Get the userAssignedManagedIdentityDetails property: User assigned managed identity details. - * - * @return the userAssignedManagedIdentityDetails value. - */ - public UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails() { - return this.userAssignedManagedIdentityDetails; - } - - /** - * Set the userAssignedManagedIdentityDetails property: User assigned managed identity details. - * - * @param userAssignedManagedIdentityDetails the userAssignedManagedIdentityDetails value to set. - * @return the SnapshotBackupAdditionalDetails object itself. - */ - public SnapshotBackupAdditionalDetails - withUserAssignedManagedIdentityDetails(UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails) { - this.userAssignedManagedIdentityDetails = userAssignedManagedIdentityDetails; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("instantRpRetentionRangeInDays", this.instantRpRetentionRangeInDays); - jsonWriter.writeStringField("instantRPDetails", this.instantRPDetails); - jsonWriter.writeJsonField("userAssignedManagedIdentityDetails", this.userAssignedManagedIdentityDetails); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SnapshotBackupAdditionalDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SnapshotBackupAdditionalDetails 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 SnapshotBackupAdditionalDetails. - */ - public static SnapshotBackupAdditionalDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SnapshotBackupAdditionalDetails deserializedSnapshotBackupAdditionalDetails - = new SnapshotBackupAdditionalDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("instantRpRetentionRangeInDays".equals(fieldName)) { - deserializedSnapshotBackupAdditionalDetails.instantRpRetentionRangeInDays - = reader.getNullable(JsonReader::getInt); - } else if ("instantRPDetails".equals(fieldName)) { - deserializedSnapshotBackupAdditionalDetails.instantRPDetails = reader.getString(); - } else if ("userAssignedManagedIdentityDetails".equals(fieldName)) { - deserializedSnapshotBackupAdditionalDetails.userAssignedManagedIdentityDetails - = UserAssignedManagedIdentityDetails.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSnapshotBackupAdditionalDetails; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SnapshotRestoreParameters.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SnapshotRestoreParameters.java deleted file mode 100644 index 59bf2f4a060f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SnapshotRestoreParameters.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Encapsulates information regarding snapshot recovery for SAP Hana. - */ -@Fluent -public final class SnapshotRestoreParameters implements JsonSerializable { - /* - * The skipAttachAndMount property. - */ - private Boolean skipAttachAndMount; - - /* - * The logPointInTimeForDBRecovery property. - */ - private String logPointInTimeForDBRecovery; - - /** - * Creates an instance of SnapshotRestoreParameters class. - */ - public SnapshotRestoreParameters() { - } - - /** - * Get the skipAttachAndMount property: The skipAttachAndMount property. - * - * @return the skipAttachAndMount value. - */ - public Boolean skipAttachAndMount() { - return this.skipAttachAndMount; - } - - /** - * Set the skipAttachAndMount property: The skipAttachAndMount property. - * - * @param skipAttachAndMount the skipAttachAndMount value to set. - * @return the SnapshotRestoreParameters object itself. - */ - public SnapshotRestoreParameters withSkipAttachAndMount(Boolean skipAttachAndMount) { - this.skipAttachAndMount = skipAttachAndMount; - return this; - } - - /** - * Get the logPointInTimeForDBRecovery property: The logPointInTimeForDBRecovery property. - * - * @return the logPointInTimeForDBRecovery value. - */ - public String logPointInTimeForDBRecovery() { - return this.logPointInTimeForDBRecovery; - } - - /** - * Set the logPointInTimeForDBRecovery property: The logPointInTimeForDBRecovery property. - * - * @param logPointInTimeForDBRecovery the logPointInTimeForDBRecovery value to set. - * @return the SnapshotRestoreParameters object itself. - */ - public SnapshotRestoreParameters withLogPointInTimeForDBRecovery(String logPointInTimeForDBRecovery) { - this.logPointInTimeForDBRecovery = logPointInTimeForDBRecovery; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("skipAttachAndMount", this.skipAttachAndMount); - jsonWriter.writeStringField("logPointInTimeForDBRecovery", this.logPointInTimeForDBRecovery); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SnapshotRestoreParameters from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SnapshotRestoreParameters 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 SnapshotRestoreParameters. - */ - public static SnapshotRestoreParameters fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SnapshotRestoreParameters deserializedSnapshotRestoreParameters = new SnapshotRestoreParameters(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("skipAttachAndMount".equals(fieldName)) { - deserializedSnapshotRestoreParameters.skipAttachAndMount - = reader.getNullable(JsonReader::getBoolean); - } else if ("logPointInTimeForDBRecovery".equals(fieldName)) { - deserializedSnapshotRestoreParameters.logPointInTimeForDBRecovery = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSnapshotRestoreParameters; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SoftDeleteFeatureState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SoftDeleteFeatureState.java deleted file mode 100644 index c834871da05a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SoftDeleteFeatureState.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Soft Delete feature state. - */ -public final class SoftDeleteFeatureState extends ExpandableStringEnum { - /** - * Static value Invalid for SoftDeleteFeatureState. - */ - public static final SoftDeleteFeatureState INVALID = fromString("Invalid"); - - /** - * Static value Enabled for SoftDeleteFeatureState. - */ - public static final SoftDeleteFeatureState ENABLED = fromString("Enabled"); - - /** - * Static value Disabled for SoftDeleteFeatureState. - */ - public static final SoftDeleteFeatureState DISABLED = fromString("Disabled"); - - /** - * Static value AlwaysON for SoftDeleteFeatureState. - */ - public static final SoftDeleteFeatureState ALWAYS_ON = fromString("AlwaysON"); - - /** - * Creates a new instance of SoftDeleteFeatureState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SoftDeleteFeatureState() { - } - - /** - * Creates or finds a SoftDeleteFeatureState from its string representation. - * - * @param name a name to look for. - * @return the corresponding SoftDeleteFeatureState. - */ - public static SoftDeleteFeatureState fromString(String name) { - return fromString(name, SoftDeleteFeatureState.class); - } - - /** - * Gets known SoftDeleteFeatureState values. - * - * @return known SoftDeleteFeatureState values. - */ - public static Collection values() { - return values(SoftDeleteFeatureState.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SourceSideScanInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SourceSideScanInfo.java deleted file mode 100644 index e3ff531796c0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SourceSideScanInfo.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Source side threat information. - */ -@Fluent -public final class SourceSideScanInfo implements JsonSerializable { - /* - * Threat status of the container - */ - private SourceSideScanStatus sourceSideScanStatus; - - /* - * Threat summary for the container - */ - private SourceSideScanSummary sourceSideScanSummary; - - /** - * Creates an instance of SourceSideScanInfo class. - */ - public SourceSideScanInfo() { - } - - /** - * Get the sourceSideScanStatus property: Threat status of the container. - * - * @return the sourceSideScanStatus value. - */ - public SourceSideScanStatus sourceSideScanStatus() { - return this.sourceSideScanStatus; - } - - /** - * Set the sourceSideScanStatus property: Threat status of the container. - * - * @param sourceSideScanStatus the sourceSideScanStatus value to set. - * @return the SourceSideScanInfo object itself. - */ - public SourceSideScanInfo withSourceSideScanStatus(SourceSideScanStatus sourceSideScanStatus) { - this.sourceSideScanStatus = sourceSideScanStatus; - return this; - } - - /** - * Get the sourceSideScanSummary property: Threat summary for the container. - * - * @return the sourceSideScanSummary value. - */ - public SourceSideScanSummary sourceSideScanSummary() { - return this.sourceSideScanSummary; - } - - /** - * Set the sourceSideScanSummary property: Threat summary for the container. - * - * @param sourceSideScanSummary the sourceSideScanSummary value to set. - * @return the SourceSideScanInfo object itself. - */ - public SourceSideScanInfo withSourceSideScanSummary(SourceSideScanSummary sourceSideScanSummary) { - this.sourceSideScanSummary = sourceSideScanSummary; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("sourceSideScanStatus", - this.sourceSideScanStatus == null ? null : this.sourceSideScanStatus.toString()); - jsonWriter.writeStringField("sourceSideScanSummary", - this.sourceSideScanSummary == null ? null : this.sourceSideScanSummary.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SourceSideScanInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SourceSideScanInfo 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 SourceSideScanInfo. - */ - public static SourceSideScanInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SourceSideScanInfo deserializedSourceSideScanInfo = new SourceSideScanInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sourceSideScanStatus".equals(fieldName)) { - deserializedSourceSideScanInfo.sourceSideScanStatus - = SourceSideScanStatus.fromString(reader.getString()); - } else if ("sourceSideScanSummary".equals(fieldName)) { - deserializedSourceSideScanInfo.sourceSideScanSummary - = SourceSideScanSummary.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedSourceSideScanInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SourceSideScanStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SourceSideScanStatus.java deleted file mode 100644 index ca602f993f61..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SourceSideScanStatus.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Threat status of the container. - */ -public final class SourceSideScanStatus extends ExpandableStringEnum { - /** - * Source side scan is configured. - */ - public static final SourceSideScanStatus CONFIGURED = fromString("Configured"); - - /** - * Source side scan is not configured. - */ - public static final SourceSideScanStatus NOT_CONFIGURED = fromString("NotConfigured"); - - /** - * Source side scan is not applicable. - */ - public static final SourceSideScanStatus NOT_APPLICABLE = fromString("NotApplicable"); - - /** - * Creates a new instance of SourceSideScanStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SourceSideScanStatus() { - } - - /** - * Creates or finds a SourceSideScanStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding SourceSideScanStatus. - */ - public static SourceSideScanStatus fromString(String name) { - return fromString(name, SourceSideScanStatus.class); - } - - /** - * Gets known SourceSideScanStatus values. - * - * @return known SourceSideScanStatus values. - */ - public static Collection values() { - return values(SourceSideScanStatus.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SourceSideScanSummary.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SourceSideScanSummary.java deleted file mode 100644 index 9b37bba42469..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SourceSideScanSummary.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Threat summary for the container. - */ -public final class SourceSideScanSummary extends ExpandableStringEnum { - /** - * Scan summary is unknown. - */ - public static final SourceSideScanSummary UNKNOWN = fromString("Unknown"); - - /** - * Scan summary is not applicable. - */ - public static final SourceSideScanSummary NOT_APPLICABLE = fromString("NotApplicable"); - - /** - * Scan summary is suspicious. - */ - public static final SourceSideScanSummary SUSPICIOUS = fromString("Suspicious"); - - /** - * Scan summary indicates healthy state. - */ - public static final SourceSideScanSummary HEALTHY = fromString("Healthy"); - - /** - * Creates a new instance of SourceSideScanSummary value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SourceSideScanSummary() { - } - - /** - * Creates or finds a SourceSideScanSummary from its string representation. - * - * @param name a name to look for. - * @return the corresponding SourceSideScanSummary. - */ - public static SourceSideScanSummary fromString(String name) { - return fromString(name, SourceSideScanSummary.class); - } - - /** - * Gets known SourceSideScanSummary values. - * - * @return known SourceSideScanSummary values. - */ - public static Collection values() { - return values(SourceSideScanSummary.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SqlDataDirectory.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SqlDataDirectory.java deleted file mode 100644 index 372713ca83e2..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SqlDataDirectory.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * SQLDataDirectory info. - */ -@Immutable -public final class SqlDataDirectory implements JsonSerializable { - /* - * Type of data directory mapping - */ - private SqlDataDirectoryType type; - - /* - * File path - */ - private String path; - - /* - * Logical name of the file - */ - private String logicalName; - - /** - * Creates an instance of SqlDataDirectory class. - */ - private SqlDataDirectory() { - } - - /** - * Get the type property: Type of data directory mapping. - * - * @return the type value. - */ - public SqlDataDirectoryType type() { - return this.type; - } - - /** - * Get the path property: File path. - * - * @return the path value. - */ - public String path() { - return this.path; - } - - /** - * Get the logicalName property: Logical name of the file. - * - * @return the logicalName value. - */ - public String logicalName() { - return this.logicalName; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("path", this.path); - jsonWriter.writeStringField("logicalName", this.logicalName); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SqlDataDirectory from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SqlDataDirectory 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 SqlDataDirectory. - */ - public static SqlDataDirectory fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SqlDataDirectory deserializedSqlDataDirectory = new SqlDataDirectory(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedSqlDataDirectory.type = SqlDataDirectoryType.fromString(reader.getString()); - } else if ("path".equals(fieldName)) { - deserializedSqlDataDirectory.path = reader.getString(); - } else if ("logicalName".equals(fieldName)) { - deserializedSqlDataDirectory.logicalName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSqlDataDirectory; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SqlDataDirectoryMapping.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SqlDataDirectoryMapping.java deleted file mode 100644 index ea68f37b4a28..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SqlDataDirectoryMapping.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Encapsulates information regarding data directory. - */ -@Fluent -public final class SqlDataDirectoryMapping implements JsonSerializable { - /* - * Type of data directory mapping - */ - private SqlDataDirectoryType mappingType; - - /* - * Restore source logical name path - */ - private String sourceLogicalName; - - /* - * Restore source path - */ - private String sourcePath; - - /* - * Target path - */ - private String targetPath; - - /** - * Creates an instance of SqlDataDirectoryMapping class. - */ - public SqlDataDirectoryMapping() { - } - - /** - * Get the mappingType property: Type of data directory mapping. - * - * @return the mappingType value. - */ - public SqlDataDirectoryType mappingType() { - return this.mappingType; - } - - /** - * Set the mappingType property: Type of data directory mapping. - * - * @param mappingType the mappingType value to set. - * @return the SqlDataDirectoryMapping object itself. - */ - public SqlDataDirectoryMapping withMappingType(SqlDataDirectoryType mappingType) { - this.mappingType = mappingType; - return this; - } - - /** - * Get the sourceLogicalName property: Restore source logical name path. - * - * @return the sourceLogicalName value. - */ - public String sourceLogicalName() { - return this.sourceLogicalName; - } - - /** - * Set the sourceLogicalName property: Restore source logical name path. - * - * @param sourceLogicalName the sourceLogicalName value to set. - * @return the SqlDataDirectoryMapping object itself. - */ - public SqlDataDirectoryMapping withSourceLogicalName(String sourceLogicalName) { - this.sourceLogicalName = sourceLogicalName; - return this; - } - - /** - * Get the sourcePath property: Restore source path. - * - * @return the sourcePath value. - */ - public String sourcePath() { - return this.sourcePath; - } - - /** - * Set the sourcePath property: Restore source path. - * - * @param sourcePath the sourcePath value to set. - * @return the SqlDataDirectoryMapping object itself. - */ - public SqlDataDirectoryMapping withSourcePath(String sourcePath) { - this.sourcePath = sourcePath; - return this; - } - - /** - * Get the targetPath property: Target path. - * - * @return the targetPath value. - */ - public String targetPath() { - return this.targetPath; - } - - /** - * Set the targetPath property: Target path. - * - * @param targetPath the targetPath value to set. - * @return the SqlDataDirectoryMapping object itself. - */ - public SqlDataDirectoryMapping withTargetPath(String targetPath) { - this.targetPath = targetPath; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("mappingType", this.mappingType == null ? null : this.mappingType.toString()); - jsonWriter.writeStringField("sourceLogicalName", this.sourceLogicalName); - jsonWriter.writeStringField("sourcePath", this.sourcePath); - jsonWriter.writeStringField("targetPath", this.targetPath); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SqlDataDirectoryMapping from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SqlDataDirectoryMapping 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 SqlDataDirectoryMapping. - */ - public static SqlDataDirectoryMapping fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SqlDataDirectoryMapping deserializedSqlDataDirectoryMapping = new SqlDataDirectoryMapping(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("mappingType".equals(fieldName)) { - deserializedSqlDataDirectoryMapping.mappingType - = SqlDataDirectoryType.fromString(reader.getString()); - } else if ("sourceLogicalName".equals(fieldName)) { - deserializedSqlDataDirectoryMapping.sourceLogicalName = reader.getString(); - } else if ("sourcePath".equals(fieldName)) { - deserializedSqlDataDirectoryMapping.sourcePath = reader.getString(); - } else if ("targetPath".equals(fieldName)) { - deserializedSqlDataDirectoryMapping.targetPath = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSqlDataDirectoryMapping; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SqlDataDirectoryType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SqlDataDirectoryType.java deleted file mode 100644 index d003bfdca92a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SqlDataDirectoryType.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Type of data directory mapping. - */ -public final class SqlDataDirectoryType extends ExpandableStringEnum { - /** - * Static value Invalid for SqlDataDirectoryType. - */ - public static final SqlDataDirectoryType INVALID = fromString("Invalid"); - - /** - * Static value Data for SqlDataDirectoryType. - */ - public static final SqlDataDirectoryType DATA = fromString("Data"); - - /** - * Static value Log for SqlDataDirectoryType. - */ - public static final SqlDataDirectoryType LOG = fromString("Log"); - - /** - * Creates a new instance of SqlDataDirectoryType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SqlDataDirectoryType() { - } - - /** - * Creates or finds a SqlDataDirectoryType from its string representation. - * - * @param name a name to look for. - * @return the corresponding SqlDataDirectoryType. - */ - public static SqlDataDirectoryType fromString(String name) { - return fromString(name, SqlDataDirectoryType.class); - } - - /** - * Gets known SqlDataDirectoryType values. - * - * @return known SqlDataDirectoryType values. - */ - public static Collection values() { - return values(SqlDataDirectoryType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/StorageType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/StorageType.java deleted file mode 100644 index bc182fcda52c..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/StorageType.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Storage type. - */ -public final class StorageType extends ExpandableStringEnum { - /** - * Static value Invalid for StorageType. - */ - public static final StorageType INVALID = fromString("Invalid"); - - /** - * Static value GeoRedundant for StorageType. - */ - public static final StorageType GEO_REDUNDANT = fromString("GeoRedundant"); - - /** - * Static value LocallyRedundant for StorageType. - */ - public static final StorageType LOCALLY_REDUNDANT = fromString("LocallyRedundant"); - - /** - * Static value ZoneRedundant for StorageType. - */ - public static final StorageType ZONE_REDUNDANT = fromString("ZoneRedundant"); - - /** - * Static value ReadAccessGeoZoneRedundant for StorageType. - */ - public static final StorageType READ_ACCESS_GEO_ZONE_REDUNDANT = fromString("ReadAccessGeoZoneRedundant"); - - /** - * Creates a new instance of StorageType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public StorageType() { - } - - /** - * Creates or finds a StorageType from its string representation. - * - * @param name a name to look for. - * @return the corresponding StorageType. - */ - public static StorageType fromString(String name) { - return fromString(name, StorageType.class); - } - - /** - * Gets known StorageType values. - * - * @return known StorageType values. - */ - public static Collection values() { - return values(StorageType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/StorageTypeState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/StorageTypeState.java deleted file mode 100644 index e4834fb14d36..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/StorageTypeState.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Locked or Unlocked. Once a machine is registered against a resource, the storageTypeState is always Locked. - */ -public final class StorageTypeState extends ExpandableStringEnum { - /** - * Static value Invalid for StorageTypeState. - */ - public static final StorageTypeState INVALID = fromString("Invalid"); - - /** - * Static value Locked for StorageTypeState. - */ - public static final StorageTypeState LOCKED = fromString("Locked"); - - /** - * Static value Unlocked for StorageTypeState. - */ - public static final StorageTypeState UNLOCKED = fromString("Unlocked"); - - /** - * Creates a new instance of StorageTypeState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public StorageTypeState() { - } - - /** - * Creates or finds a StorageTypeState from its string representation. - * - * @param name a name to look for. - * @return the corresponding StorageTypeState. - */ - public static StorageTypeState fromString(String name) { - return fromString(name, StorageTypeState.class); - } - - /** - * Gets known StorageTypeState values. - * - * @return known StorageTypeState values. - */ - public static Collection values() { - return values(StorageTypeState.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SubProtectionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SubProtectionPolicy.java deleted file mode 100644 index 726cd5bbb32b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SubProtectionPolicy.java +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.Map; - -/** - * Sub-protection policy which includes schedule and retention. - */ -@Fluent -public final class SubProtectionPolicy implements JsonSerializable { - /* - * Type of backup policy type - */ - private PolicyType policyType; - - /* - * Backup schedule specified as part of backup policy. - */ - private SchedulePolicy schedulePolicy; - - /* - * Retention policy with the details on backup copy retention ranges. - */ - private RetentionPolicy retentionPolicy; - - /* - * Tiering policy to automatically move RPs to another tier. - * Key is Target Tier, defined in RecoveryPointTierType enum. - * Tiering policy specifies the criteria to move RP to the target tier. - */ - private Map tieringPolicy; - - /* - * Snapshot Backup related fields for WorkloadType SaPHanaSystem - */ - private SnapshotBackupAdditionalDetails snapshotBackupAdditionalDetails; - - /** - * Creates an instance of SubProtectionPolicy class. - */ - public SubProtectionPolicy() { - } - - /** - * Get the policyType property: Type of backup policy type. - * - * @return the policyType value. - */ - public PolicyType policyType() { - return this.policyType; - } - - /** - * Set the policyType property: Type of backup policy type. - * - * @param policyType the policyType value to set. - * @return the SubProtectionPolicy object itself. - */ - public SubProtectionPolicy withPolicyType(PolicyType policyType) { - this.policyType = policyType; - return this; - } - - /** - * Get the schedulePolicy property: Backup schedule specified as part of backup policy. - * - * @return the schedulePolicy value. - */ - public SchedulePolicy schedulePolicy() { - return this.schedulePolicy; - } - - /** - * Set the schedulePolicy property: Backup schedule specified as part of backup policy. - * - * @param schedulePolicy the schedulePolicy value to set. - * @return the SubProtectionPolicy object itself. - */ - public SubProtectionPolicy withSchedulePolicy(SchedulePolicy schedulePolicy) { - this.schedulePolicy = schedulePolicy; - return this; - } - - /** - * Get the retentionPolicy property: Retention policy with the details on backup copy retention ranges. - * - * @return the retentionPolicy value. - */ - public RetentionPolicy retentionPolicy() { - return this.retentionPolicy; - } - - /** - * Set the retentionPolicy property: Retention policy with the details on backup copy retention ranges. - * - * @param retentionPolicy the retentionPolicy value to set. - * @return the SubProtectionPolicy object itself. - */ - public SubProtectionPolicy withRetentionPolicy(RetentionPolicy retentionPolicy) { - this.retentionPolicy = retentionPolicy; - return this; - } - - /** - * Get the tieringPolicy property: Tiering policy to automatically move RPs to another tier. - * Key is Target Tier, defined in RecoveryPointTierType enum. - * Tiering policy specifies the criteria to move RP to the target tier. - * - * @return the tieringPolicy value. - */ - public Map tieringPolicy() { - return this.tieringPolicy; - } - - /** - * Set the tieringPolicy property: Tiering policy to automatically move RPs to another tier. - * Key is Target Tier, defined in RecoveryPointTierType enum. - * Tiering policy specifies the criteria to move RP to the target tier. - * - * @param tieringPolicy the tieringPolicy value to set. - * @return the SubProtectionPolicy object itself. - */ - public SubProtectionPolicy withTieringPolicy(Map tieringPolicy) { - this.tieringPolicy = tieringPolicy; - return this; - } - - /** - * Get the snapshotBackupAdditionalDetails property: Snapshot Backup related fields for WorkloadType SaPHanaSystem. - * - * @return the snapshotBackupAdditionalDetails value. - */ - public SnapshotBackupAdditionalDetails snapshotBackupAdditionalDetails() { - return this.snapshotBackupAdditionalDetails; - } - - /** - * Set the snapshotBackupAdditionalDetails property: Snapshot Backup related fields for WorkloadType SaPHanaSystem. - * - * @param snapshotBackupAdditionalDetails the snapshotBackupAdditionalDetails value to set. - * @return the SubProtectionPolicy object itself. - */ - public SubProtectionPolicy - withSnapshotBackupAdditionalDetails(SnapshotBackupAdditionalDetails snapshotBackupAdditionalDetails) { - this.snapshotBackupAdditionalDetails = snapshotBackupAdditionalDetails; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("policyType", this.policyType == null ? null : this.policyType.toString()); - jsonWriter.writeJsonField("schedulePolicy", this.schedulePolicy); - jsonWriter.writeJsonField("retentionPolicy", this.retentionPolicy); - jsonWriter.writeMapField("tieringPolicy", this.tieringPolicy, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("snapshotBackupAdditionalDetails", this.snapshotBackupAdditionalDetails); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SubProtectionPolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SubProtectionPolicy 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 SubProtectionPolicy. - */ - public static SubProtectionPolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SubProtectionPolicy deserializedSubProtectionPolicy = new SubProtectionPolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("policyType".equals(fieldName)) { - deserializedSubProtectionPolicy.policyType = PolicyType.fromString(reader.getString()); - } else if ("schedulePolicy".equals(fieldName)) { - deserializedSubProtectionPolicy.schedulePolicy = SchedulePolicy.fromJson(reader); - } else if ("retentionPolicy".equals(fieldName)) { - deserializedSubProtectionPolicy.retentionPolicy = RetentionPolicy.fromJson(reader); - } else if ("tieringPolicy".equals(fieldName)) { - Map tieringPolicy - = reader.readMap(reader1 -> TieringPolicy.fromJson(reader1)); - deserializedSubProtectionPolicy.tieringPolicy = tieringPolicy; - } else if ("snapshotBackupAdditionalDetails".equals(fieldName)) { - deserializedSubProtectionPolicy.snapshotBackupAdditionalDetails - = SnapshotBackupAdditionalDetails.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSubProtectionPolicy; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SupportStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SupportStatus.java deleted file mode 100644 index 547dffe6b1e5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/SupportStatus.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Support status of feature. - */ -public final class SupportStatus extends ExpandableStringEnum { - /** - * Static value Invalid for SupportStatus. - */ - public static final SupportStatus INVALID = fromString("Invalid"); - - /** - * Static value Supported for SupportStatus. - */ - public static final SupportStatus SUPPORTED = fromString("Supported"); - - /** - * Static value DefaultOFF for SupportStatus. - */ - public static final SupportStatus DEFAULT_OFF = fromString("DefaultOFF"); - - /** - * Static value DefaultON for SupportStatus. - */ - public static final SupportStatus DEFAULT_ON = fromString("DefaultON"); - - /** - * Static value NotSupported for SupportStatus. - */ - public static final SupportStatus NOT_SUPPORTED = fromString("NotSupported"); - - /** - * Creates a new instance of SupportStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SupportStatus() { - } - - /** - * Creates or finds a SupportStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding SupportStatus. - */ - public static SupportStatus fromString(String name) { - return fromString(name, SupportStatus.class); - } - - /** - * Gets known SupportStatus values. - * - * @return known SupportStatus values. - */ - public static Collection values() { - return values(SupportStatus.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetAfsRestoreInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetAfsRestoreInfo.java deleted file mode 100644 index 1b8c2891f061..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetAfsRestoreInfo.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Target Azure File Share Info. - */ -@Fluent -public final class TargetAfsRestoreInfo implements JsonSerializable { - /* - * File share name - */ - private String name; - - /* - * Target file share resource ARM ID - */ - private String targetResourceId; - - /** - * Creates an instance of TargetAfsRestoreInfo class. - */ - public TargetAfsRestoreInfo() { - } - - /** - * Get the name property: File share name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: File share name. - * - * @param name the name value to set. - * @return the TargetAfsRestoreInfo object itself. - */ - public TargetAfsRestoreInfo withName(String name) { - this.name = name; - return this; - } - - /** - * Get the targetResourceId property: Target file share resource ARM ID. - * - * @return the targetResourceId value. - */ - public String targetResourceId() { - return this.targetResourceId; - } - - /** - * Set the targetResourceId property: Target file share resource ARM ID. - * - * @param targetResourceId the targetResourceId value to set. - * @return the TargetAfsRestoreInfo object itself. - */ - public TargetAfsRestoreInfo withTargetResourceId(String targetResourceId) { - this.targetResourceId = targetResourceId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("targetResourceId", this.targetResourceId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of TargetAfsRestoreInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TargetAfsRestoreInfo 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 TargetAfsRestoreInfo. - */ - public static TargetAfsRestoreInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - TargetAfsRestoreInfo deserializedTargetAfsRestoreInfo = new TargetAfsRestoreInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedTargetAfsRestoreInfo.name = reader.getString(); - } else if ("targetResourceId".equals(fieldName)) { - deserializedTargetAfsRestoreInfo.targetResourceId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedTargetAfsRestoreInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetDiskNetworkAccessOption.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetDiskNetworkAccessOption.java deleted file mode 100644 index 240656111f2a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetDiskNetworkAccessOption.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -/** - * Network access settings to be used for restored disks. - */ -public enum TargetDiskNetworkAccessOption { - /** - * Enum value SameAsOnSourceDisks. - */ - SAME_AS_ON_SOURCE_DISKS("SameAsOnSourceDisks"), - - /** - * Enum value EnablePrivateAccessForAllDisks. - */ - ENABLE_PRIVATE_ACCESS_FOR_ALL_DISKS("EnablePrivateAccessForAllDisks"), - - /** - * Enum value EnablePublicAccessForAllDisks. - */ - ENABLE_PUBLIC_ACCESS_FOR_ALL_DISKS("EnablePublicAccessForAllDisks"); - - /** - * The actual serialized value for a TargetDiskNetworkAccessOption instance. - */ - private final String value; - - TargetDiskNetworkAccessOption(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a TargetDiskNetworkAccessOption instance. - * - * @param value the serialized value to parse. - * @return the parsed TargetDiskNetworkAccessOption object, or null if unable to parse. - */ - public static TargetDiskNetworkAccessOption fromString(String value) { - if (value == null) { - return null; - } - TargetDiskNetworkAccessOption[] items = TargetDiskNetworkAccessOption.values(); - for (TargetDiskNetworkAccessOption item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetDiskNetworkAccessSettings.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetDiskNetworkAccessSettings.java deleted file mode 100644 index 5707163bf8cf..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetDiskNetworkAccessSettings.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Specifies target network access settings for disks of VM to be restored. - */ -@Fluent -public final class TargetDiskNetworkAccessSettings implements JsonSerializable { - /* - * Network access settings to be used for restored disks - */ - private TargetDiskNetworkAccessOption targetDiskNetworkAccessOption; - - /* - * Gets or sets the ARM resource ID of the target disk access to be used when TargetDiskNetworkAccessOption is set - * to TargetDiskNetworkAccessOption.UseNew - */ - private String targetDiskAccessId; - - /** - * Creates an instance of TargetDiskNetworkAccessSettings class. - */ - public TargetDiskNetworkAccessSettings() { - } - - /** - * Get the targetDiskNetworkAccessOption property: Network access settings to be used for restored disks. - * - * @return the targetDiskNetworkAccessOption value. - */ - public TargetDiskNetworkAccessOption targetDiskNetworkAccessOption() { - return this.targetDiskNetworkAccessOption; - } - - /** - * Set the targetDiskNetworkAccessOption property: Network access settings to be used for restored disks. - * - * @param targetDiskNetworkAccessOption the targetDiskNetworkAccessOption value to set. - * @return the TargetDiskNetworkAccessSettings object itself. - */ - public TargetDiskNetworkAccessSettings - withTargetDiskNetworkAccessOption(TargetDiskNetworkAccessOption targetDiskNetworkAccessOption) { - this.targetDiskNetworkAccessOption = targetDiskNetworkAccessOption; - return this; - } - - /** - * Get the targetDiskAccessId property: Gets or sets the ARM resource ID of the target disk access to be used when - * TargetDiskNetworkAccessOption is set to TargetDiskNetworkAccessOption.UseNew. - * - * @return the targetDiskAccessId value. - */ - public String targetDiskAccessId() { - return this.targetDiskAccessId; - } - - /** - * Set the targetDiskAccessId property: Gets or sets the ARM resource ID of the target disk access to be used when - * TargetDiskNetworkAccessOption is set to TargetDiskNetworkAccessOption.UseNew. - * - * @param targetDiskAccessId the targetDiskAccessId value to set. - * @return the TargetDiskNetworkAccessSettings object itself. - */ - public TargetDiskNetworkAccessSettings withTargetDiskAccessId(String targetDiskAccessId) { - this.targetDiskAccessId = targetDiskAccessId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("targetDiskNetworkAccessOption", - this.targetDiskNetworkAccessOption == null ? null : this.targetDiskNetworkAccessOption.toString()); - jsonWriter.writeStringField("targetDiskAccessId", this.targetDiskAccessId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of TargetDiskNetworkAccessSettings from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TargetDiskNetworkAccessSettings 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 TargetDiskNetworkAccessSettings. - */ - public static TargetDiskNetworkAccessSettings fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - TargetDiskNetworkAccessSettings deserializedTargetDiskNetworkAccessSettings - = new TargetDiskNetworkAccessSettings(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("targetDiskNetworkAccessOption".equals(fieldName)) { - deserializedTargetDiskNetworkAccessSettings.targetDiskNetworkAccessOption - = TargetDiskNetworkAccessOption.fromString(reader.getString()); - } else if ("targetDiskAccessId".equals(fieldName)) { - deserializedTargetDiskNetworkAccessSettings.targetDiskAccessId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedTargetDiskNetworkAccessSettings; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetRestoreInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetRestoreInfo.java deleted file mode 100644 index ad6fb0f0167b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TargetRestoreInfo.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Details about target workload during restore operation. - */ -@Fluent -public final class TargetRestoreInfo implements JsonSerializable { - /* - * Can Overwrite if Target DataBase already exists - */ - private OverwriteOptions overwriteOption; - - /* - * Resource Id name of the container in which Target DataBase resides - */ - private String containerId; - - /* - * Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana - */ - private String databaseName; - - /* - * Target directory location for restore as files. - */ - private String targetDirectoryForFileRestore; - - /** - * Creates an instance of TargetRestoreInfo class. - */ - public TargetRestoreInfo() { - } - - /** - * Get the overwriteOption property: Can Overwrite if Target DataBase already exists. - * - * @return the overwriteOption value. - */ - public OverwriteOptions overwriteOption() { - return this.overwriteOption; - } - - /** - * Set the overwriteOption property: Can Overwrite if Target DataBase already exists. - * - * @param overwriteOption the overwriteOption value to set. - * @return the TargetRestoreInfo object itself. - */ - public TargetRestoreInfo withOverwriteOption(OverwriteOptions overwriteOption) { - this.overwriteOption = overwriteOption; - return this; - } - - /** - * Get the containerId property: Resource Id name of the container in which Target DataBase resides. - * - * @return the containerId value. - */ - public String containerId() { - return this.containerId; - } - - /** - * Set the containerId property: Resource Id name of the container in which Target DataBase resides. - * - * @param containerId the containerId value to set. - * @return the TargetRestoreInfo object itself. - */ - public TargetRestoreInfo withContainerId(String containerId) { - this.containerId = containerId; - return this; - } - - /** - * Get the databaseName property: Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana. - * - * @return the databaseName value. - */ - public String databaseName() { - return this.databaseName; - } - - /** - * Set the databaseName property: Database name InstanceName/DataBaseName for SQL or System/DbName for SAP Hana. - * - * @param databaseName the databaseName value to set. - * @return the TargetRestoreInfo object itself. - */ - public TargetRestoreInfo withDatabaseName(String databaseName) { - this.databaseName = databaseName; - return this; - } - - /** - * Get the targetDirectoryForFileRestore property: Target directory location for restore as files. - * - * @return the targetDirectoryForFileRestore value. - */ - public String targetDirectoryForFileRestore() { - return this.targetDirectoryForFileRestore; - } - - /** - * Set the targetDirectoryForFileRestore property: Target directory location for restore as files. - * - * @param targetDirectoryForFileRestore the targetDirectoryForFileRestore value to set. - * @return the TargetRestoreInfo object itself. - */ - public TargetRestoreInfo withTargetDirectoryForFileRestore(String targetDirectoryForFileRestore) { - this.targetDirectoryForFileRestore = targetDirectoryForFileRestore; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("overwriteOption", - this.overwriteOption == null ? null : this.overwriteOption.toString()); - jsonWriter.writeStringField("containerId", this.containerId); - jsonWriter.writeStringField("databaseName", this.databaseName); - jsonWriter.writeStringField("targetDirectoryForFileRestore", this.targetDirectoryForFileRestore); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of TargetRestoreInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TargetRestoreInfo 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 TargetRestoreInfo. - */ - public static TargetRestoreInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - TargetRestoreInfo deserializedTargetRestoreInfo = new TargetRestoreInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("overwriteOption".equals(fieldName)) { - deserializedTargetRestoreInfo.overwriteOption = OverwriteOptions.fromString(reader.getString()); - } else if ("containerId".equals(fieldName)) { - deserializedTargetRestoreInfo.containerId = reader.getString(); - } else if ("databaseName".equals(fieldName)) { - deserializedTargetRestoreInfo.databaseName = reader.getString(); - } else if ("targetDirectoryForFileRestore".equals(fieldName)) { - deserializedTargetRestoreInfo.targetDirectoryForFileRestore = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedTargetRestoreInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ThreatInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ThreatInfo.java deleted file mode 100644 index ac2c952e1dad..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ThreatInfo.java +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Recovery Point Threat information. - */ -@Immutable -public final class ThreatInfo implements JsonSerializable { - /* - * Threat Subject - */ - private String threatTitle; - - /* - * Threat Description - */ - private String threatDescription; - - /* - * Timestamp when the last (latest)threat information was sent - */ - private OffsetDateTime lastUpdatedTime; - - /* - * Threat Status Types - */ - private ThreatState threatState; - - /* - * Start timestamp of the threat - */ - private OffsetDateTime threatStartTime; - - /* - * End timestamp of the threat - */ - private OffsetDateTime threatEndTime; - - /* - * threat details link - */ - private String threatURI; - - /* - * Threat Severity Types - */ - private ThreatSeverity threatSeverity; - - /** - * Creates an instance of ThreatInfo class. - */ - private ThreatInfo() { - } - - /** - * Get the threatTitle property: Threat Subject. - * - * @return the threatTitle value. - */ - public String threatTitle() { - return this.threatTitle; - } - - /** - * Get the threatDescription property: Threat Description. - * - * @return the threatDescription value. - */ - public String threatDescription() { - return this.threatDescription; - } - - /** - * Get the lastUpdatedTime property: Timestamp when the last (latest)threat information was sent. - * - * @return the lastUpdatedTime value. - */ - public OffsetDateTime lastUpdatedTime() { - return this.lastUpdatedTime; - } - - /** - * Get the threatState property: Threat Status Types. - * - * @return the threatState value. - */ - public ThreatState threatState() { - return this.threatState; - } - - /** - * Get the threatStartTime property: Start timestamp of the threat. - * - * @return the threatStartTime value. - */ - public OffsetDateTime threatStartTime() { - return this.threatStartTime; - } - - /** - * Get the threatEndTime property: End timestamp of the threat. - * - * @return the threatEndTime value. - */ - public OffsetDateTime threatEndTime() { - return this.threatEndTime; - } - - /** - * Get the threatURI property: threat details link. - * - * @return the threatURI value. - */ - public String threatURI() { - return this.threatURI; - } - - /** - * Get the threatSeverity property: Threat Severity Types. - * - * @return the threatSeverity value. - */ - public ThreatSeverity threatSeverity() { - return this.threatSeverity; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("threatState", this.threatState == null ? null : this.threatState.toString()); - jsonWriter.writeStringField("threatSeverity", - this.threatSeverity == null ? null : this.threatSeverity.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ThreatInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ThreatInfo 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 ThreatInfo. - */ - public static ThreatInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ThreatInfo deserializedThreatInfo = new ThreatInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("threatTitle".equals(fieldName)) { - deserializedThreatInfo.threatTitle = reader.getString(); - } else if ("threatDescription".equals(fieldName)) { - deserializedThreatInfo.threatDescription = reader.getString(); - } else if ("lastUpdatedTime".equals(fieldName)) { - deserializedThreatInfo.lastUpdatedTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("threatState".equals(fieldName)) { - deserializedThreatInfo.threatState = ThreatState.fromString(reader.getString()); - } else if ("threatStartTime".equals(fieldName)) { - deserializedThreatInfo.threatStartTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("threatEndTime".equals(fieldName)) { - deserializedThreatInfo.threatEndTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("threatURI".equals(fieldName)) { - deserializedThreatInfo.threatURI = reader.getString(); - } else if ("threatSeverity".equals(fieldName)) { - deserializedThreatInfo.threatSeverity = ThreatSeverity.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedThreatInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ThreatSeverity.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ThreatSeverity.java deleted file mode 100644 index b2d3dcab0752..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ThreatSeverity.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Threat Severity Types. - */ -public final class ThreatSeverity extends ExpandableStringEnum { - /** - * Critical severity level. - */ - public static final ThreatSeverity CRITICAL = fromString("Critical"); - - /** - * High severity level. - */ - public static final ThreatSeverity HIGH = fromString("High"); - - /** - * Warning severity level. - */ - public static final ThreatSeverity WARNING = fromString("Warning"); - - /** - * Informational severity level. - */ - public static final ThreatSeverity INFORMATIONAL = fromString("Informational"); - - /** - * Creates a new instance of ThreatSeverity value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ThreatSeverity() { - } - - /** - * Creates or finds a ThreatSeverity from its string representation. - * - * @param name a name to look for. - * @return the corresponding ThreatSeverity. - */ - public static ThreatSeverity fromString(String name) { - return fromString(name, ThreatSeverity.class); - } - - /** - * Gets known ThreatSeverity values. - * - * @return known ThreatSeverity values. - */ - public static Collection values() { - return values(ThreatSeverity.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ThreatState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ThreatState.java deleted file mode 100644 index 5f245ab51f7c..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ThreatState.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Threat Status Types. - */ -public final class ThreatState extends ExpandableStringEnum { - /** - * Threat is active. - */ - public static final ThreatState ACTIVE = fromString("Active"); - - /** - * Threat remediation is in progress. - */ - public static final ThreatState IN_PROGRESS = fromString("InProgress"); - - /** - * Threat has been ignored. - */ - public static final ThreatState IGNORED = fromString("Ignored"); - - /** - * Threat has been resolved. - */ - public static final ThreatState RESOLVED = fromString("Resolved"); - - /** - * Creates a new instance of ThreatState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ThreatState() { - } - - /** - * Creates or finds a ThreatState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ThreatState. - */ - public static ThreatState fromString(String name) { - return fromString(name, ThreatState.class); - } - - /** - * Gets known ThreatState values. - * - * @return known ThreatState values. - */ - public static Collection values() { - return values(ThreatState.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ThreatStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ThreatStatus.java deleted file mode 100644 index 17ea4ce8944f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ThreatStatus.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Threat status of the recovery point. - */ -public final class ThreatStatus extends ExpandableStringEnum { - /** - * Threat status is unknown. - */ - public static final ThreatStatus UNKNOWN = fromString("Unknown"); - - /** - * Recovery point is healthy. - */ - public static final ThreatStatus HEALTHY = fromString("Healthy"); - - /** - * Recovery point is unhealthy. - */ - public static final ThreatStatus UN_HEALTHY = fromString("UnHealthy"); - - /** - * Recovery point has warning-level threats. - */ - public static final ThreatStatus WARNING = fromString("Warning"); - - /** - * Threat status is not available. - */ - public static final ThreatStatus NOT_AVAILABLE = fromString("NotAvailable"); - - /** - * Creates a new instance of ThreatStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ThreatStatus() { - } - - /** - * Creates or finds a ThreatStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding ThreatStatus. - */ - public static ThreatStatus fromString(String name) { - return fromString(name, ThreatStatus.class); - } - - /** - * Gets known ThreatStatus values. - * - * @return known ThreatStatus values. - */ - public static Collection values() { - return values(ThreatStatus.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringCostInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringCostInfo.java deleted file mode 100644 index 93c8a437cea1..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringCostInfo.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TieringCostInfoInner; - -/** - * An immutable client-side representation of TieringCostInfo. - */ -public interface TieringCostInfo { - /** - * Gets the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - String objectType(); - - /** - * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TieringCostInfoInner object. - * - * @return the inner object. - */ - TieringCostInfoInner innerModel(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringCostOperationStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringCostOperationStatus.java deleted file mode 100644 index c245ae25e709..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringCostOperationStatus.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of TieringCostOperationStatus. - */ -public interface TieringCostOperationStatus { - /** - * Gets the status of async operations of tiering cost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param operationId The operationId 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 status of async operations of tiering cost along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String vaultName, String operationId, - Context context); - - /** - * Gets the status of async operations of tiering cost. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param vaultName The name of the recovery services vault. - * @param operationId The operationId 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 status of async operations of tiering cost. - */ - OperationStatus get(String resourceGroupName, String vaultName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringCostRehydrationInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringCostRehydrationInfo.java deleted file mode 100644 index 4fe36dab99b5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringCostRehydrationInfo.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TieringCostInfoInner; -import java.io.IOException; - -/** - * Response parameters for tiering cost info for rehydration. - */ -@Immutable -public final class TieringCostRehydrationInfo extends TieringCostInfoInner { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "TieringCostRehydrationInfo"; - - /* - * Rehydration size in bytes - */ - private long rehydrationSizeInBytes; - - /* - * Source tier to target tier rehydration cost per GB per month - */ - private double retailRehydrationCostPerGBPerMonth; - - /** - * Creates an instance of TieringCostRehydrationInfo class. - */ - private TieringCostRehydrationInfo() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the rehydrationSizeInBytes property: Rehydration size in bytes. - * - * @return the rehydrationSizeInBytes value. - */ - public long rehydrationSizeInBytes() { - return this.rehydrationSizeInBytes; - } - - /** - * Get the retailRehydrationCostPerGBPerMonth property: Source tier to target tier rehydration cost per GB per - * month. - * - * @return the retailRehydrationCostPerGBPerMonth value. - */ - public double retailRehydrationCostPerGBPerMonth() { - return this.retailRehydrationCostPerGBPerMonth; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeLongField("rehydrationSizeInBytes", this.rehydrationSizeInBytes); - jsonWriter.writeDoubleField("retailRehydrationCostPerGBPerMonth", this.retailRehydrationCostPerGBPerMonth); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of TieringCostRehydrationInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TieringCostRehydrationInfo 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 TieringCostRehydrationInfo. - */ - public static TieringCostRehydrationInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - TieringCostRehydrationInfo deserializedTieringCostRehydrationInfo = new TieringCostRehydrationInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("rehydrationSizeInBytes".equals(fieldName)) { - deserializedTieringCostRehydrationInfo.rehydrationSizeInBytes = reader.getLong(); - } else if ("retailRehydrationCostPerGBPerMonth".equals(fieldName)) { - deserializedTieringCostRehydrationInfo.retailRehydrationCostPerGBPerMonth = reader.getDouble(); - } else if ("objectType".equals(fieldName)) { - deserializedTieringCostRehydrationInfo.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedTieringCostRehydrationInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringCostSavingInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringCostSavingInfo.java deleted file mode 100644 index cae3d7e5e642..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringCostSavingInfo.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TieringCostInfoInner; -import java.io.IOException; - -/** - * Response parameters for tiering cost info for savings. - */ -@Immutable -public final class TieringCostSavingInfo extends TieringCostInfoInner { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "TieringCostSavingInfo"; - - /* - * Source tier size reduction in bytes after moving all the recommended backup points to target tier - */ - private long sourceTierSizeReductionInBytes; - - /* - * Target tier size increase in bytes after moving all the recommended backup points to target tier - */ - private long targetTierSizeIncreaseInBytes; - - /* - * Source tier retail cost per GB per month - */ - private double retailSourceTierCostPerGBPerMonth; - - /* - * Target tier retail cost per GB per month - */ - private double retailTargetTierCostPerGBPerMonth; - - /** - * Creates an instance of TieringCostSavingInfo class. - */ - private TieringCostSavingInfo() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the sourceTierSizeReductionInBytes property: Source tier size reduction in bytes after moving all the - * recommended backup points to target tier. - * - * @return the sourceTierSizeReductionInBytes value. - */ - public long sourceTierSizeReductionInBytes() { - return this.sourceTierSizeReductionInBytes; - } - - /** - * Get the targetTierSizeIncreaseInBytes property: Target tier size increase in bytes after moving all the - * recommended backup points to target tier. - * - * @return the targetTierSizeIncreaseInBytes value. - */ - public long targetTierSizeIncreaseInBytes() { - return this.targetTierSizeIncreaseInBytes; - } - - /** - * Get the retailSourceTierCostPerGBPerMonth property: Source tier retail cost per GB per month. - * - * @return the retailSourceTierCostPerGBPerMonth value. - */ - public double retailSourceTierCostPerGBPerMonth() { - return this.retailSourceTierCostPerGBPerMonth; - } - - /** - * Get the retailTargetTierCostPerGBPerMonth property: Target tier retail cost per GB per month. - * - * @return the retailTargetTierCostPerGBPerMonth value. - */ - public double retailTargetTierCostPerGBPerMonth() { - return this.retailTargetTierCostPerGBPerMonth; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeLongField("sourceTierSizeReductionInBytes", this.sourceTierSizeReductionInBytes); - jsonWriter.writeLongField("targetTierSizeIncreaseInBytes", this.targetTierSizeIncreaseInBytes); - jsonWriter.writeDoubleField("retailSourceTierCostPerGBPerMonth", this.retailSourceTierCostPerGBPerMonth); - jsonWriter.writeDoubleField("retailTargetTierCostPerGBPerMonth", this.retailTargetTierCostPerGBPerMonth); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of TieringCostSavingInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TieringCostSavingInfo 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 TieringCostSavingInfo. - */ - public static TieringCostSavingInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - TieringCostSavingInfo deserializedTieringCostSavingInfo = new TieringCostSavingInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sourceTierSizeReductionInBytes".equals(fieldName)) { - deserializedTieringCostSavingInfo.sourceTierSizeReductionInBytes = reader.getLong(); - } else if ("targetTierSizeIncreaseInBytes".equals(fieldName)) { - deserializedTieringCostSavingInfo.targetTierSizeIncreaseInBytes = reader.getLong(); - } else if ("retailSourceTierCostPerGBPerMonth".equals(fieldName)) { - deserializedTieringCostSavingInfo.retailSourceTierCostPerGBPerMonth = reader.getDouble(); - } else if ("retailTargetTierCostPerGBPerMonth".equals(fieldName)) { - deserializedTieringCostSavingInfo.retailTargetTierCostPerGBPerMonth = reader.getDouble(); - } else if ("objectType".equals(fieldName)) { - deserializedTieringCostSavingInfo.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedTieringCostSavingInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringMode.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringMode.java deleted file mode 100644 index 75fd047bb9d2..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringMode.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Tiering Mode to control automatic tiering of recovery points. Supported values are: - * 1. TierRecommended: Tier all recovery points recommended to be tiered - * 2. TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below. - * 3. DoNotTier: Do not tier any recovery points. - */ -public final class TieringMode extends ExpandableStringEnum { - /** - * Static value Invalid for TieringMode. - */ - public static final TieringMode INVALID = fromString("Invalid"); - - /** - * Static value TierRecommended for TieringMode. - */ - public static final TieringMode TIER_RECOMMENDED = fromString("TierRecommended"); - - /** - * Static value TierAfter for TieringMode. - */ - public static final TieringMode TIER_AFTER = fromString("TierAfter"); - - /** - * Static value DoNotTier for TieringMode. - */ - public static final TieringMode DO_NOT_TIER = fromString("DoNotTier"); - - /** - * Creates a new instance of TieringMode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public TieringMode() { - } - - /** - * Creates or finds a TieringMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding TieringMode. - */ - public static TieringMode fromString(String name) { - return fromString(name, TieringMode.class); - } - - /** - * Gets known TieringMode values. - * - * @return known TieringMode values. - */ - public static Collection values() { - return values(TieringMode.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringPolicy.java deleted file mode 100644 index 02e471a03d44..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringPolicy.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Tiering Policy for a target tier. - * If the policy is not specified for a given target tier, service retains the existing configured tiering policy for - * that tier. - */ -@Fluent -public final class TieringPolicy implements JsonSerializable { - /* - * Tiering Mode to control automatic tiering of recovery points. Supported values are: - * 1. TierRecommended: Tier all recovery points recommended to be tiered - * 2. TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below. - * 3. DoNotTier: Do not tier any recovery points - */ - private TieringMode tieringMode; - - /* - * Number of days/weeks/months/years to retain backups in current tier before tiering. - * Used only if TieringMode is set to TierAfter - */ - private Integer duration; - - /* - * Retention duration type: days/weeks/months/years - * Used only if TieringMode is set to TierAfter - */ - private RetentionDurationType durationType; - - /** - * Creates an instance of TieringPolicy class. - */ - public TieringPolicy() { - } - - /** - * Get the tieringMode property: Tiering Mode to control automatic tiering of recovery points. Supported values are: - * 1. TierRecommended: Tier all recovery points recommended to be tiered - * 2. TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below. - * 3. DoNotTier: Do not tier any recovery points. - * - * @return the tieringMode value. - */ - public TieringMode tieringMode() { - return this.tieringMode; - } - - /** - * Set the tieringMode property: Tiering Mode to control automatic tiering of recovery points. Supported values are: - * 1. TierRecommended: Tier all recovery points recommended to be tiered - * 2. TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below. - * 3. DoNotTier: Do not tier any recovery points. - * - * @param tieringMode the tieringMode value to set. - * @return the TieringPolicy object itself. - */ - public TieringPolicy withTieringMode(TieringMode tieringMode) { - this.tieringMode = tieringMode; - return this; - } - - /** - * Get the duration property: Number of days/weeks/months/years to retain backups in current tier before tiering. - * Used only if TieringMode is set to TierAfter. - * - * @return the duration value. - */ - public Integer duration() { - return this.duration; - } - - /** - * Set the duration property: Number of days/weeks/months/years to retain backups in current tier before tiering. - * Used only if TieringMode is set to TierAfter. - * - * @param duration the duration value to set. - * @return the TieringPolicy object itself. - */ - public TieringPolicy withDuration(Integer duration) { - this.duration = duration; - return this; - } - - /** - * Get the durationType property: Retention duration type: days/weeks/months/years - * Used only if TieringMode is set to TierAfter. - * - * @return the durationType value. - */ - public RetentionDurationType durationType() { - return this.durationType; - } - - /** - * Set the durationType property: Retention duration type: days/weeks/months/years - * Used only if TieringMode is set to TierAfter. - * - * @param durationType the durationType value to set. - * @return the TieringPolicy object itself. - */ - public TieringPolicy withDurationType(RetentionDurationType durationType) { - this.durationType = durationType; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("tieringMode", this.tieringMode == null ? null : this.tieringMode.toString()); - jsonWriter.writeNumberField("duration", this.duration); - jsonWriter.writeStringField("durationType", this.durationType == null ? null : this.durationType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of TieringPolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TieringPolicy 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 TieringPolicy. - */ - public static TieringPolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - TieringPolicy deserializedTieringPolicy = new TieringPolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("tieringMode".equals(fieldName)) { - deserializedTieringPolicy.tieringMode = TieringMode.fromString(reader.getString()); - } else if ("duration".equals(fieldName)) { - deserializedTieringPolicy.duration = reader.getNullable(JsonReader::getInt); - } else if ("durationType".equals(fieldName)) { - deserializedTieringPolicy.durationType = RetentionDurationType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedTieringPolicy; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TokenInformation.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TokenInformation.java deleted file mode 100644 index 49c424d16e44..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TokenInformation.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TokenInformationInner; - -/** - * An immutable client-side representation of TokenInformation. - */ -public interface TokenInformation { - /** - * Gets the token property: Token value. - * - * @return the token value. - */ - String token(); - - /** - * Gets the expiryTimeInUtcTicks property: Expiry time of token. - * - * @return the expiryTimeInUtcTicks value. - */ - Long expiryTimeInUtcTicks(); - - /** - * Gets the securityPin property: Security PIN. - * - * @return the securityPin value. - */ - String securityPin(); - - /** - * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.TokenInformationInner object. - * - * @return the inner object. - */ - TokenInformationInner innerModel(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TriggerDataMoveRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TriggerDataMoveRequest.java deleted file mode 100644 index b537532eae1d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TriggerDataMoveRequest.java +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Trigger DataMove Request. - */ -@Fluent -public final class TriggerDataMoveRequest implements JsonSerializable { - /* - * ARM Id of source vault - */ - private String sourceResourceId; - - /* - * Source Region - */ - private String sourceRegion; - - /* - * DataMove Level - */ - private DataMoveLevel dataMoveLevel; - - /* - * Correlation Id - */ - private String correlationId; - - /* - * Source Container ArmIds - */ - private List sourceContainerArmIds; - - /* - * Pause GC - */ - private Boolean pauseGC; - - /** - * Creates an instance of TriggerDataMoveRequest class. - */ - public TriggerDataMoveRequest() { - } - - /** - * Get the sourceResourceId property: ARM Id of source vault. - * - * @return the sourceResourceId value. - */ - public String sourceResourceId() { - return this.sourceResourceId; - } - - /** - * Set the sourceResourceId property: ARM Id of source vault. - * - * @param sourceResourceId the sourceResourceId value to set. - * @return the TriggerDataMoveRequest object itself. - */ - public TriggerDataMoveRequest withSourceResourceId(String sourceResourceId) { - this.sourceResourceId = sourceResourceId; - return this; - } - - /** - * Get the sourceRegion property: Source Region. - * - * @return the sourceRegion value. - */ - public String sourceRegion() { - return this.sourceRegion; - } - - /** - * Set the sourceRegion property: Source Region. - * - * @param sourceRegion the sourceRegion value to set. - * @return the TriggerDataMoveRequest object itself. - */ - public TriggerDataMoveRequest withSourceRegion(String sourceRegion) { - this.sourceRegion = sourceRegion; - return this; - } - - /** - * Get the dataMoveLevel property: DataMove Level. - * - * @return the dataMoveLevel value. - */ - public DataMoveLevel dataMoveLevel() { - return this.dataMoveLevel; - } - - /** - * Set the dataMoveLevel property: DataMove Level. - * - * @param dataMoveLevel the dataMoveLevel value to set. - * @return the TriggerDataMoveRequest object itself. - */ - public TriggerDataMoveRequest withDataMoveLevel(DataMoveLevel dataMoveLevel) { - this.dataMoveLevel = dataMoveLevel; - return this; - } - - /** - * Get the correlationId property: Correlation Id. - * - * @return the correlationId value. - */ - public String correlationId() { - return this.correlationId; - } - - /** - * Set the correlationId property: Correlation Id. - * - * @param correlationId the correlationId value to set. - * @return the TriggerDataMoveRequest object itself. - */ - public TriggerDataMoveRequest withCorrelationId(String correlationId) { - this.correlationId = correlationId; - return this; - } - - /** - * Get the sourceContainerArmIds property: Source Container ArmIds. - * - * @return the sourceContainerArmIds value. - */ - public List sourceContainerArmIds() { - return this.sourceContainerArmIds; - } - - /** - * Set the sourceContainerArmIds property: Source Container ArmIds. - * - * @param sourceContainerArmIds the sourceContainerArmIds value to set. - * @return the TriggerDataMoveRequest object itself. - */ - public TriggerDataMoveRequest withSourceContainerArmIds(List sourceContainerArmIds) { - this.sourceContainerArmIds = sourceContainerArmIds; - return this; - } - - /** - * Get the pauseGC property: Pause GC. - * - * @return the pauseGC value. - */ - public Boolean pauseGC() { - return this.pauseGC; - } - - /** - * Set the pauseGC property: Pause GC. - * - * @param pauseGC the pauseGC value to set. - * @return the TriggerDataMoveRequest object itself. - */ - public TriggerDataMoveRequest withPauseGC(Boolean pauseGC) { - this.pauseGC = pauseGC; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("sourceResourceId", this.sourceResourceId); - jsonWriter.writeStringField("sourceRegion", this.sourceRegion); - jsonWriter.writeStringField("dataMoveLevel", this.dataMoveLevel == null ? null : this.dataMoveLevel.toString()); - jsonWriter.writeStringField("correlationId", this.correlationId); - jsonWriter.writeArrayField("sourceContainerArmIds", this.sourceContainerArmIds, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("pauseGC", this.pauseGC); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of TriggerDataMoveRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TriggerDataMoveRequest 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 TriggerDataMoveRequest. - */ - public static TriggerDataMoveRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - TriggerDataMoveRequest deserializedTriggerDataMoveRequest = new TriggerDataMoveRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sourceResourceId".equals(fieldName)) { - deserializedTriggerDataMoveRequest.sourceResourceId = reader.getString(); - } else if ("sourceRegion".equals(fieldName)) { - deserializedTriggerDataMoveRequest.sourceRegion = reader.getString(); - } else if ("dataMoveLevel".equals(fieldName)) { - deserializedTriggerDataMoveRequest.dataMoveLevel = DataMoveLevel.fromString(reader.getString()); - } else if ("correlationId".equals(fieldName)) { - deserializedTriggerDataMoveRequest.correlationId = reader.getString(); - } else if ("sourceContainerArmIds".equals(fieldName)) { - List sourceContainerArmIds = reader.readArray(reader1 -> reader1.getString()); - deserializedTriggerDataMoveRequest.sourceContainerArmIds = sourceContainerArmIds; - } else if ("pauseGC".equals(fieldName)) { - deserializedTriggerDataMoveRequest.pauseGC = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedTriggerDataMoveRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UnlockDeleteRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UnlockDeleteRequest.java deleted file mode 100644 index e6d3e850d11b..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UnlockDeleteRequest.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Request body of unlock delete API. - */ -@Fluent -public final class UnlockDeleteRequest implements JsonSerializable { - /* - * The resourceGuardOperationRequests property. - */ - private List resourceGuardOperationRequests; - - /* - * The resourceToBeDeleted property. - */ - private String resourceToBeDeleted; - - /** - * Creates an instance of UnlockDeleteRequest class. - */ - public UnlockDeleteRequest() { - } - - /** - * Get the resourceGuardOperationRequests property: The resourceGuardOperationRequests property. - * - * @return the resourceGuardOperationRequests value. - */ - public List resourceGuardOperationRequests() { - return this.resourceGuardOperationRequests; - } - - /** - * Set the resourceGuardOperationRequests property: The resourceGuardOperationRequests property. - * - * @param resourceGuardOperationRequests the resourceGuardOperationRequests value to set. - * @return the UnlockDeleteRequest object itself. - */ - public UnlockDeleteRequest withResourceGuardOperationRequests(List resourceGuardOperationRequests) { - this.resourceGuardOperationRequests = resourceGuardOperationRequests; - return this; - } - - /** - * Get the resourceToBeDeleted property: The resourceToBeDeleted property. - * - * @return the resourceToBeDeleted value. - */ - public String resourceToBeDeleted() { - return this.resourceToBeDeleted; - } - - /** - * Set the resourceToBeDeleted property: The resourceToBeDeleted property. - * - * @param resourceToBeDeleted the resourceToBeDeleted value to set. - * @return the UnlockDeleteRequest object itself. - */ - public UnlockDeleteRequest withResourceToBeDeleted(String resourceToBeDeleted) { - this.resourceToBeDeleted = resourceToBeDeleted; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("resourceGuardOperationRequests", this.resourceGuardOperationRequests, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("resourceToBeDeleted", this.resourceToBeDeleted); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of UnlockDeleteRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of UnlockDeleteRequest 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 UnlockDeleteRequest. - */ - public static UnlockDeleteRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - UnlockDeleteRequest deserializedUnlockDeleteRequest = new UnlockDeleteRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceGuardOperationRequests".equals(fieldName)) { - List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); - deserializedUnlockDeleteRequest.resourceGuardOperationRequests = resourceGuardOperationRequests; - } else if ("resourceToBeDeleted".equals(fieldName)) { - deserializedUnlockDeleteRequest.resourceToBeDeleted = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedUnlockDeleteRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UnlockDeleteResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UnlockDeleteResponse.java deleted file mode 100644 index 5517fe8e3045..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UnlockDeleteResponse.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.UnlockDeleteResponseInner; - -/** - * An immutable client-side representation of UnlockDeleteResponse. - */ -public interface UnlockDeleteResponse { - /** - * Gets the unlockDeleteExpiryTime property: This is the time when unlock delete privileges will get expired. - * - * @return the unlockDeleteExpiryTime value. - */ - String unlockDeleteExpiryTime(); - - /** - * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.UnlockDeleteResponseInner object. - * - * @return the inner object. - */ - UnlockDeleteResponseInner innerModel(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UpdateRecoveryPointRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UpdateRecoveryPointRequest.java deleted file mode 100644 index 5e2c62d542e2..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UpdateRecoveryPointRequest.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Patch Request content to update recovery point for given RecoveryPointId. - */ -@Fluent -public final class UpdateRecoveryPointRequest implements JsonSerializable { - /* - * Resource properties. - */ - private PatchRecoveryPointInput properties; - - /** - * Creates an instance of UpdateRecoveryPointRequest class. - */ - public UpdateRecoveryPointRequest() { - } - - /** - * Get the properties property: Resource properties. - * - * @return the properties value. - */ - public PatchRecoveryPointInput properties() { - return this.properties; - } - - /** - * Set the properties property: Resource properties. - * - * @param properties the properties value to set. - * @return the UpdateRecoveryPointRequest object itself. - */ - public UpdateRecoveryPointRequest withProperties(PatchRecoveryPointInput properties) { - this.properties = properties; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of UpdateRecoveryPointRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of UpdateRecoveryPointRequest 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 UpdateRecoveryPointRequest. - */ - public static UpdateRecoveryPointRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - UpdateRecoveryPointRequest deserializedUpdateRecoveryPointRequest = new UpdateRecoveryPointRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedUpdateRecoveryPointRequest.properties = PatchRecoveryPointInput.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedUpdateRecoveryPointRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UsagesUnit.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UsagesUnit.java deleted file mode 100644 index c913cb9ee29a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UsagesUnit.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Unit of the usage. - */ -public final class UsagesUnit extends ExpandableStringEnum { - /** - * Static value Count for UsagesUnit. - */ - public static final UsagesUnit COUNT = fromString("Count"); - - /** - * Static value Bytes for UsagesUnit. - */ - public static final UsagesUnit BYTES = fromString("Bytes"); - - /** - * Static value Seconds for UsagesUnit. - */ - public static final UsagesUnit SECONDS = fromString("Seconds"); - - /** - * Static value Percent for UsagesUnit. - */ - public static final UsagesUnit PERCENT = fromString("Percent"); - - /** - * Static value CountPerSecond for UsagesUnit. - */ - public static final UsagesUnit COUNT_PER_SECOND = fromString("CountPerSecond"); - - /** - * Static value BytesPerSecond for UsagesUnit. - */ - public static final UsagesUnit BYTES_PER_SECOND = fromString("BytesPerSecond"); - - /** - * Creates a new instance of UsagesUnit value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public UsagesUnit() { - } - - /** - * Creates or finds a UsagesUnit from its string representation. - * - * @param name a name to look for. - * @return the corresponding UsagesUnit. - */ - public static UsagesUnit fromString(String name) { - return fromString(name, UsagesUnit.class); - } - - /** - * Gets known UsagesUnit values. - * - * @return known UsagesUnit values. - */ - public static Collection values() { - return values(UsagesUnit.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UserAssignedIdentityProperties.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UserAssignedIdentityProperties.java deleted file mode 100644 index 1f54bb1545c0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UserAssignedIdentityProperties.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * User assigned managed identity properties. - */ -@Fluent -public final class UserAssignedIdentityProperties implements JsonSerializable { - /* - * The client ID of the assigned identity. - */ - private String clientId; - - /* - * The principal ID of the assigned identity. - */ - private String principalId; - - /** - * Creates an instance of UserAssignedIdentityProperties class. - */ - public UserAssignedIdentityProperties() { - } - - /** - * Get the clientId property: The client ID of the assigned identity. - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * Set the clientId property: The client ID of the assigned identity. - * - * @param clientId the clientId value to set. - * @return the UserAssignedIdentityProperties object itself. - */ - public UserAssignedIdentityProperties withClientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Get the principalId property: The principal ID of the assigned identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Set the principalId property: The principal ID of the assigned identity. - * - * @param principalId the principalId value to set. - * @return the UserAssignedIdentityProperties object itself. - */ - public UserAssignedIdentityProperties withPrincipalId(String principalId) { - this.principalId = principalId; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("clientId", this.clientId); - jsonWriter.writeStringField("principalId", this.principalId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of UserAssignedIdentityProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of UserAssignedIdentityProperties 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 UserAssignedIdentityProperties. - */ - public static UserAssignedIdentityProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - UserAssignedIdentityProperties deserializedUserAssignedIdentityProperties - = new UserAssignedIdentityProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("clientId".equals(fieldName)) { - deserializedUserAssignedIdentityProperties.clientId = reader.getString(); - } else if ("principalId".equals(fieldName)) { - deserializedUserAssignedIdentityProperties.principalId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedUserAssignedIdentityProperties; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UserAssignedManagedIdentityDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UserAssignedManagedIdentityDetails.java deleted file mode 100644 index b30e77b1e4fe..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/UserAssignedManagedIdentityDetails.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * User assigned managed identity details. - */ -@Fluent -public final class UserAssignedManagedIdentityDetails implements JsonSerializable { - /* - * The ARM id of the assigned identity. - */ - private String identityArmId; - - /* - * The name of the assigned identity. - */ - private String identityName; - - /* - * User assigned managed identity properties - */ - private UserAssignedIdentityProperties userAssignedIdentityProperties; - - /** - * Creates an instance of UserAssignedManagedIdentityDetails class. - */ - public UserAssignedManagedIdentityDetails() { - } - - /** - * Get the identityArmId property: The ARM id of the assigned identity. - * - * @return the identityArmId value. - */ - public String identityArmId() { - return this.identityArmId; - } - - /** - * Set the identityArmId property: The ARM id of the assigned identity. - * - * @param identityArmId the identityArmId value to set. - * @return the UserAssignedManagedIdentityDetails object itself. - */ - public UserAssignedManagedIdentityDetails withIdentityArmId(String identityArmId) { - this.identityArmId = identityArmId; - return this; - } - - /** - * Get the identityName property: The name of the assigned identity. - * - * @return the identityName value. - */ - public String identityName() { - return this.identityName; - } - - /** - * Set the identityName property: The name of the assigned identity. - * - * @param identityName the identityName value to set. - * @return the UserAssignedManagedIdentityDetails object itself. - */ - public UserAssignedManagedIdentityDetails withIdentityName(String identityName) { - this.identityName = identityName; - return this; - } - - /** - * Get the userAssignedIdentityProperties property: User assigned managed identity properties. - * - * @return the userAssignedIdentityProperties value. - */ - public UserAssignedIdentityProperties userAssignedIdentityProperties() { - return this.userAssignedIdentityProperties; - } - - /** - * Set the userAssignedIdentityProperties property: User assigned managed identity properties. - * - * @param userAssignedIdentityProperties the userAssignedIdentityProperties value to set. - * @return the UserAssignedManagedIdentityDetails object itself. - */ - public UserAssignedManagedIdentityDetails - withUserAssignedIdentityProperties(UserAssignedIdentityProperties userAssignedIdentityProperties) { - this.userAssignedIdentityProperties = userAssignedIdentityProperties; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("identityArmId", this.identityArmId); - jsonWriter.writeStringField("identityName", this.identityName); - jsonWriter.writeJsonField("userAssignedIdentityProperties", this.userAssignedIdentityProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of UserAssignedManagedIdentityDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of UserAssignedManagedIdentityDetails 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 UserAssignedManagedIdentityDetails. - */ - public static UserAssignedManagedIdentityDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - UserAssignedManagedIdentityDetails deserializedUserAssignedManagedIdentityDetails - = new UserAssignedManagedIdentityDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("identityArmId".equals(fieldName)) { - deserializedUserAssignedManagedIdentityDetails.identityArmId = reader.getString(); - } else if ("identityName".equals(fieldName)) { - deserializedUserAssignedManagedIdentityDetails.identityName = reader.getString(); - } else if ("userAssignedIdentityProperties".equals(fieldName)) { - deserializedUserAssignedManagedIdentityDetails.userAssignedIdentityProperties - = UserAssignedIdentityProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedUserAssignedManagedIdentityDetails; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VMWorkloadPolicyType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VMWorkloadPolicyType.java deleted file mode 100644 index 4e9ecbc30c66..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VMWorkloadPolicyType.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Type of the protection policy. - */ -public final class VMWorkloadPolicyType extends ExpandableStringEnum { - /** - * Invalid policy type. - */ - public static final VMWorkloadPolicyType INVALID = fromString("Invalid"); - - /** - * Snapshot V1 policy type. - */ - public static final VMWorkloadPolicyType SNAPSHOT_V1 = fromString("SnapshotV1"); - - /** - * Snapshot V2 policy type. - */ - public static final VMWorkloadPolicyType SNAPSHOT_V2 = fromString("SnapshotV2"); - - /** - * Streaming policy type. - */ - public static final VMWorkloadPolicyType STREAMING = fromString("Streaming"); - - /** - * Creates a new instance of VMWorkloadPolicyType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public VMWorkloadPolicyType() { - } - - /** - * Creates or finds a VMWorkloadPolicyType from its string representation. - * - * @param name a name to look for. - * @return the corresponding VMWorkloadPolicyType. - */ - public static VMWorkloadPolicyType fromString(String name) { - return fromString(name, VMWorkloadPolicyType.class); - } - - /** - * Gets known VMWorkloadPolicyType values. - * - * @return known VMWorkloadPolicyType values. - */ - public static Collection values() { - return values(VMWorkloadPolicyType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateIaasVMRestoreOperationRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateIaasVMRestoreOperationRequest.java deleted file mode 100644 index 9b899a7de6a2..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateIaasVMRestoreOperationRequest.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * AzureRestoreValidation request. - */ -@Fluent -public final class ValidateIaasVMRestoreOperationRequest extends ValidateRestoreOperationRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "ValidateIaasVMRestoreOperationRequest"; - - /** - * Creates an instance of ValidateIaasVMRestoreOperationRequest class. - */ - public ValidateIaasVMRestoreOperationRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * {@inheritDoc} - */ - @Override - public ValidateIaasVMRestoreOperationRequest withRestoreRequest(RestoreRequest restoreRequest) { - super.withRestoreRequest(restoreRequest); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("restoreRequest", restoreRequest()); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ValidateIaasVMRestoreOperationRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ValidateIaasVMRestoreOperationRequest 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 ValidateIaasVMRestoreOperationRequest. - */ - public static ValidateIaasVMRestoreOperationRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ValidateIaasVMRestoreOperationRequest deserializedValidateIaasVMRestoreOperationRequest - = new ValidateIaasVMRestoreOperationRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("restoreRequest".equals(fieldName)) { - deserializedValidateIaasVMRestoreOperationRequest - .withRestoreRequest(RestoreRequest.fromJson(reader)); - } else if ("objectType".equals(fieldName)) { - deserializedValidateIaasVMRestoreOperationRequest.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedValidateIaasVMRestoreOperationRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationRequest.java deleted file mode 100644 index aa6f8b3a50f3..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationRequest.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Base class for validate operation request. - */ -@Immutable -public class ValidateOperationRequest implements JsonSerializable { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "ValidateOperationRequest"; - - /** - * Creates an instance of ValidateOperationRequest class. - */ - public ValidateOperationRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - public String objectType() { - return this.objectType; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ValidateOperationRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ValidateOperationRequest 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 ValidateOperationRequest. - */ - public static ValidateOperationRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("ValidateRestoreOperationRequest".equals(discriminatorValue)) { - return ValidateRestoreOperationRequest.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("ValidateIaasVMRestoreOperationRequest".equals(discriminatorValue)) { - return ValidateIaasVMRestoreOperationRequest.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static ValidateOperationRequest fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ValidateOperationRequest deserializedValidateOperationRequest = new ValidateOperationRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedValidateOperationRequest.objectType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedValidateOperationRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationRequestResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationRequestResource.java deleted file mode 100644 index 64151f2b2d65..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationRequestResource.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Base class for validate operation request. - */ -@Fluent -public final class ValidateOperationRequestResource implements JsonSerializable { - /* - * Recovery point ID. - */ - private String id; - - /* - * ValidateOperationRequestResource properties - */ - private ValidateOperationRequest properties; - - /** - * Creates an instance of ValidateOperationRequestResource class. - */ - public ValidateOperationRequestResource() { - } - - /** - * Get the id property: Recovery point ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Recovery point ID. - * - * @param id the id value to set. - * @return the ValidateOperationRequestResource object itself. - */ - public ValidateOperationRequestResource withId(String id) { - this.id = id; - return this; - } - - /** - * Get the properties property: ValidateOperationRequestResource properties. - * - * @return the properties value. - */ - public ValidateOperationRequest properties() { - return this.properties; - } - - /** - * Set the properties property: ValidateOperationRequestResource properties. - * - * @param properties the properties value to set. - * @return the ValidateOperationRequestResource object itself. - */ - public ValidateOperationRequestResource withProperties(ValidateOperationRequest properties) { - this.properties = properties; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ValidateOperationRequestResource from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ValidateOperationRequestResource 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 ValidateOperationRequestResource. - */ - public static ValidateOperationRequestResource fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ValidateOperationRequestResource deserializedValidateOperationRequestResource - = new ValidateOperationRequestResource(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedValidateOperationRequestResource.id = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedValidateOperationRequestResource.properties = ValidateOperationRequest.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedValidateOperationRequestResource; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationResponse.java deleted file mode 100644 index 8aa6bbefccad..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationResponse.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Base class for validate operation response. - */ -@Immutable -public final class ValidateOperationResponse implements JsonSerializable { - /* - * Gets the validation result - */ - private List validationResults; - - /** - * Creates an instance of ValidateOperationResponse class. - */ - private ValidateOperationResponse() { - } - - /** - * Get the validationResults property: Gets the validation result. - * - * @return the validationResults value. - */ - public List validationResults() { - return this.validationResults; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("validationResults", this.validationResults, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ValidateOperationResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ValidateOperationResponse 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 ValidateOperationResponse. - */ - public static ValidateOperationResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ValidateOperationResponse deserializedValidateOperationResponse = new ValidateOperationResponse(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("validationResults".equals(fieldName)) { - List validationResults = reader.readArray(reader1 -> ErrorDetail.fromJson(reader1)); - deserializedValidateOperationResponse.validationResults = validationResults; - } else { - reader.skipChildren(); - } - } - - return deserializedValidateOperationResponse; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationResults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationResults.java deleted file mode 100644 index b583d70cced5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationResults.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ValidateOperationResults. - */ -public interface ValidateOperationResults { - /** - * Fetches the result of a triggered validate operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation whose result needs to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, String operationId, - Context context); - - /** - * Fetches the result of a triggered validate operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID which represents the operation whose result needs to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - ValidateOperationsResponse get(String vaultName, String resourceGroupName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationStatuses.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationStatuses.java deleted file mode 100644 index 03f7ae186b87..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationStatuses.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ValidateOperationStatuses. - */ -public interface ValidateOperationStatuses { - /** - * Fetches the status of a triggered validate operation. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. - * If operation has completed, this method returns the list of errors obtained while validating the operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID represents the operation whose status needs to be fetched. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status along with {@link Response}. - */ - Response getWithResponse(String vaultName, String resourceGroupName, String operationId, - Context context); - - /** - * Fetches the status of a triggered validate operation. The status can be in progress, completed - * or failed. You can refer to the OperationStatus enum for all the possible states of the operation. - * If operation has completed, this method returns the list of errors obtained while validating the operation. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param operationId OperationID represents the operation whose status needs to be fetched. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return operation status. - */ - OperationStatus get(String vaultName, String resourceGroupName, String operationId); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperations.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperations.java deleted file mode 100644 index d5bb6f64d41c..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperations.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.Context; - -/** - * Resource collection API of ValidateOperations. - */ -public interface ValidateOperations { - /** - * Validate operation for specified backed up item in the form of an asynchronous operation. Returns tracking - * headers which can be tracked using GetValidateOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void trigger(String vaultName, String resourceGroupName, ValidateOperationRequestResource parameters); - - /** - * Validate operation for specified backed up item in the form of an asynchronous operation. Returns tracking - * headers which can be tracked using GetValidateOperationResult API. - * - * @param vaultName The name of the recovery services vault. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param parameters resource validate operation request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void trigger(String vaultName, String resourceGroupName, ValidateOperationRequestResource parameters, - Context context); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationsResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationsResponse.java deleted file mode 100644 index ee7957ef4f68..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationsResponse.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; - -/** - * An immutable client-side representation of ValidateOperationsResponse. - */ -public interface ValidateOperationsResponse { - /** - * Gets the validateOperationResponse property: Base class for validate operation response. - * - * @return the validateOperationResponse value. - */ - ValidateOperationResponse validateOperationResponse(); - - /** - * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner - * object. - * - * @return the inner object. - */ - ValidateOperationsResponseInner innerModel(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateRestoreOperationRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateRestoreOperationRequest.java deleted file mode 100644 index bcf8edc726b3..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateRestoreOperationRequest.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * AzureRestoreValidation request. - */ -@Fluent -public class ValidateRestoreOperationRequest extends ValidateOperationRequest { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String objectType = "ValidateRestoreOperationRequest"; - - /* - * Sets restore request to be validated - */ - private RestoreRequest restoreRequest; - - /** - * Creates an instance of ValidateRestoreOperationRequest class. - */ - public ValidateRestoreOperationRequest() { - } - - /** - * Get the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - @Override - public String objectType() { - return this.objectType; - } - - /** - * Get the restoreRequest property: Sets restore request to be validated. - * - * @return the restoreRequest value. - */ - public RestoreRequest restoreRequest() { - return this.restoreRequest; - } - - /** - * Set the restoreRequest property: Sets restore request to be validated. - * - * @param restoreRequest the restoreRequest value to set. - * @return the ValidateRestoreOperationRequest object itself. - */ - public ValidateRestoreOperationRequest withRestoreRequest(RestoreRequest restoreRequest) { - this.restoreRequest = restoreRequest; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("objectType", this.objectType); - jsonWriter.writeJsonField("restoreRequest", this.restoreRequest); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ValidateRestoreOperationRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ValidateRestoreOperationRequest 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 ValidateRestoreOperationRequest. - */ - public static ValidateRestoreOperationRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("objectType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("ValidateIaasVMRestoreOperationRequest".equals(discriminatorValue)) { - return ValidateIaasVMRestoreOperationRequest.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static ValidateRestoreOperationRequest fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ValidateRestoreOperationRequest deserializedValidateRestoreOperationRequest - = new ValidateRestoreOperationRequest(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("objectType".equals(fieldName)) { - deserializedValidateRestoreOperationRequest.objectType = reader.getString(); - } else if ("restoreRequest".equals(fieldName)) { - deserializedValidateRestoreOperationRequest.restoreRequest = RestoreRequest.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedValidateRestoreOperationRequest; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidationStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidationStatus.java deleted file mode 100644 index cab611793dc8..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidationStatus.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Validation Status. - */ -public final class ValidationStatus extends ExpandableStringEnum { - /** - * Static value Invalid for ValidationStatus. - */ - public static final ValidationStatus INVALID = fromString("Invalid"); - - /** - * Static value Succeeded for ValidationStatus. - */ - public static final ValidationStatus SUCCEEDED = fromString("Succeeded"); - - /** - * Static value Failed for ValidationStatus. - */ - public static final ValidationStatus FAILED = fromString("Failed"); - - /** - * Creates a new instance of ValidationStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ValidationStatus() { - } - - /** - * Creates or finds a ValidationStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding ValidationStatus. - */ - public static ValidationStatus fromString(String name) { - return fromString(name, ValidationStatus.class); - } - - /** - * Gets known ValidationStatus values. - * - * @return known ValidationStatus values. - */ - public static Collection values() { - return values(ValidationStatus.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJob.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJob.java deleted file mode 100644 index 09c1b4b7887a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJob.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.Duration; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Vault level Job. - */ -@Immutable -public final class VaultJob extends Job { - /* - * This property will be used as the discriminator for deciding the specific types in the polymorphic chain of - * types. - */ - private String jobType = "VaultJob"; - - /* - * Time elapsed during the execution of this job. - */ - private Duration duration; - - /* - * Gets or sets the state/actions applicable on this job like cancel/retry. - */ - private List actionsInfo; - - /* - * Error details on execution of this job. - */ - private List errorDetails; - - /* - * Additional information about the job. - */ - private VaultJobExtendedInfo extendedInfo; - - /** - * Creates an instance of VaultJob class. - */ - private VaultJob() { - } - - /** - * Get the jobType property: This property will be used as the discriminator for deciding the specific types in the - * polymorphic chain of types. - * - * @return the jobType value. - */ - @Override - public String jobType() { - return this.jobType; - } - - /** - * Get the duration property: Time elapsed during the execution of this job. - * - * @return the duration value. - */ - public Duration duration() { - return this.duration; - } - - /** - * Get the actionsInfo property: Gets or sets the state/actions applicable on this job like cancel/retry. - * - * @return the actionsInfo value. - */ - public List actionsInfo() { - return this.actionsInfo; - } - - /** - * Get the errorDetails property: Error details on execution of this job. - * - * @return the errorDetails value. - */ - public List errorDetails() { - return this.errorDetails; - } - - /** - * Get the extendedInfo property: Additional information about the job. - * - * @return the extendedInfo value. - */ - public VaultJobExtendedInfo extendedInfo() { - return this.extendedInfo; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("entityFriendlyName", entityFriendlyName()); - jsonWriter.writeStringField("backupManagementType", - backupManagementType() == null ? null : backupManagementType().toString()); - jsonWriter.writeStringField("operation", operation()); - jsonWriter.writeStringField("status", status()); - jsonWriter.writeStringField("startTime", - startTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(startTime())); - jsonWriter.writeStringField("endTime", - endTime() == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(endTime())); - jsonWriter.writeStringField("activityId", activityId()); - jsonWriter.writeStringField("jobType", this.jobType); - jsonWriter.writeStringField("duration", CoreUtils.durationToStringWithDays(this.duration)); - jsonWriter.writeArrayField("actionsInfo", this.actionsInfo, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("errorDetails", this.errorDetails, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("extendedInfo", this.extendedInfo); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of VaultJob from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of VaultJob 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 VaultJob. - */ - public static VaultJob fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - VaultJob deserializedVaultJob = new VaultJob(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("entityFriendlyName".equals(fieldName)) { - deserializedVaultJob.withEntityFriendlyName(reader.getString()); - } else if ("backupManagementType".equals(fieldName)) { - deserializedVaultJob.withBackupManagementType(BackupManagementType.fromString(reader.getString())); - } else if ("operation".equals(fieldName)) { - deserializedVaultJob.withOperation(reader.getString()); - } else if ("status".equals(fieldName)) { - deserializedVaultJob.withStatus(reader.getString()); - } else if ("startTime".equals(fieldName)) { - deserializedVaultJob.withStartTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("endTime".equals(fieldName)) { - deserializedVaultJob.withEndTime(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("activityId".equals(fieldName)) { - deserializedVaultJob.withActivityId(reader.getString()); - } else if ("jobType".equals(fieldName)) { - deserializedVaultJob.jobType = reader.getString(); - } else if ("duration".equals(fieldName)) { - deserializedVaultJob.duration - = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); - } else if ("actionsInfo".equals(fieldName)) { - List actionsInfo - = reader.readArray(reader1 -> JobSupportedAction.fromString(reader1.getString())); - deserializedVaultJob.actionsInfo = actionsInfo; - } else if ("errorDetails".equals(fieldName)) { - List errorDetails - = reader.readArray(reader1 -> VaultJobErrorInfo.fromJson(reader1)); - deserializedVaultJob.errorDetails = errorDetails; - } else if ("extendedInfo".equals(fieldName)) { - deserializedVaultJob.extendedInfo = VaultJobExtendedInfo.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedVaultJob; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJobErrorInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJobErrorInfo.java deleted file mode 100644 index 99cf513a4fb2..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJobErrorInfo.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Vault Job specific error information. - */ -@Immutable -public final class VaultJobErrorInfo implements JsonSerializable { - /* - * Error code. - */ - private Integer errorCode; - - /* - * Localized error string. - */ - private String errorString; - - /* - * List of localized recommendations for above error code. - */ - private List recommendations; - - /** - * Creates an instance of VaultJobErrorInfo class. - */ - private VaultJobErrorInfo() { - } - - /** - * Get the errorCode property: Error code. - * - * @return the errorCode value. - */ - public Integer errorCode() { - return this.errorCode; - } - - /** - * Get the errorString property: Localized error string. - * - * @return the errorString value. - */ - public String errorString() { - return this.errorString; - } - - /** - * Get the recommendations property: List of localized recommendations for above error code. - * - * @return the recommendations value. - */ - public List recommendations() { - return this.recommendations; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("errorCode", this.errorCode); - jsonWriter.writeStringField("errorString", this.errorString); - jsonWriter.writeArrayField("recommendations", this.recommendations, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of VaultJobErrorInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of VaultJobErrorInfo 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 VaultJobErrorInfo. - */ - public static VaultJobErrorInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - VaultJobErrorInfo deserializedVaultJobErrorInfo = new VaultJobErrorInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("errorCode".equals(fieldName)) { - deserializedVaultJobErrorInfo.errorCode = reader.getNullable(JsonReader::getInt); - } else if ("errorString".equals(fieldName)) { - deserializedVaultJobErrorInfo.errorString = reader.getString(); - } else if ("recommendations".equals(fieldName)) { - List recommendations = reader.readArray(reader1 -> reader1.getString()); - deserializedVaultJobErrorInfo.recommendations = recommendations; - } else { - reader.skipChildren(); - } - } - - return deserializedVaultJobErrorInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJobExtendedInfo.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJobExtendedInfo.java deleted file mode 100644 index 9f8950384252..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultJobExtendedInfo.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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.Map; - -/** - * Vault Job for CMK - has CMK specific info. - */ -@Immutable -public final class VaultJobExtendedInfo implements JsonSerializable { - /* - * Job properties. - */ - private Map propertyBag; - - /** - * Creates an instance of VaultJobExtendedInfo class. - */ - private VaultJobExtendedInfo() { - } - - /** - * Get the propertyBag property: Job properties. - * - * @return the propertyBag value. - */ - public Map propertyBag() { - return this.propertyBag; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeMapField("propertyBag", this.propertyBag, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of VaultJobExtendedInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of VaultJobExtendedInfo 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 VaultJobExtendedInfo. - */ - public static VaultJobExtendedInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - VaultJobExtendedInfo deserializedVaultJobExtendedInfo = new VaultJobExtendedInfo(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("propertyBag".equals(fieldName)) { - Map propertyBag = reader.readMap(reader1 -> reader1.getString()); - deserializedVaultJobExtendedInfo.propertyBag = propertyBag; - } else { - reader.skipChildren(); - } - } - - return deserializedVaultJobExtendedInfo; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultRetentionPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultRetentionPolicy.java deleted file mode 100644 index af8e870712d2..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultRetentionPolicy.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Vault retention policy for AzureFileShare. - */ -@Fluent -public final class VaultRetentionPolicy implements JsonSerializable { - /* - * Base class for retention policy. - */ - private RetentionPolicy vaultRetention; - - /* - * The snapshotRetentionInDays property. - */ - private int snapshotRetentionInDays; - - /** - * Creates an instance of VaultRetentionPolicy class. - */ - public VaultRetentionPolicy() { - } - - /** - * Get the vaultRetention property: Base class for retention policy. - * - * @return the vaultRetention value. - */ - public RetentionPolicy vaultRetention() { - return this.vaultRetention; - } - - /** - * Set the vaultRetention property: Base class for retention policy. - * - * @param vaultRetention the vaultRetention value to set. - * @return the VaultRetentionPolicy object itself. - */ - public VaultRetentionPolicy withVaultRetention(RetentionPolicy vaultRetention) { - this.vaultRetention = vaultRetention; - return this; - } - - /** - * Get the snapshotRetentionInDays property: The snapshotRetentionInDays property. - * - * @return the snapshotRetentionInDays value. - */ - public int snapshotRetentionInDays() { - return this.snapshotRetentionInDays; - } - - /** - * Set the snapshotRetentionInDays property: The snapshotRetentionInDays property. - * - * @param snapshotRetentionInDays the snapshotRetentionInDays value to set. - * @return the VaultRetentionPolicy object itself. - */ - public VaultRetentionPolicy withSnapshotRetentionInDays(int snapshotRetentionInDays) { - this.snapshotRetentionInDays = snapshotRetentionInDays; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("vaultRetention", this.vaultRetention); - jsonWriter.writeIntField("snapshotRetentionInDays", this.snapshotRetentionInDays); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of VaultRetentionPolicy from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of VaultRetentionPolicy 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 VaultRetentionPolicy. - */ - public static VaultRetentionPolicy fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - VaultRetentionPolicy deserializedVaultRetentionPolicy = new VaultRetentionPolicy(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("vaultRetention".equals(fieldName)) { - deserializedVaultRetentionPolicy.vaultRetention = RetentionPolicy.fromJson(reader); - } else if ("snapshotRetentionInDays".equals(fieldName)) { - deserializedVaultRetentionPolicy.snapshotRetentionInDays = reader.getInt(); - } else { - reader.skipChildren(); - } - } - - return deserializedVaultRetentionPolicy; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultStorageConfigOperationResultResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultStorageConfigOperationResultResponse.java deleted file mode 100644 index 740f72c85937..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultStorageConfigOperationResultResponse.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.VaultStorageConfigOperationResultResponseInner; - -/** - * An immutable client-side representation of VaultStorageConfigOperationResultResponse. - */ -public interface VaultStorageConfigOperationResultResponse { - /** - * Gets the objectType property: This property will be used as the discriminator for deciding the specific types in - * the polymorphic chain of types. - * - * @return the objectType value. - */ - String objectType(); - - /** - * Gets the inner - * com.azure.resourcemanager.recoveryservicesbackup.fluent.models.VaultStorageConfigOperationResultResponseInner - * object. - * - * @return the inner object. - */ - VaultStorageConfigOperationResultResponseInner innerModel(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultSubResourceType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultSubResourceType.java deleted file mode 100644 index d6386a967fd5..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultSubResourceType.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * GroupId for the PrivateEndpointConnection - AzureBackup, AzureBackup_secondary or AzureSiteRecovery. - */ -public final class VaultSubResourceType extends ExpandableStringEnum { - /** - * Static value AzureBackup for VaultSubResourceType. - */ - public static final VaultSubResourceType AZURE_BACKUP = fromString("AzureBackup"); - - /** - * Static value AzureBackup_secondary for VaultSubResourceType. - */ - public static final VaultSubResourceType AZURE_BACKUP_SECONDARY = fromString("AzureBackup_secondary"); - - /** - * Static value AzureSiteRecovery for VaultSubResourceType. - */ - public static final VaultSubResourceType AZURE_SITE_RECOVERY = fromString("AzureSiteRecovery"); - - /** - * Creates a new instance of VaultSubResourceType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public VaultSubResourceType() { - } - - /** - * Creates or finds a VaultSubResourceType from its string representation. - * - * @param name a name to look for. - * @return the corresponding VaultSubResourceType. - */ - public static VaultSubResourceType fromString(String name) { - return fromString(name, VaultSubResourceType.class); - } - - /** - * Gets known VaultSubResourceType values. - * - * @return known VaultSubResourceType values. - */ - public static Collection values() { - return values(VaultSubResourceType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeekOfMonth.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeekOfMonth.java deleted file mode 100644 index 185dcc778602..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeekOfMonth.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -/** - * Defines values for WeekOfMonth. - */ -public enum WeekOfMonth { - /** - * Enum value First. - */ - FIRST("First"), - - /** - * Enum value Second. - */ - SECOND("Second"), - - /** - * Enum value Third. - */ - THIRD("Third"), - - /** - * Enum value Fourth. - */ - FOURTH("Fourth"), - - /** - * Enum value Last. - */ - LAST("Last"), - - /** - * Enum value Invalid. - */ - INVALID("Invalid"); - - /** - * The actual serialized value for a WeekOfMonth instance. - */ - private final String value; - - WeekOfMonth(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a WeekOfMonth instance. - * - * @param value the serialized value to parse. - * @return the parsed WeekOfMonth object, or null if unable to parse. - */ - public static WeekOfMonth fromString(String value) { - if (value == null) { - return null; - } - WeekOfMonth[] items = WeekOfMonth.values(); - for (WeekOfMonth item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeeklyRetentionFormat.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeeklyRetentionFormat.java deleted file mode 100644 index 4085a40e500d..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeeklyRetentionFormat.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Weekly retention format. - */ -@Fluent -public final class WeeklyRetentionFormat implements JsonSerializable { - /* - * List of days of the week. - */ - private List daysOfTheWeek; - - /* - * List of weeks of month. - */ - private List weeksOfTheMonth; - - /** - * Creates an instance of WeeklyRetentionFormat class. - */ - public WeeklyRetentionFormat() { - } - - /** - * Get the daysOfTheWeek property: List of days of the week. - * - * @return the daysOfTheWeek value. - */ - public List daysOfTheWeek() { - return this.daysOfTheWeek; - } - - /** - * Set the daysOfTheWeek property: List of days of the week. - * - * @param daysOfTheWeek the daysOfTheWeek value to set. - * @return the WeeklyRetentionFormat object itself. - */ - public WeeklyRetentionFormat withDaysOfTheWeek(List daysOfTheWeek) { - this.daysOfTheWeek = daysOfTheWeek; - return this; - } - - /** - * Get the weeksOfTheMonth property: List of weeks of month. - * - * @return the weeksOfTheMonth value. - */ - public List weeksOfTheMonth() { - return this.weeksOfTheMonth; - } - - /** - * Set the weeksOfTheMonth property: List of weeks of month. - * - * @param weeksOfTheMonth the weeksOfTheMonth value to set. - * @return the WeeklyRetentionFormat object itself. - */ - public WeeklyRetentionFormat withWeeksOfTheMonth(List weeksOfTheMonth) { - this.weeksOfTheMonth = weeksOfTheMonth; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("daysOfTheWeek", this.daysOfTheWeek, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("weeksOfTheMonth", this.weeksOfTheMonth, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WeeklyRetentionFormat from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WeeklyRetentionFormat 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 WeeklyRetentionFormat. - */ - public static WeeklyRetentionFormat fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WeeklyRetentionFormat deserializedWeeklyRetentionFormat = new WeeklyRetentionFormat(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("daysOfTheWeek".equals(fieldName)) { - List daysOfTheWeek - = reader.readArray(reader1 -> DayOfWeek.fromString(reader1.getString())); - deserializedWeeklyRetentionFormat.daysOfTheWeek = daysOfTheWeek; - } else if ("weeksOfTheMonth".equals(fieldName)) { - List weeksOfTheMonth - = reader.readArray(reader1 -> WeekOfMonth.fromString(reader1.getString())); - deserializedWeeklyRetentionFormat.weeksOfTheMonth = weeksOfTheMonth; - } else { - reader.skipChildren(); - } - } - - return deserializedWeeklyRetentionFormat; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeeklyRetentionSchedule.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeeklyRetentionSchedule.java deleted file mode 100644 index 943720e371c7..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeeklyRetentionSchedule.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Weekly retention schedule. - */ -@Fluent -public final class WeeklyRetentionSchedule implements JsonSerializable { - /* - * List of days of week for weekly retention policy. - */ - private List daysOfTheWeek; - - /* - * Retention times of retention policy. - */ - private List retentionTimes; - - /* - * Retention duration of retention Policy. - */ - private RetentionDuration retentionDuration; - - /** - * Creates an instance of WeeklyRetentionSchedule class. - */ - public WeeklyRetentionSchedule() { - } - - /** - * Get the daysOfTheWeek property: List of days of week for weekly retention policy. - * - * @return the daysOfTheWeek value. - */ - public List daysOfTheWeek() { - return this.daysOfTheWeek; - } - - /** - * Set the daysOfTheWeek property: List of days of week for weekly retention policy. - * - * @param daysOfTheWeek the daysOfTheWeek value to set. - * @return the WeeklyRetentionSchedule object itself. - */ - public WeeklyRetentionSchedule withDaysOfTheWeek(List daysOfTheWeek) { - this.daysOfTheWeek = daysOfTheWeek; - return this; - } - - /** - * Get the retentionTimes property: Retention times of retention policy. - * - * @return the retentionTimes value. - */ - public List retentionTimes() { - return this.retentionTimes; - } - - /** - * Set the retentionTimes property: Retention times of retention policy. - * - * @param retentionTimes the retentionTimes value to set. - * @return the WeeklyRetentionSchedule object itself. - */ - public WeeklyRetentionSchedule withRetentionTimes(List retentionTimes) { - this.retentionTimes = retentionTimes; - return this; - } - - /** - * Get the retentionDuration property: Retention duration of retention Policy. - * - * @return the retentionDuration value. - */ - public RetentionDuration retentionDuration() { - return this.retentionDuration; - } - - /** - * Set the retentionDuration property: Retention duration of retention Policy. - * - * @param retentionDuration the retentionDuration value to set. - * @return the WeeklyRetentionSchedule object itself. - */ - public WeeklyRetentionSchedule withRetentionDuration(RetentionDuration retentionDuration) { - this.retentionDuration = retentionDuration; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("daysOfTheWeek", this.daysOfTheWeek, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("retentionTimes", this.retentionTimes, (writer, element) -> writer - .writeString(element == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(element))); - jsonWriter.writeJsonField("retentionDuration", this.retentionDuration); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WeeklyRetentionSchedule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WeeklyRetentionSchedule 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 WeeklyRetentionSchedule. - */ - public static WeeklyRetentionSchedule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WeeklyRetentionSchedule deserializedWeeklyRetentionSchedule = new WeeklyRetentionSchedule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("daysOfTheWeek".equals(fieldName)) { - List daysOfTheWeek - = reader.readArray(reader1 -> DayOfWeek.fromString(reader1.getString())); - deserializedWeeklyRetentionSchedule.daysOfTheWeek = daysOfTheWeek; - } else if ("retentionTimes".equals(fieldName)) { - List retentionTimes = reader.readArray(reader1 -> reader1 - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - deserializedWeeklyRetentionSchedule.retentionTimes = retentionTimes; - } else if ("retentionDuration".equals(fieldName)) { - deserializedWeeklyRetentionSchedule.retentionDuration = RetentionDuration.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedWeeklyRetentionSchedule; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeeklySchedule.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeeklySchedule.java deleted file mode 100644 index c6cde207bafe..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WeeklySchedule.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * The WeeklySchedule model. - */ -@Fluent -public final class WeeklySchedule implements JsonSerializable { - /* - * The scheduleRunDays property. - */ - private List scheduleRunDays; - - /* - * List of times of day this schedule has to be run. - */ - private List scheduleRunTimes; - - /** - * Creates an instance of WeeklySchedule class. - */ - public WeeklySchedule() { - } - - /** - * Get the scheduleRunDays property: The scheduleRunDays property. - * - * @return the scheduleRunDays value. - */ - public List scheduleRunDays() { - return this.scheduleRunDays; - } - - /** - * Set the scheduleRunDays property: The scheduleRunDays property. - * - * @param scheduleRunDays the scheduleRunDays value to set. - * @return the WeeklySchedule object itself. - */ - public WeeklySchedule withScheduleRunDays(List scheduleRunDays) { - this.scheduleRunDays = scheduleRunDays; - return this; - } - - /** - * Get the scheduleRunTimes property: List of times of day this schedule has to be run. - * - * @return the scheduleRunTimes value. - */ - public List scheduleRunTimes() { - return this.scheduleRunTimes; - } - - /** - * Set the scheduleRunTimes property: List of times of day this schedule has to be run. - * - * @param scheduleRunTimes the scheduleRunTimes value to set. - * @return the WeeklySchedule object itself. - */ - public WeeklySchedule withScheduleRunTimes(List scheduleRunTimes) { - this.scheduleRunTimes = scheduleRunTimes; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("scheduleRunDays", this.scheduleRunDays, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("scheduleRunTimes", this.scheduleRunTimes, (writer, element) -> writer - .writeString(element == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(element))); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WeeklySchedule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WeeklySchedule 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 WeeklySchedule. - */ - public static WeeklySchedule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WeeklySchedule deserializedWeeklySchedule = new WeeklySchedule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("scheduleRunDays".equals(fieldName)) { - List scheduleRunDays - = reader.readArray(reader1 -> DayOfWeek.fromString(reader1.getString())); - deserializedWeeklySchedule.scheduleRunDays = scheduleRunDays; - } else if ("scheduleRunTimes".equals(fieldName)) { - List scheduleRunTimes = reader.readArray(reader1 -> reader1 - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - deserializedWeeklySchedule.scheduleRunTimes = scheduleRunTimes; - } else { - reader.skipChildren(); - } - } - - return deserializedWeeklySchedule; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadInquiryDetails.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadInquiryDetails.java deleted file mode 100644 index ed8ca9cfced0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadInquiryDetails.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Details of an inquired protectable item. - */ -@Fluent -public final class WorkloadInquiryDetails implements JsonSerializable { - /* - * Type of the Workload such as SQL, Oracle etc. - */ - private String type; - - /* - * Contains the protectable item Count inside this Container. - */ - private Long itemCount; - - /* - * Inquiry validation such as permissions and other backup validations. - */ - private InquiryValidation inquiryValidation; - - /** - * Creates an instance of WorkloadInquiryDetails class. - */ - public WorkloadInquiryDetails() { - } - - /** - * Get the type property: Type of the Workload such as SQL, Oracle etc. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type of the Workload such as SQL, Oracle etc. - * - * @param type the type value to set. - * @return the WorkloadInquiryDetails object itself. - */ - public WorkloadInquiryDetails withType(String type) { - this.type = type; - return this; - } - - /** - * Get the itemCount property: Contains the protectable item Count inside this Container. - * - * @return the itemCount value. - */ - public Long itemCount() { - return this.itemCount; - } - - /** - * Set the itemCount property: Contains the protectable item Count inside this Container. - * - * @param itemCount the itemCount value to set. - * @return the WorkloadInquiryDetails object itself. - */ - public WorkloadInquiryDetails withItemCount(Long itemCount) { - this.itemCount = itemCount; - return this; - } - - /** - * Get the inquiryValidation property: Inquiry validation such as permissions and other backup validations. - * - * @return the inquiryValidation value. - */ - public InquiryValidation inquiryValidation() { - return this.inquiryValidation; - } - - /** - * Set the inquiryValidation property: Inquiry validation such as permissions and other backup validations. - * - * @param inquiryValidation the inquiryValidation value to set. - * @return the WorkloadInquiryDetails object itself. - */ - public WorkloadInquiryDetails withInquiryValidation(InquiryValidation inquiryValidation) { - this.inquiryValidation = inquiryValidation; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type); - jsonWriter.writeNumberField("itemCount", this.itemCount); - jsonWriter.writeJsonField("inquiryValidation", this.inquiryValidation); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WorkloadInquiryDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WorkloadInquiryDetails 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 WorkloadInquiryDetails. - */ - public static WorkloadInquiryDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WorkloadInquiryDetails deserializedWorkloadInquiryDetails = new WorkloadInquiryDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedWorkloadInquiryDetails.type = reader.getString(); - } else if ("itemCount".equals(fieldName)) { - deserializedWorkloadInquiryDetails.itemCount = reader.getNullable(JsonReader::getLong); - } else if ("inquiryValidation".equals(fieldName)) { - deserializedWorkloadInquiryDetails.inquiryValidation = InquiryValidation.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedWorkloadInquiryDetails; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItem.java deleted file mode 100644 index 32f0fb3d8425..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItem.java +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Base class for backup item. Workload-specific backup items are derived from this class. - */ -@Immutable -public class WorkloadItem implements JsonSerializable { - /* - * Type of the backup item. - */ - private String workloadItemType = "WorkloadItem"; - - /* - * Type of backup management to backup an item. - */ - private String backupManagementType; - - /* - * Type of workload for the backup management - */ - private String workloadType; - - /* - * Friendly name of the backup item. - */ - private String friendlyName; - - /* - * State of the back up item. - */ - private ProtectionStatus protectionState; - - /** - * Creates an instance of WorkloadItem class. - */ - protected WorkloadItem() { - } - - /** - * Get the workloadItemType property: Type of the backup item. - * - * @return the workloadItemType value. - */ - public String workloadItemType() { - return this.workloadItemType; - } - - /** - * Get the backupManagementType property: Type of backup management to backup an item. - * - * @return the backupManagementType value. - */ - public String backupManagementType() { - return this.backupManagementType; - } - - /** - * Set the backupManagementType property: Type of backup management to backup an item. - * - * @param backupManagementType the backupManagementType value to set. - * @return the WorkloadItem object itself. - */ - WorkloadItem withBackupManagementType(String backupManagementType) { - this.backupManagementType = backupManagementType; - return this; - } - - /** - * Get the workloadType property: Type of workload for the backup management. - * - * @return the workloadType value. - */ - public String workloadType() { - return this.workloadType; - } - - /** - * Set the workloadType property: Type of workload for the backup management. - * - * @param workloadType the workloadType value to set. - * @return the WorkloadItem object itself. - */ - WorkloadItem withWorkloadType(String workloadType) { - this.workloadType = workloadType; - return this; - } - - /** - * Get the friendlyName property: Friendly name of the backup item. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.friendlyName; - } - - /** - * Set the friendlyName property: Friendly name of the backup item. - * - * @param friendlyName the friendlyName value to set. - * @return the WorkloadItem object itself. - */ - WorkloadItem withFriendlyName(String friendlyName) { - this.friendlyName = friendlyName; - return this; - } - - /** - * Get the protectionState property: State of the back up item. - * - * @return the protectionState value. - */ - public ProtectionStatus protectionState() { - return this.protectionState; - } - - /** - * Set the protectionState property: State of the back up item. - * - * @param protectionState the protectionState value to set. - * @return the WorkloadItem object itself. - */ - WorkloadItem withProtectionState(ProtectionStatus protectionState) { - this.protectionState = protectionState; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("workloadItemType", this.workloadItemType); - jsonWriter.writeStringField("backupManagementType", this.backupManagementType); - jsonWriter.writeStringField("workloadType", this.workloadType); - jsonWriter.writeStringField("friendlyName", this.friendlyName); - jsonWriter.writeStringField("protectionState", - this.protectionState == null ? null : this.protectionState.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WorkloadItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WorkloadItem 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 WorkloadItem. - */ - public static WorkloadItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("workloadItemType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureVmWorkloadItem".equals(discriminatorValue)) { - return AzureVmWorkloadItem.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("SAPAseDatabase".equals(discriminatorValue)) { - return AzureVmWorkloadSapAseDatabaseWorkloadItem.fromJson(readerToUse.reset()); - } else if ("SAPAseSystem".equals(discriminatorValue)) { - return AzureVmWorkloadSapAseSystemWorkloadItem.fromJson(readerToUse.reset()); - } else if ("SAPHanaDatabase".equals(discriminatorValue)) { - return AzureVmWorkloadSapHanaDatabaseWorkloadItem.fromJson(readerToUse.reset()); - } else if ("SAPHanaSystem".equals(discriminatorValue)) { - return AzureVmWorkloadSapHanaSystemWorkloadItem.fromJson(readerToUse.reset()); - } else if ("SQLDataBase".equals(discriminatorValue)) { - return AzureVmWorkloadSqlDatabaseWorkloadItem.fromJson(readerToUse.reset()); - } else if ("SQLInstance".equals(discriminatorValue)) { - return AzureVmWorkloadSqlInstanceWorkloadItem.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static WorkloadItem fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WorkloadItem deserializedWorkloadItem = new WorkloadItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("workloadItemType".equals(fieldName)) { - deserializedWorkloadItem.workloadItemType = reader.getString(); - } else if ("backupManagementType".equals(fieldName)) { - deserializedWorkloadItem.backupManagementType = reader.getString(); - } else if ("workloadType".equals(fieldName)) { - deserializedWorkloadItem.workloadType = reader.getString(); - } else if ("friendlyName".equals(fieldName)) { - deserializedWorkloadItem.friendlyName = reader.getString(); - } else if ("protectionState".equals(fieldName)) { - deserializedWorkloadItem.protectionState = ProtectionStatus.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedWorkloadItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItemResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItemResource.java deleted file mode 100644 index c0abff700f2f..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItemResource.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadItemResourceInner; -import java.util.Map; - -/** - * An immutable client-side representation of WorkloadItemResource. - */ -public interface WorkloadItemResource { - /** - * 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 location property: Resource location. - * - * @return the location value. - */ - String location(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the eTag property: Optional ETag. - * - * @return the eTag value. - */ - String eTag(); - - /** - * Gets the properties property: WorkloadItemResource properties. - * - * @return the properties value. - */ - WorkloadItem 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.recoveryservicesbackup.fluent.models.WorkloadItemResourceInner object. - * - * @return the inner object. - */ - WorkloadItemResourceInner innerModel(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItemType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItemType.java deleted file mode 100644 index 68c389602b2a..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadItemType.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Workload item type of the item for which intent is to be set. - */ -public final class WorkloadItemType extends ExpandableStringEnum { - /** - * Static value Invalid for WorkloadItemType. - */ - public static final WorkloadItemType INVALID = fromString("Invalid"); - - /** - * Static value SQLInstance for WorkloadItemType. - */ - public static final WorkloadItemType SQLINSTANCE = fromString("SQLInstance"); - - /** - * Static value SQLDataBase for WorkloadItemType. - */ - public static final WorkloadItemType SQLDATA_BASE = fromString("SQLDataBase"); - - /** - * Static value SAPHanaSystem for WorkloadItemType. - */ - public static final WorkloadItemType SAPHANA_SYSTEM = fromString("SAPHanaSystem"); - - /** - * Static value SAPHanaDatabase for WorkloadItemType. - */ - public static final WorkloadItemType SAPHANA_DATABASE = fromString("SAPHanaDatabase"); - - /** - * Static value SAPAseSystem for WorkloadItemType. - */ - public static final WorkloadItemType SAPASE_SYSTEM = fromString("SAPAseSystem"); - - /** - * Static value SAPAseDatabase for WorkloadItemType. - */ - public static final WorkloadItemType SAPASE_DATABASE = fromString("SAPAseDatabase"); - - /** - * Static value SAPHanaDBInstance for WorkloadItemType. - */ - public static final WorkloadItemType SAPHANA_DBINSTANCE = fromString("SAPHanaDBInstance"); - - /** - * Creates a new instance of WorkloadItemType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public WorkloadItemType() { - } - - /** - * Creates or finds a WorkloadItemType from its string representation. - * - * @param name a name to look for. - * @return the corresponding WorkloadItemType. - */ - public static WorkloadItemType fromString(String name) { - return fromString(name, WorkloadItemType.class); - } - - /** - * Gets known WorkloadItemType values. - * - * @return known WorkloadItemType values. - */ - public static Collection values() { - return values(WorkloadItemType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadProtectableItem.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadProtectableItem.java deleted file mode 100644 index aec038022d07..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadProtectableItem.java +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.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; - -/** - * Base class for backup item. Workload-specific backup items are derived from this class. - */ -@Immutable -public class WorkloadProtectableItem implements JsonSerializable { - /* - * Type of the backup item. - */ - private String protectableItemType = "WorkloadProtectableItem"; - - /* - * Type of backup management to backup an item. - */ - private String backupManagementType; - - /* - * Type of workload for the backup management - */ - private String workloadType; - - /* - * Friendly name of the backup item. - */ - private String friendlyName; - - /* - * State of the back up item. - */ - private ProtectionStatus protectionState; - - /** - * Creates an instance of WorkloadProtectableItem class. - */ - protected WorkloadProtectableItem() { - } - - /** - * Get the protectableItemType property: Type of the backup item. - * - * @return the protectableItemType value. - */ - public String protectableItemType() { - return this.protectableItemType; - } - - /** - * Get the backupManagementType property: Type of backup management to backup an item. - * - * @return the backupManagementType value. - */ - public String backupManagementType() { - return this.backupManagementType; - } - - /** - * Set the backupManagementType property: Type of backup management to backup an item. - * - * @param backupManagementType the backupManagementType value to set. - * @return the WorkloadProtectableItem object itself. - */ - WorkloadProtectableItem withBackupManagementType(String backupManagementType) { - this.backupManagementType = backupManagementType; - return this; - } - - /** - * Get the workloadType property: Type of workload for the backup management. - * - * @return the workloadType value. - */ - public String workloadType() { - return this.workloadType; - } - - /** - * Set the workloadType property: Type of workload for the backup management. - * - * @param workloadType the workloadType value to set. - * @return the WorkloadProtectableItem object itself. - */ - WorkloadProtectableItem withWorkloadType(String workloadType) { - this.workloadType = workloadType; - return this; - } - - /** - * Get the friendlyName property: Friendly name of the backup item. - * - * @return the friendlyName value. - */ - public String friendlyName() { - return this.friendlyName; - } - - /** - * Set the friendlyName property: Friendly name of the backup item. - * - * @param friendlyName the friendlyName value to set. - * @return the WorkloadProtectableItem object itself. - */ - WorkloadProtectableItem withFriendlyName(String friendlyName) { - this.friendlyName = friendlyName; - return this; - } - - /** - * Get the protectionState property: State of the back up item. - * - * @return the protectionState value. - */ - public ProtectionStatus protectionState() { - return this.protectionState; - } - - /** - * Set the protectionState property: State of the back up item. - * - * @param protectionState the protectionState value to set. - * @return the WorkloadProtectableItem object itself. - */ - WorkloadProtectableItem withProtectionState(ProtectionStatus protectionState) { - this.protectionState = protectionState; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("protectableItemType", this.protectableItemType); - jsonWriter.writeStringField("backupManagementType", this.backupManagementType); - jsonWriter.writeStringField("workloadType", this.workloadType); - jsonWriter.writeStringField("friendlyName", this.friendlyName); - jsonWriter.writeStringField("protectionState", - this.protectionState == null ? null : this.protectionState.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WorkloadProtectableItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WorkloadProtectableItem 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 WorkloadProtectableItem. - */ - public static WorkloadProtectableItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("protectableItemType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureFileShare".equals(discriminatorValue)) { - return AzureFileShareProtectableItem.fromJson(readerToUse.reset()); - } else if ("IaaSVMProtectableItem".equals(discriminatorValue)) { - return IaasVmProtectableItem.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("Microsoft.Compute/virtualMachines".equals(discriminatorValue)) { - return AzureIaaSComputeVMProtectableItem.fromJson(readerToUse.reset()); - } else if ("Microsoft.ClassicCompute/virtualMachines".equals(discriminatorValue)) { - return AzureIaaSClassicComputeVMProtectableItem.fromJson(readerToUse.reset()); - } else if ("AzureVmWorkloadProtectableItem".equals(discriminatorValue)) { - return AzureVmWorkloadProtectableItem.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("SAPAseDatabase".equals(discriminatorValue)) { - return AzureVmWorkloadSapAseDatabaseProtectableItem.fromJson(readerToUse.reset()); - } else if ("SAPAseSystem".equals(discriminatorValue)) { - return AzureVmWorkloadSapAseSystemProtectableItem.fromJson(readerToUse.reset()); - } else if ("SAPHanaDatabase".equals(discriminatorValue)) { - return AzureVmWorkloadSapHanaDatabaseProtectableItem.fromJson(readerToUse.reset()); - } else if ("SAPHanaSystem".equals(discriminatorValue)) { - return AzureVmWorkloadSapHanaSystemProtectableItem.fromJson(readerToUse.reset()); - } else if ("SAPHanaDBInstance".equals(discriminatorValue)) { - return AzureVmWorkloadSapHanaDBInstance.fromJson(readerToUse.reset()); - } else if ("HanaHSRContainer".equals(discriminatorValue)) { - return AzureVmWorkloadSapHanaHsr.fromJson(readerToUse.reset()); - } else if ("HanaScaleoutContainer".equals(discriminatorValue)) { - return AzureVmWorkloadSAPHanaScaleoutProtectableItem.fromJson(readerToUse.reset()); - } else if ("SQLAvailabilityGroupContainer".equals(discriminatorValue)) { - return AzureVmWorkloadSqlAvailabilityGroupProtectableItem.fromJson(readerToUse.reset()); - } else if ("SQLDataBase".equals(discriminatorValue)) { - return AzureVmWorkloadSqlDatabaseProtectableItem.fromJson(readerToUse.reset()); - } else if ("SQLInstance".equals(discriminatorValue)) { - return AzureVmWorkloadSqlInstanceProtectableItem.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static WorkloadProtectableItem fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WorkloadProtectableItem deserializedWorkloadProtectableItem = new WorkloadProtectableItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("protectableItemType".equals(fieldName)) { - deserializedWorkloadProtectableItem.protectableItemType = reader.getString(); - } else if ("backupManagementType".equals(fieldName)) { - deserializedWorkloadProtectableItem.backupManagementType = reader.getString(); - } else if ("workloadType".equals(fieldName)) { - deserializedWorkloadProtectableItem.workloadType = reader.getString(); - } else if ("friendlyName".equals(fieldName)) { - deserializedWorkloadProtectableItem.friendlyName = reader.getString(); - } else if ("protectionState".equals(fieldName)) { - deserializedWorkloadProtectableItem.protectionState - = ProtectionStatus.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedWorkloadProtectableItem; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadProtectableItemResource.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadProtectableItemResource.java deleted file mode 100644 index 75522a995a64..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadProtectableItemResource.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.WorkloadProtectableItemResourceInner; -import java.util.Map; - -/** - * An immutable client-side representation of WorkloadProtectableItemResource. - */ -public interface WorkloadProtectableItemResource { - /** - * 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 location property: Resource location. - * - * @return the location value. - */ - String location(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the eTag property: Optional ETag. - * - * @return the eTag value. - */ - String eTag(); - - /** - * Gets the properties property: WorkloadProtectableItemResource properties. - * - * @return the properties value. - */ - WorkloadProtectableItem 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.recoveryservicesbackup.fluent.models.WorkloadProtectableItemResourceInner object. - * - * @return the inner object. - */ - WorkloadProtectableItemResourceInner innerModel(); -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadType.java deleted file mode 100644 index 1fa03c09c9a4..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/WorkloadType.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Type of workload for the backup management. - */ -public final class WorkloadType extends ExpandableStringEnum { - /** - * Static value Invalid for WorkloadType. - */ - public static final WorkloadType INVALID = fromString("Invalid"); - - /** - * Static value VM for WorkloadType. - */ - public static final WorkloadType VM = fromString("VM"); - - /** - * Static value FileFolder for WorkloadType. - */ - public static final WorkloadType FILE_FOLDER = fromString("FileFolder"); - - /** - * Static value AzureSqlDb for WorkloadType. - */ - public static final WorkloadType AZURE_SQL_DB = fromString("AzureSqlDb"); - - /** - * Static value SQLDB for WorkloadType. - */ - public static final WorkloadType SQLDB = fromString("SQLDB"); - - /** - * Static value Exchange for WorkloadType. - */ - public static final WorkloadType EXCHANGE = fromString("Exchange"); - - /** - * Static value Sharepoint for WorkloadType. - */ - public static final WorkloadType SHAREPOINT = fromString("Sharepoint"); - - /** - * Static value VMwareVM for WorkloadType. - */ - public static final WorkloadType VMWARE_VM = fromString("VMwareVM"); - - /** - * Static value SystemState for WorkloadType. - */ - public static final WorkloadType SYSTEM_STATE = fromString("SystemState"); - - /** - * Static value Client for WorkloadType. - */ - public static final WorkloadType CLIENT = fromString("Client"); - - /** - * Static value GenericDataSource for WorkloadType. - */ - public static final WorkloadType GENERIC_DATA_SOURCE = fromString("GenericDataSource"); - - /** - * Static value SQLDataBase for WorkloadType. - */ - public static final WorkloadType SQLDATA_BASE = fromString("SQLDataBase"); - - /** - * Static value AzureFileShare for WorkloadType. - */ - public static final WorkloadType AZURE_FILE_SHARE = fromString("AzureFileShare"); - - /** - * Static value SAPHanaDatabase for WorkloadType. - */ - public static final WorkloadType SAPHANA_DATABASE = fromString("SAPHanaDatabase"); - - /** - * Static value SAPAseDatabase for WorkloadType. - */ - public static final WorkloadType SAPASE_DATABASE = fromString("SAPAseDatabase"); - - /** - * Static value SAPHanaDBInstance for WorkloadType. - */ - public static final WorkloadType SAPHANA_DBINSTANCE = fromString("SAPHanaDBInstance"); - - /** - * Creates a new instance of WorkloadType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public WorkloadType() { - } - - /** - * Creates or finds a WorkloadType from its string representation. - * - * @param name a name to look for. - * @return the corresponding WorkloadType. - */ - public static WorkloadType fromString(String name) { - return fromString(name, WorkloadType.class); - } - - /** - * Gets known WorkloadType values. - * - * @return known WorkloadType values. - */ - public static Collection values() { - return values(WorkloadType.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/XcoolState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/XcoolState.java deleted file mode 100644 index ce384a2f6df0..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/XcoolState.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Vault x-cool state. - */ -public final class XcoolState extends ExpandableStringEnum { - /** - * Static value Invalid for XcoolState. - */ - public static final XcoolState INVALID = fromString("Invalid"); - - /** - * Static value Enabled for XcoolState. - */ - public static final XcoolState ENABLED = fromString("Enabled"); - - /** - * Static value Disabled for XcoolState. - */ - public static final XcoolState DISABLED = fromString("Disabled"); - - /** - * Creates a new instance of XcoolState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public XcoolState() { - } - - /** - * Creates or finds a XcoolState from its string representation. - * - * @param name a name to look for. - * @return the corresponding XcoolState. - */ - public static XcoolState fromString(String name) { - return fromString(name, XcoolState.class); - } - - /** - * Gets known XcoolState values. - * - * @return known XcoolState values. - */ - public static Collection values() { - return values(XcoolState.class); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/YearlyRetentionSchedule.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/YearlyRetentionSchedule.java deleted file mode 100644 index 41f3c814457e..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/YearlyRetentionSchedule.java +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.recoveryservicesbackup.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Yearly retention schedule. - */ -@Fluent -public final class YearlyRetentionSchedule implements JsonSerializable { - /* - * Retention schedule format for yearly retention policy. - */ - private RetentionScheduleFormat retentionScheduleFormatType; - - /* - * List of months of year of yearly retention policy. - */ - private List monthsOfYear; - - /* - * Daily retention format for yearly retention policy. - */ - private DailyRetentionFormat retentionScheduleDaily; - - /* - * Weekly retention format for yearly retention policy. - */ - private WeeklyRetentionFormat retentionScheduleWeekly; - - /* - * Retention times of retention policy. - */ - private List retentionTimes; - - /* - * Retention duration of retention Policy. - */ - private RetentionDuration retentionDuration; - - /** - * Creates an instance of YearlyRetentionSchedule class. - */ - public YearlyRetentionSchedule() { - } - - /** - * Get the retentionScheduleFormatType property: Retention schedule format for yearly retention policy. - * - * @return the retentionScheduleFormatType value. - */ - public RetentionScheduleFormat retentionScheduleFormatType() { - return this.retentionScheduleFormatType; - } - - /** - * Set the retentionScheduleFormatType property: Retention schedule format for yearly retention policy. - * - * @param retentionScheduleFormatType the retentionScheduleFormatType value to set. - * @return the YearlyRetentionSchedule object itself. - */ - public YearlyRetentionSchedule - withRetentionScheduleFormatType(RetentionScheduleFormat retentionScheduleFormatType) { - this.retentionScheduleFormatType = retentionScheduleFormatType; - return this; - } - - /** - * Get the monthsOfYear property: List of months of year of yearly retention policy. - * - * @return the monthsOfYear value. - */ - public List monthsOfYear() { - return this.monthsOfYear; - } - - /** - * Set the monthsOfYear property: List of months of year of yearly retention policy. - * - * @param monthsOfYear the monthsOfYear value to set. - * @return the YearlyRetentionSchedule object itself. - */ - public YearlyRetentionSchedule withMonthsOfYear(List monthsOfYear) { - this.monthsOfYear = monthsOfYear; - return this; - } - - /** - * Get the retentionScheduleDaily property: Daily retention format for yearly retention policy. - * - * @return the retentionScheduleDaily value. - */ - public DailyRetentionFormat retentionScheduleDaily() { - return this.retentionScheduleDaily; - } - - /** - * Set the retentionScheduleDaily property: Daily retention format for yearly retention policy. - * - * @param retentionScheduleDaily the retentionScheduleDaily value to set. - * @return the YearlyRetentionSchedule object itself. - */ - public YearlyRetentionSchedule withRetentionScheduleDaily(DailyRetentionFormat retentionScheduleDaily) { - this.retentionScheduleDaily = retentionScheduleDaily; - return this; - } - - /** - * Get the retentionScheduleWeekly property: Weekly retention format for yearly retention policy. - * - * @return the retentionScheduleWeekly value. - */ - public WeeklyRetentionFormat retentionScheduleWeekly() { - return this.retentionScheduleWeekly; - } - - /** - * Set the retentionScheduleWeekly property: Weekly retention format for yearly retention policy. - * - * @param retentionScheduleWeekly the retentionScheduleWeekly value to set. - * @return the YearlyRetentionSchedule object itself. - */ - public YearlyRetentionSchedule withRetentionScheduleWeekly(WeeklyRetentionFormat retentionScheduleWeekly) { - this.retentionScheduleWeekly = retentionScheduleWeekly; - return this; - } - - /** - * Get the retentionTimes property: Retention times of retention policy. - * - * @return the retentionTimes value. - */ - public List retentionTimes() { - return this.retentionTimes; - } - - /** - * Set the retentionTimes property: Retention times of retention policy. - * - * @param retentionTimes the retentionTimes value to set. - * @return the YearlyRetentionSchedule object itself. - */ - public YearlyRetentionSchedule withRetentionTimes(List retentionTimes) { - this.retentionTimes = retentionTimes; - return this; - } - - /** - * Get the retentionDuration property: Retention duration of retention Policy. - * - * @return the retentionDuration value. - */ - public RetentionDuration retentionDuration() { - return this.retentionDuration; - } - - /** - * Set the retentionDuration property: Retention duration of retention Policy. - * - * @param retentionDuration the retentionDuration value to set. - * @return the YearlyRetentionSchedule object itself. - */ - public YearlyRetentionSchedule withRetentionDuration(RetentionDuration retentionDuration) { - this.retentionDuration = retentionDuration; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("retentionScheduleFormatType", - this.retentionScheduleFormatType == null ? null : this.retentionScheduleFormatType.toString()); - jsonWriter.writeArrayField("monthsOfYear", this.monthsOfYear, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeJsonField("retentionScheduleDaily", this.retentionScheduleDaily); - jsonWriter.writeJsonField("retentionScheduleWeekly", this.retentionScheduleWeekly); - jsonWriter.writeArrayField("retentionTimes", this.retentionTimes, (writer, element) -> writer - .writeString(element == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(element))); - jsonWriter.writeJsonField("retentionDuration", this.retentionDuration); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of YearlyRetentionSchedule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of YearlyRetentionSchedule 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 YearlyRetentionSchedule. - */ - public static YearlyRetentionSchedule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - YearlyRetentionSchedule deserializedYearlyRetentionSchedule = new YearlyRetentionSchedule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("retentionScheduleFormatType".equals(fieldName)) { - deserializedYearlyRetentionSchedule.retentionScheduleFormatType - = RetentionScheduleFormat.fromString(reader.getString()); - } else if ("monthsOfYear".equals(fieldName)) { - List monthsOfYear - = reader.readArray(reader1 -> MonthOfYear.fromString(reader1.getString())); - deserializedYearlyRetentionSchedule.monthsOfYear = monthsOfYear; - } else if ("retentionScheduleDaily".equals(fieldName)) { - deserializedYearlyRetentionSchedule.retentionScheduleDaily = DailyRetentionFormat.fromJson(reader); - } else if ("retentionScheduleWeekly".equals(fieldName)) { - deserializedYearlyRetentionSchedule.retentionScheduleWeekly - = WeeklyRetentionFormat.fromJson(reader); - } else if ("retentionTimes".equals(fieldName)) { - List retentionTimes = reader.readArray(reader1 -> reader1 - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - deserializedYearlyRetentionSchedule.retentionTimes = retentionTimes; - } else if ("retentionDuration".equals(fieldName)) { - deserializedYearlyRetentionSchedule.retentionDuration = RetentionDuration.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedYearlyRetentionSchedule; - }); - } -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/package-info.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/package-info.java deleted file mode 100644 index 882c5ae4d702..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// 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 RecoveryServicesBackup. - * Open API 2.0 Specs for Azure RecoveryServices Backup service. - */ -package com.azure.resourcemanager.recoveryservicesbackup.models; diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/package-info.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/package-info.java deleted file mode 100644 index 7d5319657288..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// 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 RecoveryServicesBackup. - * Open API 2.0 Specs for Azure RecoveryServices Backup service. - */ -package com.azure.resourcemanager.recoveryservicesbackup; diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/module-info.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/module-info.java deleted file mode 100644 index 1efa13ab3700..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/module-info.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -module com.azure.resourcemanager.recoveryservicesbackup { - requires transitive com.azure.core.management; - - exports com.azure.resourcemanager.recoveryservicesbackup; - exports com.azure.resourcemanager.recoveryservicesbackup.fluent; - exports com.azure.resourcemanager.recoveryservicesbackup.fluent.models; - exports com.azure.resourcemanager.recoveryservicesbackup.models; - - opens com.azure.resourcemanager.recoveryservicesbackup.fluent.models to com.azure.core; - opens com.azure.resourcemanager.recoveryservicesbackup.models to com.azure.core; - opens com.azure.resourcemanager.recoveryservicesbackup.implementation.models to com.azure.core; -} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicesbackup/proxy-config.json b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicesbackup/proxy-config.json deleted file mode 100644 index 6a4769af2fc1..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicesbackup/proxy-config.json +++ /dev/null @@ -1 +0,0 @@ -[["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupEnginesClientImpl$BackupEnginesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupJobsClientImpl$BackupJobsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupOperationResultsClientImpl$BackupOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupOperationStatusesClientImpl$BackupOperationStatusesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupPoliciesClientImpl$BackupPoliciesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectableItemsClientImpl$BackupProtectableItemsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectedItemsClientImpl$BackupProtectedItemsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectionContainersClientImpl$BackupProtectionContainersService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectionIntentsClientImpl$BackupProtectionIntentsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceEncryptionConfigsClientImpl$BackupResourceEncryptionConfigsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceStorageConfigsNonCrrsClientImpl$BackupResourceStorageConfigsNonCrrsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceVaultConfigsClientImpl$BackupResourceVaultConfigsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupStatusClientImpl$BackupStatusService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupUsageSummariesClientImpl$BackupUsageSummariesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupWorkloadItemsClientImpl$BackupWorkloadItemsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupsClientImpl$BackupsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BmsPrepareDataMoveOperationResultsClientImpl$BmsPrepareDataMoveOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.DeletedProtectionContainersClientImpl$DeletedProtectionContainersService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ExportJobsOperationResultsClientImpl$ExportJobsOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.FeatureSupportsClientImpl$FeatureSupportsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.FetchTieringCostsClientImpl$FetchTieringCostsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.GetTieringCostOperationResultsClientImpl$GetTieringCostOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ItemLevelRecoveryConnectionsClientImpl$ItemLevelRecoveryConnectionsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.JobCancellationsClientImpl$JobCancellationsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.JobDetailsClientImpl$JobDetailsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.JobOperationResultsClientImpl$JobOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.JobsClientImpl$JobsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.OperationOperationsClientImpl$OperationOperationsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.PrivateEndpointsClientImpl$PrivateEndpointsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectableContainersClientImpl$ProtectableContainersService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemOperationResultsClientImpl$ProtectedItemOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemOperationStatusesClientImpl$ProtectedItemOperationStatusesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemsClientImpl$ProtectedItemsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionContainerOperationResultsClientImpl$ProtectionContainerOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionContainerRefreshOperationResultsClientImpl$ProtectionContainerRefreshOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionContainersClientImpl$ProtectionContainersService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionIntentsClientImpl$ProtectionIntentsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionPoliciesClientImpl$ProtectionPoliciesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionPolicyOperationResultsClientImpl$ProtectionPolicyOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionPolicyOperationStatusesClientImpl$ProtectionPolicyOperationStatusesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.RecoveryPointsClientImpl$RecoveryPointsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.RecoveryPointsRecommendedForMovesClientImpl$RecoveryPointsRecommendedForMovesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ResourceGuardProxyOperationsClientImpl$ResourceGuardProxyOperationsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.RestoresClientImpl$RestoresService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.SecurityPINsClientImpl$SecurityPINsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.TieringCostOperationStatusClientImpl$TieringCostOperationStatusService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationResultsClientImpl$ValidateOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationStatusesClientImpl$ValidateOperationStatusesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationsClientImpl$ValidateOperationsService"]] \ No newline at end of file diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicesbackup/reflect-config.json b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicesbackup/reflect-config.json deleted file mode 100644 index 0637a088a01e..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicesbackup/reflect-config.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/resources/azure-resourcemanager-recoveryservicesbackup.properties b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/resources/azure-resourcemanager-recoveryservicesbackup.properties deleted file mode 100644 index defbd48204e4..000000000000 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/resources/azure-resourcemanager-recoveryservicesbackup.properties +++ /dev/null @@ -1 +0,0 @@ -version=${project.version} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/KnowledgeBaseRetrievalServiceVersion.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/KnowledgeBaseRetrievalServiceVersion.java new file mode 100644 index 000000000000..9e66e757438c --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/KnowledgeBaseRetrievalServiceVersion.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.search.documents; + +import com.azure.core.util.ServiceVersion; + +/** + * Service version of KnowledgeBaseRetrievalClient. + */ +public enum KnowledgeBaseRetrievalServiceVersion implements ServiceVersion { + /** + * Enum value 2025-11-01-preview. + */ + V2025_11_01_PREVIEW("2025-11-01-preview"), + + /** + * Enum value 2026-04-01. + */ + V2026_04_01("2026-04-01"), + + /** + * Enum value 2026-05-01-preview. + */ + V2026_05_01_PREVIEW("2026-05-01-preview"); + + private final String version; + + KnowledgeBaseRetrievalServiceVersion(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 KnowledgeBaseRetrievalServiceVersion}. + */ + public static KnowledgeBaseRetrievalServiceVersion getLatest() { + return V2026_05_01_PREVIEW; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchIndexServiceVersion.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchIndexServiceVersion.java new file mode 100644 index 000000000000..beb3f187ecbb --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchIndexServiceVersion.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.search.documents; + +import com.azure.core.util.ServiceVersion; + +/** + * Service version of SearchIndexClient. + */ +public enum SearchIndexServiceVersion implements ServiceVersion { + /** + * Enum value 2025-11-01-preview. + */ + V2025_11_01_PREVIEW("2025-11-01-preview"), + + /** + * Enum value 2026-04-01. + */ + V2026_04_01("2026-04-01"), + + /** + * Enum value 2026-05-01-preview. + */ + V2026_05_01_PREVIEW("2026-05-01-preview"); + + private final String version; + + SearchIndexServiceVersion(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 SearchIndexServiceVersion}. + */ + public static SearchIndexServiceVersion getLatest() { + return V2026_05_01_PREVIEW; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchIndexerServiceVersion.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchIndexerServiceVersion.java new file mode 100644 index 000000000000..aa1c0ca12394 --- /dev/null +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchIndexerServiceVersion.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.search.documents; + +import com.azure.core.util.ServiceVersion; + +/** + * Service version of SearchIndexerClient. + */ +public enum SearchIndexerServiceVersion implements ServiceVersion { + /** + * Enum value 2025-11-01-preview. + */ + V2025_11_01_PREVIEW("2025-11-01-preview"), + + /** + * Enum value 2026-04-01. + */ + V2026_04_01("2026-04-01"), + + /** + * Enum value 2026-05-01-preview. + */ + V2026_05_01_PREVIEW("2026-05-01-preview"); + + private final String version; + + SearchIndexerServiceVersion(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 SearchIndexerServiceVersion}. + */ + public static SearchIndexerServiceVersion getLatest() { + return V2026_05_01_PREVIEW; + } +} diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/KnowledgeBaseRetrievalClientImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/KnowledgeBaseRetrievalClientImpl.java index 7c061ae27d9d..f61974ef8db1 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/KnowledgeBaseRetrievalClientImpl.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/KnowledgeBaseRetrievalClientImpl.java @@ -32,7 +32,7 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.search.documents.SearchServiceVersion; +import com.azure.search.documents.KnowledgeBaseRetrievalServiceVersion; import reactor.core.publisher.Mono; /** @@ -75,14 +75,14 @@ public String getKnowledgeBaseName() { /** * Service version. */ - private final SearchServiceVersion serviceVersion; + private final KnowledgeBaseRetrievalServiceVersion serviceVersion; /** * Gets Service version. * * @return the serviceVersion value. */ - public SearchServiceVersion getServiceVersion() { + public KnowledgeBaseRetrievalServiceVersion getServiceVersion() { return this.serviceVersion; } @@ -122,7 +122,7 @@ public SerializerAdapter getSerializerAdapter() { * @param serviceVersion Service version. */ public KnowledgeBaseRetrievalClientImpl(String endpoint, String knowledgeBaseName, - SearchServiceVersion serviceVersion) { + KnowledgeBaseRetrievalServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), JacksonAdapter.createDefaultSerializerAdapter(), endpoint, knowledgeBaseName, serviceVersion); } @@ -136,7 +136,7 @@ public KnowledgeBaseRetrievalClientImpl(String endpoint, String knowledgeBaseNam * @param serviceVersion Service version. */ public KnowledgeBaseRetrievalClientImpl(HttpPipeline httpPipeline, String endpoint, String knowledgeBaseName, - SearchServiceVersion serviceVersion) { + KnowledgeBaseRetrievalServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, knowledgeBaseName, serviceVersion); } @@ -151,7 +151,7 @@ public KnowledgeBaseRetrievalClientImpl(HttpPipeline httpPipeline, String endpoi * @param serviceVersion Service version. */ public KnowledgeBaseRetrievalClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - String endpoint, String knowledgeBaseName, SearchServiceVersion serviceVersion) { + String endpoint, String knowledgeBaseName, KnowledgeBaseRetrievalServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexClientImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexClientImpl.java index a3002ca570e7..4c00a54c55eb 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexClientImpl.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexClientImpl.java @@ -39,7 +39,7 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.search.documents.SearchServiceVersion; +import com.azure.search.documents.SearchIndexServiceVersion; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -71,14 +71,14 @@ public String getEndpoint() { /** * Service version. */ - private final SearchServiceVersion serviceVersion; + private final SearchIndexServiceVersion serviceVersion; /** * Gets Service version. * * @return the serviceVersion value. */ - public SearchServiceVersion getServiceVersion() { + public SearchIndexServiceVersion getServiceVersion() { return this.serviceVersion; } @@ -116,7 +116,7 @@ public SerializerAdapter getSerializerAdapter() { * @param endpoint The endpoint URL of the search service. * @param serviceVersion Service version. */ - public SearchIndexClientImpl(String endpoint, SearchServiceVersion serviceVersion) { + public SearchIndexClientImpl(String endpoint, SearchIndexServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -128,7 +128,7 @@ public SearchIndexClientImpl(String endpoint, SearchServiceVersion serviceVersio * @param endpoint The endpoint URL of the search service. * @param serviceVersion Service version. */ - public SearchIndexClientImpl(HttpPipeline httpPipeline, String endpoint, SearchServiceVersion serviceVersion) { + public SearchIndexClientImpl(HttpPipeline httpPipeline, String endpoint, SearchIndexServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -141,7 +141,7 @@ public SearchIndexClientImpl(HttpPipeline httpPipeline, String endpoint, SearchS * @param serviceVersion Service version. */ public SearchIndexClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - SearchServiceVersion serviceVersion) { + SearchIndexServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexerClientImpl.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexerClientImpl.java index a9ac60fd0a2f..dbaef58e1ad6 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexerClientImpl.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexerClientImpl.java @@ -36,7 +36,7 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.search.documents.SearchServiceVersion; +import com.azure.search.documents.SearchIndexerServiceVersion; import reactor.core.publisher.Mono; /** @@ -65,14 +65,14 @@ public String getEndpoint() { /** * Service version. */ - private final SearchServiceVersion serviceVersion; + private final SearchIndexerServiceVersion serviceVersion; /** * Gets Service version. * * @return the serviceVersion value. */ - public SearchServiceVersion getServiceVersion() { + public SearchIndexerServiceVersion getServiceVersion() { return this.serviceVersion; } @@ -110,7 +110,7 @@ public SerializerAdapter getSerializerAdapter() { * @param endpoint The endpoint URL of the search service. * @param serviceVersion Service version. */ - public SearchIndexerClientImpl(String endpoint, SearchServiceVersion serviceVersion) { + public SearchIndexerClientImpl(String endpoint, SearchIndexerServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -122,7 +122,8 @@ public SearchIndexerClientImpl(String endpoint, SearchServiceVersion serviceVers * @param endpoint The endpoint URL of the search service. * @param serviceVersion Service version. */ - public SearchIndexerClientImpl(HttpPipeline httpPipeline, String endpoint, SearchServiceVersion serviceVersion) { + public SearchIndexerClientImpl(HttpPipeline httpPipeline, String endpoint, + SearchIndexerServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } @@ -135,7 +136,7 @@ public SearchIndexerClientImpl(HttpPipeline httpPipeline, String endpoint, Searc * @param serviceVersion Service version. */ public SearchIndexerClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - SearchServiceVersion serviceVersion) { + SearchIndexerServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClientBuilder.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClientBuilder.java index 21b304f7c187..65f1c5866c1c 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClientBuilder.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClientBuilder.java @@ -37,7 +37,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.search.documents.SearchAudience; -import com.azure.search.documents.SearchServiceVersion; +import com.azure.search.documents.SearchIndexServiceVersion; import com.azure.search.documents.implementation.SearchIndexClientImpl; import java.util.ArrayList; import java.util.List; @@ -237,19 +237,7 @@ public SearchIndexClientBuilder endpoint(String endpoint) { * Service version */ @Generated - private SearchServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the SearchIndexClientBuilder. - */ - @Generated - public SearchIndexClientBuilder serviceVersion(SearchServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } + private SearchIndexServiceVersion serviceVersion; /* * The retry policy that will attempt to retry failed requests, if applicable. @@ -295,8 +283,8 @@ public SearchIndexClientBuilder audience(SearchAudience audience) { private SearchIndexClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - SearchServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : SearchServiceVersion.getLatest(); + SearchIndexServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : SearchIndexServiceVersion.getLatest(); SearchIndexClientImpl client = new SearchIndexClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; @@ -374,4 +362,16 @@ public SearchIndexClient buildClient() { @Generated private String[] scopes = DEFAULT_SCOPES; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the SearchIndexClientBuilder. + */ + @Generated + public SearchIndexClientBuilder serviceVersion(SearchIndexServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClientBuilder.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClientBuilder.java index 0e56fde46edd..a9a23a6dab02 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClientBuilder.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClientBuilder.java @@ -37,7 +37,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.search.documents.SearchAudience; -import com.azure.search.documents.SearchServiceVersion; +import com.azure.search.documents.SearchIndexerServiceVersion; import com.azure.search.documents.implementation.SearchIndexerClientImpl; import java.util.ArrayList; import java.util.List; @@ -237,19 +237,7 @@ public SearchIndexerClientBuilder endpoint(String endpoint) { * Service version */ @Generated - private SearchServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the SearchIndexerClientBuilder. - */ - @Generated - public SearchIndexerClientBuilder serviceVersion(SearchServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } + private SearchIndexerServiceVersion serviceVersion; /* * The retry policy that will attempt to retry failed requests, if applicable. @@ -295,8 +283,8 @@ public SearchIndexerClientBuilder audience(SearchAudience audience) { private SearchIndexerClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - SearchServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : SearchServiceVersion.getLatest(); + SearchIndexerServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : SearchIndexerServiceVersion.getLatest(); SearchIndexerClientImpl client = new SearchIndexerClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; @@ -374,4 +362,16 @@ public SearchIndexerClient buildClient() { @Generated private String[] scopes = DEFAULT_SCOPES; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the SearchIndexerClientBuilder. + */ + @Generated + public SearchIndexerClientBuilder serviceVersion(SearchIndexerServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } } diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalClientBuilder.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalClientBuilder.java index f8f63e317d3c..f00e75fe9764 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalClientBuilder.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/knowledgebases/KnowledgeBaseRetrievalClientBuilder.java @@ -36,8 +36,8 @@ import com.azure.core.util.builder.ClientBuilderUtil; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.search.documents.KnowledgeBaseRetrievalServiceVersion; import com.azure.search.documents.SearchAudience; -import com.azure.search.documents.SearchServiceVersion; import com.azure.search.documents.implementation.KnowledgeBaseRetrievalClientImpl; import java.util.ArrayList; import java.util.List; @@ -237,19 +237,7 @@ public KnowledgeBaseRetrievalClientBuilder endpoint(String endpoint) { * Service version */ @Generated - private SearchServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the KnowledgeBaseRetrievalClientBuilder. - */ - @Generated - public KnowledgeBaseRetrievalClientBuilder serviceVersion(SearchServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } + private KnowledgeBaseRetrievalServiceVersion serviceVersion; /* * The retry policy that will attempt to retry failed requests, if applicable. @@ -295,8 +283,8 @@ public KnowledgeBaseRetrievalClientBuilder audience(SearchAudience audience) { private KnowledgeBaseRetrievalClientImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - SearchServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : SearchServiceVersion.getLatest(); + KnowledgeBaseRetrievalServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : KnowledgeBaseRetrievalServiceVersion.getLatest(); KnowledgeBaseRetrievalClientImpl client = new KnowledgeBaseRetrievalClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, this.knowledgeBaseName, localServiceVersion); @@ -394,4 +382,16 @@ public KnowledgeBaseRetrievalClientBuilder knowledgeBaseName(String knowledgeBas this.knowledgeBaseName = knowledgeBaseName; return this; } + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the KnowledgeBaseRetrievalClientBuilder. + */ + @Generated + public KnowledgeBaseRetrievalClientBuilder serviceVersion(KnowledgeBaseRetrievalServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java deleted file mode 100644 index ed3f01dc243e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java +++ /dev/null @@ -1,1474 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -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.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.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.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.security.fluent.SecurityCenter; -import com.azure.resourcemanager.security.implementation.AdvancedThreatProtectionsImpl; -import com.azure.resourcemanager.security.implementation.AlertsImpl; -import com.azure.resourcemanager.security.implementation.AlertsSuppressionRulesImpl; -import com.azure.resourcemanager.security.implementation.AllowedConnectionsImpl; -import com.azure.resourcemanager.security.implementation.ApiCollectionsImpl; -import com.azure.resourcemanager.security.implementation.ApplicationsImpl; -import com.azure.resourcemanager.security.implementation.AssessmentsImpl; -import com.azure.resourcemanager.security.implementation.AssessmentsMetadatasImpl; -import com.azure.resourcemanager.security.implementation.AssignmentsImpl; -import com.azure.resourcemanager.security.implementation.AutoProvisioningSettingsImpl; -import com.azure.resourcemanager.security.implementation.AutomationsImpl; -import com.azure.resourcemanager.security.implementation.AzureDevOpsOrgsImpl; -import com.azure.resourcemanager.security.implementation.AzureDevOpsProjectsImpl; -import com.azure.resourcemanager.security.implementation.AzureDevOpsReposImpl; -import com.azure.resourcemanager.security.implementation.ComplianceResultsImpl; -import com.azure.resourcemanager.security.implementation.CompliancesImpl; -import com.azure.resourcemanager.security.implementation.CustomRecommendationsImpl; -import com.azure.resourcemanager.security.implementation.DefenderForStoragesImpl; -import com.azure.resourcemanager.security.implementation.DevOpsConfigurationsImpl; -import com.azure.resourcemanager.security.implementation.DevOpsOperationResultsImpl; -import com.azure.resourcemanager.security.implementation.DeviceSecurityGroupsImpl; -import com.azure.resourcemanager.security.implementation.DiscoveredSecuritySolutionsImpl; -import com.azure.resourcemanager.security.implementation.ExternalSecuritySolutionsImpl; -import com.azure.resourcemanager.security.implementation.GitHubIssuesImpl; -import com.azure.resourcemanager.security.implementation.GitHubOwnersImpl; -import com.azure.resourcemanager.security.implementation.GitHubReposImpl; -import com.azure.resourcemanager.security.implementation.GitLabGroupsImpl; -import com.azure.resourcemanager.security.implementation.GitLabProjectsImpl; -import com.azure.resourcemanager.security.implementation.GitLabSubgroupsImpl; -import com.azure.resourcemanager.security.implementation.GovernanceAssignmentsImpl; -import com.azure.resourcemanager.security.implementation.GovernanceRulesImpl; -import com.azure.resourcemanager.security.implementation.HealthReportsImpl; -import com.azure.resourcemanager.security.implementation.InformationProtectionPoliciesImpl; -import com.azure.resourcemanager.security.implementation.IotSecuritySolutionAnalyticsImpl; -import com.azure.resourcemanager.security.implementation.IotSecuritySolutionsAnalyticsAggregatedAlertsImpl; -import com.azure.resourcemanager.security.implementation.IotSecuritySolutionsAnalyticsRecommendationsImpl; -import com.azure.resourcemanager.security.implementation.IotSecuritySolutionsImpl; -import com.azure.resourcemanager.security.implementation.JitNetworkAccessPoliciesImpl; -import com.azure.resourcemanager.security.implementation.LocationsImpl; -import com.azure.resourcemanager.security.implementation.MdeOnboardingsImpl; -import com.azure.resourcemanager.security.implementation.OperationResultsImpl; -import com.azure.resourcemanager.security.implementation.OperationStatusesImpl; -import com.azure.resourcemanager.security.implementation.OperationsImpl; -import com.azure.resourcemanager.security.implementation.PricingsImpl; -import com.azure.resourcemanager.security.implementation.PrivateEndpointConnectionsImpl; -import com.azure.resourcemanager.security.implementation.PrivateLinkResourcesImpl; -import com.azure.resourcemanager.security.implementation.PrivateLinksImpl; -import com.azure.resourcemanager.security.implementation.RegulatoryComplianceAssessmentsImpl; -import com.azure.resourcemanager.security.implementation.RegulatoryComplianceControlsImpl; -import com.azure.resourcemanager.security.implementation.RegulatoryComplianceStandardsImpl; -import com.azure.resourcemanager.security.implementation.SecureScoreControlDefinitionsImpl; -import com.azure.resourcemanager.security.implementation.SecureScoreControlsImpl; -import com.azure.resourcemanager.security.implementation.SecureScoresImpl; -import com.azure.resourcemanager.security.implementation.SecurityCenterBuilder; -import com.azure.resourcemanager.security.implementation.SecurityConnectorApplicationsImpl; -import com.azure.resourcemanager.security.implementation.SecurityConnectorsImpl; -import com.azure.resourcemanager.security.implementation.SecurityContactsImpl; -import com.azure.resourcemanager.security.implementation.SecurityOperatorsImpl; -import com.azure.resourcemanager.security.implementation.SecuritySolutionsImpl; -import com.azure.resourcemanager.security.implementation.SecuritySolutionsReferenceDatasImpl; -import com.azure.resourcemanager.security.implementation.SecurityStandardsImpl; -import com.azure.resourcemanager.security.implementation.SensitivitySettingsImpl; -import com.azure.resourcemanager.security.implementation.ServerVulnerabilityAssessmentsImpl; -import com.azure.resourcemanager.security.implementation.ServerVulnerabilityAssessmentsSettingsImpl; -import com.azure.resourcemanager.security.implementation.SettingsImpl; -import com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentBaselineRulesImpl; -import com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentScanResultsImpl; -import com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentScansImpl; -import com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentSettingsOperationsImpl; -import com.azure.resourcemanager.security.implementation.StandardAssignmentsImpl; -import com.azure.resourcemanager.security.implementation.StandardsImpl; -import com.azure.resourcemanager.security.implementation.SubAssessmentsImpl; -import com.azure.resourcemanager.security.implementation.TasksImpl; -import com.azure.resourcemanager.security.implementation.TopologiesImpl; -import com.azure.resourcemanager.security.implementation.WorkspaceSettingsImpl; -import com.azure.resourcemanager.security.models.AdvancedThreatProtections; -import com.azure.resourcemanager.security.models.Alerts; -import com.azure.resourcemanager.security.models.AlertsSuppressionRules; -import com.azure.resourcemanager.security.models.AllowedConnections; -import com.azure.resourcemanager.security.models.ApiCollections; -import com.azure.resourcemanager.security.models.Applications; -import com.azure.resourcemanager.security.models.Assessments; -import com.azure.resourcemanager.security.models.AssessmentsMetadatas; -import com.azure.resourcemanager.security.models.Assignments; -import com.azure.resourcemanager.security.models.AutoProvisioningSettings; -import com.azure.resourcemanager.security.models.Automations; -import com.azure.resourcemanager.security.models.AzureDevOpsOrgs; -import com.azure.resourcemanager.security.models.AzureDevOpsProjects; -import com.azure.resourcemanager.security.models.AzureDevOpsRepos; -import com.azure.resourcemanager.security.models.ComplianceResults; -import com.azure.resourcemanager.security.models.Compliances; -import com.azure.resourcemanager.security.models.CustomRecommendations; -import com.azure.resourcemanager.security.models.DefenderForStorages; -import com.azure.resourcemanager.security.models.DevOpsConfigurations; -import com.azure.resourcemanager.security.models.DevOpsOperationResults; -import com.azure.resourcemanager.security.models.DeviceSecurityGroups; -import com.azure.resourcemanager.security.models.DiscoveredSecuritySolutions; -import com.azure.resourcemanager.security.models.ExternalSecuritySolutions; -import com.azure.resourcemanager.security.models.GitHubIssues; -import com.azure.resourcemanager.security.models.GitHubOwners; -import com.azure.resourcemanager.security.models.GitHubRepos; -import com.azure.resourcemanager.security.models.GitLabGroups; -import com.azure.resourcemanager.security.models.GitLabProjects; -import com.azure.resourcemanager.security.models.GitLabSubgroups; -import com.azure.resourcemanager.security.models.GovernanceAssignments; -import com.azure.resourcemanager.security.models.GovernanceRules; -import com.azure.resourcemanager.security.models.HealthReports; -import com.azure.resourcemanager.security.models.InformationProtectionPolicies; -import com.azure.resourcemanager.security.models.IotSecuritySolutionAnalytics; -import com.azure.resourcemanager.security.models.IotSecuritySolutions; -import com.azure.resourcemanager.security.models.IotSecuritySolutionsAnalyticsAggregatedAlerts; -import com.azure.resourcemanager.security.models.IotSecuritySolutionsAnalyticsRecommendations; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicies; -import com.azure.resourcemanager.security.models.Locations; -import com.azure.resourcemanager.security.models.MdeOnboardings; -import com.azure.resourcemanager.security.models.OperationResults; -import com.azure.resourcemanager.security.models.OperationStatuses; -import com.azure.resourcemanager.security.models.Operations; -import com.azure.resourcemanager.security.models.Pricings; -import com.azure.resourcemanager.security.models.PrivateEndpointConnections; -import com.azure.resourcemanager.security.models.PrivateLinkResources; -import com.azure.resourcemanager.security.models.PrivateLinks; -import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessments; -import com.azure.resourcemanager.security.models.RegulatoryComplianceControls; -import com.azure.resourcemanager.security.models.RegulatoryComplianceStandards; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitions; -import com.azure.resourcemanager.security.models.SecureScoreControls; -import com.azure.resourcemanager.security.models.SecureScores; -import com.azure.resourcemanager.security.models.SecurityConnectorApplications; -import com.azure.resourcemanager.security.models.SecurityConnectors; -import com.azure.resourcemanager.security.models.SecurityContacts; -import com.azure.resourcemanager.security.models.SecurityOperators; -import com.azure.resourcemanager.security.models.SecuritySolutions; -import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceDatas; -import com.azure.resourcemanager.security.models.SecurityStandards; -import com.azure.resourcemanager.security.models.SensitivitySettings; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessments; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettings; -import com.azure.resourcemanager.security.models.Settings; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentBaselineRules; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentScanResults; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentScans; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentSettingsOperations; -import com.azure.resourcemanager.security.models.StandardAssignments; -import com.azure.resourcemanager.security.models.Standards; -import com.azure.resourcemanager.security.models.SubAssessments; -import com.azure.resourcemanager.security.models.Tasks; -import com.azure.resourcemanager.security.models.Topologies; -import com.azure.resourcemanager.security.models.WorkspaceSettings; -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; - -/** - * Entry point to SecurityManager. - * API spec for Microsoft.Security (Azure Security Center) alerts resource provider. - */ -public final class SecurityManager { - private Alerts alerts; - - private AlertsSuppressionRules alertsSuppressionRules; - - private ApiCollections apiCollections; - - private Applications applications; - - private AssessmentsMetadatas assessmentsMetadatas; - - private Automations automations; - - private SecurityContacts securityContacts; - - private ComplianceResults complianceResults; - - private GovernanceAssignments governanceAssignments; - - private GovernanceRules governanceRules; - - private HealthReports healthReports; - - private DeviceSecurityGroups deviceSecurityGroups; - - private AutoProvisioningSettings autoProvisioningSettings; - - private Compliances compliances; - - private InformationProtectionPolicies informationProtectionPolicies; - - private WorkspaceSettings workspaceSettings; - - private MdeOnboardings mdeOnboardings; - - private Operations operations; - - private Pricings pricings; - - private PrivateLinkResources privateLinkResources; - - private PrivateEndpointConnections privateEndpointConnections; - - private RegulatoryComplianceStandards regulatoryComplianceStandards; - - private RegulatoryComplianceControls regulatoryComplianceControls; - - private RegulatoryComplianceAssessments regulatoryComplianceAssessments; - - private SecurityConnectors securityConnectors; - - private AzureDevOpsOrgs azureDevOpsOrgs; - - private GitHubOwners gitHubOwners; - - private GitLabGroups gitLabGroups; - - private DevOpsConfigurations devOpsConfigurations; - - private AzureDevOpsProjects azureDevOpsProjects; - - private GitLabProjects gitLabProjects; - - private SecurityOperators securityOperators; - - private DiscoveredSecuritySolutions discoveredSecuritySolutions; - - private ExternalSecuritySolutions externalSecuritySolutions; - - private JitNetworkAccessPolicies jitNetworkAccessPolicies; - - private SecuritySolutions securitySolutions; - - private SecurityStandards securityStandards; - - private StandardAssignments standardAssignments; - - private CustomRecommendations customRecommendations; - - private ServerVulnerabilityAssessmentsSettings serverVulnerabilityAssessmentsSettings; - - private Settings settings; - - private SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselineRules; - - private SqlVulnerabilityAssessmentScanResults sqlVulnerabilityAssessmentScanResults; - - private Standards standards; - - private Assignments assignments; - - private Tasks tasks; - - private SecurityConnectorApplications securityConnectorApplications; - - private Assessments assessments; - - private AdvancedThreatProtections advancedThreatProtections; - - private DefenderForStorages defenderForStorages; - - private IotSecuritySolutionAnalytics iotSecuritySolutionAnalytics; - - private IotSecuritySolutions iotSecuritySolutions; - - private IotSecuritySolutionsAnalyticsAggregatedAlerts iotSecuritySolutionsAnalyticsAggregatedAlerts; - - private IotSecuritySolutionsAnalyticsRecommendations iotSecuritySolutionsAnalyticsRecommendations; - - private Locations locations; - - private OperationResults operationResults; - - private OperationStatuses operationStatuses; - - private PrivateLinks privateLinks; - - private SecureScores secureScores; - - private SecureScoreControls secureScoreControls; - - private SecureScoreControlDefinitions secureScoreControlDefinitions; - - private GitLabSubgroups gitLabSubgroups; - - private DevOpsOperationResults devOpsOperationResults; - - private AzureDevOpsRepos azureDevOpsRepos; - - private GitHubRepos gitHubRepos; - - private GitHubIssues gitHubIssues; - - private AllowedConnections allowedConnections; - - private ServerVulnerabilityAssessments serverVulnerabilityAssessments; - - private Topologies topologies; - - private SecuritySolutionsReferenceDatas securitySolutionsReferenceDatas; - - private SensitivitySettings sensitivitySettings; - - private SqlVulnerabilityAssessmentSettingsOperations sqlVulnerabilityAssessmentSettingsOperations; - - private SqlVulnerabilityAssessmentScans sqlVulnerabilityAssessmentScans; - - private SubAssessments subAssessments; - - private final SecurityCenter clientObject; - - private SecurityManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = new SecurityCenterBuilder().pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); - } - - /** - * Creates an instance of Security service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the Security service API instance. - */ - public static SecurityManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return configure().authenticate(credential, profile); - } - - /** - * Creates an instance of Security service API entry point. - * - * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. - * @param profile the Azure profile for client. - * @return the Security service API instance. - */ - public static SecurityManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new SecurityManager(httpPipeline, profile, null); - } - - /** - * Gets a Configurable instance that can be used to create SecurityManager with optional configuration. - * - * @return the Configurable instance allowing configurations. - */ - public static Configurable configure() { - return new SecurityManager.Configurable(); - } - - /** - * The Configurable allowing configurations to be set. - */ - 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-security.properties"); - - private HttpClient httpClient; - private HttpLogOptions httpLogOptions; - private final List policies = new ArrayList<>(); - private final List scopes = new ArrayList<>(); - private RetryPolicy retryPolicy; - private RetryOptions retryOptions; - private Duration defaultPollInterval; - - private Configurable() { - } - - /** - * Sets the http client. - * - * @param httpClient the HTTP client. - * @return the configurable object itself. - */ - public Configurable withHttpClient(HttpClient httpClient) { - this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); - return this; - } - - /** - * Sets the logging options to the HTTP pipeline. - * - * @param httpLogOptions the HTTP log options. - * @return the configurable object itself. - */ - public Configurable withLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); - return this; - } - - /** - * Adds the pipeline policy to the HTTP pipeline. - * - * @param policy the HTTP pipeline policy. - * @return the configurable object itself. - */ - public Configurable withPolicy(HttpPipelinePolicy policy) { - this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); - return this; - } - - /** - * Adds the scope to permission sets. - * - * @param scope the scope. - * @return the configurable object itself. - */ - public Configurable withScope(String scope) { - this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); - return this; - } - - /** - * Sets the retry policy to the HTTP pipeline. - * - * @param retryPolicy the HTTP pipeline retry policy. - * @return the configurable object itself. - */ - public Configurable withRetryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); - return this; - } - - /** - * Sets the retry options for the HTTP pipeline retry policy. - *

- * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. - * - * @param retryOptions the retry options for the HTTP pipeline retry policy. - * @return the configurable object itself. - */ - public Configurable withRetryOptions(RetryOptions retryOptions) { - this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); - return this; - } - - /** - * Sets the default poll interval, used when service does not provide "Retry-After" header. - * - * @param defaultPollInterval the default poll interval. - * @return the configurable object itself. - */ - public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval - = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); - if (this.defaultPollInterval.isNegative()) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); - } - return this; - } - - /** - * Creates an instance of Security service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the Security service API instance. - */ - public SecurityManager authenticate(TokenCredential credential, AzureProfile profile) { - 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.security") - .append("/") - .append(clientVersion); - if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder.append(" (") - .append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.name")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")) - .append("; auto-generated)"); - } else { - userAgentBuilder.append(" (auto-generated)"); - } - - if (scopes.isEmpty()) { - scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); - } - if (retryPolicy == null) { - if (retryOptions != null) { - retryPolicy = new RetryPolicy(retryOptions); - } else { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); - } - } - List policies = new ArrayList<>(); - policies.add(new UserAgentPolicy(userAgentBuilder.toString())); - policies.add(new AddHeadersFromContextPolicy()); - policies.add(new RequestIdPolicy()); - policies.addAll(this.policies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(retryPolicy); - policies.add(new AddDatePolicy()); - policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies.addAll(this.policies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); - return new SecurityManager(httpPipeline, profile, defaultPollInterval); - } - } - - /** - * Gets the resource collection API of Alerts. - * - * @return Resource collection API of Alerts. - */ - public Alerts alerts() { - if (this.alerts == null) { - this.alerts = new AlertsImpl(clientObject.getAlerts(), this); - } - return alerts; - } - - /** - * Gets the resource collection API of AlertsSuppressionRules. - * - * @return Resource collection API of AlertsSuppressionRules. - */ - public AlertsSuppressionRules alertsSuppressionRules() { - if (this.alertsSuppressionRules == null) { - this.alertsSuppressionRules - = new AlertsSuppressionRulesImpl(clientObject.getAlertsSuppressionRules(), this); - } - return alertsSuppressionRules; - } - - /** - * Gets the resource collection API of ApiCollections. - * - * @return Resource collection API of ApiCollections. - */ - public ApiCollections apiCollections() { - if (this.apiCollections == null) { - this.apiCollections = new ApiCollectionsImpl(clientObject.getApiCollections(), this); - } - return apiCollections; - } - - /** - * Gets the resource collection API of Applications. It manages Application. - * - * @return Resource collection API of Applications. - */ - public Applications applications() { - if (this.applications == null) { - this.applications = new ApplicationsImpl(clientObject.getApplications(), this); - } - return applications; - } - - /** - * Gets the resource collection API of AssessmentsMetadatas. It manages SecurityAssessmentMetadataResponse. - * - * @return Resource collection API of AssessmentsMetadatas. - */ - public AssessmentsMetadatas assessmentsMetadatas() { - if (this.assessmentsMetadatas == null) { - this.assessmentsMetadatas = new AssessmentsMetadatasImpl(clientObject.getAssessmentsMetadatas(), this); - } - return assessmentsMetadatas; - } - - /** - * Gets the resource collection API of Automations. It manages Automation. - * - * @return Resource collection API of Automations. - */ - public Automations automations() { - if (this.automations == null) { - this.automations = new AutomationsImpl(clientObject.getAutomations(), this); - } - return automations; - } - - /** - * Gets the resource collection API of SecurityContacts. It manages SecurityContact. - * - * @return Resource collection API of SecurityContacts. - */ - public SecurityContacts securityContacts() { - if (this.securityContacts == null) { - this.securityContacts = new SecurityContactsImpl(clientObject.getSecurityContacts(), this); - } - return securityContacts; - } - - /** - * Gets the resource collection API of ComplianceResults. - * - * @return Resource collection API of ComplianceResults. - */ - public ComplianceResults complianceResults() { - if (this.complianceResults == null) { - this.complianceResults = new ComplianceResultsImpl(clientObject.getComplianceResults(), this); - } - return complianceResults; - } - - /** - * Gets the resource collection API of GovernanceAssignments. It manages GovernanceAssignment. - * - * @return Resource collection API of GovernanceAssignments. - */ - public GovernanceAssignments governanceAssignments() { - if (this.governanceAssignments == null) { - this.governanceAssignments = new GovernanceAssignmentsImpl(clientObject.getGovernanceAssignments(), this); - } - return governanceAssignments; - } - - /** - * Gets the resource collection API of GovernanceRules. It manages GovernanceRule. - * - * @return Resource collection API of GovernanceRules. - */ - public GovernanceRules governanceRules() { - if (this.governanceRules == null) { - this.governanceRules = new GovernanceRulesImpl(clientObject.getGovernanceRules(), this); - } - return governanceRules; - } - - /** - * Gets the resource collection API of HealthReports. - * - * @return Resource collection API of HealthReports. - */ - public HealthReports healthReports() { - if (this.healthReports == null) { - this.healthReports = new HealthReportsImpl(clientObject.getHealthReports(), this); - } - return healthReports; - } - - /** - * Gets the resource collection API of DeviceSecurityGroups. It manages DeviceSecurityGroup. - * - * @return Resource collection API of DeviceSecurityGroups. - */ - public DeviceSecurityGroups deviceSecurityGroups() { - if (this.deviceSecurityGroups == null) { - this.deviceSecurityGroups = new DeviceSecurityGroupsImpl(clientObject.getDeviceSecurityGroups(), this); - } - return deviceSecurityGroups; - } - - /** - * Gets the resource collection API of AutoProvisioningSettings. It manages AutoProvisioningSetting. - * - * @return Resource collection API of AutoProvisioningSettings. - */ - public AutoProvisioningSettings autoProvisioningSettings() { - if (this.autoProvisioningSettings == null) { - this.autoProvisioningSettings - = new AutoProvisioningSettingsImpl(clientObject.getAutoProvisioningSettings(), this); - } - return autoProvisioningSettings; - } - - /** - * Gets the resource collection API of Compliances. - * - * @return Resource collection API of Compliances. - */ - public Compliances compliances() { - if (this.compliances == null) { - this.compliances = new CompliancesImpl(clientObject.getCompliances(), this); - } - return compliances; - } - - /** - * Gets the resource collection API of InformationProtectionPolicies. It manages InformationProtectionPolicy. - * - * @return Resource collection API of InformationProtectionPolicies. - */ - public InformationProtectionPolicies informationProtectionPolicies() { - if (this.informationProtectionPolicies == null) { - this.informationProtectionPolicies - = new InformationProtectionPoliciesImpl(clientObject.getInformationProtectionPolicies(), this); - } - return informationProtectionPolicies; - } - - /** - * Gets the resource collection API of WorkspaceSettings. It manages WorkspaceSetting. - * - * @return Resource collection API of WorkspaceSettings. - */ - public WorkspaceSettings workspaceSettings() { - if (this.workspaceSettings == null) { - this.workspaceSettings = new WorkspaceSettingsImpl(clientObject.getWorkspaceSettings(), this); - } - return workspaceSettings; - } - - /** - * Gets the resource collection API of MdeOnboardings. - * - * @return Resource collection API of MdeOnboardings. - */ - public MdeOnboardings mdeOnboardings() { - if (this.mdeOnboardings == null) { - this.mdeOnboardings = new MdeOnboardingsImpl(clientObject.getMdeOnboardings(), this); - } - return mdeOnboardings; - } - - /** - * Gets the resource collection API of Operations. - * - * @return Resource collection API of Operations. - */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); - } - return operations; - } - - /** - * Gets the resource collection API of Pricings. - * - * @return Resource collection API of Pricings. - */ - public Pricings pricings() { - if (this.pricings == null) { - this.pricings = new PricingsImpl(clientObject.getPricings(), this); - } - return pricings; - } - - /** - * Gets the resource collection API of PrivateLinkResources. - * - * @return Resource collection API of PrivateLinkResources. - */ - public PrivateLinkResources privateLinkResources() { - if (this.privateLinkResources == null) { - this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); - } - return privateLinkResources; - } - - /** - * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection. - * - * @return Resource collection API of PrivateEndpointConnections. - */ - public PrivateEndpointConnections privateEndpointConnections() { - if (this.privateEndpointConnections == null) { - this.privateEndpointConnections - = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); - } - return privateEndpointConnections; - } - - /** - * Gets the resource collection API of RegulatoryComplianceStandards. - * - * @return Resource collection API of RegulatoryComplianceStandards. - */ - public RegulatoryComplianceStandards regulatoryComplianceStandards() { - if (this.regulatoryComplianceStandards == null) { - this.regulatoryComplianceStandards - = new RegulatoryComplianceStandardsImpl(clientObject.getRegulatoryComplianceStandards(), this); - } - return regulatoryComplianceStandards; - } - - /** - * Gets the resource collection API of RegulatoryComplianceControls. - * - * @return Resource collection API of RegulatoryComplianceControls. - */ - public RegulatoryComplianceControls regulatoryComplianceControls() { - if (this.regulatoryComplianceControls == null) { - this.regulatoryComplianceControls - = new RegulatoryComplianceControlsImpl(clientObject.getRegulatoryComplianceControls(), this); - } - return regulatoryComplianceControls; - } - - /** - * Gets the resource collection API of RegulatoryComplianceAssessments. - * - * @return Resource collection API of RegulatoryComplianceAssessments. - */ - public RegulatoryComplianceAssessments regulatoryComplianceAssessments() { - if (this.regulatoryComplianceAssessments == null) { - this.regulatoryComplianceAssessments - = new RegulatoryComplianceAssessmentsImpl(clientObject.getRegulatoryComplianceAssessments(), this); - } - return regulatoryComplianceAssessments; - } - - /** - * Gets the resource collection API of SecurityConnectors. It manages SecurityConnector. - * - * @return Resource collection API of SecurityConnectors. - */ - public SecurityConnectors securityConnectors() { - if (this.securityConnectors == null) { - this.securityConnectors = new SecurityConnectorsImpl(clientObject.getSecurityConnectors(), this); - } - return securityConnectors; - } - - /** - * Gets the resource collection API of AzureDevOpsOrgs. It manages AzureDevOpsOrg. - * - * @return Resource collection API of AzureDevOpsOrgs. - */ - public AzureDevOpsOrgs azureDevOpsOrgs() { - if (this.azureDevOpsOrgs == null) { - this.azureDevOpsOrgs = new AzureDevOpsOrgsImpl(clientObject.getAzureDevOpsOrgs(), this); - } - return azureDevOpsOrgs; - } - - /** - * Gets the resource collection API of GitHubOwners. - * - * @return Resource collection API of GitHubOwners. - */ - public GitHubOwners gitHubOwners() { - if (this.gitHubOwners == null) { - this.gitHubOwners = new GitHubOwnersImpl(clientObject.getGitHubOwners(), this); - } - return gitHubOwners; - } - - /** - * Gets the resource collection API of GitLabGroups. - * - * @return Resource collection API of GitLabGroups. - */ - public GitLabGroups gitLabGroups() { - if (this.gitLabGroups == null) { - this.gitLabGroups = new GitLabGroupsImpl(clientObject.getGitLabGroups(), this); - } - return gitLabGroups; - } - - /** - * Gets the resource collection API of DevOpsConfigurations. - * - * @return Resource collection API of DevOpsConfigurations. - */ - public DevOpsConfigurations devOpsConfigurations() { - if (this.devOpsConfigurations == null) { - this.devOpsConfigurations = new DevOpsConfigurationsImpl(clientObject.getDevOpsConfigurations(), this); - } - return devOpsConfigurations; - } - - /** - * Gets the resource collection API of AzureDevOpsProjects. It manages AzureDevOpsProject. - * - * @return Resource collection API of AzureDevOpsProjects. - */ - public AzureDevOpsProjects azureDevOpsProjects() { - if (this.azureDevOpsProjects == null) { - this.azureDevOpsProjects = new AzureDevOpsProjectsImpl(clientObject.getAzureDevOpsProjects(), this); - } - return azureDevOpsProjects; - } - - /** - * Gets the resource collection API of GitLabProjects. - * - * @return Resource collection API of GitLabProjects. - */ - public GitLabProjects gitLabProjects() { - if (this.gitLabProjects == null) { - this.gitLabProjects = new GitLabProjectsImpl(clientObject.getGitLabProjects(), this); - } - return gitLabProjects; - } - - /** - * Gets the resource collection API of SecurityOperators. - * - * @return Resource collection API of SecurityOperators. - */ - public SecurityOperators securityOperators() { - if (this.securityOperators == null) { - this.securityOperators = new SecurityOperatorsImpl(clientObject.getSecurityOperators(), this); - } - return securityOperators; - } - - /** - * Gets the resource collection API of DiscoveredSecuritySolutions. - * - * @return Resource collection API of DiscoveredSecuritySolutions. - */ - public DiscoveredSecuritySolutions discoveredSecuritySolutions() { - if (this.discoveredSecuritySolutions == null) { - this.discoveredSecuritySolutions - = new DiscoveredSecuritySolutionsImpl(clientObject.getDiscoveredSecuritySolutions(), this); - } - return discoveredSecuritySolutions; - } - - /** - * Gets the resource collection API of ExternalSecuritySolutions. - * - * @return Resource collection API of ExternalSecuritySolutions. - */ - public ExternalSecuritySolutions externalSecuritySolutions() { - if (this.externalSecuritySolutions == null) { - this.externalSecuritySolutions - = new ExternalSecuritySolutionsImpl(clientObject.getExternalSecuritySolutions(), this); - } - return externalSecuritySolutions; - } - - /** - * Gets the resource collection API of JitNetworkAccessPolicies. It manages JitNetworkAccessPolicy. - * - * @return Resource collection API of JitNetworkAccessPolicies. - */ - public JitNetworkAccessPolicies jitNetworkAccessPolicies() { - if (this.jitNetworkAccessPolicies == null) { - this.jitNetworkAccessPolicies - = new JitNetworkAccessPoliciesImpl(clientObject.getJitNetworkAccessPolicies(), this); - } - return jitNetworkAccessPolicies; - } - - /** - * Gets the resource collection API of SecuritySolutions. - * - * @return Resource collection API of SecuritySolutions. - */ - public SecuritySolutions securitySolutions() { - if (this.securitySolutions == null) { - this.securitySolutions = new SecuritySolutionsImpl(clientObject.getSecuritySolutions(), this); - } - return securitySolutions; - } - - /** - * Gets the resource collection API of SecurityStandards. It manages SecurityStandard. - * - * @return Resource collection API of SecurityStandards. - */ - public SecurityStandards securityStandards() { - if (this.securityStandards == null) { - this.securityStandards = new SecurityStandardsImpl(clientObject.getSecurityStandards(), this); - } - return securityStandards; - } - - /** - * Gets the resource collection API of StandardAssignments. It manages StandardAssignment. - * - * @return Resource collection API of StandardAssignments. - */ - public StandardAssignments standardAssignments() { - if (this.standardAssignments == null) { - this.standardAssignments = new StandardAssignmentsImpl(clientObject.getStandardAssignments(), this); - } - return standardAssignments; - } - - /** - * Gets the resource collection API of CustomRecommendations. It manages CustomRecommendation. - * - * @return Resource collection API of CustomRecommendations. - */ - public CustomRecommendations customRecommendations() { - if (this.customRecommendations == null) { - this.customRecommendations = new CustomRecommendationsImpl(clientObject.getCustomRecommendations(), this); - } - return customRecommendations; - } - - /** - * Gets the resource collection API of ServerVulnerabilityAssessmentsSettings. - * - * @return Resource collection API of ServerVulnerabilityAssessmentsSettings. - */ - public ServerVulnerabilityAssessmentsSettings serverVulnerabilityAssessmentsSettings() { - if (this.serverVulnerabilityAssessmentsSettings == null) { - this.serverVulnerabilityAssessmentsSettings = new ServerVulnerabilityAssessmentsSettingsImpl( - clientObject.getServerVulnerabilityAssessmentsSettings(), this); - } - return serverVulnerabilityAssessmentsSettings; - } - - /** - * Gets the resource collection API of Settings. - * - * @return Resource collection API of Settings. - */ - public Settings settings() { - if (this.settings == null) { - this.settings = new SettingsImpl(clientObject.getSettings(), this); - } - return settings; - } - - /** - * Gets the resource collection API of SqlVulnerabilityAssessmentBaselineRules. It manages RuleResults. - * - * @return Resource collection API of SqlVulnerabilityAssessmentBaselineRules. - */ - public SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselineRules() { - if (this.sqlVulnerabilityAssessmentBaselineRules == null) { - this.sqlVulnerabilityAssessmentBaselineRules = new SqlVulnerabilityAssessmentBaselineRulesImpl( - clientObject.getSqlVulnerabilityAssessmentBaselineRules(), this); - } - return sqlVulnerabilityAssessmentBaselineRules; - } - - /** - * Gets the resource collection API of SqlVulnerabilityAssessmentScanResults. - * - * @return Resource collection API of SqlVulnerabilityAssessmentScanResults. - */ - public SqlVulnerabilityAssessmentScanResults sqlVulnerabilityAssessmentScanResults() { - if (this.sqlVulnerabilityAssessmentScanResults == null) { - this.sqlVulnerabilityAssessmentScanResults = new SqlVulnerabilityAssessmentScanResultsImpl( - clientObject.getSqlVulnerabilityAssessmentScanResults(), this); - } - return sqlVulnerabilityAssessmentScanResults; - } - - /** - * Gets the resource collection API of Standards. It manages Standard. - * - * @return Resource collection API of Standards. - */ - public Standards standards() { - if (this.standards == null) { - this.standards = new StandardsImpl(clientObject.getStandards(), this); - } - return standards; - } - - /** - * Gets the resource collection API of Assignments. It manages Assignment. - * - * @return Resource collection API of Assignments. - */ - public Assignments assignments() { - if (this.assignments == null) { - this.assignments = new AssignmentsImpl(clientObject.getAssignments(), this); - } - return assignments; - } - - /** - * Gets the resource collection API of Tasks. - * - * @return Resource collection API of Tasks. - */ - public Tasks tasks() { - if (this.tasks == null) { - this.tasks = new TasksImpl(clientObject.getTasks(), this); - } - return tasks; - } - - /** - * Gets the resource collection API of SecurityConnectorApplications. - * - * @return Resource collection API of SecurityConnectorApplications. - */ - public SecurityConnectorApplications securityConnectorApplications() { - if (this.securityConnectorApplications == null) { - this.securityConnectorApplications - = new SecurityConnectorApplicationsImpl(clientObject.getSecurityConnectorApplications(), this); - } - return securityConnectorApplications; - } - - /** - * Gets the resource collection API of Assessments. It manages SecurityAssessmentResponse. - * - * @return Resource collection API of Assessments. - */ - public Assessments assessments() { - if (this.assessments == null) { - this.assessments = new AssessmentsImpl(clientObject.getAssessments(), this); - } - return assessments; - } - - /** - * Gets the resource collection API of AdvancedThreatProtections. It manages AdvancedThreatProtectionSetting. - * - * @return Resource collection API of AdvancedThreatProtections. - */ - public AdvancedThreatProtections advancedThreatProtections() { - if (this.advancedThreatProtections == null) { - this.advancedThreatProtections - = new AdvancedThreatProtectionsImpl(clientObject.getAdvancedThreatProtections(), this); - } - return advancedThreatProtections; - } - - /** - * Gets the resource collection API of DefenderForStorages. It manages DefenderForStorageSetting. - * - * @return Resource collection API of DefenderForStorages. - */ - public DefenderForStorages defenderForStorages() { - if (this.defenderForStorages == null) { - this.defenderForStorages = new DefenderForStoragesImpl(clientObject.getDefenderForStorages(), this); - } - return defenderForStorages; - } - - /** - * Gets the resource collection API of IotSecuritySolutionAnalytics. - * - * @return Resource collection API of IotSecuritySolutionAnalytics. - */ - public IotSecuritySolutionAnalytics iotSecuritySolutionAnalytics() { - if (this.iotSecuritySolutionAnalytics == null) { - this.iotSecuritySolutionAnalytics - = new IotSecuritySolutionAnalyticsImpl(clientObject.getIotSecuritySolutionAnalytics(), this); - } - return iotSecuritySolutionAnalytics; - } - - /** - * Gets the resource collection API of IotSecuritySolutions. It manages IoTSecuritySolutionModel. - * - * @return Resource collection API of IotSecuritySolutions. - */ - public IotSecuritySolutions iotSecuritySolutions() { - if (this.iotSecuritySolutions == null) { - this.iotSecuritySolutions = new IotSecuritySolutionsImpl(clientObject.getIotSecuritySolutions(), this); - } - return iotSecuritySolutions; - } - - /** - * Gets the resource collection API of IotSecuritySolutionsAnalyticsAggregatedAlerts. - * - * @return Resource collection API of IotSecuritySolutionsAnalyticsAggregatedAlerts. - */ - public IotSecuritySolutionsAnalyticsAggregatedAlerts iotSecuritySolutionsAnalyticsAggregatedAlerts() { - if (this.iotSecuritySolutionsAnalyticsAggregatedAlerts == null) { - this.iotSecuritySolutionsAnalyticsAggregatedAlerts = new IotSecuritySolutionsAnalyticsAggregatedAlertsImpl( - clientObject.getIotSecuritySolutionsAnalyticsAggregatedAlerts(), this); - } - return iotSecuritySolutionsAnalyticsAggregatedAlerts; - } - - /** - * Gets the resource collection API of IotSecuritySolutionsAnalyticsRecommendations. - * - * @return Resource collection API of IotSecuritySolutionsAnalyticsRecommendations. - */ - public IotSecuritySolutionsAnalyticsRecommendations iotSecuritySolutionsAnalyticsRecommendations() { - if (this.iotSecuritySolutionsAnalyticsRecommendations == null) { - this.iotSecuritySolutionsAnalyticsRecommendations = new IotSecuritySolutionsAnalyticsRecommendationsImpl( - clientObject.getIotSecuritySolutionsAnalyticsRecommendations(), this); - } - return iotSecuritySolutionsAnalyticsRecommendations; - } - - /** - * Gets the resource collection API of Locations. - * - * @return Resource collection API of Locations. - */ - public Locations locations() { - if (this.locations == null) { - this.locations = new LocationsImpl(clientObject.getLocations(), this); - } - return locations; - } - - /** - * Gets the resource collection API of OperationResults. - * - * @return Resource collection API of OperationResults. - */ - public OperationResults operationResults() { - if (this.operationResults == null) { - this.operationResults = new OperationResultsImpl(clientObject.getOperationResults(), this); - } - return operationResults; - } - - /** - * Gets the resource collection API of OperationStatuses. - * - * @return Resource collection API of OperationStatuses. - */ - public OperationStatuses operationStatuses() { - if (this.operationStatuses == null) { - this.operationStatuses = new OperationStatusesImpl(clientObject.getOperationStatuses(), this); - } - return operationStatuses; - } - - /** - * Gets the resource collection API of PrivateLinks. It manages PrivateLinkResource. - * - * @return Resource collection API of PrivateLinks. - */ - public PrivateLinks privateLinks() { - if (this.privateLinks == null) { - this.privateLinks = new PrivateLinksImpl(clientObject.getPrivateLinks(), this); - } - return privateLinks; - } - - /** - * Gets the resource collection API of SecureScores. - * - * @return Resource collection API of SecureScores. - */ - public SecureScores secureScores() { - if (this.secureScores == null) { - this.secureScores = new SecureScoresImpl(clientObject.getSecureScores(), this); - } - return secureScores; - } - - /** - * Gets the resource collection API of SecureScoreControls. - * - * @return Resource collection API of SecureScoreControls. - */ - public SecureScoreControls secureScoreControls() { - if (this.secureScoreControls == null) { - this.secureScoreControls = new SecureScoreControlsImpl(clientObject.getSecureScoreControls(), this); - } - return secureScoreControls; - } - - /** - * Gets the resource collection API of SecureScoreControlDefinitions. - * - * @return Resource collection API of SecureScoreControlDefinitions. - */ - public SecureScoreControlDefinitions secureScoreControlDefinitions() { - if (this.secureScoreControlDefinitions == null) { - this.secureScoreControlDefinitions - = new SecureScoreControlDefinitionsImpl(clientObject.getSecureScoreControlDefinitions(), this); - } - return secureScoreControlDefinitions; - } - - /** - * Gets the resource collection API of GitLabSubgroups. - * - * @return Resource collection API of GitLabSubgroups. - */ - public GitLabSubgroups gitLabSubgroups() { - if (this.gitLabSubgroups == null) { - this.gitLabSubgroups = new GitLabSubgroupsImpl(clientObject.getGitLabSubgroups(), this); - } - return gitLabSubgroups; - } - - /** - * Gets the resource collection API of DevOpsOperationResults. - * - * @return Resource collection API of DevOpsOperationResults. - */ - public DevOpsOperationResults devOpsOperationResults() { - if (this.devOpsOperationResults == null) { - this.devOpsOperationResults - = new DevOpsOperationResultsImpl(clientObject.getDevOpsOperationResults(), this); - } - return devOpsOperationResults; - } - - /** - * Gets the resource collection API of AzureDevOpsRepos. It manages AzureDevOpsRepository. - * - * @return Resource collection API of AzureDevOpsRepos. - */ - public AzureDevOpsRepos azureDevOpsRepos() { - if (this.azureDevOpsRepos == null) { - this.azureDevOpsRepos = new AzureDevOpsReposImpl(clientObject.getAzureDevOpsRepos(), this); - } - return azureDevOpsRepos; - } - - /** - * Gets the resource collection API of GitHubRepos. - * - * @return Resource collection API of GitHubRepos. - */ - public GitHubRepos gitHubRepos() { - if (this.gitHubRepos == null) { - this.gitHubRepos = new GitHubReposImpl(clientObject.getGitHubRepos(), this); - } - return gitHubRepos; - } - - /** - * Gets the resource collection API of GitHubIssues. - * - * @return Resource collection API of GitHubIssues. - */ - public GitHubIssues gitHubIssues() { - if (this.gitHubIssues == null) { - this.gitHubIssues = new GitHubIssuesImpl(clientObject.getGitHubIssues(), this); - } - return gitHubIssues; - } - - /** - * Gets the resource collection API of AllowedConnections. - * - * @return Resource collection API of AllowedConnections. - */ - public AllowedConnections allowedConnections() { - if (this.allowedConnections == null) { - this.allowedConnections = new AllowedConnectionsImpl(clientObject.getAllowedConnections(), this); - } - return allowedConnections; - } - - /** - * Gets the resource collection API of ServerVulnerabilityAssessments. - * - * @return Resource collection API of ServerVulnerabilityAssessments. - */ - public ServerVulnerabilityAssessments serverVulnerabilityAssessments() { - if (this.serverVulnerabilityAssessments == null) { - this.serverVulnerabilityAssessments - = new ServerVulnerabilityAssessmentsImpl(clientObject.getServerVulnerabilityAssessments(), this); - } - return serverVulnerabilityAssessments; - } - - /** - * Gets the resource collection API of Topologies. - * - * @return Resource collection API of Topologies. - */ - public Topologies topologies() { - if (this.topologies == null) { - this.topologies = new TopologiesImpl(clientObject.getTopologies(), this); - } - return topologies; - } - - /** - * Gets the resource collection API of SecuritySolutionsReferenceDatas. - * - * @return Resource collection API of SecuritySolutionsReferenceDatas. - */ - public SecuritySolutionsReferenceDatas securitySolutionsReferenceDatas() { - if (this.securitySolutionsReferenceDatas == null) { - this.securitySolutionsReferenceDatas - = new SecuritySolutionsReferenceDatasImpl(clientObject.getSecuritySolutionsReferenceDatas(), this); - } - return securitySolutionsReferenceDatas; - } - - /** - * Gets the resource collection API of SensitivitySettings. - * - * @return Resource collection API of SensitivitySettings. - */ - public SensitivitySettings sensitivitySettings() { - if (this.sensitivitySettings == null) { - this.sensitivitySettings = new SensitivitySettingsImpl(clientObject.getSensitivitySettings(), this); - } - return sensitivitySettings; - } - - /** - * Gets the resource collection API of SqlVulnerabilityAssessmentSettingsOperations. - * - * @return Resource collection API of SqlVulnerabilityAssessmentSettingsOperations. - */ - public SqlVulnerabilityAssessmentSettingsOperations sqlVulnerabilityAssessmentSettingsOperations() { - if (this.sqlVulnerabilityAssessmentSettingsOperations == null) { - this.sqlVulnerabilityAssessmentSettingsOperations = new SqlVulnerabilityAssessmentSettingsOperationsImpl( - clientObject.getSqlVulnerabilityAssessmentSettingsOperations(), this); - } - return sqlVulnerabilityAssessmentSettingsOperations; - } - - /** - * Gets the resource collection API of SqlVulnerabilityAssessmentScans. - * - * @return Resource collection API of SqlVulnerabilityAssessmentScans. - */ - public SqlVulnerabilityAssessmentScans sqlVulnerabilityAssessmentScans() { - if (this.sqlVulnerabilityAssessmentScans == null) { - this.sqlVulnerabilityAssessmentScans - = new SqlVulnerabilityAssessmentScansImpl(clientObject.getSqlVulnerabilityAssessmentScans(), this); - } - return sqlVulnerabilityAssessmentScans; - } - - /** - * Gets the resource collection API of SubAssessments. - * - * @return Resource collection API of SubAssessments. - */ - public SubAssessments subAssessments() { - if (this.subAssessments == null) { - this.subAssessments = new SubAssessmentsImpl(clientObject.getSubAssessments(), this); - } - return subAssessments; - } - - /** - * Gets wrapped service client SecurityCenter providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. - * - * @return Wrapped service client SecurityCenter. - */ - public SecurityCenter serviceClient() { - return this.clientObject; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdvancedThreatProtectionsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdvancedThreatProtectionsClient.java deleted file mode 100644 index 2e7ed0ac78ce..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdvancedThreatProtectionsClient.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AdvancedThreatProtectionSettingInner; - -/** - * An instance of this class provides access to all the operations defined in AdvancedThreatProtectionsClient. - */ -public interface AdvancedThreatProtectionsClient { - /** - * Gets the Advanced Threat Protection settings for the specified resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 Advanced Threat Protection settings for the specified resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceId, Context context); - - /** - * Gets the Advanced Threat Protection settings for the specified resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 Advanced Threat Protection settings for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AdvancedThreatProtectionSettingInner get(String resourceId); - - /** - * Creates or updates the Advanced Threat Protection settings on a specified resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param advancedThreatProtectionSetting Advanced Threat Protection Settings. - * @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 Advanced Threat Protection resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(String resourceId, - AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting, Context context); - - /** - * Creates or updates the Advanced Threat Protection settings on a specified resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param advancedThreatProtectionSetting Advanced Threat Protection Settings. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advanced Threat Protection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AdvancedThreatProtectionSettingInner create(String resourceId, - AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsClient.java deleted file mode 100644 index a5cb3bfc0457..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsClient.java +++ /dev/null @@ -1,484 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.models.AlertInner; -import com.azure.resourcemanager.security.models.AlertSimulatorRequestBody; - -/** - * An instance of this class provides access to all the operations defined in AlertsClient. - */ -public interface AlertsClient { - /** - * Get an alert that is associated with a subscription. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @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 alert that is associated with a subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSubscriptionLevelWithResponse(String ascLocation, String alertName, Context context); - - /** - * Get an alert that is associated with a subscription. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 alert that is associated with a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AlertInner getSubscriptionLevel(String ascLocation, String alertName); - - /** - * List all the alerts that are associated with the subscription that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSubscriptionLevelByRegion(String ascLocation); - - /** - * List all the alerts that are associated with the subscription that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSubscriptionLevelByRegion(String ascLocation, Context context); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @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 updateSubscriptionLevelStateToDismissWithResponse(String ascLocation, String alertName, - Context context); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 updateSubscriptionLevelStateToDismiss(String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @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 updateSubscriptionLevelStateToResolveWithResponse(String ascLocation, String alertName, - Context context); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 updateSubscriptionLevelStateToResolve(String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @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 updateSubscriptionLevelStateToActivateWithResponse(String ascLocation, String alertName, - Context context); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 updateSubscriptionLevelStateToActivate(String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @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 updateSubscriptionLevelStateToInProgressWithResponse(String ascLocation, String alertName, - Context context); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 updateSubscriptionLevelStateToInProgress(String ascLocation, String alertName); - - /** - * Get an alert that is associated a resource group or a resource in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @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 alert that is associated a resource group or a resource in a resource group along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getResourceGroupLevelWithResponse(String resourceGroupName, String ascLocation, - String alertName, Context context); - - /** - * Get an alert that is associated a resource group or a resource in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 alert that is associated a resource group or a resource in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AlertInner getResourceGroupLevel(String resourceGroupName, String ascLocation, String alertName); - - /** - * List all the alerts that are associated with the resource group that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName); - - /** - * List all the alerts that are associated with the resource group that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName, - Context context); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @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 updateResourceGroupLevelStateToResolveWithResponse(String resourceGroupName, String ascLocation, - String alertName, Context context); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 updateResourceGroupLevelStateToResolve(String resourceGroupName, String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @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 updateResourceGroupLevelStateToDismissWithResponse(String resourceGroupName, String ascLocation, - String alertName, Context context); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 updateResourceGroupLevelStateToDismiss(String resourceGroupName, String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @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 updateResourceGroupLevelStateToActivateWithResponse(String resourceGroupName, String ascLocation, - String alertName, Context context); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 updateResourceGroupLevelStateToActivate(String resourceGroupName, String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @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 updateResourceGroupLevelStateToInProgressWithResponse(String resourceGroupName, String ascLocation, - String alertName, Context context); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 updateResourceGroupLevelStateToInProgress(String resourceGroupName, String ascLocation, String alertName); - - /** - * List all the alerts that are associated with the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List all the alerts that are associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * List all the alerts that are associated with the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List all the alerts that are associated with the 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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> beginSimulate(String ascLocation, - AlertSimulatorRequestBody alertSimulatorRequestBody); - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody The request body. - * @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> beginSimulate(String ascLocation, - AlertSimulatorRequestBody alertSimulatorRequestBody, Context context); - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 simulate(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody); - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody The request body. - * @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 simulate(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsSuppressionRulesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsSuppressionRulesClient.java deleted file mode 100644 index 75405a26ddce..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsSuppressionRulesClient.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; - -/** - * An instance of this class provides access to all the operations defined in AlertsSuppressionRulesClient. - */ -public interface AlertsSuppressionRulesClient { - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert 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 dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String alertsSuppressionRuleName, Context context); - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AlertsSuppressionRuleInner get(String alertsSuppressionRuleName); - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @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 describes the suppression rule along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String alertsSuppressionRuleName, - AlertsSuppressionRuleInner alertsSuppressionRule, Context context); - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 suppression rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AlertsSuppressionRuleInner update(String alertsSuppressionRuleName, - AlertsSuppressionRuleInner alertsSuppressionRule); - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String alertsSuppressionRuleName, Context context); - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 alertsSuppressionRuleName); - - /** - * List of all the dismiss rules for the given 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 suppression rules list for subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List of all the dismiss rules for the given subscription. - * - * @param alertType Type of the alert to get rules for. - * @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 suppression rules list for subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String alertType, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AllowedConnectionsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AllowedConnectionsClient.java deleted file mode 100644 index 6587b086fcf1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AllowedConnectionsClient.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AllowedConnectionsResourceInner; -import com.azure.resourcemanager.security.models.ConnectionType; - -/** - * An instance of this class provides access to all the operations defined in AllowedConnectionsClient. - */ -public interface AllowedConnectionsClient { - /** - * Gets the list of all possible traffic between resources for the subscription and location, based on connection - * type. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param connectionType The type of allowed connections (Internal, External). - * @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 all possible traffic between resources for the subscription and location, based on connection - * type along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String ascLocation, - ConnectionType connectionType, Context context); - - /** - * Gets the list of all possible traffic between resources for the subscription and location, based on connection - * type. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param connectionType The type of allowed connections (Internal, External). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 all possible traffic between resources for the subscription and location, based on connection - * type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AllowedConnectionsResourceInner get(String resourceGroupName, String ascLocation, ConnectionType connectionType); - - /** - * Gets the list of all possible traffic between resources for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation); - - /** - * Gets the list of all possible traffic between resources for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation, Context context); - - /** - * Gets the list of all possible traffic between resources for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets the list of all possible traffic between resources for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionsClient.java deleted file mode 100644 index 275880127541..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionsClient.java +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.models.ApiCollectionInner; - -/** - * An instance of this class provides access to all the operations defined in ApiCollectionsClient. - */ -public interface ApiCollectionsClient { - /** - * Gets an onboarded Azure API Management API - * - * Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. If an Azure API - * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the - * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @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 onboarded Azure API Management API - * - * Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByAzureApiManagementServiceWithResponse(String resourceGroupName, - String serviceName, String apiId, Context context); - - /** - * Gets an onboarded Azure API Management API - * - * Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. If an Azure API - * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the - * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 onboarded Azure API Management API - * - * Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApiCollectionInner getByAzureApiManagementService(String resourceGroupName, String serviceName, String apiId); - - /** - * Onboard an Azure API Management API to Microsoft Defender for APIs - * - * Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the - * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been - * detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 an API collection as represented by Microsoft Defender for APIs. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ApiCollectionInner> - beginOnboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId); - - /** - * Onboard an Azure API Management API to Microsoft Defender for APIs - * - * Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the - * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been - * detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @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 an API collection as represented by Microsoft Defender for APIs. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ApiCollectionInner> - beginOnboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId, Context context); - - /** - * Onboard an Azure API Management API to Microsoft Defender for APIs - * - * Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the - * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been - * detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 API collection as represented by Microsoft Defender for APIs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApiCollectionInner onboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId); - - /** - * Onboard an Azure API Management API to Microsoft Defender for APIs - * - * Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the - * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been - * detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @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 API collection as represented by Microsoft Defender for APIs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApiCollectionInner onboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId, - Context context); - - /** - * Offboard an Azure API Management API from Microsoft Defender for APIs - * - * Offboard an Azure API Management API from Microsoft Defender for APIs. The system will stop monitoring the - * operations within the Azure API Management API for intrusive behaviors. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @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 offboardAzureApiManagementApiWithResponse(String resourceGroupName, String serviceName, String apiId, - Context context); - - /** - * Offboard an Azure API Management API from Microsoft Defender for APIs - * - * Offboard an Azure API Management API from Microsoft Defender for APIs. The system will stop monitoring the - * operations within the Azure API Management API for intrusive behaviors. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 offboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId); - - /** - * Gets a list of onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. If an Azure API - * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the - * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAzureApiManagementService(String resourceGroupName, String serviceName); - - /** - * Gets a list of onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. If an Azure API - * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the - * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @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 onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByAzureApiManagementService(String resourceGroupName, String serviceName, - Context context); - - /** - * Gets a list of API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs. - * - * @throws com.azure.core.management.exception.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 API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets a list of API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs. - * - * @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 API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets a list of API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs. - * - * @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 a list of API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets a list of API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs. - * - * @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 a list of API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApplicationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApplicationsClient.java deleted file mode 100644 index 0ee1e316226a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApplicationsClient.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; - -/** - * An instance of this class provides access to all the operations defined in ApplicationsClient. - */ -public interface ApplicationsClient { - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String applicationId, Context context); - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 application for the requested scope by applicationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationInner get(String applicationId); - - /** - * Creates or update a security application on the given subscription. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @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 security Application over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String applicationId, ApplicationInner application, - Context context); - - /** - * Creates or update a security application on the given subscription. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationInner createOrUpdate(String applicationId, ApplicationInner application); - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String applicationId, Context context); - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 applicationId); - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @throws com.azure.core.management.exception.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 relevant applications over a subscription level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @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 all relevant applications over a subscription level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsClient.java deleted file mode 100644 index d63f757bcfdd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsClient.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner; -import com.azure.resourcemanager.security.models.ExpandEnum; -import com.azure.resourcemanager.security.models.SecurityAssessment; - -/** - * An instance of this class provides access to all the operations defined in AssessmentsClient. - */ -public interface AssessmentsClient { - /** - * Get a security assessment on your scanned resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param expand OData expand. Optional. - * @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 security assessment on your scanned resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceId, String assessmentName, - ExpandEnum expand, Context context); - - /** - * Get a security assessment on your scanned resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 security assessment on your scanned resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentResponseInner get(String resourceId, String assessmentName); - - /** - * Create a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assessment Calculated assessment on a pre-defined assessment metadata. - * @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 security assessment on a resource - response format along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceId, String assessmentName, - SecurityAssessment assessment, Context context); - - /** - * Create a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assessment Calculated assessment on a pre-defined assessment metadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment on a resource - response format. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentResponseInner createOrUpdate(String resourceId, String assessmentName, - SecurityAssessment assessment); - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceId, String assessmentName, Context context); - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 resourceId, String assessmentName); - - /** - * Get security assessments on all your scanned resources inside a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 security assessments on all your scanned resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * Get security assessments on all your scanned resources inside a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 security assessments on all your scanned resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsMetadatasClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsMetadatasClient.java deleted file mode 100644 index 1159e30637fc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsMetadatasClient.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner; - -/** - * An instance of this class provides access to all the operations defined in AssessmentsMetadatasClient. - */ -public interface AssessmentsMetadatasClient { - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @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 metadata information on an assessment type in a specific subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getInSubscriptionWithResponse(String assessmentMetadataName, - Context context); - - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type in a specific subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentMetadataResponseInner getInSubscription(String assessmentMetadataName); - - /** - * Create metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param assessmentMetadata AssessmentMetadata object. - * @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 security assessment metadata response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createInSubscriptionWithResponse(String assessmentMetadataName, - SecurityAssessmentMetadataResponseInner assessmentMetadata, Context context); - - /** - * Create metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param assessmentMetadata AssessmentMetadata object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentMetadataResponseInner createInSubscription(String assessmentMetadataName, - SecurityAssessmentMetadataResponseInner assessmentMetadata); - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @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 deleteInSubscriptionWithResponse(String assessmentMetadataName, Context context); - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 deleteInSubscription(String assessmentMetadataName); - - /** - * Get metadata information on all assessment types in a specific 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 metadata information on all assessment types in a specific subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySubscription(); - - /** - * Get metadata information on all assessment types in a specific 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 metadata information on all assessment types in a specific subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySubscription(Context context); - - /** - * Get metadata information on an assessment type. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @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 metadata information on an assessment type along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String assessmentMetadataName, Context context); - - /** - * Get metadata information on an assessment type. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentMetadataResponseInner get(String assessmentMetadataName); - - /** - * Get metadata information on all assessment types. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on all assessment types as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get metadata information on all assessment types. - * - * @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 metadata information on all assessment types as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssignmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssignmentsClient.java deleted file mode 100644 index ffdf62721e17..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssignmentsClient.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AssignmentInner; - -/** - * An instance of this class provides access to all the operations defined in AssignmentsClient. - */ -public interface AssignmentsClient { - /** - * Get a specific standard assignment for the requested scope by resourceId. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific standard assignment for the requested scope by resourceId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String assignmentId, - Context context); - - /** - * Get a specific standard assignment for the requested scope by resourceId. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 standard assignment for the requested scope by resourceId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AssignmentInner getByResourceGroup(String resourceGroupName, String assignmentId); - - /** - * Create a security assignment on the given scope. Will create/update the required standard assignment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @param assignment Custom standard assignment over a pre-defined scope. - * @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 security Assignment on a resource group over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String assignmentId, - AssignmentInner assignment, Context context); - - /** - * Create a security assignment on the given scope. Will create/update the required standard assignment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @param assignment Custom standard assignment over a pre-defined scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Assignment on a resource group over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AssignmentInner createOrUpdate(String resourceGroupName, String assignmentId, AssignmentInner assignment); - - /** - * Delete a standard assignment over a given scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String assignmentId, Context context); - - /** - * Delete a standard assignment over a given scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 assignmentId); - - /** - * Get a list of all relevant standardAssignments available for scope. - * - * @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 a list of all relevant standardAssignments available for scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Get a list of all relevant standardAssignments available for scope. - * - * @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 a list of all relevant standardAssignments available for scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Get a list of all relevant standardAssignments over a subscription level scope. - * - * @throws com.azure.core.management.exception.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 relevant standardAssignments over a subscription level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get a list of all relevant standardAssignments over a subscription level scope. - * - * @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 all relevant standardAssignments over a subscription level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AutoProvisioningSettingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AutoProvisioningSettingsClient.java deleted file mode 100644 index c4d690d3fe83..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AutoProvisioningSettingsClient.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; - -/** - * An instance of this class provides access to all the operations defined in AutoProvisioningSettingsClient. - */ -public interface AutoProvisioningSettingsClient { - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @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 auto provisioning setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String settingName, Context context); - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AutoProvisioningSettingInner get(String settingName); - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param setting Auto provisioning setting key. - * @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 auto provisioning setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(String settingName, AutoProvisioningSettingInner setting, - Context context); - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param setting Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AutoProvisioningSettingInner create(String settingName, AutoProvisioningSettingInner setting); - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AutomationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AutomationsClient.java deleted file mode 100644 index 6552a1ecd0a9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AutomationsClient.java +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner; -import com.azure.resourcemanager.security.models.AutomationUpdateModel; - -/** - * An instance of this class provides access to all the operations defined in AutomationsClient. - */ -public interface AutomationsClient { - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation 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 security automation resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String automationName, - Context context); - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation 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 security automation resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AutomationInner getByResourceGroup(String resourceGroupName, String automationName); - - /** - * Creates or updates a security automation. If a security automation is already created and a subsequent request is - * issued for the same automation id, then it will be updated. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 security automation resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String automationName, - AutomationInner automation, Context context); - - /** - * Creates or updates a security automation. If a security automation is already created and a subsequent request is - * issued for the same automation id, then it will be updated. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 security automation resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AutomationInner createOrUpdate(String resourceGroupName, String automationName, AutomationInner automation); - - /** - * Updates a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The update model of security automation 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 security automation resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String automationName, - AutomationUpdateModel automation, Context context); - - /** - * Updates a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The update model of security automation 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 security automation resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AutomationInner update(String resourceGroupName, String automationName, AutomationUpdateModel automation); - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String automationName, Context context); - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String automationName); - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations for the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations for the specified 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations for the specified 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 list of security automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations for the specified 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 list of security automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 security automation model state property bag along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response validateWithResponse(String resourceGroupName, String automationName, - AutomationInner automation, Context context); - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 security automation model state property bag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AutomationValidationStatusInner validate(String resourceGroupName, String automationName, - AutomationInner automation); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsOrgsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsOrgsClient.java deleted file mode 100644 index 781ba8c7b7a6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsOrgsClient.java +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.models.AzureDevOpsOrgInner; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgListResponseInner; - -/** - * An instance of this class provides access to all the operations defined in AzureDevOpsOrgsClient. - */ -public interface AzureDevOpsOrgsClient { - /** - * Returns a monitored Azure DevOps organization resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName 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 azure DevOps Organization resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String orgName, Context context); - - /** - * Returns a monitored Azure DevOps organization resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName 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 azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsOrgInner get(String resourceGroupName, String securityConnectorName, String orgName); - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsOrgInner> beginCreateOrUpdate(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg); - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @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 azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsOrgInner> beginCreateOrUpdate(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg, Context context); - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsOrgInner createOrUpdate(String resourceGroupName, String securityConnectorName, String orgName, - AzureDevOpsOrgInner azureDevOpsOrg); - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @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 azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsOrgInner createOrUpdate(String resourceGroupName, String securityConnectorName, String orgName, - AzureDevOpsOrgInner azureDevOpsOrg, Context context); - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsOrgInner> beginUpdate(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg); - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @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 azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsOrgInner> beginUpdate(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg, Context context); - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsOrgInner update(String resourceGroupName, String securityConnectorName, String orgName, - AzureDevOpsOrgInner azureDevOpsOrg); - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @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 azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsOrgInner update(String resourceGroupName, String securityConnectorName, String orgName, - AzureDevOpsOrgInner azureDevOpsOrg, Context context); - - /** - * Returns a list of Azure DevOps organizations onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * Returns a list of Azure DevOps organizations onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); - - /** - * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listAvailableWithResponse(String resourceGroupName, - String securityConnectorName, Context context); - - /** - * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsOrgListResponseInner listAvailable(String resourceGroupName, String securityConnectorName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsProjectsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsProjectsClient.java deleted file mode 100644 index 05b386661ab1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsProjectsClient.java +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.models.AzureDevOpsProjectInner; - -/** - * An instance of this class provides access to all the operations defined in AzureDevOpsProjectsClient. - */ -public interface AzureDevOpsProjectsClient { - /** - * Returns a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName 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 azure DevOps Project resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, Context context); - - /** - * Returns a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName 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 azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsProjectInner get(String resourceGroupName, String securityConnectorName, String orgName, - String projectName); - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsProjectInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, - AzureDevOpsProjectInner azureDevOpsProject); - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @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 azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsProjectInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, - AzureDevOpsProjectInner azureDevOpsProject, Context context); - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsProjectInner createOrUpdate(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, AzureDevOpsProjectInner azureDevOpsProject); - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @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 azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsProjectInner createOrUpdate(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, AzureDevOpsProjectInner azureDevOpsProject, Context context); - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsProjectInner> beginUpdate(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject); - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @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 azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsProjectInner> beginUpdate(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject, - Context context); - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsProjectInner update(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, AzureDevOpsProjectInner azureDevOpsProject); - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @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 azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsProjectInner update(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, AzureDevOpsProjectInner azureDevOpsProject, Context context); - - /** - * Returns a list of Azure DevOps projects onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, String orgName); - - /** - * Returns a list of Azure DevOps projects onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, String orgName, - Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsReposClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsReposClient.java deleted file mode 100644 index 12552cf1cd6c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AzureDevOpsReposClient.java +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.models.AzureDevOpsRepositoryInner; - -/** - * An instance of this class provides access to all the operations defined in AzureDevOpsReposClient. - */ -public interface AzureDevOpsReposClient { - /** - * Returns a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName 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 azure DevOps Repository resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName, Context context); - - /** - * Returns a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName 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 azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsRepositoryInner get(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, String repoName); - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsRepositoryInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository); - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @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 azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsRepositoryInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository, Context context); - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsRepositoryInner createOrUpdate(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository); - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @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 azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsRepositoryInner createOrUpdate(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository, Context context); - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsRepositoryInner> beginUpdate(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository); - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @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 azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AzureDevOpsRepositoryInner> beginUpdate(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository, Context context); - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsRepositoryInner update(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository); - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @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 azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AzureDevOpsRepositoryInner update(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository, Context context); - - /** - * Returns a list of Azure DevOps repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, - String orgName, String projectName); - - /** - * Returns a list of Azure DevOps repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ComplianceResultsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ComplianceResultsClient.java deleted file mode 100644 index 7b223c4f8e94..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ComplianceResultsClient.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ComplianceResultInner; - -/** - * An instance of this class provides access to all the operations defined in ComplianceResultsClient. - */ -public interface ComplianceResultsClient { - /** - * Security Compliance Result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param complianceResultName The compliance result key. - * @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 compliance result along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceId, String complianceResultName, Context context); - - /** - * Security Compliance Result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param complianceResultName The compliance result key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 compliance result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ComplianceResultInner get(String resourceId, String complianceResultName); - - /** - * Security compliance results in the subscription. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of compliance results response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * Security compliance results in the subscription. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of compliance results response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CompliancesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CompliancesClient.java deleted file mode 100644 index 942f7e99b948..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CompliancesClient.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ComplianceInner; - -/** - * An instance of this class provides access to all the operations defined in CompliancesClient. - */ -public interface CompliancesClient { - /** - * Details of a specific Compliance. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param complianceName name of the Compliance. - * @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 compliance of a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String complianceName, Context context); - - /** - * Details of a specific Compliance. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param complianceName name of the Compliance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ComplianceInner get(String scope, String complianceName); - - /** - * The Compliance scores of the specific management group. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of Compliance objects response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * The Compliance scores of the specific management group. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of Compliance objects response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomRecommendationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomRecommendationsClient.java deleted file mode 100644 index 97e338bd16b8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomRecommendationsClient.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.CustomRecommendationInner; - -/** - * An instance of this class provides access to all the operations defined in CustomRecommendationsClient. - */ -public interface CustomRecommendationsClient { - /** - * Get a specific custom recommendation for the requested scope by customRecommendationName. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific custom recommendation for the requested scope by customRecommendationName along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String customRecommendationName, Context context); - - /** - * Get a specific custom recommendation for the requested scope by customRecommendationName. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 custom recommendation for the requested scope by customRecommendationName. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CustomRecommendationInner get(String scope, String customRecommendationName); - - /** - * Creates or updates a custom recommendation over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @param customRecommendationBody Custom Recommendation body. - * @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 custom Recommendation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String scope, String customRecommendationName, - CustomRecommendationInner customRecommendationBody, Context context); - - /** - * Creates or updates a custom recommendation over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @param customRecommendationBody Custom Recommendation body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom Recommendation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CustomRecommendationInner createOrUpdate(String scope, String customRecommendationName, - CustomRecommendationInner customRecommendationBody); - - /** - * Delete a custom recommendation over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String scope, String customRecommendationName, Context context); - - /** - * Delete a custom recommendation over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 scope, String customRecommendationName); - - /** - * Get a list of all relevant custom recommendations over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant custom recommendations over a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * Get a list of all relevant custom recommendations over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant custom recommendations over a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DefenderForStoragesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DefenderForStoragesClient.java deleted file mode 100644 index c94f7392e784..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DefenderForStoragesClient.java +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.DefenderForStorageSettingInner; -import com.azure.resourcemanager.security.fluent.models.MalwareScanInner; -import com.azure.resourcemanager.security.models.SettingName; - -/** - * An instance of this class provides access to all the operations defined in DefenderForStoragesClient. - */ -public interface DefenderForStoragesClient { - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting 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 Defender for Storage settings for the specified storage account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceId, SettingName settingName, - Context context); - - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting 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 Defender for Storage settings for the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DefenderForStorageSettingInner get(String resourceId, SettingName settingName); - - /** - * Creates or updates the Defender for Storage settings on a specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param defenderForStorageSetting Defender for Storage Settings. - * @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 Defender for Storage resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(String resourceId, SettingName settingName, - DefenderForStorageSettingInner defenderForStorageSetting, Context context); - - /** - * Creates or updates the Defender for Storage settings on a specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param defenderForStorageSetting Defender for Storage Settings. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DefenderForStorageSettingInner create(String resourceId, SettingName settingName, - DefenderForStorageSettingInner defenderForStorageSetting); - - /** - * Lists the Defender for Storage settings for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of Defender for Storage settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceId); - - /** - * Lists the Defender for Storage settings for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of Defender for Storage settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceId, Context context); - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. Blobs and Files will be scanned - * for malware. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting 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 describes the state of a malware scan operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response startMalwareScanWithResponse(String resourceId, SettingName settingName, - Context context); - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. Blobs and Files will be scanned - * for malware. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting 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 describes the state of a malware scan operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MalwareScanInner startMalwareScan(String resourceId, SettingName settingName); - - /** - * Cancels a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a GUID. - * @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 describes the state of a malware scan operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response cancelMalwareScanWithResponse(String resourceId, SettingName settingName, String scanId, - Context context); - - /** - * Cancels a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 state of a malware scan operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MalwareScanInner cancelMalwareScan(String resourceId, SettingName settingName, String scanId); - - /** - * Gets the Defender for Storage malware scan for the specified storage resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a GUID. - * @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 Defender for Storage malware scan for the specified storage resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getMalwareScanWithResponse(String resourceId, SettingName settingName, String scanId, - Context context); - - /** - * Gets the Defender for Storage malware scan for the specified storage resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage malware scan for the specified storage resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MalwareScanInner getMalwareScan(String resourceId, SettingName settingName, String scanId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsConfigurationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsConfigurationsClient.java deleted file mode 100644 index 72dab439caf0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsConfigurationsClient.java +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.models.DevOpsConfigurationInner; - -/** - * An instance of this class provides access to all the operations defined in DevOpsConfigurationsClient. - */ -public interface DevOpsConfigurationsClient { - /** - * Gets a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 a DevOps Configuration along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, - Context context); - - /** - * Gets a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 a DevOps Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DevOpsConfigurationInner get(String resourceGroupName, String securityConnectorName); - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DevOpsConfigurationInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration); - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @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 devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DevOpsConfigurationInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration, - Context context); - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DevOpsConfigurationInner createOrUpdate(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration); - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @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 devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DevOpsConfigurationInner createOrUpdate(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration, Context context); - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DevOpsConfigurationInner> beginUpdate(String resourceGroupName, - String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration); - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @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 devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DevOpsConfigurationInner> beginUpdate(String resourceGroupName, - String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration, Context context); - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DevOpsConfigurationInner update(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration); - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @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 devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DevOpsConfigurationInner update(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration, Context context); - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String securityConnectorName); - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String securityConnectorName, - Context context); - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String securityConnectorName); - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String securityConnectorName, Context context); - - /** - * List DevOps Configurations. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * List DevOps Configurations. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, - Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsOperationResultsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsOperationResultsClient.java deleted file mode 100644 index 98da2518926b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DevOpsOperationResultsClient.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.OperationStatusResultInner; - -/** - * An instance of this class provides access to all the operations defined in DevOpsOperationResultsClient. - */ -public interface DevOpsOperationResultsClient { - /** - * Get devops long running operation result. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param operationResultId The operationResultId 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 devops long running operation result along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String operationResultId, Context context); - - /** - * Get devops long running operation result. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param operationResultId The operationResultId 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 devops long running operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner get(String resourceGroupName, String securityConnectorName, String operationResultId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DeviceSecurityGroupsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DeviceSecurityGroupsClient.java deleted file mode 100644 index a8dd8315efea..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DeviceSecurityGroupsClient.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.DeviceSecurityGroupInner; - -/** - * An instance of this class provides access to all the operations defined in DeviceSecurityGroupsClient. - */ -public interface DeviceSecurityGroupsClient { - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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 the device security group resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceId, String deviceSecurityGroupName, - Context context); - - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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 the device security group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeviceSecurityGroupInner get(String resourceId, String deviceSecurityGroupName); - - /** - * Use this method to creates or updates the device security group on a specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param deviceSecurityGroup Security group object. - * @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 device security group resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceId, String deviceSecurityGroupName, - DeviceSecurityGroupInner deviceSecurityGroup, Context context); - - /** - * Use this method to creates or updates the device security group on a specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param deviceSecurityGroup Security group object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeviceSecurityGroupInner createOrUpdate(String resourceId, String deviceSecurityGroupName, - DeviceSecurityGroupInner deviceSecurityGroup); - - /** - * User this method to deletes the device security group. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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 the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceId, String deviceSecurityGroupName, Context context); - - /** - * User this method to deletes the device security group. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceId, String deviceSecurityGroupName); - - /** - * Use this method get the list of device security groups for the specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of device security groups as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceId); - - /** - * Use this method get the list of device security groups for the specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of device security groups as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceId, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DiscoveredSecuritySolutionsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DiscoveredSecuritySolutionsClient.java deleted file mode 100644 index f9a187b05598..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DiscoveredSecuritySolutionsClient.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner; - -/** - * An instance of this class provides access to all the operations defined in DiscoveredSecuritySolutionsClient. - */ -public interface DiscoveredSecuritySolutionsClient { - /** - * Gets a specific discovered Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param discoveredSecuritySolutionName Name of a discovered security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific discovered Security Solution along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String ascLocation, - String discoveredSecuritySolutionName, Context context); - - /** - * Gets a specific discovered Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param discoveredSecuritySolutionName Name of a discovered security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 discovered Security Solution. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiscoveredSecuritySolutionInner get(String resourceGroupName, String ascLocation, - String discoveredSecuritySolutionName); - - /** - * Gets a list of discovered Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation); - - /** - * Gets a list of discovered Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation, Context context); - - /** - * Gets a list of discovered Security Solutions for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets a list of discovered Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ExternalSecuritySolutionsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ExternalSecuritySolutionsClient.java deleted file mode 100644 index d430d56ac610..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ExternalSecuritySolutionsClient.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner; - -/** - * An instance of this class provides access to all the operations defined in ExternalSecuritySolutionsClient. - */ -public interface ExternalSecuritySolutionsClient { - /** - * Gets a specific external Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param externalSecuritySolutionsName Name of an external security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific external Security Solution along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String ascLocation, - String externalSecuritySolutionsName, Context context); - - /** - * Gets a specific external Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param externalSecuritySolutionsName Name of an external security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 external Security Solution. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExternalSecuritySolutionInner get(String resourceGroupName, String ascLocation, - String externalSecuritySolutionsName); - - /** - * Gets a list of external Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external Security Solutions for the subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation); - - /** - * Gets a list of external Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external Security Solutions for the subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation, Context context); - - /** - * Gets a list of external security solutions for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external security solutions for the subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets a list of external security solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external security solutions for the subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubIssuesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubIssuesClient.java deleted file mode 100644 index c247ec34ae3d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubIssuesClient.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.models.IssueCreationRequest; - -/** - * An instance of this class provides access to all the operations defined in GitHubIssuesClient. - */ -public interface GitHubIssuesClient { - /** - * Creates a GitHub issue for the specified repository and assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName 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> beginCreate(String resourceGroupName, String securityConnectorName, - String ownerName, String repoName); - - /** - * Creates a GitHub issue for the specified repository and assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName parameter. - * @param createIssueRequest The request model containing details for creating the GitHub issue. - * @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> beginCreate(String resourceGroupName, String securityConnectorName, - String ownerName, String repoName, IssueCreationRequest createIssueRequest, Context context); - - /** - * Creates a GitHub issue for the specified repository and assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void create(String resourceGroupName, String securityConnectorName, String ownerName, String repoName); - - /** - * Creates a GitHub issue for the specified repository and assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName parameter. - * @param createIssueRequest The request model containing details for creating the GitHub issue. - * @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 create(String resourceGroupName, String securityConnectorName, String ownerName, String repoName, - IssueCreationRequest createIssueRequest, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubOwnersClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubOwnersClient.java deleted file mode 100644 index 49a68617398b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubOwnersClient.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GitHubOwnerInner; -import com.azure.resourcemanager.security.fluent.models.GitHubOwnerListResponseInner; - -/** - * An instance of this class provides access to all the operations defined in GitHubOwnersClient. - */ -public interface GitHubOwnersClient { - /** - * Returns a monitored GitHub owner. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName 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 gitHub Owner resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, String ownerName, - Context context); - - /** - * Returns a monitored GitHub owner. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName 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 gitHub Owner resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GitHubOwnerInner get(String resourceGroupName, String securityConnectorName, String ownerName); - - /** - * Returns a list of GitHub owners onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * Returns a list of GitHub owners onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); - - /** - * Returns a list of all GitHub owners accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listAvailableWithResponse(String resourceGroupName, - String securityConnectorName, Context context); - - /** - * Returns a list of all GitHub owners accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GitHubOwnerListResponseInner listAvailable(String resourceGroupName, String securityConnectorName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubReposClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubReposClient.java deleted file mode 100644 index 4426f41d3cb9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitHubReposClient.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GitHubRepositoryInner; - -/** - * An instance of this class provides access to all the operations defined in GitHubReposClient. - */ -public interface GitHubReposClient { - /** - * Returns a monitored GitHub repository. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName 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 gitHub Repository resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String ownerName, String repoName, Context context); - - /** - * Returns a monitored GitHub repository. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName 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 gitHub Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GitHubRepositoryInner get(String resourceGroupName, String securityConnectorName, String ownerName, - String repoName); - - /** - * Returns a list of GitHub repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, String ownerName); - - /** - * Returns a list of GitHub repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, String ownerName, - Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabGroupsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabGroupsClient.java deleted file mode 100644 index ae8ea63ddf5d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabGroupsClient.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupInner; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner; - -/** - * An instance of this class provides access to all the operations defined in GitLabGroupsClient. - */ -public interface GitLabGroupsClient { - /** - * Returns a monitored GitLab Group resource for a given fully-qualified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 gitLab Group resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String groupFQName, Context context); - - /** - * Returns a monitored GitLab Group resource for a given fully-qualified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 gitLab Group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GitLabGroupInner get(String resourceGroupName, String securityConnectorName, String groupFQName); - - /** - * Returns a list of GitLab groups onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * Returns a list of GitLab groups onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); - - /** - * Returns a list of all GitLab groups accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listAvailableWithResponse(String resourceGroupName, - String securityConnectorName, Context context); - - /** - * Returns a list of all GitLab groups accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GitLabGroupListResponseInner listAvailable(String resourceGroupName, String securityConnectorName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabProjectsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabProjectsClient.java deleted file mode 100644 index f219e7d35852..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabProjectsClient.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GitLabProjectInner; - -/** - * An instance of this class provides access to all the operations defined in GitLabProjectsClient. - */ -public interface GitLabProjectsClient { - /** - * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName parameter. - * @param projectName The projectName 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 gitLab Project resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String groupFQName, String projectName, Context context); - - /** - * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName parameter. - * @param projectName The projectName 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 gitLab Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GitLabProjectInner get(String resourceGroupName, String securityConnectorName, String groupFQName, - String projectName); - - /** - * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 a list of GitLab projects that are directly owned by given group and onboarded to the connector as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, String groupFQName); - - /** - * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 a list of GitLab projects that are directly owned by given group and onboarded to the connector as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, String groupFQName, - Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabSubgroupsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabSubgroupsClient.java deleted file mode 100644 index d8efd88e0eb9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GitLabSubgroupsClient.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner; - -/** - * An instance of this class provides access to all the operations defined in GitLabSubgroupsClient. - */ -public interface GitLabSubgroupsClient { - /** - * Gets nested subgroups of given GitLab Group which are onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 nested subgroups of given GitLab Group which are onboarded to the connector along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String resourceGroupName, String securityConnectorName, - String groupFQName, Context context); - - /** - * Gets nested subgroups of given GitLab Group which are onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 nested subgroups of given GitLab Group which are onboarded to the connector. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GitLabGroupListResponseInner list(String resourceGroupName, String securityConnectorName, String groupFQName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceAssignmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceAssignmentsClient.java deleted file mode 100644 index e89bc5e4a516..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceAssignmentsClient.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GovernanceAssignmentInner; - -/** - * An instance of this class provides access to all the operations defined in GovernanceAssignmentsClient. - */ -public interface GovernanceAssignmentsClient { - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param assignmentKey The governance assignment key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceAssignment for the requested scope by AssignmentKey along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String assessmentName, String assignmentKey, - Context context); - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param assignmentKey The governance assignment key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 governanceAssignment for the requested scope by AssignmentKey. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GovernanceAssignmentInner get(String scope, String assessmentName, String assignmentKey); - - /** - * Creates or updates a governance assignment on the given subscription. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param assignmentKey The governance assignment key. - * @param governanceAssignment Governance assignment over a subscription scope. - * @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 governance assignment over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String scope, String assessmentName, - String assignmentKey, GovernanceAssignmentInner governanceAssignment, Context context); - - /** - * Creates or updates a governance assignment on the given subscription. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param assignmentKey The governance assignment key. - * @param governanceAssignment Governance assignment over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignment over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GovernanceAssignmentInner createOrUpdate(String scope, String assessmentName, String assignmentKey, - GovernanceAssignmentInner governanceAssignment); - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param assignmentKey The governance assignment key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String scope, String assessmentName, String assignmentKey, Context context); - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param assignmentKey The governance assignment key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 scope, String assessmentName, String assignmentKey); - - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignments on all of your resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, String assessmentName); - - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @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 governance assignments on all of your resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, String assessmentName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceRulesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceRulesClient.java deleted file mode 100644 index 622bab50c54d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceRulesClient.java +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.fluent.models.OperationResultInner; -import com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams; -import com.azure.resourcemanager.security.models.GovernanceRulesOperationResultsResponse; - -/** - * An instance of this class provides access to all the operations defined in GovernanceRulesClient. - */ -public interface GovernanceRulesClient { - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governance rule for the requested scope by ruleId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String ruleId, Context context); - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 governance rule for the requested scope by ruleId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GovernanceRuleInner get(String scope, String ruleId); - - /** - * Creates or updates a governance rule over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param governanceRule Governance rule over a given scope. - * @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 governance rule over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String scope, String ruleId, - GovernanceRuleInner governanceRule, Context context); - - /** - * Creates or updates a governance rule over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param governanceRule Governance rule over a given scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rule over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GovernanceRuleInner createOrUpdate(String scope, String ruleId, GovernanceRuleInner governanceRule); - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 scope, String ruleId); - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @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 scope, String ruleId, Context context); - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 scope, String ruleId); - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @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 scope, String ruleId, Context context); - - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant governance rules over a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant governance rules over a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); - - /** - * Execute a governance rule. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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> beginExecute(String scope, String ruleId); - - /** - * Execute a governance rule. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @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> beginExecute(String scope, String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); - - /** - * Execute a governance rule. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 execute(String scope, String ruleId); - - /** - * Execute a governance rule. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @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 execute(String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the governance rule. - * @param ruleId The governance rule key. - * @param operationId The governance rule long running operation unique key. - * @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 governance rules long run operation result for the requested scope by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GovernanceRulesOperationResultsResponse operationResultsWithResponse(String scope, String ruleId, - String operationId, Context context); - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the governance rule. - * @param ruleId The governance rule key. - * @param operationId The governance rule long running operation unique key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationResultInner operationResults(String scope, String ruleId, String operationId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportsClient.java deleted file mode 100644 index e6a36e2283b0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportsClient.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.HealthReportInner; - -/** - * An instance of this class provides access to all the operations defined in HealthReportsClient. - */ -public interface HealthReportsClient { - /** - * Get health report of resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param healthReportName The health report key. - * @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 report of resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceId, String healthReportName, Context context); - - /** - * Get health report of resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param healthReportName The health report key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 report of resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HealthReportInner get(String resourceId, String healthReportName); - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all health reports inside a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all health reports inside a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/InformationProtectionPoliciesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/InformationProtectionPoliciesClient.java deleted file mode 100644 index f5c4cf0e9dec..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/InformationProtectionPoliciesClient.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.InformationProtectionPolicyInner; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; - -/** - * An instance of this class provides access to all the operations defined in InformationProtectionPoliciesClient. - */ -public interface InformationProtectionPoliciesClient { - /** - * Details of the information protection policy. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param informationProtectionPolicyName Name of the information protection policy. - * @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 information protection policy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, Context context); - - /** - * Details of the information protection policy. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param informationProtectionPolicyName Name of the information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InformationProtectionPolicyInner get(String scope, InformationProtectionPolicyName informationProtectionPolicyName); - - /** - * Details of the information protection policy. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param informationProtectionPolicyName Name of the information protection policy. - * @param informationProtectionPolicy Information protection policy. - * @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 information protection policy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy, Context context); - - /** - * Details of the information protection policy. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param informationProtectionPolicyName Name of the information protection policy. - * @param informationProtectionPolicy Information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InformationProtectionPolicyInner createOrUpdate(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy); - - /** - * Information protection policies of a specific management group. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 information protection policies response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * Information protection policies of a specific management group. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 information protection policies response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionAnalyticsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionAnalyticsClient.java deleted file mode 100644 index 9af38d9a26bc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionAnalyticsClient.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelInner; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelListInner; - -/** - * An instance of this class provides access to all the operations defined in IotSecuritySolutionAnalyticsClient. - */ -public interface IotSecuritySolutionAnalyticsClient { - /** - * Use this method to get IoT Security Analytics metrics. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @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 security analytics of your IoT Security solution along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String solutionName, - Context context); - - /** - * Use this method to get IoT Security Analytics metrics. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security analytics of your IoT Security solution. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IoTSecuritySolutionAnalyticsModelInner get(String resourceGroupName, String solutionName); - - /** - * Use this method to get IoT security Analytics metrics in an array. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Security analytics of your IoT Security solution along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String resourceGroupName, String solutionName, - Context context); - - /** - * Use this method to get IoT security Analytics metrics in an array. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Security analytics of your IoT Security solution. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IoTSecuritySolutionAnalyticsModelListInner list(String resourceGroupName, String solutionName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionsAnalyticsAggregatedAlertsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionsAnalyticsAggregatedAlertsClient.java deleted file mode 100644 index 10c914f31d68..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionsAnalyticsAggregatedAlertsClient.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedAlertInner; - -/** - * An instance of this class provides access to all the operations defined in - * IotSecuritySolutionsAnalyticsAggregatedAlertsClient. - */ -public interface IotSecuritySolutionsAnalyticsAggregatedAlertsClient { - /** - * Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is - * performed by alert name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated alert. - * @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 security Solution Aggregated Alert information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String solutionName, - String aggregatedAlertName, Context context); - - /** - * Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is - * performed by alert name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Solution Aggregated Alert information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IoTSecurityAggregatedAlertInner get(String resourceGroupName, String solutionName, String aggregatedAlertName); - - /** - * Use this method to get the aggregated alert list of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solution aggregated alert data as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String solutionName); - - /** - * Use this method to get the aggregated alert list of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solution aggregated alert data as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String solutionName, Integer top, - Context context); - - /** - * Use this method to dismiss an aggregated IoT Security Solution Alert. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated alert. - * @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 dismissWithResponse(String resourceGroupName, String solutionName, String aggregatedAlertName, - Context context); - - /** - * Use this method to dismiss an aggregated IoT Security Solution Alert. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 dismiss(String resourceGroupName, String solutionName, String aggregatedAlertName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionsAnalyticsRecommendationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionsAnalyticsRecommendationsClient.java deleted file mode 100644 index 265ef8781489..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionsAnalyticsRecommendationsClient.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedRecommendationInner; - -/** - * An instance of this class provides access to all the operations defined in - * IotSecuritySolutionsAnalyticsRecommendationsClient. - */ -public interface IotSecuritySolutionsAnalyticsRecommendationsClient { - /** - * Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This - * aggregation is performed by recommendation name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedRecommendationName Name of the recommendation aggregated for this query. - * @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 ioT Security solution recommendation information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String solutionName, - String aggregatedRecommendationName, Context context); - - /** - * Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This - * aggregation is performed by recommendation name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedRecommendationName Name of the recommendation aggregated for this query. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution recommendation information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IoTSecurityAggregatedRecommendationInner get(String resourceGroupName, String solutionName, - String aggregatedRecommendationName); - - /** - * Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solution aggregated recommendations as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String solutionName); - - /** - * Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solution aggregated recommendations as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String solutionName, - Integer top, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionsClient.java deleted file mode 100644 index b6da73b70b0d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionsClient.java +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionModelInner; -import com.azure.resourcemanager.security.models.UpdateIotSecuritySolutionData; - -/** - * An instance of this class provides access to all the operations defined in IotSecuritySolutionsClient. - */ -public interface IotSecuritySolutionsClient { - /** - * User this method to get details of a specific IoT Security solution based on solution name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @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 ioT Security solution configuration and resource information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, - String solutionName, Context context); - - /** - * User this method to get details of a specific IoT Security solution based on solution name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution configuration and resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IoTSecuritySolutionModelInner getByResourceGroup(String resourceGroupName, String solutionName); - - /** - * Use this method to create or update yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param iotSecuritySolutionData The security solution data. - * @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 ioT Security solution configuration and resource information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String solutionName, - IoTSecuritySolutionModelInner iotSecuritySolutionData, Context context); - - /** - * Use this method to create or update yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param iotSecuritySolutionData The security solution data. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution configuration and resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IoTSecuritySolutionModelInner createOrUpdate(String resourceGroupName, String solutionName, - IoTSecuritySolutionModelInner iotSecuritySolutionData); - - /** - * Use this method to update existing IoT Security solution tags or user defined resources. To update other fields - * use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param updateIotSecuritySolutionData The security solution data. - * @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 ioT Security solution configuration and resource information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String solutionName, - UpdateIotSecuritySolutionData updateIotSecuritySolutionData, Context context); - - /** - * Use this method to update existing IoT Security solution tags or user defined resources. To update other fields - * use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param updateIotSecuritySolutionData The security solution data. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution configuration and resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IoTSecuritySolutionModelInner update(String resourceGroupName, String solutionName, - UpdateIotSecuritySolutionData updateIotSecuritySolutionData); - - /** - * Use this method to delete yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String solutionName, Context context); - - /** - * Use this method to delete yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 solutionName); - - /** - * Use this method to get the list IoT Security solutions organized by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Use this method to get the list IoT Security solutions organized by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, String filter, - Context context); - - /** - * Use this method to get the list of IoT Security solutions by 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 list of IoT Security solutions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Use this method to get the list of IoT Security solutions by subscription. - * - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/JitNetworkAccessPoliciesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/JitNetworkAccessPoliciesClient.java deleted file mode 100644 index 214cba037833..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/JitNetworkAccessPoliciesClient.java +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyInner; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateRequest; - -/** - * An instance of this class provides access to all the operations defined in JitNetworkAccessPoliciesClient. - */ -public interface JitNetworkAccessPoliciesClient { - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @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 concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String ascLocation, - String jitNetworkAccessPolicyName, Context context); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - JitNetworkAccessPolicyInner get(String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName); - - /** - * Create a policy for protecting resources using Just-in-Time access control. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @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 concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String ascLocation, - String jitNetworkAccessPolicyName, JitNetworkAccessPolicyInner body, Context context); - - /** - * Create a policy for protecting resources using Just-in-Time access control. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @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 concrete proxy resource types can be created by aliasing this type using a specific property type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - JitNetworkAccessPolicyInner createOrUpdate(String resourceGroupName, String ascLocation, - String jitNetworkAccessPolicyName, JitNetworkAccessPolicyInner body); - - /** - * Delete a Just-in-Time access control policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName, - Context context); - - /** - * Delete a Just-in-Time access control policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 ascLocation, String jitNetworkAccessPolicyName); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroupAndRegion(String resourceGroupName, - String ascLocation); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param 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 paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroupAndRegion(String resourceGroupName, - String ascLocation, Context context); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByRegion(String ascLocation); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByRegion(String ascLocation, Context context); - - /** - * Initiate a JIT access from a specific Just-in-Time policy configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response initiateWithResponse(String resourceGroupName, String ascLocation, - String jitNetworkAccessPolicyName, JitNetworkAccessPolicyInitiateRequest body, Context context); - - /** - * Initiate a JIT access from a specific Just-in-Time policy configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @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 response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - JitNetworkAccessRequestInner initiate(String resourceGroupName, String ascLocation, - String jitNetworkAccessPolicyName, JitNetworkAccessPolicyInitiateRequest body); - - /** - * Policies for protecting resources using Just-in-Time access control. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Policies for protecting resources using Just-in-Time access control. - * - * @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 paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @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 the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @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 the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/LocationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/LocationsClient.java deleted file mode 100644 index b075c19e083c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/LocationsClient.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AscLocationInner; - -/** - * An instance of this class provides access to all the operations defined in LocationsClient. - */ -public interface LocationsClient { - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String ascLocation, Context context); - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AscLocationInner get(String ascLocation); - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their ID. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their 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 list of locations where ASC saves your data as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/MdeOnboardingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/MdeOnboardingsClient.java deleted file mode 100644 index 0844de706f7e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/MdeOnboardingsClient.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataListInner; - -/** - * An instance of this class provides access to all the operations defined in MdeOnboardingsClient. - */ -public interface MdeOnboardingsClient { - /** - * The default configuration or data needed to onboard the machine to MDE. - * - * @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 resource of the configuration or data needed to onboard the machine to MDE along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(Context context); - - /** - * The default configuration or data needed to onboard the machine to MDE. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource of the configuration or data needed to onboard the machine to MDE. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MdeOnboardingDataInner get(); - - /** - * The configuration or data needed to onboard the machine to MDE. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all MDE onboarding data resources along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); - - /** - * The configuration or data needed to onboard the machine to MDE. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all MDE onboarding data resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MdeOnboardingDataListInner list(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationResultsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationResultsClient.java deleted file mode 100644 index 2efc702e2356..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationResultsClient.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.models.OperationResultsGetResponse; - -/** - * An instance of this class provides access to all the operations defined in OperationResultsClient. - */ -public interface OperationResultsClient { - /** - * Returns operation results for long running operations. - * - * @param location The name of the Azure region. - * @param operationId The ID of an ongoing async operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationResultsGetResponse getWithResponse(String location, String operationId, Context context); - - /** - * Returns operation results for long running operations. - * - * @param location The name of the Azure region. - * @param operationId The ID of an ongoing async operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void get(String location, String operationId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationStatusesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationStatusesClient.java deleted file mode 100644 index ba8619cec69a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationStatusesClient.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.OperationStatusResultInner; - -/** - * An instance of this class provides access to all the operations defined in OperationStatusesClient. - */ -public interface OperationStatusesClient { - /** - * Get the status of a long running azure asynchronous operation. - * - * @param location The name of the Azure region. - * @param operationId The ID of an ongoing async operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a long running azure asynchronous operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String location, String operationId, Context context); - - /** - * Get the status of a long running azure asynchronous operation. - * - * @param location The name of the Azure region. - * @param operationId The ID of an ongoing async operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a long running azure asynchronous operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusResultInner get(String location, String operationId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationsClient.java deleted file mode 100644 index 100216b0c110..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationsClient.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.OperationInner; - -/** - * An instance of this class provides access to all the operations defined in OperationsClient. - */ -public interface OperationsClient { - /** - * Exposes all available operations for discovery purposes. - * - * @throws com.azure.core.management.exception.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 REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Exposes all available operations for discovery purposes. - * - * @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 REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/PricingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/PricingsClient.java deleted file mode 100644 index ec7dceb3b774..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/PricingsClient.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.PricingInner; -import com.azure.resourcemanager.security.fluent.models.PricingListInner; - -/** - * An instance of this class provides access to all the operations defined in PricingsClient. - */ -public interface PricingsClient { - /** - * Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a - * subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'. - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param pricingName name of the pricing 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 Defender plans pricing configurations of the selected scope (valid scopes are resource id or a - * subscription id) along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scopeId, String pricingName, Context context); - - /** - * Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a - * subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'. - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param pricingName name of the pricing 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 Defender plans pricing configurations of the selected scope (valid scopes are resource id or a - * subscription id). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PricingInner get(String scopeId, String pricingName); - - /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the scope. Valid scopes are: - * subscription id or a specific resource id (Supported resources are: 'VirtualMachines, VMSS and ARC Machines' and - * only for plan='VirtualMachines' and subPlan='P1'). - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param pricingName name of the pricing configuration. - * @param pricing Pricing object. - * @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 microsoft Defender for Cloud is provided in two pricing tiers: free and standard along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String scopeId, String pricingName, PricingInner pricing, - Context context); - - /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the scope. Valid scopes are: - * subscription id or a specific resource id (Supported resources are: 'VirtualMachines, VMSS and ARC Machines' and - * only for plan='VirtualMachines' and subPlan='P1'). - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param pricingName name of the pricing configuration. - * @param pricing Pricing object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return microsoft Defender for Cloud is provided in two pricing tiers: free and standard. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PricingInner update(String scopeId, String pricingName, PricingInner pricing); - - /** - * Deletes a provided Microsoft Defender for Cloud pricing configuration in a specific resource. Valid only for - * resource scope (Supported resources are: 'VirtualMachines, VMSS, ARC Machines, and Containers'). - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param pricingName name of the pricing 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 Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String scopeId, String pricingName, Context context); - - /** - * Deletes a provided Microsoft Defender for Cloud pricing configuration in a specific resource. Valid only for - * resource scope (Supported resources are: 'VirtualMachines, VMSS, ARC Machines, and Containers'). - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param pricingName name of the pricing 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 delete(String scopeId, String pricingName); - - /** - * Lists Microsoft Defender for Cloud pricing configurations of the scopeId, that match the optional given $filter. - * Valid scopes are: subscription id or a specific resource id (Supported resources are: 'VirtualMachines, VMSS and - * ARC Machines'). Valid $filter is: 'name in ({planName1},{planName2},...)'. If $filter is not provided, the - * unfiltered list will be returned. If '$filter=name in (planName1,planName2)' is provided, the returned list - * includes the pricings set for 'planName1' and 'planName2' only. - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of pricing configurations response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String scopeId, String filter, Context context); - - /** - * Lists Microsoft Defender for Cloud pricing configurations of the scopeId, that match the optional given $filter. - * Valid scopes are: subscription id or a specific resource id (Supported resources are: 'VirtualMachines, VMSS and - * ARC Machines'). Valid $filter is: 'name in ({planName1},{planName2},...)'. If $filter is not provided, the - * unfiltered list will be returned. If '$filter=name in (planName1,planName2)' is provided, the returned list - * includes the pricings set for 'planName1' and 'planName2' only. - * - * @param scopeId The fully qualified Azure Resource manager identifier of the 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 list of pricing configurations response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PricingListInner list(String scopeId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/PrivateEndpointConnectionsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/PrivateEndpointConnectionsClient.java deleted file mode 100644 index 3af2407cff47..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/PrivateEndpointConnectionsClient.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.models.PrivateEndpointConnectionInner; - -/** - * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. - */ -public interface PrivateEndpointConnectionsClient { - /** - * Gets the specified private endpoint connection associated with the private link. Returns the connection details, - * status, and configuration for a specific private endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * 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 specified private endpoint connection associated with the private link along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName, Context context); - - /** - * Gets the specified private endpoint connection associated with the private link. Returns the connection details, - * status, and configuration for a specific private endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * 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 specified private endpoint connection associated with the private link. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner get(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName); - - /** - * Update the state of specified private endpoint connection associated with the private link. This operation is - * typically used to approve or reject pending private endpoint connections. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param privateEndpointConnection The private endpoint connection 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 {@link SyncPoller} for polling of the private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( - String resourceGroupName, String privateLinkName, String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection); - - /** - * Update the state of specified private endpoint connection associated with the private link. This operation is - * typically used to approve or reject pending private endpoint connections. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param privateEndpointConnection The private endpoint connection 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 {@link SyncPoller} for polling of the private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( - String resourceGroupName, String privateLinkName, String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection, Context context); - - /** - * Update the state of specified private endpoint connection associated with the private link. This operation is - * typically used to approve or reject pending private endpoint connections. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param privateEndpointConnection The private endpoint connection 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 private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection); - - /** - * Update the state of specified private endpoint connection associated with the private link. This operation is - * typically used to approve or reject pending private endpoint connections. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param privateEndpointConnection The private endpoint connection 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 private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, - Context context); - - /** - * Deletes the specified private endpoint connection associated with the private link. This operation will - * disconnect the private endpoint and remove the connection configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName); - - /** - * Deletes the specified private endpoint connection associated with the private link. This operation will - * disconnect the private endpoint and remove the connection configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName, Context context); - - /** - * Deletes the specified private endpoint connection associated with the private link. This operation will - * disconnect the private endpoint and remove the connection configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String privateLinkName, String privateEndpointConnectionName); - - /** - * Deletes the specified private endpoint connection associated with the private link. This operation will - * disconnect the private endpoint and remove the connection configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String privateLinkName, String privateEndpointConnectionName, - Context context); - - /** - * Gets all private endpoint connections for a private link. Returns the list of private endpoints that are - * connected or in the process of connecting to this private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 private endpoint connections for a private link as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String privateLinkName); - - /** - * Gets all private endpoint connections for a private link. Returns the list of private endpoints that are - * connected or in the process of connecting to this private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @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 private endpoint connections for a private link as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String privateLinkName, - Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/PrivateLinkResourcesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/PrivateLinkResourcesClient.java deleted file mode 100644 index 1be91aa6e4c5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/PrivateLinkResourcesClient.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.PrivateLinkGroupResourceInner; - -/** - * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. - */ -public interface PrivateLinkResourcesClient { - /** - * Get the specified private link resource associated with the private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param groupId The group ID of the private link 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 specified private link resource associated with the private link along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String privateLinkName, - String groupId, Context context); - - /** - * Get the specified private link resource associated with the private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param groupId The group ID of the private link 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 specified private link resource associated with the private link. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkGroupResourceInner get(String resourceGroupName, String privateLinkName, String groupId); - - /** - * List all private link resources in a private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a PrivateLinkGroupResource list operation as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String privateLinkName); - - /** - * List all private link resources in a private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a PrivateLinkGroupResource list operation as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String privateLinkName, - Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/PrivateLinksClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/PrivateLinksClient.java deleted file mode 100644 index eafaa67dddd8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/PrivateLinksClient.java +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.security.models.PrivateLinkUpdate; - -/** - * An instance of this class provides access to all the operations defined in PrivateLinksClient. - */ -public interface PrivateLinksClient { - /** - * Get a private link resource. Returns the configuration and status of private endpoint connectivity for Microsoft - * Defender for Cloud services in the specified region. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @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 private link resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String privateLinkName, - Context context); - - /** - * Get a private link resource. Returns the configuration and status of private endpoint connectivity for Microsoft - * Defender for Cloud services in the specified region. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 private link resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkResourceInner getByResourceGroup(String resourceGroupName, String privateLinkName); - - /** - * Checks whether private link exists. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @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 headWithResponse(String resourceGroupName, String privateLinkName, Context context); - - /** - * Checks whether private link exists. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 head(String resourceGroupName, String privateLinkName); - - /** - * Create a private link resource. This operation creates the necessary infrastructure to enable private endpoint - * connections to Microsoft Defender for Cloud services. For updates to existing resources, use the PATCH operation. - * The operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateLink Private link request payload containing the resource information for create operations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a private link resource that enables secure, private connectivity - * to Microsoft Defender for Cloud services. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, PrivateLinkResourceInner> beginCreate(String resourceGroupName, - String privateLinkName, PrivateLinkResourceInner privateLink); - - /** - * Create a private link resource. This operation creates the necessary infrastructure to enable private endpoint - * connections to Microsoft Defender for Cloud services. For updates to existing resources, use the PATCH operation. - * The operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateLink Private link request payload containing the resource information for create 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 the {@link SyncPoller} for polling of a private link resource that enables secure, private connectivity - * to Microsoft Defender for Cloud services. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, PrivateLinkResourceInner> beginCreate(String resourceGroupName, - String privateLinkName, PrivateLinkResourceInner privateLink, Context context); - - /** - * Create a private link resource. This operation creates the necessary infrastructure to enable private endpoint - * connections to Microsoft Defender for Cloud services. For updates to existing resources, use the PATCH operation. - * The operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateLink Private link request payload containing the resource information for create operations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 private link resource that enables secure, private connectivity to Microsoft Defender for Cloud - * services. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkResourceInner create(String resourceGroupName, String privateLinkName, - PrivateLinkResourceInner privateLink); - - /** - * Create a private link resource. This operation creates the necessary infrastructure to enable private endpoint - * connections to Microsoft Defender for Cloud services. For updates to existing resources, use the PATCH operation. - * The operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateLink Private link request payload containing the resource information for create 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 a private link resource that enables secure, private connectivity to Microsoft Defender for Cloud - * services. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkResourceInner create(String resourceGroupName, String privateLinkName, - PrivateLinkResourceInner privateLink, Context context); - - /** - * Update specific properties of a private link resource. Use this operation to update mutable properties like tags - * without affecting the entire resource configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateLink private link update payload containing only the properties to be updated. - * @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 private link resource that enables secure, private connectivity to Microsoft Defender for Cloud - * services along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String privateLinkName, - PrivateLinkUpdate privateLink, Context context); - - /** - * Update specific properties of a private link resource. Use this operation to update mutable properties like tags - * without affecting the entire resource configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateLink private link update payload containing only the properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 private link resource that enables secure, private connectivity to Microsoft Defender for Cloud - * services. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkResourceInner update(String resourceGroupName, String privateLinkName, PrivateLinkUpdate privateLink); - - /** - * Delete a private link resource. This operation will remove the private link infrastructure and disconnect all - * associated private endpoints. This operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 privateLinkName); - - /** - * Delete a private link resource. This operation will remove the private link infrastructure and disconnect all - * associated private endpoints. This operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @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 privateLinkName, Context context); - - /** - * Delete a private link resource. This operation will remove the private link infrastructure and disconnect all - * associated private endpoints. This operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 privateLinkName); - - /** - * Delete a private link resource. This operation will remove the private link infrastructure and disconnect all - * associated private endpoints. This operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @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 privateLinkName, Context context); - - /** - * Lists all the private links in the specified resource group. private links enable secure, private connectivity to - * Microsoft Defender for Cloud services without exposing traffic to the public internet. Use the 'nextLink' - * property in the response to get the next page of private links for the specified resource group. - * - * @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 paginated list of private link resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the private links in the specified resource group. private links enable secure, private connectivity to - * Microsoft Defender for Cloud services without exposing traffic to the public internet. Use the 'nextLink' - * property in the response to get the next page of private links for the specified 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paginated list of private link resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Lists all the private links in the specified subscription. private links enable secure, private connectivity to - * Microsoft Defender for Cloud services without exposing traffic to the public internet. Use the 'nextLink' - * property in the response to get the next page of private links for the specified 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 paginated list of private link resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the private links in the specified subscription. private links enable secure, private connectivity to - * Microsoft Defender for Cloud services without exposing traffic to the public internet. Use the 'nextLink' - * property in the response to get the next page of private links for the specified 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 paginated list of private link resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceAssessmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceAssessmentsClient.java deleted file mode 100644 index 90ef406aa303..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceAssessmentsClient.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentInner; - -/** - * An instance of this class provides access to all the operations defined in RegulatoryComplianceAssessmentsClient. - */ -public interface RegulatoryComplianceAssessmentsClient { - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @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 regulatory compliance assessment details and state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String regulatoryComplianceAssessmentName, Context context); - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RegulatoryComplianceAssessmentInner get(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String regulatoryComplianceAssessmentName); - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName); - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String filter, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceControlsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceControlsClient.java deleted file mode 100644 index 9d3450780b99..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceControlsClient.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceControlInner; - -/** - * An instance of this class provides access to all the operations defined in RegulatoryComplianceControlsClient. - */ -public interface RegulatoryComplianceControlsClient { - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @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 regulatory compliance control details and state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, Context context); - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RegulatoryComplianceControlInner get(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName); - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String regulatoryComplianceStandardName); - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String regulatoryComplianceStandardName, String filter, - Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceStandardsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceStandardsClient.java deleted file mode 100644 index 4b43e864806f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceStandardsClient.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardInner; - -/** - * An instance of this class provides access to all the operations defined in RegulatoryComplianceStandardsClient. - */ -public interface RegulatoryComplianceStandardsClient { - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @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 regulatory compliance standard details and state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String regulatoryComplianceStandardName, - Context context); - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RegulatoryComplianceStandardInner get(String regulatoryComplianceStandardName); - - /** - * Supported regulatory compliance standards details and state. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Supported regulatory compliance standards details and state. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecureScoreControlDefinitionsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecureScoreControlDefinitionsClient.java deleted file mode 100644 index 5a5e4458f29b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecureScoreControlDefinitionsClient.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner; - -/** - * An instance of this class provides access to all the operations defined in SecureScoreControlDefinitionsClient. - */ -public interface SecureScoreControlDefinitionsClient { - /** - * List the available security controls, their assessments, and the max score. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List the available security controls, their assessments, and the max score. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * For a specified subscription, list the available security controls, their assessments, and the max score. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySubscription(); - - /** - * For a specified subscription, list the available security controls, their assessments, and the max score. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySubscription(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecureScoreControlsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecureScoreControlsClient.java deleted file mode 100644 index 2cb1b125b276..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecureScoreControlsClient.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDetailsInner; -import com.azure.resourcemanager.security.models.ExpandControlsEnum; - -/** - * An instance of this class provides access to all the operations defined in SecureScoreControlsClient. - */ -public interface SecureScoreControlsClient { - /** - * Get all security controls for a specific initiative within a scope. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 security controls for a specific initiative within a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySecureScore(String secureScoreName); - - /** - * Get all security controls for a specific initiative within a scope. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @param expand OData expand. Optional. - * @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 security controls for a specific initiative within a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySecureScore(String secureScoreName, ExpandControlsEnum expand, - Context context); - - /** - * Get all security controls within a scope. - * - * @throws com.azure.core.management.exception.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 security controls within a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get all security controls within a scope. - * - * @param expand OData expand. Optional. - * @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 security controls within a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(ExpandControlsEnum expand, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecureScoresClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecureScoresClient.java deleted file mode 100644 index 4522116e871d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecureScoresClient.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecureScoreItemInner; - -/** - * An instance of this class provides access to all the operations defined in SecureScoresClient. - */ -public interface SecureScoresClient { - /** - * Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC - * Default initiative, use 'ascScore'. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @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 secure score for a specific Microsoft Defender for Cloud initiative within your current scope along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String secureScoreName, Context context); - - /** - * Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC - * Default initiative, use 'ascScore'. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secure score for a specific Microsoft Defender for Cloud initiative within your current scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecureScoreItemInner get(String secureScoreName); - - /** - * List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of secure scores as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of secure scores as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java deleted file mode 100644 index cf6094bb591f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java +++ /dev/null @@ -1,559 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** - * The interface for SecurityCenter class. - */ -public interface SecurityCenter { - /** - * Gets Service host. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * 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. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the AlertsClient object to access its operations. - * - * @return the AlertsClient object. - */ - AlertsClient getAlerts(); - - /** - * Gets the AlertsSuppressionRulesClient object to access its operations. - * - * @return the AlertsSuppressionRulesClient object. - */ - AlertsSuppressionRulesClient getAlertsSuppressionRules(); - - /** - * Gets the ApiCollectionsClient object to access its operations. - * - * @return the ApiCollectionsClient object. - */ - ApiCollectionsClient getApiCollections(); - - /** - * Gets the ApplicationsClient object to access its operations. - * - * @return the ApplicationsClient object. - */ - ApplicationsClient getApplications(); - - /** - * Gets the AssessmentsMetadatasClient object to access its operations. - * - * @return the AssessmentsMetadatasClient object. - */ - AssessmentsMetadatasClient getAssessmentsMetadatas(); - - /** - * Gets the AutomationsClient object to access its operations. - * - * @return the AutomationsClient object. - */ - AutomationsClient getAutomations(); - - /** - * Gets the SecurityContactsClient object to access its operations. - * - * @return the SecurityContactsClient object. - */ - SecurityContactsClient getSecurityContacts(); - - /** - * Gets the ComplianceResultsClient object to access its operations. - * - * @return the ComplianceResultsClient object. - */ - ComplianceResultsClient getComplianceResults(); - - /** - * Gets the GovernanceAssignmentsClient object to access its operations. - * - * @return the GovernanceAssignmentsClient object. - */ - GovernanceAssignmentsClient getGovernanceAssignments(); - - /** - * Gets the GovernanceRulesClient object to access its operations. - * - * @return the GovernanceRulesClient object. - */ - GovernanceRulesClient getGovernanceRules(); - - /** - * Gets the HealthReportsClient object to access its operations. - * - * @return the HealthReportsClient object. - */ - HealthReportsClient getHealthReports(); - - /** - * Gets the DeviceSecurityGroupsClient object to access its operations. - * - * @return the DeviceSecurityGroupsClient object. - */ - DeviceSecurityGroupsClient getDeviceSecurityGroups(); - - /** - * Gets the AutoProvisioningSettingsClient object to access its operations. - * - * @return the AutoProvisioningSettingsClient object. - */ - AutoProvisioningSettingsClient getAutoProvisioningSettings(); - - /** - * Gets the CompliancesClient object to access its operations. - * - * @return the CompliancesClient object. - */ - CompliancesClient getCompliances(); - - /** - * Gets the InformationProtectionPoliciesClient object to access its operations. - * - * @return the InformationProtectionPoliciesClient object. - */ - InformationProtectionPoliciesClient getInformationProtectionPolicies(); - - /** - * Gets the WorkspaceSettingsClient object to access its operations. - * - * @return the WorkspaceSettingsClient object. - */ - WorkspaceSettingsClient getWorkspaceSettings(); - - /** - * Gets the MdeOnboardingsClient object to access its operations. - * - * @return the MdeOnboardingsClient object. - */ - MdeOnboardingsClient getMdeOnboardings(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - - /** - * Gets the PricingsClient object to access its operations. - * - * @return the PricingsClient object. - */ - PricingsClient getPricings(); - - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - PrivateLinkResourcesClient getPrivateLinkResources(); - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - PrivateEndpointConnectionsClient getPrivateEndpointConnections(); - - /** - * Gets the RegulatoryComplianceStandardsClient object to access its operations. - * - * @return the RegulatoryComplianceStandardsClient object. - */ - RegulatoryComplianceStandardsClient getRegulatoryComplianceStandards(); - - /** - * Gets the RegulatoryComplianceControlsClient object to access its operations. - * - * @return the RegulatoryComplianceControlsClient object. - */ - RegulatoryComplianceControlsClient getRegulatoryComplianceControls(); - - /** - * Gets the RegulatoryComplianceAssessmentsClient object to access its operations. - * - * @return the RegulatoryComplianceAssessmentsClient object. - */ - RegulatoryComplianceAssessmentsClient getRegulatoryComplianceAssessments(); - - /** - * Gets the SecurityConnectorsClient object to access its operations. - * - * @return the SecurityConnectorsClient object. - */ - SecurityConnectorsClient getSecurityConnectors(); - - /** - * Gets the AzureDevOpsOrgsClient object to access its operations. - * - * @return the AzureDevOpsOrgsClient object. - */ - AzureDevOpsOrgsClient getAzureDevOpsOrgs(); - - /** - * Gets the GitHubOwnersClient object to access its operations. - * - * @return the GitHubOwnersClient object. - */ - GitHubOwnersClient getGitHubOwners(); - - /** - * Gets the GitLabGroupsClient object to access its operations. - * - * @return the GitLabGroupsClient object. - */ - GitLabGroupsClient getGitLabGroups(); - - /** - * Gets the DevOpsConfigurationsClient object to access its operations. - * - * @return the DevOpsConfigurationsClient object. - */ - DevOpsConfigurationsClient getDevOpsConfigurations(); - - /** - * Gets the AzureDevOpsProjectsClient object to access its operations. - * - * @return the AzureDevOpsProjectsClient object. - */ - AzureDevOpsProjectsClient getAzureDevOpsProjects(); - - /** - * Gets the GitLabProjectsClient object to access its operations. - * - * @return the GitLabProjectsClient object. - */ - GitLabProjectsClient getGitLabProjects(); - - /** - * Gets the SecurityOperatorsClient object to access its operations. - * - * @return the SecurityOperatorsClient object. - */ - SecurityOperatorsClient getSecurityOperators(); - - /** - * Gets the DiscoveredSecuritySolutionsClient object to access its operations. - * - * @return the DiscoveredSecuritySolutionsClient object. - */ - DiscoveredSecuritySolutionsClient getDiscoveredSecuritySolutions(); - - /** - * Gets the ExternalSecuritySolutionsClient object to access its operations. - * - * @return the ExternalSecuritySolutionsClient object. - */ - ExternalSecuritySolutionsClient getExternalSecuritySolutions(); - - /** - * Gets the JitNetworkAccessPoliciesClient object to access its operations. - * - * @return the JitNetworkAccessPoliciesClient object. - */ - JitNetworkAccessPoliciesClient getJitNetworkAccessPolicies(); - - /** - * Gets the SecuritySolutionsClient object to access its operations. - * - * @return the SecuritySolutionsClient object. - */ - SecuritySolutionsClient getSecuritySolutions(); - - /** - * Gets the SecurityStandardsClient object to access its operations. - * - * @return the SecurityStandardsClient object. - */ - SecurityStandardsClient getSecurityStandards(); - - /** - * Gets the StandardAssignmentsClient object to access its operations. - * - * @return the StandardAssignmentsClient object. - */ - StandardAssignmentsClient getStandardAssignments(); - - /** - * Gets the CustomRecommendationsClient object to access its operations. - * - * @return the CustomRecommendationsClient object. - */ - CustomRecommendationsClient getCustomRecommendations(); - - /** - * Gets the ServerVulnerabilityAssessmentsSettingsClient object to access its operations. - * - * @return the ServerVulnerabilityAssessmentsSettingsClient object. - */ - ServerVulnerabilityAssessmentsSettingsClient getServerVulnerabilityAssessmentsSettings(); - - /** - * Gets the SettingsClient object to access its operations. - * - * @return the SettingsClient object. - */ - SettingsClient getSettings(); - - /** - * Gets the SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentBaselineRulesClient object. - */ - SqlVulnerabilityAssessmentBaselineRulesClient getSqlVulnerabilityAssessmentBaselineRules(); - - /** - * Gets the SqlVulnerabilityAssessmentScanResultsClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentScanResultsClient object. - */ - SqlVulnerabilityAssessmentScanResultsClient getSqlVulnerabilityAssessmentScanResults(); - - /** - * Gets the StandardsClient object to access its operations. - * - * @return the StandardsClient object. - */ - StandardsClient getStandards(); - - /** - * Gets the AssignmentsClient object to access its operations. - * - * @return the AssignmentsClient object. - */ - AssignmentsClient getAssignments(); - - /** - * Gets the TasksClient object to access its operations. - * - * @return the TasksClient object. - */ - TasksClient getTasks(); - - /** - * Gets the SecurityConnectorApplicationsClient object to access its operations. - * - * @return the SecurityConnectorApplicationsClient object. - */ - SecurityConnectorApplicationsClient getSecurityConnectorApplications(); - - /** - * Gets the AssessmentsClient object to access its operations. - * - * @return the AssessmentsClient object. - */ - AssessmentsClient getAssessments(); - - /** - * Gets the AdvancedThreatProtectionsClient object to access its operations. - * - * @return the AdvancedThreatProtectionsClient object. - */ - AdvancedThreatProtectionsClient getAdvancedThreatProtections(); - - /** - * Gets the DefenderForStoragesClient object to access its operations. - * - * @return the DefenderForStoragesClient object. - */ - DefenderForStoragesClient getDefenderForStorages(); - - /** - * Gets the IotSecuritySolutionAnalyticsClient object to access its operations. - * - * @return the IotSecuritySolutionAnalyticsClient object. - */ - IotSecuritySolutionAnalyticsClient getIotSecuritySolutionAnalytics(); - - /** - * Gets the IotSecuritySolutionsClient object to access its operations. - * - * @return the IotSecuritySolutionsClient object. - */ - IotSecuritySolutionsClient getIotSecuritySolutions(); - - /** - * Gets the IotSecuritySolutionsAnalyticsAggregatedAlertsClient object to access its operations. - * - * @return the IotSecuritySolutionsAnalyticsAggregatedAlertsClient object. - */ - IotSecuritySolutionsAnalyticsAggregatedAlertsClient getIotSecuritySolutionsAnalyticsAggregatedAlerts(); - - /** - * Gets the IotSecuritySolutionsAnalyticsRecommendationsClient object to access its operations. - * - * @return the IotSecuritySolutionsAnalyticsRecommendationsClient object. - */ - IotSecuritySolutionsAnalyticsRecommendationsClient getIotSecuritySolutionsAnalyticsRecommendations(); - - /** - * Gets the LocationsClient object to access its operations. - * - * @return the LocationsClient object. - */ - LocationsClient getLocations(); - - /** - * Gets the OperationResultsClient object to access its operations. - * - * @return the OperationResultsClient object. - */ - OperationResultsClient getOperationResults(); - - /** - * Gets the OperationStatusesClient object to access its operations. - * - * @return the OperationStatusesClient object. - */ - OperationStatusesClient getOperationStatuses(); - - /** - * Gets the PrivateLinksClient object to access its operations. - * - * @return the PrivateLinksClient object. - */ - PrivateLinksClient getPrivateLinks(); - - /** - * Gets the SecureScoresClient object to access its operations. - * - * @return the SecureScoresClient object. - */ - SecureScoresClient getSecureScores(); - - /** - * Gets the SecureScoreControlsClient object to access its operations. - * - * @return the SecureScoreControlsClient object. - */ - SecureScoreControlsClient getSecureScoreControls(); - - /** - * Gets the SecureScoreControlDefinitionsClient object to access its operations. - * - * @return the SecureScoreControlDefinitionsClient object. - */ - SecureScoreControlDefinitionsClient getSecureScoreControlDefinitions(); - - /** - * Gets the GitLabSubgroupsClient object to access its operations. - * - * @return the GitLabSubgroupsClient object. - */ - GitLabSubgroupsClient getGitLabSubgroups(); - - /** - * Gets the DevOpsOperationResultsClient object to access its operations. - * - * @return the DevOpsOperationResultsClient object. - */ - DevOpsOperationResultsClient getDevOpsOperationResults(); - - /** - * Gets the AzureDevOpsReposClient object to access its operations. - * - * @return the AzureDevOpsReposClient object. - */ - AzureDevOpsReposClient getAzureDevOpsRepos(); - - /** - * Gets the GitHubReposClient object to access its operations. - * - * @return the GitHubReposClient object. - */ - GitHubReposClient getGitHubRepos(); - - /** - * Gets the GitHubIssuesClient object to access its operations. - * - * @return the GitHubIssuesClient object. - */ - GitHubIssuesClient getGitHubIssues(); - - /** - * Gets the AllowedConnectionsClient object to access its operations. - * - * @return the AllowedConnectionsClient object. - */ - AllowedConnectionsClient getAllowedConnections(); - - /** - * Gets the ServerVulnerabilityAssessmentsClient object to access its operations. - * - * @return the ServerVulnerabilityAssessmentsClient object. - */ - ServerVulnerabilityAssessmentsClient getServerVulnerabilityAssessments(); - - /** - * Gets the TopologiesClient object to access its operations. - * - * @return the TopologiesClient object. - */ - TopologiesClient getTopologies(); - - /** - * Gets the SecuritySolutionsReferenceDatasClient object to access its operations. - * - * @return the SecuritySolutionsReferenceDatasClient object. - */ - SecuritySolutionsReferenceDatasClient getSecuritySolutionsReferenceDatas(); - - /** - * Gets the SensitivitySettingsClient object to access its operations. - * - * @return the SensitivitySettingsClient object. - */ - SensitivitySettingsClient getSensitivitySettings(); - - /** - * Gets the SqlVulnerabilityAssessmentSettingsOperationsClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentSettingsOperationsClient object. - */ - SqlVulnerabilityAssessmentSettingsOperationsClient getSqlVulnerabilityAssessmentSettingsOperations(); - - /** - * Gets the SqlVulnerabilityAssessmentScansClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentScansClient object. - */ - SqlVulnerabilityAssessmentScansClient getSqlVulnerabilityAssessmentScans(); - - /** - * Gets the SubAssessmentsClient object to access its operations. - * - * @return the SubAssessmentsClient object. - */ - SubAssessmentsClient getSubAssessments(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorApplicationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorApplicationsClient.java deleted file mode 100644 index 8e184d066732..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorApplicationsClient.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; - -/** - * An instance of this class provides access to all the operations defined in SecurityConnectorApplicationsClient. - */ -public interface SecurityConnectorApplicationsClient { - /** - * Get a specific application for the requested scope by applicationId. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String applicationId, Context context); - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 application for the requested scope by applicationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationInner get(String resourceGroupName, String securityConnectorName, String applicationId); - - /** - * Creates or update a security Application on the given security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @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 security Application over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String securityConnectorName, - String applicationId, ApplicationInner application, Context context); - - /** - * Creates or update a security Application on the given security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationInner createOrUpdate(String resourceGroupName, String securityConnectorName, String applicationId, - ApplicationInner application); - - /** - * Delete an Application over a given scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String securityConnectorName, String applicationId, - Context context); - - /** - * Delete an Application over a given scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 securityConnectorName, String applicationId); - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 a list of all relevant applications over a security connector level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 a list of all relevant applications over a security connector level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorsClient.java deleted file mode 100644 index 262d6dc26057..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorsClient.java +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner; - -/** - * An instance of this class provides access to all the operations defined in SecurityConnectorsClient. - */ -public interface SecurityConnectorsClient { - /** - * Retrieves details of a specific security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 security connector resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, - String securityConnectorName, Context context); - - /** - * Retrieves details of a specific security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 security connector resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityConnectorInner getByResourceGroup(String resourceGroupName, String securityConnectorName); - - /** - * Creates or updates a security connector. If a security connector is already created and a subsequent request is - * issued for the same security connector id, then it will be updated. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector 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 security connector resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String securityConnectorName, - SecurityConnectorInner securityConnector, Context context); - - /** - * Creates or updates a security connector. If a security connector is already created and a subsequent request is - * issued for the same security connector id, then it will be updated. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector 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 security connector resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityConnectorInner createOrUpdate(String resourceGroupName, String securityConnectorName, - SecurityConnectorInner securityConnector); - - /** - * Updates a security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector 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 security connector resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String securityConnectorName, - SecurityConnectorInner securityConnector, Context context); - - /** - * Updates a security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector 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 security connector resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityConnectorInner update(String resourceGroupName, String securityConnectorName, - SecurityConnectorInner securityConnector); - - /** - * Deletes a security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String securityConnectorName, Context context); - - /** - * Deletes a security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String securityConnectorName); - - /** - * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified 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 list of security connectors response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified 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 list of security connectors response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityContactsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityContactsClient.java deleted file mode 100644 index ad1f8728847d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityContactsClient.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityContactInner; -import com.azure.resourcemanager.security.models.SecurityContactName; - -/** - * An instance of this class provides access to all the operations defined in SecurityContactsClient. - */ -public interface SecurityContactsClient { - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @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 default Security contact configurations for the subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(SecurityContactName securityContactName, Context context); - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityContactInner get(SecurityContactName securityContactName); - - /** - * Create security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param securityContact Security contact object. - * @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 contact details and configurations for notifications coming from Microsoft Defender for Cloud along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(SecurityContactName securityContactName, - SecurityContactInner securityContact, Context context); - - /** - * Create security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param securityContact Security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityContactInner create(SecurityContactName securityContactName, SecurityContactInner securityContact); - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(SecurityContactName securityContactName, Context context); - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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(SecurityContactName securityContactName); - - /** - * List all security contact configurations for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List all security contact configurations for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityOperatorsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityOperatorsClient.java deleted file mode 100644 index b89649fd489f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityOperatorsClient.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorInner; - -/** - * An instance of this class provides access to all the operations defined in SecurityOperatorsClient. - */ -public interface SecurityOperatorsClient { - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName Name of the pricing configuration. - * @param securityOperatorName Name of the security operator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific security operator for the requested scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String pricingName, String securityOperatorName, Context context); - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName Name of the pricing configuration. - * @param securityOperatorName Name of the security operator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 security operator for the requested scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityOperatorInner get(String pricingName, String securityOperatorName); - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName Name of the pricing configuration. - * @param securityOperatorName Name of the security operator. - * @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 security operator under a given subscription and pricing along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String pricingName, String securityOperatorName, - Context context); - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName Name of the pricing configuration. - * @param securityOperatorName Name of the security operator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security operator under a given subscription and pricing. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityOperatorInner createOrUpdate(String pricingName, String securityOperatorName); - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName Name of the pricing configuration. - * @param securityOperatorName Name of the security operator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String pricingName, String securityOperatorName, Context context); - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName Name of the pricing configuration. - * @param securityOperatorName Name of the security operator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 pricingName, String securityOperatorName); - - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName Name of the pricing 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 list of SecurityOperator response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String pricingName); - - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName Name of the pricing 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 list of SecurityOperator response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String pricingName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecuritySolutionsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecuritySolutionsClient.java deleted file mode 100644 index fbd3b240d99c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecuritySolutionsClient.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionInner; - -/** - * An instance of this class provides access to all the operations defined in SecuritySolutionsClient. - */ -public interface SecuritySolutionsClient { - /** - * Gets a specific Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param securitySolutionName Name of security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific Security Solution along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String ascLocation, - String securitySolutionName, Context context); - - /** - * Gets a specific Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param securitySolutionName Name of security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Security Solution. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecuritySolutionInner get(String resourceGroupName, String ascLocation, String securitySolutionName); - - /** - * Gets a list of Security Solutions for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Security Solutions for the subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets a list of Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Security Solutions for the subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecuritySolutionsReferenceDatasClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecuritySolutionsReferenceDatasClient.java deleted file mode 100644 index 421d962f4d85..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecuritySolutionsReferenceDatasClient.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionsReferenceDataListInner; - -/** - * An instance of this class provides access to all the operations defined in SecuritySolutionsReferenceDatasClient. - */ -public interface SecuritySolutionsReferenceDatasClient { - /** - * Gets a list of all supported Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all supported Security Solutions for the subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); - - /** - * Gets a list of all supported Security Solutions for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all supported Security Solutions for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecuritySolutionsReferenceDataListInner list(); - - /** - * Gets list of all supported Security Solutions for subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all supported Security Solutions for subscription and location along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listByHomeRegionWithResponse(String ascLocation, Context context); - - /** - * Gets list of all supported Security Solutions for subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all supported Security Solutions for subscription and location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecuritySolutionsReferenceDataListInner listByHomeRegion(String ascLocation); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityStandardsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityStandardsClient.java deleted file mode 100644 index 94fbf1ca19cb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityStandardsClient.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityStandardInner; - -/** - * An instance of this class provides access to all the operations defined in SecurityStandardsClient. - */ -public interface SecurityStandardsClient { - /** - * Get a specific security standard for the requested scope by standardId. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param standardId The Security Standard key - unique key for the standard type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific security standard for the requested scope by standardId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String standardId, Context context); - - /** - * Get a specific security standard for the requested scope by standardId. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param standardId The Security Standard key - unique key for the standard type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 security standard for the requested scope by standardId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityStandardInner get(String scope, String standardId); - - /** - * Creates or updates a security standard over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param standardId The Security Standard key - unique key for the standard type. - * @param standard Custom security standard over a pre-defined scope. - * @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 security Standard on a resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String scope, String standardId, - SecurityStandardInner standard, Context context); - - /** - * Creates or updates a security standard over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param standardId The Security Standard key - unique key for the standard type. - * @param standard Custom security standard over a pre-defined scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Standard on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityStandardInner createOrUpdate(String scope, String standardId, SecurityStandardInner standard); - - /** - * Delete a security standard over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param standardId The Security Standard key - unique key for the standard type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String scope, String standardId, Context context); - - /** - * Delete a security standard over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param standardId The Security Standard key - unique key for the standard type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 scope, String standardId); - - /** - * Get a list of all relevant security standards over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant security standards over a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * Get a list of all relevant security standards over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant security standards over a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SensitivitySettingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SensitivitySettingsClient.java deleted file mode 100644 index 94976bca99c7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SensitivitySettingsClient.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner; -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; -import com.azure.resourcemanager.security.models.UpdateSensitivitySettingsRequest; - -/** - * An instance of this class provides access to all the operations defined in SensitivitySettingsClient. - */ -public interface SensitivitySettingsClient { - /** - * Gets data sensitivity settings for sensitive data discovery. - * - * @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 data sensitivity settings for sensitive data discovery along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(Context context); - - /** - * Gets data sensitivity settings for sensitive data discovery. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GetSensitivitySettingsResponseInner get(); - - /** - * Create or update data sensitivity settings for sensitive data discovery. - * - * @param sensitivitySettings The data sensitivity settings to update. - * @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 data sensitivity settings for sensitive data discovery along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response - createOrUpdateWithResponse(UpdateSensitivitySettingsRequest sensitivitySettings, Context context); - - /** - * Create or update data sensitivity settings for sensitive data discovery. - * - * @param sensitivitySettings The data sensitivity settings to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GetSensitivitySettingsResponseInner createOrUpdate(UpdateSensitivitySettingsRequest sensitivitySettings); - - /** - * Gets a list with a single sensitivity settings 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 list with a single sensitivity settings resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); - - /** - * Gets a list with a single sensitivity settings resource. - * - * @throws com.azure.core.management.exception.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 with a single sensitivity settings resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GetSensitivitySettingsListResponseInner list(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ServerVulnerabilityAssessmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ServerVulnerabilityAssessmentsClient.java deleted file mode 100644 index 8902d250a647..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ServerVulnerabilityAssessmentsClient.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.SyncPoller; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentInner; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsListInner; - -/** - * An instance of this class provides access to all the operations defined in ServerVulnerabilityAssessmentsClient. - */ -public interface ServerVulnerabilityAssessmentsClient { - /** - * Gets a server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 server vulnerability assessment onboarding statuses on a given resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName, Context context); - - /** - * Gets a server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 server vulnerability assessment onboarding statuses on a given resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerVulnerabilityAssessmentInner get(String resourceGroupName, String resourceNamespace, String resourceType, - String resourceName); - - /** - * Creating a server vulnerability assessment on a resource, which will onboard a resource for having a - * vulnerability assessment on it. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 describes the server vulnerability assessment details on a resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, - String resourceNamespace, String resourceType, String resourceName, Context context); - - /** - * Creating a server vulnerability assessment on a resource, which will onboard a resource for having a - * vulnerability assessment on it. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 describes the server vulnerability assessment details on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerVulnerabilityAssessmentInner createOrUpdate(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName); - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName); - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName, Context context); - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName); - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, - Context context); - - /** - * Gets a list of server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 list of server vulnerability assessment onboarding statuses on a given resource along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listByExtendedResourceWithResponse(String resourceGroupName, - String resourceNamespace, String resourceType, String resourceName, Context context); - - /** - * Gets a list of server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 list of server vulnerability assessment onboarding statuses on a given resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerVulnerabilityAssessmentsListInner listByExtendedResource(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ServerVulnerabilityAssessmentsSettingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ServerVulnerabilityAssessmentsSettingsClient.java deleted file mode 100644 index d0b45782635a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ServerVulnerabilityAssessmentsSettingsClient.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsSettingInner; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; - -/** - * An instance of this class provides access to all the operations defined in - * ServerVulnerabilityAssessmentsSettingsClient. - */ -public interface ServerVulnerabilityAssessmentsSettingsClient { - /** - * Get a server vulnerability assessments setting of the requested kind, that is set on the subscription. - * - * @param settingKind The kind of the server vulnerability assessments setting. - * @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 server vulnerability assessments setting of the requested kind, that is set on the subscription along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response - getWithResponse(ServerVulnerabilityAssessmentsSettingKindName settingKind, Context context); - - /** - * Get a server vulnerability assessments setting of the requested kind, that is set on the subscription. - * - * @param settingKind The kind of the server vulnerability assessments setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 server vulnerability assessments setting of the requested kind, that is set on the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerVulnerabilityAssessmentsSettingInner get(ServerVulnerabilityAssessmentsSettingKindName settingKind); - - /** - * Create or update a server vulnerability assessments setting of the requested kind on the subscription. - * - * @param settingKind The kind of the server vulnerability assessments setting. - * @param serverVulnerabilityAssessmentsSetting A server vulnerability assessments setting over a predefined scope. - * @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 base vulnerability assessments setting on servers in the defined scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - ServerVulnerabilityAssessmentsSettingKindName settingKind, - ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting, Context context); - - /** - * Create or update a server vulnerability assessments setting of the requested kind on the subscription. - * - * @param settingKind The kind of the server vulnerability assessments setting. - * @param serverVulnerabilityAssessmentsSetting A server vulnerability assessments setting over a predefined scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 base vulnerability assessments setting on servers in the defined scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerVulnerabilityAssessmentsSettingInner createOrUpdate(ServerVulnerabilityAssessmentsSettingKindName settingKind, - ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting); - - /** - * Delete the server vulnerability assessments setting of the requested kind from the subscription. - * - * @param settingKind The kind of the server vulnerability assessments setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(ServerVulnerabilityAssessmentsSettingKindName settingKind, Context context); - - /** - * Delete the server vulnerability assessments setting of the requested kind from the subscription. - * - * @param settingKind The kind of the server vulnerability assessments setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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(ServerVulnerabilityAssessmentsSettingKindName settingKind); - - /** - * Get a list of all the server vulnerability assessments settings over a subscription level scope. - * - * @throws com.azure.core.management.exception.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 the server vulnerability assessments settings over a subscription level scope as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get a list of all the server vulnerability assessments settings over a subscription level scope. - * - * @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 all the server vulnerability assessments settings over a subscription level scope as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SettingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SettingsClient.java deleted file mode 100644 index 2e77c78a0245..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SettingsClient.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SettingInner; -import com.azure.resourcemanager.security.models.SettingName; - -/** - * An instance of this class provides access to all the operations defined in SettingsClient. - */ -public interface SettingsClient { - /** - * Settings of different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @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 kind of the security setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(SettingName settingName, Context context); - - /** - * Settings of different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SettingInner get(SettingName settingName); - - /** - * updating settings about different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param setting Setting object. - * @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 kind of the security setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(SettingName settingName, SettingInner setting, Context context); - - /** - * updating settings about different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param setting Setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SettingInner update(SettingName settingName, SettingInner setting); - - /** - * Settings about different configurations in Microsoft Defender for Cloud. - * - * @throws com.azure.core.management.exception.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 settings list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Settings about different configurations in Microsoft Defender for Cloud. - * - * @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 settings list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentBaselineRulesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentBaselineRulesClient.java deleted file mode 100644 index f65e4bbdaf68..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentBaselineRulesClient.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.RuleResultsInner; -import com.azure.resourcemanager.security.fluent.models.RulesResultsInner; -import com.azure.resourcemanager.security.models.RuleResultsInput; -import com.azure.resourcemanager.security.models.RulesResultsInput; - -/** - * An instance of this class provides access to all the operations defined in - * SqlVulnerabilityAssessmentBaselineRulesClient. - */ -public interface SqlVulnerabilityAssessmentBaselineRulesClient { - /** - * Gets the results for a given rule in the Baseline. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The rule Id. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @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 results for a given rule in the Baseline along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceId, String ruleId, String databaseName, Context context); - - /** - * Gets the results for a given rule in the Baseline. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The rule 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 results for a given rule in the Baseline. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RuleResultsInner get(String resourceId, String ruleId); - - /** - * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The rule Id. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param body The baseline results for this 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 rule results along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceId, String ruleId, String databaseName, - RuleResultsInput body, Context context); - - /** - * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The rule 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 rule results. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RuleResultsInner createOrUpdate(String resourceId, String ruleId); - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The rule Id. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceId, String ruleId, String databaseName, Context context); - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The rule 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceId, String ruleId); - - /** - * Gets the results for all rules in the Baseline. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 results for all rules in the Baseline as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceId); - - /** - * Gets the results for all rules in the Baseline. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @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 results for all rules in the Baseline as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceId, String databaseName, Context context); - - /** - * Set a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param body The content of the action request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of rules results along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response addWithResponse(String resourceId, String databaseName, RulesResultsInput body, - Context context); - - /** - * Set a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of rules results. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RulesResultsInner add(String resourceId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentScanResultsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentScanResultsClient.java deleted file mode 100644 index 579fb4d61cfc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentScanResultsClient.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ScanResultInner; - -/** - * An instance of this class provides access to all the operations defined in - * SqlVulnerabilityAssessmentScanResultsClient. - */ -public interface SqlVulnerabilityAssessmentScanResultsClient { - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. - * @param scanResultId The rule Id of the results. - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @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 scan results of a single rule in a scan record along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scanId, String scanResultId, String resourceId, - String databaseName, Context context); - - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. - * @param scanResultId The rule Id of the results. - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 scan results of a single rule in a scan record. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScanResultInner get(String scanId, String scanResultId, String resourceId); - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of scan results for a single scan record as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scanId, String resourceId); - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @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 scan results for a single scan record as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scanId, String resourceId, String databaseName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentScansClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentScansClient.java deleted file mode 100644 index 100fa399ceb6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentScansClient.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.models.ScanV2Inner; -import com.azure.resourcemanager.security.fluent.models.SqlVulnerabilityAssessmentScanOperationResultInner; - -/** - * An instance of this class provides access to all the operations defined in SqlVulnerabilityAssessmentScansClient. - */ -public interface SqlVulnerabilityAssessmentScansClient { - /** - * Initiates a vulnerability assessment scan. - * - * @param resourceId The resourceId 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 represents the result of a SQL Vulnerability Assessment scan - * operation, wrapped in the ARM resource envelope. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SqlVulnerabilityAssessmentScanOperationResultInner> - beginInitiateScan(String resourceId); - - /** - * Initiates a vulnerability assessment scan. - * - * @param resourceId The resourceId parameter. - * @param databaseName The databaseName 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 represents the result of a SQL Vulnerability Assessment scan - * operation, wrapped in the ARM resource envelope. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SqlVulnerabilityAssessmentScanOperationResultInner> - beginInitiateScan(String resourceId, String databaseName, Context context); - - /** - * Initiates a vulnerability assessment scan. - * - * @param resourceId The resourceId 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 represents the result of a SQL Vulnerability Assessment scan operation, wrapped in the ARM resource - * envelope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SqlVulnerabilityAssessmentScanOperationResultInner initiateScan(String resourceId); - - /** - * Initiates a vulnerability assessment scan. - * - * @param resourceId The resourceId parameter. - * @param databaseName The databaseName 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 represents the result of a SQL Vulnerability Assessment scan operation, wrapped in the ARM resource - * envelope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SqlVulnerabilityAssessmentScanOperationResultInner initiateScan(String resourceId, String databaseName, - Context context); - - /** - * Gets the result of a scan operation initiated by the InitiateScan action. - * - * @param resourceId The resourceId parameter. - * @param operationId The operationId parameter. - * @param databaseName The databaseName 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 result of a scan operation initiated by the InitiateScan action along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getScanOperationResultWithResponse(String resourceId, - String operationId, String databaseName, Context context); - - /** - * Gets the result of a scan operation initiated by the InitiateScan action. - * - * @param resourceId The resourceId parameter. - * @param operationId The operationId 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 result of a scan operation initiated by the InitiateScan action. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SqlVulnerabilityAssessmentScanOperationResultInner getScanOperationResult(String resourceId, String operationId); - - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @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 scan details of a single scan record along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scanId, String resourceId, String databaseName, Context context); - - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 scan details of a single scan record. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScanV2Inner get(String scanId, String resourceId); - - /** - * Gets a list of scan records. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of scan records as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceId); - - /** - * Gets a list of scan records. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @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 scan records as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceId, String databaseName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentSettingsOperationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentSettingsOperationsClient.java deleted file mode 100644 index d87cb09d7407..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentSettingsOperationsClient.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SqlVulnerabilityAssessmentSettingsInner; - -/** - * An instance of this class provides access to all the operations defined in - * SqlVulnerabilityAssessmentSettingsOperationsClient. - */ -public interface SqlVulnerabilityAssessmentSettingsOperationsClient { - /** - * Gets the SQL Vulnerability Assessment settings. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 SQL Vulnerability Assessment settings along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceId, Context context); - - /** - * Gets the SQL Vulnerability Assessment settings. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 SQL Vulnerability Assessment settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SqlVulnerabilityAssessmentSettingsInner get(String resourceId); - - /** - * Creates or updates the SQL Vulnerability Assessment settings. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param body The SQL Vulnerability Assessment settings. - * @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 sQL Vulnerability Assessment settings resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceId, - SqlVulnerabilityAssessmentSettingsInner body, Context context); - - /** - * Creates or updates the SQL Vulnerability Assessment settings. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 sQL Vulnerability Assessment settings resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SqlVulnerabilityAssessmentSettingsInner createOrUpdate(String resourceId); - - /** - * Deletes the SQL Vulnerability Assessment settings. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceId, Context context); - - /** - * Deletes the SQL Vulnerability Assessment settings. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/StandardAssignmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/StandardAssignmentsClient.java deleted file mode 100644 index 6562d47a8384..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/StandardAssignmentsClient.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.StandardAssignmentInner; - -/** - * An instance of this class provides access to all the operations defined in StandardAssignmentsClient. - */ -public interface StandardAssignmentsClient { - /** - * Retrieves a standard assignment. - * - * This operation retrieves a single standard assignment, given its name and the scope it was created at. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param standardAssignmentName The standard assignments assignment key - unique key for the standard assignment. - * @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 security Assignment on a resource group over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceId, String standardAssignmentName, - Context context); - - /** - * Retrieves a standard assignment. - * - * This operation retrieves a single standard assignment, given its name and the scope it was created at. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param standardAssignmentName The standard assignments assignment key - unique key for the standard assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Assignment on a resource group over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StandardAssignmentInner get(String resourceId, String standardAssignmentName); - - /** - * Creates or updates a standard assignment. - * - * This operation creates or updates a standard assignment with the given scope and name. standard assignments apply - * to all resources contained within their scope. For example, when you assign a policy at resource group scope, - * that policy applies to all resources in the group. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param standardAssignmentName The standard assignments assignment key - unique key for the standard assignment. - * @param standardAssignment Custom standard assignment over a pre-defined scope. - * @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 security Assignment on a resource group over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(String resourceId, String standardAssignmentName, - StandardAssignmentInner standardAssignment, Context context); - - /** - * Creates or updates a standard assignment. - * - * This operation creates or updates a standard assignment with the given scope and name. standard assignments apply - * to all resources contained within their scope. For example, when you assign a policy at resource group scope, - * that policy applies to all resources in the group. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param standardAssignmentName The standard assignments assignment key - unique key for the standard assignment. - * @param standardAssignment Custom standard assignment over a pre-defined scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Assignment on a resource group over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StandardAssignmentInner create(String resourceId, String standardAssignmentName, - StandardAssignmentInner standardAssignment); - - /** - * Deletes a standard assignment. - * - * This operation deletes a standard assignment, given its name and the scope it was created in. The scope of a - * standard assignment is the part of its ID preceding - * '/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}'. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param standardAssignmentName The standard assignments assignment key - unique key for the standard assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceId, String standardAssignmentName, Context context); - - /** - * Deletes a standard assignment. - * - * This operation deletes a standard assignment, given its name and the scope it was created in. The scope of a - * standard assignment is the part of its ID preceding - * '/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}'. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param standardAssignmentName The standard assignments assignment key - unique key for the standard assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 resourceId, String standardAssignmentName); - - /** - * Get a list of all relevant standard assignments over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant standard assignments over a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * Get a list of all relevant standard assignments over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant standard assignments over a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/StandardsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/StandardsClient.java deleted file mode 100644 index aceb75912ff8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/StandardsClient.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.StandardInner; - -/** - * An instance of this class provides access to all the operations defined in StandardsClient. - */ -public interface StandardsClient { - /** - * Get a specific security standard for the requested scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param standardId The Security Standard key - unique key for the standard type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific security standard for the requested scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String standardId, - Context context); - - /** - * Get a specific security standard for the requested scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param standardId The Security Standard key - unique key for the standard type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 security standard for the requested scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StandardInner getByResourceGroup(String resourceGroupName, String standardId); - - /** - * Create a security standard on the given scope. Available only for custom standards. Will create/update the - * required standard definitions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param standardId The Security Standard key - unique key for the standard type. - * @param standard Custom security standard over a pre-defined scope. - * @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 security Standard on a resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String standardId, - StandardInner standard, Context context); - - /** - * Create a security standard on the given scope. Available only for custom standards. Will create/update the - * required standard definitions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param standardId The Security Standard key - unique key for the standard type. - * @param standard Custom security standard over a pre-defined scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Standard on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - StandardInner createOrUpdate(String resourceGroupName, String standardId, StandardInner standard); - - /** - * Delete a security standard on a scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param standardId The Security Standard key - unique key for the standard type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String standardId, Context context); - - /** - * Delete a security standard on a scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param standardId The Security Standard key - unique key for the standard type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 standardId); - - /** - * Get security standards on all your resources inside a scope. - * - * @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 security standards on all your resources inside a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Get security standards on all your resources inside a scope. - * - * @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 security standards on all your resources inside a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Get a list of all relevant security standards over a subscription level scope. - * - * @throws com.azure.core.management.exception.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 relevant security standards over a subscription level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get a list of all relevant security standards over a subscription level scope. - * - * @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 all relevant security standards over a subscription level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SubAssessmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SubAssessmentsClient.java deleted file mode 100644 index f2008a31ffa7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SubAssessmentsClient.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecuritySubAssessmentInner; - -/** - * An instance of this class provides access to all the operations defined in SubAssessmentsClient. - */ -public interface SubAssessmentsClient { - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope The scope of the sub-assessment. - * @param assessmentName The security assessment key - unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment type. - * @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 security sub-assessment on your scanned resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String assessmentName, String subAssessmentName, - Context context); - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope The scope of the sub-assessment. - * @param assessmentName The security assessment key - unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 security sub-assessment on your scanned resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecuritySubAssessmentInner get(String scope, String assessmentName, String subAssessmentName); - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope The scope of the sub-assessment. - * @param assessmentName The security assessment key - unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, String assessmentName); - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope The scope of the sub-assessment. - * @param assessmentName The security assessment key - unique key for the assessment type. - * @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 security sub-assessments on all your scanned resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, String assessmentName, Context context); - - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 security sub-assessments on all your scanned resources inside a subscription scope as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAll(String scope); - - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 security sub-assessments on all your scanned resources inside a subscription scope as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAll(String scope, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TasksClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TasksClient.java deleted file mode 100644 index a93955836a33..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TasksClient.java +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityTaskInner; -import com.azure.resourcemanager.security.models.TaskUpdateActionType; - -/** - * An instance of this class provides access to all the operations defined in TasksClient. - */ -public interface TasksClient { - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @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 security task that we recommend to do in order to strengthen security along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getResourceGroupLevelTaskWithResponse(String resourceGroupName, String ascLocation, - String taskName, Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityTaskInner getResourceGroupLevelTask(String resourceGroupName, String ascLocation, String taskName); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, String ascLocation); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, String ascLocation, String filter, - Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @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 updateResourceGroupLevelTaskStateWithResponse(String resourceGroupName, String ascLocation, - String taskName, TaskUpdateActionType taskUpdateActionType, Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 updateResourceGroupLevelTaskState(String resourceGroupName, String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @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 security task that we recommend to do in order to strengthen security along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSubscriptionLevelTaskWithResponse(String ascLocation, String taskName, - Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityTaskInner getSubscriptionLevelTask(String ascLocation, String taskName); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation, String filter, Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @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 updateSubscriptionLevelTaskStateWithResponse(String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType, Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 updateSubscriptionLevelTaskState(String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TopologiesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TopologiesClient.java deleted file mode 100644 index 581f9d902f74..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TopologiesClient.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.TopologyResourceInner; - -/** - * An instance of this class provides access to all the operations defined in TopologiesClient. - */ -public interface TopologiesClient { - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String ascLocation, - String topologyResourceName, Context context); - - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TopologyResourceInner get(String resourceGroupName, String ascLocation, String topologyResourceName); - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation); - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation, Context context); - - /** - * Gets a list that allows to build a topology view of a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets a list that allows to build a topology view of a 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 a list that allows to build a topology view of a subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/WorkspaceSettingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/WorkspaceSettingsClient.java deleted file mode 100644 index c1658efd4e42..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/WorkspaceSettingsClient.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.WorkspaceSettingInner; - -/** - * An instance of this class provides access to all the operations defined in WorkspaceSettingsClient. - */ -public interface WorkspaceSettingsClient { - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @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 configures where to store the OMS agent data for workspaces under a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String workspaceSettingName, Context context); - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceSettingInner get(String workspaceSettingName); - - /** - * creating settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @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 configures where to store the OMS agent data for workspaces under a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(String workspaceSettingName, - WorkspaceSettingInner workspaceSetting, Context context); - - /** - * creating settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceSettingInner create(String workspaceSettingName, WorkspaceSettingInner workspaceSetting); - - /** - * Settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @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 configures where to store the OMS agent data for workspaces under a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String workspaceSettingName, - WorkspaceSettingInner workspaceSetting, Context context); - - /** - * Settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceSettingInner update(String workspaceSettingName, WorkspaceSettingInner workspaceSetting); - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String workspaceSettingName, Context context); - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 workspaceSettingName); - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdvancedThreatProtectionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdvancedThreatProtectionProperties.java deleted file mode 100644 index 88c03ecfacd0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdvancedThreatProtectionProperties.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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 Advanced Threat Protection settings. - */ -@Fluent -public final class AdvancedThreatProtectionProperties implements JsonSerializable { - /* - * Indicates whether Advanced Threat Protection is enabled. - */ - private Boolean isEnabled; - - /** - * Creates an instance of AdvancedThreatProtectionProperties class. - */ - public AdvancedThreatProtectionProperties() { - } - - /** - * Get the isEnabled property: Indicates whether Advanced Threat Protection is enabled. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.isEnabled; - } - - /** - * Set the isEnabled property: Indicates whether Advanced Threat Protection is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the AdvancedThreatProtectionProperties object itself. - */ - public AdvancedThreatProtectionProperties withIsEnabled(Boolean isEnabled) { - this.isEnabled = isEnabled; - 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("isEnabled", this.isEnabled); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AdvancedThreatProtectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AdvancedThreatProtectionProperties 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 AdvancedThreatProtectionProperties. - */ - public static AdvancedThreatProtectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AdvancedThreatProtectionProperties deserializedAdvancedThreatProtectionProperties - = new AdvancedThreatProtectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("isEnabled".equals(fieldName)) { - deserializedAdvancedThreatProtectionProperties.isEnabled - = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedAdvancedThreatProtectionProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdvancedThreatProtectionSettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdvancedThreatProtectionSettingInner.java deleted file mode 100644 index 50237dd19c50..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdvancedThreatProtectionSettingInner.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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 java.io.IOException; - -/** - * The Advanced Threat Protection resource. - */ -@Fluent -public final class AdvancedThreatProtectionSettingInner extends ProxyResource { - /* - * The Advanced Threat Protection settings. - */ - private AdvancedThreatProtectionProperties 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 AdvancedThreatProtectionSettingInner class. - */ - public AdvancedThreatProtectionSettingInner() { - } - - /** - * Get the innerProperties property: The Advanced Threat Protection settings. - * - * @return the innerProperties value. - */ - private AdvancedThreatProtectionProperties 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 isEnabled property: Indicates whether Advanced Threat Protection is enabled. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().isEnabled(); - } - - /** - * Set the isEnabled property: Indicates whether Advanced Threat Protection is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the AdvancedThreatProtectionSettingInner object itself. - */ - public AdvancedThreatProtectionSettingInner withIsEnabled(Boolean isEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new AdvancedThreatProtectionProperties(); - } - this.innerProperties().withIsEnabled(isEnabled); - 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 AdvancedThreatProtectionSettingInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AdvancedThreatProtectionSettingInner 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 AdvancedThreatProtectionSettingInner. - */ - public static AdvancedThreatProtectionSettingInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AdvancedThreatProtectionSettingInner deserializedAdvancedThreatProtectionSettingInner - = new AdvancedThreatProtectionSettingInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAdvancedThreatProtectionSettingInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAdvancedThreatProtectionSettingInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAdvancedThreatProtectionSettingInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAdvancedThreatProtectionSettingInner.innerProperties - = AdvancedThreatProtectionProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAdvancedThreatProtectionSettingInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAdvancedThreatProtectionSettingInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertInner.java deleted file mode 100644 index e4600834dfcc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertInner.java +++ /dev/null @@ -1,417 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.AlertEntity; -import com.azure.resourcemanager.security.models.AlertPropertiesSupportingEvidence; -import com.azure.resourcemanager.security.models.AlertSeverity; -import com.azure.resourcemanager.security.models.AlertStatus; -import com.azure.resourcemanager.security.models.Intent; -import com.azure.resourcemanager.security.models.ResourceIdentifier; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** - * Security alert. - */ -@Immutable -public final class AlertInner extends ProxyResource { - /* - * describes security alert properties. - */ - private AlertProperties 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 AlertInner class. - */ - private AlertInner() { - } - - /** - * Get the innerProperties property: describes security alert properties. - * - * @return the innerProperties value. - */ - private AlertProperties 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 version property: Schema version. - * - * @return the version value. - */ - public String version() { - return this.innerProperties() == null ? null : this.innerProperties().version(); - } - - /** - * Get the alertType property: Unique identifier for the detection logic (all alert instances from the same - * detection logic will have the same alertType). - * - * @return the alertType value. - */ - public String alertType() { - return this.innerProperties() == null ? null : this.innerProperties().alertType(); - } - - /** - * Get the systemAlertId property: Unique identifier for the alert. - * - * @return the systemAlertId value. - */ - public String systemAlertId() { - return this.innerProperties() == null ? null : this.innerProperties().systemAlertId(); - } - - /** - * Get the productComponentName property: The name of Azure Security Center pricing tier which powering this alert. - * Learn more: https://docs.microsoft.com/en-us/azure/security-center/security-center-pricing. - * - * @return the productComponentName value. - */ - public String productComponentName() { - return this.innerProperties() == null ? null : this.innerProperties().productComponentName(); - } - - /** - * Get the alertDisplayName property: The display name of the alert. - * - * @return the alertDisplayName value. - */ - public String alertDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().alertDisplayName(); - } - - /** - * Get the description property: Description of the suspicious activity that was detected. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the severity property: The risk level of the threat that was detected. Learn more: - * https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified. - * - * @return the severity value. - */ - public AlertSeverity severity() { - return this.innerProperties() == null ? null : this.innerProperties().severity(); - } - - /** - * Get the intent property: The kill chain related intent behind the alert. For list of supported values, and - * explanations of Azure Security Center's supported kill chain intents. - * - * @return the intent value. - */ - public Intent intent() { - return this.innerProperties() == null ? null : this.innerProperties().intent(); - } - - /** - * Get the startTimeUtc property: The UTC time of the first event or activity included in the alert in ISO8601 - * format. - * - * @return the startTimeUtc value. - */ - public OffsetDateTime startTimeUtc() { - return this.innerProperties() == null ? null : this.innerProperties().startTimeUtc(); - } - - /** - * Get the endTimeUtc property: The UTC time of the last event or activity included in the alert in ISO8601 format. - * - * @return the endTimeUtc value. - */ - public OffsetDateTime endTimeUtc() { - return this.innerProperties() == null ? null : this.innerProperties().endTimeUtc(); - } - - /** - * Get the resourceIdentifiers property: The resource identifiers that can be used to direct the alert to the right - * product exposure group (tenant, workspace, subscription etc.). There can be multiple identifiers of different - * type per alert. - * - * @return the resourceIdentifiers value. - */ - public List resourceIdentifiers() { - return this.innerProperties() == null ? null : this.innerProperties().resourceIdentifiers(); - } - - /** - * Get the remediationSteps property: Manual action items to take to remediate the alert. - * - * @return the remediationSteps value. - */ - public List remediationSteps() { - return this.innerProperties() == null ? null : this.innerProperties().remediationSteps(); - } - - /** - * Get the vendorName property: The name of the vendor that raises the alert. - * - * @return the vendorName value. - */ - public String vendorName() { - return this.innerProperties() == null ? null : this.innerProperties().vendorName(); - } - - /** - * Get the status property: The life cycle status of the alert. - * - * @return the status value. - */ - public AlertStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the extendedLinks property: Links related to the alert. - * - * @return the extendedLinks value. - */ - public List> extendedLinks() { - return this.innerProperties() == null ? null : this.innerProperties().extendedLinks(); - } - - /** - * Get the alertUri property: A direct link to the alert page in Azure Portal. - * - * @return the alertUri value. - */ - public String alertUri() { - return this.innerProperties() == null ? null : this.innerProperties().alertUri(); - } - - /** - * Get the timeGeneratedUtc property: The UTC time the alert was generated in ISO8601 format. - * - * @return the timeGeneratedUtc value. - */ - public OffsetDateTime timeGeneratedUtc() { - return this.innerProperties() == null ? null : this.innerProperties().timeGeneratedUtc(); - } - - /** - * Get the productName property: The name of the product which published this alert (Microsoft Sentinel, Microsoft - * Defender for Identity, Microsoft Defender for Endpoint, Microsoft Defender for Office, Microsoft Defender for - * Cloud Apps, and so on). - * - * @return the productName value. - */ - public String productName() { - return this.innerProperties() == null ? null : this.innerProperties().productName(); - } - - /** - * Get the processingEndTimeUtc property: The UTC processing end time of the alert in ISO8601 format. - * - * @return the processingEndTimeUtc value. - */ - public OffsetDateTime processingEndTimeUtc() { - return this.innerProperties() == null ? null : this.innerProperties().processingEndTimeUtc(); - } - - /** - * Get the entities property: A list of entities related to the alert. - * - * @return the entities value. - */ - public List entities() { - return this.innerProperties() == null ? null : this.innerProperties().entities(); - } - - /** - * Get the isIncident property: This field determines whether the alert is an incident (a compound grouping of - * several alerts) or a single alert. - * - * @return the isIncident value. - */ - public Boolean isIncident() { - return this.innerProperties() == null ? null : this.innerProperties().isIncident(); - } - - /** - * Get the correlationKey property: Key for corelating related alerts. Alerts with the same correlation key - * considered to be related. - * - * @return the correlationKey value. - */ - public String correlationKey() { - return this.innerProperties() == null ? null : this.innerProperties().correlationKey(); - } - - /** - * Get the extendedProperties property: Custom properties for the alert. - * - * @return the extendedProperties value. - */ - public Map extendedProperties() { - return this.innerProperties() == null ? null : this.innerProperties().extendedProperties(); - } - - /** - * Get the compromisedEntity property: The display name of the resource most related to this alert. - * - * @return the compromisedEntity value. - */ - public String compromisedEntity() { - return this.innerProperties() == null ? null : this.innerProperties().compromisedEntity(); - } - - /** - * Get the techniques property: kill chain related techniques behind the alert. - * - * @return the techniques value. - */ - public List techniques() { - return this.innerProperties() == null ? null : this.innerProperties().techniques(); - } - - /** - * Get the subTechniques property: Kill chain related sub-techniques behind the alert. - * - * @return the subTechniques value. - */ - public List subTechniques() { - return this.innerProperties() == null ? null : this.innerProperties().subTechniques(); - } - - /** - * Get the supportingEvidence property: Changing set of properties depending on the supportingEvidence type. - * - * @return the supportingEvidence value. - */ - public AlertPropertiesSupportingEvidence supportingEvidence() { - return this.innerProperties() == null ? null : this.innerProperties().supportingEvidence(); - } - - /** - * 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 AlertInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AlertInner 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 AlertInner. - */ - public static AlertInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AlertInner deserializedAlertInner = new AlertInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAlertInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAlertInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAlertInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAlertInner.innerProperties = AlertProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAlertInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAlertInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertProperties.java deleted file mode 100644 index 002eb72c8e96..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertProperties.java +++ /dev/null @@ -1,549 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.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 com.azure.resourcemanager.security.models.AlertEntity; -import com.azure.resourcemanager.security.models.AlertPropertiesSupportingEvidence; -import com.azure.resourcemanager.security.models.AlertSeverity; -import com.azure.resourcemanager.security.models.AlertStatus; -import com.azure.resourcemanager.security.models.Intent; -import com.azure.resourcemanager.security.models.ResourceIdentifier; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** - * describes security alert properties. - */ -@Immutable -public final class AlertProperties implements JsonSerializable { - /* - * Schema version. - */ - private String version; - - /* - * Unique identifier for the detection logic (all alert instances from the same detection logic will have the same - * alertType). - */ - private String alertType; - - /* - * Unique identifier for the alert. - */ - private String systemAlertId; - - /* - * The name of Azure Security Center pricing tier which powering this alert. Learn more: - * https://docs.microsoft.com/en-us/azure/security-center/security-center-pricing - */ - private String productComponentName; - - /* - * The display name of the alert. - */ - private String alertDisplayName; - - /* - * Description of the suspicious activity that was detected. - */ - private String description; - - /* - * The risk level of the threat that was detected. Learn more: - * https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified. - */ - private AlertSeverity severity; - - /* - * The kill chain related intent behind the alert. For list of supported values, and explanations of Azure Security - * Center's supported kill chain intents. - */ - private Intent intent; - - /* - * The UTC time of the first event or activity included in the alert in ISO8601 format. - */ - private OffsetDateTime startTimeUtc; - - /* - * The UTC time of the last event or activity included in the alert in ISO8601 format. - */ - private OffsetDateTime endTimeUtc; - - /* - * The resource identifiers that can be used to direct the alert to the right product exposure group (tenant, - * workspace, subscription etc.). There can be multiple identifiers of different type per alert. - */ - private List resourceIdentifiers; - - /* - * Manual action items to take to remediate the alert. - */ - private List remediationSteps; - - /* - * The name of the vendor that raises the alert. - */ - private String vendorName; - - /* - * The life cycle status of the alert. - */ - private AlertStatus status; - - /* - * Links related to the alert - */ - private List> extendedLinks; - - /* - * A direct link to the alert page in Azure Portal. - */ - private String alertUri; - - /* - * The UTC time the alert was generated in ISO8601 format. - */ - private OffsetDateTime timeGeneratedUtc; - - /* - * The name of the product which published this alert (Microsoft Sentinel, Microsoft Defender for Identity, - * Microsoft Defender for Endpoint, Microsoft Defender for Office, Microsoft Defender for Cloud Apps, and so on). - */ - private String productName; - - /* - * The UTC processing end time of the alert in ISO8601 format. - */ - private OffsetDateTime processingEndTimeUtc; - - /* - * A list of entities related to the alert. - */ - private List entities; - - /* - * This field determines whether the alert is an incident (a compound grouping of several alerts) or a single alert. - */ - private Boolean isIncident; - - /* - * Key for corelating related alerts. Alerts with the same correlation key considered to be related. - */ - private String correlationKey; - - /* - * Custom properties for the alert. - */ - private Map extendedProperties; - - /* - * The display name of the resource most related to this alert. - */ - private String compromisedEntity; - - /* - * kill chain related techniques behind the alert. - */ - private List techniques; - - /* - * Kill chain related sub-techniques behind the alert. - */ - private List subTechniques; - - /* - * Changing set of properties depending on the supportingEvidence type. - */ - private AlertPropertiesSupportingEvidence supportingEvidence; - - /** - * Creates an instance of AlertProperties class. - */ - private AlertProperties() { - } - - /** - * Get the version property: Schema version. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Get the alertType property: Unique identifier for the detection logic (all alert instances from the same - * detection logic will have the same alertType). - * - * @return the alertType value. - */ - public String alertType() { - return this.alertType; - } - - /** - * Get the systemAlertId property: Unique identifier for the alert. - * - * @return the systemAlertId value. - */ - public String systemAlertId() { - return this.systemAlertId; - } - - /** - * Get the productComponentName property: The name of Azure Security Center pricing tier which powering this alert. - * Learn more: https://docs.microsoft.com/en-us/azure/security-center/security-center-pricing. - * - * @return the productComponentName value. - */ - public String productComponentName() { - return this.productComponentName; - } - - /** - * Get the alertDisplayName property: The display name of the alert. - * - * @return the alertDisplayName value. - */ - public String alertDisplayName() { - return this.alertDisplayName; - } - - /** - * Get the description property: Description of the suspicious activity that was detected. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the severity property: The risk level of the threat that was detected. Learn more: - * https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified. - * - * @return the severity value. - */ - public AlertSeverity severity() { - return this.severity; - } - - /** - * Get the intent property: The kill chain related intent behind the alert. For list of supported values, and - * explanations of Azure Security Center's supported kill chain intents. - * - * @return the intent value. - */ - public Intent intent() { - return this.intent; - } - - /** - * Get the startTimeUtc property: The UTC time of the first event or activity included in the alert in ISO8601 - * format. - * - * @return the startTimeUtc value. - */ - public OffsetDateTime startTimeUtc() { - return this.startTimeUtc; - } - - /** - * Get the endTimeUtc property: The UTC time of the last event or activity included in the alert in ISO8601 format. - * - * @return the endTimeUtc value. - */ - public OffsetDateTime endTimeUtc() { - return this.endTimeUtc; - } - - /** - * Get the resourceIdentifiers property: The resource identifiers that can be used to direct the alert to the right - * product exposure group (tenant, workspace, subscription etc.). There can be multiple identifiers of different - * type per alert. - * - * @return the resourceIdentifiers value. - */ - public List resourceIdentifiers() { - return this.resourceIdentifiers; - } - - /** - * Get the remediationSteps property: Manual action items to take to remediate the alert. - * - * @return the remediationSteps value. - */ - public List remediationSteps() { - return this.remediationSteps; - } - - /** - * Get the vendorName property: The name of the vendor that raises the alert. - * - * @return the vendorName value. - */ - public String vendorName() { - return this.vendorName; - } - - /** - * Get the status property: The life cycle status of the alert. - * - * @return the status value. - */ - public AlertStatus status() { - return this.status; - } - - /** - * Get the extendedLinks property: Links related to the alert. - * - * @return the extendedLinks value. - */ - public List> extendedLinks() { - return this.extendedLinks; - } - - /** - * Get the alertUri property: A direct link to the alert page in Azure Portal. - * - * @return the alertUri value. - */ - public String alertUri() { - return this.alertUri; - } - - /** - * Get the timeGeneratedUtc property: The UTC time the alert was generated in ISO8601 format. - * - * @return the timeGeneratedUtc value. - */ - public OffsetDateTime timeGeneratedUtc() { - return this.timeGeneratedUtc; - } - - /** - * Get the productName property: The name of the product which published this alert (Microsoft Sentinel, Microsoft - * Defender for Identity, Microsoft Defender for Endpoint, Microsoft Defender for Office, Microsoft Defender for - * Cloud Apps, and so on). - * - * @return the productName value. - */ - public String productName() { - return this.productName; - } - - /** - * Get the processingEndTimeUtc property: The UTC processing end time of the alert in ISO8601 format. - * - * @return the processingEndTimeUtc value. - */ - public OffsetDateTime processingEndTimeUtc() { - return this.processingEndTimeUtc; - } - - /** - * Get the entities property: A list of entities related to the alert. - * - * @return the entities value. - */ - public List entities() { - return this.entities; - } - - /** - * Get the isIncident property: This field determines whether the alert is an incident (a compound grouping of - * several alerts) or a single alert. - * - * @return the isIncident value. - */ - public Boolean isIncident() { - return this.isIncident; - } - - /** - * Get the correlationKey property: Key for corelating related alerts. Alerts with the same correlation key - * considered to be related. - * - * @return the correlationKey value. - */ - public String correlationKey() { - return this.correlationKey; - } - - /** - * Get the extendedProperties property: Custom properties for the alert. - * - * @return the extendedProperties value. - */ - public Map extendedProperties() { - return this.extendedProperties; - } - - /** - * Get the compromisedEntity property: The display name of the resource most related to this alert. - * - * @return the compromisedEntity value. - */ - public String compromisedEntity() { - return this.compromisedEntity; - } - - /** - * Get the techniques property: kill chain related techniques behind the alert. - * - * @return the techniques value. - */ - public List techniques() { - return this.techniques; - } - - /** - * Get the subTechniques property: Kill chain related sub-techniques behind the alert. - * - * @return the subTechniques value. - */ - public List subTechniques() { - return this.subTechniques; - } - - /** - * Get the supportingEvidence property: Changing set of properties depending on the supportingEvidence type. - * - * @return the supportingEvidence value. - */ - public AlertPropertiesSupportingEvidence supportingEvidence() { - return this.supportingEvidence; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (resourceIdentifiers() != null) { - resourceIdentifiers().forEach(e -> e.validate()); - } - if (entities() != null) { - entities().forEach(e -> e.validate()); - } - if (supportingEvidence() != null) { - supportingEvidence().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeMapField("extendedProperties", this.extendedProperties, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("supportingEvidence", this.supportingEvidence); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AlertProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AlertProperties 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 AlertProperties. - */ - public static AlertProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AlertProperties deserializedAlertProperties = new AlertProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("version".equals(fieldName)) { - deserializedAlertProperties.version = reader.getString(); - } else if ("alertType".equals(fieldName)) { - deserializedAlertProperties.alertType = reader.getString(); - } else if ("systemAlertId".equals(fieldName)) { - deserializedAlertProperties.systemAlertId = reader.getString(); - } else if ("productComponentName".equals(fieldName)) { - deserializedAlertProperties.productComponentName = reader.getString(); - } else if ("alertDisplayName".equals(fieldName)) { - deserializedAlertProperties.alertDisplayName = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedAlertProperties.description = reader.getString(); - } else if ("severity".equals(fieldName)) { - deserializedAlertProperties.severity = AlertSeverity.fromString(reader.getString()); - } else if ("intent".equals(fieldName)) { - deserializedAlertProperties.intent = Intent.fromString(reader.getString()); - } else if ("startTimeUtc".equals(fieldName)) { - deserializedAlertProperties.startTimeUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("endTimeUtc".equals(fieldName)) { - deserializedAlertProperties.endTimeUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("resourceIdentifiers".equals(fieldName)) { - List resourceIdentifiers - = reader.readArray(reader1 -> ResourceIdentifier.fromJson(reader1)); - deserializedAlertProperties.resourceIdentifiers = resourceIdentifiers; - } else if ("remediationSteps".equals(fieldName)) { - List remediationSteps = reader.readArray(reader1 -> reader1.getString()); - deserializedAlertProperties.remediationSteps = remediationSteps; - } else if ("vendorName".equals(fieldName)) { - deserializedAlertProperties.vendorName = reader.getString(); - } else if ("status".equals(fieldName)) { - deserializedAlertProperties.status = AlertStatus.fromString(reader.getString()); - } else if ("extendedLinks".equals(fieldName)) { - List> extendedLinks - = reader.readArray(reader1 -> reader1.readMap(reader2 -> reader2.getString())); - deserializedAlertProperties.extendedLinks = extendedLinks; - } else if ("alertUri".equals(fieldName)) { - deserializedAlertProperties.alertUri = reader.getString(); - } else if ("timeGeneratedUtc".equals(fieldName)) { - deserializedAlertProperties.timeGeneratedUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("productName".equals(fieldName)) { - deserializedAlertProperties.productName = reader.getString(); - } else if ("processingEndTimeUtc".equals(fieldName)) { - deserializedAlertProperties.processingEndTimeUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("entities".equals(fieldName)) { - List entities = reader.readArray(reader1 -> AlertEntity.fromJson(reader1)); - deserializedAlertProperties.entities = entities; - } else if ("isIncident".equals(fieldName)) { - deserializedAlertProperties.isIncident = reader.getNullable(JsonReader::getBoolean); - } else if ("correlationKey".equals(fieldName)) { - deserializedAlertProperties.correlationKey = reader.getString(); - } else if ("extendedProperties".equals(fieldName)) { - Map extendedProperties = reader.readMap(reader1 -> reader1.getString()); - deserializedAlertProperties.extendedProperties = extendedProperties; - } else if ("compromisedEntity".equals(fieldName)) { - deserializedAlertProperties.compromisedEntity = reader.getString(); - } else if ("techniques".equals(fieldName)) { - List techniques = reader.readArray(reader1 -> reader1.getString()); - deserializedAlertProperties.techniques = techniques; - } else if ("subTechniques".equals(fieldName)) { - List subTechniques = reader.readArray(reader1 -> reader1.getString()); - deserializedAlertProperties.subTechniques = subTechniques; - } else if ("supportingEvidence".equals(fieldName)) { - deserializedAlertProperties.supportingEvidence = AlertPropertiesSupportingEvidence.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAlertProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertSyncSettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertSyncSettingProperties.java deleted file mode 100644 index 0bb0c578ccae..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertSyncSettingProperties.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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 alert sync setting properties. - */ -@Fluent -public final class AlertSyncSettingProperties implements JsonSerializable { - /* - * Is the alert sync setting enabled - */ - private boolean enabled; - - /** - * Creates an instance of AlertSyncSettingProperties class. - */ - public AlertSyncSettingProperties() { - } - - /** - * Get the enabled property: Is the alert sync setting enabled. - * - * @return the enabled value. - */ - public boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is the alert sync setting enabled. - * - * @param enabled the enabled value to set. - * @return the AlertSyncSettingProperties object itself. - */ - public AlertSyncSettingProperties withEnabled(boolean enabled) { - this.enabled = enabled; - 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("enabled", this.enabled); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AlertSyncSettingProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AlertSyncSettingProperties 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 AlertSyncSettingProperties. - */ - public static AlertSyncSettingProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AlertSyncSettingProperties deserializedAlertSyncSettingProperties = new AlertSyncSettingProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedAlertSyncSettingProperties.enabled = reader.getBoolean(); - } else { - reader.skipChildren(); - } - } - - return deserializedAlertSyncSettingProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleInner.java deleted file mode 100644 index 2c81cb1994b8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleInner.java +++ /dev/null @@ -1,307 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.RuleState; -import com.azure.resourcemanager.security.models.SuppressionAlertsScope; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Describes the suppression rule. - */ -@Fluent -public final class AlertsSuppressionRuleInner extends ProxyResource { - /* - * describes AlertsSuppressionRule properties - */ - private AlertsSuppressionRuleProperties 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 AlertsSuppressionRuleInner class. - */ - public AlertsSuppressionRuleInner() { - } - - /** - * Get the innerProperties property: describes AlertsSuppressionRule properties. - * - * @return the innerProperties value. - */ - private AlertsSuppressionRuleProperties 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 alertType property: Type of the alert to automatically suppress. For all alert types, use '*'. - * - * @return the alertType value. - */ - public String alertType() { - return this.innerProperties() == null ? null : this.innerProperties().alertType(); - } - - /** - * Set the alertType property: Type of the alert to automatically suppress. For all alert types, use '*'. - * - * @param alertType the alertType value to set. - * @return the AlertsSuppressionRuleInner object itself. - */ - public AlertsSuppressionRuleInner withAlertType(String alertType) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertsSuppressionRuleProperties(); - } - this.innerProperties().withAlertType(alertType); - return this; - } - - /** - * Get the lastModifiedUtc property: The last time this rule was modified. - * - * @return the lastModifiedUtc value. - */ - public OffsetDateTime lastModifiedUtc() { - return this.innerProperties() == null ? null : this.innerProperties().lastModifiedUtc(); - } - - /** - * Get the expirationDateUtc property: Expiration date of the rule, if value is not provided or provided as null - * there will no expiration at all. - * - * @return the expirationDateUtc value. - */ - public OffsetDateTime expirationDateUtc() { - return this.innerProperties() == null ? null : this.innerProperties().expirationDateUtc(); - } - - /** - * Set the expirationDateUtc property: Expiration date of the rule, if value is not provided or provided as null - * there will no expiration at all. - * - * @param expirationDateUtc the expirationDateUtc value to set. - * @return the AlertsSuppressionRuleInner object itself. - */ - public AlertsSuppressionRuleInner withExpirationDateUtc(OffsetDateTime expirationDateUtc) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertsSuppressionRuleProperties(); - } - this.innerProperties().withExpirationDateUtc(expirationDateUtc); - return this; - } - - /** - * Get the reason property: The reason for dismissing the alert. - * - * @return the reason value. - */ - public String reason() { - return this.innerProperties() == null ? null : this.innerProperties().reason(); - } - - /** - * Set the reason property: The reason for dismissing the alert. - * - * @param reason the reason value to set. - * @return the AlertsSuppressionRuleInner object itself. - */ - public AlertsSuppressionRuleInner withReason(String reason) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertsSuppressionRuleProperties(); - } - this.innerProperties().withReason(reason); - return this; - } - - /** - * Get the state property: Possible states of the rule. - * - * @return the state value. - */ - public RuleState state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Set the state property: Possible states of the rule. - * - * @param state the state value to set. - * @return the AlertsSuppressionRuleInner object itself. - */ - public AlertsSuppressionRuleInner withState(RuleState state) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertsSuppressionRuleProperties(); - } - this.innerProperties().withState(state); - return this; - } - - /** - * Get the comment property: Any comment regarding the rule. - * - * @return the comment value. - */ - public String comment() { - return this.innerProperties() == null ? null : this.innerProperties().comment(); - } - - /** - * Set the comment property: Any comment regarding the rule. - * - * @param comment the comment value to set. - * @return the AlertsSuppressionRuleInner object itself. - */ - public AlertsSuppressionRuleInner withComment(String comment) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertsSuppressionRuleProperties(); - } - this.innerProperties().withComment(comment); - return this; - } - - /** - * Get the suppressionAlertsScope property: The suppression conditions. - * - * @return the suppressionAlertsScope value. - */ - public SuppressionAlertsScope suppressionAlertsScope() { - return this.innerProperties() == null ? null : this.innerProperties().suppressionAlertsScope(); - } - - /** - * Set the suppressionAlertsScope property: The suppression conditions. - * - * @param suppressionAlertsScope the suppressionAlertsScope value to set. - * @return the AlertsSuppressionRuleInner object itself. - */ - public AlertsSuppressionRuleInner withSuppressionAlertsScope(SuppressionAlertsScope suppressionAlertsScope) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertsSuppressionRuleProperties(); - } - this.innerProperties().withSuppressionAlertsScope(suppressionAlertsScope); - 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 AlertsSuppressionRuleInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AlertsSuppressionRuleInner 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 AlertsSuppressionRuleInner. - */ - public static AlertsSuppressionRuleInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AlertsSuppressionRuleInner deserializedAlertsSuppressionRuleInner = new AlertsSuppressionRuleInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAlertsSuppressionRuleInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAlertsSuppressionRuleInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAlertsSuppressionRuleInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAlertsSuppressionRuleInner.innerProperties - = AlertsSuppressionRuleProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAlertsSuppressionRuleInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAlertsSuppressionRuleInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleProperties.java deleted file mode 100644 index 826e9a821014..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleProperties.java +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.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 com.azure.resourcemanager.security.models.RuleState; -import com.azure.resourcemanager.security.models.SuppressionAlertsScope; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * describes AlertsSuppressionRule properties. - */ -@Fluent -public final class AlertsSuppressionRuleProperties implements JsonSerializable { - /* - * Type of the alert to automatically suppress. For all alert types, use '*' - */ - private String alertType; - - /* - * The last time this rule was modified - */ - private OffsetDateTime lastModifiedUtc; - - /* - * Expiration date of the rule, if value is not provided or provided as null there will no expiration at all - */ - private OffsetDateTime expirationDateUtc; - - /* - * The reason for dismissing the alert - */ - private String reason; - - /* - * Possible states of the rule - */ - private RuleState state; - - /* - * Any comment regarding the rule - */ - private String comment; - - /* - * The suppression conditions - */ - private SuppressionAlertsScope suppressionAlertsScope; - - /** - * Creates an instance of AlertsSuppressionRuleProperties class. - */ - public AlertsSuppressionRuleProperties() { - } - - /** - * Get the alertType property: Type of the alert to automatically suppress. For all alert types, use '*'. - * - * @return the alertType value. - */ - public String alertType() { - return this.alertType; - } - - /** - * Set the alertType property: Type of the alert to automatically suppress. For all alert types, use '*'. - * - * @param alertType the alertType value to set. - * @return the AlertsSuppressionRuleProperties object itself. - */ - public AlertsSuppressionRuleProperties withAlertType(String alertType) { - this.alertType = alertType; - return this; - } - - /** - * Get the lastModifiedUtc property: The last time this rule was modified. - * - * @return the lastModifiedUtc value. - */ - public OffsetDateTime lastModifiedUtc() { - return this.lastModifiedUtc; - } - - /** - * Get the expirationDateUtc property: Expiration date of the rule, if value is not provided or provided as null - * there will no expiration at all. - * - * @return the expirationDateUtc value. - */ - public OffsetDateTime expirationDateUtc() { - return this.expirationDateUtc; - } - - /** - * Set the expirationDateUtc property: Expiration date of the rule, if value is not provided or provided as null - * there will no expiration at all. - * - * @param expirationDateUtc the expirationDateUtc value to set. - * @return the AlertsSuppressionRuleProperties object itself. - */ - public AlertsSuppressionRuleProperties withExpirationDateUtc(OffsetDateTime expirationDateUtc) { - this.expirationDateUtc = expirationDateUtc; - return this; - } - - /** - * Get the reason property: The reason for dismissing the alert. - * - * @return the reason value. - */ - public String reason() { - return this.reason; - } - - /** - * Set the reason property: The reason for dismissing the alert. - * - * @param reason the reason value to set. - * @return the AlertsSuppressionRuleProperties object itself. - */ - public AlertsSuppressionRuleProperties withReason(String reason) { - this.reason = reason; - return this; - } - - /** - * Get the state property: Possible states of the rule. - * - * @return the state value. - */ - public RuleState state() { - return this.state; - } - - /** - * Set the state property: Possible states of the rule. - * - * @param state the state value to set. - * @return the AlertsSuppressionRuleProperties object itself. - */ - public AlertsSuppressionRuleProperties withState(RuleState state) { - this.state = state; - return this; - } - - /** - * Get the comment property: Any comment regarding the rule. - * - * @return the comment value. - */ - public String comment() { - return this.comment; - } - - /** - * Set the comment property: Any comment regarding the rule. - * - * @param comment the comment value to set. - * @return the AlertsSuppressionRuleProperties object itself. - */ - public AlertsSuppressionRuleProperties withComment(String comment) { - this.comment = comment; - return this; - } - - /** - * Get the suppressionAlertsScope property: The suppression conditions. - * - * @return the suppressionAlertsScope value. - */ - public SuppressionAlertsScope suppressionAlertsScope() { - return this.suppressionAlertsScope; - } - - /** - * Set the suppressionAlertsScope property: The suppression conditions. - * - * @param suppressionAlertsScope the suppressionAlertsScope value to set. - * @return the AlertsSuppressionRuleProperties object itself. - */ - public AlertsSuppressionRuleProperties withSuppressionAlertsScope(SuppressionAlertsScope suppressionAlertsScope) { - this.suppressionAlertsScope = suppressionAlertsScope; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (alertType() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property alertType in model AlertsSuppressionRuleProperties")); - } - if (reason() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property reason in model AlertsSuppressionRuleProperties")); - } - if (state() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property state in model AlertsSuppressionRuleProperties")); - } - if (suppressionAlertsScope() != null) { - suppressionAlertsScope().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AlertsSuppressionRuleProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("alertType", this.alertType); - jsonWriter.writeStringField("reason", this.reason); - jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); - jsonWriter.writeStringField("expirationDateUtc", - this.expirationDateUtc == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationDateUtc)); - jsonWriter.writeStringField("comment", this.comment); - jsonWriter.writeJsonField("suppressionAlertsScope", this.suppressionAlertsScope); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AlertsSuppressionRuleProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AlertsSuppressionRuleProperties 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 AlertsSuppressionRuleProperties. - */ - public static AlertsSuppressionRuleProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AlertsSuppressionRuleProperties deserializedAlertsSuppressionRuleProperties - = new AlertsSuppressionRuleProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("alertType".equals(fieldName)) { - deserializedAlertsSuppressionRuleProperties.alertType = reader.getString(); - } else if ("reason".equals(fieldName)) { - deserializedAlertsSuppressionRuleProperties.reason = reader.getString(); - } else if ("state".equals(fieldName)) { - deserializedAlertsSuppressionRuleProperties.state = RuleState.fromString(reader.getString()); - } else if ("lastModifiedUtc".equals(fieldName)) { - deserializedAlertsSuppressionRuleProperties.lastModifiedUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("expirationDateUtc".equals(fieldName)) { - deserializedAlertsSuppressionRuleProperties.expirationDateUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("comment".equals(fieldName)) { - deserializedAlertsSuppressionRuleProperties.comment = reader.getString(); - } else if ("suppressionAlertsScope".equals(fieldName)) { - deserializedAlertsSuppressionRuleProperties.suppressionAlertsScope - = SuppressionAlertsScope.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAlertsSuppressionRuleProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceInner.java deleted file mode 100644 index cf8392a51691..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceInner.java +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.ConnectableResource; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * The resource whose properties describes the allowed traffic between Azure resources. - */ -@Immutable -public final class AllowedConnectionsResourceInner extends ProxyResource { - /* - * Describes the allowed traffic between Azure resources - */ - private AllowedConnectionsResourceProperties innerProperties; - - /* - * Location where the resource is stored - */ - private String location; - - /* - * 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 AllowedConnectionsResourceInner class. - */ - private AllowedConnectionsResourceInner() { - } - - /** - * Get the innerProperties property: Describes the allowed traffic between Azure resources. - * - * @return the innerProperties value. - */ - private AllowedConnectionsResourceProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * 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 calculatedDateTime property: The UTC time on which the allowed connections resource was calculated. - * - * @return the calculatedDateTime value. - */ - public OffsetDateTime calculatedDateTime() { - return this.innerProperties() == null ? null : this.innerProperties().calculatedDateTime(); - } - - /** - * Get the connectableResources property: List of connectable resources. - * - * @return the connectableResources value. - */ - public List connectableResources() { - return this.innerProperties() == null ? null : this.innerProperties().connectableResources(); - } - - /** - * 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(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AllowedConnectionsResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AllowedConnectionsResourceInner 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 AllowedConnectionsResourceInner. - */ - public static AllowedConnectionsResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AllowedConnectionsResourceInner deserializedAllowedConnectionsResourceInner - = new AllowedConnectionsResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAllowedConnectionsResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAllowedConnectionsResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAllowedConnectionsResourceInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedAllowedConnectionsResourceInner.location = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAllowedConnectionsResourceInner.innerProperties - = AllowedConnectionsResourceProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAllowedConnectionsResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAllowedConnectionsResourceInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceProperties.java deleted file mode 100644 index 4fa0d39449b5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceProperties.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.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 com.azure.resourcemanager.security.models.ConnectableResource; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * Describes the allowed traffic between Azure resources. - */ -@Immutable -public final class AllowedConnectionsResourceProperties - implements JsonSerializable { - /* - * The UTC time on which the allowed connections resource was calculated - */ - private OffsetDateTime calculatedDateTime; - - /* - * List of connectable resources - */ - private List connectableResources; - - /** - * Creates an instance of AllowedConnectionsResourceProperties class. - */ - private AllowedConnectionsResourceProperties() { - } - - /** - * Get the calculatedDateTime property: The UTC time on which the allowed connections resource was calculated. - * - * @return the calculatedDateTime value. - */ - public OffsetDateTime calculatedDateTime() { - return this.calculatedDateTime; - } - - /** - * Get the connectableResources property: List of connectable resources. - * - * @return the connectableResources value. - */ - public List connectableResources() { - return this.connectableResources; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (connectableResources() != null) { - connectableResources().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AllowedConnectionsResourceProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AllowedConnectionsResourceProperties 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 AllowedConnectionsResourceProperties. - */ - public static AllowedConnectionsResourceProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AllowedConnectionsResourceProperties deserializedAllowedConnectionsResourceProperties - = new AllowedConnectionsResourceProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("calculatedDateTime".equals(fieldName)) { - deserializedAllowedConnectionsResourceProperties.calculatedDateTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("connectableResources".equals(fieldName)) { - List connectableResources - = reader.readArray(reader1 -> ConnectableResource.fromJson(reader1)); - deserializedAllowedConnectionsResourceProperties.connectableResources = connectableResources; - } else { - reader.skipChildren(); - } - } - - return deserializedAllowedConnectionsResourceProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionInner.java deleted file mode 100644 index 291e405353e8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionInner.java +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.ProvisioningState; -import java.io.IOException; - -/** - * An API collection as represented by Microsoft Defender for APIs. - */ -@Immutable -public final class ApiCollectionInner extends ProxyResource { - /* - * Describes the properties of an API collection. - */ - private ApiCollectionProperties 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 ApiCollectionInner class. - */ - private ApiCollectionInner() { - } - - /** - * Get the innerProperties property: Describes the properties of an API collection. - * - * @return the innerProperties value. - */ - private ApiCollectionProperties 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 provisioningState property: Gets the provisioning state of the API collection. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the displayName property: The display name of the API collection. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the discoveredVia property: The resource Id of the resource from where this API collection was discovered. - * - * @return the discoveredVia value. - */ - public String discoveredVia() { - return this.innerProperties() == null ? null : this.innerProperties().discoveredVia(); - } - - /** - * Get the baseUrl property: The base URI for this API collection. All endpoints of this API collection extend this - * base URI. - * - * @return the baseUrl value. - */ - public String baseUrl() { - return this.innerProperties() == null ? null : this.innerProperties().baseUrl(); - } - - /** - * Get the numberOfApiEndpoints property: The number of API endpoints discovered in this API collection. - * - * @return the numberOfApiEndpoints value. - */ - public Long numberOfApiEndpoints() { - return this.innerProperties() == null ? null : this.innerProperties().numberOfApiEndpoints(); - } - - /** - * Get the numberOfInactiveApiEndpoints property: The number of API endpoints in this API collection that have not - * received any API traffic in the last 30 days. - * - * @return the numberOfInactiveApiEndpoints value. - */ - public Long numberOfInactiveApiEndpoints() { - return this.innerProperties() == null ? null : this.innerProperties().numberOfInactiveApiEndpoints(); - } - - /** - * Get the numberOfUnauthenticatedApiEndpoints property: The number of API endpoints in this API collection that are - * unauthenticated. - * - * @return the numberOfUnauthenticatedApiEndpoints value. - */ - public Long numberOfUnauthenticatedApiEndpoints() { - return this.innerProperties() == null ? null : this.innerProperties().numberOfUnauthenticatedApiEndpoints(); - } - - /** - * Get the numberOfExternalApiEndpoints property: The number of API endpoints in this API collection for which API - * traffic from the internet was observed. - * - * @return the numberOfExternalApiEndpoints value. - */ - public Long numberOfExternalApiEndpoints() { - return this.innerProperties() == null ? null : this.innerProperties().numberOfExternalApiEndpoints(); - } - - /** - * Get the numberOfApiEndpointsWithSensitiveDataExposed property: The number of API endpoints in this API collection - * which are exposing sensitive data in their requests and/or responses. - * - * @return the numberOfApiEndpointsWithSensitiveDataExposed value. - */ - public Long numberOfApiEndpointsWithSensitiveDataExposed() { - return this.innerProperties() == null - ? null - : this.innerProperties().numberOfApiEndpointsWithSensitiveDataExposed(); - } - - /** - * Get the sensitivityLabel property: The highest priority sensitivity label from Microsoft Purview in this API - * collection. - * - * @return the sensitivityLabel value. - */ - public String sensitivityLabel() { - return this.innerProperties() == null ? null : this.innerProperties().sensitivityLabel(); - } - - /** - * 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 ApiCollectionInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ApiCollectionInner 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 ApiCollectionInner. - */ - public static ApiCollectionInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ApiCollectionInner deserializedApiCollectionInner = new ApiCollectionInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedApiCollectionInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedApiCollectionInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedApiCollectionInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedApiCollectionInner.innerProperties = ApiCollectionProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedApiCollectionInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedApiCollectionInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionProperties.java deleted file mode 100644 index 22255a494063..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionProperties.java +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.ProvisioningState; -import java.io.IOException; - -/** - * Describes the properties of an API collection. - */ -@Immutable -public final class ApiCollectionProperties implements JsonSerializable { - /* - * Gets the provisioning state of the API collection. - */ - private ProvisioningState provisioningState; - - /* - * The display name of the API collection. - */ - private String displayName; - - /* - * The resource Id of the resource from where this API collection was discovered. - */ - private String discoveredVia; - - /* - * The base URI for this API collection. All endpoints of this API collection extend this base URI. - */ - private String baseUrl; - - /* - * The number of API endpoints discovered in this API collection. - */ - private Long numberOfApiEndpoints; - - /* - * The number of API endpoints in this API collection that have not received any API traffic in the last 30 days. - */ - private Long numberOfInactiveApiEndpoints; - - /* - * The number of API endpoints in this API collection that are unauthenticated. - */ - private Long numberOfUnauthenticatedApiEndpoints; - - /* - * The number of API endpoints in this API collection for which API traffic from the internet was observed. - */ - private Long numberOfExternalApiEndpoints; - - /* - * The number of API endpoints in this API collection which are exposing sensitive data in their requests and/or - * responses. - */ - private Long numberOfApiEndpointsWithSensitiveDataExposed; - - /* - * The highest priority sensitivity label from Microsoft Purview in this API collection. - */ - private String sensitivityLabel; - - /** - * Creates an instance of ApiCollectionProperties class. - */ - private ApiCollectionProperties() { - } - - /** - * Get the provisioningState property: Gets the provisioning state of the API collection. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the displayName property: The display name of the API collection. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the discoveredVia property: The resource Id of the resource from where this API collection was discovered. - * - * @return the discoveredVia value. - */ - public String discoveredVia() { - return this.discoveredVia; - } - - /** - * Get the baseUrl property: The base URI for this API collection. All endpoints of this API collection extend this - * base URI. - * - * @return the baseUrl value. - */ - public String baseUrl() { - return this.baseUrl; - } - - /** - * Get the numberOfApiEndpoints property: The number of API endpoints discovered in this API collection. - * - * @return the numberOfApiEndpoints value. - */ - public Long numberOfApiEndpoints() { - return this.numberOfApiEndpoints; - } - - /** - * Get the numberOfInactiveApiEndpoints property: The number of API endpoints in this API collection that have not - * received any API traffic in the last 30 days. - * - * @return the numberOfInactiveApiEndpoints value. - */ - public Long numberOfInactiveApiEndpoints() { - return this.numberOfInactiveApiEndpoints; - } - - /** - * Get the numberOfUnauthenticatedApiEndpoints property: The number of API endpoints in this API collection that are - * unauthenticated. - * - * @return the numberOfUnauthenticatedApiEndpoints value. - */ - public Long numberOfUnauthenticatedApiEndpoints() { - return this.numberOfUnauthenticatedApiEndpoints; - } - - /** - * Get the numberOfExternalApiEndpoints property: The number of API endpoints in this API collection for which API - * traffic from the internet was observed. - * - * @return the numberOfExternalApiEndpoints value. - */ - public Long numberOfExternalApiEndpoints() { - return this.numberOfExternalApiEndpoints; - } - - /** - * Get the numberOfApiEndpointsWithSensitiveDataExposed property: The number of API endpoints in this API collection - * which are exposing sensitive data in their requests and/or responses. - * - * @return the numberOfApiEndpointsWithSensitiveDataExposed value. - */ - public Long numberOfApiEndpointsWithSensitiveDataExposed() { - return this.numberOfApiEndpointsWithSensitiveDataExposed; - } - - /** - * Get the sensitivityLabel property: The highest priority sensitivity label from Microsoft Purview in this API - * collection. - * - * @return the sensitivityLabel value. - */ - public String sensitivityLabel() { - return this.sensitivityLabel; - } - - /** - * 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 ApiCollectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ApiCollectionProperties 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 ApiCollectionProperties. - */ - public static ApiCollectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ApiCollectionProperties deserializedApiCollectionProperties = new ApiCollectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningState".equals(fieldName)) { - deserializedApiCollectionProperties.provisioningState - = ProvisioningState.fromString(reader.getString()); - } else if ("displayName".equals(fieldName)) { - deserializedApiCollectionProperties.displayName = reader.getString(); - } else if ("discoveredVia".equals(fieldName)) { - deserializedApiCollectionProperties.discoveredVia = reader.getString(); - } else if ("baseUrl".equals(fieldName)) { - deserializedApiCollectionProperties.baseUrl = reader.getString(); - } else if ("numberOfApiEndpoints".equals(fieldName)) { - deserializedApiCollectionProperties.numberOfApiEndpoints = reader.getNullable(JsonReader::getLong); - } else if ("numberOfInactiveApiEndpoints".equals(fieldName)) { - deserializedApiCollectionProperties.numberOfInactiveApiEndpoints - = reader.getNullable(JsonReader::getLong); - } else if ("numberOfUnauthenticatedApiEndpoints".equals(fieldName)) { - deserializedApiCollectionProperties.numberOfUnauthenticatedApiEndpoints - = reader.getNullable(JsonReader::getLong); - } else if ("numberOfExternalApiEndpoints".equals(fieldName)) { - deserializedApiCollectionProperties.numberOfExternalApiEndpoints - = reader.getNullable(JsonReader::getLong); - } else if ("numberOfApiEndpointsWithSensitiveDataExposed".equals(fieldName)) { - deserializedApiCollectionProperties.numberOfApiEndpointsWithSensitiveDataExposed - = reader.getNullable(JsonReader::getLong); - } else if ("sensitivityLabel".equals(fieldName)) { - deserializedApiCollectionProperties.sensitivityLabel = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedApiCollectionProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApplicationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApplicationInner.java deleted file mode 100644 index 333596f45d5e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApplicationInner.java +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.ApplicationSourceResourceType; -import java.io.IOException; -import java.util.List; - -/** - * Security Application over a given scope. - */ -@Fluent -public final class ApplicationInner extends ProxyResource { - /* - * Properties of a security application - */ - private ApplicationProperties 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 ApplicationInner class. - */ - public ApplicationInner() { - } - - /** - * Get the innerProperties property: Properties of a security application. - * - * @return the innerProperties value. - */ - private ApplicationProperties 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 displayName property: display name of the application. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: display name of the application. - * - * @param displayName the displayName value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the description property: description of the application. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: description of the application. - * - * @param description the description value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * - * @return the sourceResourceType value. - */ - public ApplicationSourceResourceType sourceResourceType() { - return this.innerProperties() == null ? null : this.innerProperties().sourceResourceType(); - } - - /** - * Set the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * - * @param sourceResourceType the sourceResourceType value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withSourceResourceType(ApplicationSourceResourceType sourceResourceType) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - this.innerProperties().withSourceResourceType(sourceResourceType); - return this; - } - - /** - * Get the conditionSets property: The application conditionSets - see examples. - * - * @return the conditionSets value. - */ - public List conditionSets() { - return this.innerProperties() == null ? null : this.innerProperties().conditionSets(); - } - - /** - * Set the conditionSets property: The application conditionSets - see examples. - * - * @param conditionSets the conditionSets value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withConditionSets(List conditionSets) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - this.innerProperties().withConditionSets(conditionSets); - 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 ApplicationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ApplicationInner 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 ApplicationInner. - */ - public static ApplicationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ApplicationInner deserializedApplicationInner = new ApplicationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedApplicationInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedApplicationInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedApplicationInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedApplicationInner.innerProperties = ApplicationProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedApplicationInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedApplicationInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApplicationProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApplicationProperties.java deleted file mode 100644 index 56d65b4889fd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApplicationProperties.java +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.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.security.models.ApplicationSourceResourceType; -import java.io.IOException; -import java.util.List; - -/** - * Describes properties of an application. - */ -@Fluent -public final class ApplicationProperties implements JsonSerializable { - /* - * display name of the application - */ - private String displayName; - - /* - * description of the application - */ - private String description; - - /* - * The application source, what it affects, e.g. Assessments - */ - private ApplicationSourceResourceType sourceResourceType; - - /* - * The application conditionSets - see examples - */ - private List conditionSets; - - /** - * Creates an instance of ApplicationProperties class. - */ - public ApplicationProperties() { - } - - /** - * Get the displayName property: display name of the application. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: display name of the application. - * - * @param displayName the displayName value to set. - * @return the ApplicationProperties object itself. - */ - public ApplicationProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the description property: description of the application. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: description of the application. - * - * @param description the description value to set. - * @return the ApplicationProperties object itself. - */ - public ApplicationProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * - * @return the sourceResourceType value. - */ - public ApplicationSourceResourceType sourceResourceType() { - return this.sourceResourceType; - } - - /** - * Set the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * - * @param sourceResourceType the sourceResourceType value to set. - * @return the ApplicationProperties object itself. - */ - public ApplicationProperties withSourceResourceType(ApplicationSourceResourceType sourceResourceType) { - this.sourceResourceType = sourceResourceType; - return this; - } - - /** - * Get the conditionSets property: The application conditionSets - see examples. - * - * @return the conditionSets value. - */ - public List conditionSets() { - return this.conditionSets; - } - - /** - * Set the conditionSets property: The application conditionSets - see examples. - * - * @param conditionSets the conditionSets value to set. - * @return the ApplicationProperties object itself. - */ - public ApplicationProperties withConditionSets(List conditionSets) { - this.conditionSets = conditionSets; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sourceResourceType() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property sourceResourceType in model ApplicationProperties")); - } - if (conditionSets() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property conditionSets in model ApplicationProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ApplicationProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("sourceResourceType", - this.sourceResourceType == null ? null : this.sourceResourceType.toString()); - jsonWriter.writeArrayField("conditionSets", this.conditionSets, - (writer, element) -> writer.writeUntyped(element)); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeStringField("description", this.description); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ApplicationProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ApplicationProperties 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 ApplicationProperties. - */ - public static ApplicationProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ApplicationProperties deserializedApplicationProperties = new ApplicationProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sourceResourceType".equals(fieldName)) { - deserializedApplicationProperties.sourceResourceType - = ApplicationSourceResourceType.fromString(reader.getString()); - } else if ("conditionSets".equals(fieldName)) { - List conditionSets = reader.readArray(reader1 -> reader1.readUntyped()); - deserializedApplicationProperties.conditionSets = conditionSets; - } else if ("displayName".equals(fieldName)) { - deserializedApplicationProperties.displayName = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedApplicationProperties.description = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedApplicationProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AscLocationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AscLocationInner.java deleted file mode 100644 index f50f29f51148..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AscLocationInner.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ASC location of the subscription is in the "name" field. - */ -@Immutable -public final class AscLocationInner extends ProxyResource { - /* - * An empty set of properties - */ - private Object 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 AscLocationInner class. - */ - private AscLocationInner() { - } - - /** - * Get the properties property: An empty set of properties. - * - * @return the properties value. - */ - public Object properties() { - return this.properties; - } - - /** - * 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() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - if (this.properties != null) { - jsonWriter.writeUntypedField("properties", this.properties); - } - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AscLocationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AscLocationInner 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 AscLocationInner. - */ - public static AscLocationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AscLocationInner deserializedAscLocationInner = new AscLocationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAscLocationInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAscLocationInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAscLocationInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAscLocationInner.properties = reader.readUntyped(); - } else if ("systemData".equals(fieldName)) { - deserializedAscLocationInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAscLocationInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AssignmentInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AssignmentInner.java deleted file mode 100644 index 19c24c50f6e7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AssignmentInner.java +++ /dev/null @@ -1,487 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.AssignedComponentItem; -import com.azure.resourcemanager.security.models.AssignedStandardItem; -import com.azure.resourcemanager.security.models.AssignmentPropertiesAdditionalData; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Map; - -/** - * Security Assignment on a resource group over a given scope. - */ -@Fluent -public final class AssignmentInner extends ProxyResource { - /* - * Properties of a security assignment - */ - private AssignmentProperties innerProperties; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The geo-location where the resource lives - */ - private String location; - - /* - * Kind of the resource - */ - private String kind; - - /* - * Entity tag is used for comparing two or more entities from the same requested resource. - */ - private String etag; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of AssignmentInner class. - */ - public AssignmentInner() { - } - - /** - * Get the innerProperties property: Properties of a security assignment. - * - * @return the innerProperties value. - */ - private AssignmentProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the AssignmentInner object itself. - */ - public AssignmentInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The geo-location where the resource lives. - * - * @param location the location value to set. - * @return the AssignmentInner object itself. - */ - public AssignmentInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the kind property: Kind of the resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: Kind of the resource. - * - * @param kind the kind value to set. - * @return the AssignmentInner object itself. - */ - public AssignmentInner withKind(String kind) { - this.kind = kind; - return this; - } - - /** - * Get the etag property: Entity tag is used for comparing two or more entities from the same requested resource. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Entity tag is used for comparing two or more entities from the same requested resource. - * - * @param etag the etag value to set. - * @return the AssignmentInner object itself. - */ - public AssignmentInner withEtag(String etag) { - this.etag = etag; - 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; - } - - /** - * Get the displayName property: display name of the standardAssignment. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: display name of the standardAssignment. - * - * @param displayName the displayName value to set. - * @return the AssignmentInner object itself. - */ - public AssignmentInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new AssignmentProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the description property: description of the standardAssignment. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: description of the standardAssignment. - * - * @param description the description value to set. - * @return the AssignmentInner object itself. - */ - public AssignmentInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new AssignmentProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the assignedStandard property: Standard item with key as applied to this standard assignment over the given - * scope. - * - * @return the assignedStandard value. - */ - public AssignedStandardItem assignedStandard() { - return this.innerProperties() == null ? null : this.innerProperties().assignedStandard(); - } - - /** - * Set the assignedStandard property: Standard item with key as applied to this standard assignment over the given - * scope. - * - * @param assignedStandard the assignedStandard value to set. - * @return the AssignmentInner object itself. - */ - public AssignmentInner withAssignedStandard(AssignedStandardItem assignedStandard) { - if (this.innerProperties() == null) { - this.innerProperties = new AssignmentProperties(); - } - this.innerProperties().withAssignedStandard(assignedStandard); - return this; - } - - /** - * Get the assignedComponent property: Component item with key as applied to this standard assignment over the given - * scope. - * - * @return the assignedComponent value. - */ - public AssignedComponentItem assignedComponent() { - return this.innerProperties() == null ? null : this.innerProperties().assignedComponent(); - } - - /** - * Set the assignedComponent property: Component item with key as applied to this standard assignment over the given - * scope. - * - * @param assignedComponent the assignedComponent value to set. - * @return the AssignmentInner object itself. - */ - public AssignmentInner withAssignedComponent(AssignedComponentItem assignedComponent) { - if (this.innerProperties() == null) { - this.innerProperties = new AssignmentProperties(); - } - this.innerProperties().withAssignedComponent(assignedComponent); - return this; - } - - /** - * Get the scope property: Scope to which the standardAssignment applies - can be a subscription path or a resource - * group under that subscription. - * - * @return the scope value. - */ - public String scope() { - return this.innerProperties() == null ? null : this.innerProperties().scope(); - } - - /** - * Set the scope property: Scope to which the standardAssignment applies - can be a subscription path or a resource - * group under that subscription. - * - * @param scope the scope value to set. - * @return the AssignmentInner object itself. - */ - public AssignmentInner withScope(String scope) { - if (this.innerProperties() == null) { - this.innerProperties = new AssignmentProperties(); - } - this.innerProperties().withScope(scope); - return this; - } - - /** - * Get the effect property: expected effect of this assignment (Disable/Exempt/etc). - * - * @return the effect value. - */ - public String effect() { - return this.innerProperties() == null ? null : this.innerProperties().effect(); - } - - /** - * Set the effect property: expected effect of this assignment (Disable/Exempt/etc). - * - * @param effect the effect value to set. - * @return the AssignmentInner object itself. - */ - public AssignmentInner withEffect(String effect) { - if (this.innerProperties() == null) { - this.innerProperties = new AssignmentProperties(); - } - this.innerProperties().withEffect(effect); - return this; - } - - /** - * Get the expiresOn property: Expiration date of this assignment as a full ISO date. - * - * @return the expiresOn value. - */ - public OffsetDateTime expiresOn() { - return this.innerProperties() == null ? null : this.innerProperties().expiresOn(); - } - - /** - * Set the expiresOn property: Expiration date of this assignment as a full ISO date. - * - * @param expiresOn the expiresOn value to set. - * @return the AssignmentInner object itself. - */ - public AssignmentInner withExpiresOn(OffsetDateTime expiresOn) { - if (this.innerProperties() == null) { - this.innerProperties = new AssignmentProperties(); - } - this.innerProperties().withExpiresOn(expiresOn); - return this; - } - - /** - * Get the additionalData property: Additional data about the assignment. - * - * @return the additionalData value. - */ - public AssignmentPropertiesAdditionalData additionalData() { - return this.innerProperties() == null ? null : this.innerProperties().additionalData(); - } - - /** - * Set the additionalData property: Additional data about the assignment. - * - * @param additionalData the additionalData value to set. - * @return the AssignmentInner object itself. - */ - public AssignmentInner withAdditionalData(AssignmentPropertiesAdditionalData additionalData) { - if (this.innerProperties() == null) { - this.innerProperties = new AssignmentProperties(); - } - this.innerProperties().withAdditionalData(additionalData); - return this; - } - - /** - * Get the metadata property: The assignment metadata. Metadata is an open ended object and is typically a - * collection of key value pairs. - * - * @return the metadata value. - */ - public Object metadata() { - return this.innerProperties() == null ? null : this.innerProperties().metadata(); - } - - /** - * Set the metadata property: The assignment metadata. Metadata is an open ended object and is typically a - * collection of key value pairs. - * - * @param metadata the metadata value to set. - * @return the AssignmentInner object itself. - */ - public AssignmentInner withMetadata(Object metadata) { - if (this.innerProperties() == null) { - this.innerProperties = new AssignmentProperties(); - } - this.innerProperties().withMetadata(metadata); - 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); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeStringField("kind", this.kind); - jsonWriter.writeStringField("etag", this.etag); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AssignmentInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssignmentInner 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 AssignmentInner. - */ - public static AssignmentInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssignmentInner deserializedAssignmentInner = new AssignmentInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAssignmentInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAssignmentInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAssignmentInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAssignmentInner.innerProperties = AssignmentProperties.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedAssignmentInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedAssignmentInner.location = reader.getString(); - } else if ("kind".equals(fieldName)) { - deserializedAssignmentInner.kind = reader.getString(); - } else if ("etag".equals(fieldName)) { - deserializedAssignmentInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedAssignmentInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAssignmentInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AssignmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AssignmentProperties.java deleted file mode 100644 index 808f8ab8bd05..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AssignmentProperties.java +++ /dev/null @@ -1,346 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.AssignedComponentItem; -import com.azure.resourcemanager.security.models.AssignedStandardItem; -import com.azure.resourcemanager.security.models.AssignmentPropertiesAdditionalData; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Describes the properties of a standardAssignment. - */ -@Fluent -public final class AssignmentProperties implements JsonSerializable { - /* - * display name of the standardAssignment - */ - private String displayName; - - /* - * description of the standardAssignment - */ - private String description; - - /* - * Standard item with key as applied to this standard assignment over the given scope - */ - private AssignedStandardItem assignedStandard; - - /* - * Component item with key as applied to this standard assignment over the given scope - */ - private AssignedComponentItem assignedComponent; - - /* - * Scope to which the standardAssignment applies - can be a subscription path or a resource group under that - * subscription - */ - private String scope; - - /* - * expected effect of this assignment (Disable/Exempt/etc) - */ - private String effect; - - /* - * Expiration date of this assignment as a full ISO date - */ - private OffsetDateTime expiresOn; - - /* - * Additional data about the assignment - */ - private AssignmentPropertiesAdditionalData additionalData; - - /* - * The assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs. - */ - private Object metadata; - - /** - * Creates an instance of AssignmentProperties class. - */ - public AssignmentProperties() { - } - - /** - * Get the displayName property: display name of the standardAssignment. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: display name of the standardAssignment. - * - * @param displayName the displayName value to set. - * @return the AssignmentProperties object itself. - */ - public AssignmentProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the description property: description of the standardAssignment. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: description of the standardAssignment. - * - * @param description the description value to set. - * @return the AssignmentProperties object itself. - */ - public AssignmentProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the assignedStandard property: Standard item with key as applied to this standard assignment over the given - * scope. - * - * @return the assignedStandard value. - */ - public AssignedStandardItem assignedStandard() { - return this.assignedStandard; - } - - /** - * Set the assignedStandard property: Standard item with key as applied to this standard assignment over the given - * scope. - * - * @param assignedStandard the assignedStandard value to set. - * @return the AssignmentProperties object itself. - */ - public AssignmentProperties withAssignedStandard(AssignedStandardItem assignedStandard) { - this.assignedStandard = assignedStandard; - return this; - } - - /** - * Get the assignedComponent property: Component item with key as applied to this standard assignment over the given - * scope. - * - * @return the assignedComponent value. - */ - public AssignedComponentItem assignedComponent() { - return this.assignedComponent; - } - - /** - * Set the assignedComponent property: Component item with key as applied to this standard assignment over the given - * scope. - * - * @param assignedComponent the assignedComponent value to set. - * @return the AssignmentProperties object itself. - */ - public AssignmentProperties withAssignedComponent(AssignedComponentItem assignedComponent) { - this.assignedComponent = assignedComponent; - return this; - } - - /** - * Get the scope property: Scope to which the standardAssignment applies - can be a subscription path or a resource - * group under that subscription. - * - * @return the scope value. - */ - public String scope() { - return this.scope; - } - - /** - * Set the scope property: Scope to which the standardAssignment applies - can be a subscription path or a resource - * group under that subscription. - * - * @param scope the scope value to set. - * @return the AssignmentProperties object itself. - */ - public AssignmentProperties withScope(String scope) { - this.scope = scope; - return this; - } - - /** - * Get the effect property: expected effect of this assignment (Disable/Exempt/etc). - * - * @return the effect value. - */ - public String effect() { - return this.effect; - } - - /** - * Set the effect property: expected effect of this assignment (Disable/Exempt/etc). - * - * @param effect the effect value to set. - * @return the AssignmentProperties object itself. - */ - public AssignmentProperties withEffect(String effect) { - this.effect = effect; - return this; - } - - /** - * Get the expiresOn property: Expiration date of this assignment as a full ISO date. - * - * @return the expiresOn value. - */ - public OffsetDateTime expiresOn() { - return this.expiresOn; - } - - /** - * Set the expiresOn property: Expiration date of this assignment as a full ISO date. - * - * @param expiresOn the expiresOn value to set. - * @return the AssignmentProperties object itself. - */ - public AssignmentProperties withExpiresOn(OffsetDateTime expiresOn) { - this.expiresOn = expiresOn; - return this; - } - - /** - * Get the additionalData property: Additional data about the assignment. - * - * @return the additionalData value. - */ - public AssignmentPropertiesAdditionalData additionalData() { - return this.additionalData; - } - - /** - * Set the additionalData property: Additional data about the assignment. - * - * @param additionalData the additionalData value to set. - * @return the AssignmentProperties object itself. - */ - public AssignmentProperties withAdditionalData(AssignmentPropertiesAdditionalData additionalData) { - this.additionalData = additionalData; - return this; - } - - /** - * Get the metadata property: The assignment metadata. Metadata is an open ended object and is typically a - * collection of key value pairs. - * - * @return the metadata value. - */ - public Object metadata() { - return this.metadata; - } - - /** - * Set the metadata property: The assignment metadata. Metadata is an open ended object and is typically a - * collection of key value pairs. - * - * @param metadata the metadata value to set. - * @return the AssignmentProperties object itself. - */ - public AssignmentProperties withMetadata(Object metadata) { - this.metadata = metadata; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (assignedStandard() != null) { - assignedStandard().validate(); - } - if (assignedComponent() != null) { - assignedComponent().validate(); - } - if (additionalData() != null) { - additionalData().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeJsonField("assignedStandard", this.assignedStandard); - jsonWriter.writeJsonField("assignedComponent", this.assignedComponent); - jsonWriter.writeStringField("scope", this.scope); - jsonWriter.writeStringField("effect", this.effect); - jsonWriter.writeStringField("expiresOn", - this.expiresOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiresOn)); - jsonWriter.writeJsonField("additionalData", this.additionalData); - if (this.metadata != null) { - jsonWriter.writeUntypedField("metadata", this.metadata); - } - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AssignmentProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssignmentProperties 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 AssignmentProperties. - */ - public static AssignmentProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssignmentProperties deserializedAssignmentProperties = new AssignmentProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("displayName".equals(fieldName)) { - deserializedAssignmentProperties.displayName = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedAssignmentProperties.description = reader.getString(); - } else if ("assignedStandard".equals(fieldName)) { - deserializedAssignmentProperties.assignedStandard = AssignedStandardItem.fromJson(reader); - } else if ("assignedComponent".equals(fieldName)) { - deserializedAssignmentProperties.assignedComponent = AssignedComponentItem.fromJson(reader); - } else if ("scope".equals(fieldName)) { - deserializedAssignmentProperties.scope = reader.getString(); - } else if ("effect".equals(fieldName)) { - deserializedAssignmentProperties.effect = reader.getString(); - } else if ("expiresOn".equals(fieldName)) { - deserializedAssignmentProperties.expiresOn = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("additionalData".equals(fieldName)) { - deserializedAssignmentProperties.additionalData - = AssignmentPropertiesAdditionalData.fromJson(reader); - } else if ("metadata".equals(fieldName)) { - deserializedAssignmentProperties.metadata = reader.readUntyped(); - } else { - reader.skipChildren(); - } - } - - return deserializedAssignmentProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingInner.java deleted file mode 100644 index 792c0b85896f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingInner.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.AutoProvision; -import java.io.IOException; - -/** - * Auto provisioning setting. - */ -@Fluent -public final class AutoProvisioningSettingInner extends ProxyResource { - /* - * Auto provisioning setting data - */ - private AutoProvisioningSettingProperties 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 AutoProvisioningSettingInner class. - */ - public AutoProvisioningSettingInner() { - } - - /** - * Get the innerProperties property: Auto provisioning setting data. - * - * @return the innerProperties value. - */ - private AutoProvisioningSettingProperties 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 autoProvision property: Describes what kind of security agent provisioning action to take. - * - * @return the autoProvision value. - */ - public AutoProvision autoProvision() { - return this.innerProperties() == null ? null : this.innerProperties().autoProvision(); - } - - /** - * Set the autoProvision property: Describes what kind of security agent provisioning action to take. - * - * @param autoProvision the autoProvision value to set. - * @return the AutoProvisioningSettingInner object itself. - */ - public AutoProvisioningSettingInner withAutoProvision(AutoProvision autoProvision) { - if (this.innerProperties() == null) { - this.innerProperties = new AutoProvisioningSettingProperties(); - } - this.innerProperties().withAutoProvision(autoProvision); - 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 AutoProvisioningSettingInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutoProvisioningSettingInner 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 AutoProvisioningSettingInner. - */ - public static AutoProvisioningSettingInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutoProvisioningSettingInner deserializedAutoProvisioningSettingInner = new AutoProvisioningSettingInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAutoProvisioningSettingInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAutoProvisioningSettingInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAutoProvisioningSettingInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAutoProvisioningSettingInner.innerProperties - = AutoProvisioningSettingProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAutoProvisioningSettingInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAutoProvisioningSettingInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingProperties.java deleted file mode 100644 index 59d439d928b1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingProperties.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.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.security.models.AutoProvision; -import java.io.IOException; - -/** - * describes properties of an auto provisioning setting. - */ -@Fluent -public final class AutoProvisioningSettingProperties implements JsonSerializable { - /* - * Describes what kind of security agent provisioning action to take - */ - private AutoProvision autoProvision; - - /** - * Creates an instance of AutoProvisioningSettingProperties class. - */ - public AutoProvisioningSettingProperties() { - } - - /** - * Get the autoProvision property: Describes what kind of security agent provisioning action to take. - * - * @return the autoProvision value. - */ - public AutoProvision autoProvision() { - return this.autoProvision; - } - - /** - * Set the autoProvision property: Describes what kind of security agent provisioning action to take. - * - * @param autoProvision the autoProvision value to set. - * @return the AutoProvisioningSettingProperties object itself. - */ - public AutoProvisioningSettingProperties withAutoProvision(AutoProvision autoProvision) { - this.autoProvision = autoProvision; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (autoProvision() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property autoProvision in model AutoProvisioningSettingProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AutoProvisioningSettingProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("autoProvision", this.autoProvision == null ? null : this.autoProvision.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutoProvisioningSettingProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutoProvisioningSettingProperties 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 AutoProvisioningSettingProperties. - */ - public static AutoProvisioningSettingProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutoProvisioningSettingProperties deserializedAutoProvisioningSettingProperties - = new AutoProvisioningSettingProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("autoProvision".equals(fieldName)) { - deserializedAutoProvisioningSettingProperties.autoProvision - = AutoProvision.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAutoProvisioningSettingProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationInner.java deleted file mode 100644 index c7cdf2f6c46e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationInner.java +++ /dev/null @@ -1,395 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.AutomationAction; -import com.azure.resourcemanager.security.models.AutomationScope; -import com.azure.resourcemanager.security.models.AutomationSource; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * The security automation resource. - */ -@Fluent -public final class AutomationInner extends ProxyResource { - /* - * Security automation data - */ - private AutomationProperties innerProperties; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The geo-location where the resource lives - */ - private String location; - - /* - * Kind of the resource - */ - private String kind; - - /* - * Entity tag is used for comparing two or more entities from the same requested resource. - */ - private String etag; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of AutomationInner class. - */ - public AutomationInner() { - } - - /** - * Get the innerProperties property: Security automation data. - * - * @return the innerProperties value. - */ - private AutomationProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the AutomationInner object itself. - */ - public AutomationInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The geo-location where the resource lives. - * - * @param location the location value to set. - * @return the AutomationInner object itself. - */ - public AutomationInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the kind property: Kind of the resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: Kind of the resource. - * - * @param kind the kind value to set. - * @return the AutomationInner object itself. - */ - public AutomationInner withKind(String kind) { - this.kind = kind; - return this; - } - - /** - * Get the etag property: Entity tag is used for comparing two or more entities from the same requested resource. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Entity tag is used for comparing two or more entities from the same requested resource. - * - * @param etag the etag value to set. - * @return the AutomationInner object itself. - */ - public AutomationInner withEtag(String etag) { - this.etag = etag; - 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; - } - - /** - * Get the description property: The security automation description. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: The security automation description. - * - * @param description the description value to set. - * @return the AutomationInner object itself. - */ - public AutomationInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the isEnabled property: Indicates whether the security automation is enabled. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().isEnabled(); - } - - /** - * Set the isEnabled property: Indicates whether the security automation is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the AutomationInner object itself. - */ - public AutomationInner withIsEnabled(Boolean isEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withIsEnabled(isEnabled); - return this; - } - - /** - * Get the scopes property: A collection of scopes on which the security automations logic is applied. Supported - * scopes are the subscription itself or a resource group under that subscription. The automation will only apply on - * defined scopes. - * - * @return the scopes value. - */ - public List scopes() { - return this.innerProperties() == null ? null : this.innerProperties().scopes(); - } - - /** - * Set the scopes property: A collection of scopes on which the security automations logic is applied. Supported - * scopes are the subscription itself or a resource group under that subscription. The automation will only apply on - * defined scopes. - * - * @param scopes the scopes value to set. - * @return the AutomationInner object itself. - */ - public AutomationInner withScopes(List scopes) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withScopes(scopes); - return this; - } - - /** - * Get the sources property: A collection of the source event types which evaluate the security automation set of - * rules. - * - * @return the sources value. - */ - public List sources() { - return this.innerProperties() == null ? null : this.innerProperties().sources(); - } - - /** - * Set the sources property: A collection of the source event types which evaluate the security automation set of - * rules. - * - * @param sources the sources value to set. - * @return the AutomationInner object itself. - */ - public AutomationInner withSources(List sources) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withSources(sources); - return this; - } - - /** - * Get the actions property: A collection of the actions which are triggered if all the configured rules - * evaluations, within at least one rule set, are true. - * - * @return the actions value. - */ - public List actions() { - return this.innerProperties() == null ? null : this.innerProperties().actions(); - } - - /** - * Set the actions property: A collection of the actions which are triggered if all the configured rules - * evaluations, within at least one rule set, are true. - * - * @param actions the actions value to set. - * @return the AutomationInner object itself. - */ - public AutomationInner withActions(List actions) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withActions(actions); - 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); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeStringField("kind", this.kind); - jsonWriter.writeStringField("etag", this.etag); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationInner 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 AutomationInner. - */ - public static AutomationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationInner deserializedAutomationInner = new AutomationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAutomationInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAutomationInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAutomationInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAutomationInner.innerProperties = AutomationProperties.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedAutomationInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedAutomationInner.location = reader.getString(); - } else if ("kind".equals(fieldName)) { - deserializedAutomationInner.kind = reader.getString(); - } else if ("etag".equals(fieldName)) { - deserializedAutomationInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedAutomationInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationProperties.java deleted file mode 100644 index ebe1ba3c1961..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationProperties.java +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.AutomationAction; -import com.azure.resourcemanager.security.models.AutomationScope; -import com.azure.resourcemanager.security.models.AutomationSource; -import java.io.IOException; -import java.util.List; - -/** - * A set of properties that defines the behavior of the automation configuration. To learn more about the supported - * security events data models schemas - please visit https://aka.ms/ASCAutomationSchemas. - */ -@Fluent -public final class AutomationProperties implements JsonSerializable { - /* - * The security automation description. - */ - private String description; - - /* - * Indicates whether the security automation is enabled. - */ - private Boolean isEnabled; - - /* - * A collection of scopes on which the security automations logic is applied. Supported scopes are the subscription - * itself or a resource group under that subscription. The automation will only apply on defined scopes. - */ - private List scopes; - - /* - * A collection of the source event types which evaluate the security automation set of rules. - */ - private List sources; - - /* - * A collection of the actions which are triggered if all the configured rules evaluations, within at least one rule - * set, are true. - */ - private List actions; - - /** - * Creates an instance of AutomationProperties class. - */ - public AutomationProperties() { - } - - /** - * Get the description property: The security automation description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The security automation description. - * - * @param description the description value to set. - * @return the AutomationProperties object itself. - */ - public AutomationProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the isEnabled property: Indicates whether the security automation is enabled. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.isEnabled; - } - - /** - * Set the isEnabled property: Indicates whether the security automation is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the AutomationProperties object itself. - */ - public AutomationProperties withIsEnabled(Boolean isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - /** - * Get the scopes property: A collection of scopes on which the security automations logic is applied. Supported - * scopes are the subscription itself or a resource group under that subscription. The automation will only apply on - * defined scopes. - * - * @return the scopes value. - */ - public List scopes() { - return this.scopes; - } - - /** - * Set the scopes property: A collection of scopes on which the security automations logic is applied. Supported - * scopes are the subscription itself or a resource group under that subscription. The automation will only apply on - * defined scopes. - * - * @param scopes the scopes value to set. - * @return the AutomationProperties object itself. - */ - public AutomationProperties withScopes(List scopes) { - this.scopes = scopes; - return this; - } - - /** - * Get the sources property: A collection of the source event types which evaluate the security automation set of - * rules. - * - * @return the sources value. - */ - public List sources() { - return this.sources; - } - - /** - * Set the sources property: A collection of the source event types which evaluate the security automation set of - * rules. - * - * @param sources the sources value to set. - * @return the AutomationProperties object itself. - */ - public AutomationProperties withSources(List sources) { - this.sources = sources; - return this; - } - - /** - * Get the actions property: A collection of the actions which are triggered if all the configured rules - * evaluations, within at least one rule set, are true. - * - * @return the actions value. - */ - public List actions() { - return this.actions; - } - - /** - * Set the actions property: A collection of the actions which are triggered if all the configured rules - * evaluations, within at least one rule set, are true. - * - * @param actions the actions value to set. - * @return the AutomationProperties object itself. - */ - public AutomationProperties withActions(List actions) { - this.actions = actions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (scopes() != null) { - scopes().forEach(e -> e.validate()); - } - if (sources() != null) { - sources().forEach(e -> e.validate()); - } - if (actions() != null) { - actions().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeBooleanField("isEnabled", this.isEnabled); - jsonWriter.writeArrayField("scopes", this.scopes, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("actions", this.actions, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationProperties 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 AutomationProperties. - */ - public static AutomationProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationProperties deserializedAutomationProperties = new AutomationProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedAutomationProperties.description = reader.getString(); - } else if ("isEnabled".equals(fieldName)) { - deserializedAutomationProperties.isEnabled = reader.getNullable(JsonReader::getBoolean); - } else if ("scopes".equals(fieldName)) { - List scopes = reader.readArray(reader1 -> AutomationScope.fromJson(reader1)); - deserializedAutomationProperties.scopes = scopes; - } else if ("sources".equals(fieldName)) { - List sources = reader.readArray(reader1 -> AutomationSource.fromJson(reader1)); - deserializedAutomationProperties.sources = sources; - } else if ("actions".equals(fieldName)) { - List actions = reader.readArray(reader1 -> AutomationAction.fromJson(reader1)); - deserializedAutomationProperties.actions = actions; - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationValidationStatusInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationValidationStatusInner.java deleted file mode 100644 index ad0af56ac31b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationValidationStatusInner.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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; - -/** - * The security automation model state property bag. - */ -@Immutable -public final class AutomationValidationStatusInner implements JsonSerializable { - /* - * Indicates whether the model is valid or not. - */ - private Boolean isValid; - - /* - * The validation message. - */ - private String message; - - /** - * Creates an instance of AutomationValidationStatusInner class. - */ - private AutomationValidationStatusInner() { - } - - /** - * Get the isValid property: Indicates whether the model is valid or not. - * - * @return the isValid value. - */ - public Boolean isValid() { - return this.isValid; - } - - /** - * Get the message property: The validation message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * 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("isValid", this.isValid); - jsonWriter.writeStringField("message", this.message); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationValidationStatusInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationValidationStatusInner 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 AutomationValidationStatusInner. - */ - public static AutomationValidationStatusInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationValidationStatusInner deserializedAutomationValidationStatusInner - = new AutomationValidationStatusInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("isValid".equals(fieldName)) { - deserializedAutomationValidationStatusInner.isValid = reader.getNullable(JsonReader::getBoolean); - } else if ("message".equals(fieldName)) { - deserializedAutomationValidationStatusInner.message = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationValidationStatusInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgInner.java deleted file mode 100644 index 40ee763dcefb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.AzureDevOpsOrgProperties; -import java.io.IOException; - -/** - * Azure DevOps Organization resource. - */ -@Fluent -public final class AzureDevOpsOrgInner extends ProxyResource { - /* - * Azure DevOps Organization properties. - */ - private AzureDevOpsOrgProperties 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 AzureDevOpsOrgInner class. - */ - public AzureDevOpsOrgInner() { - } - - /** - * Get the properties property: Azure DevOps Organization properties. - * - * @return the properties value. - */ - public AzureDevOpsOrgProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Azure DevOps Organization properties. - * - * @param properties the properties value to set. - * @return the AzureDevOpsOrgInner object itself. - */ - public AzureDevOpsOrgInner withProperties(AzureDevOpsOrgProperties 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 AzureDevOpsOrgInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureDevOpsOrgInner 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 AzureDevOpsOrgInner. - */ - public static AzureDevOpsOrgInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureDevOpsOrgInner deserializedAzureDevOpsOrgInner = new AzureDevOpsOrgInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAzureDevOpsOrgInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAzureDevOpsOrgInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAzureDevOpsOrgInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAzureDevOpsOrgInner.properties = AzureDevOpsOrgProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAzureDevOpsOrgInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureDevOpsOrgInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgListResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgListResponseInner.java deleted file mode 100644 index 2168e9d05d27..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsOrgListResponseInner.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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; -import java.util.List; - -/** - * List of RP resources which supports pagination. - */ -@Immutable -public final class AzureDevOpsOrgListResponseInner implements JsonSerializable { - /* - * The AzureDevOpsOrg items on this page. - */ - private List value; - - /* - * The link to the next page of items. - */ - private String nextLink; - - /** - * Creates an instance of AzureDevOpsOrgListResponseInner class. - */ - private AzureDevOpsOrgListResponseInner() { - } - - /** - * Get the value property: The AzureDevOpsOrg items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * 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 AzureDevOpsOrgListResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureDevOpsOrgListResponseInner 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 AzureDevOpsOrgListResponseInner. - */ - public static AzureDevOpsOrgListResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureDevOpsOrgListResponseInner deserializedAzureDevOpsOrgListResponseInner - = new AzureDevOpsOrgListResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AzureDevOpsOrgInner.fromJson(reader1)); - deserializedAzureDevOpsOrgListResponseInner.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAzureDevOpsOrgListResponseInner.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureDevOpsOrgListResponseInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsProjectInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsProjectInner.java deleted file mode 100644 index 4d18aaae609f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsProjectInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.AzureDevOpsProjectProperties; -import java.io.IOException; - -/** - * Azure DevOps Project resource. - */ -@Fluent -public final class AzureDevOpsProjectInner extends ProxyResource { - /* - * Azure DevOps Project properties. - */ - private AzureDevOpsProjectProperties 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 AzureDevOpsProjectInner class. - */ - public AzureDevOpsProjectInner() { - } - - /** - * Get the properties property: Azure DevOps Project properties. - * - * @return the properties value. - */ - public AzureDevOpsProjectProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Azure DevOps Project properties. - * - * @param properties the properties value to set. - * @return the AzureDevOpsProjectInner object itself. - */ - public AzureDevOpsProjectInner withProperties(AzureDevOpsProjectProperties 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 AzureDevOpsProjectInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureDevOpsProjectInner 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 AzureDevOpsProjectInner. - */ - public static AzureDevOpsProjectInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureDevOpsProjectInner deserializedAzureDevOpsProjectInner = new AzureDevOpsProjectInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAzureDevOpsProjectInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAzureDevOpsProjectInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAzureDevOpsProjectInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAzureDevOpsProjectInner.properties = AzureDevOpsProjectProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAzureDevOpsProjectInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureDevOpsProjectInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsRepositoryInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsRepositoryInner.java deleted file mode 100644 index 4ce64bb6a26c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AzureDevOpsRepositoryInner.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.AzureDevOpsRepositoryProperties; -import java.io.IOException; - -/** - * Azure DevOps Repository resource. - */ -@Fluent -public final class AzureDevOpsRepositoryInner extends ProxyResource { - /* - * Azure DevOps Repository properties. - */ - private AzureDevOpsRepositoryProperties 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 AzureDevOpsRepositoryInner class. - */ - public AzureDevOpsRepositoryInner() { - } - - /** - * Get the properties property: Azure DevOps Repository properties. - * - * @return the properties value. - */ - public AzureDevOpsRepositoryProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Azure DevOps Repository properties. - * - * @param properties the properties value to set. - * @return the AzureDevOpsRepositoryInner object itself. - */ - public AzureDevOpsRepositoryInner withProperties(AzureDevOpsRepositoryProperties 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 AzureDevOpsRepositoryInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureDevOpsRepositoryInner 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 AzureDevOpsRepositoryInner. - */ - public static AzureDevOpsRepositoryInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureDevOpsRepositoryInner deserializedAzureDevOpsRepositoryInner = new AzureDevOpsRepositoryInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAzureDevOpsRepositoryInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAzureDevOpsRepositoryInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAzureDevOpsRepositoryInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAzureDevOpsRepositoryInner.properties - = AzureDevOpsRepositoryProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedAzureDevOpsRepositoryInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureDevOpsRepositoryInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceInner.java deleted file mode 100644 index 96ac8be0163e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceInner.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.ComplianceSegment; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * Compliance of a scope. - */ -@Immutable -public final class ComplianceInner extends ProxyResource { - /* - * Compliance data - */ - private ComplianceProperties 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 ComplianceInner class. - */ - private ComplianceInner() { - } - - /** - * Get the innerProperties property: Compliance data. - * - * @return the innerProperties value. - */ - private ComplianceProperties 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 assessmentTimestampUtcDate property: The timestamp when the Compliance calculation was conducted. - * - * @return the assessmentTimestampUtcDate value. - */ - public OffsetDateTime assessmentTimestampUtcDate() { - return this.innerProperties() == null ? null : this.innerProperties().assessmentTimestampUtcDate(); - } - - /** - * Get the resourceCount property: The resource count of the given subscription for which the Compliance calculation - * was conducted (needed for Management Group Compliance calculation). - * - * @return the resourceCount value. - */ - public Integer resourceCount() { - return this.innerProperties() == null ? null : this.innerProperties().resourceCount(); - } - - /** - * Get the assessmentResult property: An array of segment, which is the actually the compliance assessment. - * - * @return the assessmentResult value. - */ - public List assessmentResult() { - return this.innerProperties() == null ? null : this.innerProperties().assessmentResult(); - } - - /** - * 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 ComplianceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComplianceInner 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 ComplianceInner. - */ - public static ComplianceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ComplianceInner deserializedComplianceInner = new ComplianceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedComplianceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedComplianceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedComplianceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedComplianceInner.innerProperties = ComplianceProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedComplianceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedComplianceInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceProperties.java deleted file mode 100644 index 2f1d1498feb0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceProperties.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.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 com.azure.resourcemanager.security.models.ComplianceSegment; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * The Compliance score (percentage) of a Subscription is a sum of all Resources' Compliances under the given - * Subscription. A Resource Compliance is defined as the compliant ('healthy') Policy Definitions out of all Policy - * Definitions applicable to a given resource. - */ -@Immutable -public final class ComplianceProperties implements JsonSerializable { - /* - * The timestamp when the Compliance calculation was conducted. - */ - private OffsetDateTime assessmentTimestampUtcDate; - - /* - * The resource count of the given subscription for which the Compliance calculation was conducted (needed for - * Management Group Compliance calculation). - */ - private Integer resourceCount; - - /* - * An array of segment, which is the actually the compliance assessment. - */ - private List assessmentResult; - - /** - * Creates an instance of ComplianceProperties class. - */ - private ComplianceProperties() { - } - - /** - * Get the assessmentTimestampUtcDate property: The timestamp when the Compliance calculation was conducted. - * - * @return the assessmentTimestampUtcDate value. - */ - public OffsetDateTime assessmentTimestampUtcDate() { - return this.assessmentTimestampUtcDate; - } - - /** - * Get the resourceCount property: The resource count of the given subscription for which the Compliance calculation - * was conducted (needed for Management Group Compliance calculation). - * - * @return the resourceCount value. - */ - public Integer resourceCount() { - return this.resourceCount; - } - - /** - * Get the assessmentResult property: An array of segment, which is the actually the compliance assessment. - * - * @return the assessmentResult value. - */ - public List assessmentResult() { - return this.assessmentResult; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (assessmentResult() != null) { - assessmentResult().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ComplianceProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComplianceProperties 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 ComplianceProperties. - */ - public static ComplianceProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ComplianceProperties deserializedComplianceProperties = new ComplianceProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("assessmentTimestampUtcDate".equals(fieldName)) { - deserializedComplianceProperties.assessmentTimestampUtcDate = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("resourceCount".equals(fieldName)) { - deserializedComplianceProperties.resourceCount = reader.getNullable(JsonReader::getInt); - } else if ("assessmentResult".equals(fieldName)) { - List assessmentResult - = reader.readArray(reader1 -> ComplianceSegment.fromJson(reader1)); - deserializedComplianceProperties.assessmentResult = assessmentResult; - } else { - reader.skipChildren(); - } - } - - return deserializedComplianceProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceResultInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceResultInner.java deleted file mode 100644 index eaf829668cc0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceResultInner.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.ResourceStatus; -import java.io.IOException; - -/** - * a compliance result. - */ -@Immutable -public final class ComplianceResultInner extends ProxyResource { - /* - * Compliance result data - */ - private ComplianceResultProperties 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 ComplianceResultInner class. - */ - private ComplianceResultInner() { - } - - /** - * Get the innerProperties property: Compliance result data. - * - * @return the innerProperties value. - */ - private ComplianceResultProperties 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 resourceStatus property: The status of the resource regarding a single assessment. - * - * @return the resourceStatus value. - */ - public ResourceStatus resourceStatus() { - return this.innerProperties() == null ? null : this.innerProperties().resourceStatus(); - } - - /** - * 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 ComplianceResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComplianceResultInner 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 ComplianceResultInner. - */ - public static ComplianceResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ComplianceResultInner deserializedComplianceResultInner = new ComplianceResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedComplianceResultInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedComplianceResultInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedComplianceResultInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedComplianceResultInner.innerProperties = ComplianceResultProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedComplianceResultInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedComplianceResultInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceResultProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceResultProperties.java deleted file mode 100644 index 1ffbe27cdd07..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceResultProperties.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.ResourceStatus; -import java.io.IOException; - -/** - * Compliance result data. - */ -@Immutable -public final class ComplianceResultProperties implements JsonSerializable { - /* - * The status of the resource regarding a single assessment - */ - private ResourceStatus resourceStatus; - - /** - * Creates an instance of ComplianceResultProperties class. - */ - private ComplianceResultProperties() { - } - - /** - * Get the resourceStatus property: The status of the resource regarding a single assessment. - * - * @return the resourceStatus value. - */ - public ResourceStatus resourceStatus() { - return this.resourceStatus; - } - - /** - * 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 ComplianceResultProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComplianceResultProperties 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 ComplianceResultProperties. - */ - public static ComplianceResultProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ComplianceResultProperties deserializedComplianceResultProperties = new ComplianceResultProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceStatus".equals(fieldName)) { - deserializedComplianceResultProperties.resourceStatus - = ResourceStatus.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedComplianceResultProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomRecommendationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomRecommendationInner.java deleted file mode 100644 index 0888707ea158..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomRecommendationInner.java +++ /dev/null @@ -1,332 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.RecommendationSupportedClouds; -import com.azure.resourcemanager.security.models.SecurityIssue; -import com.azure.resourcemanager.security.models.SeverityEnum; -import java.io.IOException; -import java.util.List; - -/** - * Custom Recommendation. - */ -@Fluent -public final class CustomRecommendationInner extends ProxyResource { - /* - * describes Custom Recommendation properties. - */ - private CustomRecommendationProperties 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 CustomRecommendationInner class. - */ - public CustomRecommendationInner() { - } - - /** - * Get the innerProperties property: describes Custom Recommendation properties. - * - * @return the innerProperties value. - */ - private CustomRecommendationProperties 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 query property: KQL query representing the Recommendation results required. - * - * @return the query value. - */ - public String query() { - return this.innerProperties() == null ? null : this.innerProperties().query(); - } - - /** - * Set the query property: KQL query representing the Recommendation results required. - * - * @param query the query value to set. - * @return the CustomRecommendationInner object itself. - */ - public CustomRecommendationInner withQuery(String query) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomRecommendationProperties(); - } - this.innerProperties().withQuery(query); - return this; - } - - /** - * Get the cloudProviders property: List of all standard supported clouds. - * - * @return the cloudProviders value. - */ - public List cloudProviders() { - return this.innerProperties() == null ? null : this.innerProperties().cloudProviders(); - } - - /** - * Set the cloudProviders property: List of all standard supported clouds. - * - * @param cloudProviders the cloudProviders value to set. - * @return the CustomRecommendationInner object itself. - */ - public CustomRecommendationInner withCloudProviders(List cloudProviders) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomRecommendationProperties(); - } - this.innerProperties().withCloudProviders(cloudProviders); - return this; - } - - /** - * Get the severity property: The severity to relate to the assessments generated by this Recommendation. - * - * @return the severity value. - */ - public SeverityEnum severity() { - return this.innerProperties() == null ? null : this.innerProperties().severity(); - } - - /** - * Set the severity property: The severity to relate to the assessments generated by this Recommendation. - * - * @param severity the severity value to set. - * @return the CustomRecommendationInner object itself. - */ - public CustomRecommendationInner withSeverity(SeverityEnum severity) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomRecommendationProperties(); - } - this.innerProperties().withSeverity(severity); - return this; - } - - /** - * Get the securityIssue property: The severity to relate to the assessments generated by this Recommendation. - * - * @return the securityIssue value. - */ - public SecurityIssue securityIssue() { - return this.innerProperties() == null ? null : this.innerProperties().securityIssue(); - } - - /** - * Set the securityIssue property: The severity to relate to the assessments generated by this Recommendation. - * - * @param securityIssue the securityIssue value to set. - * @return the CustomRecommendationInner object itself. - */ - public CustomRecommendationInner withSecurityIssue(SecurityIssue securityIssue) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomRecommendationProperties(); - } - this.innerProperties().withSecurityIssue(securityIssue); - return this; - } - - /** - * Get the displayName property: The display name of the assessments generated by this Recommendation. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: The display name of the assessments generated by this Recommendation. - * - * @param displayName the displayName value to set. - * @return the CustomRecommendationInner object itself. - */ - public CustomRecommendationInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomRecommendationProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the description property: The description to relate to the assessments generated by this Recommendation. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: The description to relate to the assessments generated by this Recommendation. - * - * @param description the description value to set. - * @return the CustomRecommendationInner object itself. - */ - public CustomRecommendationInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomRecommendationProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the remediationDescription property: The remediation description to relate to the assessments generated by - * this Recommendation. - * - * @return the remediationDescription value. - */ - public String remediationDescription() { - return this.innerProperties() == null ? null : this.innerProperties().remediationDescription(); - } - - /** - * Set the remediationDescription property: The remediation description to relate to the assessments generated by - * this Recommendation. - * - * @param remediationDescription the remediationDescription value to set. - * @return the CustomRecommendationInner object itself. - */ - public CustomRecommendationInner withRemediationDescription(String remediationDescription) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomRecommendationProperties(); - } - this.innerProperties().withRemediationDescription(remediationDescription); - return this; - } - - /** - * Get the assessmentKey property: The assessment metadata key used when an assessment is generated for this - * Recommendation. - * - * @return the assessmentKey value. - */ - public String assessmentKey() { - return this.innerProperties() == null ? null : this.innerProperties().assessmentKey(); - } - - /** - * 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 CustomRecommendationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CustomRecommendationInner 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 CustomRecommendationInner. - */ - public static CustomRecommendationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CustomRecommendationInner deserializedCustomRecommendationInner = new CustomRecommendationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedCustomRecommendationInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedCustomRecommendationInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedCustomRecommendationInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedCustomRecommendationInner.innerProperties - = CustomRecommendationProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedCustomRecommendationInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCustomRecommendationInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomRecommendationProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomRecommendationProperties.java deleted file mode 100644 index e4314f559f10..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomRecommendationProperties.java +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.RecommendationSupportedClouds; -import com.azure.resourcemanager.security.models.SecurityIssue; -import com.azure.resourcemanager.security.models.SeverityEnum; -import java.io.IOException; -import java.util.List; - -/** - * describes the Custom Recommendation properties. - */ -@Fluent -public final class CustomRecommendationProperties implements JsonSerializable { - /* - * KQL query representing the Recommendation results required. - */ - private String query; - - /* - * List of all standard supported clouds. - */ - private List cloudProviders; - - /* - * The severity to relate to the assessments generated by this Recommendation. - */ - private SeverityEnum severity; - - /* - * The severity to relate to the assessments generated by this Recommendation. - */ - private SecurityIssue securityIssue; - - /* - * The display name of the assessments generated by this Recommendation. - */ - private String displayName; - - /* - * The description to relate to the assessments generated by this Recommendation. - */ - private String description; - - /* - * The remediation description to relate to the assessments generated by this Recommendation. - */ - private String remediationDescription; - - /* - * The assessment metadata key used when an assessment is generated for this Recommendation. - */ - private String assessmentKey; - - /** - * Creates an instance of CustomRecommendationProperties class. - */ - public CustomRecommendationProperties() { - } - - /** - * Get the query property: KQL query representing the Recommendation results required. - * - * @return the query value. - */ - public String query() { - return this.query; - } - - /** - * Set the query property: KQL query representing the Recommendation results required. - * - * @param query the query value to set. - * @return the CustomRecommendationProperties object itself. - */ - public CustomRecommendationProperties withQuery(String query) { - this.query = query; - return this; - } - - /** - * Get the cloudProviders property: List of all standard supported clouds. - * - * @return the cloudProviders value. - */ - public List cloudProviders() { - return this.cloudProviders; - } - - /** - * Set the cloudProviders property: List of all standard supported clouds. - * - * @param cloudProviders the cloudProviders value to set. - * @return the CustomRecommendationProperties object itself. - */ - public CustomRecommendationProperties withCloudProviders(List cloudProviders) { - this.cloudProviders = cloudProviders; - return this; - } - - /** - * Get the severity property: The severity to relate to the assessments generated by this Recommendation. - * - * @return the severity value. - */ - public SeverityEnum severity() { - return this.severity; - } - - /** - * Set the severity property: The severity to relate to the assessments generated by this Recommendation. - * - * @param severity the severity value to set. - * @return the CustomRecommendationProperties object itself. - */ - public CustomRecommendationProperties withSeverity(SeverityEnum severity) { - this.severity = severity; - return this; - } - - /** - * Get the securityIssue property: The severity to relate to the assessments generated by this Recommendation. - * - * @return the securityIssue value. - */ - public SecurityIssue securityIssue() { - return this.securityIssue; - } - - /** - * Set the securityIssue property: The severity to relate to the assessments generated by this Recommendation. - * - * @param securityIssue the securityIssue value to set. - * @return the CustomRecommendationProperties object itself. - */ - public CustomRecommendationProperties withSecurityIssue(SecurityIssue securityIssue) { - this.securityIssue = securityIssue; - return this; - } - - /** - * Get the displayName property: The display name of the assessments generated by this Recommendation. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the assessments generated by this Recommendation. - * - * @param displayName the displayName value to set. - * @return the CustomRecommendationProperties object itself. - */ - public CustomRecommendationProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the description property: The description to relate to the assessments generated by this Recommendation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description to relate to the assessments generated by this Recommendation. - * - * @param description the description value to set. - * @return the CustomRecommendationProperties object itself. - */ - public CustomRecommendationProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the remediationDescription property: The remediation description to relate to the assessments generated by - * this Recommendation. - * - * @return the remediationDescription value. - */ - public String remediationDescription() { - return this.remediationDescription; - } - - /** - * Set the remediationDescription property: The remediation description to relate to the assessments generated by - * this Recommendation. - * - * @param remediationDescription the remediationDescription value to set. - * @return the CustomRecommendationProperties object itself. - */ - public CustomRecommendationProperties withRemediationDescription(String remediationDescription) { - this.remediationDescription = remediationDescription; - return this; - } - - /** - * Get the assessmentKey property: The assessment metadata key used when an assessment is generated for this - * Recommendation. - * - * @return the assessmentKey value. - */ - public String assessmentKey() { - return this.assessmentKey; - } - - /** - * 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.writeArrayField("cloudProviders", this.cloudProviders, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeStringField("severity", this.severity == null ? null : this.severity.toString()); - jsonWriter.writeStringField("securityIssue", this.securityIssue == null ? null : this.securityIssue.toString()); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeStringField("remediationDescription", this.remediationDescription); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CustomRecommendationProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CustomRecommendationProperties 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 CustomRecommendationProperties. - */ - public static CustomRecommendationProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CustomRecommendationProperties deserializedCustomRecommendationProperties - = new CustomRecommendationProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("query".equals(fieldName)) { - deserializedCustomRecommendationProperties.query = reader.getString(); - } else if ("cloudProviders".equals(fieldName)) { - List cloudProviders - = reader.readArray(reader1 -> RecommendationSupportedClouds.fromString(reader1.getString())); - deserializedCustomRecommendationProperties.cloudProviders = cloudProviders; - } else if ("severity".equals(fieldName)) { - deserializedCustomRecommendationProperties.severity = SeverityEnum.fromString(reader.getString()); - } else if ("securityIssue".equals(fieldName)) { - deserializedCustomRecommendationProperties.securityIssue - = SecurityIssue.fromString(reader.getString()); - } else if ("displayName".equals(fieldName)) { - deserializedCustomRecommendationProperties.displayName = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedCustomRecommendationProperties.description = reader.getString(); - } else if ("remediationDescription".equals(fieldName)) { - deserializedCustomRecommendationProperties.remediationDescription = reader.getString(); - } else if ("assessmentKey".equals(fieldName)) { - deserializedCustomRecommendationProperties.assessmentKey = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCustomRecommendationProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DataExportSettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DataExportSettingProperties.java deleted file mode 100644 index bfd23c950044..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DataExportSettingProperties.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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 data export setting properties. - */ -@Fluent -public final class DataExportSettingProperties implements JsonSerializable { - /* - * Is the data export setting enabled - */ - private boolean enabled; - - /** - * Creates an instance of DataExportSettingProperties class. - */ - public DataExportSettingProperties() { - } - - /** - * Get the enabled property: Is the data export setting enabled. - * - * @return the enabled value. - */ - public boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is the data export setting enabled. - * - * @param enabled the enabled value to set. - * @return the DataExportSettingProperties object itself. - */ - public DataExportSettingProperties withEnabled(boolean enabled) { - this.enabled = enabled; - 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("enabled", this.enabled); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DataExportSettingProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DataExportSettingProperties 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 DataExportSettingProperties. - */ - public static DataExportSettingProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DataExportSettingProperties deserializedDataExportSettingProperties = new DataExportSettingProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDataExportSettingProperties.enabled = reader.getBoolean(); - } else { - reader.skipChildren(); - } - } - - return deserializedDataExportSettingProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DefenderForStorageSettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DefenderForStorageSettingInner.java deleted file mode 100644 index ee914a9b992a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DefenderForStorageSettingInner.java +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.DefenderForStorageSettingProperties; -import java.io.IOException; - -/** - * The Defender for Storage resource. - */ -@Fluent -public final class DefenderForStorageSettingInner extends ProxyResource { - /* - * Defender for Storage resource properties. - */ - private DefenderForStorageSettingProperties 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 DefenderForStorageSettingInner class. - */ - public DefenderForStorageSettingInner() { - } - - /** - * Get the properties property: Defender for Storage resource properties. - * - * @return the properties value. - */ - public DefenderForStorageSettingProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Defender for Storage resource properties. - * - * @param properties the properties value to set. - * @return the DefenderForStorageSettingInner object itself. - */ - public DefenderForStorageSettingInner withProperties(DefenderForStorageSettingProperties 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 DefenderForStorageSettingInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForStorageSettingInner 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 DefenderForStorageSettingInner. - */ - public static DefenderForStorageSettingInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForStorageSettingInner deserializedDefenderForStorageSettingInner - = new DefenderForStorageSettingInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedDefenderForStorageSettingInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedDefenderForStorageSettingInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedDefenderForStorageSettingInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedDefenderForStorageSettingInner.properties - = DefenderForStorageSettingProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedDefenderForStorageSettingInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForStorageSettingInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DevOpsConfigurationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DevOpsConfigurationInner.java deleted file mode 100644 index 5909c6b6e068..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DevOpsConfigurationInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.DevOpsConfigurationProperties; -import java.io.IOException; - -/** - * DevOps Configuration resource. - */ -@Fluent -public final class DevOpsConfigurationInner extends ProxyResource { - /* - * DevOps Configuration properties. - */ - private DevOpsConfigurationProperties 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 DevOpsConfigurationInner class. - */ - public DevOpsConfigurationInner() { - } - - /** - * Get the properties property: DevOps Configuration properties. - * - * @return the properties value. - */ - public DevOpsConfigurationProperties properties() { - return this.properties; - } - - /** - * Set the properties property: DevOps Configuration properties. - * - * @param properties the properties value to set. - * @return the DevOpsConfigurationInner object itself. - */ - public DevOpsConfigurationInner withProperties(DevOpsConfigurationProperties 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 DevOpsConfigurationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DevOpsConfigurationInner 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 DevOpsConfigurationInner. - */ - public static DevOpsConfigurationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DevOpsConfigurationInner deserializedDevOpsConfigurationInner = new DevOpsConfigurationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedDevOpsConfigurationInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedDevOpsConfigurationInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedDevOpsConfigurationInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedDevOpsConfigurationInner.properties = DevOpsConfigurationProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedDevOpsConfigurationInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDevOpsConfigurationInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupInner.java deleted file mode 100644 index 5dd6a975bd79..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupInner.java +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.AllowlistCustomAlertRule; -import com.azure.resourcemanager.security.models.DenylistCustomAlertRule; -import com.azure.resourcemanager.security.models.ThresholdCustomAlertRule; -import com.azure.resourcemanager.security.models.TimeWindowCustomAlertRule; -import java.io.IOException; -import java.util.List; - -/** - * The device security group resource. - */ -@Fluent -public final class DeviceSecurityGroupInner extends ProxyResource { - /* - * Device Security group data - */ - private DeviceSecurityGroupProperties 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 DeviceSecurityGroupInner class. - */ - public DeviceSecurityGroupInner() { - } - - /** - * Get the innerProperties property: Device Security group data. - * - * @return the innerProperties value. - */ - private DeviceSecurityGroupProperties 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 thresholdRules property: The list of custom alert threshold rules. - * - * @return the thresholdRules value. - */ - public List thresholdRules() { - return this.innerProperties() == null ? null : this.innerProperties().thresholdRules(); - } - - /** - * Set the thresholdRules property: The list of custom alert threshold rules. - * - * @param thresholdRules the thresholdRules value to set. - * @return the DeviceSecurityGroupInner object itself. - */ - public DeviceSecurityGroupInner withThresholdRules(List thresholdRules) { - if (this.innerProperties() == null) { - this.innerProperties = new DeviceSecurityGroupProperties(); - } - this.innerProperties().withThresholdRules(thresholdRules); - return this; - } - - /** - * Get the timeWindowRules property: The list of custom alert time-window rules. - * - * @return the timeWindowRules value. - */ - public List timeWindowRules() { - return this.innerProperties() == null ? null : this.innerProperties().timeWindowRules(); - } - - /** - * Set the timeWindowRules property: The list of custom alert time-window rules. - * - * @param timeWindowRules the timeWindowRules value to set. - * @return the DeviceSecurityGroupInner object itself. - */ - public DeviceSecurityGroupInner withTimeWindowRules(List timeWindowRules) { - if (this.innerProperties() == null) { - this.innerProperties = new DeviceSecurityGroupProperties(); - } - this.innerProperties().withTimeWindowRules(timeWindowRules); - return this; - } - - /** - * Get the allowlistRules property: The allow-list custom alert rules. - * - * @return the allowlistRules value. - */ - public List allowlistRules() { - return this.innerProperties() == null ? null : this.innerProperties().allowlistRules(); - } - - /** - * Set the allowlistRules property: The allow-list custom alert rules. - * - * @param allowlistRules the allowlistRules value to set. - * @return the DeviceSecurityGroupInner object itself. - */ - public DeviceSecurityGroupInner withAllowlistRules(List allowlistRules) { - if (this.innerProperties() == null) { - this.innerProperties = new DeviceSecurityGroupProperties(); - } - this.innerProperties().withAllowlistRules(allowlistRules); - return this; - } - - /** - * Get the denylistRules property: The deny-list custom alert rules. - * - * @return the denylistRules value. - */ - public List denylistRules() { - return this.innerProperties() == null ? null : this.innerProperties().denylistRules(); - } - - /** - * Set the denylistRules property: The deny-list custom alert rules. - * - * @param denylistRules the denylistRules value to set. - * @return the DeviceSecurityGroupInner object itself. - */ - public DeviceSecurityGroupInner withDenylistRules(List denylistRules) { - if (this.innerProperties() == null) { - this.innerProperties = new DeviceSecurityGroupProperties(); - } - this.innerProperties().withDenylistRules(denylistRules); - 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 DeviceSecurityGroupInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeviceSecurityGroupInner 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 DeviceSecurityGroupInner. - */ - public static DeviceSecurityGroupInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DeviceSecurityGroupInner deserializedDeviceSecurityGroupInner = new DeviceSecurityGroupInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedDeviceSecurityGroupInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedDeviceSecurityGroupInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedDeviceSecurityGroupInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedDeviceSecurityGroupInner.innerProperties - = DeviceSecurityGroupProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedDeviceSecurityGroupInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDeviceSecurityGroupInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupProperties.java deleted file mode 100644 index cf1b8bf86d44..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupProperties.java +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.AllowlistCustomAlertRule; -import com.azure.resourcemanager.security.models.DenylistCustomAlertRule; -import com.azure.resourcemanager.security.models.ThresholdCustomAlertRule; -import com.azure.resourcemanager.security.models.TimeWindowCustomAlertRule; -import java.io.IOException; -import java.util.List; - -/** - * describes properties of a security group. - */ -@Fluent -public final class DeviceSecurityGroupProperties implements JsonSerializable { - /* - * The list of custom alert threshold rules. - */ - private List thresholdRules; - - /* - * The list of custom alert time-window rules. - */ - private List timeWindowRules; - - /* - * The allow-list custom alert rules. - */ - private List allowlistRules; - - /* - * The deny-list custom alert rules. - */ - private List denylistRules; - - /** - * Creates an instance of DeviceSecurityGroupProperties class. - */ - public DeviceSecurityGroupProperties() { - } - - /** - * Get the thresholdRules property: The list of custom alert threshold rules. - * - * @return the thresholdRules value. - */ - public List thresholdRules() { - return this.thresholdRules; - } - - /** - * Set the thresholdRules property: The list of custom alert threshold rules. - * - * @param thresholdRules the thresholdRules value to set. - * @return the DeviceSecurityGroupProperties object itself. - */ - public DeviceSecurityGroupProperties withThresholdRules(List thresholdRules) { - this.thresholdRules = thresholdRules; - return this; - } - - /** - * Get the timeWindowRules property: The list of custom alert time-window rules. - * - * @return the timeWindowRules value. - */ - public List timeWindowRules() { - return this.timeWindowRules; - } - - /** - * Set the timeWindowRules property: The list of custom alert time-window rules. - * - * @param timeWindowRules the timeWindowRules value to set. - * @return the DeviceSecurityGroupProperties object itself. - */ - public DeviceSecurityGroupProperties withTimeWindowRules(List timeWindowRules) { - this.timeWindowRules = timeWindowRules; - return this; - } - - /** - * Get the allowlistRules property: The allow-list custom alert rules. - * - * @return the allowlistRules value. - */ - public List allowlistRules() { - return this.allowlistRules; - } - - /** - * Set the allowlistRules property: The allow-list custom alert rules. - * - * @param allowlistRules the allowlistRules value to set. - * @return the DeviceSecurityGroupProperties object itself. - */ - public DeviceSecurityGroupProperties withAllowlistRules(List allowlistRules) { - this.allowlistRules = allowlistRules; - return this; - } - - /** - * Get the denylistRules property: The deny-list custom alert rules. - * - * @return the denylistRules value. - */ - public List denylistRules() { - return this.denylistRules; - } - - /** - * Set the denylistRules property: The deny-list custom alert rules. - * - * @param denylistRules the denylistRules value to set. - * @return the DeviceSecurityGroupProperties object itself. - */ - public DeviceSecurityGroupProperties withDenylistRules(List denylistRules) { - this.denylistRules = denylistRules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (thresholdRules() != null) { - thresholdRules().forEach(e -> e.validate()); - } - if (timeWindowRules() != null) { - timeWindowRules().forEach(e -> e.validate()); - } - if (allowlistRules() != null) { - allowlistRules().forEach(e -> e.validate()); - } - if (denylistRules() != null) { - denylistRules().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("thresholdRules", this.thresholdRules, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("timeWindowRules", this.timeWindowRules, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("allowlistRules", this.allowlistRules, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("denylistRules", this.denylistRules, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeviceSecurityGroupProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeviceSecurityGroupProperties 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 DeviceSecurityGroupProperties. - */ - public static DeviceSecurityGroupProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DeviceSecurityGroupProperties deserializedDeviceSecurityGroupProperties - = new DeviceSecurityGroupProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("thresholdRules".equals(fieldName)) { - List thresholdRules - = reader.readArray(reader1 -> ThresholdCustomAlertRule.fromJson(reader1)); - deserializedDeviceSecurityGroupProperties.thresholdRules = thresholdRules; - } else if ("timeWindowRules".equals(fieldName)) { - List timeWindowRules - = reader.readArray(reader1 -> TimeWindowCustomAlertRule.fromJson(reader1)); - deserializedDeviceSecurityGroupProperties.timeWindowRules = timeWindowRules; - } else if ("allowlistRules".equals(fieldName)) { - List allowlistRules - = reader.readArray(reader1 -> AllowlistCustomAlertRule.fromJson(reader1)); - deserializedDeviceSecurityGroupProperties.allowlistRules = allowlistRules; - } else if ("denylistRules".equals(fieldName)) { - List denylistRules - = reader.readArray(reader1 -> DenylistCustomAlertRule.fromJson(reader1)); - deserializedDeviceSecurityGroupProperties.denylistRules = denylistRules; - } else { - reader.skipChildren(); - } - } - - return deserializedDeviceSecurityGroupProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionInner.java deleted file mode 100644 index fcb129146d14..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionInner.java +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -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.security.models.SecurityFamily; -import java.io.IOException; - -/** - * Concrete proxy resource types can be created by aliasing this type using a specific property type. - */ -@Immutable -public final class DiscoveredSecuritySolutionInner extends ProxyResource { - /* - * The properties property. - */ - private DiscoveredSecuritySolutionProperties innerProperties; - - /* - * Location where the resource is stored - */ - private String location; - - /* - * 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 DiscoveredSecuritySolutionInner class. - */ - private DiscoveredSecuritySolutionInner() { - } - - /** - * Get the innerProperties property: The properties property. - * - * @return the innerProperties value. - */ - private DiscoveredSecuritySolutionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * 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 securityFamily property: The security family of the discovered solution. - * - * @return the securityFamily value. - */ - public SecurityFamily securityFamily() { - return this.innerProperties() == null ? null : this.innerProperties().securityFamily(); - } - - /** - * Get the offer property: The security solutions' image offer. - * - * @return the offer value. - */ - public String offer() { - return this.innerProperties() == null ? null : this.innerProperties().offer(); - } - - /** - * Get the publisher property: The security solutions' image publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.innerProperties() == null ? null : this.innerProperties().publisher(); - } - - /** - * Get the sku property: The security solutions' image sku. - * - * @return the sku value. - */ - public String sku() { - return this.innerProperties() == null ? null : this.innerProperties().sku(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model DiscoveredSecuritySolutionInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DiscoveredSecuritySolutionInner.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DiscoveredSecuritySolutionInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DiscoveredSecuritySolutionInner 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 DiscoveredSecuritySolutionInner. - */ - public static DiscoveredSecuritySolutionInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DiscoveredSecuritySolutionInner deserializedDiscoveredSecuritySolutionInner - = new DiscoveredSecuritySolutionInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedDiscoveredSecuritySolutionInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedDiscoveredSecuritySolutionInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedDiscoveredSecuritySolutionInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedDiscoveredSecuritySolutionInner.innerProperties - = DiscoveredSecuritySolutionProperties.fromJson(reader); - } else if ("location".equals(fieldName)) { - deserializedDiscoveredSecuritySolutionInner.location = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedDiscoveredSecuritySolutionInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDiscoveredSecuritySolutionInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionProperties.java deleted file mode 100644 index 61a47b7b197b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionProperties.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -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.security.models.SecurityFamily; -import java.io.IOException; - -/** - * The DiscoveredSecuritySolutionProperties model. - */ -@Immutable -public final class DiscoveredSecuritySolutionProperties - implements JsonSerializable { - /* - * The security family of the discovered solution - */ - private SecurityFamily securityFamily; - - /* - * The security solutions' image offer - */ - private String offer; - - /* - * The security solutions' image publisher - */ - private String publisher; - - /* - * The security solutions' image sku - */ - private String sku; - - /** - * Creates an instance of DiscoveredSecuritySolutionProperties class. - */ - private DiscoveredSecuritySolutionProperties() { - } - - /** - * Get the securityFamily property: The security family of the discovered solution. - * - * @return the securityFamily value. - */ - public SecurityFamily securityFamily() { - return this.securityFamily; - } - - /** - * Get the offer property: The security solutions' image offer. - * - * @return the offer value. - */ - public String offer() { - return this.offer; - } - - /** - * Get the publisher property: The security solutions' image publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Get the sku property: The security solutions' image sku. - * - * @return the sku value. - */ - public String sku() { - return this.sku; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (securityFamily() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property securityFamily in model DiscoveredSecuritySolutionProperties")); - } - if (offer() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property offer in model DiscoveredSecuritySolutionProperties")); - } - if (publisher() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property publisher in model DiscoveredSecuritySolutionProperties")); - } - if (sku() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property sku in model DiscoveredSecuritySolutionProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DiscoveredSecuritySolutionProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("securityFamily", - this.securityFamily == null ? null : this.securityFamily.toString()); - jsonWriter.writeStringField("offer", this.offer); - jsonWriter.writeStringField("publisher", this.publisher); - jsonWriter.writeStringField("sku", this.sku); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DiscoveredSecuritySolutionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DiscoveredSecuritySolutionProperties 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 DiscoveredSecuritySolutionProperties. - */ - public static DiscoveredSecuritySolutionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DiscoveredSecuritySolutionProperties deserializedDiscoveredSecuritySolutionProperties - = new DiscoveredSecuritySolutionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("securityFamily".equals(fieldName)) { - deserializedDiscoveredSecuritySolutionProperties.securityFamily - = SecurityFamily.fromString(reader.getString()); - } else if ("offer".equals(fieldName)) { - deserializedDiscoveredSecuritySolutionProperties.offer = reader.getString(); - } else if ("publisher".equals(fieldName)) { - deserializedDiscoveredSecuritySolutionProperties.publisher = reader.getString(); - } else if ("sku".equals(fieldName)) { - deserializedDiscoveredSecuritySolutionProperties.sku = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDiscoveredSecuritySolutionProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ExternalSecuritySolutionInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ExternalSecuritySolutionInner.java deleted file mode 100644 index 2a409c9f4008..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ExternalSecuritySolutionInner.java +++ /dev/null @@ -1,255 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.AadExternalSecuritySolution; -import com.azure.resourcemanager.security.models.AtaExternalSecuritySolution; -import com.azure.resourcemanager.security.models.CefExternalSecuritySolution; -import com.azure.resourcemanager.security.models.ExternalSecuritySolutionKind; -import java.io.IOException; - -/** - * Represents a security solution external to Microsoft Defender for Cloud which sends information to an OMS workspace - * and whose data is displayed by Microsoft Defender for Cloud. - */ -@Immutable -public class ExternalSecuritySolutionInner extends ProxyResource { - /* - * The kind of the external solution - */ - private ExternalSecuritySolutionKind kind = ExternalSecuritySolutionKind.fromString("ExternalSecuritySolution"); - - /* - * The resource-specific properties for this resource. - */ - private Object properties; - - /* - * Location where the resource is stored - */ - private String location; - - /* - * 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 ExternalSecuritySolutionInner class. - */ - protected ExternalSecuritySolutionInner() { - } - - /** - * Get the kind property: The kind of the external solution. - * - * @return the kind value. - */ - public ExternalSecuritySolutionKind kind() { - return this.kind; - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public Object properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the ExternalSecuritySolutionInner object itself. - */ - ExternalSecuritySolutionInner withProperties(Object properties) { - this.properties = properties; - return this; - } - - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Location where the resource is stored. - * - * @param location the location value to set. - * @return the ExternalSecuritySolutionInner object itself. - */ - ExternalSecuritySolutionInner withLocation(String location) { - this.location = location; - 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; - } - - /** - * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @param systemData the systemData value to set. - * @return the ExternalSecuritySolutionInner object itself. - */ - ExternalSecuritySolutionInner withSystemData(SystemData systemData) { - this.systemData = systemData; - return this; - } - - /** - * 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() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); - if (this.properties != null) { - jsonWriter.writeUntypedField("properties", this.properties); - } - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ExternalSecuritySolutionInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ExternalSecuritySolutionInner 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 ExternalSecuritySolutionInner. - */ - public static ExternalSecuritySolutionInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("kind".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("CEF".equals(discriminatorValue)) { - return CefExternalSecuritySolution.fromJson(readerToUse.reset()); - } else if ("ATA".equals(discriminatorValue)) { - return AtaExternalSecuritySolution.fromJson(readerToUse.reset()); - } else if ("AAD".equals(discriminatorValue)) { - return AadExternalSecuritySolution.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static ExternalSecuritySolutionInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ExternalSecuritySolutionInner deserializedExternalSecuritySolutionInner - = new ExternalSecuritySolutionInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedExternalSecuritySolutionInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedExternalSecuritySolutionInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedExternalSecuritySolutionInner.type = reader.getString(); - } else if ("kind".equals(fieldName)) { - deserializedExternalSecuritySolutionInner.kind - = ExternalSecuritySolutionKind.fromString(reader.getString()); - } else if ("properties".equals(fieldName)) { - deserializedExternalSecuritySolutionInner.properties = reader.readUntyped(); - } else if ("location".equals(fieldName)) { - deserializedExternalSecuritySolutionInner.location = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedExternalSecuritySolutionInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedExternalSecuritySolutionInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsListResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsListResponseInner.java deleted file mode 100644 index 4c38cf74997d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsListResponseInner.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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; -import java.util.List; - -/** - * A list with a single sensitivity settings resource. - */ -@Immutable -public final class GetSensitivitySettingsListResponseInner - implements JsonSerializable { - /* - * The value property. - */ - private List value; - - /** - * Creates an instance of GetSensitivitySettingsListResponseInner class. - */ - private GetSensitivitySettingsListResponseInner() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * 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 GetSensitivitySettingsListResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GetSensitivitySettingsListResponseInner 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 GetSensitivitySettingsListResponseInner. - */ - public static GetSensitivitySettingsListResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GetSensitivitySettingsListResponseInner deserializedGetSensitivitySettingsListResponseInner - = new GetSensitivitySettingsListResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> GetSensitivitySettingsResponseInner.fromJson(reader1)); - deserializedGetSensitivitySettingsListResponseInner.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedGetSensitivitySettingsListResponseInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsResponseInner.java deleted file mode 100644 index 201a167a6dc2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsResponseInner.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponseProperties; -import java.io.IOException; - -/** - * Data sensitivity settings for sensitive data discovery. - */ -@Immutable -public final class GetSensitivitySettingsResponseInner extends ProxyResource { - /* - * The sensitivity settings properties - */ - private GetSensitivitySettingsResponseProperties 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 GetSensitivitySettingsResponseInner class. - */ - private GetSensitivitySettingsResponseInner() { - } - - /** - * Get the properties property: The sensitivity settings properties. - * - * @return the properties value. - */ - public GetSensitivitySettingsResponseProperties properties() { - return this.properties; - } - - /** - * 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 GetSensitivitySettingsResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GetSensitivitySettingsResponseInner 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 GetSensitivitySettingsResponseInner. - */ - public static GetSensitivitySettingsResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GetSensitivitySettingsResponseInner deserializedGetSensitivitySettingsResponseInner - = new GetSensitivitySettingsResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGetSensitivitySettingsResponseInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGetSensitivitySettingsResponseInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGetSensitivitySettingsResponseInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedGetSensitivitySettingsResponseInner.properties - = GetSensitivitySettingsResponseProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedGetSensitivitySettingsResponseInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGetSensitivitySettingsResponseInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerInner.java deleted file mode 100644 index 70583efdaec5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerInner.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.GitHubOwnerProperties; -import java.io.IOException; - -/** - * GitHub Owner resource. - */ -@Immutable -public final class GitHubOwnerInner extends ProxyResource { - /* - * GitHub Owner properties. - */ - private GitHubOwnerProperties 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 GitHubOwnerInner class. - */ - private GitHubOwnerInner() { - } - - /** - * Get the properties property: GitHub Owner properties. - * - * @return the properties value. - */ - public GitHubOwnerProperties properties() { - return this.properties; - } - - /** - * 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 GitHubOwnerInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GitHubOwnerInner 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 GitHubOwnerInner. - */ - public static GitHubOwnerInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GitHubOwnerInner deserializedGitHubOwnerInner = new GitHubOwnerInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGitHubOwnerInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGitHubOwnerInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGitHubOwnerInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedGitHubOwnerInner.properties = GitHubOwnerProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedGitHubOwnerInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGitHubOwnerInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerListResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerListResponseInner.java deleted file mode 100644 index bdc6ae5e6902..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubOwnerListResponseInner.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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; -import java.util.List; - -/** - * List of RP resources which supports pagination. - */ -@Immutable -public final class GitHubOwnerListResponseInner implements JsonSerializable { - /* - * The GitHubOwner items on this page. - */ - private List value; - - /* - * The link to the next page of items. - */ - private String nextLink; - - /** - * Creates an instance of GitHubOwnerListResponseInner class. - */ - private GitHubOwnerListResponseInner() { - } - - /** - * Get the value property: The GitHubOwner items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * 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 GitHubOwnerListResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GitHubOwnerListResponseInner 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 GitHubOwnerListResponseInner. - */ - public static GitHubOwnerListResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GitHubOwnerListResponseInner deserializedGitHubOwnerListResponseInner = new GitHubOwnerListResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> GitHubOwnerInner.fromJson(reader1)); - deserializedGitHubOwnerListResponseInner.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedGitHubOwnerListResponseInner.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGitHubOwnerListResponseInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubRepositoryInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubRepositoryInner.java deleted file mode 100644 index 4ca36e0d4b8c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitHubRepositoryInner.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.GitHubRepositoryProperties; -import java.io.IOException; - -/** - * GitHub Repository resource. - */ -@Immutable -public final class GitHubRepositoryInner extends ProxyResource { - /* - * GitHub Repository properties. - */ - private GitHubRepositoryProperties 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 GitHubRepositoryInner class. - */ - private GitHubRepositoryInner() { - } - - /** - * Get the properties property: GitHub Repository properties. - * - * @return the properties value. - */ - public GitHubRepositoryProperties properties() { - return this.properties; - } - - /** - * 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 GitHubRepositoryInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GitHubRepositoryInner 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 GitHubRepositoryInner. - */ - public static GitHubRepositoryInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GitHubRepositoryInner deserializedGitHubRepositoryInner = new GitHubRepositoryInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGitHubRepositoryInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGitHubRepositoryInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGitHubRepositoryInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedGitHubRepositoryInner.properties = GitHubRepositoryProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedGitHubRepositoryInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGitHubRepositoryInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupInner.java deleted file mode 100644 index ddc0d53037e1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupInner.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.GitLabGroupProperties; -import java.io.IOException; - -/** - * GitLab Group resource. - */ -@Immutable -public final class GitLabGroupInner extends ProxyResource { - /* - * GitLab Group properties. - */ - private GitLabGroupProperties 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 GitLabGroupInner class. - */ - private GitLabGroupInner() { - } - - /** - * Get the properties property: GitLab Group properties. - * - * @return the properties value. - */ - public GitLabGroupProperties properties() { - return this.properties; - } - - /** - * 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 GitLabGroupInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GitLabGroupInner 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 GitLabGroupInner. - */ - public static GitLabGroupInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GitLabGroupInner deserializedGitLabGroupInner = new GitLabGroupInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGitLabGroupInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGitLabGroupInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGitLabGroupInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedGitLabGroupInner.properties = GitLabGroupProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedGitLabGroupInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGitLabGroupInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupListResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupListResponseInner.java deleted file mode 100644 index 64e94550173b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabGroupListResponseInner.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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; -import java.util.List; - -/** - * List of RP resources which supports pagination. - */ -@Immutable -public final class GitLabGroupListResponseInner implements JsonSerializable { - /* - * The GitLabGroup items on this page. - */ - private List value; - - /* - * The link to the next page of items. - */ - private String nextLink; - - /** - * Creates an instance of GitLabGroupListResponseInner class. - */ - private GitLabGroupListResponseInner() { - } - - /** - * Get the value property: The GitLabGroup items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * 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 GitLabGroupListResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GitLabGroupListResponseInner 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 GitLabGroupListResponseInner. - */ - public static GitLabGroupListResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GitLabGroupListResponseInner deserializedGitLabGroupListResponseInner = new GitLabGroupListResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> GitLabGroupInner.fromJson(reader1)); - deserializedGitLabGroupListResponseInner.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedGitLabGroupListResponseInner.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGitLabGroupListResponseInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabProjectInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabProjectInner.java deleted file mode 100644 index 9760fb5acacf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GitLabProjectInner.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.GitLabProjectProperties; -import java.io.IOException; - -/** - * GitLab Project resource. - */ -@Immutable -public final class GitLabProjectInner extends ProxyResource { - /* - * GitLab Project properties. - */ - private GitLabProjectProperties 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 GitLabProjectInner class. - */ - private GitLabProjectInner() { - } - - /** - * Get the properties property: GitLab Project properties. - * - * @return the properties value. - */ - public GitLabProjectProperties properties() { - return this.properties; - } - - /** - * 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 GitLabProjectInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GitLabProjectInner 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 GitLabProjectInner. - */ - public static GitLabProjectInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GitLabProjectInner deserializedGitLabProjectInner = new GitLabProjectInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGitLabProjectInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGitLabProjectInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGitLabProjectInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedGitLabProjectInner.properties = GitLabProjectProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedGitLabProjectInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGitLabProjectInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentInner.java deleted file mode 100644 index 7e88a433fcb2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentInner.java +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.GovernanceAssignmentAdditionalData; -import com.azure.resourcemanager.security.models.GovernanceEmailNotification; -import com.azure.resourcemanager.security.models.RemediationEta; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Governance assignment over a given scope. - */ -@Fluent -public final class GovernanceAssignmentInner extends ProxyResource { - /* - * The properties of a governance assignment - */ - private GovernanceAssignmentProperties 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 GovernanceAssignmentInner class. - */ - public GovernanceAssignmentInner() { - } - - /** - * Get the innerProperties property: The properties of a governance assignment. - * - * @return the innerProperties value. - */ - private GovernanceAssignmentProperties 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 owner property: The Owner for the governance assignment - e.g. user@contoso.com - see example. - * - * @return the owner value. - */ - public String owner() { - return this.innerProperties() == null ? null : this.innerProperties().owner(); - } - - /** - * Set the owner property: The Owner for the governance assignment - e.g. user@contoso.com - see example. - * - * @param owner the owner value to set. - * @return the GovernanceAssignmentInner object itself. - */ - public GovernanceAssignmentInner withOwner(String owner) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceAssignmentProperties(); - } - this.innerProperties().withOwner(owner); - return this; - } - - /** - * Get the remediationDueDate property: The remediation due-date - after this date Secure Score will be affected (in - * case of active grace-period). - * - * @return the remediationDueDate value. - */ - public OffsetDateTime remediationDueDate() { - return this.innerProperties() == null ? null : this.innerProperties().remediationDueDate(); - } - - /** - * Set the remediationDueDate property: The remediation due-date - after this date Secure Score will be affected (in - * case of active grace-period). - * - * @param remediationDueDate the remediationDueDate value to set. - * @return the GovernanceAssignmentInner object itself. - */ - public GovernanceAssignmentInner withRemediationDueDate(OffsetDateTime remediationDueDate) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceAssignmentProperties(); - } - this.innerProperties().withRemediationDueDate(remediationDueDate); - return this; - } - - /** - * Get the remediationEta property: The ETA (estimated time of arrival) for remediation (optional), see example. - * - * @return the remediationEta value. - */ - public RemediationEta remediationEta() { - return this.innerProperties() == null ? null : this.innerProperties().remediationEta(); - } - - /** - * Set the remediationEta property: The ETA (estimated time of arrival) for remediation (optional), see example. - * - * @param remediationEta the remediationEta value to set. - * @return the GovernanceAssignmentInner object itself. - */ - public GovernanceAssignmentInner withRemediationEta(RemediationEta remediationEta) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceAssignmentProperties(); - } - this.innerProperties().withRemediationEta(remediationEta); - return this; - } - - /** - * Get the isGracePeriod property: Defines whether there is a grace period on the governance assignment. - * - * @return the isGracePeriod value. - */ - public Boolean isGracePeriod() { - return this.innerProperties() == null ? null : this.innerProperties().isGracePeriod(); - } - - /** - * Set the isGracePeriod property: Defines whether there is a grace period on the governance assignment. - * - * @param isGracePeriod the isGracePeriod value to set. - * @return the GovernanceAssignmentInner object itself. - */ - public GovernanceAssignmentInner withIsGracePeriod(Boolean isGracePeriod) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceAssignmentProperties(); - } - this.innerProperties().withIsGracePeriod(isGracePeriod); - return this; - } - - /** - * Get the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @return the governanceEmailNotification value. - */ - public GovernanceEmailNotification governanceEmailNotification() { - return this.innerProperties() == null ? null : this.innerProperties().governanceEmailNotification(); - } - - /** - * Set the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @param governanceEmailNotification the governanceEmailNotification value to set. - * @return the GovernanceAssignmentInner object itself. - */ - public GovernanceAssignmentInner - withGovernanceEmailNotification(GovernanceEmailNotification governanceEmailNotification) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceAssignmentProperties(); - } - this.innerProperties().withGovernanceEmailNotification(governanceEmailNotification); - return this; - } - - /** - * Get the additionalData property: The additional data for the governance assignment - e.g. links to ticket - * (optional), see example. - * - * @return the additionalData value. - */ - public GovernanceAssignmentAdditionalData additionalData() { - return this.innerProperties() == null ? null : this.innerProperties().additionalData(); - } - - /** - * Set the additionalData property: The additional data for the governance assignment - e.g. links to ticket - * (optional), see example. - * - * @param additionalData the additionalData value to set. - * @return the GovernanceAssignmentInner object itself. - */ - public GovernanceAssignmentInner withAdditionalData(GovernanceAssignmentAdditionalData additionalData) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceAssignmentProperties(); - } - this.innerProperties().withAdditionalData(additionalData); - 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 GovernanceAssignmentInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GovernanceAssignmentInner 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 GovernanceAssignmentInner. - */ - public static GovernanceAssignmentInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GovernanceAssignmentInner deserializedGovernanceAssignmentInner = new GovernanceAssignmentInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGovernanceAssignmentInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGovernanceAssignmentInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGovernanceAssignmentInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedGovernanceAssignmentInner.innerProperties - = GovernanceAssignmentProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedGovernanceAssignmentInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGovernanceAssignmentInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentProperties.java deleted file mode 100644 index f918d5ecbff3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentProperties.java +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.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 com.azure.resourcemanager.security.models.GovernanceAssignmentAdditionalData; -import com.azure.resourcemanager.security.models.GovernanceEmailNotification; -import com.azure.resourcemanager.security.models.RemediationEta; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Describes properties of an governance assignment. - */ -@Fluent -public final class GovernanceAssignmentProperties implements JsonSerializable { - /* - * The Owner for the governance assignment - e.g. user@contoso.com - see example - */ - private String owner; - - /* - * The remediation due-date - after this date Secure Score will be affected (in case of active grace-period) - */ - private OffsetDateTime remediationDueDate; - - /* - * The ETA (estimated time of arrival) for remediation (optional), see example - */ - private RemediationEta remediationEta; - - /* - * Defines whether there is a grace period on the governance assignment - */ - private Boolean isGracePeriod; - - /* - * The email notifications settings for the governance rule, states whether to disable notifications for mangers and - * owners - */ - private GovernanceEmailNotification governanceEmailNotification; - - /* - * The additional data for the governance assignment - e.g. links to ticket (optional), see example - */ - private GovernanceAssignmentAdditionalData additionalData; - - /** - * Creates an instance of GovernanceAssignmentProperties class. - */ - public GovernanceAssignmentProperties() { - } - - /** - * Get the owner property: The Owner for the governance assignment - e.g. user@contoso.com - see example. - * - * @return the owner value. - */ - public String owner() { - return this.owner; - } - - /** - * Set the owner property: The Owner for the governance assignment - e.g. user@contoso.com - see example. - * - * @param owner the owner value to set. - * @return the GovernanceAssignmentProperties object itself. - */ - public GovernanceAssignmentProperties withOwner(String owner) { - this.owner = owner; - return this; - } - - /** - * Get the remediationDueDate property: The remediation due-date - after this date Secure Score will be affected (in - * case of active grace-period). - * - * @return the remediationDueDate value. - */ - public OffsetDateTime remediationDueDate() { - return this.remediationDueDate; - } - - /** - * Set the remediationDueDate property: The remediation due-date - after this date Secure Score will be affected (in - * case of active grace-period). - * - * @param remediationDueDate the remediationDueDate value to set. - * @return the GovernanceAssignmentProperties object itself. - */ - public GovernanceAssignmentProperties withRemediationDueDate(OffsetDateTime remediationDueDate) { - this.remediationDueDate = remediationDueDate; - return this; - } - - /** - * Get the remediationEta property: The ETA (estimated time of arrival) for remediation (optional), see example. - * - * @return the remediationEta value. - */ - public RemediationEta remediationEta() { - return this.remediationEta; - } - - /** - * Set the remediationEta property: The ETA (estimated time of arrival) for remediation (optional), see example. - * - * @param remediationEta the remediationEta value to set. - * @return the GovernanceAssignmentProperties object itself. - */ - public GovernanceAssignmentProperties withRemediationEta(RemediationEta remediationEta) { - this.remediationEta = remediationEta; - return this; - } - - /** - * Get the isGracePeriod property: Defines whether there is a grace period on the governance assignment. - * - * @return the isGracePeriod value. - */ - public Boolean isGracePeriod() { - return this.isGracePeriod; - } - - /** - * Set the isGracePeriod property: Defines whether there is a grace period on the governance assignment. - * - * @param isGracePeriod the isGracePeriod value to set. - * @return the GovernanceAssignmentProperties object itself. - */ - public GovernanceAssignmentProperties withIsGracePeriod(Boolean isGracePeriod) { - this.isGracePeriod = isGracePeriod; - return this; - } - - /** - * Get the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @return the governanceEmailNotification value. - */ - public GovernanceEmailNotification governanceEmailNotification() { - return this.governanceEmailNotification; - } - - /** - * Set the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @param governanceEmailNotification the governanceEmailNotification value to set. - * @return the GovernanceAssignmentProperties object itself. - */ - public GovernanceAssignmentProperties - withGovernanceEmailNotification(GovernanceEmailNotification governanceEmailNotification) { - this.governanceEmailNotification = governanceEmailNotification; - return this; - } - - /** - * Get the additionalData property: The additional data for the governance assignment - e.g. links to ticket - * (optional), see example. - * - * @return the additionalData value. - */ - public GovernanceAssignmentAdditionalData additionalData() { - return this.additionalData; - } - - /** - * Set the additionalData property: The additional data for the governance assignment - e.g. links to ticket - * (optional), see example. - * - * @param additionalData the additionalData value to set. - * @return the GovernanceAssignmentProperties object itself. - */ - public GovernanceAssignmentProperties withAdditionalData(GovernanceAssignmentAdditionalData additionalData) { - this.additionalData = additionalData; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (remediationDueDate() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property remediationDueDate in model GovernanceAssignmentProperties")); - } - if (remediationEta() != null) { - remediationEta().validate(); - } - if (governanceEmailNotification() != null) { - governanceEmailNotification().validate(); - } - if (additionalData() != null) { - additionalData().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(GovernanceAssignmentProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("remediationDueDate", - this.remediationDueDate == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.remediationDueDate)); - jsonWriter.writeStringField("owner", this.owner); - jsonWriter.writeJsonField("remediationEta", this.remediationEta); - jsonWriter.writeBooleanField("isGracePeriod", this.isGracePeriod); - jsonWriter.writeJsonField("governanceEmailNotification", this.governanceEmailNotification); - jsonWriter.writeJsonField("additionalData", this.additionalData); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GovernanceAssignmentProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GovernanceAssignmentProperties 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 GovernanceAssignmentProperties. - */ - public static GovernanceAssignmentProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GovernanceAssignmentProperties deserializedGovernanceAssignmentProperties - = new GovernanceAssignmentProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("remediationDueDate".equals(fieldName)) { - deserializedGovernanceAssignmentProperties.remediationDueDate = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("owner".equals(fieldName)) { - deserializedGovernanceAssignmentProperties.owner = reader.getString(); - } else if ("remediationEta".equals(fieldName)) { - deserializedGovernanceAssignmentProperties.remediationEta = RemediationEta.fromJson(reader); - } else if ("isGracePeriod".equals(fieldName)) { - deserializedGovernanceAssignmentProperties.isGracePeriod - = reader.getNullable(JsonReader::getBoolean); - } else if ("governanceEmailNotification".equals(fieldName)) { - deserializedGovernanceAssignmentProperties.governanceEmailNotification - = GovernanceEmailNotification.fromJson(reader); - } else if ("additionalData".equals(fieldName)) { - deserializedGovernanceAssignmentProperties.additionalData - = GovernanceAssignmentAdditionalData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGovernanceAssignmentProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleInner.java deleted file mode 100644 index 246f345eb4ad..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleInner.java +++ /dev/null @@ -1,502 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.GovernanceRuleEmailNotification; -import com.azure.resourcemanager.security.models.GovernanceRuleMetadata; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.io.IOException; -import java.util.List; - -/** - * Governance rule over a given scope. - */ -@Fluent -public final class GovernanceRuleInner extends ProxyResource { - /* - * Properties of a governance rule - */ - private GovernanceRuleProperties 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 GovernanceRuleInner class. - */ - public GovernanceRuleInner() { - } - - /** - * Get the innerProperties property: Properties of a governance rule. - * - * @return the innerProperties value. - */ - private GovernanceRuleProperties 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 tenantId property: The tenantId (GUID). - * - * @return the tenantId value. - */ - public String tenantId() { - return this.innerProperties() == null ? null : this.innerProperties().tenantId(); - } - - /** - * Get the displayName property: Display name of the governance rule. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: Display name of the governance rule. - * - * @param displayName the displayName value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the description property: Description of the governance rule. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: Description of the governance rule. - * - * @param description the description value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the remediationTimeframe property: Governance rule remediation timeframe - this is the time that will affect - * on the grace-period duration e.g. 7.00:00:00 - means 7 days. - * - * @return the remediationTimeframe value. - */ - public String remediationTimeframe() { - return this.innerProperties() == null ? null : this.innerProperties().remediationTimeframe(); - } - - /** - * Set the remediationTimeframe property: Governance rule remediation timeframe - this is the time that will affect - * on the grace-period duration e.g. 7.00:00:00 - means 7 days. - * - * @param remediationTimeframe the remediationTimeframe value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withRemediationTimeframe(String remediationTimeframe) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withRemediationTimeframe(remediationTimeframe); - return this; - } - - /** - * Get the isGracePeriod property: Defines whether there is a grace period on the governance rule. - * - * @return the isGracePeriod value. - */ - public Boolean isGracePeriod() { - return this.innerProperties() == null ? null : this.innerProperties().isGracePeriod(); - } - - /** - * Set the isGracePeriod property: Defines whether there is a grace period on the governance rule. - * - * @param isGracePeriod the isGracePeriod value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withIsGracePeriod(Boolean isGracePeriod) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withIsGracePeriod(isGracePeriod); - return this; - } - - /** - * Get the rulePriority property: The governance rule priority, priority to the lower number. Rules with the same - * priority on the same scope will not be allowed. - * - * @return the rulePriority value. - */ - public Integer rulePriority() { - return this.innerProperties() == null ? null : this.innerProperties().rulePriority(); - } - - /** - * Set the rulePriority property: The governance rule priority, priority to the lower number. Rules with the same - * priority on the same scope will not be allowed. - * - * @param rulePriority the rulePriority value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withRulePriority(Integer rulePriority) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withRulePriority(rulePriority); - return this; - } - - /** - * Get the isDisabled property: Defines whether the rule is active/inactive. - * - * @return the isDisabled value. - */ - public Boolean isDisabled() { - return this.innerProperties() == null ? null : this.innerProperties().isDisabled(); - } - - /** - * Set the isDisabled property: Defines whether the rule is active/inactive. - * - * @param isDisabled the isDisabled value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withIsDisabled(Boolean isDisabled) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withIsDisabled(isDisabled); - return this; - } - - /** - * Get the ruleType property: The rule type of the governance rule, defines the source of the rule e.g. Integrated. - * - * @return the ruleType value. - */ - public GovernanceRuleType ruleType() { - return this.innerProperties() == null ? null : this.innerProperties().ruleType(); - } - - /** - * Set the ruleType property: The rule type of the governance rule, defines the source of the rule e.g. Integrated. - * - * @param ruleType the ruleType value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withRuleType(GovernanceRuleType ruleType) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withRuleType(ruleType); - return this; - } - - /** - * Get the sourceResourceType property: The governance rule source, what the rule affects, e.g. Assessments. - * - * @return the sourceResourceType value. - */ - public GovernanceRuleSourceResourceType sourceResourceType() { - return this.innerProperties() == null ? null : this.innerProperties().sourceResourceType(); - } - - /** - * Set the sourceResourceType property: The governance rule source, what the rule affects, e.g. Assessments. - * - * @param sourceResourceType the sourceResourceType value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withSourceResourceType(GovernanceRuleSourceResourceType sourceResourceType) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withSourceResourceType(sourceResourceType); - return this; - } - - /** - * Get the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). - * - * @return the excludedScopes value. - */ - public List excludedScopes() { - return this.innerProperties() == null ? null : this.innerProperties().excludedScopes(); - } - - /** - * Set the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). - * - * @param excludedScopes the excludedScopes value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withExcludedScopes(List excludedScopes) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withExcludedScopes(excludedScopes); - return this; - } - - /** - * Get the conditionSets property: The governance rule conditionSets - see examples. - * - * @return the conditionSets value. - */ - public List conditionSets() { - return this.innerProperties() == null ? null : this.innerProperties().conditionSets(); - } - - /** - * Set the conditionSets property: The governance rule conditionSets - see examples. - * - * @param conditionSets the conditionSets value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withConditionSets(List conditionSets) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withConditionSets(conditionSets); - return this; - } - - /** - * Get the includeMemberScopes property: Defines whether the rule is management scope rule (master connector as a - * single scope or management scope). - * - * @return the includeMemberScopes value. - */ - public Boolean includeMemberScopes() { - return this.innerProperties() == null ? null : this.innerProperties().includeMemberScopes(); - } - - /** - * Set the includeMemberScopes property: Defines whether the rule is management scope rule (master connector as a - * single scope or management scope). - * - * @param includeMemberScopes the includeMemberScopes value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withIncludeMemberScopes(Boolean includeMemberScopes) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withIncludeMemberScopes(includeMemberScopes); - return this; - } - - /** - * Get the ownerSource property: The owner source for the governance rule - e.g. Manually by user@contoso.com - - * see example. - * - * @return the ownerSource value. - */ - public GovernanceRuleOwnerSource ownerSource() { - return this.innerProperties() == null ? null : this.innerProperties().ownerSource(); - } - - /** - * Set the ownerSource property: The owner source for the governance rule - e.g. Manually by user@contoso.com - - * see example. - * - * @param ownerSource the ownerSource value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withOwnerSource(GovernanceRuleOwnerSource ownerSource) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withOwnerSource(ownerSource); - return this; - } - - /** - * Get the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @return the governanceEmailNotification value. - */ - public GovernanceRuleEmailNotification governanceEmailNotification() { - return this.innerProperties() == null ? null : this.innerProperties().governanceEmailNotification(); - } - - /** - * Set the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @param governanceEmailNotification the governanceEmailNotification value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner - withGovernanceEmailNotification(GovernanceRuleEmailNotification governanceEmailNotification) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withGovernanceEmailNotification(governanceEmailNotification); - return this; - } - - /** - * Get the metadata property: The governance rule metadata. - * - * @return the metadata value. - */ - public GovernanceRuleMetadata metadata() { - return this.innerProperties() == null ? null : this.innerProperties().metadata(); - } - - /** - * Set the metadata property: The governance rule metadata. - * - * @param metadata the metadata value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withMetadata(GovernanceRuleMetadata metadata) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withMetadata(metadata); - 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 GovernanceRuleInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GovernanceRuleInner 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 GovernanceRuleInner. - */ - public static GovernanceRuleInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GovernanceRuleInner deserializedGovernanceRuleInner = new GovernanceRuleInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedGovernanceRuleInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedGovernanceRuleInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedGovernanceRuleInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedGovernanceRuleInner.innerProperties = GovernanceRuleProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedGovernanceRuleInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGovernanceRuleInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleProperties.java deleted file mode 100644 index cf68a6fef173..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleProperties.java +++ /dev/null @@ -1,538 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.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.security.models.GovernanceRuleEmailNotification; -import com.azure.resourcemanager.security.models.GovernanceRuleMetadata; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.io.IOException; -import java.util.List; - -/** - * Describes properties of an governance rule. - */ -@Fluent -public final class GovernanceRuleProperties implements JsonSerializable { - /* - * The tenantId (GUID) - */ - private String tenantId; - - /* - * Display name of the governance rule - */ - private String displayName; - - /* - * Description of the governance rule - */ - private String description; - - /* - * Governance rule remediation timeframe - this is the time that will affect on the grace-period duration e.g. - * 7.00:00:00 - means 7 days - */ - private String remediationTimeframe; - - /* - * Defines whether there is a grace period on the governance rule - */ - private Boolean isGracePeriod; - - /* - * The governance rule priority, priority to the lower number. Rules with the same priority on the same scope will - * not be allowed - */ - private int rulePriority; - - /* - * Defines whether the rule is active/inactive - */ - private Boolean isDisabled; - - /* - * The rule type of the governance rule, defines the source of the rule e.g. Integrated - */ - private GovernanceRuleType ruleType; - - /* - * The governance rule source, what the rule affects, e.g. Assessments - */ - private GovernanceRuleSourceResourceType sourceResourceType; - - /* - * Excluded scopes, filter out the descendants of the scope (on management scopes) - */ - private List excludedScopes; - - /* - * The governance rule conditionSets - see examples - */ - private List conditionSets; - - /* - * Defines whether the rule is management scope rule (master connector as a single scope or management scope) - */ - private Boolean includeMemberScopes; - - /* - * The owner source for the governance rule - e.g. Manually by user@contoso.com - see example - */ - private GovernanceRuleOwnerSource ownerSource; - - /* - * The email notifications settings for the governance rule, states whether to disable notifications for mangers and - * owners - */ - private GovernanceRuleEmailNotification governanceEmailNotification; - - /* - * The governance rule metadata - */ - private GovernanceRuleMetadata metadata; - - /** - * Creates an instance of GovernanceRuleProperties class. - */ - public GovernanceRuleProperties() { - } - - /** - * Get the tenantId property: The tenantId (GUID). - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the displayName property: Display name of the governance rule. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Display name of the governance rule. - * - * @param displayName the displayName value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the description property: Description of the governance rule. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the governance rule. - * - * @param description the description value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the remediationTimeframe property: Governance rule remediation timeframe - this is the time that will affect - * on the grace-period duration e.g. 7.00:00:00 - means 7 days. - * - * @return the remediationTimeframe value. - */ - public String remediationTimeframe() { - return this.remediationTimeframe; - } - - /** - * Set the remediationTimeframe property: Governance rule remediation timeframe - this is the time that will affect - * on the grace-period duration e.g. 7.00:00:00 - means 7 days. - * - * @param remediationTimeframe the remediationTimeframe value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withRemediationTimeframe(String remediationTimeframe) { - this.remediationTimeframe = remediationTimeframe; - return this; - } - - /** - * Get the isGracePeriod property: Defines whether there is a grace period on the governance rule. - * - * @return the isGracePeriod value. - */ - public Boolean isGracePeriod() { - return this.isGracePeriod; - } - - /** - * Set the isGracePeriod property: Defines whether there is a grace period on the governance rule. - * - * @param isGracePeriod the isGracePeriod value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withIsGracePeriod(Boolean isGracePeriod) { - this.isGracePeriod = isGracePeriod; - return this; - } - - /** - * Get the rulePriority property: The governance rule priority, priority to the lower number. Rules with the same - * priority on the same scope will not be allowed. - * - * @return the rulePriority value. - */ - public int rulePriority() { - return this.rulePriority; - } - - /** - * Set the rulePriority property: The governance rule priority, priority to the lower number. Rules with the same - * priority on the same scope will not be allowed. - * - * @param rulePriority the rulePriority value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withRulePriority(int rulePriority) { - this.rulePriority = rulePriority; - return this; - } - - /** - * Get the isDisabled property: Defines whether the rule is active/inactive. - * - * @return the isDisabled value. - */ - public Boolean isDisabled() { - return this.isDisabled; - } - - /** - * Set the isDisabled property: Defines whether the rule is active/inactive. - * - * @param isDisabled the isDisabled value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withIsDisabled(Boolean isDisabled) { - this.isDisabled = isDisabled; - return this; - } - - /** - * Get the ruleType property: The rule type of the governance rule, defines the source of the rule e.g. Integrated. - * - * @return the ruleType value. - */ - public GovernanceRuleType ruleType() { - return this.ruleType; - } - - /** - * Set the ruleType property: The rule type of the governance rule, defines the source of the rule e.g. Integrated. - * - * @param ruleType the ruleType value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withRuleType(GovernanceRuleType ruleType) { - this.ruleType = ruleType; - return this; - } - - /** - * Get the sourceResourceType property: The governance rule source, what the rule affects, e.g. Assessments. - * - * @return the sourceResourceType value. - */ - public GovernanceRuleSourceResourceType sourceResourceType() { - return this.sourceResourceType; - } - - /** - * Set the sourceResourceType property: The governance rule source, what the rule affects, e.g. Assessments. - * - * @param sourceResourceType the sourceResourceType value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withSourceResourceType(GovernanceRuleSourceResourceType sourceResourceType) { - this.sourceResourceType = sourceResourceType; - return this; - } - - /** - * Get the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). - * - * @return the excludedScopes value. - */ - public List excludedScopes() { - return this.excludedScopes; - } - - /** - * Set the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). - * - * @param excludedScopes the excludedScopes value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withExcludedScopes(List excludedScopes) { - this.excludedScopes = excludedScopes; - return this; - } - - /** - * Get the conditionSets property: The governance rule conditionSets - see examples. - * - * @return the conditionSets value. - */ - public List conditionSets() { - return this.conditionSets; - } - - /** - * Set the conditionSets property: The governance rule conditionSets - see examples. - * - * @param conditionSets the conditionSets value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withConditionSets(List conditionSets) { - this.conditionSets = conditionSets; - return this; - } - - /** - * Get the includeMemberScopes property: Defines whether the rule is management scope rule (master connector as a - * single scope or management scope). - * - * @return the includeMemberScopes value. - */ - public Boolean includeMemberScopes() { - return this.includeMemberScopes; - } - - /** - * Set the includeMemberScopes property: Defines whether the rule is management scope rule (master connector as a - * single scope or management scope). - * - * @param includeMemberScopes the includeMemberScopes value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withIncludeMemberScopes(Boolean includeMemberScopes) { - this.includeMemberScopes = includeMemberScopes; - return this; - } - - /** - * Get the ownerSource property: The owner source for the governance rule - e.g. Manually by user@contoso.com - - * see example. - * - * @return the ownerSource value. - */ - public GovernanceRuleOwnerSource ownerSource() { - return this.ownerSource; - } - - /** - * Set the ownerSource property: The owner source for the governance rule - e.g. Manually by user@contoso.com - - * see example. - * - * @param ownerSource the ownerSource value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withOwnerSource(GovernanceRuleOwnerSource ownerSource) { - this.ownerSource = ownerSource; - return this; - } - - /** - * Get the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @return the governanceEmailNotification value. - */ - public GovernanceRuleEmailNotification governanceEmailNotification() { - return this.governanceEmailNotification; - } - - /** - * Set the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @param governanceEmailNotification the governanceEmailNotification value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties - withGovernanceEmailNotification(GovernanceRuleEmailNotification governanceEmailNotification) { - this.governanceEmailNotification = governanceEmailNotification; - return this; - } - - /** - * Get the metadata property: The governance rule metadata. - * - * @return the metadata value. - */ - public GovernanceRuleMetadata metadata() { - return this.metadata; - } - - /** - * Set the metadata property: The governance rule metadata. - * - * @param metadata the metadata value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withMetadata(GovernanceRuleMetadata metadata) { - this.metadata = metadata; - 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 GovernanceRuleProperties")); - } - if (ruleType() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property ruleType in model GovernanceRuleProperties")); - } - if (sourceResourceType() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property sourceResourceType in model GovernanceRuleProperties")); - } - if (conditionSets() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property conditionSets in model GovernanceRuleProperties")); - } - if (ownerSource() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property ownerSource in model GovernanceRuleProperties")); - } else { - ownerSource().validate(); - } - if (governanceEmailNotification() != null) { - governanceEmailNotification().validate(); - } - if (metadata() != null) { - metadata().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(GovernanceRuleProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeIntField("rulePriority", this.rulePriority); - jsonWriter.writeStringField("ruleType", this.ruleType == null ? null : this.ruleType.toString()); - jsonWriter.writeStringField("sourceResourceType", - this.sourceResourceType == null ? null : this.sourceResourceType.toString()); - jsonWriter.writeArrayField("conditionSets", this.conditionSets, - (writer, element) -> writer.writeUntyped(element)); - jsonWriter.writeJsonField("ownerSource", this.ownerSource); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeStringField("remediationTimeframe", this.remediationTimeframe); - jsonWriter.writeBooleanField("isGracePeriod", this.isGracePeriod); - jsonWriter.writeBooleanField("isDisabled", this.isDisabled); - jsonWriter.writeArrayField("excludedScopes", this.excludedScopes, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeBooleanField("includeMemberScopes", this.includeMemberScopes); - jsonWriter.writeJsonField("governanceEmailNotification", this.governanceEmailNotification); - jsonWriter.writeJsonField("metadata", this.metadata); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GovernanceRuleProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GovernanceRuleProperties 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 GovernanceRuleProperties. - */ - public static GovernanceRuleProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GovernanceRuleProperties deserializedGovernanceRuleProperties = new GovernanceRuleProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("displayName".equals(fieldName)) { - deserializedGovernanceRuleProperties.displayName = reader.getString(); - } else if ("rulePriority".equals(fieldName)) { - deserializedGovernanceRuleProperties.rulePriority = reader.getInt(); - } else if ("ruleType".equals(fieldName)) { - deserializedGovernanceRuleProperties.ruleType = GovernanceRuleType.fromString(reader.getString()); - } else if ("sourceResourceType".equals(fieldName)) { - deserializedGovernanceRuleProperties.sourceResourceType - = GovernanceRuleSourceResourceType.fromString(reader.getString()); - } else if ("conditionSets".equals(fieldName)) { - List conditionSets = reader.readArray(reader1 -> reader1.readUntyped()); - deserializedGovernanceRuleProperties.conditionSets = conditionSets; - } else if ("ownerSource".equals(fieldName)) { - deserializedGovernanceRuleProperties.ownerSource = GovernanceRuleOwnerSource.fromJson(reader); - } else if ("tenantId".equals(fieldName)) { - deserializedGovernanceRuleProperties.tenantId = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedGovernanceRuleProperties.description = reader.getString(); - } else if ("remediationTimeframe".equals(fieldName)) { - deserializedGovernanceRuleProperties.remediationTimeframe = reader.getString(); - } else if ("isGracePeriod".equals(fieldName)) { - deserializedGovernanceRuleProperties.isGracePeriod = reader.getNullable(JsonReader::getBoolean); - } else if ("isDisabled".equals(fieldName)) { - deserializedGovernanceRuleProperties.isDisabled = reader.getNullable(JsonReader::getBoolean); - } else if ("excludedScopes".equals(fieldName)) { - List excludedScopes = reader.readArray(reader1 -> reader1.getString()); - deserializedGovernanceRuleProperties.excludedScopes = excludedScopes; - } else if ("includeMemberScopes".equals(fieldName)) { - deserializedGovernanceRuleProperties.includeMemberScopes - = reader.getNullable(JsonReader::getBoolean); - } else if ("governanceEmailNotification".equals(fieldName)) { - deserializedGovernanceRuleProperties.governanceEmailNotification - = GovernanceRuleEmailNotification.fromJson(reader); - } else if ("metadata".equals(fieldName)) { - deserializedGovernanceRuleProperties.metadata = GovernanceRuleMetadata.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGovernanceRuleProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportInner.java deleted file mode 100644 index 48eece07db0e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportInner.java +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.EnvironmentDetails; -import com.azure.resourcemanager.security.models.HealthDataClassification; -import com.azure.resourcemanager.security.models.HealthReportResourceDetails; -import com.azure.resourcemanager.security.models.HealthReportStatus; -import com.azure.resourcemanager.security.models.Issue; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * The health report resource. - */ -@Immutable -public final class HealthReportInner extends ProxyResource { - /* - * Properties of a health report - */ - private HealthReportProperties 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 HealthReportInner class. - */ - private HealthReportInner() { - } - - /** - * Get the innerProperties property: Properties of a health report. - * - * @return the innerProperties value. - */ - private HealthReportProperties 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 resourceDetails property: The resource details of the health report. - * - * @return the resourceDetails value. - */ - public HealthReportResourceDetails resourceDetails() { - return this.innerProperties() == null ? null : this.innerProperties().resourceDetails(); - } - - /** - * Get the environmentDetails property: The environment details of the resource. - * - * @return the environmentDetails value. - */ - public EnvironmentDetails environmentDetails() { - return this.innerProperties() == null ? null : this.innerProperties().environmentDetails(); - } - - /** - * Get the healthDataClassification property: The classification of the health report. - * - * @return the healthDataClassification value. - */ - public HealthDataClassification healthDataClassification() { - return this.innerProperties() == null ? null : this.innerProperties().healthDataClassification(); - } - - /** - * Get the status property: The status of the health report. - * - * @return the status value. - */ - public HealthReportStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the affectedDefendersPlans property: The affected defenders plans by unhealthy report. - * - * @return the affectedDefendersPlans value. - */ - public List affectedDefendersPlans() { - return this.innerProperties() == null ? null : this.innerProperties().affectedDefendersPlans(); - } - - /** - * Get the affectedDefendersSubPlans property: The affected defenders sub plans by unhealthy report. - * - * @return the affectedDefendersSubPlans value. - */ - public List affectedDefendersSubPlans() { - return this.innerProperties() == null ? null : this.innerProperties().affectedDefendersSubPlans(); - } - - /** - * Get the reportAdditionalData property: Additional data for the given health report, this field can include more - * details on the resource and the health scenario. - * - * @return the reportAdditionalData value. - */ - public Map reportAdditionalData() { - return this.innerProperties() == null ? null : this.innerProperties().reportAdditionalData(); - } - - /** - * Get the issues property: A collection of the issues in the report. - * - * @return the issues value. - */ - public List issues() { - return this.innerProperties() == null ? null : this.innerProperties().issues(); - } - - /** - * 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 HealthReportInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HealthReportInner 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 HealthReportInner. - */ - public static HealthReportInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HealthReportInner deserializedHealthReportInner = new HealthReportInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedHealthReportInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedHealthReportInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedHealthReportInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedHealthReportInner.innerProperties = HealthReportProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedHealthReportInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedHealthReportInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportProperties.java deleted file mode 100644 index f6e20ceb9a9f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportProperties.java +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.EnvironmentDetails; -import com.azure.resourcemanager.security.models.HealthDataClassification; -import com.azure.resourcemanager.security.models.HealthReportResourceDetails; -import com.azure.resourcemanager.security.models.HealthReportStatus; -import com.azure.resourcemanager.security.models.Issue; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * Describes properties of the health report. - */ -@Immutable -public final class HealthReportProperties implements JsonSerializable { - /* - * The resource details of the health report - */ - private HealthReportResourceDetails resourceDetails; - - /* - * The environment details of the resource - */ - private EnvironmentDetails environmentDetails; - - /* - * The classification of the health report - */ - private HealthDataClassification healthDataClassification; - - /* - * The status of the health report - */ - private HealthReportStatus status; - - /* - * The affected defenders plans by unhealthy report - */ - private List affectedDefendersPlans; - - /* - * The affected defenders sub plans by unhealthy report - */ - private List affectedDefendersSubPlans; - - /* - * Additional data for the given health report, this field can include more details on the resource and the health - * scenario. - */ - private Map reportAdditionalData; - - /* - * A collection of the issues in the report - */ - private List issues; - - /** - * Creates an instance of HealthReportProperties class. - */ - private HealthReportProperties() { - } - - /** - * Get the resourceDetails property: The resource details of the health report. - * - * @return the resourceDetails value. - */ - public HealthReportResourceDetails resourceDetails() { - return this.resourceDetails; - } - - /** - * Get the environmentDetails property: The environment details of the resource. - * - * @return the environmentDetails value. - */ - public EnvironmentDetails environmentDetails() { - return this.environmentDetails; - } - - /** - * Get the healthDataClassification property: The classification of the health report. - * - * @return the healthDataClassification value. - */ - public HealthDataClassification healthDataClassification() { - return this.healthDataClassification; - } - - /** - * Get the status property: The status of the health report. - * - * @return the status value. - */ - public HealthReportStatus status() { - return this.status; - } - - /** - * Get the affectedDefendersPlans property: The affected defenders plans by unhealthy report. - * - * @return the affectedDefendersPlans value. - */ - public List affectedDefendersPlans() { - return this.affectedDefendersPlans; - } - - /** - * Get the affectedDefendersSubPlans property: The affected defenders sub plans by unhealthy report. - * - * @return the affectedDefendersSubPlans value. - */ - public List affectedDefendersSubPlans() { - return this.affectedDefendersSubPlans; - } - - /** - * Get the reportAdditionalData property: Additional data for the given health report, this field can include more - * details on the resource and the health scenario. - * - * @return the reportAdditionalData value. - */ - public Map reportAdditionalData() { - return this.reportAdditionalData; - } - - /** - * Get the issues property: A collection of the issues in the report. - * - * @return the issues value. - */ - public List issues() { - return this.issues; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (resourceDetails() != null) { - resourceDetails().validate(); - } - if (environmentDetails() != null) { - environmentDetails().validate(); - } - if (healthDataClassification() != null) { - healthDataClassification().validate(); - } - if (status() != null) { - status().validate(); - } - if (issues() != null) { - issues().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("resourceDetails", this.resourceDetails); - jsonWriter.writeJsonField("environmentDetails", this.environmentDetails); - jsonWriter.writeJsonField("healthDataClassification", this.healthDataClassification); - jsonWriter.writeJsonField("status", this.status); - jsonWriter.writeArrayField("affectedDefendersPlans", this.affectedDefendersPlans, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeArrayField("affectedDefendersSubPlans", this.affectedDefendersSubPlans, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeArrayField("issues", this.issues, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of HealthReportProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HealthReportProperties 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 HealthReportProperties. - */ - public static HealthReportProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HealthReportProperties deserializedHealthReportProperties = new HealthReportProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceDetails".equals(fieldName)) { - deserializedHealthReportProperties.resourceDetails = HealthReportResourceDetails.fromJson(reader); - } else if ("environmentDetails".equals(fieldName)) { - deserializedHealthReportProperties.environmentDetails = EnvironmentDetails.fromJson(reader); - } else if ("healthDataClassification".equals(fieldName)) { - deserializedHealthReportProperties.healthDataClassification - = HealthDataClassification.fromJson(reader); - } else if ("status".equals(fieldName)) { - deserializedHealthReportProperties.status = HealthReportStatus.fromJson(reader); - } else if ("affectedDefendersPlans".equals(fieldName)) { - List affectedDefendersPlans = reader.readArray(reader1 -> reader1.getString()); - deserializedHealthReportProperties.affectedDefendersPlans = affectedDefendersPlans; - } else if ("affectedDefendersSubPlans".equals(fieldName)) { - List affectedDefendersSubPlans = reader.readArray(reader1 -> reader1.getString()); - deserializedHealthReportProperties.affectedDefendersSubPlans = affectedDefendersSubPlans; - } else if ("reportAdditionalData".equals(fieldName)) { - Map reportAdditionalData = reader.readMap(reader1 -> reader1.getString()); - deserializedHealthReportProperties.reportAdditionalData = reportAdditionalData; - } else if ("issues".equals(fieldName)) { - List issues = reader.readArray(reader1 -> Issue.fromJson(reader1)); - deserializedHealthReportProperties.issues = issues; - } else { - reader.skipChildren(); - } - } - - return deserializedHealthReportProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyInner.java deleted file mode 100644 index e63bf6f16f4c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyInner.java +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.InformationType; -import com.azure.resourcemanager.security.models.SensitivityLabel; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Map; - -/** - * Information protection policy. - */ -@Fluent -public final class InformationProtectionPolicyInner extends ProxyResource { - /* - * Information protection policy data - */ - private InformationProtectionPolicyProperties 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 InformationProtectionPolicyInner class. - */ - public InformationProtectionPolicyInner() { - } - - /** - * Get the innerProperties property: Information protection policy data. - * - * @return the innerProperties value. - */ - private InformationProtectionPolicyProperties 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 lastModifiedUtc property: Describes the last UTC time the policy was modified. - * - * @return the lastModifiedUtc value. - */ - public OffsetDateTime lastModifiedUtc() { - return this.innerProperties() == null ? null : this.innerProperties().lastModifiedUtc(); - } - - /** - * Get the version property: Describes the version of the policy. - * - * @return the version value. - */ - public String version() { - return this.innerProperties() == null ? null : this.innerProperties().version(); - } - - /** - * Get the labels property: Dictionary of sensitivity labels. - * - * @return the labels value. - */ - public Map labels() { - return this.innerProperties() == null ? null : this.innerProperties().labels(); - } - - /** - * Set the labels property: Dictionary of sensitivity labels. - * - * @param labels the labels value to set. - * @return the InformationProtectionPolicyInner object itself. - */ - public InformationProtectionPolicyInner withLabels(Map labels) { - if (this.innerProperties() == null) { - this.innerProperties = new InformationProtectionPolicyProperties(); - } - this.innerProperties().withLabels(labels); - return this; - } - - /** - * Get the informationTypes property: The sensitivity information types. - * - * @return the informationTypes value. - */ - public Map informationTypes() { - return this.innerProperties() == null ? null : this.innerProperties().informationTypes(); - } - - /** - * Set the informationTypes property: The sensitivity information types. - * - * @param informationTypes the informationTypes value to set. - * @return the InformationProtectionPolicyInner object itself. - */ - public InformationProtectionPolicyInner withInformationTypes(Map informationTypes) { - if (this.innerProperties() == null) { - this.innerProperties = new InformationProtectionPolicyProperties(); - } - this.innerProperties().withInformationTypes(informationTypes); - 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 InformationProtectionPolicyInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InformationProtectionPolicyInner 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 InformationProtectionPolicyInner. - */ - public static InformationProtectionPolicyInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - InformationProtectionPolicyInner deserializedInformationProtectionPolicyInner - = new InformationProtectionPolicyInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedInformationProtectionPolicyInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedInformationProtectionPolicyInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedInformationProtectionPolicyInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedInformationProtectionPolicyInner.innerProperties - = InformationProtectionPolicyProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedInformationProtectionPolicyInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedInformationProtectionPolicyInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyProperties.java deleted file mode 100644 index 5055ac4bca60..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyProperties.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.InformationType; -import com.azure.resourcemanager.security.models.SensitivityLabel; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Map; - -/** - * describes properties of an information protection policy. - */ -@Fluent -public final class InformationProtectionPolicyProperties - implements JsonSerializable { - /* - * Describes the last UTC time the policy was modified. - */ - private OffsetDateTime lastModifiedUtc; - - /* - * Describes the version of the policy. - */ - private String version; - - /* - * Dictionary of sensitivity labels. - */ - private Map labels; - - /* - * The sensitivity information types. - */ - private Map informationTypes; - - /** - * Creates an instance of InformationProtectionPolicyProperties class. - */ - public InformationProtectionPolicyProperties() { - } - - /** - * Get the lastModifiedUtc property: Describes the last UTC time the policy was modified. - * - * @return the lastModifiedUtc value. - */ - public OffsetDateTime lastModifiedUtc() { - return this.lastModifiedUtc; - } - - /** - * Get the version property: Describes the version of the policy. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Get the labels property: Dictionary of sensitivity labels. - * - * @return the labels value. - */ - public Map labels() { - return this.labels; - } - - /** - * Set the labels property: Dictionary of sensitivity labels. - * - * @param labels the labels value to set. - * @return the InformationProtectionPolicyProperties object itself. - */ - public InformationProtectionPolicyProperties withLabels(Map labels) { - this.labels = labels; - return this; - } - - /** - * Get the informationTypes property: The sensitivity information types. - * - * @return the informationTypes value. - */ - public Map informationTypes() { - return this.informationTypes; - } - - /** - * Set the informationTypes property: The sensitivity information types. - * - * @param informationTypes the informationTypes value to set. - * @return the InformationProtectionPolicyProperties object itself. - */ - public InformationProtectionPolicyProperties withInformationTypes(Map informationTypes) { - this.informationTypes = informationTypes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (labels() != null) { - labels().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - if (informationTypes() != null) { - informationTypes().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeMapField("labels", this.labels, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeMapField("informationTypes", this.informationTypes, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InformationProtectionPolicyProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InformationProtectionPolicyProperties 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 InformationProtectionPolicyProperties. - */ - public static InformationProtectionPolicyProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - InformationProtectionPolicyProperties deserializedInformationProtectionPolicyProperties - = new InformationProtectionPolicyProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("lastModifiedUtc".equals(fieldName)) { - deserializedInformationProtectionPolicyProperties.lastModifiedUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("version".equals(fieldName)) { - deserializedInformationProtectionPolicyProperties.version = reader.getString(); - } else if ("labels".equals(fieldName)) { - Map labels - = reader.readMap(reader1 -> SensitivityLabel.fromJson(reader1)); - deserializedInformationProtectionPolicyProperties.labels = labels; - } else if ("informationTypes".equals(fieldName)) { - Map informationTypes - = reader.readMap(reader1 -> InformationType.fromJson(reader1)); - deserializedInformationProtectionPolicyProperties.informationTypes = informationTypes; - } else { - reader.skipChildren(); - } - } - - return deserializedInformationProtectionPolicyProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertInner.java deleted file mode 100644 index b15115515430..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertInner.java +++ /dev/null @@ -1,297 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlertPropertiesTopDevicesListItem; -import com.azure.resourcemanager.security.models.ReportedSeverity; -import java.io.IOException; -import java.time.LocalDate; -import java.util.List; -import java.util.Map; - -/** - * Security Solution Aggregated Alert information. - */ -@Immutable -public final class IoTSecurityAggregatedAlertInner extends ProxyResource { - /* - * IoT Security solution aggregated alert details. - */ - private IoTSecurityAggregatedAlertProperties innerProperties; - - /* - * Resource tags - */ - private Map tags; - - /* - * 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 IoTSecurityAggregatedAlertInner class. - */ - private IoTSecurityAggregatedAlertInner() { - } - - /** - * Get the innerProperties property: IoT Security solution aggregated alert details. - * - * @return the innerProperties value. - */ - private IoTSecurityAggregatedAlertProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * 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 alertType property: Name of the alert type. - * - * @return the alertType value. - */ - public String alertType() { - return this.innerProperties() == null ? null : this.innerProperties().alertType(); - } - - /** - * Get the alertDisplayName property: Display name of the alert type. - * - * @return the alertDisplayName value. - */ - public String alertDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().alertDisplayName(); - } - - /** - * Get the aggregatedDateUtc property: Date of detection. - * - * @return the aggregatedDateUtc value. - */ - public LocalDate aggregatedDateUtc() { - return this.innerProperties() == null ? null : this.innerProperties().aggregatedDateUtc(); - } - - /** - * Get the vendorName property: Name of the organization that raised the alert. - * - * @return the vendorName value. - */ - public String vendorName() { - return this.innerProperties() == null ? null : this.innerProperties().vendorName(); - } - - /** - * Get the reportedSeverity property: Assessed alert severity. - * - * @return the reportedSeverity value. - */ - public ReportedSeverity reportedSeverity() { - return this.innerProperties() == null ? null : this.innerProperties().reportedSeverity(); - } - - /** - * Get the remediationSteps property: Recommended steps for remediation. - * - * @return the remediationSteps value. - */ - public String remediationSteps() { - return this.innerProperties() == null ? null : this.innerProperties().remediationSteps(); - } - - /** - * Get the description property: Description of the suspected vulnerability and meaning. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the count property: Number of alerts occurrences within the aggregated time window. - * - * @return the count value. - */ - public Long count() { - return this.innerProperties() == null ? null : this.innerProperties().count(); - } - - /** - * Get the effectedResourceType property: Azure resource ID of the resource that received the alerts. - * - * @return the effectedResourceType value. - */ - public String effectedResourceType() { - return this.innerProperties() == null ? null : this.innerProperties().effectedResourceType(); - } - - /** - * Get the systemSource property: The type of the alerted resource (Azure, Non-Azure). - * - * @return the systemSource value. - */ - public String systemSource() { - return this.innerProperties() == null ? null : this.innerProperties().systemSource(); - } - - /** - * Get the actionTaken property: IoT Security solution alert response. - * - * @return the actionTaken value. - */ - public String actionTaken() { - return this.innerProperties() == null ? null : this.innerProperties().actionTaken(); - } - - /** - * Get the logAnalyticsQuery property: Log analytics query for getting the list of affected devices/alerts. - * - * @return the logAnalyticsQuery value. - */ - public String logAnalyticsQuery() { - return this.innerProperties() == null ? null : this.innerProperties().logAnalyticsQuery(); - } - - /** - * Get the topDevicesList property: 10 devices with the highest number of occurrences of this alert type, on this - * day. - * - * @return the topDevicesList value. - */ - public List topDevicesList() { - return this.innerProperties() == null ? null : this.innerProperties().topDevicesList(); - } - - /** - * 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); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IoTSecurityAggregatedAlertInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IoTSecurityAggregatedAlertInner 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 IoTSecurityAggregatedAlertInner. - */ - public static IoTSecurityAggregatedAlertInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IoTSecurityAggregatedAlertInner deserializedIoTSecurityAggregatedAlertInner - = new IoTSecurityAggregatedAlertInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedIoTSecurityAggregatedAlertInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedIoTSecurityAggregatedAlertInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedIoTSecurityAggregatedAlertInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedIoTSecurityAggregatedAlertInner.innerProperties - = IoTSecurityAggregatedAlertProperties.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedIoTSecurityAggregatedAlertInner.tags = tags; - } else if ("systemData".equals(fieldName)) { - deserializedIoTSecurityAggregatedAlertInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedIoTSecurityAggregatedAlertInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertProperties.java deleted file mode 100644 index 8e0caaad6f17..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertProperties.java +++ /dev/null @@ -1,287 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlertPropertiesTopDevicesListItem; -import com.azure.resourcemanager.security.models.ReportedSeverity; -import java.io.IOException; -import java.time.LocalDate; -import java.util.List; - -/** - * IoT Security solution aggregated alert details. - */ -@Immutable -public final class IoTSecurityAggregatedAlertProperties - implements JsonSerializable { - /* - * Name of the alert type. - */ - private String alertType; - - /* - * Display name of the alert type. - */ - private String alertDisplayName; - - /* - * Date of detection. - */ - private LocalDate aggregatedDateUtc; - - /* - * Name of the organization that raised the alert. - */ - private String vendorName; - - /* - * Assessed alert severity. - */ - private ReportedSeverity reportedSeverity; - - /* - * Recommended steps for remediation. - */ - private String remediationSteps; - - /* - * Description of the suspected vulnerability and meaning. - */ - private String description; - - /* - * Number of alerts occurrences within the aggregated time window. - */ - private Long count; - - /* - * Azure resource ID of the resource that received the alerts. - */ - private String effectedResourceType; - - /* - * The type of the alerted resource (Azure, Non-Azure). - */ - private String systemSource; - - /* - * IoT Security solution alert response. - */ - private String actionTaken; - - /* - * Log analytics query for getting the list of affected devices/alerts. - */ - private String logAnalyticsQuery; - - /* - * 10 devices with the highest number of occurrences of this alert type, on this day. - */ - private List topDevicesList; - - /** - * Creates an instance of IoTSecurityAggregatedAlertProperties class. - */ - private IoTSecurityAggregatedAlertProperties() { - } - - /** - * Get the alertType property: Name of the alert type. - * - * @return the alertType value. - */ - public String alertType() { - return this.alertType; - } - - /** - * Get the alertDisplayName property: Display name of the alert type. - * - * @return the alertDisplayName value. - */ - public String alertDisplayName() { - return this.alertDisplayName; - } - - /** - * Get the aggregatedDateUtc property: Date of detection. - * - * @return the aggregatedDateUtc value. - */ - public LocalDate aggregatedDateUtc() { - return this.aggregatedDateUtc; - } - - /** - * Get the vendorName property: Name of the organization that raised the alert. - * - * @return the vendorName value. - */ - public String vendorName() { - return this.vendorName; - } - - /** - * Get the reportedSeverity property: Assessed alert severity. - * - * @return the reportedSeverity value. - */ - public ReportedSeverity reportedSeverity() { - return this.reportedSeverity; - } - - /** - * Get the remediationSteps property: Recommended steps for remediation. - * - * @return the remediationSteps value. - */ - public String remediationSteps() { - return this.remediationSteps; - } - - /** - * Get the description property: Description of the suspected vulnerability and meaning. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the count property: Number of alerts occurrences within the aggregated time window. - * - * @return the count value. - */ - public Long count() { - return this.count; - } - - /** - * Get the effectedResourceType property: Azure resource ID of the resource that received the alerts. - * - * @return the effectedResourceType value. - */ - public String effectedResourceType() { - return this.effectedResourceType; - } - - /** - * Get the systemSource property: The type of the alerted resource (Azure, Non-Azure). - * - * @return the systemSource value. - */ - public String systemSource() { - return this.systemSource; - } - - /** - * Get the actionTaken property: IoT Security solution alert response. - * - * @return the actionTaken value. - */ - public String actionTaken() { - return this.actionTaken; - } - - /** - * Get the logAnalyticsQuery property: Log analytics query for getting the list of affected devices/alerts. - * - * @return the logAnalyticsQuery value. - */ - public String logAnalyticsQuery() { - return this.logAnalyticsQuery; - } - - /** - * Get the topDevicesList property: 10 devices with the highest number of occurrences of this alert type, on this - * day. - * - * @return the topDevicesList value. - */ - public List topDevicesList() { - return this.topDevicesList; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (topDevicesList() != null) { - topDevicesList().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IoTSecurityAggregatedAlertProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IoTSecurityAggregatedAlertProperties 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 IoTSecurityAggregatedAlertProperties. - */ - public static IoTSecurityAggregatedAlertProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IoTSecurityAggregatedAlertProperties deserializedIoTSecurityAggregatedAlertProperties - = new IoTSecurityAggregatedAlertProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("alertType".equals(fieldName)) { - deserializedIoTSecurityAggregatedAlertProperties.alertType = reader.getString(); - } else if ("alertDisplayName".equals(fieldName)) { - deserializedIoTSecurityAggregatedAlertProperties.alertDisplayName = reader.getString(); - } else if ("aggregatedDateUtc".equals(fieldName)) { - deserializedIoTSecurityAggregatedAlertProperties.aggregatedDateUtc - = reader.getNullable(nonNullReader -> LocalDate.parse(nonNullReader.getString())); - } else if ("vendorName".equals(fieldName)) { - deserializedIoTSecurityAggregatedAlertProperties.vendorName = reader.getString(); - } else if ("reportedSeverity".equals(fieldName)) { - deserializedIoTSecurityAggregatedAlertProperties.reportedSeverity - = ReportedSeverity.fromString(reader.getString()); - } else if ("remediationSteps".equals(fieldName)) { - deserializedIoTSecurityAggregatedAlertProperties.remediationSteps = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedIoTSecurityAggregatedAlertProperties.description = reader.getString(); - } else if ("count".equals(fieldName)) { - deserializedIoTSecurityAggregatedAlertProperties.count = reader.getNullable(JsonReader::getLong); - } else if ("effectedResourceType".equals(fieldName)) { - deserializedIoTSecurityAggregatedAlertProperties.effectedResourceType = reader.getString(); - } else if ("systemSource".equals(fieldName)) { - deserializedIoTSecurityAggregatedAlertProperties.systemSource = reader.getString(); - } else if ("actionTaken".equals(fieldName)) { - deserializedIoTSecurityAggregatedAlertProperties.actionTaken = reader.getString(); - } else if ("logAnalyticsQuery".equals(fieldName)) { - deserializedIoTSecurityAggregatedAlertProperties.logAnalyticsQuery = reader.getString(); - } else if ("topDevicesList".equals(fieldName)) { - List topDevicesList = reader - .readArray(reader1 -> IoTSecurityAggregatedAlertPropertiesTopDevicesListItem.fromJson(reader1)); - deserializedIoTSecurityAggregatedAlertProperties.topDevicesList = topDevicesList; - } else { - reader.skipChildren(); - } - } - - return deserializedIoTSecurityAggregatedAlertProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationInner.java deleted file mode 100644 index dd247d8bd531..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationInner.java +++ /dev/null @@ -1,266 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.ReportedSeverity; -import java.io.IOException; -import java.util.Map; - -/** - * IoT Security solution recommendation information. - */ -@Immutable -public final class IoTSecurityAggregatedRecommendationInner extends ProxyResource { - /* - * Security Solution data - */ - private IoTSecurityAggregatedRecommendationProperties innerProperties; - - /* - * Resource tags - */ - private Map tags; - - /* - * 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 IoTSecurityAggregatedRecommendationInner class. - */ - private IoTSecurityAggregatedRecommendationInner() { - } - - /** - * Get the innerProperties property: Security Solution data. - * - * @return the innerProperties value. - */ - private IoTSecurityAggregatedRecommendationProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * 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 recommendationName property: Name of the recommendation. - * - * @return the recommendationName value. - */ - public String recommendationName() { - return this.innerProperties() == null ? null : this.innerProperties().recommendationName(); - } - - /** - * Get the recommendationDisplayName property: Display name of the recommendation type. - * - * @return the recommendationDisplayName value. - */ - public String recommendationDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().recommendationDisplayName(); - } - - /** - * Get the description property: Description of the suspected vulnerability and meaning. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the recommendationTypeId property: Recommendation-type GUID. - * - * @return the recommendationTypeId value. - */ - public String recommendationTypeId() { - return this.innerProperties() == null ? null : this.innerProperties().recommendationTypeId(); - } - - /** - * Get the detectedBy property: Name of the organization that made the recommendation. - * - * @return the detectedBy value. - */ - public String detectedBy() { - return this.innerProperties() == null ? null : this.innerProperties().detectedBy(); - } - - /** - * Get the remediationSteps property: Recommended steps for remediation. - * - * @return the remediationSteps value. - */ - public String remediationSteps() { - return this.innerProperties() == null ? null : this.innerProperties().remediationSteps(); - } - - /** - * Get the reportedSeverity property: Assessed recommendation severity. - * - * @return the reportedSeverity value. - */ - public ReportedSeverity reportedSeverity() { - return this.innerProperties() == null ? null : this.innerProperties().reportedSeverity(); - } - - /** - * Get the healthyDevices property: Number of healthy devices within the IoT Security solution. - * - * @return the healthyDevices value. - */ - public Long healthyDevices() { - return this.innerProperties() == null ? null : this.innerProperties().healthyDevices(); - } - - /** - * Get the unhealthyDeviceCount property: Number of unhealthy devices within the IoT Security solution. - * - * @return the unhealthyDeviceCount value. - */ - public Long unhealthyDeviceCount() { - return this.innerProperties() == null ? null : this.innerProperties().unhealthyDeviceCount(); - } - - /** - * Get the logAnalyticsQuery property: Log analytics query for getting the list of affected devices/alerts. - * - * @return the logAnalyticsQuery value. - */ - public String logAnalyticsQuery() { - return this.innerProperties() == null ? null : this.innerProperties().logAnalyticsQuery(); - } - - /** - * 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); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IoTSecurityAggregatedRecommendationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IoTSecurityAggregatedRecommendationInner 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 IoTSecurityAggregatedRecommendationInner. - */ - public static IoTSecurityAggregatedRecommendationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IoTSecurityAggregatedRecommendationInner deserializedIoTSecurityAggregatedRecommendationInner - = new IoTSecurityAggregatedRecommendationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedIoTSecurityAggregatedRecommendationInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedIoTSecurityAggregatedRecommendationInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedIoTSecurityAggregatedRecommendationInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedIoTSecurityAggregatedRecommendationInner.innerProperties - = IoTSecurityAggregatedRecommendationProperties.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedIoTSecurityAggregatedRecommendationInner.tags = tags; - } else if ("systemData".equals(fieldName)) { - deserializedIoTSecurityAggregatedRecommendationInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedIoTSecurityAggregatedRecommendationInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationProperties.java deleted file mode 100644 index 36fef3c51827..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationProperties.java +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.ReportedSeverity; -import java.io.IOException; - -/** - * IoT Security solution aggregated recommendation information. - */ -@Immutable -public final class IoTSecurityAggregatedRecommendationProperties - implements JsonSerializable { - /* - * Name of the recommendation. - */ - private String recommendationName; - - /* - * Display name of the recommendation type. - */ - private String recommendationDisplayName; - - /* - * Description of the suspected vulnerability and meaning. - */ - private String description; - - /* - * Recommendation-type GUID. - */ - private String recommendationTypeId; - - /* - * Name of the organization that made the recommendation. - */ - private String detectedBy; - - /* - * Recommended steps for remediation - */ - private String remediationSteps; - - /* - * Assessed recommendation severity. - */ - private ReportedSeverity reportedSeverity; - - /* - * Number of healthy devices within the IoT Security solution. - */ - private Long healthyDevices; - - /* - * Number of unhealthy devices within the IoT Security solution. - */ - private Long unhealthyDeviceCount; - - /* - * Log analytics query for getting the list of affected devices/alerts. - */ - private String logAnalyticsQuery; - - /** - * Creates an instance of IoTSecurityAggregatedRecommendationProperties class. - */ - private IoTSecurityAggregatedRecommendationProperties() { - } - - /** - * Get the recommendationName property: Name of the recommendation. - * - * @return the recommendationName value. - */ - public String recommendationName() { - return this.recommendationName; - } - - /** - * Get the recommendationDisplayName property: Display name of the recommendation type. - * - * @return the recommendationDisplayName value. - */ - public String recommendationDisplayName() { - return this.recommendationDisplayName; - } - - /** - * Get the description property: Description of the suspected vulnerability and meaning. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the recommendationTypeId property: Recommendation-type GUID. - * - * @return the recommendationTypeId value. - */ - public String recommendationTypeId() { - return this.recommendationTypeId; - } - - /** - * Get the detectedBy property: Name of the organization that made the recommendation. - * - * @return the detectedBy value. - */ - public String detectedBy() { - return this.detectedBy; - } - - /** - * Get the remediationSteps property: Recommended steps for remediation. - * - * @return the remediationSteps value. - */ - public String remediationSteps() { - return this.remediationSteps; - } - - /** - * Get the reportedSeverity property: Assessed recommendation severity. - * - * @return the reportedSeverity value. - */ - public ReportedSeverity reportedSeverity() { - return this.reportedSeverity; - } - - /** - * Get the healthyDevices property: Number of healthy devices within the IoT Security solution. - * - * @return the healthyDevices value. - */ - public Long healthyDevices() { - return this.healthyDevices; - } - - /** - * Get the unhealthyDeviceCount property: Number of unhealthy devices within the IoT Security solution. - * - * @return the unhealthyDeviceCount value. - */ - public Long unhealthyDeviceCount() { - return this.unhealthyDeviceCount; - } - - /** - * Get the logAnalyticsQuery property: Log analytics query for getting the list of affected devices/alerts. - * - * @return the logAnalyticsQuery value. - */ - public String logAnalyticsQuery() { - return this.logAnalyticsQuery; - } - - /** - * 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("recommendationName", this.recommendationName); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IoTSecurityAggregatedRecommendationProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IoTSecurityAggregatedRecommendationProperties 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 IoTSecurityAggregatedRecommendationProperties. - */ - public static IoTSecurityAggregatedRecommendationProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IoTSecurityAggregatedRecommendationProperties deserializedIoTSecurityAggregatedRecommendationProperties - = new IoTSecurityAggregatedRecommendationProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("recommendationName".equals(fieldName)) { - deserializedIoTSecurityAggregatedRecommendationProperties.recommendationName = reader.getString(); - } else if ("recommendationDisplayName".equals(fieldName)) { - deserializedIoTSecurityAggregatedRecommendationProperties.recommendationDisplayName - = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedIoTSecurityAggregatedRecommendationProperties.description = reader.getString(); - } else if ("recommendationTypeId".equals(fieldName)) { - deserializedIoTSecurityAggregatedRecommendationProperties.recommendationTypeId = reader.getString(); - } else if ("detectedBy".equals(fieldName)) { - deserializedIoTSecurityAggregatedRecommendationProperties.detectedBy = reader.getString(); - } else if ("remediationSteps".equals(fieldName)) { - deserializedIoTSecurityAggregatedRecommendationProperties.remediationSteps = reader.getString(); - } else if ("reportedSeverity".equals(fieldName)) { - deserializedIoTSecurityAggregatedRecommendationProperties.reportedSeverity - = ReportedSeverity.fromString(reader.getString()); - } else if ("healthyDevices".equals(fieldName)) { - deserializedIoTSecurityAggregatedRecommendationProperties.healthyDevices - = reader.getNullable(JsonReader::getLong); - } else if ("unhealthyDeviceCount".equals(fieldName)) { - deserializedIoTSecurityAggregatedRecommendationProperties.unhealthyDeviceCount - = reader.getNullable(JsonReader::getLong); - } else if ("logAnalyticsQuery".equals(fieldName)) { - deserializedIoTSecurityAggregatedRecommendationProperties.logAnalyticsQuery = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedIoTSecurityAggregatedRecommendationProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelInner.java deleted file mode 100644 index e1056f6b52c3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelInner.java +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.IoTSecurityAlertedDevice; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceAlert; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceRecommendation; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem; -import com.azure.resourcemanager.security.models.IoTSeverityMetrics; -import java.io.IOException; -import java.util.List; - -/** - * Security analytics of your IoT Security solution. - */ -@Immutable -public final class IoTSecuritySolutionAnalyticsModelInner extends ProxyResource { - /* - * Security Solution Aggregated Alert data - */ - private IoTSecuritySolutionAnalyticsModelProperties 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 IoTSecuritySolutionAnalyticsModelInner class. - */ - private IoTSecuritySolutionAnalyticsModelInner() { - } - - /** - * Get the innerProperties property: Security Solution Aggregated Alert data. - * - * @return the innerProperties value. - */ - private IoTSecuritySolutionAnalyticsModelProperties 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 metrics property: Security analytics of your IoT Security solution. - * - * @return the metrics value. - */ - public IoTSeverityMetrics metrics() { - return this.innerProperties() == null ? null : this.innerProperties().metrics(); - } - - /** - * Get the unhealthyDeviceCount property: Number of unhealthy devices within your IoT Security solution. - * - * @return the unhealthyDeviceCount value. - */ - public Long unhealthyDeviceCount() { - return this.innerProperties() == null ? null : this.innerProperties().unhealthyDeviceCount(); - } - - /** - * Get the devicesMetrics property: List of device metrics by the aggregation date. - * - * @return the devicesMetrics value. - */ - public List devicesMetrics() { - return this.innerProperties() == null ? null : this.innerProperties().devicesMetrics(); - } - - /** - * Get the topAlertedDevices property: List of the 3 devices with the most alerts. - * - * @return the topAlertedDevices value. - */ - public List topAlertedDevices() { - return this.innerProperties() == null ? null : this.innerProperties().topAlertedDevices(); - } - - /** - * Get the mostPrevalentDeviceAlerts property: List of the 3 most prevalent device alerts. - * - * @return the mostPrevalentDeviceAlerts value. - */ - public List mostPrevalentDeviceAlerts() { - return this.innerProperties() == null ? null : this.innerProperties().mostPrevalentDeviceAlerts(); - } - - /** - * Get the mostPrevalentDeviceRecommendations property: List of the 3 most prevalent device recommendations. - * - * @return the mostPrevalentDeviceRecommendations value. - */ - public List mostPrevalentDeviceRecommendations() { - return this.innerProperties() == null ? null : this.innerProperties().mostPrevalentDeviceRecommendations(); - } - - /** - * 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 IoTSecuritySolutionAnalyticsModelInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IoTSecuritySolutionAnalyticsModelInner 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 IoTSecuritySolutionAnalyticsModelInner. - */ - public static IoTSecuritySolutionAnalyticsModelInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IoTSecuritySolutionAnalyticsModelInner deserializedIoTSecuritySolutionAnalyticsModelInner - = new IoTSecuritySolutionAnalyticsModelInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedIoTSecuritySolutionAnalyticsModelInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedIoTSecuritySolutionAnalyticsModelInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedIoTSecuritySolutionAnalyticsModelInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedIoTSecuritySolutionAnalyticsModelInner.innerProperties - = IoTSecuritySolutionAnalyticsModelProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedIoTSecuritySolutionAnalyticsModelInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedIoTSecuritySolutionAnalyticsModelInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelListInner.java deleted file mode 100644 index 402ef3db3b29..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelListInner.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -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.List; - -/** - * List of Security analytics of your IoT Security solution. - */ -@Immutable -public final class IoTSecuritySolutionAnalyticsModelListInner - implements JsonSerializable { - /* - * The IoTSecuritySolutionAnalyticsModel items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of IoTSecuritySolutionAnalyticsModelListInner class. - */ - private IoTSecuritySolutionAnalyticsModelListInner() { - } - - /** - * Get the value property: The IoTSecuritySolutionAnalyticsModel items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property value in model IoTSecuritySolutionAnalyticsModelListInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(IoTSecuritySolutionAnalyticsModelListInner.class); - - /** - * {@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 IoTSecuritySolutionAnalyticsModelListInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IoTSecuritySolutionAnalyticsModelListInner 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 IoTSecuritySolutionAnalyticsModelListInner. - */ - public static IoTSecuritySolutionAnalyticsModelListInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IoTSecuritySolutionAnalyticsModelListInner deserializedIoTSecuritySolutionAnalyticsModelListInner - = new IoTSecuritySolutionAnalyticsModelListInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> IoTSecuritySolutionAnalyticsModelInner.fromJson(reader1)); - deserializedIoTSecuritySolutionAnalyticsModelListInner.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedIoTSecuritySolutionAnalyticsModelListInner.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedIoTSecuritySolutionAnalyticsModelListInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelProperties.java deleted file mode 100644 index d4a66c876744..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelProperties.java +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.IoTSecurityAlertedDevice; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceAlert; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceRecommendation; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem; -import com.azure.resourcemanager.security.models.IoTSeverityMetrics; -import java.io.IOException; -import java.util.List; - -/** - * Security analytics properties of your IoT Security solution. - */ -@Immutable -public final class IoTSecuritySolutionAnalyticsModelProperties - implements JsonSerializable { - /* - * Security analytics of your IoT Security solution. - */ - private IoTSeverityMetrics metrics; - - /* - * Number of unhealthy devices within your IoT Security solution. - */ - private Long unhealthyDeviceCount; - - /* - * List of device metrics by the aggregation date. - */ - private List devicesMetrics; - - /* - * List of the 3 devices with the most alerts. - */ - private List topAlertedDevices; - - /* - * List of the 3 most prevalent device alerts. - */ - private List mostPrevalentDeviceAlerts; - - /* - * List of the 3 most prevalent device recommendations. - */ - private List mostPrevalentDeviceRecommendations; - - /** - * Creates an instance of IoTSecuritySolutionAnalyticsModelProperties class. - */ - private IoTSecuritySolutionAnalyticsModelProperties() { - } - - /** - * Get the metrics property: Security analytics of your IoT Security solution. - * - * @return the metrics value. - */ - public IoTSeverityMetrics metrics() { - return this.metrics; - } - - /** - * Get the unhealthyDeviceCount property: Number of unhealthy devices within your IoT Security solution. - * - * @return the unhealthyDeviceCount value. - */ - public Long unhealthyDeviceCount() { - return this.unhealthyDeviceCount; - } - - /** - * Get the devicesMetrics property: List of device metrics by the aggregation date. - * - * @return the devicesMetrics value. - */ - public List devicesMetrics() { - return this.devicesMetrics; - } - - /** - * Get the topAlertedDevices property: List of the 3 devices with the most alerts. - * - * @return the topAlertedDevices value. - */ - public List topAlertedDevices() { - return this.topAlertedDevices; - } - - /** - * Get the mostPrevalentDeviceAlerts property: List of the 3 most prevalent device alerts. - * - * @return the mostPrevalentDeviceAlerts value. - */ - public List mostPrevalentDeviceAlerts() { - return this.mostPrevalentDeviceAlerts; - } - - /** - * Get the mostPrevalentDeviceRecommendations property: List of the 3 most prevalent device recommendations. - * - * @return the mostPrevalentDeviceRecommendations value. - */ - public List mostPrevalentDeviceRecommendations() { - return this.mostPrevalentDeviceRecommendations; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (metrics() != null) { - metrics().validate(); - } - if (devicesMetrics() != null) { - devicesMetrics().forEach(e -> e.validate()); - } - if (topAlertedDevices() != null) { - topAlertedDevices().forEach(e -> e.validate()); - } - if (mostPrevalentDeviceAlerts() != null) { - mostPrevalentDeviceAlerts().forEach(e -> e.validate()); - } - if (mostPrevalentDeviceRecommendations() != null) { - mostPrevalentDeviceRecommendations().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("topAlertedDevices", this.topAlertedDevices, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("mostPrevalentDeviceAlerts", this.mostPrevalentDeviceAlerts, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("mostPrevalentDeviceRecommendations", this.mostPrevalentDeviceRecommendations, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IoTSecuritySolutionAnalyticsModelProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IoTSecuritySolutionAnalyticsModelProperties 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 IoTSecuritySolutionAnalyticsModelProperties. - */ - public static IoTSecuritySolutionAnalyticsModelProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IoTSecuritySolutionAnalyticsModelProperties deserializedIoTSecuritySolutionAnalyticsModelProperties - = new IoTSecuritySolutionAnalyticsModelProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("metrics".equals(fieldName)) { - deserializedIoTSecuritySolutionAnalyticsModelProperties.metrics - = IoTSeverityMetrics.fromJson(reader); - } else if ("unhealthyDeviceCount".equals(fieldName)) { - deserializedIoTSecuritySolutionAnalyticsModelProperties.unhealthyDeviceCount - = reader.getNullable(JsonReader::getLong); - } else if ("devicesMetrics".equals(fieldName)) { - List devicesMetrics - = reader.readArray( - reader1 -> IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem.fromJson(reader1)); - deserializedIoTSecuritySolutionAnalyticsModelProperties.devicesMetrics = devicesMetrics; - } else if ("topAlertedDevices".equals(fieldName)) { - List topAlertedDevices - = reader.readArray(reader1 -> IoTSecurityAlertedDevice.fromJson(reader1)); - deserializedIoTSecuritySolutionAnalyticsModelProperties.topAlertedDevices = topAlertedDevices; - } else if ("mostPrevalentDeviceAlerts".equals(fieldName)) { - List mostPrevalentDeviceAlerts - = reader.readArray(reader1 -> IoTSecurityDeviceAlert.fromJson(reader1)); - deserializedIoTSecuritySolutionAnalyticsModelProperties.mostPrevalentDeviceAlerts - = mostPrevalentDeviceAlerts; - } else if ("mostPrevalentDeviceRecommendations".equals(fieldName)) { - List mostPrevalentDeviceRecommendations - = reader.readArray(reader1 -> IoTSecurityDeviceRecommendation.fromJson(reader1)); - deserializedIoTSecuritySolutionAnalyticsModelProperties.mostPrevalentDeviceRecommendations - = mostPrevalentDeviceRecommendations; - } else { - reader.skipChildren(); - } - } - - return deserializedIoTSecuritySolutionAnalyticsModelProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionModelInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionModelInner.java deleted file mode 100644 index 6851a231ee98..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionModelInner.java +++ /dev/null @@ -1,464 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.AdditionalWorkspacesProperties; -import com.azure.resourcemanager.security.models.DataSource; -import com.azure.resourcemanager.security.models.ExportData; -import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; -import com.azure.resourcemanager.security.models.SecuritySolutionStatus; -import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * IoT Security solution configuration and resource information. - */ -@Fluent -public final class IoTSecuritySolutionModelInner extends ProxyResource { - /* - * Security Solution data - */ - private IoTSecuritySolutionProperties innerProperties; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The geo-location where the resource lives - */ - private String location; - - /* - * 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 IoTSecuritySolutionModelInner class. - */ - public IoTSecuritySolutionModelInner() { - } - - /** - * Get the innerProperties property: Security Solution data. - * - * @return the innerProperties value. - */ - private IoTSecuritySolutionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The geo-location where the resource lives. - * - * @param location the location value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withLocation(String location) { - this.location = location; - 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; - } - - /** - * Get the workspace property: Workspace resource ID. - * - * @return the workspace value. - */ - public String workspace() { - return this.innerProperties() == null ? null : this.innerProperties().workspace(); - } - - /** - * Set the workspace property: Workspace resource ID. - * - * @param workspace the workspace value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withWorkspace(String workspace) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionProperties(); - } - this.innerProperties().withWorkspace(workspace); - return this; - } - - /** - * Get the displayName property: Resource display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: Resource display name. - * - * @param displayName the displayName value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the status property: Status of the IoT Security solution. - * - * @return the status value. - */ - public SecuritySolutionStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: Status of the IoT Security solution. - * - * @param status the status value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withStatus(SecuritySolutionStatus status) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the export property: List of additional options for exporting to workspace data. - * - * @return the export value. - */ - public List export() { - return this.innerProperties() == null ? null : this.innerProperties().export(); - } - - /** - * Set the export property: List of additional options for exporting to workspace data. - * - * @param export the export value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withExport(List export) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionProperties(); - } - this.innerProperties().withExport(export); - return this; - } - - /** - * Get the disabledDataSources property: Disabled data sources. Disabling these data sources compromises the system. - * - * @return the disabledDataSources value. - */ - public List disabledDataSources() { - return this.innerProperties() == null ? null : this.innerProperties().disabledDataSources(); - } - - /** - * Set the disabledDataSources property: Disabled data sources. Disabling these data sources compromises the system. - * - * @param disabledDataSources the disabledDataSources value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withDisabledDataSources(List disabledDataSources) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionProperties(); - } - this.innerProperties().withDisabledDataSources(disabledDataSources); - return this; - } - - /** - * Get the iotHubs property: IoT Hub resource IDs. - * - * @return the iotHubs value. - */ - public List iotHubs() { - return this.innerProperties() == null ? null : this.innerProperties().iotHubs(); - } - - /** - * Set the iotHubs property: IoT Hub resource IDs. - * - * @param iotHubs the iotHubs value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withIotHubs(List iotHubs) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionProperties(); - } - this.innerProperties().withIotHubs(iotHubs); - return this; - } - - /** - * Get the userDefinedResources property: Properties of the IoT Security solution's user defined resources. - * - * @return the userDefinedResources value. - */ - public UserDefinedResourcesProperties userDefinedResources() { - return this.innerProperties() == null ? null : this.innerProperties().userDefinedResources(); - } - - /** - * Set the userDefinedResources property: Properties of the IoT Security solution's user defined resources. - * - * @param userDefinedResources the userDefinedResources value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withUserDefinedResources(UserDefinedResourcesProperties userDefinedResources) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionProperties(); - } - this.innerProperties().withUserDefinedResources(userDefinedResources); - return this; - } - - /** - * Get the autoDiscoveredResources property: List of resources that were automatically discovered as relevant to the - * security solution. - * - * @return the autoDiscoveredResources value. - */ - public List autoDiscoveredResources() { - return this.innerProperties() == null ? null : this.innerProperties().autoDiscoveredResources(); - } - - /** - * Get the recommendationsConfiguration property: List of the configuration status for each recommendation type. - * - * @return the recommendationsConfiguration value. - */ - public List recommendationsConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().recommendationsConfiguration(); - } - - /** - * Set the recommendationsConfiguration property: List of the configuration status for each recommendation type. - * - * @param recommendationsConfiguration the recommendationsConfiguration value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner - withRecommendationsConfiguration(List recommendationsConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionProperties(); - } - this.innerProperties().withRecommendationsConfiguration(recommendationsConfiguration); - return this; - } - - /** - * Get the unmaskedIpLoggingStatus property: Unmasked IP address logging status. - * - * @return the unmaskedIpLoggingStatus value. - */ - public UnmaskedIpLoggingStatus unmaskedIpLoggingStatus() { - return this.innerProperties() == null ? null : this.innerProperties().unmaskedIpLoggingStatus(); - } - - /** - * Set the unmaskedIpLoggingStatus property: Unmasked IP address logging status. - * - * @param unmaskedIpLoggingStatus the unmaskedIpLoggingStatus value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus unmaskedIpLoggingStatus) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionProperties(); - } - this.innerProperties().withUnmaskedIpLoggingStatus(unmaskedIpLoggingStatus); - return this; - } - - /** - * Get the additionalWorkspaces property: List of additional workspaces. - * - * @return the additionalWorkspaces value. - */ - public List additionalWorkspaces() { - return this.innerProperties() == null ? null : this.innerProperties().additionalWorkspaces(); - } - - /** - * Set the additionalWorkspaces property: List of additional workspaces. - * - * @param additionalWorkspaces the additionalWorkspaces value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner - withAdditionalWorkspaces(List additionalWorkspaces) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionProperties(); - } - this.innerProperties().withAdditionalWorkspaces(additionalWorkspaces); - 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); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IoTSecuritySolutionModelInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IoTSecuritySolutionModelInner 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 IoTSecuritySolutionModelInner. - */ - public static IoTSecuritySolutionModelInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IoTSecuritySolutionModelInner deserializedIoTSecuritySolutionModelInner - = new IoTSecuritySolutionModelInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedIoTSecuritySolutionModelInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedIoTSecuritySolutionModelInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedIoTSecuritySolutionModelInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedIoTSecuritySolutionModelInner.innerProperties - = IoTSecuritySolutionProperties.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedIoTSecuritySolutionModelInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedIoTSecuritySolutionModelInner.location = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedIoTSecuritySolutionModelInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedIoTSecuritySolutionModelInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionProperties.java deleted file mode 100644 index b68acd7f6367..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionProperties.java +++ /dev/null @@ -1,414 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.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.security.models.AdditionalWorkspacesProperties; -import com.azure.resourcemanager.security.models.DataSource; -import com.azure.resourcemanager.security.models.ExportData; -import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; -import com.azure.resourcemanager.security.models.SecuritySolutionStatus; -import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import java.io.IOException; -import java.util.List; - -/** - * Security Solution setting data. - */ -@Fluent -public final class IoTSecuritySolutionProperties implements JsonSerializable { - /* - * Workspace resource ID - */ - private String workspace; - - /* - * Resource display name. - */ - private String displayName; - - /* - * Status of the IoT Security solution. - */ - private SecuritySolutionStatus status; - - /* - * List of additional options for exporting to workspace data. - */ - private List export; - - /* - * Disabled data sources. Disabling these data sources compromises the system. - */ - private List disabledDataSources; - - /* - * IoT Hub resource IDs - */ - private List iotHubs; - - /* - * Properties of the IoT Security solution's user defined resources. - */ - private UserDefinedResourcesProperties userDefinedResources; - - /* - * List of resources that were automatically discovered as relevant to the security solution. - */ - private List autoDiscoveredResources; - - /* - * List of the configuration status for each recommendation type. - */ - private List recommendationsConfiguration; - - /* - * Unmasked IP address logging status - */ - private UnmaskedIpLoggingStatus unmaskedIpLoggingStatus; - - /* - * List of additional workspaces - */ - private List additionalWorkspaces; - - /** - * Creates an instance of IoTSecuritySolutionProperties class. - */ - public IoTSecuritySolutionProperties() { - } - - /** - * Get the workspace property: Workspace resource ID. - * - * @return the workspace value. - */ - public String workspace() { - return this.workspace; - } - - /** - * Set the workspace property: Workspace resource ID. - * - * @param workspace the workspace value to set. - * @return the IoTSecuritySolutionProperties object itself. - */ - public IoTSecuritySolutionProperties withWorkspace(String workspace) { - this.workspace = workspace; - return this; - } - - /** - * Get the displayName property: Resource display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Resource display name. - * - * @param displayName the displayName value to set. - * @return the IoTSecuritySolutionProperties object itself. - */ - public IoTSecuritySolutionProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the status property: Status of the IoT Security solution. - * - * @return the status value. - */ - public SecuritySolutionStatus status() { - return this.status; - } - - /** - * Set the status property: Status of the IoT Security solution. - * - * @param status the status value to set. - * @return the IoTSecuritySolutionProperties object itself. - */ - public IoTSecuritySolutionProperties withStatus(SecuritySolutionStatus status) { - this.status = status; - return this; - } - - /** - * Get the export property: List of additional options for exporting to workspace data. - * - * @return the export value. - */ - public List export() { - return this.export; - } - - /** - * Set the export property: List of additional options for exporting to workspace data. - * - * @param export the export value to set. - * @return the IoTSecuritySolutionProperties object itself. - */ - public IoTSecuritySolutionProperties withExport(List export) { - this.export = export; - return this; - } - - /** - * Get the disabledDataSources property: Disabled data sources. Disabling these data sources compromises the system. - * - * @return the disabledDataSources value. - */ - public List disabledDataSources() { - return this.disabledDataSources; - } - - /** - * Set the disabledDataSources property: Disabled data sources. Disabling these data sources compromises the system. - * - * @param disabledDataSources the disabledDataSources value to set. - * @return the IoTSecuritySolutionProperties object itself. - */ - public IoTSecuritySolutionProperties withDisabledDataSources(List disabledDataSources) { - this.disabledDataSources = disabledDataSources; - return this; - } - - /** - * Get the iotHubs property: IoT Hub resource IDs. - * - * @return the iotHubs value. - */ - public List iotHubs() { - return this.iotHubs; - } - - /** - * Set the iotHubs property: IoT Hub resource IDs. - * - * @param iotHubs the iotHubs value to set. - * @return the IoTSecuritySolutionProperties object itself. - */ - public IoTSecuritySolutionProperties withIotHubs(List iotHubs) { - this.iotHubs = iotHubs; - return this; - } - - /** - * Get the userDefinedResources property: Properties of the IoT Security solution's user defined resources. - * - * @return the userDefinedResources value. - */ - public UserDefinedResourcesProperties userDefinedResources() { - return this.userDefinedResources; - } - - /** - * Set the userDefinedResources property: Properties of the IoT Security solution's user defined resources. - * - * @param userDefinedResources the userDefinedResources value to set. - * @return the IoTSecuritySolutionProperties object itself. - */ - public IoTSecuritySolutionProperties withUserDefinedResources(UserDefinedResourcesProperties userDefinedResources) { - this.userDefinedResources = userDefinedResources; - return this; - } - - /** - * Get the autoDiscoveredResources property: List of resources that were automatically discovered as relevant to the - * security solution. - * - * @return the autoDiscoveredResources value. - */ - public List autoDiscoveredResources() { - return this.autoDiscoveredResources; - } - - /** - * Get the recommendationsConfiguration property: List of the configuration status for each recommendation type. - * - * @return the recommendationsConfiguration value. - */ - public List recommendationsConfiguration() { - return this.recommendationsConfiguration; - } - - /** - * Set the recommendationsConfiguration property: List of the configuration status for each recommendation type. - * - * @param recommendationsConfiguration the recommendationsConfiguration value to set. - * @return the IoTSecuritySolutionProperties object itself. - */ - public IoTSecuritySolutionProperties - withRecommendationsConfiguration(List recommendationsConfiguration) { - this.recommendationsConfiguration = recommendationsConfiguration; - return this; - } - - /** - * Get the unmaskedIpLoggingStatus property: Unmasked IP address logging status. - * - * @return the unmaskedIpLoggingStatus value. - */ - public UnmaskedIpLoggingStatus unmaskedIpLoggingStatus() { - return this.unmaskedIpLoggingStatus; - } - - /** - * Set the unmaskedIpLoggingStatus property: Unmasked IP address logging status. - * - * @param unmaskedIpLoggingStatus the unmaskedIpLoggingStatus value to set. - * @return the IoTSecuritySolutionProperties object itself. - */ - public IoTSecuritySolutionProperties withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus unmaskedIpLoggingStatus) { - this.unmaskedIpLoggingStatus = unmaskedIpLoggingStatus; - return this; - } - - /** - * Get the additionalWorkspaces property: List of additional workspaces. - * - * @return the additionalWorkspaces value. - */ - public List additionalWorkspaces() { - return this.additionalWorkspaces; - } - - /** - * Set the additionalWorkspaces property: List of additional workspaces. - * - * @param additionalWorkspaces the additionalWorkspaces value to set. - * @return the IoTSecuritySolutionProperties object itself. - */ - public IoTSecuritySolutionProperties - withAdditionalWorkspaces(List additionalWorkspaces) { - this.additionalWorkspaces = additionalWorkspaces; - 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 IoTSecuritySolutionProperties")); - } - if (iotHubs() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property iotHubs in model IoTSecuritySolutionProperties")); - } - if (userDefinedResources() != null) { - userDefinedResources().validate(); - } - if (recommendationsConfiguration() != null) { - recommendationsConfiguration().forEach(e -> e.validate()); - } - if (additionalWorkspaces() != null) { - additionalWorkspaces().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(IoTSecuritySolutionProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeArrayField("iotHubs", this.iotHubs, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("workspace", this.workspace); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeArrayField("export", this.export, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("disabledDataSources", this.disabledDataSources, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeJsonField("userDefinedResources", this.userDefinedResources); - jsonWriter.writeArrayField("recommendationsConfiguration", this.recommendationsConfiguration, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("unmaskedIpLoggingStatus", - this.unmaskedIpLoggingStatus == null ? null : this.unmaskedIpLoggingStatus.toString()); - jsonWriter.writeArrayField("additionalWorkspaces", this.additionalWorkspaces, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of IoTSecuritySolutionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IoTSecuritySolutionProperties 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 IoTSecuritySolutionProperties. - */ - public static IoTSecuritySolutionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IoTSecuritySolutionProperties deserializedIoTSecuritySolutionProperties - = new IoTSecuritySolutionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("displayName".equals(fieldName)) { - deserializedIoTSecuritySolutionProperties.displayName = reader.getString(); - } else if ("iotHubs".equals(fieldName)) { - List iotHubs = reader.readArray(reader1 -> reader1.getString()); - deserializedIoTSecuritySolutionProperties.iotHubs = iotHubs; - } else if ("workspace".equals(fieldName)) { - deserializedIoTSecuritySolutionProperties.workspace = reader.getString(); - } else if ("status".equals(fieldName)) { - deserializedIoTSecuritySolutionProperties.status - = SecuritySolutionStatus.fromString(reader.getString()); - } else if ("export".equals(fieldName)) { - List export = reader.readArray(reader1 -> ExportData.fromString(reader1.getString())); - deserializedIoTSecuritySolutionProperties.export = export; - } else if ("disabledDataSources".equals(fieldName)) { - List disabledDataSources - = reader.readArray(reader1 -> DataSource.fromString(reader1.getString())); - deserializedIoTSecuritySolutionProperties.disabledDataSources = disabledDataSources; - } else if ("userDefinedResources".equals(fieldName)) { - deserializedIoTSecuritySolutionProperties.userDefinedResources - = UserDefinedResourcesProperties.fromJson(reader); - } else if ("autoDiscoveredResources".equals(fieldName)) { - List autoDiscoveredResources = reader.readArray(reader1 -> reader1.getString()); - deserializedIoTSecuritySolutionProperties.autoDiscoveredResources = autoDiscoveredResources; - } else if ("recommendationsConfiguration".equals(fieldName)) { - List recommendationsConfiguration - = reader.readArray(reader1 -> RecommendationConfigurationProperties.fromJson(reader1)); - deserializedIoTSecuritySolutionProperties.recommendationsConfiguration - = recommendationsConfiguration; - } else if ("unmaskedIpLoggingStatus".equals(fieldName)) { - deserializedIoTSecuritySolutionProperties.unmaskedIpLoggingStatus - = UnmaskedIpLoggingStatus.fromString(reader.getString()); - } else if ("additionalWorkspaces".equals(fieldName)) { - List additionalWorkspaces - = reader.readArray(reader1 -> AdditionalWorkspacesProperties.fromJson(reader1)); - deserializedIoTSecuritySolutionProperties.additionalWorkspaces = additionalWorkspaces; - } else { - reader.skipChildren(); - } - } - - return deserializedIoTSecuritySolutionProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessPolicyInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessPolicyInner.java deleted file mode 100644 index 6fe5e9ce65d6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessPolicyInner.java +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -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.security.models.JitNetworkAccessPolicyVirtualMachine; -import java.io.IOException; -import java.util.List; - -/** - * Concrete proxy resource types can be created by aliasing this type using a specific property type. - */ -@Fluent -public final class JitNetworkAccessPolicyInner extends ProxyResource { - /* - * The properties property. - */ - private JitNetworkAccessPolicyProperties innerProperties = new JitNetworkAccessPolicyProperties(); - - /* - * Kind of the resource - */ - private String kind; - - /* - * Location where the resource is stored - */ - private String location; - - /* - * 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 JitNetworkAccessPolicyInner class. - */ - public JitNetworkAccessPolicyInner() { - } - - /** - * Get the innerProperties property: The properties property. - * - * @return the innerProperties value. - */ - private JitNetworkAccessPolicyProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the kind property: Kind of the resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: Kind of the resource. - * - * @param kind the kind value to set. - * @return the JitNetworkAccessPolicyInner object itself. - */ - public JitNetworkAccessPolicyInner withKind(String kind) { - this.kind = kind; - return this; - } - - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * 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 virtualMachines property: Configurations for Microsoft.Compute/virtualMachines resource type. - * - * @return the virtualMachines value. - */ - public List virtualMachines() { - return this.innerProperties() == null ? null : this.innerProperties().virtualMachines(); - } - - /** - * Set the virtualMachines property: Configurations for Microsoft.Compute/virtualMachines resource type. - * - * @param virtualMachines the virtualMachines value to set. - * @return the JitNetworkAccessPolicyInner object itself. - */ - public JitNetworkAccessPolicyInner withVirtualMachines(List virtualMachines) { - if (this.innerProperties() == null) { - this.innerProperties = new JitNetworkAccessPolicyProperties(); - } - this.innerProperties().withVirtualMachines(virtualMachines); - return this; - } - - /** - * Get the requests property: The requests property. - * - * @return the requests value. - */ - public List requests() { - return this.innerProperties() == null ? null : this.innerProperties().requests(); - } - - /** - * Set the requests property: The requests property. - * - * @param requests the requests value to set. - * @return the JitNetworkAccessPolicyInner object itself. - */ - public JitNetworkAccessPolicyInner withRequests(List requests) { - if (this.innerProperties() == null) { - this.innerProperties = new JitNetworkAccessPolicyProperties(); - } - this.innerProperties().withRequests(requests); - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the Just-in-Time policy. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model JitNetworkAccessPolicyInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(JitNetworkAccessPolicyInner.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.innerProperties); - jsonWriter.writeStringField("kind", this.kind); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of JitNetworkAccessPolicyInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of JitNetworkAccessPolicyInner 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 JitNetworkAccessPolicyInner. - */ - public static JitNetworkAccessPolicyInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - JitNetworkAccessPolicyInner deserializedJitNetworkAccessPolicyInner = new JitNetworkAccessPolicyInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedJitNetworkAccessPolicyInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedJitNetworkAccessPolicyInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedJitNetworkAccessPolicyInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedJitNetworkAccessPolicyInner.innerProperties - = JitNetworkAccessPolicyProperties.fromJson(reader); - } else if ("location".equals(fieldName)) { - deserializedJitNetworkAccessPolicyInner.location = reader.getString(); - } else if ("kind".equals(fieldName)) { - deserializedJitNetworkAccessPolicyInner.kind = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedJitNetworkAccessPolicyInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedJitNetworkAccessPolicyInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessPolicyProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessPolicyProperties.java deleted file mode 100644 index 1f2f41716526..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessPolicyProperties.java +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.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.security.models.JitNetworkAccessPolicyVirtualMachine; -import java.io.IOException; -import java.util.List; - -/** - * The JitNetworkAccessPolicyProperties model. - */ -@Fluent -public final class JitNetworkAccessPolicyProperties implements JsonSerializable { - /* - * Configurations for Microsoft.Compute/virtualMachines resource type. - */ - private List virtualMachines; - - /* - * The requests property. - */ - private List requests; - - /* - * Gets the provisioning state of the Just-in-Time policy. - */ - private String provisioningState; - - /** - * Creates an instance of JitNetworkAccessPolicyProperties class. - */ - public JitNetworkAccessPolicyProperties() { - } - - /** - * Get the virtualMachines property: Configurations for Microsoft.Compute/virtualMachines resource type. - * - * @return the virtualMachines value. - */ - public List virtualMachines() { - return this.virtualMachines; - } - - /** - * Set the virtualMachines property: Configurations for Microsoft.Compute/virtualMachines resource type. - * - * @param virtualMachines the virtualMachines value to set. - * @return the JitNetworkAccessPolicyProperties object itself. - */ - public JitNetworkAccessPolicyProperties - withVirtualMachines(List virtualMachines) { - this.virtualMachines = virtualMachines; - return this; - } - - /** - * Get the requests property: The requests property. - * - * @return the requests value. - */ - public List requests() { - return this.requests; - } - - /** - * Set the requests property: The requests property. - * - * @param requests the requests value to set. - * @return the JitNetworkAccessPolicyProperties object itself. - */ - public JitNetworkAccessPolicyProperties withRequests(List requests) { - this.requests = requests; - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the Just-in-Time policy. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualMachines() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property virtualMachines in model JitNetworkAccessPolicyProperties")); - } else { - virtualMachines().forEach(e -> e.validate()); - } - if (requests() != null) { - requests().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(JitNetworkAccessPolicyProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("virtualMachines", this.virtualMachines, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("requests", this.requests, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of JitNetworkAccessPolicyProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of JitNetworkAccessPolicyProperties 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 JitNetworkAccessPolicyProperties. - */ - public static JitNetworkAccessPolicyProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - JitNetworkAccessPolicyProperties deserializedJitNetworkAccessPolicyProperties - = new JitNetworkAccessPolicyProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("virtualMachines".equals(fieldName)) { - List virtualMachines - = reader.readArray(reader1 -> JitNetworkAccessPolicyVirtualMachine.fromJson(reader1)); - deserializedJitNetworkAccessPolicyProperties.virtualMachines = virtualMachines; - } else if ("requests".equals(fieldName)) { - List requests - = reader.readArray(reader1 -> JitNetworkAccessRequestInner.fromJson(reader1)); - deserializedJitNetworkAccessPolicyProperties.requests = requests; - } else if ("provisioningState".equals(fieldName)) { - deserializedJitNetworkAccessPolicyProperties.provisioningState = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedJitNetworkAccessPolicyProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessRequestInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessRequestInner.java deleted file mode 100644 index 657d9e6cae8a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessRequestInner.java +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.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 com.azure.resourcemanager.security.models.JitNetworkAccessRequestVirtualMachine; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * The JitNetworkAccessRequest model. - */ -@Fluent -public final class JitNetworkAccessRequestInner implements JsonSerializable { - /* - * The virtualMachines property. - */ - private List virtualMachines; - - /* - * The start time of the request in UTC - */ - private OffsetDateTime startTimeUtc; - - /* - * The identity of the person who made the request - */ - private String requestor; - - /* - * The justification for making the initiate request - */ - private String justification; - - /** - * Creates an instance of JitNetworkAccessRequestInner class. - */ - public JitNetworkAccessRequestInner() { - } - - /** - * Get the virtualMachines property: The virtualMachines property. - * - * @return the virtualMachines value. - */ - public List virtualMachines() { - return this.virtualMachines; - } - - /** - * Set the virtualMachines property: The virtualMachines property. - * - * @param virtualMachines the virtualMachines value to set. - * @return the JitNetworkAccessRequestInner object itself. - */ - public JitNetworkAccessRequestInner - withVirtualMachines(List virtualMachines) { - this.virtualMachines = virtualMachines; - return this; - } - - /** - * Get the startTimeUtc property: The start time of the request in UTC. - * - * @return the startTimeUtc value. - */ - public OffsetDateTime startTimeUtc() { - return this.startTimeUtc; - } - - /** - * Set the startTimeUtc property: The start time of the request in UTC. - * - * @param startTimeUtc the startTimeUtc value to set. - * @return the JitNetworkAccessRequestInner object itself. - */ - public JitNetworkAccessRequestInner withStartTimeUtc(OffsetDateTime startTimeUtc) { - this.startTimeUtc = startTimeUtc; - return this; - } - - /** - * Get the requestor property: The identity of the person who made the request. - * - * @return the requestor value. - */ - public String requestor() { - return this.requestor; - } - - /** - * Set the requestor property: The identity of the person who made the request. - * - * @param requestor the requestor value to set. - * @return the JitNetworkAccessRequestInner object itself. - */ - public JitNetworkAccessRequestInner withRequestor(String requestor) { - this.requestor = requestor; - return this; - } - - /** - * Get the justification property: The justification for making the initiate request. - * - * @return the justification value. - */ - public String justification() { - return this.justification; - } - - /** - * Set the justification property: The justification for making the initiate request. - * - * @param justification the justification value to set. - * @return the JitNetworkAccessRequestInner object itself. - */ - public JitNetworkAccessRequestInner withJustification(String justification) { - this.justification = justification; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualMachines() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property virtualMachines in model JitNetworkAccessRequestInner")); - } else { - virtualMachines().forEach(e -> e.validate()); - } - if (startTimeUtc() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property startTimeUtc in model JitNetworkAccessRequestInner")); - } - if (requestor() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property requestor in model JitNetworkAccessRequestInner")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(JitNetworkAccessRequestInner.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("virtualMachines", this.virtualMachines, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("startTimeUtc", - this.startTimeUtc == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTimeUtc)); - jsonWriter.writeStringField("requestor", this.requestor); - jsonWriter.writeStringField("justification", this.justification); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of JitNetworkAccessRequestInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of JitNetworkAccessRequestInner 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 JitNetworkAccessRequestInner. - */ - public static JitNetworkAccessRequestInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - JitNetworkAccessRequestInner deserializedJitNetworkAccessRequestInner = new JitNetworkAccessRequestInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("virtualMachines".equals(fieldName)) { - List virtualMachines - = reader.readArray(reader1 -> JitNetworkAccessRequestVirtualMachine.fromJson(reader1)); - deserializedJitNetworkAccessRequestInner.virtualMachines = virtualMachines; - } else if ("startTimeUtc".equals(fieldName)) { - deserializedJitNetworkAccessRequestInner.startTimeUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("requestor".equals(fieldName)) { - deserializedJitNetworkAccessRequestInner.requestor = reader.getString(); - } else if ("justification".equals(fieldName)) { - deserializedJitNetworkAccessRequestInner.justification = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedJitNetworkAccessRequestInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MalwareScanInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MalwareScanInner.java deleted file mode 100644 index e006c9e65864..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MalwareScanInner.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.MalwareScanProperties; -import java.io.IOException; - -/** - * Describes the state of a malware scan operation. - */ -@Immutable -public final class MalwareScanInner implements JsonSerializable { - /* - * The properties property. - */ - private MalwareScanProperties properties; - - /** - * Creates an instance of MalwareScanInner class. - */ - private MalwareScanInner() { - } - - /** - * Get the properties property: The properties property. - * - * @return the properties value. - */ - public MalwareScanProperties 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(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MalwareScanInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MalwareScanInner 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 MalwareScanInner. - */ - public static MalwareScanInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MalwareScanInner deserializedMalwareScanInner = new MalwareScanInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedMalwareScanInner.properties = MalwareScanProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedMalwareScanInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataInner.java deleted file mode 100644 index ee507e7ec021..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataInner.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The resource of the configuration or data needed to onboard the machine to MDE. - */ -@Immutable -public final class MdeOnboardingDataInner extends ProxyResource { - private static final byte[] EMPTY_BYTE_ARRAY = new byte[0]; - - /* - * Properties of the MDE configuration or data parameter needed to onboard the machine to MDE - */ - private MdeOnboardingDataProperties 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 MdeOnboardingDataInner class. - */ - private MdeOnboardingDataInner() { - } - - /** - * Get the innerProperties property: Properties of the MDE configuration or data parameter needed to onboard the - * machine to MDE. - * - * @return the innerProperties value. - */ - private MdeOnboardingDataProperties 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 onboardingPackageWindows property: The onboarding package used to onboard Windows machines to MDE, coded - * in base64. This can also be used for onboarding using the dedicated VM Extension. - * - * @return the onboardingPackageWindows value. - */ - public byte[] onboardingPackageWindows() { - return this.innerProperties() == null ? EMPTY_BYTE_ARRAY : this.innerProperties().onboardingPackageWindows(); - } - - /** - * Get the onboardingPackageLinux property: The onboarding package used to onboard Linux machines to MDE, coded in - * base64. This can also be used for onboarding using the dedicated VM Extension. - * - * @return the onboardingPackageLinux value. - */ - public byte[] onboardingPackageLinux() { - return this.innerProperties() == null ? EMPTY_BYTE_ARRAY : this.innerProperties().onboardingPackageLinux(); - } - - /** - * 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 MdeOnboardingDataInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MdeOnboardingDataInner 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 MdeOnboardingDataInner. - */ - public static MdeOnboardingDataInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MdeOnboardingDataInner deserializedMdeOnboardingDataInner = new MdeOnboardingDataInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedMdeOnboardingDataInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedMdeOnboardingDataInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedMdeOnboardingDataInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedMdeOnboardingDataInner.innerProperties = MdeOnboardingDataProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedMdeOnboardingDataInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedMdeOnboardingDataInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataListInner.java deleted file mode 100644 index ee293b6f85a5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataListInner.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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; -import java.util.List; - -/** - * List of all MDE onboarding data resources. - */ -@Immutable -public final class MdeOnboardingDataListInner implements JsonSerializable { - /* - * List of the resources of the configuration or data needed to onboard the machine to MDE - */ - private List value; - - /** - * Creates an instance of MdeOnboardingDataListInner class. - */ - private MdeOnboardingDataListInner() { - } - - /** - * Get the value property: List of the resources of the configuration or data needed to onboard the machine to MDE. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * 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 MdeOnboardingDataListInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MdeOnboardingDataListInner 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 MdeOnboardingDataListInner. - */ - public static MdeOnboardingDataListInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MdeOnboardingDataListInner deserializedMdeOnboardingDataListInner = new MdeOnboardingDataListInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> MdeOnboardingDataInner.fromJson(reader1)); - deserializedMdeOnboardingDataListInner.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedMdeOnboardingDataListInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataProperties.java deleted file mode 100644 index 6aafc4948dcd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataProperties.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.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; - -/** - * Properties of the MDE configuration or data parameter needed to onboard the machine to MDE. - */ -@Immutable -public final class MdeOnboardingDataProperties implements JsonSerializable { - /* - * The onboarding package used to onboard Windows machines to MDE, coded in base64. This can also be used for - * onboarding using the dedicated VM Extension - */ - private byte[] onboardingPackageWindows; - - /* - * The onboarding package used to onboard Linux machines to MDE, coded in base64. This can also be used for - * onboarding using the dedicated VM Extension - */ - private byte[] onboardingPackageLinux; - - /** - * Creates an instance of MdeOnboardingDataProperties class. - */ - private MdeOnboardingDataProperties() { - } - - /** - * Get the onboardingPackageWindows property: The onboarding package used to onboard Windows machines to MDE, coded - * in base64. This can also be used for onboarding using the dedicated VM Extension. - * - * @return the onboardingPackageWindows value. - */ - public byte[] onboardingPackageWindows() { - return CoreUtils.clone(this.onboardingPackageWindows); - } - - /** - * Get the onboardingPackageLinux property: The onboarding package used to onboard Linux machines to MDE, coded in - * base64. This can also be used for onboarding using the dedicated VM Extension. - * - * @return the onboardingPackageLinux value. - */ - public byte[] onboardingPackageLinux() { - return CoreUtils.clone(this.onboardingPackageLinux); - } - - /** - * 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.writeBinaryField("onboardingPackageWindows", this.onboardingPackageWindows); - jsonWriter.writeBinaryField("onboardingPackageLinux", this.onboardingPackageLinux); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MdeOnboardingDataProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MdeOnboardingDataProperties 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 MdeOnboardingDataProperties. - */ - public static MdeOnboardingDataProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MdeOnboardingDataProperties deserializedMdeOnboardingDataProperties = new MdeOnboardingDataProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("onboardingPackageWindows".equals(fieldName)) { - deserializedMdeOnboardingDataProperties.onboardingPackageWindows = reader.getBinary(); - } else if ("onboardingPackageLinux".equals(fieldName)) { - deserializedMdeOnboardingDataProperties.onboardingPackageLinux = reader.getBinary(); - } else { - reader.skipChildren(); - } - } - - return deserializedMdeOnboardingDataProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationInner.java deleted file mode 100644 index 2db559e9bc32..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationInner.java +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.ArmActionType; -import com.azure.resourcemanager.security.models.OperationDisplay; -import com.azure.resourcemanager.security.models.Origin; -import java.io.IOException; - -/** - * REST API Operation - * - * Details of a REST API operation, returned from the Resource Provider Operations API. - */ -@Immutable -public final class OperationInner implements JsonSerializable { - /* - * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" - */ - private String name; - - /* - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure - * Resource Manager/control-plane operations. - */ - private Boolean isDataAction; - - /* - * Localized display information for this particular operation. - */ - private OperationDisplay display; - - /* - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default - * value is "user,system" - */ - private Origin origin; - - /* - * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - */ - private ArmActionType actionType; - - /** - * Creates an instance of OperationInner class. - */ - private OperationInner() { - } - - /** - * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for Azure Resource Manager/control-plane operations. - * - * @return the isDataAction value. - */ - public Boolean isDataAction() { - return this.isDataAction; - } - - /** - * Get the display property: Localized display information for this particular operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and - * audit logs UX. Default value is "user,system". - * - * @return the origin value. - */ - public Origin origin() { - return this.origin; - } - - /** - * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are - * for internal only APIs. - * - * @return the actionType value. - */ - public ArmActionType actionType() { - return this.actionType; - } - - /** - * 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.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 if ("origin".equals(fieldName)) { - deserializedOperationInner.origin = Origin.fromString(reader.getString()); - } else if ("actionType".equals(fieldName)) { - deserializedOperationInner.actionType = ArmActionType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationResultInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationResultInner.java deleted file mode 100644 index cf360fc689b9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationResultInner.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.OperationResultStatus; -import java.io.IOException; - -/** - * Long run operation status of governance rule over a given scope. - */ -@Immutable -public final class OperationResultInner implements JsonSerializable { - /* - * The status of the long run operation result of governance rule - */ - private OperationResultStatus status; - - /** - * Creates an instance of OperationResultInner class. - */ - private OperationResultInner() { - } - - /** - * Get the status property: The status of the long run operation result of governance rule. - * - * @return the status value. - */ - public OperationResultStatus status() { - return this.status; - } - - /** - * 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 OperationResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationResultInner 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 OperationResultInner. - */ - public static OperationResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationResultInner deserializedOperationResultInner = new OperationResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedOperationResultInner.status = OperationResultStatus.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationResultInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationStatusResultInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationStatusResultInner.java deleted file mode 100644 index cf5574dcd991..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationStatusResultInner.java +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.exception.ManagementError; -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; -import java.util.List; - -/** - * The current status of an async operation. - */ -@Immutable -public final class OperationStatusResultInner implements JsonSerializable { - /* - * Fully qualified ID for the async operation. - */ - private String id; - - /* - * Name of the async operation. - */ - private String name; - - /* - * Operation status. - */ - private String status; - - /* - * Percent of the operation that is complete. - */ - private Double percentComplete; - - /* - * The start time of the operation. - */ - private OffsetDateTime startTime; - - /* - * The end time of the operation. - */ - private OffsetDateTime endTime; - - /* - * The operations list. - */ - private List operations; - - /* - * If present, details of the operation error. - */ - private ManagementError error; - - /* - * Fully qualified ID of the resource against which the original async operation was started. - */ - private String resourceId; - - /** - * Creates an instance of OperationStatusResultInner class. - */ - private OperationStatusResultInner() { - } - - /** - * Get the id property: Fully qualified ID for the async operation. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the name property: Name of the async operation. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the status property: Operation status. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Get the percentComplete property: Percent of the operation that is complete. - * - * @return the percentComplete value. - */ - public Double percentComplete() { - return this.percentComplete; - } - - /** - * Get the startTime property: The start time of the operation. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Get the endTime property: The end time of the operation. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Get the operations property: The operations list. - * - * @return the operations value. - */ - public List operations() { - return this.operations; - } - - /** - * Get the error property: If present, details of the operation error. - * - * @return the error value. - */ - public ManagementError error() { - return this.error; - } - - /** - * Get the resourceId property: Fully qualified ID of the resource against which the original async operation was - * started. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (status() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property status in model OperationStatusResultInner")); - } - if (operations() != null) { - operations().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(OperationStatusResultInner.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("status", this.status); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeNumberField("percentComplete", this.percentComplete); - jsonWriter.writeStringField("startTime", - this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); - jsonWriter.writeStringField("endTime", - this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); - jsonWriter.writeArrayField("operations", this.operations, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("error", this.error); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationStatusResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationStatusResultInner 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 OperationStatusResultInner. - */ - public static OperationStatusResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationStatusResultInner deserializedOperationStatusResultInner = new OperationStatusResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("status".equals(fieldName)) { - deserializedOperationStatusResultInner.status = reader.getString(); - } else if ("id".equals(fieldName)) { - deserializedOperationStatusResultInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedOperationStatusResultInner.name = reader.getString(); - } else if ("percentComplete".equals(fieldName)) { - deserializedOperationStatusResultInner.percentComplete = reader.getNullable(JsonReader::getDouble); - } else if ("startTime".equals(fieldName)) { - deserializedOperationStatusResultInner.startTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("endTime".equals(fieldName)) { - deserializedOperationStatusResultInner.endTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("operations".equals(fieldName)) { - List operations - = reader.readArray(reader1 -> OperationStatusResultInner.fromJson(reader1)); - deserializedOperationStatusResultInner.operations = operations; - } else if ("error".equals(fieldName)) { - deserializedOperationStatusResultInner.error = ManagementError.fromJson(reader); - } else if ("resourceId".equals(fieldName)) { - deserializedOperationStatusResultInner.resourceId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationStatusResultInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingInner.java deleted file mode 100644 index ab3513672f0e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingInner.java +++ /dev/null @@ -1,347 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.Enforce; -import com.azure.resourcemanager.security.models.Extension; -import com.azure.resourcemanager.security.models.Inherited; -import com.azure.resourcemanager.security.models.PricingTier; -import com.azure.resourcemanager.security.models.ResourcesCoverageStatus; -import java.io.IOException; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * Microsoft Defender for Cloud is provided in two pricing tiers: free and standard. The standard tier offers advanced - * security capabilities, while the free tier offers basic security features. - */ -@Fluent -public final class PricingInner extends ProxyResource { - /* - * Pricing data - */ - private PricingProperties 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 PricingInner class. - */ - public PricingInner() { - } - - /** - * Get the innerProperties property: Pricing data. - * - * @return the innerProperties value. - */ - private PricingProperties 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 pricingTier property: Indicates whether the Defender plan is enabled on the selected scope. Microsoft - * Defender for Cloud is provided in two pricing tiers: free and standard. The standard tier offers advanced - * security capabilities, while the free tier offers basic security features. - * - * @return the pricingTier value. - */ - public PricingTier pricingTier() { - return this.innerProperties() == null ? null : this.innerProperties().pricingTier(); - } - - /** - * Set the pricingTier property: Indicates whether the Defender plan is enabled on the selected scope. Microsoft - * Defender for Cloud is provided in two pricing tiers: free and standard. The standard tier offers advanced - * security capabilities, while the free tier offers basic security features. - * - * @param pricingTier the pricingTier value to set. - * @return the PricingInner object itself. - */ - public PricingInner withPricingTier(PricingTier pricingTier) { - if (this.innerProperties() == null) { - this.innerProperties = new PricingProperties(); - } - this.innerProperties().withPricingTier(pricingTier); - return this; - } - - /** - * Get the subPlan property: The sub-plan selected for a Standard pricing configuration, when more than one sub-plan - * is available. Each sub-plan enables a set of security features. When not specified, full plan is applied. For - * VirtualMachines plan, available sub plans are 'P1' & 'P2', where for resource level only 'P1' sub plan is - * supported. - * - * @return the subPlan value. - */ - public String subPlan() { - return this.innerProperties() == null ? null : this.innerProperties().subPlan(); - } - - /** - * Set the subPlan property: The sub-plan selected for a Standard pricing configuration, when more than one sub-plan - * is available. Each sub-plan enables a set of security features. When not specified, full plan is applied. For - * VirtualMachines plan, available sub plans are 'P1' & 'P2', where for resource level only 'P1' sub plan is - * supported. - * - * @param subPlan the subPlan value to set. - * @return the PricingInner object itself. - */ - public PricingInner withSubPlan(String subPlan) { - if (this.innerProperties() == null) { - this.innerProperties = new PricingProperties(); - } - this.innerProperties().withSubPlan(subPlan); - return this; - } - - /** - * Get the freeTrialRemainingTime property: The duration left for the subscriptions free trial period - in ISO 8601 - * format (e.g. P3Y6M4DT12H30M5S). - * - * @return the freeTrialRemainingTime value. - */ - public Duration freeTrialRemainingTime() { - return this.innerProperties() == null ? null : this.innerProperties().freeTrialRemainingTime(); - } - - /** - * Get the enablementTime property: Optional. If `pricingTier` is `Standard` then this property holds the date of - * the last time the `pricingTier` was set to `Standard`, when available (e.g 2023-03-01T12:42:42.1921106Z). - * - * @return the enablementTime value. - */ - public OffsetDateTime enablementTime() { - return this.innerProperties() == null ? null : this.innerProperties().enablementTime(); - } - - /** - * Get the enforce property: If set to "False", it allows the descendants of this scope to override the pricing - * configuration set on this scope (allows setting inherited="False"). If set to "True", it prevents overrides and - * forces this pricing configuration on all the descendants of this scope. This field is only available for - * subscription-level pricing. - * - * @return the enforce value. - */ - public Enforce enforce() { - return this.innerProperties() == null ? null : this.innerProperties().enforce(); - } - - /** - * Set the enforce property: If set to "False", it allows the descendants of this scope to override the pricing - * configuration set on this scope (allows setting inherited="False"). If set to "True", it prevents overrides and - * forces this pricing configuration on all the descendants of this scope. This field is only available for - * subscription-level pricing. - * - * @param enforce the enforce value to set. - * @return the PricingInner object itself. - */ - public PricingInner withEnforce(Enforce enforce) { - if (this.innerProperties() == null) { - this.innerProperties = new PricingProperties(); - } - this.innerProperties().withEnforce(enforce); - return this; - } - - /** - * Get the inherited property: "inherited" = "True" indicates that the current scope inherits its pricing - * configuration from its parent. The ID of the parent scope that provides the inherited configuration is displayed - * in the "inheritedFrom" field. On the other hand, "inherited" = "False" indicates that the current scope has its - * own pricing configuration explicitly set, and does not inherit from its parent. This field is read only and - * available only for resource-level pricing. - * - * @return the inherited value. - */ - public Inherited inherited() { - return this.innerProperties() == null ? null : this.innerProperties().inherited(); - } - - /** - * Get the inheritedFrom property: The id of the scope inherited from. "Null" if not inherited. This field is only - * available for resource-level pricing. - * - * @return the inheritedFrom value. - */ - public String inheritedFrom() { - return this.innerProperties() == null ? null : this.innerProperties().inheritedFrom(); - } - - /** - * Get the resourcesCoverageStatus property: This field is available for subscription-level only, and reflects the - * coverage status of the resources under the subscription. Please note: The "pricingTier" field reflects the plan - * status of the subscription. However, since the plan status can also be defined at the resource level, there might - * be misalignment between the subscription's plan status and the resource status. This field helps indicate the - * coverage status of the resources. - * - * @return the resourcesCoverageStatus value. - */ - public ResourcesCoverageStatus resourcesCoverageStatus() { - return this.innerProperties() == null ? null : this.innerProperties().resourcesCoverageStatus(); - } - - /** - * Get the extensions property: Optional. List of extensions offered under a plan. - * - * @return the extensions value. - */ - public List extensions() { - return this.innerProperties() == null ? null : this.innerProperties().extensions(); - } - - /** - * Set the extensions property: Optional. List of extensions offered under a plan. - * - * @param extensions the extensions value to set. - * @return the PricingInner object itself. - */ - public PricingInner withExtensions(List extensions) { - if (this.innerProperties() == null) { - this.innerProperties = new PricingProperties(); - } - this.innerProperties().withExtensions(extensions); - return this; - } - - /** - * Get the deprecated property: Optional. True if the plan is deprecated. If there are replacing plans they will - * appear in `replacedBy` property. - * - * @return the deprecated value. - */ - public Boolean deprecated() { - return this.innerProperties() == null ? null : this.innerProperties().deprecated(); - } - - /** - * Get the replacedBy property: Optional. List of plans that replace this plan. This property exists only if this - * plan is deprecated. - * - * @return the replacedBy value. - */ - public List replacedBy() { - return this.innerProperties() == null ? null : this.innerProperties().replacedBy(); - } - - /** - * 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 PricingInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PricingInner 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 PricingInner. - */ - public static PricingInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PricingInner deserializedPricingInner = new PricingInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedPricingInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedPricingInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedPricingInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedPricingInner.innerProperties = PricingProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedPricingInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedPricingInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingListInner.java deleted file mode 100644 index c2b07f990724..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingListInner.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -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.List; - -/** - * List of pricing configurations response. - */ -@Immutable -public final class PricingListInner implements JsonSerializable { - /* - * List of pricing configurations - */ - private List value; - - /** - * Creates an instance of PricingListInner class. - */ - private PricingListInner() { - } - - /** - * Get the value property: List of pricing configurations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model PricingListInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(PricingListInner.class); - - /** - * {@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 PricingListInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PricingListInner 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 PricingListInner. - */ - public static PricingListInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PricingListInner deserializedPricingListInner = new PricingListInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> PricingInner.fromJson(reader1)); - deserializedPricingListInner.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedPricingListInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingProperties.java deleted file mode 100644 index f9a8ec0fa923..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingProperties.java +++ /dev/null @@ -1,357 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.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 com.azure.resourcemanager.security.models.Enforce; -import com.azure.resourcemanager.security.models.Extension; -import com.azure.resourcemanager.security.models.Inherited; -import com.azure.resourcemanager.security.models.PricingTier; -import com.azure.resourcemanager.security.models.ResourcesCoverageStatus; -import java.io.IOException; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * Pricing properties for the relevant scope. - */ -@Fluent -public final class PricingProperties implements JsonSerializable { - /* - * Indicates whether the Defender plan is enabled on the selected scope. Microsoft Defender for Cloud is provided in - * two pricing tiers: free and standard. The standard tier offers advanced security capabilities, while the free - * tier offers basic security features. - */ - private PricingTier pricingTier; - - /* - * The sub-plan selected for a Standard pricing configuration, when more than one sub-plan is available. Each - * sub-plan enables a set of security features. When not specified, full plan is applied. For VirtualMachines plan, - * available sub plans are 'P1' & 'P2', where for resource level only 'P1' sub plan is supported. - */ - private String subPlan; - - /* - * The duration left for the subscriptions free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S). - */ - private Duration freeTrialRemainingTime; - - /* - * Optional. If `pricingTier` is `Standard` then this property holds the date of the last time the `pricingTier` was - * set to `Standard`, when available (e.g 2023-03-01T12:42:42.1921106Z). - */ - private OffsetDateTime enablementTime; - - /* - * If set to "False", it allows the descendants of this scope to override the pricing configuration set on this - * scope (allows setting inherited="False"). If set to "True", it prevents overrides and forces this pricing - * configuration on all the descendants of this scope. This field is only available for subscription-level pricing. - */ - private Enforce enforce; - - /* - * "inherited" = "True" indicates that the current scope inherits its pricing configuration from its parent. The ID - * of the parent scope that provides the inherited configuration is displayed in the "inheritedFrom" field. On the - * other hand, "inherited" = "False" indicates that the current scope has its own pricing configuration explicitly - * set, and does not inherit from its parent. This field is read only and available only for resource-level pricing. - */ - private Inherited inherited; - - /* - * The id of the scope inherited from. "Null" if not inherited. This field is only available for resource-level - * pricing. - */ - private String inheritedFrom; - - /* - * This field is available for subscription-level only, and reflects the coverage status of the resources under the - * subscription. Please note: The "pricingTier" field reflects the plan status of the subscription. However, since - * the plan status can also be defined at the resource level, there might be misalignment between the subscription's - * plan status and the resource status. This field helps indicate the coverage status of the resources. - */ - private ResourcesCoverageStatus resourcesCoverageStatus; - - /* - * Optional. List of extensions offered under a plan. - */ - private List extensions; - - /* - * Optional. True if the plan is deprecated. If there are replacing plans they will appear in `replacedBy` property - */ - private Boolean deprecated; - - /* - * Optional. List of plans that replace this plan. This property exists only if this plan is deprecated. - */ - private List replacedBy; - - /** - * Creates an instance of PricingProperties class. - */ - public PricingProperties() { - } - - /** - * Get the pricingTier property: Indicates whether the Defender plan is enabled on the selected scope. Microsoft - * Defender for Cloud is provided in two pricing tiers: free and standard. The standard tier offers advanced - * security capabilities, while the free tier offers basic security features. - * - * @return the pricingTier value. - */ - public PricingTier pricingTier() { - return this.pricingTier; - } - - /** - * Set the pricingTier property: Indicates whether the Defender plan is enabled on the selected scope. Microsoft - * Defender for Cloud is provided in two pricing tiers: free and standard. The standard tier offers advanced - * security capabilities, while the free tier offers basic security features. - * - * @param pricingTier the pricingTier value to set. - * @return the PricingProperties object itself. - */ - public PricingProperties withPricingTier(PricingTier pricingTier) { - this.pricingTier = pricingTier; - return this; - } - - /** - * Get the subPlan property: The sub-plan selected for a Standard pricing configuration, when more than one sub-plan - * is available. Each sub-plan enables a set of security features. When not specified, full plan is applied. For - * VirtualMachines plan, available sub plans are 'P1' & 'P2', where for resource level only 'P1' sub plan is - * supported. - * - * @return the subPlan value. - */ - public String subPlan() { - return this.subPlan; - } - - /** - * Set the subPlan property: The sub-plan selected for a Standard pricing configuration, when more than one sub-plan - * is available. Each sub-plan enables a set of security features. When not specified, full plan is applied. For - * VirtualMachines plan, available sub plans are 'P1' & 'P2', where for resource level only 'P1' sub plan is - * supported. - * - * @param subPlan the subPlan value to set. - * @return the PricingProperties object itself. - */ - public PricingProperties withSubPlan(String subPlan) { - this.subPlan = subPlan; - return this; - } - - /** - * Get the freeTrialRemainingTime property: The duration left for the subscriptions free trial period - in ISO 8601 - * format (e.g. P3Y6M4DT12H30M5S). - * - * @return the freeTrialRemainingTime value. - */ - public Duration freeTrialRemainingTime() { - return this.freeTrialRemainingTime; - } - - /** - * Get the enablementTime property: Optional. If `pricingTier` is `Standard` then this property holds the date of - * the last time the `pricingTier` was set to `Standard`, when available (e.g 2023-03-01T12:42:42.1921106Z). - * - * @return the enablementTime value. - */ - public OffsetDateTime enablementTime() { - return this.enablementTime; - } - - /** - * Get the enforce property: If set to "False", it allows the descendants of this scope to override the pricing - * configuration set on this scope (allows setting inherited="False"). If set to "True", it prevents overrides and - * forces this pricing configuration on all the descendants of this scope. This field is only available for - * subscription-level pricing. - * - * @return the enforce value. - */ - public Enforce enforce() { - return this.enforce; - } - - /** - * Set the enforce property: If set to "False", it allows the descendants of this scope to override the pricing - * configuration set on this scope (allows setting inherited="False"). If set to "True", it prevents overrides and - * forces this pricing configuration on all the descendants of this scope. This field is only available for - * subscription-level pricing. - * - * @param enforce the enforce value to set. - * @return the PricingProperties object itself. - */ - public PricingProperties withEnforce(Enforce enforce) { - this.enforce = enforce; - return this; - } - - /** - * Get the inherited property: "inherited" = "True" indicates that the current scope inherits its pricing - * configuration from its parent. The ID of the parent scope that provides the inherited configuration is displayed - * in the "inheritedFrom" field. On the other hand, "inherited" = "False" indicates that the current scope has its - * own pricing configuration explicitly set, and does not inherit from its parent. This field is read only and - * available only for resource-level pricing. - * - * @return the inherited value. - */ - public Inherited inherited() { - return this.inherited; - } - - /** - * Get the inheritedFrom property: The id of the scope inherited from. "Null" if not inherited. This field is only - * available for resource-level pricing. - * - * @return the inheritedFrom value. - */ - public String inheritedFrom() { - return this.inheritedFrom; - } - - /** - * Get the resourcesCoverageStatus property: This field is available for subscription-level only, and reflects the - * coverage status of the resources under the subscription. Please note: The "pricingTier" field reflects the plan - * status of the subscription. However, since the plan status can also be defined at the resource level, there might - * be misalignment between the subscription's plan status and the resource status. This field helps indicate the - * coverage status of the resources. - * - * @return the resourcesCoverageStatus value. - */ - public ResourcesCoverageStatus resourcesCoverageStatus() { - return this.resourcesCoverageStatus; - } - - /** - * Get the extensions property: Optional. List of extensions offered under a plan. - * - * @return the extensions value. - */ - public List extensions() { - return this.extensions; - } - - /** - * Set the extensions property: Optional. List of extensions offered under a plan. - * - * @param extensions the extensions value to set. - * @return the PricingProperties object itself. - */ - public PricingProperties withExtensions(List extensions) { - this.extensions = extensions; - return this; - } - - /** - * Get the deprecated property: Optional. True if the plan is deprecated. If there are replacing plans they will - * appear in `replacedBy` property. - * - * @return the deprecated value. - */ - public Boolean deprecated() { - return this.deprecated; - } - - /** - * Get the replacedBy property: Optional. List of plans that replace this plan. This property exists only if this - * plan is deprecated. - * - * @return the replacedBy value. - */ - public List replacedBy() { - return this.replacedBy; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (pricingTier() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property pricingTier in model PricingProperties")); - } - if (extensions() != null) { - extensions().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(PricingProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("pricingTier", this.pricingTier == null ? null : this.pricingTier.toString()); - jsonWriter.writeStringField("subPlan", this.subPlan); - jsonWriter.writeStringField("enforce", this.enforce == null ? null : this.enforce.toString()); - jsonWriter.writeArrayField("extensions", this.extensions, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PricingProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PricingProperties 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 PricingProperties. - */ - public static PricingProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PricingProperties deserializedPricingProperties = new PricingProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("pricingTier".equals(fieldName)) { - deserializedPricingProperties.pricingTier = PricingTier.fromString(reader.getString()); - } else if ("subPlan".equals(fieldName)) { - deserializedPricingProperties.subPlan = reader.getString(); - } else if ("freeTrialRemainingTime".equals(fieldName)) { - deserializedPricingProperties.freeTrialRemainingTime - = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); - } else if ("enablementTime".equals(fieldName)) { - deserializedPricingProperties.enablementTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("enforce".equals(fieldName)) { - deserializedPricingProperties.enforce = Enforce.fromString(reader.getString()); - } else if ("inherited".equals(fieldName)) { - deserializedPricingProperties.inherited = Inherited.fromString(reader.getString()); - } else if ("inheritedFrom".equals(fieldName)) { - deserializedPricingProperties.inheritedFrom = reader.getString(); - } else if ("resourcesCoverageStatus".equals(fieldName)) { - deserializedPricingProperties.resourcesCoverageStatus - = ResourcesCoverageStatus.fromString(reader.getString()); - } else if ("extensions".equals(fieldName)) { - List extensions = reader.readArray(reader1 -> Extension.fromJson(reader1)); - deserializedPricingProperties.extensions = extensions; - } else if ("deprecated".equals(fieldName)) { - deserializedPricingProperties.deprecated = reader.getNullable(JsonReader::getBoolean); - } else if ("replacedBy".equals(fieldName)) { - List replacedBy = reader.readArray(reader1 -> reader1.getString()); - deserializedPricingProperties.replacedBy = replacedBy; - } else { - reader.skipChildren(); - } - } - - return deserializedPricingProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateEndpointConnectionInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateEndpointConnectionInner.java deleted file mode 100644 index b83a5cb70151..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateEndpointConnectionInner.java +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.PrivateEndpoint; -import com.azure.resourcemanager.security.models.PrivateEndpointConnectionProvisioningState; -import com.azure.resourcemanager.security.models.PrivateLinkServiceConnectionState; -import java.io.IOException; -import java.util.List; - -/** - * The private endpoint connection resource. - */ -@Fluent -public final class PrivateEndpointConnectionInner extends ProxyResource { - /* - * Resource properties. - */ - private PrivateEndpointConnectionProperties 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 PrivateEndpointConnectionInner class. - */ - public PrivateEndpointConnectionInner() { - } - - /** - * Get the innerProperties property: Resource properties. - * - * @return the innerProperties value. - */ - private PrivateEndpointConnectionProperties 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 groupIds property: The group ids for the private endpoint resource. - * - * @return the groupIds value. - */ - public List groupIds() { - return this.innerProperties() == null ? null : this.innerProperties().groupIds(); - } - - /** - * Get the privateEndpoint property: The private endpoint resource. - * - * @return the privateEndpoint value. - */ - public PrivateEndpoint privateEndpoint() { - return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); - } - - /** - * Set the privateEndpoint property: The private endpoint resource. - * - * @param privateEndpoint the privateEndpoint value to set. - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateEndpointConnectionProperties(); - } - this.innerProperties().withPrivateEndpoint(privateEndpoint); - return this; - } - - /** - * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @return the privateLinkServiceConnectionState value. - */ - public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { - return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); - } - - /** - * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. - * @return the PrivateEndpointConnectionInner object itself. - */ - public PrivateEndpointConnectionInner - withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateEndpointConnectionProperties(); - } - this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the private endpoint connection resource. - * - * @return the provisioningState value. - */ - public PrivateEndpointConnectionProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * 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 PrivateEndpointConnectionInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpointConnectionInner 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 PrivateEndpointConnectionInner. - */ - public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpointConnectionInner deserializedPrivateEndpointConnectionInner - = new PrivateEndpointConnectionInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.innerProperties - = PrivateEndpointConnectionProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpointConnectionInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateEndpointConnectionProperties.java deleted file mode 100644 index c56c61056232..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateEndpointConnectionProperties.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.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.security.models.PrivateEndpoint; -import com.azure.resourcemanager.security.models.PrivateEndpointConnectionProvisioningState; -import com.azure.resourcemanager.security.models.PrivateLinkServiceConnectionState; -import java.io.IOException; -import java.util.List; - -/** - * Properties of the private endpoint connection. - */ -@Fluent -public final class PrivateEndpointConnectionProperties - implements JsonSerializable { - /* - * The group ids for the private endpoint resource. - */ - private List groupIds; - - /* - * The private endpoint resource. - */ - private PrivateEndpoint privateEndpoint; - - /* - * A collection of information about the state of the connection between service consumer and provider. - */ - private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; - - /* - * The provisioning state of the private endpoint connection resource. - */ - private PrivateEndpointConnectionProvisioningState provisioningState; - - /** - * Creates an instance of PrivateEndpointConnectionProperties class. - */ - public PrivateEndpointConnectionProperties() { - } - - /** - * Get the groupIds property: The group ids for the private endpoint resource. - * - * @return the groupIds value. - */ - public List groupIds() { - return this.groupIds; - } - - /** - * Get the privateEndpoint property: The private endpoint resource. - * - * @return the privateEndpoint value. - */ - public PrivateEndpoint privateEndpoint() { - return this.privateEndpoint; - } - - /** - * Set the privateEndpoint property: The private endpoint resource. - * - * @param privateEndpoint the privateEndpoint value to set. - * @return the PrivateEndpointConnectionProperties object itself. - */ - public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - this.privateEndpoint = privateEndpoint; - return this; - } - - /** - * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @return the privateLinkServiceConnectionState value. - */ - public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { - return this.privateLinkServiceConnectionState; - } - - /** - * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection - * between service consumer and provider. - * - * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. - * @return the PrivateEndpointConnectionProperties object itself. - */ - public PrivateEndpointConnectionProperties - withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { - this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; - return this; - } - - /** - * Get the provisioningState property: The provisioning state of the private endpoint connection resource. - * - * @return the provisioningState value. - */ - public PrivateEndpointConnectionProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (privateEndpoint() != null) { - privateEndpoint().validate(); - } - if (privateLinkServiceConnectionState() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property privateLinkServiceConnectionState in model PrivateEndpointConnectionProperties")); - } else { - privateLinkServiceConnectionState().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); - jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateEndpointConnectionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpointConnectionProperties 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 PrivateEndpointConnectionProperties. - */ - public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpointConnectionProperties deserializedPrivateEndpointConnectionProperties - = new PrivateEndpointConnectionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("privateLinkServiceConnectionState".equals(fieldName)) { - deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState - = PrivateLinkServiceConnectionState.fromJson(reader); - } else if ("groupIds".equals(fieldName)) { - List groupIds = reader.readArray(reader1 -> reader1.getString()); - deserializedPrivateEndpointConnectionProperties.groupIds = groupIds; - } else if ("privateEndpoint".equals(fieldName)) { - deserializedPrivateEndpointConnectionProperties.privateEndpoint = PrivateEndpoint.fromJson(reader); - } else if ("provisioningState".equals(fieldName)) { - deserializedPrivateEndpointConnectionProperties.provisioningState - = PrivateEndpointConnectionProvisioningState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpointConnectionProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateLinkGroupResourceInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateLinkGroupResourceInner.java deleted file mode 100644 index 056042f373b1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateLinkGroupResourceInner.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * A private link group resource that describes a grouping for the private link. - */ -@Immutable -public final class PrivateLinkGroupResourceInner extends ProxyResource { - /* - * Resource properties. - */ - private PrivateLinkResourceProperties 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 PrivateLinkGroupResourceInner class. - */ - private PrivateLinkGroupResourceInner() { - } - - /** - * Get the innerProperties property: Resource properties. - * - * @return the innerProperties value. - */ - private PrivateLinkResourceProperties 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 groupId property: The private link resource group id. - * - * @return the groupId value. - */ - public String groupId() { - return this.innerProperties() == null ? null : this.innerProperties().groupId(); - } - - /** - * Get the requiredMembers property: The private link resource required member names. - * - * @return the requiredMembers value. - */ - public List requiredMembers() { - return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); - } - - /** - * Get the requiredZoneNames property: The private link resource private link DNS zone name. - * - * @return the requiredZoneNames value. - */ - public List requiredZoneNames() { - return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); - } - - /** - * 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 PrivateLinkGroupResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateLinkGroupResourceInner 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 PrivateLinkGroupResourceInner. - */ - public static PrivateLinkGroupResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateLinkGroupResourceInner deserializedPrivateLinkGroupResourceInner - = new PrivateLinkGroupResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedPrivateLinkGroupResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedPrivateLinkGroupResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedPrivateLinkGroupResourceInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedPrivateLinkGroupResourceInner.innerProperties - = PrivateLinkResourceProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedPrivateLinkGroupResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateLinkGroupResourceInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateLinkProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateLinkProperties.java deleted file mode 100644 index fc4a749ce9a0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateLinkProperties.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.ProvisioningState; -import com.azure.resourcemanager.security.models.PublicNetworkAccess; -import java.io.IOException; -import java.util.List; - -/** - * Properties of a private link resource. These properties control the behavior and configuration of private endpoint - * connectivity to Defender services. - */ -@Fluent -public final class PrivateLinkProperties implements JsonSerializable { - /* - * The current provisioning state of the private link resource. Indicates whether the resource is being created, - * updated, deleted, or has completed successfully. - */ - private ProvisioningState provisioningState; - - /* - * List of private endpoint connections associated with this private link. Each connection represents a private - * endpoint from a customer's virtual network. - */ - private List privateEndpointConnections; - - /* - * List of private link resources available for connection. For Defender services, this typically includes the - * 'containers' group with 'api' and regional data endpoints. - */ - private List privateLinkResources; - - /* - * This determines if traffic is allowed over public network. By default it is disabled. - */ - private PublicNetworkAccess publicNetworkAccess; - - /** - * Creates an instance of PrivateLinkProperties class. - */ - public PrivateLinkProperties() { - } - - /** - * Get the provisioningState property: The current provisioning state of the private link resource. Indicates - * whether the resource is being created, updated, deleted, or has completed successfully. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the privateEndpointConnections property: List of private endpoint connections associated with this private - * link. Each connection represents a private endpoint from a customer's virtual network. - * - * @return the privateEndpointConnections value. - */ - public List privateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** - * Get the privateLinkResources property: List of private link resources available for connection. For Defender - * services, this typically includes the 'containers' group with 'api' and regional data endpoints. - * - * @return the privateLinkResources value. - */ - public List privateLinkResources() { - return this.privateLinkResources; - } - - /** - * Get the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is - * disabled. - * - * @return the publicNetworkAccess value. - */ - public PublicNetworkAccess publicNetworkAccess() { - return this.publicNetworkAccess; - } - - /** - * Set the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is - * disabled. - * - * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the PrivateLinkProperties object itself. - */ - public PrivateLinkProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { - this.publicNetworkAccess = publicNetworkAccess; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (privateEndpointConnections() != null) { - privateEndpointConnections().forEach(e -> e.validate()); - } - if (privateLinkResources() != null) { - privateLinkResources().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("publicNetworkAccess", - this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateLinkProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateLinkProperties 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 PrivateLinkProperties. - */ - public static PrivateLinkProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateLinkProperties deserializedPrivateLinkProperties = new PrivateLinkProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningState".equals(fieldName)) { - deserializedPrivateLinkProperties.provisioningState - = ProvisioningState.fromString(reader.getString()); - } else if ("privateEndpointConnections".equals(fieldName)) { - List privateEndpointConnections - = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); - deserializedPrivateLinkProperties.privateEndpointConnections = privateEndpointConnections; - } else if ("privateLinkResources".equals(fieldName)) { - List privateLinkResources - = reader.readArray(reader1 -> PrivateLinkGroupResourceInner.fromJson(reader1)); - deserializedPrivateLinkProperties.privateLinkResources = privateLinkResources; - } else if ("publicNetworkAccess".equals(fieldName)) { - deserializedPrivateLinkProperties.publicNetworkAccess - = PublicNetworkAccess.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateLinkProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateLinkResourceInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateLinkResourceInner.java deleted file mode 100644 index f2d4762a9a8e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateLinkResourceInner.java +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.ProvisioningState; -import com.azure.resourcemanager.security.models.PublicNetworkAccess; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * A private link resource that enables secure, private connectivity to Microsoft Defender for Cloud services. This - * resource manages the lifecycle of private endpoint connections and provides the necessary infrastructure for private - * connectivity. - */ -@Fluent -public final class PrivateLinkResourceInner extends Resource { - /* - * Properties specific to the private link resource - */ - private PrivateLinkProperties innerProperties = new PrivateLinkProperties(); - - /* - * 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 PrivateLinkResourceInner class. - */ - public PrivateLinkResourceInner() { - } - - /** - * Get the innerProperties property: Properties specific to the private link resource. - * - * @return the innerProperties value. - */ - private PrivateLinkProperties 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; - } - - /** - * {@inheritDoc} - */ - @Override - public PrivateLinkResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public PrivateLinkResourceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the provisioningState property: The current provisioning state of the private link resource. Indicates - * whether the resource is being created, updated, deleted, or has completed successfully. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the privateEndpointConnections property: List of private endpoint connections associated with this private - * link. Each connection represents a private endpoint from a customer's virtual network. - * - * @return the privateEndpointConnections value. - */ - public List privateEndpointConnections() { - return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); - } - - /** - * Get the privateLinkResources property: List of private link resources available for connection. For Defender - * services, this typically includes the 'containers' group with 'api' and regional data endpoints. - * - * @return the privateLinkResources value. - */ - public List privateLinkResources() { - return this.innerProperties() == null ? null : this.innerProperties().privateLinkResources(); - } - - /** - * Get the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is - * disabled. - * - * @return the publicNetworkAccess value. - */ - public PublicNetworkAccess publicNetworkAccess() { - return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); - } - - /** - * Set the publicNetworkAccess property: This determines if traffic is allowed over public network. By default it is - * disabled. - * - * @param publicNetworkAccess the publicNetworkAccess value to set. - * @return the PrivateLinkResourceInner object itself. - */ - public PrivateLinkResourceInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { - if (this.innerProperties() == null) { - this.innerProperties = new PrivateLinkProperties(); - } - this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model PrivateLinkResourceInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourceInner.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateLinkResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateLinkResourceInner 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 PrivateLinkResourceInner. - */ - public static PrivateLinkResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateLinkResourceInner deserializedPrivateLinkResourceInner = new PrivateLinkResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedPrivateLinkResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedPrivateLinkResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedPrivateLinkResourceInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedPrivateLinkResourceInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedPrivateLinkResourceInner.withTags(tags); - } else if ("properties".equals(fieldName)) { - deserializedPrivateLinkResourceInner.innerProperties = PrivateLinkProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedPrivateLinkResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateLinkResourceInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateLinkResourceProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateLinkResourceProperties.java deleted file mode 100644 index 6b0d08e7e00e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PrivateLinkResourceProperties.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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; -import java.util.List; - -/** - * Properties of a private link resource. - */ -@Immutable -public final class PrivateLinkResourceProperties implements JsonSerializable { - /* - * The private link resource group id. - */ - private String groupId; - - /* - * The private link resource required member names. - */ - private List requiredMembers; - - /* - * The private link resource private link DNS zone name. - */ - private List requiredZoneNames; - - /** - * Creates an instance of PrivateLinkResourceProperties class. - */ - private PrivateLinkResourceProperties() { - } - - /** - * Get the groupId property: The private link resource group id. - * - * @return the groupId value. - */ - public String groupId() { - return this.groupId; - } - - /** - * Get the requiredMembers property: The private link resource required member names. - * - * @return the requiredMembers value. - */ - public List requiredMembers() { - return this.requiredMembers; - } - - /** - * Get the requiredZoneNames property: The private link resource private link DNS zone name. - * - * @return the requiredZoneNames value. - */ - public List requiredZoneNames() { - return this.requiredZoneNames; - } - - /** - * 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.writeArrayField("requiredZoneNames", this.requiredZoneNames, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateLinkResourceProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateLinkResourceProperties 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 PrivateLinkResourceProperties. - */ - public static PrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateLinkResourceProperties deserializedPrivateLinkResourceProperties - = new PrivateLinkResourceProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("groupId".equals(fieldName)) { - deserializedPrivateLinkResourceProperties.groupId = reader.getString(); - } else if ("requiredMembers".equals(fieldName)) { - List requiredMembers = reader.readArray(reader1 -> reader1.getString()); - deserializedPrivateLinkResourceProperties.requiredMembers = requiredMembers; - } else if ("requiredZoneNames".equals(fieldName)) { - List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); - deserializedPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames; - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateLinkResourceProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentInner.java deleted file mode 100644 index b01e671807a6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentInner.java +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.State; -import java.io.IOException; - -/** - * Regulatory compliance assessment details and state. - */ -@Immutable -public final class RegulatoryComplianceAssessmentInner extends ProxyResource { - /* - * Regulatory compliance assessment data - */ - private RegulatoryComplianceAssessmentProperties 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 RegulatoryComplianceAssessmentInner class. - */ - private RegulatoryComplianceAssessmentInner() { - } - - /** - * Get the innerProperties property: Regulatory compliance assessment data. - * - * @return the innerProperties value. - */ - private RegulatoryComplianceAssessmentProperties 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 description property: The description of the regulatory compliance assessment. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the assessmentType property: The expected type of assessment contained in the AssessmentDetailsLink. - * - * @return the assessmentType value. - */ - public String assessmentType() { - return this.innerProperties() == null ? null : this.innerProperties().assessmentType(); - } - - /** - * Get the assessmentDetailsLink property: Link to more detailed assessment results data. The response type will be - * according to the assessmentType field. - * - * @return the assessmentDetailsLink value. - */ - public String assessmentDetailsLink() { - return this.innerProperties() == null ? null : this.innerProperties().assessmentDetailsLink(); - } - - /** - * Get the state property: Aggregative state based on the assessment's scanned resources states. - * - * @return the state value. - */ - public State state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Get the passedResources property: The given assessment's related resources count with passed state. - * - * @return the passedResources value. - */ - public Integer passedResources() { - return this.innerProperties() == null ? null : this.innerProperties().passedResources(); - } - - /** - * Get the failedResources property: The given assessment's related resources count with failed state. - * - * @return the failedResources value. - */ - public Integer failedResources() { - return this.innerProperties() == null ? null : this.innerProperties().failedResources(); - } - - /** - * Get the skippedResources property: The given assessment's related resources count with skipped state. - * - * @return the skippedResources value. - */ - public Integer skippedResources() { - return this.innerProperties() == null ? null : this.innerProperties().skippedResources(); - } - - /** - * Get the unsupportedResources property: The given assessment's related resources count with unsupported state. - * - * @return the unsupportedResources value. - */ - public Integer unsupportedResources() { - return this.innerProperties() == null ? null : this.innerProperties().unsupportedResources(); - } - - /** - * 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 RegulatoryComplianceAssessmentInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RegulatoryComplianceAssessmentInner 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 RegulatoryComplianceAssessmentInner. - */ - public static RegulatoryComplianceAssessmentInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RegulatoryComplianceAssessmentInner deserializedRegulatoryComplianceAssessmentInner - = new RegulatoryComplianceAssessmentInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentInner.innerProperties - = RegulatoryComplianceAssessmentProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRegulatoryComplianceAssessmentInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentProperties.java deleted file mode 100644 index a51dfce096cd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentProperties.java +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.State; -import java.io.IOException; - -/** - * Regulatory compliance assessment data. - */ -@Immutable -public final class RegulatoryComplianceAssessmentProperties - implements JsonSerializable { - /* - * The description of the regulatory compliance assessment - */ - private String description; - - /* - * The expected type of assessment contained in the AssessmentDetailsLink - */ - private String assessmentType; - - /* - * Link to more detailed assessment results data. The response type will be according to the assessmentType field - */ - private String assessmentDetailsLink; - - /* - * Aggregative state based on the assessment's scanned resources states - */ - private State state; - - /* - * The given assessment's related resources count with passed state. - */ - private Integer passedResources; - - /* - * The given assessment's related resources count with failed state. - */ - private Integer failedResources; - - /* - * The given assessment's related resources count with skipped state. - */ - private Integer skippedResources; - - /* - * The given assessment's related resources count with unsupported state. - */ - private Integer unsupportedResources; - - /** - * Creates an instance of RegulatoryComplianceAssessmentProperties class. - */ - private RegulatoryComplianceAssessmentProperties() { - } - - /** - * Get the description property: The description of the regulatory compliance assessment. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the assessmentType property: The expected type of assessment contained in the AssessmentDetailsLink. - * - * @return the assessmentType value. - */ - public String assessmentType() { - return this.assessmentType; - } - - /** - * Get the assessmentDetailsLink property: Link to more detailed assessment results data. The response type will be - * according to the assessmentType field. - * - * @return the assessmentDetailsLink value. - */ - public String assessmentDetailsLink() { - return this.assessmentDetailsLink; - } - - /** - * Get the state property: Aggregative state based on the assessment's scanned resources states. - * - * @return the state value. - */ - public State state() { - return this.state; - } - - /** - * Get the passedResources property: The given assessment's related resources count with passed state. - * - * @return the passedResources value. - */ - public Integer passedResources() { - return this.passedResources; - } - - /** - * Get the failedResources property: The given assessment's related resources count with failed state. - * - * @return the failedResources value. - */ - public Integer failedResources() { - return this.failedResources; - } - - /** - * Get the skippedResources property: The given assessment's related resources count with skipped state. - * - * @return the skippedResources value. - */ - public Integer skippedResources() { - return this.skippedResources; - } - - /** - * Get the unsupportedResources property: The given assessment's related resources count with unsupported state. - * - * @return the unsupportedResources value. - */ - public Integer unsupportedResources() { - return this.unsupportedResources; - } - - /** - * 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("state", this.state == null ? null : this.state.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RegulatoryComplianceAssessmentProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RegulatoryComplianceAssessmentProperties 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 RegulatoryComplianceAssessmentProperties. - */ - public static RegulatoryComplianceAssessmentProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RegulatoryComplianceAssessmentProperties deserializedRegulatoryComplianceAssessmentProperties - = new RegulatoryComplianceAssessmentProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentProperties.description = reader.getString(); - } else if ("assessmentType".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentProperties.assessmentType = reader.getString(); - } else if ("assessmentDetailsLink".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentProperties.assessmentDetailsLink = reader.getString(); - } else if ("state".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentProperties.state = State.fromString(reader.getString()); - } else if ("passedResources".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentProperties.passedResources - = reader.getNullable(JsonReader::getInt); - } else if ("failedResources".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentProperties.failedResources - = reader.getNullable(JsonReader::getInt); - } else if ("skippedResources".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentProperties.skippedResources - = reader.getNullable(JsonReader::getInt); - } else if ("unsupportedResources".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentProperties.unsupportedResources - = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedRegulatoryComplianceAssessmentProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlInner.java deleted file mode 100644 index 4bd22c895f15..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlInner.java +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.State; -import java.io.IOException; - -/** - * Regulatory compliance control details and state. - */ -@Immutable -public final class RegulatoryComplianceControlInner extends ProxyResource { - /* - * Regulatory compliance control data - */ - private RegulatoryComplianceControlProperties 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 RegulatoryComplianceControlInner class. - */ - private RegulatoryComplianceControlInner() { - } - - /** - * Get the innerProperties property: Regulatory compliance control data. - * - * @return the innerProperties value. - */ - private RegulatoryComplianceControlProperties 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 description property: The description of the regulatory compliance control. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the state property: Aggregative state based on the control's supported assessments states. - * - * @return the state value. - */ - public State state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Get the passedAssessments property: The number of supported regulatory compliance assessments of the given - * control with a passed state. - * - * @return the passedAssessments value. - */ - public Integer passedAssessments() { - return this.innerProperties() == null ? null : this.innerProperties().passedAssessments(); - } - - /** - * Get the failedAssessments property: The number of supported regulatory compliance assessments of the given - * control with a failed state. - * - * @return the failedAssessments value. - */ - public Integer failedAssessments() { - return this.innerProperties() == null ? null : this.innerProperties().failedAssessments(); - } - - /** - * Get the skippedAssessments property: The number of supported regulatory compliance assessments of the given - * control with a skipped state. - * - * @return the skippedAssessments value. - */ - public Integer skippedAssessments() { - return this.innerProperties() == null ? null : this.innerProperties().skippedAssessments(); - } - - /** - * 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 RegulatoryComplianceControlInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RegulatoryComplianceControlInner 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 RegulatoryComplianceControlInner. - */ - public static RegulatoryComplianceControlInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RegulatoryComplianceControlInner deserializedRegulatoryComplianceControlInner - = new RegulatoryComplianceControlInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedRegulatoryComplianceControlInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedRegulatoryComplianceControlInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedRegulatoryComplianceControlInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedRegulatoryComplianceControlInner.innerProperties - = RegulatoryComplianceControlProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedRegulatoryComplianceControlInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRegulatoryComplianceControlInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlProperties.java deleted file mode 100644 index 09d5a9541c0f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlProperties.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.State; -import java.io.IOException; - -/** - * Regulatory compliance control data. - */ -@Immutable -public final class RegulatoryComplianceControlProperties - implements JsonSerializable { - /* - * The description of the regulatory compliance control - */ - private String description; - - /* - * Aggregative state based on the control's supported assessments states - */ - private State state; - - /* - * The number of supported regulatory compliance assessments of the given control with a passed state - */ - private Integer passedAssessments; - - /* - * The number of supported regulatory compliance assessments of the given control with a failed state - */ - private Integer failedAssessments; - - /* - * The number of supported regulatory compliance assessments of the given control with a skipped state - */ - private Integer skippedAssessments; - - /** - * Creates an instance of RegulatoryComplianceControlProperties class. - */ - private RegulatoryComplianceControlProperties() { - } - - /** - * Get the description property: The description of the regulatory compliance control. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the state property: Aggregative state based on the control's supported assessments states. - * - * @return the state value. - */ - public State state() { - return this.state; - } - - /** - * Get the passedAssessments property: The number of supported regulatory compliance assessments of the given - * control with a passed state. - * - * @return the passedAssessments value. - */ - public Integer passedAssessments() { - return this.passedAssessments; - } - - /** - * Get the failedAssessments property: The number of supported regulatory compliance assessments of the given - * control with a failed state. - * - * @return the failedAssessments value. - */ - public Integer failedAssessments() { - return this.failedAssessments; - } - - /** - * Get the skippedAssessments property: The number of supported regulatory compliance assessments of the given - * control with a skipped state. - * - * @return the skippedAssessments value. - */ - public Integer skippedAssessments() { - return this.skippedAssessments; - } - - /** - * 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("state", this.state == null ? null : this.state.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RegulatoryComplianceControlProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RegulatoryComplianceControlProperties 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 RegulatoryComplianceControlProperties. - */ - public static RegulatoryComplianceControlProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RegulatoryComplianceControlProperties deserializedRegulatoryComplianceControlProperties - = new RegulatoryComplianceControlProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedRegulatoryComplianceControlProperties.description = reader.getString(); - } else if ("state".equals(fieldName)) { - deserializedRegulatoryComplianceControlProperties.state = State.fromString(reader.getString()); - } else if ("passedAssessments".equals(fieldName)) { - deserializedRegulatoryComplianceControlProperties.passedAssessments - = reader.getNullable(JsonReader::getInt); - } else if ("failedAssessments".equals(fieldName)) { - deserializedRegulatoryComplianceControlProperties.failedAssessments - = reader.getNullable(JsonReader::getInt); - } else if ("skippedAssessments".equals(fieldName)) { - deserializedRegulatoryComplianceControlProperties.skippedAssessments - = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedRegulatoryComplianceControlProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardInner.java deleted file mode 100644 index 9f874152bf33..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardInner.java +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.State; -import java.io.IOException; - -/** - * Regulatory compliance standard details and state. - */ -@Immutable -public final class RegulatoryComplianceStandardInner extends ProxyResource { - /* - * Regulatory compliance standard data - */ - private RegulatoryComplianceStandardProperties 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 RegulatoryComplianceStandardInner class. - */ - private RegulatoryComplianceStandardInner() { - } - - /** - * Get the innerProperties property: Regulatory compliance standard data. - * - * @return the innerProperties value. - */ - private RegulatoryComplianceStandardProperties 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 state property: Aggregative state based on the standard's supported controls states. - * - * @return the state value. - */ - public State state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Get the passedControls property: The number of supported regulatory compliance controls of the given standard - * with a passed state. - * - * @return the passedControls value. - */ - public Integer passedControls() { - return this.innerProperties() == null ? null : this.innerProperties().passedControls(); - } - - /** - * Get the failedControls property: The number of supported regulatory compliance controls of the given standard - * with a failed state. - * - * @return the failedControls value. - */ - public Integer failedControls() { - return this.innerProperties() == null ? null : this.innerProperties().failedControls(); - } - - /** - * Get the skippedControls property: The number of supported regulatory compliance controls of the given standard - * with a skipped state. - * - * @return the skippedControls value. - */ - public Integer skippedControls() { - return this.innerProperties() == null ? null : this.innerProperties().skippedControls(); - } - - /** - * Get the unsupportedControls property: The number of regulatory compliance controls of the given standard which - * are unsupported by automated assessments. - * - * @return the unsupportedControls value. - */ - public Integer unsupportedControls() { - return this.innerProperties() == null ? null : this.innerProperties().unsupportedControls(); - } - - /** - * 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 RegulatoryComplianceStandardInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RegulatoryComplianceStandardInner 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 RegulatoryComplianceStandardInner. - */ - public static RegulatoryComplianceStandardInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RegulatoryComplianceStandardInner deserializedRegulatoryComplianceStandardInner - = new RegulatoryComplianceStandardInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedRegulatoryComplianceStandardInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedRegulatoryComplianceStandardInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedRegulatoryComplianceStandardInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedRegulatoryComplianceStandardInner.innerProperties - = RegulatoryComplianceStandardProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedRegulatoryComplianceStandardInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRegulatoryComplianceStandardInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardProperties.java deleted file mode 100644 index 00999eb61eba..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardProperties.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.State; -import java.io.IOException; - -/** - * Regulatory compliance standard data. - */ -@Immutable -public final class RegulatoryComplianceStandardProperties - implements JsonSerializable { - /* - * Aggregative state based on the standard's supported controls states - */ - private State state; - - /* - * The number of supported regulatory compliance controls of the given standard with a passed state - */ - private Integer passedControls; - - /* - * The number of supported regulatory compliance controls of the given standard with a failed state - */ - private Integer failedControls; - - /* - * The number of supported regulatory compliance controls of the given standard with a skipped state - */ - private Integer skippedControls; - - /* - * The number of regulatory compliance controls of the given standard which are unsupported by automated assessments - */ - private Integer unsupportedControls; - - /** - * Creates an instance of RegulatoryComplianceStandardProperties class. - */ - private RegulatoryComplianceStandardProperties() { - } - - /** - * Get the state property: Aggregative state based on the standard's supported controls states. - * - * @return the state value. - */ - public State state() { - return this.state; - } - - /** - * Get the passedControls property: The number of supported regulatory compliance controls of the given standard - * with a passed state. - * - * @return the passedControls value. - */ - public Integer passedControls() { - return this.passedControls; - } - - /** - * Get the failedControls property: The number of supported regulatory compliance controls of the given standard - * with a failed state. - * - * @return the failedControls value. - */ - public Integer failedControls() { - return this.failedControls; - } - - /** - * Get the skippedControls property: The number of supported regulatory compliance controls of the given standard - * with a skipped state. - * - * @return the skippedControls value. - */ - public Integer skippedControls() { - return this.skippedControls; - } - - /** - * Get the unsupportedControls property: The number of regulatory compliance controls of the given standard which - * are unsupported by automated assessments. - * - * @return the unsupportedControls value. - */ - public Integer unsupportedControls() { - return this.unsupportedControls; - } - - /** - * 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("state", this.state == null ? null : this.state.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RegulatoryComplianceStandardProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RegulatoryComplianceStandardProperties 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 RegulatoryComplianceStandardProperties. - */ - public static RegulatoryComplianceStandardProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RegulatoryComplianceStandardProperties deserializedRegulatoryComplianceStandardProperties - = new RegulatoryComplianceStandardProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("state".equals(fieldName)) { - deserializedRegulatoryComplianceStandardProperties.state = State.fromString(reader.getString()); - } else if ("passedControls".equals(fieldName)) { - deserializedRegulatoryComplianceStandardProperties.passedControls - = reader.getNullable(JsonReader::getInt); - } else if ("failedControls".equals(fieldName)) { - deserializedRegulatoryComplianceStandardProperties.failedControls - = reader.getNullable(JsonReader::getInt); - } else if ("skippedControls".equals(fieldName)) { - deserializedRegulatoryComplianceStandardProperties.skippedControls - = reader.getNullable(JsonReader::getInt); - } else if ("unsupportedControls".equals(fieldName)) { - deserializedRegulatoryComplianceStandardProperties.unsupportedControls - = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedRegulatoryComplianceStandardProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RuleResultsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RuleResultsInner.java deleted file mode 100644 index 6f65296a1e90..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RuleResultsInner.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.RuleResultsProperties; -import java.io.IOException; - -/** - * Rule results. - */ -@Immutable -public final class RuleResultsInner extends ProxyResource { - /* - * Rule results properties. - */ - private RuleResultsProperties 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 RuleResultsInner class. - */ - private RuleResultsInner() { - } - - /** - * Get the properties property: Rule results properties. - * - * @return the properties value. - */ - public RuleResultsProperties properties() { - return this.properties; - } - - /** - * 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 RuleResultsInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RuleResultsInner 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 RuleResultsInner. - */ - public static RuleResultsInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RuleResultsInner deserializedRuleResultsInner = new RuleResultsInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedRuleResultsInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedRuleResultsInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedRuleResultsInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedRuleResultsInner.properties = RuleResultsProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedRuleResultsInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedRuleResultsInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RulesResultsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RulesResultsInner.java deleted file mode 100644 index 3ef9c25fd82b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RulesResultsInner.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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; -import java.util.List; - -/** - * A list of rules results. - */ -@Immutable -public final class RulesResultsInner implements JsonSerializable { - /* - * List of rule results. - */ - private List value; - - /* - * The nextLink property. - */ - private String nextLink; - - /** - * Creates an instance of RulesResultsInner class. - */ - private RulesResultsInner() { - } - - /** - * Get the value property: List of rule results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The nextLink property. - * - * @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(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RulesResultsInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RulesResultsInner 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 RulesResultsInner. - */ - public static RulesResultsInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RulesResultsInner deserializedRulesResultsInner = new RulesResultsInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> RuleResultsInner.fromJson(reader1)); - deserializedRulesResultsInner.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedRulesResultsInner.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRulesResultsInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanResultInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanResultInner.java deleted file mode 100644 index 564bc2cd3ce9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanResultInner.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.ScanResultProperties; -import java.io.IOException; - -/** - * A vulnerability assessment scan result for a single rule. - */ -@Immutable -public final class ScanResultInner extends ProxyResource { - /* - * A vulnerability assessment scan result properties for a single rule. - */ - private ScanResultProperties 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 ScanResultInner class. - */ - private ScanResultInner() { - } - - /** - * Get the properties property: A vulnerability assessment scan result properties for a single rule. - * - * @return the properties value. - */ - public ScanResultProperties properties() { - return this.properties; - } - - /** - * 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 ScanResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ScanResultInner 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 ScanResultInner. - */ - public static ScanResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ScanResultInner deserializedScanResultInner = new ScanResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedScanResultInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedScanResultInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedScanResultInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedScanResultInner.properties = ScanResultProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedScanResultInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedScanResultInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanV2Inner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanV2Inner.java deleted file mode 100644 index 6ff1954fe6b4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanV2Inner.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.ScanPropertiesV2; -import java.io.IOException; - -/** - * A vulnerability assessment scan record. - */ -@Immutable -public final class ScanV2Inner extends ProxyResource { - /* - * A vulnerability assessment scan record properties. - */ - private ScanPropertiesV2 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 ScanV2Inner class. - */ - private ScanV2Inner() { - } - - /** - * Get the properties property: A vulnerability assessment scan record properties. - * - * @return the properties value. - */ - public ScanPropertiesV2 properties() { - return this.properties; - } - - /** - * 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 ScanV2Inner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ScanV2Inner 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 ScanV2Inner. - */ - public static ScanV2Inner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ScanV2Inner deserializedScanV2Inner = new ScanV2Inner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedScanV2Inner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedScanV2Inner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedScanV2Inner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedScanV2Inner.properties = ScanPropertiesV2.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedScanV2Inner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedScanV2Inner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScoreDetails.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScoreDetails.java deleted file mode 100644 index 919ce067722b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScoreDetails.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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; - -/** - * Calculation result data. - */ -@Immutable -public final class ScoreDetails implements JsonSerializable { - /* - * Maximum score available - */ - private Integer max; - - /* - * Current score - */ - private Double current; - - /* - * Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point - */ - private Double percentage; - - /** - * Creates an instance of ScoreDetails class. - */ - private ScoreDetails() { - } - - /** - * Get the max property: Maximum score available. - * - * @return the max value. - */ - public Integer max() { - return this.max; - } - - /** - * Get the current property: Current score. - * - * @return the current value. - */ - public Double current() { - return this.current; - } - - /** - * Get the percentage property: Ratio of the current score divided by the maximum. Rounded to 4 digits after the - * decimal point. - * - * @return the percentage value. - */ - public Double percentage() { - return this.percentage; - } - - /** - * 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 ScoreDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ScoreDetails 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 ScoreDetails. - */ - public static ScoreDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ScoreDetails deserializedScoreDetails = new ScoreDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("max".equals(fieldName)) { - deserializedScoreDetails.max = reader.getNullable(JsonReader::getInt); - } else if ("current".equals(fieldName)) { - deserializedScoreDetails.current = reader.getNullable(JsonReader::getDouble); - } else if ("percentage".equals(fieldName)) { - deserializedScoreDetails.percentage = reader.getNullable(JsonReader::getDouble); - } else { - reader.skipChildren(); - } - } - - return deserializedScoreDetails; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDefinitionItemInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDefinitionItemInner.java deleted file mode 100644 index 1671eba6ab40..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDefinitionItemInner.java +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.AzureResourceLink; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionSource; -import java.io.IOException; -import java.util.List; - -/** - * Information about the security control. - */ -@Immutable -public final class SecureScoreControlDefinitionItemInner extends ProxyResource { - /* - * Security Control Definition Properties. - */ - private SecureScoreControlDefinitionItemProperties 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 SecureScoreControlDefinitionItemInner class. - */ - private SecureScoreControlDefinitionItemInner() { - } - - /** - * Get the innerProperties property: Security Control Definition Properties. - * - * @return the innerProperties value. - */ - private SecureScoreControlDefinitionItemProperties 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 displayName property: User friendly display name of the control. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the description property: User friendly description of the control. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the maxScore property: Maximum control score (0..10). - * - * @return the maxScore value. - */ - public Integer maxScore() { - return this.innerProperties() == null ? null : this.innerProperties().maxScore(); - } - - /** - * Get the source property: Source object from which the control was created. - * - * @return the source value. - */ - public SecureScoreControlDefinitionSource source() { - return this.innerProperties() == null ? null : this.innerProperties().source(); - } - - /** - * Get the assessmentDefinitions property: Array of assessments metadata IDs that are included in this security - * control. - * - * @return the assessmentDefinitions value. - */ - public List assessmentDefinitions() { - return this.innerProperties() == null ? null : this.innerProperties().assessmentDefinitions(); - } - - /** - * 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 SecureScoreControlDefinitionItemInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecureScoreControlDefinitionItemInner 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 SecureScoreControlDefinitionItemInner. - */ - public static SecureScoreControlDefinitionItemInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecureScoreControlDefinitionItemInner deserializedSecureScoreControlDefinitionItemInner - = new SecureScoreControlDefinitionItemInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSecureScoreControlDefinitionItemInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSecureScoreControlDefinitionItemInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSecureScoreControlDefinitionItemInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSecureScoreControlDefinitionItemInner.innerProperties - = SecureScoreControlDefinitionItemProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSecureScoreControlDefinitionItemInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecureScoreControlDefinitionItemInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDefinitionItemProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDefinitionItemProperties.java deleted file mode 100644 index 89525269509d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDefinitionItemProperties.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.AzureResourceLink; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionSource; -import java.io.IOException; -import java.util.List; - -/** - * Security Control Definition Properties. - */ -@Immutable -public final class SecureScoreControlDefinitionItemProperties - implements JsonSerializable { - /* - * User friendly display name of the control - */ - private String displayName; - - /* - * User friendly description of the control - */ - private String description; - - /* - * Maximum control score (0..10) - */ - private Integer maxScore; - - /* - * Source object from which the control was created - */ - private SecureScoreControlDefinitionSource source; - - /* - * Array of assessments metadata IDs that are included in this security control - */ - private List assessmentDefinitions; - - /** - * Creates an instance of SecureScoreControlDefinitionItemProperties class. - */ - private SecureScoreControlDefinitionItemProperties() { - } - - /** - * Get the displayName property: User friendly display name of the control. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the description property: User friendly description of the control. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the maxScore property: Maximum control score (0..10). - * - * @return the maxScore value. - */ - public Integer maxScore() { - return this.maxScore; - } - - /** - * Get the source property: Source object from which the control was created. - * - * @return the source value. - */ - public SecureScoreControlDefinitionSource source() { - return this.source; - } - - /** - * Get the assessmentDefinitions property: Array of assessments metadata IDs that are included in this security - * control. - * - * @return the assessmentDefinitions value. - */ - public List assessmentDefinitions() { - return this.assessmentDefinitions; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (source() != null) { - source().validate(); - } - if (assessmentDefinitions() != null) { - assessmentDefinitions().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecureScoreControlDefinitionItemProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecureScoreControlDefinitionItemProperties 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 SecureScoreControlDefinitionItemProperties. - */ - public static SecureScoreControlDefinitionItemProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecureScoreControlDefinitionItemProperties deserializedSecureScoreControlDefinitionItemProperties - = new SecureScoreControlDefinitionItemProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("displayName".equals(fieldName)) { - deserializedSecureScoreControlDefinitionItemProperties.displayName = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedSecureScoreControlDefinitionItemProperties.description = reader.getString(); - } else if ("maxScore".equals(fieldName)) { - deserializedSecureScoreControlDefinitionItemProperties.maxScore - = reader.getNullable(JsonReader::getInt); - } else if ("source".equals(fieldName)) { - deserializedSecureScoreControlDefinitionItemProperties.source - = SecureScoreControlDefinitionSource.fromJson(reader); - } else if ("assessmentDefinitions".equals(fieldName)) { - List assessmentDefinitions - = reader.readArray(reader1 -> AzureResourceLink.fromJson(reader1)); - deserializedSecureScoreControlDefinitionItemProperties.assessmentDefinitions - = assessmentDefinitions; - } else { - reader.skipChildren(); - } - } - - return deserializedSecureScoreControlDefinitionItemProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDetailsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDetailsInner.java deleted file mode 100644 index 021837fa8fbd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDetailsInner.java +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Details of the security control, its score, and the health status of the relevant resources. - */ -@Immutable -public final class SecureScoreControlDetailsInner extends ProxyResource { - /* - * Calculation result data in control level - */ - private SecureScoreControlScoreDetailsInner 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 SecureScoreControlDetailsInner class. - */ - private SecureScoreControlDetailsInner() { - } - - /** - * Get the innerProperties property: Calculation result data in control level. - * - * @return the innerProperties value. - */ - private SecureScoreControlScoreDetailsInner 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 displayName property: User friendly display name of the control. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the healthyResourceCount property: Number of healthy resources in the control. - * - * @return the healthyResourceCount value. - */ - public Integer healthyResourceCount() { - return this.innerProperties() == null ? null : this.innerProperties().healthyResourceCount(); - } - - /** - * Get the unhealthyResourceCount property: Number of unhealthy resources in the control. - * - * @return the unhealthyResourceCount value. - */ - public Integer unhealthyResourceCount() { - return this.innerProperties() == null ? null : this.innerProperties().unhealthyResourceCount(); - } - - /** - * Get the notApplicableResourceCount property: Number of not applicable resources in the control. - * - * @return the notApplicableResourceCount value. - */ - public Integer notApplicableResourceCount() { - return this.innerProperties() == null ? null : this.innerProperties().notApplicableResourceCount(); - } - - /** - * Get the weight property: The relative weight for this specific control in each of your subscriptions. Used when - * calculating an aggregated score for this control across all of your subscriptions. - * - * @return the weight value. - */ - public Long weight() { - return this.innerProperties() == null ? null : this.innerProperties().weight(); - } - - /** - * Get the definition property: Information about the security control. - * - * @return the definition value. - */ - public SecureScoreControlDefinitionItemInner definition() { - return this.innerProperties() == null ? null : this.innerProperties().definition(); - } - - /** - * Get the max property: Maximum score available. - * - * @return the max value. - */ - public Integer max() { - return this.innerProperties() == null ? null : this.innerProperties().max(); - } - - /** - * Get the current property: Current score. - * - * @return the current value. - */ - public Double current() { - return this.innerProperties() == null ? null : this.innerProperties().current(); - } - - /** - * Get the percentage property: Ratio of the current score divided by the maximum. Rounded to 4 digits after the - * decimal point. - * - * @return the percentage value. - */ - public Double percentage() { - return this.innerProperties() == null ? null : this.innerProperties().percentage(); - } - - /** - * 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 SecureScoreControlDetailsInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecureScoreControlDetailsInner 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 SecureScoreControlDetailsInner. - */ - public static SecureScoreControlDetailsInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecureScoreControlDetailsInner deserializedSecureScoreControlDetailsInner - = new SecureScoreControlDetailsInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSecureScoreControlDetailsInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSecureScoreControlDetailsInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSecureScoreControlDetailsInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSecureScoreControlDetailsInner.innerProperties - = SecureScoreControlScoreDetailsInner.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSecureScoreControlDetailsInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecureScoreControlDetailsInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlScoreDetailsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlScoreDetailsInner.java deleted file mode 100644 index 6addc6298c6a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlScoreDetailsInner.java +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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; - -/** - * Calculation result data in control level. - */ -@Immutable -public final class SecureScoreControlScoreDetailsInner - implements JsonSerializable { - /* - * User friendly display name of the control - */ - private String displayName; - - /* - * Actual score object for the control - */ - private ScoreDetails innerScore; - - /* - * Number of healthy resources in the control - */ - private Integer healthyResourceCount; - - /* - * Number of unhealthy resources in the control - */ - private Integer unhealthyResourceCount; - - /* - * Number of not applicable resources in the control - */ - private Integer notApplicableResourceCount; - - /* - * The relative weight for this specific control in each of your subscriptions. Used when calculating an aggregated - * score for this control across all of your subscriptions. - */ - private Long weight; - - /* - * Information about the security control. - */ - private SecureScoreControlDefinitionItemInner definition; - - /** - * Creates an instance of SecureScoreControlScoreDetailsInner class. - */ - private SecureScoreControlScoreDetailsInner() { - } - - /** - * Get the displayName property: User friendly display name of the control. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the innerScore property: Actual score object for the control. - * - * @return the innerScore value. - */ - private ScoreDetails innerScore() { - return this.innerScore; - } - - /** - * Get the healthyResourceCount property: Number of healthy resources in the control. - * - * @return the healthyResourceCount value. - */ - public Integer healthyResourceCount() { - return this.healthyResourceCount; - } - - /** - * Get the unhealthyResourceCount property: Number of unhealthy resources in the control. - * - * @return the unhealthyResourceCount value. - */ - public Integer unhealthyResourceCount() { - return this.unhealthyResourceCount; - } - - /** - * Get the notApplicableResourceCount property: Number of not applicable resources in the control. - * - * @return the notApplicableResourceCount value. - */ - public Integer notApplicableResourceCount() { - return this.notApplicableResourceCount; - } - - /** - * Get the weight property: The relative weight for this specific control in each of your subscriptions. Used when - * calculating an aggregated score for this control across all of your subscriptions. - * - * @return the weight value. - */ - public Long weight() { - return this.weight; - } - - /** - * Get the definition property: Information about the security control. - * - * @return the definition value. - */ - public SecureScoreControlDefinitionItemInner definition() { - return this.definition; - } - - /** - * Get the max property: Maximum score available. - * - * @return the max value. - */ - public Integer max() { - return this.innerScore() == null ? null : this.innerScore().max(); - } - - /** - * Get the current property: Current score. - * - * @return the current value. - */ - public Double current() { - return this.innerScore() == null ? null : this.innerScore().current(); - } - - /** - * Get the percentage property: Ratio of the current score divided by the maximum. Rounded to 4 digits after the - * decimal point. - * - * @return the percentage value. - */ - public Double percentage() { - return this.innerScore() == null ? null : this.innerScore().percentage(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerScore() != null) { - innerScore().validate(); - } - if (definition() != null) { - definition().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("score", this.innerScore); - jsonWriter.writeJsonField("definition", this.definition); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecureScoreControlScoreDetailsInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecureScoreControlScoreDetailsInner 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 SecureScoreControlScoreDetailsInner. - */ - public static SecureScoreControlScoreDetailsInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecureScoreControlScoreDetailsInner deserializedSecureScoreControlScoreDetailsInner - = new SecureScoreControlScoreDetailsInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("displayName".equals(fieldName)) { - deserializedSecureScoreControlScoreDetailsInner.displayName = reader.getString(); - } else if ("score".equals(fieldName)) { - deserializedSecureScoreControlScoreDetailsInner.innerScore = ScoreDetails.fromJson(reader); - } else if ("healthyResourceCount".equals(fieldName)) { - deserializedSecureScoreControlScoreDetailsInner.healthyResourceCount - = reader.getNullable(JsonReader::getInt); - } else if ("unhealthyResourceCount".equals(fieldName)) { - deserializedSecureScoreControlScoreDetailsInner.unhealthyResourceCount - = reader.getNullable(JsonReader::getInt); - } else if ("notApplicableResourceCount".equals(fieldName)) { - deserializedSecureScoreControlScoreDetailsInner.notApplicableResourceCount - = reader.getNullable(JsonReader::getInt); - } else if ("weight".equals(fieldName)) { - deserializedSecureScoreControlScoreDetailsInner.weight = reader.getNullable(JsonReader::getLong); - } else if ("definition".equals(fieldName)) { - deserializedSecureScoreControlScoreDetailsInner.definition - = SecureScoreControlDefinitionItemInner.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecureScoreControlScoreDetailsInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreItemInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreItemInner.java deleted file mode 100644 index e1f159ec947c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreItemInner.java +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Secure score item data model. - */ -@Immutable -public final class SecureScoreItemInner extends ProxyResource { - /* - * Secure score item - */ - private SecureScoreItemProperties 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 SecureScoreItemInner class. - */ - private SecureScoreItemInner() { - } - - /** - * Get the innerProperties property: Secure score item. - * - * @return the innerProperties value. - */ - private SecureScoreItemProperties 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 displayName property: The initiative's name. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the weight property: The relative weight for each subscription. Used when calculating an aggregated secure - * score for multiple subscriptions. - * - * @return the weight value. - */ - public Long weight() { - return this.innerProperties() == null ? null : this.innerProperties().weight(); - } - - /** - * Get the max property: Maximum score available. - * - * @return the max value. - */ - public Integer max() { - return this.innerProperties() == null ? null : this.innerProperties().max(); - } - - /** - * Get the current property: Current score. - * - * @return the current value. - */ - public Double current() { - return this.innerProperties() == null ? null : this.innerProperties().current(); - } - - /** - * Get the percentage property: Ratio of the current score divided by the maximum. Rounded to 4 digits after the - * decimal point. - * - * @return the percentage value. - */ - public Double percentage() { - return this.innerProperties() == null ? null : this.innerProperties().percentage(); - } - - /** - * 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(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecureScoreItemInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecureScoreItemInner 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 SecureScoreItemInner. - */ - public static SecureScoreItemInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecureScoreItemInner deserializedSecureScoreItemInner = new SecureScoreItemInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSecureScoreItemInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSecureScoreItemInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSecureScoreItemInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSecureScoreItemInner.innerProperties = SecureScoreItemProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSecureScoreItemInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecureScoreItemInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreItemProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreItemProperties.java deleted file mode 100644 index 2e9bb93144b2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreItemProperties.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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; - -/** - * Describes properties of a calculated secure score. - */ -@Immutable -public final class SecureScoreItemProperties implements JsonSerializable { - /* - * The initiative's name - */ - private String displayName; - - /* - * score object - */ - private ScoreDetails innerScore; - - /* - * The relative weight for each subscription. Used when calculating an aggregated secure score for multiple - * subscriptions. - */ - private Long weight; - - /** - * Creates an instance of SecureScoreItemProperties class. - */ - private SecureScoreItemProperties() { - } - - /** - * Get the displayName property: The initiative's name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the innerScore property: score object. - * - * @return the innerScore value. - */ - private ScoreDetails innerScore() { - return this.innerScore; - } - - /** - * Get the weight property: The relative weight for each subscription. Used when calculating an aggregated secure - * score for multiple subscriptions. - * - * @return the weight value. - */ - public Long weight() { - return this.weight; - } - - /** - * Get the max property: Maximum score available. - * - * @return the max value. - */ - public Integer max() { - return this.innerScore() == null ? null : this.innerScore().max(); - } - - /** - * Get the current property: Current score. - * - * @return the current value. - */ - public Double current() { - return this.innerScore() == null ? null : this.innerScore().current(); - } - - /** - * Get the percentage property: Ratio of the current score divided by the maximum. Rounded to 4 digits after the - * decimal point. - * - * @return the percentage value. - */ - public Double percentage() { - return this.innerScore() == null ? null : this.innerScore().percentage(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerScore() != null) { - innerScore().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecureScoreItemProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecureScoreItemProperties 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 SecureScoreItemProperties. - */ - public static SecureScoreItemProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecureScoreItemProperties deserializedSecureScoreItemProperties = new SecureScoreItemProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("displayName".equals(fieldName)) { - deserializedSecureScoreItemProperties.displayName = reader.getString(); - } else if ("score".equals(fieldName)) { - deserializedSecureScoreItemProperties.innerScore = ScoreDetails.fromJson(reader); - } else if ("weight".equals(fieldName)) { - deserializedSecureScoreItemProperties.weight = reader.getNullable(JsonReader::getLong); - } else { - reader.skipChildren(); - } - } - - return deserializedSecureScoreItemProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataPropertiesResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataPropertiesResponse.java deleted file mode 100644 index f76239871f3b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataPropertiesResponse.java +++ /dev/null @@ -1,388 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -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.security.models.AssessmentType; -import com.azure.resourcemanager.security.models.Categories; -import com.azure.resourcemanager.security.models.ImplementationEffort; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPartnerData; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataProperties; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates; -import com.azure.resourcemanager.security.models.Severity; -import com.azure.resourcemanager.security.models.Tactics; -import com.azure.resourcemanager.security.models.Techniques; -import com.azure.resourcemanager.security.models.Threats; -import com.azure.resourcemanager.security.models.UserImpact; -import java.io.IOException; -import java.util.List; - -/** - * Describes properties of an assessment metadata response. - */ -@Fluent -public final class SecurityAssessmentMetadataPropertiesResponse extends SecurityAssessmentMetadataProperties { - /* - * The publishDates property. - */ - private SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates; - - /* - * The plannedDeprecationDate property. - */ - private String plannedDeprecationDate; - - /* - * The tactics property. - */ - private List tactics; - - /* - * The techniques property. - */ - private List techniques; - - /* - * Azure resource ID of the policy definition that turns this assessment calculation on - */ - private String policyDefinitionId; - - /** - * Creates an instance of SecurityAssessmentMetadataPropertiesResponse class. - */ - public SecurityAssessmentMetadataPropertiesResponse() { - } - - /** - * Get the publishDates property: The publishDates property. - * - * @return the publishDates value. - */ - public SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates() { - return this.publishDates; - } - - /** - * Set the publishDates property: The publishDates property. - * - * @param publishDates the publishDates value to set. - * @return the SecurityAssessmentMetadataPropertiesResponse object itself. - */ - public SecurityAssessmentMetadataPropertiesResponse - withPublishDates(SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates) { - this.publishDates = publishDates; - return this; - } - - /** - * Get the plannedDeprecationDate property: The plannedDeprecationDate property. - * - * @return the plannedDeprecationDate value. - */ - public String plannedDeprecationDate() { - return this.plannedDeprecationDate; - } - - /** - * Set the plannedDeprecationDate property: The plannedDeprecationDate property. - * - * @param plannedDeprecationDate the plannedDeprecationDate value to set. - * @return the SecurityAssessmentMetadataPropertiesResponse object itself. - */ - public SecurityAssessmentMetadataPropertiesResponse withPlannedDeprecationDate(String plannedDeprecationDate) { - this.plannedDeprecationDate = plannedDeprecationDate; - return this; - } - - /** - * Get the tactics property: The tactics property. - * - * @return the tactics value. - */ - public List tactics() { - return this.tactics; - } - - /** - * Set the tactics property: The tactics property. - * - * @param tactics the tactics value to set. - * @return the SecurityAssessmentMetadataPropertiesResponse object itself. - */ - public SecurityAssessmentMetadataPropertiesResponse withTactics(List tactics) { - this.tactics = tactics; - return this; - } - - /** - * Get the techniques property: The techniques property. - * - * @return the techniques value. - */ - public List techniques() { - return this.techniques; - } - - /** - * Set the techniques property: The techniques property. - * - * @param techniques the techniques value to set. - * @return the SecurityAssessmentMetadataPropertiesResponse object itself. - */ - public SecurityAssessmentMetadataPropertiesResponse withTechniques(List techniques) { - this.techniques = techniques; - return this; - } - - /** - * Get the policyDefinitionId property: Azure resource ID of the policy definition that turns this assessment - * calculation on. - * - * @return the policyDefinitionId value. - */ - @Override - public String policyDefinitionId() { - return this.policyDefinitionId; - } - - /** - * {@inheritDoc} - */ - @Override - public SecurityAssessmentMetadataPropertiesResponse withDisplayName(String displayName) { - super.withDisplayName(displayName); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SecurityAssessmentMetadataPropertiesResponse withDescription(String description) { - super.withDescription(description); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SecurityAssessmentMetadataPropertiesResponse withRemediationDescription(String remediationDescription) { - super.withRemediationDescription(remediationDescription); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SecurityAssessmentMetadataPropertiesResponse withCategories(List categories) { - super.withCategories(categories); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SecurityAssessmentMetadataPropertiesResponse withSeverity(Severity severity) { - super.withSeverity(severity); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SecurityAssessmentMetadataPropertiesResponse withUserImpact(UserImpact userImpact) { - super.withUserImpact(userImpact); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SecurityAssessmentMetadataPropertiesResponse - withImplementationEffort(ImplementationEffort implementationEffort) { - super.withImplementationEffort(implementationEffort); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SecurityAssessmentMetadataPropertiesResponse withThreats(List threats) { - super.withThreats(threats); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SecurityAssessmentMetadataPropertiesResponse withPreview(Boolean preview) { - super.withPreview(preview); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SecurityAssessmentMetadataPropertiesResponse withAssessmentType(AssessmentType assessmentType) { - super.withAssessmentType(assessmentType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SecurityAssessmentMetadataPropertiesResponse - withPartnerData(SecurityAssessmentMetadataPartnerData partnerData) { - super.withPartnerData(partnerData); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (publishDates() != null) { - publishDates().validate(); - } - if (displayName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property displayName in model SecurityAssessmentMetadataPropertiesResponse")); - } - if (severity() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property severity in model SecurityAssessmentMetadataPropertiesResponse")); - } - if (assessmentType() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property assessmentType in model SecurityAssessmentMetadataPropertiesResponse")); - } - if (partnerData() != null) { - partnerData().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecurityAssessmentMetadataPropertiesResponse.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("displayName", displayName()); - jsonWriter.writeStringField("severity", severity() == null ? null : severity().toString()); - jsonWriter.writeStringField("assessmentType", assessmentType() == null ? null : assessmentType().toString()); - jsonWriter.writeStringField("description", description()); - jsonWriter.writeStringField("remediationDescription", remediationDescription()); - jsonWriter.writeArrayField("categories", categories(), - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeStringField("userImpact", userImpact() == null ? null : userImpact().toString()); - jsonWriter.writeStringField("implementationEffort", - implementationEffort() == null ? null : implementationEffort().toString()); - jsonWriter.writeArrayField("threats", threats(), - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeBooleanField("preview", preview()); - jsonWriter.writeJsonField("partnerData", partnerData()); - jsonWriter.writeJsonField("publishDates", this.publishDates); - jsonWriter.writeStringField("plannedDeprecationDate", this.plannedDeprecationDate); - jsonWriter.writeArrayField("tactics", this.tactics, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeArrayField("techniques", this.techniques, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecurityAssessmentMetadataPropertiesResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityAssessmentMetadataPropertiesResponse 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 SecurityAssessmentMetadataPropertiesResponse. - */ - public static SecurityAssessmentMetadataPropertiesResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityAssessmentMetadataPropertiesResponse deserializedSecurityAssessmentMetadataPropertiesResponse - = new SecurityAssessmentMetadataPropertiesResponse(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("displayName".equals(fieldName)) { - deserializedSecurityAssessmentMetadataPropertiesResponse.withDisplayName(reader.getString()); - } else if ("severity".equals(fieldName)) { - deserializedSecurityAssessmentMetadataPropertiesResponse - .withSeverity(Severity.fromString(reader.getString())); - } else if ("assessmentType".equals(fieldName)) { - deserializedSecurityAssessmentMetadataPropertiesResponse - .withAssessmentType(AssessmentType.fromString(reader.getString())); - } else if ("policyDefinitionId".equals(fieldName)) { - deserializedSecurityAssessmentMetadataPropertiesResponse.policyDefinitionId = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedSecurityAssessmentMetadataPropertiesResponse.withDescription(reader.getString()); - } else if ("remediationDescription".equals(fieldName)) { - deserializedSecurityAssessmentMetadataPropertiesResponse - .withRemediationDescription(reader.getString()); - } else if ("categories".equals(fieldName)) { - List categories - = reader.readArray(reader1 -> Categories.fromString(reader1.getString())); - deserializedSecurityAssessmentMetadataPropertiesResponse.withCategories(categories); - } else if ("userImpact".equals(fieldName)) { - deserializedSecurityAssessmentMetadataPropertiesResponse - .withUserImpact(UserImpact.fromString(reader.getString())); - } else if ("implementationEffort".equals(fieldName)) { - deserializedSecurityAssessmentMetadataPropertiesResponse - .withImplementationEffort(ImplementationEffort.fromString(reader.getString())); - } else if ("threats".equals(fieldName)) { - List threats = reader.readArray(reader1 -> Threats.fromString(reader1.getString())); - deserializedSecurityAssessmentMetadataPropertiesResponse.withThreats(threats); - } else if ("preview".equals(fieldName)) { - deserializedSecurityAssessmentMetadataPropertiesResponse - .withPreview(reader.getNullable(JsonReader::getBoolean)); - } else if ("partnerData".equals(fieldName)) { - deserializedSecurityAssessmentMetadataPropertiesResponse - .withPartnerData(SecurityAssessmentMetadataPartnerData.fromJson(reader)); - } else if ("publishDates".equals(fieldName)) { - deserializedSecurityAssessmentMetadataPropertiesResponse.publishDates - = SecurityAssessmentMetadataPropertiesResponsePublishDates.fromJson(reader); - } else if ("plannedDeprecationDate".equals(fieldName)) { - deserializedSecurityAssessmentMetadataPropertiesResponse.plannedDeprecationDate - = reader.getString(); - } else if ("tactics".equals(fieldName)) { - List tactics = reader.readArray(reader1 -> Tactics.fromString(reader1.getString())); - deserializedSecurityAssessmentMetadataPropertiesResponse.tactics = tactics; - } else if ("techniques".equals(fieldName)) { - List techniques - = reader.readArray(reader1 -> Techniques.fromString(reader1.getString())); - deserializedSecurityAssessmentMetadataPropertiesResponse.techniques = techniques; - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityAssessmentMetadataPropertiesResponse; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataResponseInner.java deleted file mode 100644 index 46eff2c6f114..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataResponseInner.java +++ /dev/null @@ -1,527 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.AssessmentType; -import com.azure.resourcemanager.security.models.Categories; -import com.azure.resourcemanager.security.models.ImplementationEffort; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPartnerData; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates; -import com.azure.resourcemanager.security.models.Severity; -import com.azure.resourcemanager.security.models.Tactics; -import com.azure.resourcemanager.security.models.Techniques; -import com.azure.resourcemanager.security.models.Threats; -import com.azure.resourcemanager.security.models.UserImpact; -import java.io.IOException; -import java.util.List; - -/** - * Security assessment metadata response. - */ -@Fluent -public final class SecurityAssessmentMetadataResponseInner extends ProxyResource { - /* - * Describes properties of an assessment metadata response. - */ - private SecurityAssessmentMetadataPropertiesResponse 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 SecurityAssessmentMetadataResponseInner class. - */ - public SecurityAssessmentMetadataResponseInner() { - } - - /** - * Get the innerProperties property: Describes properties of an assessment metadata response. - * - * @return the innerProperties value. - */ - private SecurityAssessmentMetadataPropertiesResponse 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 publishDates property: The publishDates property. - * - * @return the publishDates value. - */ - public SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates() { - return this.innerProperties() == null ? null : this.innerProperties().publishDates(); - } - - /** - * Set the publishDates property: The publishDates property. - * - * @param publishDates the publishDates value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner - withPublishDates(SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withPublishDates(publishDates); - return this; - } - - /** - * Get the plannedDeprecationDate property: The plannedDeprecationDate property. - * - * @return the plannedDeprecationDate value. - */ - public String plannedDeprecationDate() { - return this.innerProperties() == null ? null : this.innerProperties().plannedDeprecationDate(); - } - - /** - * Set the plannedDeprecationDate property: The plannedDeprecationDate property. - * - * @param plannedDeprecationDate the plannedDeprecationDate value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withPlannedDeprecationDate(String plannedDeprecationDate) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withPlannedDeprecationDate(plannedDeprecationDate); - return this; - } - - /** - * Get the tactics property: The tactics property. - * - * @return the tactics value. - */ - public List tactics() { - return this.innerProperties() == null ? null : this.innerProperties().tactics(); - } - - /** - * Set the tactics property: The tactics property. - * - * @param tactics the tactics value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withTactics(List tactics) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withTactics(tactics); - return this; - } - - /** - * Get the techniques property: The techniques property. - * - * @return the techniques value. - */ - public List techniques() { - return this.innerProperties() == null ? null : this.innerProperties().techniques(); - } - - /** - * Set the techniques property: The techniques property. - * - * @param techniques the techniques value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withTechniques(List techniques) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withTechniques(techniques); - return this; - } - - /** - * Get the displayName property: User friendly display name of the assessment. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: User friendly display name of the assessment. - * - * @param displayName the displayName value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the policyDefinitionId property: Azure resource ID of the policy definition that turns this assessment - * calculation on. - * - * @return the policyDefinitionId value. - */ - public String policyDefinitionId() { - return this.innerProperties() == null ? null : this.innerProperties().policyDefinitionId(); - } - - /** - * Get the description property: Human readable description of the assessment. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: Human readable description of the assessment. - * - * @param description the description value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the remediationDescription property: Human readable description of what you should do to mitigate this - * security issue. - * - * @return the remediationDescription value. - */ - public String remediationDescription() { - return this.innerProperties() == null ? null : this.innerProperties().remediationDescription(); - } - - /** - * Set the remediationDescription property: Human readable description of what you should do to mitigate this - * security issue. - * - * @param remediationDescription the remediationDescription value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withRemediationDescription(String remediationDescription) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withRemediationDescription(remediationDescription); - return this; - } - - /** - * Get the categories property: The categories property. - * - * @return the categories value. - */ - public List categories() { - return this.innerProperties() == null ? null : this.innerProperties().categories(); - } - - /** - * Set the categories property: The categories property. - * - * @param categories the categories value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withCategories(List categories) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withCategories(categories); - return this; - } - - /** - * Get the severity property: The severity level of the assessment. - * - * @return the severity value. - */ - public Severity severity() { - return this.innerProperties() == null ? null : this.innerProperties().severity(); - } - - /** - * Set the severity property: The severity level of the assessment. - * - * @param severity the severity value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withSeverity(Severity severity) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withSeverity(severity); - return this; - } - - /** - * Get the userImpact property: The user impact of the assessment. - * - * @return the userImpact value. - */ - public UserImpact userImpact() { - return this.innerProperties() == null ? null : this.innerProperties().userImpact(); - } - - /** - * Set the userImpact property: The user impact of the assessment. - * - * @param userImpact the userImpact value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withUserImpact(UserImpact userImpact) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withUserImpact(userImpact); - return this; - } - - /** - * Get the implementationEffort property: The implementation effort required to remediate this assessment. - * - * @return the implementationEffort value. - */ - public ImplementationEffort implementationEffort() { - return this.innerProperties() == null ? null : this.innerProperties().implementationEffort(); - } - - /** - * Set the implementationEffort property: The implementation effort required to remediate this assessment. - * - * @param implementationEffort the implementationEffort value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withImplementationEffort(ImplementationEffort implementationEffort) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withImplementationEffort(implementationEffort); - return this; - } - - /** - * Get the threats property: The threats property. - * - * @return the threats value. - */ - public List threats() { - return this.innerProperties() == null ? null : this.innerProperties().threats(); - } - - /** - * Set the threats property: The threats property. - * - * @param threats the threats value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withThreats(List threats) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withThreats(threats); - return this; - } - - /** - * Get the preview property: True if this assessment is in preview release status. - * - * @return the preview value. - */ - public Boolean preview() { - return this.innerProperties() == null ? null : this.innerProperties().preview(); - } - - /** - * Set the preview property: True if this assessment is in preview release status. - * - * @param preview the preview value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withPreview(Boolean preview) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withPreview(preview); - return this; - } - - /** - * Get the assessmentType property: BuiltIn if the assessment based on built-in Azure Policy definition, Custom if - * the assessment based on custom Azure Policy definition. - * - * @return the assessmentType value. - */ - public AssessmentType assessmentType() { - return this.innerProperties() == null ? null : this.innerProperties().assessmentType(); - } - - /** - * Set the assessmentType property: BuiltIn if the assessment based on built-in Azure Policy definition, Custom if - * the assessment based on custom Azure Policy definition. - * - * @param assessmentType the assessmentType value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withAssessmentType(AssessmentType assessmentType) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withAssessmentType(assessmentType); - return this; - } - - /** - * Get the partnerData property: Describes the partner that created the assessment. - * - * @return the partnerData value. - */ - public SecurityAssessmentMetadataPartnerData partnerData() { - return this.innerProperties() == null ? null : this.innerProperties().partnerData(); - } - - /** - * Set the partnerData property: Describes the partner that created the assessment. - * - * @param partnerData the partnerData value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withPartnerData(SecurityAssessmentMetadataPartnerData partnerData) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withPartnerData(partnerData); - 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 SecurityAssessmentMetadataResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityAssessmentMetadataResponseInner 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 SecurityAssessmentMetadataResponseInner. - */ - public static SecurityAssessmentMetadataResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityAssessmentMetadataResponseInner deserializedSecurityAssessmentMetadataResponseInner - = new SecurityAssessmentMetadataResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSecurityAssessmentMetadataResponseInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSecurityAssessmentMetadataResponseInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSecurityAssessmentMetadataResponseInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSecurityAssessmentMetadataResponseInner.innerProperties - = SecurityAssessmentMetadataPropertiesResponse.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSecurityAssessmentMetadataResponseInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityAssessmentMetadataResponseInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentProperties.java deleted file mode 100644 index 2a6ab3e8128e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentProperties.java +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -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.security.models.AssessmentLinks; -import com.azure.resourcemanager.security.models.AssessmentStatus; -import com.azure.resourcemanager.security.models.ResourceDetails; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataProperties; -import com.azure.resourcemanager.security.models.SecurityAssessmentPartnerData; -import com.azure.resourcemanager.security.models.SecurityAssessmentPropertiesBase; -import com.azure.resourcemanager.security.models.SecurityAssessmentPropertiesBaseRisk; -import java.io.IOException; -import java.util.Map; - -/** - * Describes properties of an assessment. - */ -@Fluent -public final class SecurityAssessmentProperties extends SecurityAssessmentPropertiesBase { - /* - * The result of the assessment - */ - private AssessmentStatus status; - - /* - * Links relevant to the assessment - */ - private AssessmentLinks links; - - /* - * User friendly display name of the assessment - */ - private String displayName; - - /** - * Creates an instance of SecurityAssessmentProperties class. - */ - public SecurityAssessmentProperties() { - } - - /** - * Get the status property: The result of the assessment. - * - * @return the status value. - */ - public AssessmentStatus status() { - return this.status; - } - - /** - * Set the status property: The result of the assessment. - * - * @param status the status value to set. - * @return the SecurityAssessmentProperties object itself. - */ - public SecurityAssessmentProperties withStatus(AssessmentStatus status) { - this.status = status; - return this; - } - - /** - * Get the links property: Links relevant to the assessment. - * - * @return the links value. - */ - @Override - public AssessmentLinks links() { - return this.links; - } - - /** - * Get the displayName property: User friendly display name of the assessment. - * - * @return the displayName value. - */ - @Override - public String displayName() { - return this.displayName; - } - - /** - * {@inheritDoc} - */ - @Override - public SecurityAssessmentProperties withRisk(SecurityAssessmentPropertiesBaseRisk risk) { - super.withRisk(risk); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SecurityAssessmentProperties withResourceDetails(ResourceDetails resourceDetails) { - super.withResourceDetails(resourceDetails); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SecurityAssessmentProperties withAdditionalData(Map additionalData) { - super.withAdditionalData(additionalData); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SecurityAssessmentProperties withMetadata(SecurityAssessmentMetadataProperties metadata) { - super.withMetadata(metadata); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SecurityAssessmentProperties withPartnersData(SecurityAssessmentPartnerData partnersData) { - super.withPartnersData(partnersData); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (status() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property status in model SecurityAssessmentProperties")); - } else { - status().validate(); - } - if (risk() != null) { - risk().validate(); - } - if (resourceDetails() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property resourceDetails in model SecurityAssessmentProperties")); - } else { - resourceDetails().validate(); - } - if (links() != null) { - links().validate(); - } - if (metadata() != null) { - metadata().validate(); - } - if (partnersData() != null) { - partnersData().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecurityAssessmentProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("resourceDetails", resourceDetails()); - jsonWriter.writeJsonField("risk", risk()); - jsonWriter.writeMapField("additionalData", additionalData(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("metadata", metadata()); - jsonWriter.writeJsonField("partnersData", partnersData()); - jsonWriter.writeJsonField("status", this.status); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecurityAssessmentProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityAssessmentProperties 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 SecurityAssessmentProperties. - */ - public static SecurityAssessmentProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityAssessmentProperties deserializedSecurityAssessmentProperties = new SecurityAssessmentProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceDetails".equals(fieldName)) { - deserializedSecurityAssessmentProperties.withResourceDetails(ResourceDetails.fromJson(reader)); - } else if ("risk".equals(fieldName)) { - deserializedSecurityAssessmentProperties - .withRisk(SecurityAssessmentPropertiesBaseRisk.fromJson(reader)); - } else if ("displayName".equals(fieldName)) { - deserializedSecurityAssessmentProperties.displayName = reader.getString(); - } else if ("additionalData".equals(fieldName)) { - Map additionalData = reader.readMap(reader1 -> reader1.getString()); - deserializedSecurityAssessmentProperties.withAdditionalData(additionalData); - } else if ("links".equals(fieldName)) { - deserializedSecurityAssessmentProperties.links = AssessmentLinks.fromJson(reader); - } else if ("metadata".equals(fieldName)) { - deserializedSecurityAssessmentProperties - .withMetadata(SecurityAssessmentMetadataProperties.fromJson(reader)); - } else if ("partnersData".equals(fieldName)) { - deserializedSecurityAssessmentProperties - .withPartnersData(SecurityAssessmentPartnerData.fromJson(reader)); - } else if ("status".equals(fieldName)) { - deserializedSecurityAssessmentProperties.status = AssessmentStatus.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityAssessmentProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentPropertiesResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentPropertiesResponse.java deleted file mode 100644 index 79a7a95f12d5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentPropertiesResponse.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -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.security.models.AssessmentLinks; -import com.azure.resourcemanager.security.models.AssessmentStatusResponse; -import com.azure.resourcemanager.security.models.ResourceDetails; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataProperties; -import com.azure.resourcemanager.security.models.SecurityAssessmentPartnerData; -import com.azure.resourcemanager.security.models.SecurityAssessmentPropertiesBase; -import com.azure.resourcemanager.security.models.SecurityAssessmentPropertiesBaseRisk; -import java.io.IOException; -import java.util.Map; - -/** - * Describes properties of an assessment. - */ -@Immutable -public final class SecurityAssessmentPropertiesResponse extends SecurityAssessmentPropertiesBase { - /* - * The result of the assessment - */ - private AssessmentStatusResponse status; - - /* - * Links relevant to the assessment - */ - private AssessmentLinks links; - - /* - * User friendly display name of the assessment - */ - private String displayName; - - /** - * Creates an instance of SecurityAssessmentPropertiesResponse class. - */ - private SecurityAssessmentPropertiesResponse() { - } - - /** - * Get the status property: The result of the assessment. - * - * @return the status value. - */ - public AssessmentStatusResponse status() { - return this.status; - } - - /** - * Get the links property: Links relevant to the assessment. - * - * @return the links value. - */ - @Override - public AssessmentLinks links() { - return this.links; - } - - /** - * Get the displayName property: User friendly display name of the assessment. - * - * @return the displayName value. - */ - @Override - public String displayName() { - return this.displayName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (status() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property status in model SecurityAssessmentPropertiesResponse")); - } else { - status().validate(); - } - if (risk() != null) { - risk().validate(); - } - if (resourceDetails() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property resourceDetails in model SecurityAssessmentPropertiesResponse")); - } else { - resourceDetails().validate(); - } - if (links() != null) { - links().validate(); - } - if (metadata() != null) { - metadata().validate(); - } - if (partnersData() != null) { - partnersData().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecurityAssessmentPropertiesResponse.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("resourceDetails", resourceDetails()); - jsonWriter.writeJsonField("risk", risk()); - jsonWriter.writeMapField("additionalData", additionalData(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("metadata", metadata()); - jsonWriter.writeJsonField("partnersData", partnersData()); - jsonWriter.writeJsonField("status", this.status); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecurityAssessmentPropertiesResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityAssessmentPropertiesResponse 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 SecurityAssessmentPropertiesResponse. - */ - public static SecurityAssessmentPropertiesResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityAssessmentPropertiesResponse deserializedSecurityAssessmentPropertiesResponse - = new SecurityAssessmentPropertiesResponse(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("resourceDetails".equals(fieldName)) { - deserializedSecurityAssessmentPropertiesResponse - .withResourceDetails(ResourceDetails.fromJson(reader)); - } else if ("risk".equals(fieldName)) { - deserializedSecurityAssessmentPropertiesResponse - .withRisk(SecurityAssessmentPropertiesBaseRisk.fromJson(reader)); - } else if ("displayName".equals(fieldName)) { - deserializedSecurityAssessmentPropertiesResponse.displayName = reader.getString(); - } else if ("additionalData".equals(fieldName)) { - Map additionalData = reader.readMap(reader1 -> reader1.getString()); - deserializedSecurityAssessmentPropertiesResponse.withAdditionalData(additionalData); - } else if ("links".equals(fieldName)) { - deserializedSecurityAssessmentPropertiesResponse.links = AssessmentLinks.fromJson(reader); - } else if ("metadata".equals(fieldName)) { - deserializedSecurityAssessmentPropertiesResponse - .withMetadata(SecurityAssessmentMetadataProperties.fromJson(reader)); - } else if ("partnersData".equals(fieldName)) { - deserializedSecurityAssessmentPropertiesResponse - .withPartnersData(SecurityAssessmentPartnerData.fromJson(reader)); - } else if ("status".equals(fieldName)) { - deserializedSecurityAssessmentPropertiesResponse.status = AssessmentStatusResponse.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityAssessmentPropertiesResponse; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentResponseInner.java deleted file mode 100644 index 07fc5bed3e84..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentResponseInner.java +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.AssessmentLinks; -import com.azure.resourcemanager.security.models.AssessmentStatusResponse; -import com.azure.resourcemanager.security.models.ResourceDetails; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataProperties; -import com.azure.resourcemanager.security.models.SecurityAssessmentPartnerData; -import com.azure.resourcemanager.security.models.SecurityAssessmentPropertiesBaseRisk; -import java.io.IOException; -import java.util.Map; - -/** - * Security assessment on a resource - response format. - */ -@Immutable -public final class SecurityAssessmentResponseInner extends ProxyResource { - /* - * Describes properties of an assessment. - */ - private SecurityAssessmentPropertiesResponse 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 SecurityAssessmentResponseInner class. - */ - private SecurityAssessmentResponseInner() { - } - - /** - * Get the innerProperties property: Describes properties of an assessment. - * - * @return the innerProperties value. - */ - private SecurityAssessmentPropertiesResponse 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 status property: The result of the assessment. - * - * @return the status value. - */ - public AssessmentStatusResponse status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the risk property: External model of risk result. - * - * @return the risk value. - */ - public SecurityAssessmentPropertiesBaseRisk risk() { - return this.innerProperties() == null ? null : this.innerProperties().risk(); - } - - /** - * Get the resourceDetails property: Details of the resource that was assessed. - * - * @return the resourceDetails value. - */ - public ResourceDetails resourceDetails() { - return this.innerProperties() == null ? null : this.innerProperties().resourceDetails(); - } - - /** - * Get the displayName property: User friendly display name of the assessment. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the additionalData property: Additional data regarding the assessment. - * - * @return the additionalData value. - */ - public Map additionalData() { - return this.innerProperties() == null ? null : this.innerProperties().additionalData(); - } - - /** - * Get the links property: Links relevant to the assessment. - * - * @return the links value. - */ - public AssessmentLinks links() { - return this.innerProperties() == null ? null : this.innerProperties().links(); - } - - /** - * Get the metadata property: Describes properties of an assessment metadata. - * - * @return the metadata value. - */ - public SecurityAssessmentMetadataProperties metadata() { - return this.innerProperties() == null ? null : this.innerProperties().metadata(); - } - - /** - * Get the partnersData property: Data regarding 3rd party partner integration. - * - * @return the partnersData value. - */ - public SecurityAssessmentPartnerData partnersData() { - return this.innerProperties() == null ? null : this.innerProperties().partnersData(); - } - - /** - * 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 SecurityAssessmentResponseInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityAssessmentResponseInner 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 SecurityAssessmentResponseInner. - */ - public static SecurityAssessmentResponseInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityAssessmentResponseInner deserializedSecurityAssessmentResponseInner - = new SecurityAssessmentResponseInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSecurityAssessmentResponseInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSecurityAssessmentResponseInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSecurityAssessmentResponseInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSecurityAssessmentResponseInner.innerProperties - = SecurityAssessmentPropertiesResponse.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSecurityAssessmentResponseInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityAssessmentResponseInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorInner.java deleted file mode 100644 index d13272e27d3c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorInner.java +++ /dev/null @@ -1,377 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.CloudName; -import com.azure.resourcemanager.security.models.CloudOffering; -import com.azure.resourcemanager.security.models.EnvironmentData; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** - * The security connector resource. - */ -@Fluent -public final class SecurityConnectorInner extends ProxyResource { - /* - * Security connector data - */ - private SecurityConnectorProperties innerProperties; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The geo-location where the resource lives - */ - private String location; - - /* - * Kind of the resource - */ - private String kind; - - /* - * Entity tag is used for comparing two or more entities from the same requested resource. - */ - private String etag; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of SecurityConnectorInner class. - */ - public SecurityConnectorInner() { - } - - /** - * Get the innerProperties property: Security connector data. - * - * @return the innerProperties value. - */ - private SecurityConnectorProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the SecurityConnectorInner object itself. - */ - public SecurityConnectorInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The geo-location where the resource lives. - * - * @param location the location value to set. - * @return the SecurityConnectorInner object itself. - */ - public SecurityConnectorInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the kind property: Kind of the resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: Kind of the resource. - * - * @param kind the kind value to set. - * @return the SecurityConnectorInner object itself. - */ - public SecurityConnectorInner withKind(String kind) { - this.kind = kind; - return this; - } - - /** - * Get the etag property: Entity tag is used for comparing two or more entities from the same requested resource. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Entity tag is used for comparing two or more entities from the same requested resource. - * - * @param etag the etag value to set. - * @return the SecurityConnectorInner object itself. - */ - public SecurityConnectorInner withEtag(String etag) { - this.etag = etag; - 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; - } - - /** - * Get the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of AWS connector, - * project number in case of GCP connector). - * - * @return the hierarchyIdentifier value. - */ - public String hierarchyIdentifier() { - return this.innerProperties() == null ? null : this.innerProperties().hierarchyIdentifier(); - } - - /** - * Set the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of AWS connector, - * project number in case of GCP connector). - * - * @param hierarchyIdentifier the hierarchyIdentifier value to set. - * @return the SecurityConnectorInner object itself. - */ - public SecurityConnectorInner withHierarchyIdentifier(String hierarchyIdentifier) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityConnectorProperties(); - } - this.innerProperties().withHierarchyIdentifier(hierarchyIdentifier); - return this; - } - - /** - * Get the hierarchyIdentifierTrialEndDate property: The date on which the trial period will end, if applicable. - * Trial period exists for 30 days after upgrading to payed offerings. - * - * @return the hierarchyIdentifierTrialEndDate value. - */ - public OffsetDateTime hierarchyIdentifierTrialEndDate() { - return this.innerProperties() == null ? null : this.innerProperties().hierarchyIdentifierTrialEndDate(); - } - - /** - * Get the environmentName property: The multi cloud resource's cloud name. - * - * @return the environmentName value. - */ - public CloudName environmentName() { - return this.innerProperties() == null ? null : this.innerProperties().environmentName(); - } - - /** - * Set the environmentName property: The multi cloud resource's cloud name. - * - * @param environmentName the environmentName value to set. - * @return the SecurityConnectorInner object itself. - */ - public SecurityConnectorInner withEnvironmentName(CloudName environmentName) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityConnectorProperties(); - } - this.innerProperties().withEnvironmentName(environmentName); - return this; - } - - /** - * Get the offerings property: A collection of offerings for the security connector. - * - * @return the offerings value. - */ - public List offerings() { - return this.innerProperties() == null ? null : this.innerProperties().offerings(); - } - - /** - * Set the offerings property: A collection of offerings for the security connector. - * - * @param offerings the offerings value to set. - * @return the SecurityConnectorInner object itself. - */ - public SecurityConnectorInner withOfferings(List offerings) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityConnectorProperties(); - } - this.innerProperties().withOfferings(offerings); - return this; - } - - /** - * Get the environmentData property: The security connector environment data. - * - * @return the environmentData value. - */ - public EnvironmentData environmentData() { - return this.innerProperties() == null ? null : this.innerProperties().environmentData(); - } - - /** - * Set the environmentData property: The security connector environment data. - * - * @param environmentData the environmentData value to set. - * @return the SecurityConnectorInner object itself. - */ - public SecurityConnectorInner withEnvironmentData(EnvironmentData environmentData) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityConnectorProperties(); - } - this.innerProperties().withEnvironmentData(environmentData); - 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); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeStringField("kind", this.kind); - jsonWriter.writeStringField("etag", this.etag); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecurityConnectorInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityConnectorInner 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 SecurityConnectorInner. - */ - public static SecurityConnectorInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityConnectorInner deserializedSecurityConnectorInner = new SecurityConnectorInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSecurityConnectorInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSecurityConnectorInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSecurityConnectorInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSecurityConnectorInner.innerProperties = SecurityConnectorProperties.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedSecurityConnectorInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedSecurityConnectorInner.location = reader.getString(); - } else if ("kind".equals(fieldName)) { - deserializedSecurityConnectorInner.kind = reader.getString(); - } else if ("etag".equals(fieldName)) { - deserializedSecurityConnectorInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedSecurityConnectorInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityConnectorInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorProperties.java deleted file mode 100644 index 6c9e114d2ca7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorProperties.java +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.CloudOffering; -import com.azure.resourcemanager.security.models.EnvironmentData; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * A set of properties that defines the security connector configuration. - */ -@Fluent -public final class SecurityConnectorProperties implements JsonSerializable { - /* - * The multi cloud resource identifier (account id in case of AWS connector, project number in case of GCP - * connector). - */ - private String hierarchyIdentifier; - - /* - * The date on which the trial period will end, if applicable. Trial period exists for 30 days after upgrading to - * payed offerings. - */ - private OffsetDateTime hierarchyIdentifierTrialEndDate; - - /* - * The multi cloud resource's cloud name. - */ - private CloudName environmentName; - - /* - * A collection of offerings for the security connector. - */ - private List offerings; - - /* - * The security connector environment data. - */ - private EnvironmentData environmentData; - - /** - * Creates an instance of SecurityConnectorProperties class. - */ - public SecurityConnectorProperties() { - } - - /** - * Get the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of AWS connector, - * project number in case of GCP connector). - * - * @return the hierarchyIdentifier value. - */ - public String hierarchyIdentifier() { - return this.hierarchyIdentifier; - } - - /** - * Set the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of AWS connector, - * project number in case of GCP connector). - * - * @param hierarchyIdentifier the hierarchyIdentifier value to set. - * @return the SecurityConnectorProperties object itself. - */ - public SecurityConnectorProperties withHierarchyIdentifier(String hierarchyIdentifier) { - this.hierarchyIdentifier = hierarchyIdentifier; - return this; - } - - /** - * Get the hierarchyIdentifierTrialEndDate property: The date on which the trial period will end, if applicable. - * Trial period exists for 30 days after upgrading to payed offerings. - * - * @return the hierarchyIdentifierTrialEndDate value. - */ - public OffsetDateTime hierarchyIdentifierTrialEndDate() { - return this.hierarchyIdentifierTrialEndDate; - } - - /** - * Get the environmentName property: The multi cloud resource's cloud name. - * - * @return the environmentName value. - */ - public CloudName environmentName() { - return this.environmentName; - } - - /** - * Set the environmentName property: The multi cloud resource's cloud name. - * - * @param environmentName the environmentName value to set. - * @return the SecurityConnectorProperties object itself. - */ - public SecurityConnectorProperties withEnvironmentName(CloudName environmentName) { - this.environmentName = environmentName; - return this; - } - - /** - * Get the offerings property: A collection of offerings for the security connector. - * - * @return the offerings value. - */ - public List offerings() { - return this.offerings; - } - - /** - * Set the offerings property: A collection of offerings for the security connector. - * - * @param offerings the offerings value to set. - * @return the SecurityConnectorProperties object itself. - */ - public SecurityConnectorProperties withOfferings(List offerings) { - this.offerings = offerings; - return this; - } - - /** - * Get the environmentData property: The security connector environment data. - * - * @return the environmentData value. - */ - public EnvironmentData environmentData() { - return this.environmentData; - } - - /** - * Set the environmentData property: The security connector environment data. - * - * @param environmentData the environmentData value to set. - * @return the SecurityConnectorProperties object itself. - */ - public SecurityConnectorProperties withEnvironmentData(EnvironmentData environmentData) { - this.environmentData = environmentData; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (offerings() != null) { - offerings().forEach(e -> e.validate()); - } - if (environmentData() != null) { - environmentData().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("hierarchyIdentifier", this.hierarchyIdentifier); - jsonWriter.writeStringField("environmentName", - this.environmentName == null ? null : this.environmentName.toString()); - jsonWriter.writeArrayField("offerings", this.offerings, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("environmentData", this.environmentData); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecurityConnectorProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityConnectorProperties 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 SecurityConnectorProperties. - */ - public static SecurityConnectorProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityConnectorProperties deserializedSecurityConnectorProperties = new SecurityConnectorProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("hierarchyIdentifier".equals(fieldName)) { - deserializedSecurityConnectorProperties.hierarchyIdentifier = reader.getString(); - } else if ("hierarchyIdentifierTrialEndDate".equals(fieldName)) { - deserializedSecurityConnectorProperties.hierarchyIdentifierTrialEndDate = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("environmentName".equals(fieldName)) { - deserializedSecurityConnectorProperties.environmentName = CloudName.fromString(reader.getString()); - } else if ("offerings".equals(fieldName)) { - List offerings = reader.readArray(reader1 -> CloudOffering.fromJson(reader1)); - deserializedSecurityConnectorProperties.offerings = offerings; - } else if ("environmentData".equals(fieldName)) { - deserializedSecurityConnectorProperties.environmentData = EnvironmentData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityConnectorProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactInner.java deleted file mode 100644 index d21387605e15..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactInner.java +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.NotificationsSource; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; -import java.io.IOException; -import java.util.List; - -/** - * Contact details and configurations for notifications coming from Microsoft Defender for Cloud. - */ -@Fluent -public final class SecurityContactInner extends ProxyResource { - /* - * Security contact data - */ - private SecurityContactProperties 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 SecurityContactInner class. - */ - public SecurityContactInner() { - } - - /** - * Get the innerProperties property: Security contact data. - * - * @return the innerProperties value. - */ - private SecurityContactProperties 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 emails property: List of email addresses which will get notifications from Microsoft Defender for Cloud - * by the configurations defined in this security contact. - * - * @return the emails value. - */ - public String emails() { - return this.innerProperties() == null ? null : this.innerProperties().emails(); - } - - /** - * Set the emails property: List of email addresses which will get notifications from Microsoft Defender for Cloud - * by the configurations defined in this security contact. - * - * @param emails the emails value to set. - * @return the SecurityContactInner object itself. - */ - public SecurityContactInner withEmails(String emails) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityContactProperties(); - } - this.innerProperties().withEmails(emails); - return this; - } - - /** - * Get the phone property: The security contact's phone number. - * - * @return the phone value. - */ - public String phone() { - return this.innerProperties() == null ? null : this.innerProperties().phone(); - } - - /** - * Set the phone property: The security contact's phone number. - * - * @param phone the phone value to set. - * @return the SecurityContactInner object itself. - */ - public SecurityContactInner withPhone(String phone) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityContactProperties(); - } - this.innerProperties().withPhone(phone); - return this; - } - - /** - * Get the isEnabled property: Indicates whether the security contact is enabled. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().isEnabled(); - } - - /** - * Set the isEnabled property: Indicates whether the security contact is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the SecurityContactInner object itself. - */ - public SecurityContactInner withIsEnabled(Boolean isEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityContactProperties(); - } - this.innerProperties().withIsEnabled(isEnabled); - return this; - } - - /** - * Get the notificationsSources property: A collection of sources types which evaluate the email notification. - * - * @return the notificationsSources value. - */ - public List notificationsSources() { - return this.innerProperties() == null ? null : this.innerProperties().notificationsSources(); - } - - /** - * Set the notificationsSources property: A collection of sources types which evaluate the email notification. - * - * @param notificationsSources the notificationsSources value to set. - * @return the SecurityContactInner object itself. - */ - public SecurityContactInner withNotificationsSources(List notificationsSources) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityContactProperties(); - } - this.innerProperties().withNotificationsSources(notificationsSources); - return this; - } - - /** - * Get the notificationsByRole property: Defines whether to send email notifications from Microsoft Defender for - * Cloud to persons with specific RBAC roles on the subscription. - * - * @return the notificationsByRole value. - */ - public SecurityContactPropertiesNotificationsByRole notificationsByRole() { - return this.innerProperties() == null ? null : this.innerProperties().notificationsByRole(); - } - - /** - * Set the notificationsByRole property: Defines whether to send email notifications from Microsoft Defender for - * Cloud to persons with specific RBAC roles on the subscription. - * - * @param notificationsByRole the notificationsByRole value to set. - * @return the SecurityContactInner object itself. - */ - public SecurityContactInner - withNotificationsByRole(SecurityContactPropertiesNotificationsByRole notificationsByRole) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityContactProperties(); - } - this.innerProperties().withNotificationsByRole(notificationsByRole); - 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 SecurityContactInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityContactInner 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 SecurityContactInner. - */ - public static SecurityContactInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityContactInner deserializedSecurityContactInner = new SecurityContactInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSecurityContactInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSecurityContactInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSecurityContactInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSecurityContactInner.innerProperties = SecurityContactProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSecurityContactInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityContactInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactProperties.java deleted file mode 100644 index abc0cf7c232d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactProperties.java +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.NotificationsSource; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; -import java.io.IOException; -import java.util.List; - -/** - * Describes security contact properties. - */ -@Fluent -public final class SecurityContactProperties implements JsonSerializable { - /* - * List of email addresses which will get notifications from Microsoft Defender for Cloud by the configurations - * defined in this security contact. - */ - private String emails; - - /* - * The security contact's phone number - */ - private String phone; - - /* - * Indicates whether the security contact is enabled. - */ - private Boolean isEnabled; - - /* - * A collection of sources types which evaluate the email notification. - */ - private List notificationsSources; - - /* - * Defines whether to send email notifications from Microsoft Defender for Cloud to persons with specific RBAC roles - * on the subscription. - */ - private SecurityContactPropertiesNotificationsByRole notificationsByRole; - - /** - * Creates an instance of SecurityContactProperties class. - */ - public SecurityContactProperties() { - } - - /** - * Get the emails property: List of email addresses which will get notifications from Microsoft Defender for Cloud - * by the configurations defined in this security contact. - * - * @return the emails value. - */ - public String emails() { - return this.emails; - } - - /** - * Set the emails property: List of email addresses which will get notifications from Microsoft Defender for Cloud - * by the configurations defined in this security contact. - * - * @param emails the emails value to set. - * @return the SecurityContactProperties object itself. - */ - public SecurityContactProperties withEmails(String emails) { - this.emails = emails; - return this; - } - - /** - * Get the phone property: The security contact's phone number. - * - * @return the phone value. - */ - public String phone() { - return this.phone; - } - - /** - * Set the phone property: The security contact's phone number. - * - * @param phone the phone value to set. - * @return the SecurityContactProperties object itself. - */ - public SecurityContactProperties withPhone(String phone) { - this.phone = phone; - return this; - } - - /** - * Get the isEnabled property: Indicates whether the security contact is enabled. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.isEnabled; - } - - /** - * Set the isEnabled property: Indicates whether the security contact is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the SecurityContactProperties object itself. - */ - public SecurityContactProperties withIsEnabled(Boolean isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - /** - * Get the notificationsSources property: A collection of sources types which evaluate the email notification. - * - * @return the notificationsSources value. - */ - public List notificationsSources() { - return this.notificationsSources; - } - - /** - * Set the notificationsSources property: A collection of sources types which evaluate the email notification. - * - * @param notificationsSources the notificationsSources value to set. - * @return the SecurityContactProperties object itself. - */ - public SecurityContactProperties withNotificationsSources(List notificationsSources) { - this.notificationsSources = notificationsSources; - return this; - } - - /** - * Get the notificationsByRole property: Defines whether to send email notifications from Microsoft Defender for - * Cloud to persons with specific RBAC roles on the subscription. - * - * @return the notificationsByRole value. - */ - public SecurityContactPropertiesNotificationsByRole notificationsByRole() { - return this.notificationsByRole; - } - - /** - * Set the notificationsByRole property: Defines whether to send email notifications from Microsoft Defender for - * Cloud to persons with specific RBAC roles on the subscription. - * - * @param notificationsByRole the notificationsByRole value to set. - * @return the SecurityContactProperties object itself. - */ - public SecurityContactProperties - withNotificationsByRole(SecurityContactPropertiesNotificationsByRole notificationsByRole) { - this.notificationsByRole = notificationsByRole; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (notificationsSources() != null) { - notificationsSources().forEach(e -> e.validate()); - } - if (notificationsByRole() != null) { - notificationsByRole().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("emails", this.emails); - jsonWriter.writeStringField("phone", this.phone); - jsonWriter.writeBooleanField("isEnabled", this.isEnabled); - jsonWriter.writeArrayField("notificationsSources", this.notificationsSources, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("notificationsByRole", this.notificationsByRole); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecurityContactProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityContactProperties 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 SecurityContactProperties. - */ - public static SecurityContactProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityContactProperties deserializedSecurityContactProperties = new SecurityContactProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("emails".equals(fieldName)) { - deserializedSecurityContactProperties.emails = reader.getString(); - } else if ("phone".equals(fieldName)) { - deserializedSecurityContactProperties.phone = reader.getString(); - } else if ("isEnabled".equals(fieldName)) { - deserializedSecurityContactProperties.isEnabled = reader.getNullable(JsonReader::getBoolean); - } else if ("notificationsSources".equals(fieldName)) { - List notificationsSources - = reader.readArray(reader1 -> NotificationsSource.fromJson(reader1)); - deserializedSecurityContactProperties.notificationsSources = notificationsSources; - } else if ("notificationsByRole".equals(fieldName)) { - deserializedSecurityContactProperties.notificationsByRole - = SecurityContactPropertiesNotificationsByRole.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityContactProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityOperatorInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityOperatorInner.java deleted file mode 100644 index 3b1191c9544a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityOperatorInner.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.Identity; -import java.io.IOException; - -/** - * Security operator under a given subscription and pricing. - */ -@Immutable -public final class SecurityOperatorInner extends ProxyResource { - /* - * Identity for the resource. - */ - private Identity identity; - - /* - * 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 SecurityOperatorInner class. - */ - private SecurityOperatorInner() { - } - - /** - * Get the identity property: Identity for the resource. - * - * @return the identity value. - */ - public Identity identity() { - return this.identity; - } - - /** - * 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 (identity() != null) { - identity().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("identity", this.identity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecurityOperatorInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityOperatorInner 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 SecurityOperatorInner. - */ - public static SecurityOperatorInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityOperatorInner deserializedSecurityOperatorInner = new SecurityOperatorInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSecurityOperatorInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSecurityOperatorInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSecurityOperatorInner.type = reader.getString(); - } else if ("identity".equals(fieldName)) { - deserializedSecurityOperatorInner.identity = Identity.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSecurityOperatorInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityOperatorInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionInner.java deleted file mode 100644 index fb6ff37e99fa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionInner.java +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.ProvisioningState; -import com.azure.resourcemanager.security.models.SecurityFamily; -import java.io.IOException; - -/** - * Concrete proxy resource types can be created by aliasing this type using a specific property type. - */ -@Immutable -public final class SecuritySolutionInner extends ProxyResource { - /* - * The properties property. - */ - private SecuritySolutionProperties innerProperties; - - /* - * Location where the resource is stored - */ - private String location; - - /* - * 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 SecuritySolutionInner class. - */ - private SecuritySolutionInner() { - } - - /** - * Get the innerProperties property: The properties property. - * - * @return the innerProperties value. - */ - private SecuritySolutionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * 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 securityFamily property: The security family of the security solution. - * - * @return the securityFamily value. - */ - public SecurityFamily securityFamily() { - return this.innerProperties() == null ? null : this.innerProperties().securityFamily(); - } - - /** - * Get the provisioningState property: The security family provisioning State. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Get the template property: The security solutions' template. - * - * @return the template value. - */ - public String template() { - return this.innerProperties() == null ? null : this.innerProperties().template(); - } - - /** - * Get the protectionStatus property: The security solutions' status. - * - * @return the protectionStatus value. - */ - public String protectionStatus() { - return this.innerProperties() == null ? null : this.innerProperties().protectionStatus(); - } - - /** - * 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 SecuritySolutionInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecuritySolutionInner 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 SecuritySolutionInner. - */ - public static SecuritySolutionInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecuritySolutionInner deserializedSecuritySolutionInner = new SecuritySolutionInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSecuritySolutionInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSecuritySolutionInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSecuritySolutionInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedSecuritySolutionInner.location = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSecuritySolutionInner.innerProperties = SecuritySolutionProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSecuritySolutionInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecuritySolutionInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionProperties.java deleted file mode 100644 index 314e08b53ba4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionProperties.java +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -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.security.models.ProvisioningState; -import com.azure.resourcemanager.security.models.SecurityFamily; -import java.io.IOException; - -/** - * The SecuritySolutionProperties model. - */ -@Immutable -public final class SecuritySolutionProperties implements JsonSerializable { - /* - * The security family of the security solution - */ - private SecurityFamily securityFamily; - - /* - * The security family provisioning State - */ - private ProvisioningState provisioningState; - - /* - * The security solutions' template - */ - private String template; - - /* - * The security solutions' status - */ - private String protectionStatus; - - /** - * Creates an instance of SecuritySolutionProperties class. - */ - private SecuritySolutionProperties() { - } - - /** - * Get the securityFamily property: The security family of the security solution. - * - * @return the securityFamily value. - */ - public SecurityFamily securityFamily() { - return this.securityFamily; - } - - /** - * Get the provisioningState property: The security family provisioning State. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the template property: The security solutions' template. - * - * @return the template value. - */ - public String template() { - return this.template; - } - - /** - * Get the protectionStatus property: The security solutions' status. - * - * @return the protectionStatus value. - */ - public String protectionStatus() { - return this.protectionStatus; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (securityFamily() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property securityFamily in model SecuritySolutionProperties")); - } - if (provisioningState() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property provisioningState in model SecuritySolutionProperties")); - } - if (template() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property template in model SecuritySolutionProperties")); - } - if (protectionStatus() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property protectionStatus in model SecuritySolutionProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecuritySolutionProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("securityFamily", - this.securityFamily == null ? null : this.securityFamily.toString()); - jsonWriter.writeStringField("provisioningState", - this.provisioningState == null ? null : this.provisioningState.toString()); - jsonWriter.writeStringField("template", this.template); - jsonWriter.writeStringField("protectionStatus", this.protectionStatus); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecuritySolutionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecuritySolutionProperties 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 SecuritySolutionProperties. - */ - public static SecuritySolutionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecuritySolutionProperties deserializedSecuritySolutionProperties = new SecuritySolutionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("securityFamily".equals(fieldName)) { - deserializedSecuritySolutionProperties.securityFamily - = SecurityFamily.fromString(reader.getString()); - } else if ("provisioningState".equals(fieldName)) { - deserializedSecuritySolutionProperties.provisioningState - = ProvisioningState.fromString(reader.getString()); - } else if ("template".equals(fieldName)) { - deserializedSecuritySolutionProperties.template = reader.getString(); - } else if ("protectionStatus".equals(fieldName)) { - deserializedSecuritySolutionProperties.protectionStatus = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSecuritySolutionProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionsReferenceDataListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionsReferenceDataListInner.java deleted file mode 100644 index 15c3e5fd86d4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionsReferenceDataListInner.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceData; -import java.io.IOException; -import java.util.List; - -/** - * The SecuritySolutionsReferenceDataList model. - */ -@Immutable -public final class SecuritySolutionsReferenceDataListInner - implements JsonSerializable { - /* - * The value property. - */ - private List value; - - /** - * Creates an instance of SecuritySolutionsReferenceDataListInner class. - */ - private SecuritySolutionsReferenceDataListInner() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * 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 SecuritySolutionsReferenceDataListInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecuritySolutionsReferenceDataListInner 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 SecuritySolutionsReferenceDataListInner. - */ - public static SecuritySolutionsReferenceDataListInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecuritySolutionsReferenceDataListInner deserializedSecuritySolutionsReferenceDataListInner - = new SecuritySolutionsReferenceDataListInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SecuritySolutionsReferenceData.fromJson(reader1)); - deserializedSecuritySolutionsReferenceDataListInner.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedSecuritySolutionsReferenceDataListInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionsReferenceDataProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionsReferenceDataProperties.java deleted file mode 100644 index 34bac7684394..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionsReferenceDataProperties.java +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -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.security.models.SecurityFamily; -import java.io.IOException; - -/** - * The SecuritySolutionsReferenceDataProperties model. - */ -@Immutable -public final class SecuritySolutionsReferenceDataProperties - implements JsonSerializable { - /* - * The security family of the security solution - */ - private SecurityFamily securityFamily; - - /* - * The security solutions' vendor name - */ - private String alertVendorName; - - /* - * The security solutions' package info url - */ - private String packageInfoUrl; - - /* - * The security solutions' product name - */ - private String productName; - - /* - * The security solutions' publisher - */ - private String publisher; - - /* - * The security solutions' publisher display name - */ - private String publisherDisplayName; - - /* - * The security solutions' template - */ - private String template; - - /** - * Creates an instance of SecuritySolutionsReferenceDataProperties class. - */ - private SecuritySolutionsReferenceDataProperties() { - } - - /** - * Get the securityFamily property: The security family of the security solution. - * - * @return the securityFamily value. - */ - public SecurityFamily securityFamily() { - return this.securityFamily; - } - - /** - * Get the alertVendorName property: The security solutions' vendor name. - * - * @return the alertVendorName value. - */ - public String alertVendorName() { - return this.alertVendorName; - } - - /** - * Get the packageInfoUrl property: The security solutions' package info url. - * - * @return the packageInfoUrl value. - */ - public String packageInfoUrl() { - return this.packageInfoUrl; - } - - /** - * Get the productName property: The security solutions' product name. - * - * @return the productName value. - */ - public String productName() { - return this.productName; - } - - /** - * Get the publisher property: The security solutions' publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Get the publisherDisplayName property: The security solutions' publisher display name. - * - * @return the publisherDisplayName value. - */ - public String publisherDisplayName() { - return this.publisherDisplayName; - } - - /** - * Get the template property: The security solutions' template. - * - * @return the template value. - */ - public String template() { - return this.template; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (securityFamily() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property securityFamily in model SecuritySolutionsReferenceDataProperties")); - } - if (alertVendorName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property alertVendorName in model SecuritySolutionsReferenceDataProperties")); - } - if (packageInfoUrl() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property packageInfoUrl in model SecuritySolutionsReferenceDataProperties")); - } - if (productName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property productName in model SecuritySolutionsReferenceDataProperties")); - } - if (publisher() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property publisher in model SecuritySolutionsReferenceDataProperties")); - } - if (publisherDisplayName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property publisherDisplayName in model SecuritySolutionsReferenceDataProperties")); - } - if (template() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property template in model SecuritySolutionsReferenceDataProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecuritySolutionsReferenceDataProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("securityFamily", - this.securityFamily == null ? null : this.securityFamily.toString()); - jsonWriter.writeStringField("alertVendorName", this.alertVendorName); - jsonWriter.writeStringField("packageInfoUrl", this.packageInfoUrl); - jsonWriter.writeStringField("productName", this.productName); - jsonWriter.writeStringField("publisher", this.publisher); - jsonWriter.writeStringField("publisherDisplayName", this.publisherDisplayName); - jsonWriter.writeStringField("template", this.template); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecuritySolutionsReferenceDataProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecuritySolutionsReferenceDataProperties 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 SecuritySolutionsReferenceDataProperties. - */ - public static SecuritySolutionsReferenceDataProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecuritySolutionsReferenceDataProperties deserializedSecuritySolutionsReferenceDataProperties - = new SecuritySolutionsReferenceDataProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("securityFamily".equals(fieldName)) { - deserializedSecuritySolutionsReferenceDataProperties.securityFamily - = SecurityFamily.fromString(reader.getString()); - } else if ("alertVendorName".equals(fieldName)) { - deserializedSecuritySolutionsReferenceDataProperties.alertVendorName = reader.getString(); - } else if ("packageInfoUrl".equals(fieldName)) { - deserializedSecuritySolutionsReferenceDataProperties.packageInfoUrl = reader.getString(); - } else if ("productName".equals(fieldName)) { - deserializedSecuritySolutionsReferenceDataProperties.productName = reader.getString(); - } else if ("publisher".equals(fieldName)) { - deserializedSecuritySolutionsReferenceDataProperties.publisher = reader.getString(); - } else if ("publisherDisplayName".equals(fieldName)) { - deserializedSecuritySolutionsReferenceDataProperties.publisherDisplayName = reader.getString(); - } else if ("template".equals(fieldName)) { - deserializedSecuritySolutionsReferenceDataProperties.template = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSecuritySolutionsReferenceDataProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityStandardInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityStandardInner.java deleted file mode 100644 index 87601f9bbd1c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityStandardInner.java +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.PartialAssessmentProperties; -import com.azure.resourcemanager.security.models.StandardMetadata; -import com.azure.resourcemanager.security.models.StandardSupportedCloud; -import com.azure.resourcemanager.security.models.StandardType; -import java.io.IOException; -import java.util.List; - -/** - * Security Standard on a resource. - */ -@Fluent -public final class SecurityStandardInner extends ProxyResource { - /* - * Properties of a security standard - */ - private SecurityStandardProperties 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 SecurityStandardInner class. - */ - public SecurityStandardInner() { - } - - /** - * Get the innerProperties property: Properties of a security standard. - * - * @return the innerProperties value. - */ - private SecurityStandardProperties 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 displayName property: Display name of the standard, equivalent to the standardId. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: Display name of the standard, equivalent to the standardId. - * - * @param displayName the displayName value to set. - * @return the SecurityStandardInner object itself. - */ - public SecurityStandardInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityStandardProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the standardType property: Standard type (Custom or Default or Compliance only currently). - * - * @return the standardType value. - */ - public StandardType standardType() { - return this.innerProperties() == null ? null : this.innerProperties().standardType(); - } - - /** - * Get the description property: Description of the standard. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: Description of the standard. - * - * @param description the description value to set. - * @return the SecurityStandardInner object itself. - */ - public SecurityStandardInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityStandardProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the assessments property: List of assessment keys to apply to standard scope. - * - * @return the assessments value. - */ - public List assessments() { - return this.innerProperties() == null ? null : this.innerProperties().assessments(); - } - - /** - * Set the assessments property: List of assessment keys to apply to standard scope. - * - * @param assessments the assessments value to set. - * @return the SecurityStandardInner object itself. - */ - public SecurityStandardInner withAssessments(List assessments) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityStandardProperties(); - } - this.innerProperties().withAssessments(assessments); - return this; - } - - /** - * Get the cloudProviders property: List of all standard supported clouds. - * - * @return the cloudProviders value. - */ - public List cloudProviders() { - return this.innerProperties() == null ? null : this.innerProperties().cloudProviders(); - } - - /** - * Set the cloudProviders property: List of all standard supported clouds. - * - * @param cloudProviders the cloudProviders value to set. - * @return the SecurityStandardInner object itself. - */ - public SecurityStandardInner withCloudProviders(List cloudProviders) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityStandardProperties(); - } - this.innerProperties().withCloudProviders(cloudProviders); - return this; - } - - /** - * Get the policySetDefinitionId property: The policy set definition id associated with the standard. - * - * @return the policySetDefinitionId value. - */ - public String policySetDefinitionId() { - return this.innerProperties() == null ? null : this.innerProperties().policySetDefinitionId(); - } - - /** - * Set the policySetDefinitionId property: The policy set definition id associated with the standard. - * - * @param policySetDefinitionId the policySetDefinitionId value to set. - * @return the SecurityStandardInner object itself. - */ - public SecurityStandardInner withPolicySetDefinitionId(String policySetDefinitionId) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityStandardProperties(); - } - this.innerProperties().withPolicySetDefinitionId(policySetDefinitionId); - return this; - } - - /** - * Get the metadata property: The security standard metadata. - * - * @return the metadata value. - */ - public StandardMetadata metadata() { - return this.innerProperties() == null ? null : this.innerProperties().metadata(); - } - - /** - * Set the metadata property: The security standard metadata. - * - * @param metadata the metadata value to set. - * @return the SecurityStandardInner object itself. - */ - public SecurityStandardInner withMetadata(StandardMetadata metadata) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityStandardProperties(); - } - this.innerProperties().withMetadata(metadata); - 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 SecurityStandardInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityStandardInner 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 SecurityStandardInner. - */ - public static SecurityStandardInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityStandardInner deserializedSecurityStandardInner = new SecurityStandardInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSecurityStandardInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSecurityStandardInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSecurityStandardInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSecurityStandardInner.innerProperties = SecurityStandardProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSecurityStandardInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityStandardInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityStandardProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityStandardProperties.java deleted file mode 100644 index 468e13fba158..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityStandardProperties.java +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.PartialAssessmentProperties; -import com.azure.resourcemanager.security.models.StandardMetadata; -import com.azure.resourcemanager.security.models.StandardSupportedCloud; -import com.azure.resourcemanager.security.models.StandardType; -import java.io.IOException; -import java.util.List; - -/** - * Describes properties of a standard. - */ -@Fluent -public final class SecurityStandardProperties implements JsonSerializable { - /* - * Display name of the standard, equivalent to the standardId - */ - private String displayName; - - /* - * Standard type (Custom or Default or Compliance only currently) - */ - private StandardType standardType; - - /* - * Description of the standard - */ - private String description; - - /* - * List of assessment keys to apply to standard scope. - */ - private List assessments; - - /* - * List of all standard supported clouds. - */ - private List cloudProviders; - - /* - * The policy set definition id associated with the standard. - */ - private String policySetDefinitionId; - - /* - * The security standard metadata. - */ - private StandardMetadata metadata; - - /** - * Creates an instance of SecurityStandardProperties class. - */ - public SecurityStandardProperties() { - } - - /** - * Get the displayName property: Display name of the standard, equivalent to the standardId. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Display name of the standard, equivalent to the standardId. - * - * @param displayName the displayName value to set. - * @return the SecurityStandardProperties object itself. - */ - public SecurityStandardProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the standardType property: Standard type (Custom or Default or Compliance only currently). - * - * @return the standardType value. - */ - public StandardType standardType() { - return this.standardType; - } - - /** - * Get the description property: Description of the standard. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the standard. - * - * @param description the description value to set. - * @return the SecurityStandardProperties object itself. - */ - public SecurityStandardProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the assessments property: List of assessment keys to apply to standard scope. - * - * @return the assessments value. - */ - public List assessments() { - return this.assessments; - } - - /** - * Set the assessments property: List of assessment keys to apply to standard scope. - * - * @param assessments the assessments value to set. - * @return the SecurityStandardProperties object itself. - */ - public SecurityStandardProperties withAssessments(List assessments) { - this.assessments = assessments; - return this; - } - - /** - * Get the cloudProviders property: List of all standard supported clouds. - * - * @return the cloudProviders value. - */ - public List cloudProviders() { - return this.cloudProviders; - } - - /** - * Set the cloudProviders property: List of all standard supported clouds. - * - * @param cloudProviders the cloudProviders value to set. - * @return the SecurityStandardProperties object itself. - */ - public SecurityStandardProperties withCloudProviders(List cloudProviders) { - this.cloudProviders = cloudProviders; - return this; - } - - /** - * Get the policySetDefinitionId property: The policy set definition id associated with the standard. - * - * @return the policySetDefinitionId value. - */ - public String policySetDefinitionId() { - return this.policySetDefinitionId; - } - - /** - * Set the policySetDefinitionId property: The policy set definition id associated with the standard. - * - * @param policySetDefinitionId the policySetDefinitionId value to set. - * @return the SecurityStandardProperties object itself. - */ - public SecurityStandardProperties withPolicySetDefinitionId(String policySetDefinitionId) { - this.policySetDefinitionId = policySetDefinitionId; - return this; - } - - /** - * Get the metadata property: The security standard metadata. - * - * @return the metadata value. - */ - public StandardMetadata metadata() { - return this.metadata; - } - - /** - * Set the metadata property: The security standard metadata. - * - * @param metadata the metadata value to set. - * @return the SecurityStandardProperties object itself. - */ - public SecurityStandardProperties withMetadata(StandardMetadata metadata) { - this.metadata = metadata; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (assessments() != null) { - assessments().forEach(e -> e.validate()); - } - if (metadata() != null) { - metadata().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeArrayField("assessments", this.assessments, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("cloudProviders", this.cloudProviders, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeStringField("policySetDefinitionId", this.policySetDefinitionId); - jsonWriter.writeJsonField("metadata", this.metadata); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecurityStandardProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityStandardProperties 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 SecurityStandardProperties. - */ - public static SecurityStandardProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityStandardProperties deserializedSecurityStandardProperties = new SecurityStandardProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("displayName".equals(fieldName)) { - deserializedSecurityStandardProperties.displayName = reader.getString(); - } else if ("standardType".equals(fieldName)) { - deserializedSecurityStandardProperties.standardType = StandardType.fromString(reader.getString()); - } else if ("description".equals(fieldName)) { - deserializedSecurityStandardProperties.description = reader.getString(); - } else if ("assessments".equals(fieldName)) { - List assessments - = reader.readArray(reader1 -> PartialAssessmentProperties.fromJson(reader1)); - deserializedSecurityStandardProperties.assessments = assessments; - } else if ("cloudProviders".equals(fieldName)) { - List cloudProviders - = reader.readArray(reader1 -> StandardSupportedCloud.fromString(reader1.getString())); - deserializedSecurityStandardProperties.cloudProviders = cloudProviders; - } else if ("policySetDefinitionId".equals(fieldName)) { - deserializedSecurityStandardProperties.policySetDefinitionId = reader.getString(); - } else if ("metadata".equals(fieldName)) { - deserializedSecurityStandardProperties.metadata = StandardMetadata.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityStandardProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentInner.java deleted file mode 100644 index 0091f46b09f6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentInner.java +++ /dev/null @@ -1,249 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.AdditionalData; -import com.azure.resourcemanager.security.models.ResourceDetails; -import com.azure.resourcemanager.security.models.SubAssessmentStatus; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Security sub-assessment on a resource. - */ -@Immutable -public final class SecuritySubAssessmentInner extends ProxyResource { - /* - * Describes properties of an sub-assessment. - */ - private SecuritySubAssessmentProperties 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 SecuritySubAssessmentInner class. - */ - private SecuritySubAssessmentInner() { - } - - /** - * Get the innerProperties property: Describes properties of an sub-assessment. - * - * @return the innerProperties value. - */ - private SecuritySubAssessmentProperties 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 id property: Vulnerability ID. - * - * @return the id value. - */ - public String idPropertiesId() { - return this.innerProperties() == null ? null : this.innerProperties().id(); - } - - /** - * Get the displayName property: User friendly display name of the sub-assessment. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the status property: Status of the sub-assessment. - * - * @return the status value. - */ - public SubAssessmentStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the remediation property: Information on how to remediate this sub-assessment. - * - * @return the remediation value. - */ - public String remediation() { - return this.innerProperties() == null ? null : this.innerProperties().remediation(); - } - - /** - * Get the impact property: Description of the impact of this sub-assessment. - * - * @return the impact value. - */ - public String impact() { - return this.innerProperties() == null ? null : this.innerProperties().impact(); - } - - /** - * Get the category property: Category of the sub-assessment. - * - * @return the category value. - */ - public String category() { - return this.innerProperties() == null ? null : this.innerProperties().category(); - } - - /** - * Get the description property: Human readable description of the assessment status. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the timeGenerated property: The date and time the sub-assessment was generated. - * - * @return the timeGenerated value. - */ - public OffsetDateTime timeGenerated() { - return this.innerProperties() == null ? null : this.innerProperties().timeGenerated(); - } - - /** - * Get the resourceDetails property: Details of the resource that was assessed. - * - * @return the resourceDetails value. - */ - public ResourceDetails resourceDetails() { - return this.innerProperties() == null ? null : this.innerProperties().resourceDetails(); - } - - /** - * Get the additionalData property: Details of the sub-assessment. - * - * @return the additionalData value. - */ - public AdditionalData additionalData() { - return this.innerProperties() == null ? null : this.innerProperties().additionalData(); - } - - /** - * 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 SecuritySubAssessmentInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecuritySubAssessmentInner 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 SecuritySubAssessmentInner. - */ - public static SecuritySubAssessmentInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecuritySubAssessmentInner deserializedSecuritySubAssessmentInner = new SecuritySubAssessmentInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSecuritySubAssessmentInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSecuritySubAssessmentInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSecuritySubAssessmentInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSecuritySubAssessmentInner.innerProperties - = SecuritySubAssessmentProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSecuritySubAssessmentInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecuritySubAssessmentInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentProperties.java deleted file mode 100644 index d23bf316b59b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentProperties.java +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.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 com.azure.resourcemanager.security.models.AdditionalData; -import com.azure.resourcemanager.security.models.ResourceDetails; -import com.azure.resourcemanager.security.models.SubAssessmentStatus; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Describes properties of an sub-assessment. - */ -@Immutable -public final class SecuritySubAssessmentProperties implements JsonSerializable { - /* - * Vulnerability ID - */ - private String id; - - /* - * User friendly display name of the sub-assessment - */ - private String displayName; - - /* - * Status of the sub-assessment - */ - private SubAssessmentStatus status; - - /* - * Information on how to remediate this sub-assessment - */ - private String remediation; - - /* - * Description of the impact of this sub-assessment - */ - private String impact; - - /* - * Category of the sub-assessment - */ - private String category; - - /* - * Human readable description of the assessment status - */ - private String description; - - /* - * The date and time the sub-assessment was generated - */ - private OffsetDateTime timeGenerated; - - /* - * Details of the resource that was assessed - */ - private ResourceDetails resourceDetails; - - /* - * Details of the sub-assessment - */ - private AdditionalData additionalData; - - /** - * Creates an instance of SecuritySubAssessmentProperties class. - */ - private SecuritySubAssessmentProperties() { - } - - /** - * Get the id property: Vulnerability ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the displayName property: User friendly display name of the sub-assessment. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the status property: Status of the sub-assessment. - * - * @return the status value. - */ - public SubAssessmentStatus status() { - return this.status; - } - - /** - * Get the remediation property: Information on how to remediate this sub-assessment. - * - * @return the remediation value. - */ - public String remediation() { - return this.remediation; - } - - /** - * Get the impact property: Description of the impact of this sub-assessment. - * - * @return the impact value. - */ - public String impact() { - return this.impact; - } - - /** - * Get the category property: Category of the sub-assessment. - * - * @return the category value. - */ - public String category() { - return this.category; - } - - /** - * Get the description property: Human readable description of the assessment status. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the timeGenerated property: The date and time the sub-assessment was generated. - * - * @return the timeGenerated value. - */ - public OffsetDateTime timeGenerated() { - return this.timeGenerated; - } - - /** - * Get the resourceDetails property: Details of the resource that was assessed. - * - * @return the resourceDetails value. - */ - public ResourceDetails resourceDetails() { - return this.resourceDetails; - } - - /** - * Get the additionalData property: Details of the sub-assessment. - * - * @return the additionalData value. - */ - public AdditionalData additionalData() { - return this.additionalData; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (status() != null) { - status().validate(); - } - if (resourceDetails() != null) { - resourceDetails().validate(); - } - if (additionalData() != null) { - additionalData().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("status", this.status); - jsonWriter.writeJsonField("resourceDetails", this.resourceDetails); - jsonWriter.writeJsonField("additionalData", this.additionalData); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecuritySubAssessmentProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecuritySubAssessmentProperties 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 SecuritySubAssessmentProperties. - */ - public static SecuritySubAssessmentProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecuritySubAssessmentProperties deserializedSecuritySubAssessmentProperties - = new SecuritySubAssessmentProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSecuritySubAssessmentProperties.id = reader.getString(); - } else if ("displayName".equals(fieldName)) { - deserializedSecuritySubAssessmentProperties.displayName = reader.getString(); - } else if ("status".equals(fieldName)) { - deserializedSecuritySubAssessmentProperties.status = SubAssessmentStatus.fromJson(reader); - } else if ("remediation".equals(fieldName)) { - deserializedSecuritySubAssessmentProperties.remediation = reader.getString(); - } else if ("impact".equals(fieldName)) { - deserializedSecuritySubAssessmentProperties.impact = reader.getString(); - } else if ("category".equals(fieldName)) { - deserializedSecuritySubAssessmentProperties.category = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedSecuritySubAssessmentProperties.description = reader.getString(); - } else if ("timeGenerated".equals(fieldName)) { - deserializedSecuritySubAssessmentProperties.timeGenerated = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("resourceDetails".equals(fieldName)) { - deserializedSecuritySubAssessmentProperties.resourceDetails = ResourceDetails.fromJson(reader); - } else if ("additionalData".equals(fieldName)) { - deserializedSecuritySubAssessmentProperties.additionalData = AdditionalData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecuritySubAssessmentProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskInner.java deleted file mode 100644 index ac4cbd56d9c2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskInner.java +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.SecurityTaskParameters; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Security task that we recommend to do in order to strengthen security. - */ -@Immutable -public final class SecurityTaskInner extends ProxyResource { - /* - * Describes properties of a task. - */ - private SecurityTaskProperties 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 SecurityTaskInner class. - */ - private SecurityTaskInner() { - } - - /** - * Get the innerProperties property: Describes properties of a task. - * - * @return the innerProperties value. - */ - private SecurityTaskProperties 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 state property: State of the task (Active, Resolved etc.). - * - * @return the state value. - */ - public String state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Get the creationTimeUtc property: The time this task was discovered in UTC. - * - * @return the creationTimeUtc value. - */ - public OffsetDateTime creationTimeUtc() { - return this.innerProperties() == null ? null : this.innerProperties().creationTimeUtc(); - } - - /** - * Get the securityTaskParameters property: Changing set of properties, depending on the task type that is derived - * from the name field. - * - * @return the securityTaskParameters value. - */ - public SecurityTaskParameters securityTaskParameters() { - return this.innerProperties() == null ? null : this.innerProperties().securityTaskParameters(); - } - - /** - * Get the lastStateChangeTimeUtc property: The time this task's details were last changed in UTC. - * - * @return the lastStateChangeTimeUtc value. - */ - public OffsetDateTime lastStateChangeTimeUtc() { - return this.innerProperties() == null ? null : this.innerProperties().lastStateChangeTimeUtc(); - } - - /** - * Get the subState property: Additional data on the state of the task. - * - * @return the subState value. - */ - public String subState() { - return this.innerProperties() == null ? null : this.innerProperties().subState(); - } - - /** - * 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 SecurityTaskInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityTaskInner 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 SecurityTaskInner. - */ - public static SecurityTaskInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityTaskInner deserializedSecurityTaskInner = new SecurityTaskInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSecurityTaskInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSecurityTaskInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSecurityTaskInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSecurityTaskInner.innerProperties = SecurityTaskProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSecurityTaskInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityTaskInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskProperties.java deleted file mode 100644 index 80ab07c97848..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskProperties.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.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 com.azure.resourcemanager.security.models.SecurityTaskParameters; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * Describes properties of a task. - */ -@Immutable -public final class SecurityTaskProperties implements JsonSerializable { - /* - * State of the task (Active, Resolved etc.) - */ - private String state; - - /* - * The time this task was discovered in UTC - */ - private OffsetDateTime creationTimeUtc; - - /* - * Changing set of properties, depending on the task type that is derived from the name field - */ - private SecurityTaskParameters securityTaskParameters; - - /* - * The time this task's details were last changed in UTC - */ - private OffsetDateTime lastStateChangeTimeUtc; - - /* - * Additional data on the state of the task - */ - private String subState; - - /** - * Creates an instance of SecurityTaskProperties class. - */ - private SecurityTaskProperties() { - } - - /** - * Get the state property: State of the task (Active, Resolved etc.). - * - * @return the state value. - */ - public String state() { - return this.state; - } - - /** - * Get the creationTimeUtc property: The time this task was discovered in UTC. - * - * @return the creationTimeUtc value. - */ - public OffsetDateTime creationTimeUtc() { - return this.creationTimeUtc; - } - - /** - * Get the securityTaskParameters property: Changing set of properties, depending on the task type that is derived - * from the name field. - * - * @return the securityTaskParameters value. - */ - public SecurityTaskParameters securityTaskParameters() { - return this.securityTaskParameters; - } - - /** - * Get the lastStateChangeTimeUtc property: The time this task's details were last changed in UTC. - * - * @return the lastStateChangeTimeUtc value. - */ - public OffsetDateTime lastStateChangeTimeUtc() { - return this.lastStateChangeTimeUtc; - } - - /** - * Get the subState property: Additional data on the state of the task. - * - * @return the subState value. - */ - public String subState() { - return this.subState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (securityTaskParameters() != null) { - securityTaskParameters().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("securityTaskParameters", this.securityTaskParameters); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecurityTaskProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityTaskProperties 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 SecurityTaskProperties. - */ - public static SecurityTaskProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityTaskProperties deserializedSecurityTaskProperties = new SecurityTaskProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("state".equals(fieldName)) { - deserializedSecurityTaskProperties.state = reader.getString(); - } else if ("creationTimeUtc".equals(fieldName)) { - deserializedSecurityTaskProperties.creationTimeUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("securityTaskParameters".equals(fieldName)) { - deserializedSecurityTaskProperties.securityTaskParameters = SecurityTaskParameters.fromJson(reader); - } else if ("lastStateChangeTimeUtc".equals(fieldName)) { - deserializedSecurityTaskProperties.lastStateChangeTimeUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("subState".equals(fieldName)) { - deserializedSecurityTaskProperties.subState = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityTaskProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentInner.java deleted file mode 100644 index 42d2571fd5cb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentPropertiesProvisioningState; -import java.io.IOException; - -/** - * Describes the server vulnerability assessment details on a resource. - */ -@Immutable -public final class ServerVulnerabilityAssessmentInner extends ProxyResource { - /* - * describes ServerVulnerabilityAssessment properties. - */ - private ServerVulnerabilityAssessmentProperties 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 ServerVulnerabilityAssessmentInner class. - */ - private ServerVulnerabilityAssessmentInner() { - } - - /** - * Get the innerProperties property: describes ServerVulnerabilityAssessment properties. - * - * @return the innerProperties value. - */ - private ServerVulnerabilityAssessmentProperties 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 provisioningState property: The provisioningState of the vulnerability assessment capability on the VM. - * - * @return the provisioningState value. - */ - public ServerVulnerabilityAssessmentPropertiesProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * 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 ServerVulnerabilityAssessmentInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServerVulnerabilityAssessmentInner 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 ServerVulnerabilityAssessmentInner. - */ - public static ServerVulnerabilityAssessmentInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServerVulnerabilityAssessmentInner deserializedServerVulnerabilityAssessmentInner - = new ServerVulnerabilityAssessmentInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedServerVulnerabilityAssessmentInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedServerVulnerabilityAssessmentInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedServerVulnerabilityAssessmentInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedServerVulnerabilityAssessmentInner.innerProperties - = ServerVulnerabilityAssessmentProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedServerVulnerabilityAssessmentInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedServerVulnerabilityAssessmentInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentProperties.java deleted file mode 100644 index c8da9a8374bd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentProperties.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentPropertiesProvisioningState; -import java.io.IOException; - -/** - * describes ServerVulnerabilityAssessment properties. - */ -@Immutable -public final class ServerVulnerabilityAssessmentProperties - implements JsonSerializable { - /* - * The provisioningState of the vulnerability assessment capability on the VM - */ - private ServerVulnerabilityAssessmentPropertiesProvisioningState provisioningState; - - /** - * Creates an instance of ServerVulnerabilityAssessmentProperties class. - */ - private ServerVulnerabilityAssessmentProperties() { - } - - /** - * Get the provisioningState property: The provisioningState of the vulnerability assessment capability on the VM. - * - * @return the provisioningState value. - */ - public ServerVulnerabilityAssessmentPropertiesProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * 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 ServerVulnerabilityAssessmentProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServerVulnerabilityAssessmentProperties 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 ServerVulnerabilityAssessmentProperties. - */ - public static ServerVulnerabilityAssessmentProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServerVulnerabilityAssessmentProperties deserializedServerVulnerabilityAssessmentProperties - = new ServerVulnerabilityAssessmentProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningState".equals(fieldName)) { - deserializedServerVulnerabilityAssessmentProperties.provisioningState - = ServerVulnerabilityAssessmentPropertiesProvisioningState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedServerVulnerabilityAssessmentProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsAzureSettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsAzureSettingProperties.java deleted file mode 100644 index b01473334788..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsAzureSettingProperties.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.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.security.models.ServerVulnerabilityAssessmentsAzureSettingSelectedProvider; -import java.io.IOException; - -/** - * Describes the vulnerability assessments setting properties on Azure servers in the defined scope. - */ -@Fluent -public final class ServerVulnerabilityAssessmentsAzureSettingProperties - implements JsonSerializable { - /* - * The selected vulnerability assessments provider on Azure servers in the defined scope. - */ - private ServerVulnerabilityAssessmentsAzureSettingSelectedProvider selectedProvider; - - /** - * Creates an instance of ServerVulnerabilityAssessmentsAzureSettingProperties class. - */ - public ServerVulnerabilityAssessmentsAzureSettingProperties() { - } - - /** - * Get the selectedProvider property: The selected vulnerability assessments provider on Azure servers in the - * defined scope. - * - * @return the selectedProvider value. - */ - public ServerVulnerabilityAssessmentsAzureSettingSelectedProvider selectedProvider() { - return this.selectedProvider; - } - - /** - * Set the selectedProvider property: The selected vulnerability assessments provider on Azure servers in the - * defined scope. - * - * @param selectedProvider the selectedProvider value to set. - * @return the ServerVulnerabilityAssessmentsAzureSettingProperties object itself. - */ - public ServerVulnerabilityAssessmentsAzureSettingProperties - withSelectedProvider(ServerVulnerabilityAssessmentsAzureSettingSelectedProvider selectedProvider) { - this.selectedProvider = selectedProvider; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (selectedProvider() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property selectedProvider in model ServerVulnerabilityAssessmentsAzureSettingProperties")); - } - } - - private static final ClientLogger LOGGER - = new ClientLogger(ServerVulnerabilityAssessmentsAzureSettingProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("selectedProvider", - this.selectedProvider == null ? null : this.selectedProvider.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ServerVulnerabilityAssessmentsAzureSettingProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServerVulnerabilityAssessmentsAzureSettingProperties 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 ServerVulnerabilityAssessmentsAzureSettingProperties. - */ - public static ServerVulnerabilityAssessmentsAzureSettingProperties fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - ServerVulnerabilityAssessmentsAzureSettingProperties deserializedServerVulnerabilityAssessmentsAzureSettingProperties - = new ServerVulnerabilityAssessmentsAzureSettingProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("selectedProvider".equals(fieldName)) { - deserializedServerVulnerabilityAssessmentsAzureSettingProperties.selectedProvider - = ServerVulnerabilityAssessmentsAzureSettingSelectedProvider.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedServerVulnerabilityAssessmentsAzureSettingProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsListInner.java deleted file mode 100644 index c9c8dca573ce..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsListInner.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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; -import java.util.List; - -/** - * List of server vulnerability assessments. - */ -@Immutable -public final class ServerVulnerabilityAssessmentsListInner - implements JsonSerializable { - /* - * The value property. - */ - private List value; - - /** - * Creates an instance of ServerVulnerabilityAssessmentsListInner class. - */ - private ServerVulnerabilityAssessmentsListInner() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * 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 ServerVulnerabilityAssessmentsListInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServerVulnerabilityAssessmentsListInner 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 ServerVulnerabilityAssessmentsListInner. - */ - public static ServerVulnerabilityAssessmentsListInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServerVulnerabilityAssessmentsListInner deserializedServerVulnerabilityAssessmentsListInner - = new ServerVulnerabilityAssessmentsListInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ServerVulnerabilityAssessmentInner.fromJson(reader1)); - deserializedServerVulnerabilityAssessmentsListInner.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedServerVulnerabilityAssessmentsListInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsSettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsSettingInner.java deleted file mode 100644 index 74f728bed194..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsSettingInner.java +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.AzureServersSetting; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKind; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingProperties; -import java.io.IOException; - -/** - * A base vulnerability assessments setting on servers in the defined scope. - */ -@Fluent -public class ServerVulnerabilityAssessmentsSettingInner extends ProxyResource { - /* - * The kind of the server vulnerability assessments setting. - */ - private ServerVulnerabilityAssessmentsSettingKind kind - = ServerVulnerabilityAssessmentsSettingKind.fromString("ServerVulnerabilityAssessmentsSetting"); - - /* - * The resource-specific properties for this resource. - */ - private ServerVulnerabilityAssessmentsSettingProperties properties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - 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 ServerVulnerabilityAssessmentsSettingInner class. - */ - public ServerVulnerabilityAssessmentsSettingInner() { - } - - /** - * Get the kind property: The kind of the server vulnerability assessments setting. - * - * @return the kind value. - */ - public ServerVulnerabilityAssessmentsSettingKind kind() { - return this.kind; - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public ServerVulnerabilityAssessmentsSettingProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the ServerVulnerabilityAssessmentsSettingInner object itself. - */ - public ServerVulnerabilityAssessmentsSettingInner - withProperties(ServerVulnerabilityAssessmentsSettingProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @param systemData the systemData value to set. - * @return the ServerVulnerabilityAssessmentsSettingInner object itself. - */ - ServerVulnerabilityAssessmentsSettingInner withSystemData(SystemData systemData) { - this.systemData = systemData; - return this; - } - - /** - * 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.writeStringField("kind", this.kind == null ? null : this.kind.toString()); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ServerVulnerabilityAssessmentsSettingInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServerVulnerabilityAssessmentsSettingInner 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 ServerVulnerabilityAssessmentsSettingInner. - */ - public static ServerVulnerabilityAssessmentsSettingInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("kind".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AzureServersSetting".equals(discriminatorValue)) { - return AzureServersSetting.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static ServerVulnerabilityAssessmentsSettingInner fromJsonKnownDiscriminator(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - ServerVulnerabilityAssessmentsSettingInner deserializedServerVulnerabilityAssessmentsSettingInner - = new ServerVulnerabilityAssessmentsSettingInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedServerVulnerabilityAssessmentsSettingInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedServerVulnerabilityAssessmentsSettingInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedServerVulnerabilityAssessmentsSettingInner.type = reader.getString(); - } else if ("kind".equals(fieldName)) { - deserializedServerVulnerabilityAssessmentsSettingInner.kind - = ServerVulnerabilityAssessmentsSettingKind.fromString(reader.getString()); - } else if ("properties".equals(fieldName)) { - deserializedServerVulnerabilityAssessmentsSettingInner.properties - = ServerVulnerabilityAssessmentsSettingProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedServerVulnerabilityAssessmentsSettingInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedServerVulnerabilityAssessmentsSettingInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SettingInner.java deleted file mode 100644 index 6d50e843daf3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SettingInner.java +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.AlertSyncSettings; -import com.azure.resourcemanager.security.models.DataExportSettings; -import com.azure.resourcemanager.security.models.SettingKind; -import com.azure.resourcemanager.security.models.SettingProperties; -import java.io.IOException; - -/** - * The kind of the security setting. - */ -@Fluent -public class SettingInner extends ProxyResource { - /* - * the kind of the settings string - */ - private SettingKind kind = SettingKind.fromString("Setting"); - - /* - * The resource-specific properties for this resource. - */ - private SettingProperties properties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - 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 SettingInner class. - */ - public SettingInner() { - } - - /** - * Get the kind property: the kind of the settings string. - * - * @return the kind value. - */ - public SettingKind kind() { - return this.kind; - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public SettingProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the SettingInner object itself. - */ - public SettingInner withProperties(SettingProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @param systemData the systemData value to set. - * @return the SettingInner object itself. - */ - SettingInner withSystemData(SystemData systemData) { - this.systemData = systemData; - return this; - } - - /** - * 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.writeStringField("kind", this.kind == null ? null : this.kind.toString()); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SettingInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SettingInner 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 SettingInner. - */ - public static SettingInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("kind".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("DataExportSettings".equals(discriminatorValue)) { - return DataExportSettings.fromJson(readerToUse.reset()); - } else if ("AlertSyncSettings".equals(discriminatorValue)) { - return AlertSyncSettings.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static SettingInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SettingInner deserializedSettingInner = new SettingInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSettingInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSettingInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSettingInner.type = reader.getString(); - } else if ("kind".equals(fieldName)) { - deserializedSettingInner.kind = SettingKind.fromString(reader.getString()); - } else if ("properties".equals(fieldName)) { - deserializedSettingInner.properties = SettingProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSettingInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSettingInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SqlVulnerabilityAssessmentScanOperationResultInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SqlVulnerabilityAssessmentScanOperationResultInner.java deleted file mode 100644 index 6ff9cb64d42a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SqlVulnerabilityAssessmentScanOperationResultInner.java +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentScanOperationResultProperties; -import java.io.IOException; - -/** - * Represents the result of a SQL Vulnerability Assessment scan operation, wrapped in the ARM resource envelope. - */ -@Immutable -public final class SqlVulnerabilityAssessmentScanOperationResultInner extends ProxyResource { - /* - * Represents the properties of a SQL Vulnerability Assessment scan operation result. - */ - private SqlVulnerabilityAssessmentScanOperationResultProperties 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 SqlVulnerabilityAssessmentScanOperationResultInner class. - */ - private SqlVulnerabilityAssessmentScanOperationResultInner() { - } - - /** - * Get the properties property: Represents the properties of a SQL Vulnerability Assessment scan operation result. - * - * @return the properties value. - */ - public SqlVulnerabilityAssessmentScanOperationResultProperties properties() { - return this.properties; - } - - /** - * 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 SqlVulnerabilityAssessmentScanOperationResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SqlVulnerabilityAssessmentScanOperationResultInner 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 SqlVulnerabilityAssessmentScanOperationResultInner. - */ - public static SqlVulnerabilityAssessmentScanOperationResultInner fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - SqlVulnerabilityAssessmentScanOperationResultInner deserializedSqlVulnerabilityAssessmentScanOperationResultInner - = new SqlVulnerabilityAssessmentScanOperationResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSqlVulnerabilityAssessmentScanOperationResultInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSqlVulnerabilityAssessmentScanOperationResultInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSqlVulnerabilityAssessmentScanOperationResultInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSqlVulnerabilityAssessmentScanOperationResultInner.properties - = SqlVulnerabilityAssessmentScanOperationResultProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSqlVulnerabilityAssessmentScanOperationResultInner.systemData - = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSqlVulnerabilityAssessmentScanOperationResultInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SqlVulnerabilityAssessmentSettingsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SqlVulnerabilityAssessmentSettingsInner.java deleted file mode 100644 index bcb7f57cba60..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SqlVulnerabilityAssessmentSettingsInner.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.SqlVulnerabilityAssessmentSettingsProperties; -import java.io.IOException; - -/** - * SQL Vulnerability Assessment settings resource. - */ -@Fluent -public final class SqlVulnerabilityAssessmentSettingsInner extends ProxyResource { - /* - * SQL Vulnerability Assessment settings properties. - */ - private SqlVulnerabilityAssessmentSettingsProperties 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 SqlVulnerabilityAssessmentSettingsInner class. - */ - public SqlVulnerabilityAssessmentSettingsInner() { - } - - /** - * Get the properties property: SQL Vulnerability Assessment settings properties. - * - * @return the properties value. - */ - public SqlVulnerabilityAssessmentSettingsProperties properties() { - return this.properties; - } - - /** - * Set the properties property: SQL Vulnerability Assessment settings properties. - * - * @param properties the properties value to set. - * @return the SqlVulnerabilityAssessmentSettingsInner object itself. - */ - public SqlVulnerabilityAssessmentSettingsInner - withProperties(SqlVulnerabilityAssessmentSettingsProperties 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 SqlVulnerabilityAssessmentSettingsInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SqlVulnerabilityAssessmentSettingsInner 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 SqlVulnerabilityAssessmentSettingsInner. - */ - public static SqlVulnerabilityAssessmentSettingsInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SqlVulnerabilityAssessmentSettingsInner deserializedSqlVulnerabilityAssessmentSettingsInner - = new SqlVulnerabilityAssessmentSettingsInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSqlVulnerabilityAssessmentSettingsInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSqlVulnerabilityAssessmentSettingsInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSqlVulnerabilityAssessmentSettingsInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSqlVulnerabilityAssessmentSettingsInner.properties - = SqlVulnerabilityAssessmentSettingsProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSqlVulnerabilityAssessmentSettingsInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSqlVulnerabilityAssessmentSettingsInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/StandardAssignmentInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/StandardAssignmentInner.java deleted file mode 100644 index 01d35da9ba99..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/StandardAssignmentInner.java +++ /dev/null @@ -1,370 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.AssignedStandardItem; -import com.azure.resourcemanager.security.models.Effect; -import com.azure.resourcemanager.security.models.StandardAssignmentMetadata; -import com.azure.resourcemanager.security.models.StandardAssignmentPropertiesAttestationData; -import com.azure.resourcemanager.security.models.StandardAssignmentPropertiesExemptionData; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * Security Assignment on a resource group over a given scope. - */ -@Fluent -public final class StandardAssignmentInner extends ProxyResource { - /* - * Properties of a standard assignments assignment - */ - private StandardAssignmentProperties 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 StandardAssignmentInner class. - */ - public StandardAssignmentInner() { - } - - /** - * Get the innerProperties property: Properties of a standard assignments assignment. - * - * @return the innerProperties value. - */ - private StandardAssignmentProperties 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 displayName property: Display name of the standardAssignment. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: Display name of the standardAssignment. - * - * @param displayName the displayName value to set. - * @return the StandardAssignmentInner object itself. - */ - public StandardAssignmentInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new StandardAssignmentProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the description property: Description of the standardAssignment. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: Description of the standardAssignment. - * - * @param description the description value to set. - * @return the StandardAssignmentInner object itself. - */ - public StandardAssignmentInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new StandardAssignmentProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the assignedStandard property: Standard item with key as applied to this standard assignment over the given - * scope. - * - * @return the assignedStandard value. - */ - public AssignedStandardItem assignedStandard() { - return this.innerProperties() == null ? null : this.innerProperties().assignedStandard(); - } - - /** - * Set the assignedStandard property: Standard item with key as applied to this standard assignment over the given - * scope. - * - * @param assignedStandard the assignedStandard value to set. - * @return the StandardAssignmentInner object itself. - */ - public StandardAssignmentInner withAssignedStandard(AssignedStandardItem assignedStandard) { - if (this.innerProperties() == null) { - this.innerProperties = new StandardAssignmentProperties(); - } - this.innerProperties().withAssignedStandard(assignedStandard); - return this; - } - - /** - * Get the effect property: Expected effect of this assignment (Audit/Exempt/Attest). - * - * @return the effect value. - */ - public Effect effect() { - return this.innerProperties() == null ? null : this.innerProperties().effect(); - } - - /** - * Set the effect property: Expected effect of this assignment (Audit/Exempt/Attest). - * - * @param effect the effect value to set. - * @return the StandardAssignmentInner object itself. - */ - public StandardAssignmentInner withEffect(Effect effect) { - if (this.innerProperties() == null) { - this.innerProperties = new StandardAssignmentProperties(); - } - this.innerProperties().withEffect(effect); - return this; - } - - /** - * Get the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). - * - * @return the excludedScopes value. - */ - public List excludedScopes() { - return this.innerProperties() == null ? null : this.innerProperties().excludedScopes(); - } - - /** - * Set the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). - * - * @param excludedScopes the excludedScopes value to set. - * @return the StandardAssignmentInner object itself. - */ - public StandardAssignmentInner withExcludedScopes(List excludedScopes) { - if (this.innerProperties() == null) { - this.innerProperties = new StandardAssignmentProperties(); - } - this.innerProperties().withExcludedScopes(excludedScopes); - return this; - } - - /** - * Get the expiresOn property: Expiration date of this assignment as a full ISO date. - * - * @return the expiresOn value. - */ - public OffsetDateTime expiresOn() { - return this.innerProperties() == null ? null : this.innerProperties().expiresOn(); - } - - /** - * Set the expiresOn property: Expiration date of this assignment as a full ISO date. - * - * @param expiresOn the expiresOn value to set. - * @return the StandardAssignmentInner object itself. - */ - public StandardAssignmentInner withExpiresOn(OffsetDateTime expiresOn) { - if (this.innerProperties() == null) { - this.innerProperties = new StandardAssignmentProperties(); - } - this.innerProperties().withExpiresOn(expiresOn); - return this; - } - - /** - * Get the exemptionData property: Additional data about assignment that has Exempt effect. - * - * @return the exemptionData value. - */ - public StandardAssignmentPropertiesExemptionData exemptionData() { - return this.innerProperties() == null ? null : this.innerProperties().exemptionData(); - } - - /** - * Set the exemptionData property: Additional data about assignment that has Exempt effect. - * - * @param exemptionData the exemptionData value to set. - * @return the StandardAssignmentInner object itself. - */ - public StandardAssignmentInner withExemptionData(StandardAssignmentPropertiesExemptionData exemptionData) { - if (this.innerProperties() == null) { - this.innerProperties = new StandardAssignmentProperties(); - } - this.innerProperties().withExemptionData(exemptionData); - return this; - } - - /** - * Get the attestationData property: Additional data about assignment that has Attest effect. - * - * @return the attestationData value. - */ - public StandardAssignmentPropertiesAttestationData attestationData() { - return this.innerProperties() == null ? null : this.innerProperties().attestationData(); - } - - /** - * Set the attestationData property: Additional data about assignment that has Attest effect. - * - * @param attestationData the attestationData value to set. - * @return the StandardAssignmentInner object itself. - */ - public StandardAssignmentInner withAttestationData(StandardAssignmentPropertiesAttestationData attestationData) { - if (this.innerProperties() == null) { - this.innerProperties = new StandardAssignmentProperties(); - } - this.innerProperties().withAttestationData(attestationData); - return this; - } - - /** - * Get the metadata property: The standard assignment metadata. - * - * @return the metadata value. - */ - public StandardAssignmentMetadata metadata() { - return this.innerProperties() == null ? null : this.innerProperties().metadata(); - } - - /** - * Set the metadata property: The standard assignment metadata. - * - * @param metadata the metadata value to set. - * @return the StandardAssignmentInner object itself. - */ - public StandardAssignmentInner withMetadata(StandardAssignmentMetadata metadata) { - if (this.innerProperties() == null) { - this.innerProperties = new StandardAssignmentProperties(); - } - this.innerProperties().withMetadata(metadata); - 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 StandardAssignmentInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of StandardAssignmentInner 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 StandardAssignmentInner. - */ - public static StandardAssignmentInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - StandardAssignmentInner deserializedStandardAssignmentInner = new StandardAssignmentInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedStandardAssignmentInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedStandardAssignmentInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedStandardAssignmentInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedStandardAssignmentInner.innerProperties = StandardAssignmentProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedStandardAssignmentInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedStandardAssignmentInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/StandardAssignmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/StandardAssignmentProperties.java deleted file mode 100644 index 82ef3156290a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/StandardAssignmentProperties.java +++ /dev/null @@ -1,347 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.AssignedStandardItem; -import com.azure.resourcemanager.security.models.Effect; -import com.azure.resourcemanager.security.models.StandardAssignmentMetadata; -import com.azure.resourcemanager.security.models.StandardAssignmentPropertiesAttestationData; -import com.azure.resourcemanager.security.models.StandardAssignmentPropertiesExemptionData; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * Describes the properties of a standardAssignment. - */ -@Fluent -public final class StandardAssignmentProperties implements JsonSerializable { - /* - * Display name of the standardAssignment - */ - private String displayName; - - /* - * Description of the standardAssignment - */ - private String description; - - /* - * Standard item with key as applied to this standard assignment over the given scope - */ - private AssignedStandardItem assignedStandard; - - /* - * Expected effect of this assignment (Audit/Exempt/Attest) - */ - private Effect effect; - - /* - * Excluded scopes, filter out the descendants of the scope (on management scopes) - */ - private List excludedScopes; - - /* - * Expiration date of this assignment as a full ISO date - */ - private OffsetDateTime expiresOn; - - /* - * Additional data about assignment that has Exempt effect - */ - private StandardAssignmentPropertiesExemptionData exemptionData; - - /* - * Additional data about assignment that has Attest effect - */ - private StandardAssignmentPropertiesAttestationData attestationData; - - /* - * The standard assignment metadata. - */ - private StandardAssignmentMetadata metadata; - - /** - * Creates an instance of StandardAssignmentProperties class. - */ - public StandardAssignmentProperties() { - } - - /** - * Get the displayName property: Display name of the standardAssignment. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Display name of the standardAssignment. - * - * @param displayName the displayName value to set. - * @return the StandardAssignmentProperties object itself. - */ - public StandardAssignmentProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the description property: Description of the standardAssignment. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the standardAssignment. - * - * @param description the description value to set. - * @return the StandardAssignmentProperties object itself. - */ - public StandardAssignmentProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the assignedStandard property: Standard item with key as applied to this standard assignment over the given - * scope. - * - * @return the assignedStandard value. - */ - public AssignedStandardItem assignedStandard() { - return this.assignedStandard; - } - - /** - * Set the assignedStandard property: Standard item with key as applied to this standard assignment over the given - * scope. - * - * @param assignedStandard the assignedStandard value to set. - * @return the StandardAssignmentProperties object itself. - */ - public StandardAssignmentProperties withAssignedStandard(AssignedStandardItem assignedStandard) { - this.assignedStandard = assignedStandard; - return this; - } - - /** - * Get the effect property: Expected effect of this assignment (Audit/Exempt/Attest). - * - * @return the effect value. - */ - public Effect effect() { - return this.effect; - } - - /** - * Set the effect property: Expected effect of this assignment (Audit/Exempt/Attest). - * - * @param effect the effect value to set. - * @return the StandardAssignmentProperties object itself. - */ - public StandardAssignmentProperties withEffect(Effect effect) { - this.effect = effect; - return this; - } - - /** - * Get the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). - * - * @return the excludedScopes value. - */ - public List excludedScopes() { - return this.excludedScopes; - } - - /** - * Set the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). - * - * @param excludedScopes the excludedScopes value to set. - * @return the StandardAssignmentProperties object itself. - */ - public StandardAssignmentProperties withExcludedScopes(List excludedScopes) { - this.excludedScopes = excludedScopes; - return this; - } - - /** - * Get the expiresOn property: Expiration date of this assignment as a full ISO date. - * - * @return the expiresOn value. - */ - public OffsetDateTime expiresOn() { - return this.expiresOn; - } - - /** - * Set the expiresOn property: Expiration date of this assignment as a full ISO date. - * - * @param expiresOn the expiresOn value to set. - * @return the StandardAssignmentProperties object itself. - */ - public StandardAssignmentProperties withExpiresOn(OffsetDateTime expiresOn) { - this.expiresOn = expiresOn; - return this; - } - - /** - * Get the exemptionData property: Additional data about assignment that has Exempt effect. - * - * @return the exemptionData value. - */ - public StandardAssignmentPropertiesExemptionData exemptionData() { - return this.exemptionData; - } - - /** - * Set the exemptionData property: Additional data about assignment that has Exempt effect. - * - * @param exemptionData the exemptionData value to set. - * @return the StandardAssignmentProperties object itself. - */ - public StandardAssignmentProperties withExemptionData(StandardAssignmentPropertiesExemptionData exemptionData) { - this.exemptionData = exemptionData; - return this; - } - - /** - * Get the attestationData property: Additional data about assignment that has Attest effect. - * - * @return the attestationData value. - */ - public StandardAssignmentPropertiesAttestationData attestationData() { - return this.attestationData; - } - - /** - * Set the attestationData property: Additional data about assignment that has Attest effect. - * - * @param attestationData the attestationData value to set. - * @return the StandardAssignmentProperties object itself. - */ - public StandardAssignmentProperties - withAttestationData(StandardAssignmentPropertiesAttestationData attestationData) { - this.attestationData = attestationData; - return this; - } - - /** - * Get the metadata property: The standard assignment metadata. - * - * @return the metadata value. - */ - public StandardAssignmentMetadata metadata() { - return this.metadata; - } - - /** - * Set the metadata property: The standard assignment metadata. - * - * @param metadata the metadata value to set. - * @return the StandardAssignmentProperties object itself. - */ - public StandardAssignmentProperties withMetadata(StandardAssignmentMetadata metadata) { - this.metadata = metadata; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (assignedStandard() != null) { - assignedStandard().validate(); - } - if (exemptionData() != null) { - exemptionData().validate(); - } - if (attestationData() != null) { - attestationData().validate(); - } - if (metadata() != null) { - metadata().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeJsonField("assignedStandard", this.assignedStandard); - jsonWriter.writeStringField("effect", this.effect == null ? null : this.effect.toString()); - jsonWriter.writeArrayField("excludedScopes", this.excludedScopes, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("expiresOn", - this.expiresOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiresOn)); - jsonWriter.writeJsonField("exemptionData", this.exemptionData); - jsonWriter.writeJsonField("attestationData", this.attestationData); - jsonWriter.writeJsonField("metadata", this.metadata); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of StandardAssignmentProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of StandardAssignmentProperties 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 StandardAssignmentProperties. - */ - public static StandardAssignmentProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - StandardAssignmentProperties deserializedStandardAssignmentProperties = new StandardAssignmentProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("displayName".equals(fieldName)) { - deserializedStandardAssignmentProperties.displayName = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedStandardAssignmentProperties.description = reader.getString(); - } else if ("assignedStandard".equals(fieldName)) { - deserializedStandardAssignmentProperties.assignedStandard = AssignedStandardItem.fromJson(reader); - } else if ("effect".equals(fieldName)) { - deserializedStandardAssignmentProperties.effect = Effect.fromString(reader.getString()); - } else if ("excludedScopes".equals(fieldName)) { - List excludedScopes = reader.readArray(reader1 -> reader1.getString()); - deserializedStandardAssignmentProperties.excludedScopes = excludedScopes; - } else if ("expiresOn".equals(fieldName)) { - deserializedStandardAssignmentProperties.expiresOn = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("exemptionData".equals(fieldName)) { - deserializedStandardAssignmentProperties.exemptionData - = StandardAssignmentPropertiesExemptionData.fromJson(reader); - } else if ("attestationData".equals(fieldName)) { - deserializedStandardAssignmentProperties.attestationData - = StandardAssignmentPropertiesAttestationData.fromJson(reader); - } else if ("metadata".equals(fieldName)) { - deserializedStandardAssignmentProperties.metadata = StandardAssignmentMetadata.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedStandardAssignmentProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/StandardInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/StandardInner.java deleted file mode 100644 index ac0184617f22..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/StandardInner.java +++ /dev/null @@ -1,397 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.StandardComponentProperties; -import com.azure.resourcemanager.security.models.StandardSupportedClouds; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * Security Standard on a resource. - */ -@Fluent -public final class StandardInner extends ProxyResource { - /* - * Properties of a security standard - */ - private StandardProperties innerProperties; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The geo-location where the resource lives - */ - private String location; - - /* - * Kind of the resource - */ - private String kind; - - /* - * Entity tag is used for comparing two or more entities from the same requested resource. - */ - private String etag; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of StandardInner class. - */ - public StandardInner() { - } - - /** - * Get the innerProperties property: Properties of a security standard. - * - * @return the innerProperties value. - */ - private StandardProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the StandardInner object itself. - */ - public StandardInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The geo-location where the resource lives. - * - * @param location the location value to set. - * @return the StandardInner object itself. - */ - public StandardInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the kind property: Kind of the resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: Kind of the resource. - * - * @param kind the kind value to set. - * @return the StandardInner object itself. - */ - public StandardInner withKind(String kind) { - this.kind = kind; - return this; - } - - /** - * Get the etag property: Entity tag is used for comparing two or more entities from the same requested resource. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Entity tag is used for comparing two or more entities from the same requested resource. - * - * @param etag the etag value to set. - * @return the StandardInner object itself. - */ - public StandardInner withEtag(String etag) { - this.etag = etag; - 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; - } - - /** - * Get the displayName property: display name of the standard, equivalent to the standardId. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: display name of the standard, equivalent to the standardId. - * - * @param displayName the displayName value to set. - * @return the StandardInner object itself. - */ - public StandardInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new StandardProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the standardType property: standard type (Custom or BuiltIn only currently). - * - * @return the standardType value. - */ - public String standardType() { - return this.innerProperties() == null ? null : this.innerProperties().standardType(); - } - - /** - * Get the description property: description of the standard. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: description of the standard. - * - * @param description the description value to set. - * @return the StandardInner object itself. - */ - public StandardInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new StandardProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the category property: category of the standard provided. - * - * @return the category value. - */ - public String category() { - return this.innerProperties() == null ? null : this.innerProperties().category(); - } - - /** - * Set the category property: category of the standard provided. - * - * @param category the category value to set. - * @return the StandardInner object itself. - */ - public StandardInner withCategory(String category) { - if (this.innerProperties() == null) { - this.innerProperties = new StandardProperties(); - } - this.innerProperties().withCategory(category); - return this; - } - - /** - * Get the components property: List of component objects containing component unique keys (such as assessment keys) - * to apply to standard scope. Currently only supports assessment keys. - * - * @return the components value. - */ - public List components() { - return this.innerProperties() == null ? null : this.innerProperties().components(); - } - - /** - * Set the components property: List of component objects containing component unique keys (such as assessment keys) - * to apply to standard scope. Currently only supports assessment keys. - * - * @param components the components value to set. - * @return the StandardInner object itself. - */ - public StandardInner withComponents(List components) { - if (this.innerProperties() == null) { - this.innerProperties = new StandardProperties(); - } - this.innerProperties().withComponents(components); - return this; - } - - /** - * Get the supportedClouds property: List of all standard supported clouds. - * - * @return the supportedClouds value. - */ - public List supportedClouds() { - return this.innerProperties() == null ? null : this.innerProperties().supportedClouds(); - } - - /** - * Set the supportedClouds property: List of all standard supported clouds. - * - * @param supportedClouds the supportedClouds value to set. - * @return the StandardInner object itself. - */ - public StandardInner withSupportedClouds(List supportedClouds) { - if (this.innerProperties() == null) { - this.innerProperties = new StandardProperties(); - } - this.innerProperties().withSupportedClouds(supportedClouds); - 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); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeStringField("kind", this.kind); - jsonWriter.writeStringField("etag", this.etag); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of StandardInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of StandardInner 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 StandardInner. - */ - public static StandardInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - StandardInner deserializedStandardInner = new StandardInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedStandardInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedStandardInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedStandardInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedStandardInner.innerProperties = StandardProperties.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedStandardInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedStandardInner.location = reader.getString(); - } else if ("kind".equals(fieldName)) { - deserializedStandardInner.kind = reader.getString(); - } else if ("etag".equals(fieldName)) { - deserializedStandardInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedStandardInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedStandardInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/StandardProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/StandardProperties.java deleted file mode 100644 index 091c9409676c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/StandardProperties.java +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.StandardComponentProperties; -import com.azure.resourcemanager.security.models.StandardSupportedClouds; -import java.io.IOException; -import java.util.List; - -/** - * Describes properties of a standard. - */ -@Fluent -public final class StandardProperties implements JsonSerializable { - /* - * display name of the standard, equivalent to the standardId - */ - private String displayName; - - /* - * standard type (Custom or BuiltIn only currently) - */ - private String standardType; - - /* - * description of the standard - */ - private String description; - - /* - * category of the standard provided - */ - private String category; - - /* - * List of component objects containing component unique keys (such as assessment keys) to apply to standard scope. - * Currently only supports assessment keys. - */ - private List components; - - /* - * List of all standard supported clouds. - */ - private List supportedClouds; - - /** - * Creates an instance of StandardProperties class. - */ - public StandardProperties() { - } - - /** - * Get the displayName property: display name of the standard, equivalent to the standardId. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: display name of the standard, equivalent to the standardId. - * - * @param displayName the displayName value to set. - * @return the StandardProperties object itself. - */ - public StandardProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the standardType property: standard type (Custom or BuiltIn only currently). - * - * @return the standardType value. - */ - public String standardType() { - return this.standardType; - } - - /** - * Get the description property: description of the standard. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: description of the standard. - * - * @param description the description value to set. - * @return the StandardProperties object itself. - */ - public StandardProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the category property: category of the standard provided. - * - * @return the category value. - */ - public String category() { - return this.category; - } - - /** - * Set the category property: category of the standard provided. - * - * @param category the category value to set. - * @return the StandardProperties object itself. - */ - public StandardProperties withCategory(String category) { - this.category = category; - return this; - } - - /** - * Get the components property: List of component objects containing component unique keys (such as assessment keys) - * to apply to standard scope. Currently only supports assessment keys. - * - * @return the components value. - */ - public List components() { - return this.components; - } - - /** - * Set the components property: List of component objects containing component unique keys (such as assessment keys) - * to apply to standard scope. Currently only supports assessment keys. - * - * @param components the components value to set. - * @return the StandardProperties object itself. - */ - public StandardProperties withComponents(List components) { - this.components = components; - return this; - } - - /** - * Get the supportedClouds property: List of all standard supported clouds. - * - * @return the supportedClouds value. - */ - public List supportedClouds() { - return this.supportedClouds; - } - - /** - * Set the supportedClouds property: List of all standard supported clouds. - * - * @param supportedClouds the supportedClouds value to set. - * @return the StandardProperties object itself. - */ - public StandardProperties withSupportedClouds(List supportedClouds) { - this.supportedClouds = supportedClouds; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (components() != null) { - components().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeStringField("category", this.category); - jsonWriter.writeArrayField("components", this.components, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("supportedClouds", this.supportedClouds, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of StandardProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of StandardProperties 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 StandardProperties. - */ - public static StandardProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - StandardProperties deserializedStandardProperties = new StandardProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("displayName".equals(fieldName)) { - deserializedStandardProperties.displayName = reader.getString(); - } else if ("standardType".equals(fieldName)) { - deserializedStandardProperties.standardType = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedStandardProperties.description = reader.getString(); - } else if ("category".equals(fieldName)) { - deserializedStandardProperties.category = reader.getString(); - } else if ("components".equals(fieldName)) { - List components - = reader.readArray(reader1 -> StandardComponentProperties.fromJson(reader1)); - deserializedStandardProperties.components = components; - } else if ("supportedClouds".equals(fieldName)) { - List supportedClouds - = reader.readArray(reader1 -> StandardSupportedClouds.fromString(reader1.getString())); - deserializedStandardProperties.supportedClouds = supportedClouds; - } else { - reader.skipChildren(); - } - } - - return deserializedStandardProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/TopologyResourceInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/TopologyResourceInner.java deleted file mode 100644 index 05affc466215..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/TopologyResourceInner.java +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.models.TopologySingleResource; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * Concrete proxy resource types can be created by aliasing this type using a specific property type. - */ -@Immutable -public final class TopologyResourceInner extends ProxyResource { - /* - * The properties property. - */ - private TopologyResourceProperties innerProperties; - - /* - * Location where the resource is stored - */ - private String location; - - /* - * 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 TopologyResourceInner class. - */ - private TopologyResourceInner() { - } - - /** - * Get the innerProperties property: The properties property. - * - * @return the innerProperties value. - */ - private TopologyResourceProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * 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 calculatedDateTime property: The UTC time on which the topology was calculated. - * - * @return the calculatedDateTime value. - */ - public OffsetDateTime calculatedDateTime() { - return this.innerProperties() == null ? null : this.innerProperties().calculatedDateTime(); - } - - /** - * Get the topologyResources property: Azure resources which are part of this topology resource. - * - * @return the topologyResources value. - */ - public List topologyResources() { - return this.innerProperties() == null ? null : this.innerProperties().topologyResources(); - } - - /** - * 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(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of TopologyResourceInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TopologyResourceInner 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 TopologyResourceInner. - */ - public static TopologyResourceInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - TopologyResourceInner deserializedTopologyResourceInner = new TopologyResourceInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedTopologyResourceInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedTopologyResourceInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedTopologyResourceInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedTopologyResourceInner.location = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedTopologyResourceInner.innerProperties = TopologyResourceProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedTopologyResourceInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedTopologyResourceInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/TopologyResourceProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/TopologyResourceProperties.java deleted file mode 100644 index 28f04afa816e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/TopologyResourceProperties.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.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 com.azure.resourcemanager.security.models.TopologySingleResource; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * The TopologyResourceProperties model. - */ -@Immutable -public final class TopologyResourceProperties implements JsonSerializable { - /* - * The UTC time on which the topology was calculated - */ - private OffsetDateTime calculatedDateTime; - - /* - * Azure resources which are part of this topology resource - */ - private List topologyResources; - - /** - * Creates an instance of TopologyResourceProperties class. - */ - private TopologyResourceProperties() { - } - - /** - * Get the calculatedDateTime property: The UTC time on which the topology was calculated. - * - * @return the calculatedDateTime value. - */ - public OffsetDateTime calculatedDateTime() { - return this.calculatedDateTime; - } - - /** - * Get the topologyResources property: Azure resources which are part of this topology resource. - * - * @return the topologyResources value. - */ - public List topologyResources() { - return this.topologyResources; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (topologyResources() != null) { - topologyResources().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of TopologyResourceProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TopologyResourceProperties 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 TopologyResourceProperties. - */ - public static TopologyResourceProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - TopologyResourceProperties deserializedTopologyResourceProperties = new TopologyResourceProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("calculatedDateTime".equals(fieldName)) { - deserializedTopologyResourceProperties.calculatedDateTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("topologyResources".equals(fieldName)) { - List topologyResources - = reader.readArray(reader1 -> TopologySingleResource.fromJson(reader1)); - deserializedTopologyResourceProperties.topologyResources = topologyResources; - } else { - reader.skipChildren(); - } - } - - return deserializedTopologyResourceProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/UpdateIoTSecuritySolutionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/UpdateIoTSecuritySolutionProperties.java deleted file mode 100644 index 3a0b71821263..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/UpdateIoTSecuritySolutionProperties.java +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.models.RecommendationConfigurationProperties; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import java.io.IOException; -import java.util.List; - -/** - * Update Security Solution setting data. - */ -@Fluent -public final class UpdateIoTSecuritySolutionProperties - implements JsonSerializable { - /* - * Properties of the IoT Security solution's user defined resources. - */ - private UserDefinedResourcesProperties userDefinedResources; - - /* - * List of the configuration status for each recommendation type. - */ - private List recommendationsConfiguration; - - /** - * Creates an instance of UpdateIoTSecuritySolutionProperties class. - */ - public UpdateIoTSecuritySolutionProperties() { - } - - /** - * Get the userDefinedResources property: Properties of the IoT Security solution's user defined resources. - * - * @return the userDefinedResources value. - */ - public UserDefinedResourcesProperties userDefinedResources() { - return this.userDefinedResources; - } - - /** - * Set the userDefinedResources property: Properties of the IoT Security solution's user defined resources. - * - * @param userDefinedResources the userDefinedResources value to set. - * @return the UpdateIoTSecuritySolutionProperties object itself. - */ - public UpdateIoTSecuritySolutionProperties - withUserDefinedResources(UserDefinedResourcesProperties userDefinedResources) { - this.userDefinedResources = userDefinedResources; - return this; - } - - /** - * Get the recommendationsConfiguration property: List of the configuration status for each recommendation type. - * - * @return the recommendationsConfiguration value. - */ - public List recommendationsConfiguration() { - return this.recommendationsConfiguration; - } - - /** - * Set the recommendationsConfiguration property: List of the configuration status for each recommendation type. - * - * @param recommendationsConfiguration the recommendationsConfiguration value to set. - * @return the UpdateIoTSecuritySolutionProperties object itself. - */ - public UpdateIoTSecuritySolutionProperties - withRecommendationsConfiguration(List recommendationsConfiguration) { - this.recommendationsConfiguration = recommendationsConfiguration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (userDefinedResources() != null) { - userDefinedResources().validate(); - } - if (recommendationsConfiguration() != null) { - recommendationsConfiguration().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("userDefinedResources", this.userDefinedResources); - jsonWriter.writeArrayField("recommendationsConfiguration", this.recommendationsConfiguration, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of UpdateIoTSecuritySolutionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of UpdateIoTSecuritySolutionProperties 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 UpdateIoTSecuritySolutionProperties. - */ - public static UpdateIoTSecuritySolutionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - UpdateIoTSecuritySolutionProperties deserializedUpdateIoTSecuritySolutionProperties - = new UpdateIoTSecuritySolutionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("userDefinedResources".equals(fieldName)) { - deserializedUpdateIoTSecuritySolutionProperties.userDefinedResources - = UserDefinedResourcesProperties.fromJson(reader); - } else if ("recommendationsConfiguration".equals(fieldName)) { - List recommendationsConfiguration - = reader.readArray(reader1 -> RecommendationConfigurationProperties.fromJson(reader1)); - deserializedUpdateIoTSecuritySolutionProperties.recommendationsConfiguration - = recommendationsConfiguration; - } else { - reader.skipChildren(); - } - } - - return deserializedUpdateIoTSecuritySolutionProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingInner.java deleted file mode 100644 index 940b3722e6aa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingInner.java +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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 java.io.IOException; - -/** - * Configures where to store the OMS agent data for workspaces under a scope. - */ -@Fluent -public final class WorkspaceSettingInner extends ProxyResource { - /* - * Workspace setting data - */ - private WorkspaceSettingProperties 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 WorkspaceSettingInner class. - */ - public WorkspaceSettingInner() { - } - - /** - * Get the innerProperties property: Workspace setting data. - * - * @return the innerProperties value. - */ - private WorkspaceSettingProperties 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 workspaceId property: The full Azure ID of the workspace to save the data in. - * - * @return the workspaceId value. - */ - public String workspaceId() { - return this.innerProperties() == null ? null : this.innerProperties().workspaceId(); - } - - /** - * Set the workspaceId property: The full Azure ID of the workspace to save the data in. - * - * @param workspaceId the workspaceId value to set. - * @return the WorkspaceSettingInner object itself. - */ - public WorkspaceSettingInner withWorkspaceId(String workspaceId) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspaceSettingProperties(); - } - this.innerProperties().withWorkspaceId(workspaceId); - return this; - } - - /** - * Get the scope property: All the VMs in this scope will send their security data to the mentioned workspace unless - * overridden by a setting with more specific scope. - * - * @return the scope value. - */ - public String scope() { - return this.innerProperties() == null ? null : this.innerProperties().scope(); - } - - /** - * Set the scope property: All the VMs in this scope will send their security data to the mentioned workspace unless - * overridden by a setting with more specific scope. - * - * @param scope the scope value to set. - * @return the WorkspaceSettingInner object itself. - */ - public WorkspaceSettingInner withScope(String scope) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspaceSettingProperties(); - } - this.innerProperties().withScope(scope); - 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 WorkspaceSettingInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WorkspaceSettingInner 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 WorkspaceSettingInner. - */ - public static WorkspaceSettingInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WorkspaceSettingInner deserializedWorkspaceSettingInner = new WorkspaceSettingInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedWorkspaceSettingInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedWorkspaceSettingInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedWorkspaceSettingInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedWorkspaceSettingInner.innerProperties = WorkspaceSettingProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedWorkspaceSettingInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedWorkspaceSettingInner; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingProperties.java deleted file mode 100644 index 019ee47c21ad..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingProperties.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.fluent.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; - -/** - * Workspace setting data. - */ -@Fluent -public final class WorkspaceSettingProperties implements JsonSerializable { - /* - * The full Azure ID of the workspace to save the data in - */ - private String workspaceId; - - /* - * All the VMs in this scope will send their security data to the mentioned workspace unless overridden by a setting - * with more specific scope - */ - private String scope; - - /** - * Creates an instance of WorkspaceSettingProperties class. - */ - public WorkspaceSettingProperties() { - } - - /** - * Get the workspaceId property: The full Azure ID of the workspace to save the data in. - * - * @return the workspaceId value. - */ - public String workspaceId() { - return this.workspaceId; - } - - /** - * Set the workspaceId property: The full Azure ID of the workspace to save the data in. - * - * @param workspaceId the workspaceId value to set. - * @return the WorkspaceSettingProperties object itself. - */ - public WorkspaceSettingProperties withWorkspaceId(String workspaceId) { - this.workspaceId = workspaceId; - return this; - } - - /** - * Get the scope property: All the VMs in this scope will send their security data to the mentioned workspace unless - * overridden by a setting with more specific scope. - * - * @return the scope value. - */ - public String scope() { - return this.scope; - } - - /** - * Set the scope property: All the VMs in this scope will send their security data to the mentioned workspace unless - * overridden by a setting with more specific scope. - * - * @param scope the scope value to set. - * @return the WorkspaceSettingProperties object itself. - */ - public WorkspaceSettingProperties withScope(String scope) { - this.scope = scope; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (workspaceId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property workspaceId in model WorkspaceSettingProperties")); - } - if (scope() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property scope in model WorkspaceSettingProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(WorkspaceSettingProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("workspaceId", this.workspaceId); - jsonWriter.writeStringField("scope", this.scope); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WorkspaceSettingProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WorkspaceSettingProperties 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 WorkspaceSettingProperties. - */ - public static WorkspaceSettingProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WorkspaceSettingProperties deserializedWorkspaceSettingProperties = new WorkspaceSettingProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("workspaceId".equals(fieldName)) { - deserializedWorkspaceSettingProperties.workspaceId = reader.getString(); - } else if ("scope".equals(fieldName)) { - deserializedWorkspaceSettingProperties.scope = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedWorkspaceSettingProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/package-info.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/package-info.java deleted file mode 100644 index 379d6e5c5131..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -/** - * Package containing the inner data models for Security. - * API spec for Microsoft.Security (Azure Security Center) alerts resource provider. - */ -package com.azure.resourcemanager.security.fluent.models; diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/package-info.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/package-info.java deleted file mode 100644 index af2d11d9d794..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -/** - * Package containing the service clients for Security. - * API spec for Microsoft.Security (Azure Security Center) alerts resource provider. - */ -package com.azure.resourcemanager.security.fluent; diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdvancedThreatProtectionSettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdvancedThreatProtectionSettingImpl.java deleted file mode 100644 index c0324b2e3aed..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdvancedThreatProtectionSettingImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AdvancedThreatProtectionSettingInner; -import com.azure.resourcemanager.security.models.AdvancedThreatProtectionSetting; - -public final class AdvancedThreatProtectionSettingImpl - implements AdvancedThreatProtectionSetting, AdvancedThreatProtectionSetting.Definition { - private AdvancedThreatProtectionSettingInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AdvancedThreatProtectionSettingImpl(AdvancedThreatProtectionSettingInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public Boolean isEnabled() { - return this.innerModel().isEnabled(); - } - - public AdvancedThreatProtectionSettingInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceId; - - public AdvancedThreatProtectionSettingImpl withExistingResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - public AdvancedThreatProtectionSetting create() { - this.innerObject = serviceManager.serviceClient() - .getAdvancedThreatProtections() - .createWithResponse(resourceId, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public AdvancedThreatProtectionSetting create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAdvancedThreatProtections() - .createWithResponse(resourceId, this.innerModel(), context) - .getValue(); - return this; - } - - AdvancedThreatProtectionSettingImpl(com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new AdvancedThreatProtectionSettingInner(); - this.serviceManager = serviceManager; - } - - public AdvancedThreatProtectionSetting refresh() { - this.innerObject = serviceManager.serviceClient() - .getAdvancedThreatProtections() - .getWithResponse(resourceId, Context.NONE) - .getValue(); - return this; - } - - public AdvancedThreatProtectionSetting refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAdvancedThreatProtections() - .getWithResponse(resourceId, context) - .getValue(); - return this; - } - - public AdvancedThreatProtectionSettingImpl withIsEnabled(Boolean isEnabled) { - this.innerModel().withIsEnabled(isEnabled); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdvancedThreatProtectionsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdvancedThreatProtectionsClientImpl.java deleted file mode 100644 index 575eda4d115c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdvancedThreatProtectionsClientImpl.java +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.AdvancedThreatProtectionsClient; -import com.azure.resourcemanager.security.fluent.models.AdvancedThreatProtectionSettingInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AdvancedThreatProtectionsClient. - */ -public final class AdvancedThreatProtectionsClientImpl implements AdvancedThreatProtectionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AdvancedThreatProtectionsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AdvancedThreatProtectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AdvancedThreatProtectionsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(AdvancedThreatProtectionsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAdvancedThreatProtections to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterAdvancedThreatProtections") - public interface AdvancedThreatProtectionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("settingName") String settingName, @HeaderParam("Accept") String accept, Context context); - - @Put("/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("settingName") String settingName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting, - Context context); - } - - /** - * Gets the Advanced Threat Protection settings for the specified resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 Advanced Threat Protection settings for the specified resource along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2019-01-01"; - final String settingName = "current"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), apiVersion, resourceId, settingName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the Advanced Threat Protection settings for the specified resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 Advanced Threat Protection settings for the specified resource along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2019-01-01"; - final String settingName = "current"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, resourceId, settingName, accept, context); - } - - /** - * Gets the Advanced Threat Protection settings for the specified resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 Advanced Threat Protection settings for the specified resource on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId) { - return getWithResponseAsync(resourceId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the Advanced Threat Protection settings for the specified resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 Advanced Threat Protection settings for the specified resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceId, Context context) { - return getWithResponseAsync(resourceId, context).block(); - } - - /** - * Gets the Advanced Threat Protection settings for the specified resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 Advanced Threat Protection settings for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AdvancedThreatProtectionSettingInner get(String resourceId) { - return getWithResponse(resourceId, Context.NONE).getValue(); - } - - /** - * Creates or updates the Advanced Threat Protection settings on a specified resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param advancedThreatProtectionSetting Advanced Threat Protection Settings. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advanced Threat Protection resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceId, - AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (advancedThreatProtectionSetting == null) { - return Mono.error(new IllegalArgumentException( - "Parameter advancedThreatProtectionSetting is required and cannot be null.")); - } else { - advancedThreatProtectionSetting.validate(); - } - final String apiVersion = "2019-01-01"; - final String settingName = "current"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, resourceId, settingName, - contentType, accept, advancedThreatProtectionSetting, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates the Advanced Threat Protection settings on a specified resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param advancedThreatProtectionSetting Advanced Threat Protection Settings. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advanced Threat Protection resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceId, - AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (advancedThreatProtectionSetting == null) { - return Mono.error(new IllegalArgumentException( - "Parameter advancedThreatProtectionSetting is required and cannot be null.")); - } else { - advancedThreatProtectionSetting.validate(); - } - final String apiVersion = "2019-01-01"; - final String settingName = "current"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, resourceId, settingName, contentType, accept, - advancedThreatProtectionSetting, context); - } - - /** - * Creates or updates the Advanced Threat Protection settings on a specified resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param advancedThreatProtectionSetting Advanced Threat Protection Settings. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advanced Threat Protection resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceId, - AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting) { - return createWithResponseAsync(resourceId, advancedThreatProtectionSetting) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates the Advanced Threat Protection settings on a specified resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param advancedThreatProtectionSetting Advanced Threat Protection Settings. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advanced Threat Protection resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String resourceId, - AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting, Context context) { - return createWithResponseAsync(resourceId, advancedThreatProtectionSetting, context).block(); - } - - /** - * Creates or updates the Advanced Threat Protection settings on a specified resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param advancedThreatProtectionSetting Advanced Threat Protection Settings. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advanced Threat Protection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AdvancedThreatProtectionSettingInner create(String resourceId, - AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting) { - return createWithResponse(resourceId, advancedThreatProtectionSetting, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdvancedThreatProtectionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdvancedThreatProtectionsImpl.java deleted file mode 100644 index e8d80d26daca..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdvancedThreatProtectionsImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.AdvancedThreatProtectionsClient; -import com.azure.resourcemanager.security.fluent.models.AdvancedThreatProtectionSettingInner; -import com.azure.resourcemanager.security.models.AdvancedThreatProtectionSetting; -import com.azure.resourcemanager.security.models.AdvancedThreatProtections; - -public final class AdvancedThreatProtectionsImpl implements AdvancedThreatProtections { - private static final ClientLogger LOGGER = new ClientLogger(AdvancedThreatProtectionsImpl.class); - - private final AdvancedThreatProtectionsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AdvancedThreatProtectionsImpl(AdvancedThreatProtectionsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceId, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AdvancedThreatProtectionSettingImpl(inner.getValue(), this.manager())); - } - - public AdvancedThreatProtectionSetting get(String resourceId) { - AdvancedThreatProtectionSettingInner inner = this.serviceClient().get(resourceId); - if (inner != null) { - return new AdvancedThreatProtectionSettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public AdvancedThreatProtectionSetting getById(String id) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}", "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - return this.getWithResponse(resourceId, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}", "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - return this.getWithResponse(resourceId, context); - } - - private AdvancedThreatProtectionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public AdvancedThreatProtectionSettingImpl define() { - return new AdvancedThreatProtectionSettingImpl(this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertImpl.java deleted file mode 100644 index 2096aa0294ed..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertImpl.java +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.AlertInner; -import com.azure.resourcemanager.security.models.Alert; -import com.azure.resourcemanager.security.models.AlertEntity; -import com.azure.resourcemanager.security.models.AlertPropertiesSupportingEvidence; -import com.azure.resourcemanager.security.models.AlertSeverity; -import com.azure.resourcemanager.security.models.AlertStatus; -import com.azure.resourcemanager.security.models.Intent; -import com.azure.resourcemanager.security.models.ResourceIdentifier; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class AlertImpl implements Alert { - private AlertInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AlertImpl(AlertInner innerObject, com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public String version() { - return this.innerModel().version(); - } - - public String alertType() { - return this.innerModel().alertType(); - } - - public String systemAlertId() { - return this.innerModel().systemAlertId(); - } - - public String productComponentName() { - return this.innerModel().productComponentName(); - } - - public String alertDisplayName() { - return this.innerModel().alertDisplayName(); - } - - public String description() { - return this.innerModel().description(); - } - - public AlertSeverity severity() { - return this.innerModel().severity(); - } - - public Intent intent() { - return this.innerModel().intent(); - } - - public OffsetDateTime startTimeUtc() { - return this.innerModel().startTimeUtc(); - } - - public OffsetDateTime endTimeUtc() { - return this.innerModel().endTimeUtc(); - } - - public List resourceIdentifiers() { - List inner = this.innerModel().resourceIdentifiers(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List remediationSteps() { - List inner = this.innerModel().remediationSteps(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String vendorName() { - return this.innerModel().vendorName(); - } - - public AlertStatus status() { - return this.innerModel().status(); - } - - public List> extendedLinks() { - List> inner = this.innerModel().extendedLinks(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String alertUri() { - return this.innerModel().alertUri(); - } - - public OffsetDateTime timeGeneratedUtc() { - return this.innerModel().timeGeneratedUtc(); - } - - public String productName() { - return this.innerModel().productName(); - } - - public OffsetDateTime processingEndTimeUtc() { - return this.innerModel().processingEndTimeUtc(); - } - - public List entities() { - List inner = this.innerModel().entities(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Boolean isIncident() { - return this.innerModel().isIncident(); - } - - public String correlationKey() { - return this.innerModel().correlationKey(); - } - - public Map extendedProperties() { - Map inner = this.innerModel().extendedProperties(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String compromisedEntity() { - return this.innerModel().compromisedEntity(); - } - - public List techniques() { - List inner = this.innerModel().techniques(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List subTechniques() { - List inner = this.innerModel().subTechniques(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public AlertPropertiesSupportingEvidence supportingEvidence() { - return this.innerModel().supportingEvidence(); - } - - public AlertInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java deleted file mode 100644 index f10b89b0bd9c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java +++ /dev/null @@ -1,2443 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.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.security.fluent.AlertsClient; -import com.azure.resourcemanager.security.fluent.models.AlertInner; -import com.azure.resourcemanager.security.implementation.models.AlertList; -import com.azure.resourcemanager.security.models.AlertSimulatorRequestBody; -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 AlertsClient. - */ -public final class AlertsClientImpl implements AlertsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AlertsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AlertsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AlertsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(AlertsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAlerts to be used by the proxy service to perform REST - * calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterAlerts") - public interface AlertsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getSubscriptionLevel(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @PathParam("alertName") String alertName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSubscriptionLevelByRegion(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateSubscriptionLevelStateToDismiss(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @PathParam("alertName") String alertName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateSubscriptionLevelStateToResolve(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @PathParam("alertName") String alertName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateSubscriptionLevelStateToActivate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @PathParam("alertName") String alertName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateSubscriptionLevelStateToInProgress(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @PathParam("alertName") String alertName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getResourceGroupLevel(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @PathParam("alertName") String alertName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listResourceGroupLevelByRegion(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateResourceGroupLevelStateToResolve(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @PathParam("alertName") String alertName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateResourceGroupLevelStateToDismiss(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @PathParam("alertName") String alertName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateResourceGroupLevelStateToActivate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @PathParam("alertName") String alertName, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateResourceGroupLevelStateToInProgress(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @PathParam("alertName") String alertName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alerts") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - 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({ "Accept: application/json;q=0.9" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> simulate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") AlertSimulatorRequestBody alertSimulatorRequestBody, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSubscriptionLevelByRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listResourceGroupLevelByRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get an alert that is associated with a subscription. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 alert that is associated with a subscription along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSubscriptionLevelWithResponseAsync(String ascLocation, String alertName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getSubscriptionLevel(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, alertName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get an alert that is associated with a subscription. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 alert that is associated with a subscription along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSubscriptionLevelWithResponseAsync(String ascLocation, String alertName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getSubscriptionLevel(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - ascLocation, alertName, accept, context); - } - - /** - * Get an alert that is associated with a subscription. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 alert that is associated with a subscription on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getSubscriptionLevelAsync(String ascLocation, String alertName) { - return getSubscriptionLevelWithResponseAsync(ascLocation, alertName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get an alert that is associated with a subscription. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 alert that is associated with a subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSubscriptionLevelWithResponse(String ascLocation, String alertName, - Context context) { - return getSubscriptionLevelWithResponseAsync(ascLocation, alertName, context).block(); - } - - /** - * Get an alert that is associated with a subscription. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 alert that is associated with a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AlertInner getSubscriptionLevel(String ascLocation, String alertName) { - return getSubscriptionLevelWithResponse(ascLocation, alertName, Context.NONE).getValue(); - } - - /** - * List all the alerts that are associated with the subscription that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSubscriptionLevelByRegionSinglePageAsync(String ascLocation) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listSubscriptionLevelByRegion(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all the alerts that are associated with the subscription that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSubscriptionLevelByRegionSinglePageAsync(String ascLocation, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSubscriptionLevelByRegion(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - ascLocation, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List all the alerts that are associated with the subscription that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSubscriptionLevelByRegionAsync(String ascLocation) { - return new PagedFlux<>(() -> listSubscriptionLevelByRegionSinglePageAsync(ascLocation), - nextLink -> listSubscriptionLevelByRegionNextSinglePageAsync(nextLink)); - } - - /** - * List all the alerts that are associated with the subscription that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSubscriptionLevelByRegionAsync(String ascLocation, Context context) { - return new PagedFlux<>(() -> listSubscriptionLevelByRegionSinglePageAsync(ascLocation, context), - nextLink -> listSubscriptionLevelByRegionNextSinglePageAsync(nextLink, context)); - } - - /** - * List all the alerts that are associated with the subscription that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSubscriptionLevelByRegion(String ascLocation) { - return new PagedIterable<>(listSubscriptionLevelByRegionAsync(ascLocation)); - } - - /** - * List all the alerts that are associated with the subscription that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSubscriptionLevelByRegion(String ascLocation, Context context) { - return new PagedIterable<>(listSubscriptionLevelByRegionAsync(ascLocation, context)); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> updateSubscriptionLevelStateToDismissWithResponseAsync(String ascLocation, - String alertName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - return FluxUtil - .withContext(context -> service.updateSubscriptionLevelStateToDismiss(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, alertName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> updateSubscriptionLevelStateToDismissWithResponseAsync(String ascLocation, - String alertName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - context = this.client.mergeContext(context); - return service.updateSubscriptionLevelStateToDismiss(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, alertName, context); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 updateSubscriptionLevelStateToDismissAsync(String ascLocation, String alertName) { - return updateSubscriptionLevelStateToDismissWithResponseAsync(ascLocation, alertName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 updateSubscriptionLevelStateToDismissWithResponse(String ascLocation, String alertName, - Context context) { - return updateSubscriptionLevelStateToDismissWithResponseAsync(ascLocation, alertName, context).block(); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 updateSubscriptionLevelStateToDismiss(String ascLocation, String alertName) { - updateSubscriptionLevelStateToDismissWithResponse(ascLocation, alertName, Context.NONE); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> updateSubscriptionLevelStateToResolveWithResponseAsync(String ascLocation, - String alertName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - return FluxUtil - .withContext(context -> service.updateSubscriptionLevelStateToResolve(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, alertName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> updateSubscriptionLevelStateToResolveWithResponseAsync(String ascLocation, - String alertName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - context = this.client.mergeContext(context); - return service.updateSubscriptionLevelStateToResolve(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, alertName, context); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 updateSubscriptionLevelStateToResolveAsync(String ascLocation, String alertName) { - return updateSubscriptionLevelStateToResolveWithResponseAsync(ascLocation, alertName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 updateSubscriptionLevelStateToResolveWithResponse(String ascLocation, String alertName, - Context context) { - return updateSubscriptionLevelStateToResolveWithResponseAsync(ascLocation, alertName, context).block(); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 updateSubscriptionLevelStateToResolve(String ascLocation, String alertName) { - updateSubscriptionLevelStateToResolveWithResponse(ascLocation, alertName, Context.NONE); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> updateSubscriptionLevelStateToActivateWithResponseAsync(String ascLocation, - String alertName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - return FluxUtil - .withContext(context -> service.updateSubscriptionLevelStateToActivate(this.client.getEndpoint(), - apiVersion, this.client.getSubscriptionId(), ascLocation, alertName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> updateSubscriptionLevelStateToActivateWithResponseAsync(String ascLocation, - String alertName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - context = this.client.mergeContext(context); - return service.updateSubscriptionLevelStateToActivate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, alertName, context); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 updateSubscriptionLevelStateToActivateAsync(String ascLocation, String alertName) { - return updateSubscriptionLevelStateToActivateWithResponseAsync(ascLocation, alertName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 updateSubscriptionLevelStateToActivateWithResponse(String ascLocation, String alertName, - Context context) { - return updateSubscriptionLevelStateToActivateWithResponseAsync(ascLocation, alertName, context).block(); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 updateSubscriptionLevelStateToActivate(String ascLocation, String alertName) { - updateSubscriptionLevelStateToActivateWithResponse(ascLocation, alertName, Context.NONE); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> updateSubscriptionLevelStateToInProgressWithResponseAsync(String ascLocation, - String alertName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - return FluxUtil - .withContext(context -> service.updateSubscriptionLevelStateToInProgress(this.client.getEndpoint(), - apiVersion, this.client.getSubscriptionId(), ascLocation, alertName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> updateSubscriptionLevelStateToInProgressWithResponseAsync(String ascLocation, - String alertName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - context = this.client.mergeContext(context); - return service.updateSubscriptionLevelStateToInProgress(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, alertName, context); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 updateSubscriptionLevelStateToInProgressAsync(String ascLocation, String alertName) { - return updateSubscriptionLevelStateToInProgressWithResponseAsync(ascLocation, alertName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 updateSubscriptionLevelStateToInProgressWithResponse(String ascLocation, String alertName, - Context context) { - return updateSubscriptionLevelStateToInProgressWithResponseAsync(ascLocation, alertName, context).block(); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 updateSubscriptionLevelStateToInProgress(String ascLocation, String alertName) { - updateSubscriptionLevelStateToInProgressWithResponse(ascLocation, alertName, Context.NONE); - } - - /** - * Get an alert that is associated a resource group or a resource in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 alert that is associated a resource group or a resource in a resource group along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getResourceGroupLevelWithResponseAsync(String resourceGroupName, - String ascLocation, String alertName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getResourceGroupLevel(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, ascLocation, alertName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get an alert that is associated a resource group or a resource in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 alert that is associated a resource group or a resource in a resource group along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getResourceGroupLevelWithResponseAsync(String resourceGroupName, - String ascLocation, String alertName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getResourceGroupLevel(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, ascLocation, alertName, accept, context); - } - - /** - * Get an alert that is associated a resource group or a resource in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 alert that is associated a resource group or a resource in a resource group on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getResourceGroupLevelAsync(String resourceGroupName, String ascLocation, - String alertName) { - return getResourceGroupLevelWithResponseAsync(resourceGroupName, ascLocation, alertName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get an alert that is associated a resource group or a resource in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 alert that is associated a resource group or a resource in a resource group along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getResourceGroupLevelWithResponse(String resourceGroupName, String ascLocation, - String alertName, Context context) { - return getResourceGroupLevelWithResponseAsync(resourceGroupName, ascLocation, alertName, context).block(); - } - - /** - * Get an alert that is associated a resource group or a resource in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 alert that is associated a resource group or a resource in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AlertInner getResourceGroupLevel(String resourceGroupName, String ascLocation, String alertName) { - return getResourceGroupLevelWithResponse(resourceGroupName, ascLocation, alertName, Context.NONE).getValue(); - } - - /** - * List all the alerts that are associated with the resource group that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listResourceGroupLevelByRegionSinglePageAsync(String ascLocation, - String resourceGroupName) { - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listResourceGroupLevelByRegion(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, ascLocation, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all the alerts that are associated with the resource group that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listResourceGroupLevelByRegionSinglePageAsync(String ascLocation, - String resourceGroupName, Context context) { - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listResourceGroupLevelByRegion(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, ascLocation, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List all the alerts that are associated with the resource group that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listResourceGroupLevelByRegionAsync(String ascLocation, String resourceGroupName) { - return new PagedFlux<>(() -> listResourceGroupLevelByRegionSinglePageAsync(ascLocation, resourceGroupName), - nextLink -> listResourceGroupLevelByRegionNextSinglePageAsync(nextLink)); - } - - /** - * List all the alerts that are associated with the resource group that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listResourceGroupLevelByRegionAsync(String ascLocation, String resourceGroupName, - Context context) { - return new PagedFlux<>( - () -> listResourceGroupLevelByRegionSinglePageAsync(ascLocation, resourceGroupName, context), - nextLink -> listResourceGroupLevelByRegionNextSinglePageAsync(nextLink, context)); - } - - /** - * List all the alerts that are associated with the resource group that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName) { - return new PagedIterable<>(listResourceGroupLevelByRegionAsync(ascLocation, resourceGroupName)); - } - - /** - * List all the alerts that are associated with the resource group that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName, - Context context) { - return new PagedIterable<>(listResourceGroupLevelByRegionAsync(ascLocation, resourceGroupName, context)); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> updateResourceGroupLevelStateToResolveWithResponseAsync(String resourceGroupName, - String ascLocation, String alertName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - return FluxUtil - .withContext(context -> service.updateResourceGroupLevelStateToResolve(this.client.getEndpoint(), - apiVersion, this.client.getSubscriptionId(), resourceGroupName, ascLocation, alertName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> updateResourceGroupLevelStateToResolveWithResponseAsync(String resourceGroupName, - String ascLocation, String alertName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - context = this.client.mergeContext(context); - return service.updateResourceGroupLevelStateToResolve(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, ascLocation, alertName, context); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 updateResourceGroupLevelStateToResolveAsync(String resourceGroupName, String ascLocation, - String alertName) { - return updateResourceGroupLevelStateToResolveWithResponseAsync(resourceGroupName, ascLocation, alertName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 updateResourceGroupLevelStateToResolveWithResponse(String resourceGroupName, - String ascLocation, String alertName, Context context) { - return updateResourceGroupLevelStateToResolveWithResponseAsync(resourceGroupName, ascLocation, alertName, - context).block(); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 updateResourceGroupLevelStateToResolve(String resourceGroupName, String ascLocation, String alertName) { - updateResourceGroupLevelStateToResolveWithResponse(resourceGroupName, ascLocation, alertName, Context.NONE); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> updateResourceGroupLevelStateToDismissWithResponseAsync(String resourceGroupName, - String ascLocation, String alertName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - return FluxUtil - .withContext(context -> service.updateResourceGroupLevelStateToDismiss(this.client.getEndpoint(), - apiVersion, this.client.getSubscriptionId(), resourceGroupName, ascLocation, alertName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> updateResourceGroupLevelStateToDismissWithResponseAsync(String resourceGroupName, - String ascLocation, String alertName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - context = this.client.mergeContext(context); - return service.updateResourceGroupLevelStateToDismiss(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, ascLocation, alertName, context); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 updateResourceGroupLevelStateToDismissAsync(String resourceGroupName, String ascLocation, - String alertName) { - return updateResourceGroupLevelStateToDismissWithResponseAsync(resourceGroupName, ascLocation, alertName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 updateResourceGroupLevelStateToDismissWithResponse(String resourceGroupName, - String ascLocation, String alertName, Context context) { - return updateResourceGroupLevelStateToDismissWithResponseAsync(resourceGroupName, ascLocation, alertName, - context).block(); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 updateResourceGroupLevelStateToDismiss(String resourceGroupName, String ascLocation, String alertName) { - updateResourceGroupLevelStateToDismissWithResponse(resourceGroupName, ascLocation, alertName, Context.NONE); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> updateResourceGroupLevelStateToActivateWithResponseAsync(String resourceGroupName, - String ascLocation, String alertName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - return FluxUtil - .withContext(context -> service.updateResourceGroupLevelStateToActivate(this.client.getEndpoint(), - apiVersion, this.client.getSubscriptionId(), resourceGroupName, ascLocation, alertName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> updateResourceGroupLevelStateToActivateWithResponseAsync(String resourceGroupName, - String ascLocation, String alertName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - context = this.client.mergeContext(context); - return service.updateResourceGroupLevelStateToActivate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, ascLocation, alertName, context); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 updateResourceGroupLevelStateToActivateAsync(String resourceGroupName, String ascLocation, - String alertName) { - return updateResourceGroupLevelStateToActivateWithResponseAsync(resourceGroupName, ascLocation, alertName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 updateResourceGroupLevelStateToActivateWithResponse(String resourceGroupName, - String ascLocation, String alertName, Context context) { - return updateResourceGroupLevelStateToActivateWithResponseAsync(resourceGroupName, ascLocation, alertName, - context).block(); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 updateResourceGroupLevelStateToActivate(String resourceGroupName, String ascLocation, - String alertName) { - updateResourceGroupLevelStateToActivateWithResponse(resourceGroupName, ascLocation, alertName, Context.NONE); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> updateResourceGroupLevelStateToInProgressWithResponseAsync(String resourceGroupName, - String ascLocation, String alertName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - return FluxUtil - .withContext(context -> service.updateResourceGroupLevelStateToInProgress(this.client.getEndpoint(), - apiVersion, this.client.getSubscriptionId(), resourceGroupName, ascLocation, alertName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> updateResourceGroupLevelStateToInProgressWithResponseAsync(String resourceGroupName, - String ascLocation, String alertName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - context = this.client.mergeContext(context); - return service.updateResourceGroupLevelStateToInProgress(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, ascLocation, alertName, context); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 updateResourceGroupLevelStateToInProgressAsync(String resourceGroupName, String ascLocation, - String alertName) { - return updateResourceGroupLevelStateToInProgressWithResponseAsync(resourceGroupName, ascLocation, alertName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 updateResourceGroupLevelStateToInProgressWithResponse(String resourceGroupName, - String ascLocation, String alertName, Context context) { - return updateResourceGroupLevelStateToInProgressWithResponseAsync(resourceGroupName, ascLocation, alertName, - context).block(); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 updateResourceGroupLevelStateToInProgress(String resourceGroupName, String ascLocation, - String alertName) { - updateResourceGroupLevelStateToInProgressWithResponse(resourceGroupName, ascLocation, alertName, Context.NONE); - } - - /** - * List all the alerts that are associated with the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all the alerts that are associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-01-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)); - } - - /** - * List all the alerts that are associated with the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List all the alerts that are associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List all the alerts that are associated with the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List all the alerts that are associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * List all the alerts that are associated with the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - 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.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), apiVersion, - 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 the alerts that are associated with the 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 list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 (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.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List all the alerts that are associated with the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List all the alerts that are associated with the 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 list of security alerts as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * List all the alerts that are associated with the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * List all the alerts that are associated with the 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 list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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>> simulateWithResponseAsync(String ascLocation, - AlertSimulatorRequestBody alertSimulatorRequestBody) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertSimulatorRequestBody == null) { - return Mono.error( - new IllegalArgumentException("Parameter alertSimulatorRequestBody is required and cannot be null.")); - } else { - alertSimulatorRequestBody.validate(); - } - final String apiVersion = "2022-01-01"; - final String contentType = "application/json"; - return FluxUtil - .withContext(context -> service.simulate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, contentType, alertSimulatorRequestBody, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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>> simulateWithResponseAsync(String ascLocation, - AlertSimulatorRequestBody alertSimulatorRequestBody, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertSimulatorRequestBody == null) { - return Mono.error( - new IllegalArgumentException("Parameter alertSimulatorRequestBody is required and cannot be null.")); - } else { - alertSimulatorRequestBody.validate(); - } - final String apiVersion = "2022-01-01"; - final String contentType = "application/json"; - context = this.client.mergeContext(context); - return service.simulate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), ascLocation, - contentType, alertSimulatorRequestBody, context); - } - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginSimulateAsync(String ascLocation, - AlertSimulatorRequestBody alertSimulatorRequestBody) { - Mono>> mono = simulateWithResponseAsync(ascLocation, alertSimulatorRequestBody); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginSimulateAsync(String ascLocation, - AlertSimulatorRequestBody alertSimulatorRequestBody, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = simulateWithResponseAsync(ascLocation, alertSimulatorRequestBody, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginSimulate(String ascLocation, - AlertSimulatorRequestBody alertSimulatorRequestBody) { - return this.beginSimulateAsync(ascLocation, alertSimulatorRequestBody).getSyncPoller(); - } - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginSimulate(String ascLocation, - AlertSimulatorRequestBody alertSimulatorRequestBody, Context context) { - return this.beginSimulateAsync(ascLocation, alertSimulatorRequestBody, context).getSyncPoller(); - } - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 simulateAsync(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody) { - return beginSimulateAsync(ascLocation, alertSimulatorRequestBody).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 simulateAsync(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody, - Context context) { - return beginSimulateAsync(ascLocation, alertSimulatorRequestBody, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 simulate(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody) { - simulateAsync(ascLocation, alertSimulatorRequestBody).block(); - } - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody The request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 simulate(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody, Context context) { - simulateAsync(ascLocation, alertSimulatorRequestBody, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSubscriptionLevelByRegionNextSinglePageAsync(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.listSubscriptionLevelByRegionNext(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 list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSubscriptionLevelByRegionNextSinglePageAsync(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.listSubscriptionLevelByRegionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listResourceGroupLevelByRegionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listResourceGroupLevelByRegionNext(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 list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listResourceGroupLevelByRegionNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listResourceGroupLevelByRegionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts 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 list of security alerts 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)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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( - context -> 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)) - .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 list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsImpl.java deleted file mode 100644 index 92a3393b9eeb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsImpl.java +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.AlertsClient; -import com.azure.resourcemanager.security.fluent.models.AlertInner; -import com.azure.resourcemanager.security.models.Alert; -import com.azure.resourcemanager.security.models.AlertSimulatorRequestBody; -import com.azure.resourcemanager.security.models.Alerts; - -public final class AlertsImpl implements Alerts { - private static final ClientLogger LOGGER = new ClientLogger(AlertsImpl.class); - - private final AlertsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AlertsImpl(AlertsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getSubscriptionLevelWithResponse(String ascLocation, String alertName, Context context) { - Response inner - = this.serviceClient().getSubscriptionLevelWithResponse(ascLocation, alertName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AlertImpl(inner.getValue(), this.manager())); - } - - public Alert getSubscriptionLevel(String ascLocation, String alertName) { - AlertInner inner = this.serviceClient().getSubscriptionLevel(ascLocation, alertName); - if (inner != null) { - return new AlertImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listSubscriptionLevelByRegion(String ascLocation) { - PagedIterable inner = this.serviceClient().listSubscriptionLevelByRegion(ascLocation); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); - } - - public PagedIterable listSubscriptionLevelByRegion(String ascLocation, Context context) { - PagedIterable inner = this.serviceClient().listSubscriptionLevelByRegion(ascLocation, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); - } - - public Response updateSubscriptionLevelStateToDismissWithResponse(String ascLocation, String alertName, - Context context) { - return this.serviceClient().updateSubscriptionLevelStateToDismissWithResponse(ascLocation, alertName, context); - } - - public void updateSubscriptionLevelStateToDismiss(String ascLocation, String alertName) { - this.serviceClient().updateSubscriptionLevelStateToDismiss(ascLocation, alertName); - } - - public Response updateSubscriptionLevelStateToResolveWithResponse(String ascLocation, String alertName, - Context context) { - return this.serviceClient().updateSubscriptionLevelStateToResolveWithResponse(ascLocation, alertName, context); - } - - public void updateSubscriptionLevelStateToResolve(String ascLocation, String alertName) { - this.serviceClient().updateSubscriptionLevelStateToResolve(ascLocation, alertName); - } - - public Response updateSubscriptionLevelStateToActivateWithResponse(String ascLocation, String alertName, - Context context) { - return this.serviceClient().updateSubscriptionLevelStateToActivateWithResponse(ascLocation, alertName, context); - } - - public void updateSubscriptionLevelStateToActivate(String ascLocation, String alertName) { - this.serviceClient().updateSubscriptionLevelStateToActivate(ascLocation, alertName); - } - - public Response updateSubscriptionLevelStateToInProgressWithResponse(String ascLocation, String alertName, - Context context) { - return this.serviceClient() - .updateSubscriptionLevelStateToInProgressWithResponse(ascLocation, alertName, context); - } - - public void updateSubscriptionLevelStateToInProgress(String ascLocation, String alertName) { - this.serviceClient().updateSubscriptionLevelStateToInProgress(ascLocation, alertName); - } - - public Response getResourceGroupLevelWithResponse(String resourceGroupName, String ascLocation, - String alertName, Context context) { - Response inner = this.serviceClient() - .getResourceGroupLevelWithResponse(resourceGroupName, ascLocation, alertName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AlertImpl(inner.getValue(), this.manager())); - } - - public Alert getResourceGroupLevel(String resourceGroupName, String ascLocation, String alertName) { - AlertInner inner = this.serviceClient().getResourceGroupLevel(resourceGroupName, ascLocation, alertName); - if (inner != null) { - return new AlertImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName) { - PagedIterable inner - = this.serviceClient().listResourceGroupLevelByRegion(ascLocation, resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); - } - - public PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName, - Context context) { - PagedIterable inner - = this.serviceClient().listResourceGroupLevelByRegion(ascLocation, resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); - } - - public Response updateResourceGroupLevelStateToResolveWithResponse(String resourceGroupName, - String ascLocation, String alertName, Context context) { - return this.serviceClient() - .updateResourceGroupLevelStateToResolveWithResponse(resourceGroupName, ascLocation, alertName, context); - } - - public void updateResourceGroupLevelStateToResolve(String resourceGroupName, String ascLocation, String alertName) { - this.serviceClient().updateResourceGroupLevelStateToResolve(resourceGroupName, ascLocation, alertName); - } - - public Response updateResourceGroupLevelStateToDismissWithResponse(String resourceGroupName, - String ascLocation, String alertName, Context context) { - return this.serviceClient() - .updateResourceGroupLevelStateToDismissWithResponse(resourceGroupName, ascLocation, alertName, context); - } - - public void updateResourceGroupLevelStateToDismiss(String resourceGroupName, String ascLocation, String alertName) { - this.serviceClient().updateResourceGroupLevelStateToDismiss(resourceGroupName, ascLocation, alertName); - } - - public Response updateResourceGroupLevelStateToActivateWithResponse(String resourceGroupName, - String ascLocation, String alertName, Context context) { - return this.serviceClient() - .updateResourceGroupLevelStateToActivateWithResponse(resourceGroupName, ascLocation, alertName, context); - } - - public void updateResourceGroupLevelStateToActivate(String resourceGroupName, String ascLocation, - String alertName) { - this.serviceClient().updateResourceGroupLevelStateToActivate(resourceGroupName, ascLocation, alertName); - } - - public Response updateResourceGroupLevelStateToInProgressWithResponse(String resourceGroupName, - String ascLocation, String alertName, Context context) { - return this.serviceClient() - .updateResourceGroupLevelStateToInProgressWithResponse(resourceGroupName, ascLocation, alertName, context); - } - - public void updateResourceGroupLevelStateToInProgress(String resourceGroupName, String ascLocation, - String alertName) { - this.serviceClient().updateResourceGroupLevelStateToInProgress(resourceGroupName, ascLocation, alertName); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); - } - - public void simulate(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody) { - this.serviceClient().simulate(ascLocation, alertSimulatorRequestBody); - } - - public void simulate(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody, Context context) { - this.serviceClient().simulate(ascLocation, alertSimulatorRequestBody, context); - } - - private AlertsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRuleImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRuleImpl.java deleted file mode 100644 index ac8a0cbae20d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRuleImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -import com.azure.resourcemanager.security.models.AlertsSuppressionRule; -import com.azure.resourcemanager.security.models.RuleState; -import com.azure.resourcemanager.security.models.SuppressionAlertsScope; -import java.time.OffsetDateTime; - -public final class AlertsSuppressionRuleImpl implements AlertsSuppressionRule { - private AlertsSuppressionRuleInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AlertsSuppressionRuleImpl(AlertsSuppressionRuleInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public String alertType() { - return this.innerModel().alertType(); - } - - public OffsetDateTime lastModifiedUtc() { - return this.innerModel().lastModifiedUtc(); - } - - public OffsetDateTime expirationDateUtc() { - return this.innerModel().expirationDateUtc(); - } - - public String reason() { - return this.innerModel().reason(); - } - - public RuleState state() { - return this.innerModel().state(); - } - - public String comment() { - return this.innerModel().comment(); - } - - public SuppressionAlertsScope suppressionAlertsScope() { - return this.innerModel().suppressionAlertsScope(); - } - - public AlertsSuppressionRuleInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRulesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRulesClientImpl.java deleted file mode 100644 index a58a12a07fbb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRulesClientImpl.java +++ /dev/null @@ -1,637 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.resourcemanager.security.fluent.AlertsSuppressionRulesClient; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -import com.azure.resourcemanager.security.implementation.models.AlertsSuppressionRulesList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AlertsSuppressionRulesClient. - */ -public final class AlertsSuppressionRulesClientImpl implements AlertsSuppressionRulesClient { - /** - * The proxy service used to perform REST calls. - */ - private final AlertsSuppressionRulesService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AlertsSuppressionRulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AlertsSuppressionRulesClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(AlertsSuppressionRulesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAlertsSuppressionRules to be used by the proxy service - * to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterAlertsSuppressionRules") - public interface AlertsSuppressionRulesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("alertsSuppressionRuleName") String alertsSuppressionRuleName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("alertsSuppressionRuleName") String alertsSuppressionRuleName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") AlertsSuppressionRuleInner alertsSuppressionRule, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("alertsSuppressionRuleName") String alertsSuppressionRuleName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("AlertType") String alertType, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String alertsSuppressionRuleName) { - 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 (alertsSuppressionRuleName == null) { - return Mono.error( - new IllegalArgumentException("Parameter alertsSuppressionRuleName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - alertsSuppressionRuleName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String alertsSuppressionRuleName, - 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 (alertsSuppressionRuleName == null) { - return Mono.error( - new IllegalArgumentException("Parameter alertsSuppressionRuleName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - alertsSuppressionRuleName, accept, context); - } - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String alertsSuppressionRuleName) { - return getWithResponseAsync(alertsSuppressionRuleName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String alertsSuppressionRuleName, Context context) { - return getWithResponseAsync(alertsSuppressionRuleName, context).block(); - } - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AlertsSuppressionRuleInner get(String alertsSuppressionRuleName) { - return getWithResponse(alertsSuppressionRuleName, Context.NONE).getValue(); - } - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 suppression rule along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String alertsSuppressionRuleName, - AlertsSuppressionRuleInner alertsSuppressionRule) { - 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 (alertsSuppressionRuleName == null) { - return Mono.error( - new IllegalArgumentException("Parameter alertsSuppressionRuleName is required and cannot be null.")); - } - if (alertsSuppressionRule == null) { - return Mono - .error(new IllegalArgumentException("Parameter alertsSuppressionRule is required and cannot be null.")); - } else { - alertsSuppressionRule.validate(); - } - final String apiVersion = "2019-01-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - alertsSuppressionRuleName, contentType, accept, alertsSuppressionRule, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 suppression rule along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String alertsSuppressionRuleName, - AlertsSuppressionRuleInner alertsSuppressionRule, 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 (alertsSuppressionRuleName == null) { - return Mono.error( - new IllegalArgumentException("Parameter alertsSuppressionRuleName is required and cannot be null.")); - } - if (alertsSuppressionRule == null) { - return Mono - .error(new IllegalArgumentException("Parameter alertsSuppressionRule is required and cannot be null.")); - } else { - alertsSuppressionRule.validate(); - } - final String apiVersion = "2019-01-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - alertsSuppressionRuleName, contentType, accept, alertsSuppressionRule, context); - } - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 suppression rule on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String alertsSuppressionRuleName, - AlertsSuppressionRuleInner alertsSuppressionRule) { - return updateWithResponseAsync(alertsSuppressionRuleName, alertsSuppressionRule) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 suppression rule along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String alertsSuppressionRuleName, - AlertsSuppressionRuleInner alertsSuppressionRule, Context context) { - return updateWithResponseAsync(alertsSuppressionRuleName, alertsSuppressionRule, context).block(); - } - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 suppression rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AlertsSuppressionRuleInner update(String alertsSuppressionRuleName, - AlertsSuppressionRuleInner alertsSuppressionRule) { - return updateWithResponse(alertsSuppressionRuleName, alertsSuppressionRule, Context.NONE).getValue(); - } - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 alertsSuppressionRuleName) { - 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 (alertsSuppressionRuleName == null) { - return Mono.error( - new IllegalArgumentException("Parameter alertsSuppressionRuleName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), alertsSuppressionRuleName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 alertsSuppressionRuleName, 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 (alertsSuppressionRuleName == null) { - return Mono.error( - new IllegalArgumentException("Parameter alertsSuppressionRuleName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - alertsSuppressionRuleName, context); - } - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 alertsSuppressionRuleName) { - return deleteWithResponseAsync(alertsSuppressionRuleName).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String alertsSuppressionRuleName, Context context) { - return deleteWithResponseAsync(alertsSuppressionRuleName, context).block(); - } - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 alertsSuppressionRuleName) { - deleteWithResponse(alertsSuppressionRuleName, Context.NONE); - } - - /** - * List of all the dismiss rules for the given subscription. - * - * @param alertType Type of the alert to get rules for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String alertType) { - 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-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - alertType, 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 of all the dismiss rules for the given subscription. - * - * @param alertType Type of the alert to get rules for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String alertType, 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-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), alertType, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List of all the dismiss rules for the given subscription. - * - * @param alertType Type of the alert to get rules for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String alertType) { - return new PagedFlux<>(() -> listSinglePageAsync(alertType), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List of all the dismiss rules for the given 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 suppression rules list for subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String alertType = null; - return new PagedFlux<>(() -> listSinglePageAsync(alertType), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List of all the dismiss rules for the given subscription. - * - * @param alertType Type of the alert to get rules for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String alertType, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(alertType, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List of all the dismiss rules for the given 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 suppression rules list for subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String alertType = null; - return new PagedIterable<>(listAsync(alertType)); - } - - /** - * List of all the dismiss rules for the given subscription. - * - * @param alertType Type of the alert to get rules for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String alertType, Context context) { - return new PagedIterable<>(listAsync(alertType, 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 suppression rules list for subscription 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 suppression rules list for subscription 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRulesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRulesImpl.java deleted file mode 100644 index 267333b0229a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRulesImpl.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.AlertsSuppressionRulesClient; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -import com.azure.resourcemanager.security.models.AlertsSuppressionRule; -import com.azure.resourcemanager.security.models.AlertsSuppressionRules; - -public final class AlertsSuppressionRulesImpl implements AlertsSuppressionRules { - private static final ClientLogger LOGGER = new ClientLogger(AlertsSuppressionRulesImpl.class); - - private final AlertsSuppressionRulesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AlertsSuppressionRulesImpl(AlertsSuppressionRulesClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String alertsSuppressionRuleName, Context context) { - Response inner - = this.serviceClient().getWithResponse(alertsSuppressionRuleName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AlertsSuppressionRuleImpl(inner.getValue(), this.manager())); - } - - public AlertsSuppressionRule get(String alertsSuppressionRuleName) { - AlertsSuppressionRuleInner inner = this.serviceClient().get(alertsSuppressionRuleName); - if (inner != null) { - return new AlertsSuppressionRuleImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response updateWithResponse(String alertsSuppressionRuleName, - AlertsSuppressionRuleInner alertsSuppressionRule, Context context) { - Response inner - = this.serviceClient().updateWithResponse(alertsSuppressionRuleName, alertsSuppressionRule, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AlertsSuppressionRuleImpl(inner.getValue(), this.manager())); - } - - public AlertsSuppressionRule update(String alertsSuppressionRuleName, - AlertsSuppressionRuleInner alertsSuppressionRule) { - AlertsSuppressionRuleInner inner - = this.serviceClient().update(alertsSuppressionRuleName, alertsSuppressionRule); - if (inner != null) { - return new AlertsSuppressionRuleImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String alertsSuppressionRuleName, Context context) { - return this.serviceClient().deleteWithResponse(alertsSuppressionRuleName, context); - } - - public void delete(String alertsSuppressionRuleName) { - this.serviceClient().delete(alertsSuppressionRuleName); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertsSuppressionRuleImpl(inner1, this.manager())); - } - - public PagedIterable list(String alertType, Context context) { - PagedIterable inner = this.serviceClient().list(alertType, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertsSuppressionRuleImpl(inner1, this.manager())); - } - - private AlertsSuppressionRulesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsClientImpl.java deleted file mode 100644 index fd1bf3a159ea..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsClientImpl.java +++ /dev/null @@ -1,615 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.AllowedConnectionsClient; -import com.azure.resourcemanager.security.fluent.models.AllowedConnectionsResourceInner; -import com.azure.resourcemanager.security.implementation.models.AllowedConnectionsList; -import com.azure.resourcemanager.security.models.ConnectionType; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AllowedConnectionsClient. - */ -public final class AllowedConnectionsClientImpl implements AllowedConnectionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AllowedConnectionsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AllowedConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AllowedConnectionsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(AllowedConnectionsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAllowedConnections to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterAllowedConnections") - public interface AllowedConnectionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections/{connectionType}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @PathParam("connectionType") ConnectionType connectionType, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegion(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/allowedConnections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location, based on connection - * type. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param connectionType The type of allowed connections (Internal, External). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 all possible traffic between resources for the subscription and location, based on connection - * type along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String ascLocation, ConnectionType connectionType) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (connectionType == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionType is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, ascLocation, connectionType, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location, based on connection - * type. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param connectionType The type of allowed connections (Internal, External). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 all possible traffic between resources for the subscription and location, based on connection - * type along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String ascLocation, ConnectionType connectionType, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (connectionType == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionType is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - ascLocation, connectionType, accept, context); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location, based on connection - * type. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param connectionType The type of allowed connections (Internal, External). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 all possible traffic between resources for the subscription and location, based on connection - * type on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String ascLocation, - ConnectionType connectionType) { - return getWithResponseAsync(resourceGroupName, ascLocation, connectionType) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location, based on connection - * type. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param connectionType The type of allowed connections (Internal, External). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 all possible traffic between resources for the subscription and location, based on connection - * type along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String ascLocation, - ConnectionType connectionType, Context context) { - return getWithResponseAsync(resourceGroupName, ascLocation, connectionType, context).block(); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location, based on connection - * type. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param connectionType The type of allowed connections (Internal, External). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 all possible traffic between resources for the subscription and location, based on connection - * type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AllowedConnectionsResourceInner get(String resourceGroupName, String ascLocation, - ConnectionType connectionType) { - return getWithResponse(resourceGroupName, ascLocation, connectionType, Context.NONE).getValue(); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync(String ascLocation) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByHomeRegion(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync(String ascLocation, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByHomeRegion(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), ascLocation, - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation) { - return new PagedFlux<>(() -> listByHomeRegionSinglePageAsync(ascLocation), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink)); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation, Context context) { - return new PagedFlux<>(() -> listByHomeRegionSinglePageAsync(ascLocation, context), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation) { - return new PagedIterable<>(listByHomeRegionAsync(ascLocation)); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation, Context context) { - return new PagedIterable<>(listByHomeRegionAsync(ascLocation, context)); - } - - /** - * Gets the list of all possible traffic between resources for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the list of all possible traffic between resources for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-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)); - } - - /** - * Gets the list of all possible traffic between resources for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the list of all possible traffic between resources for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription 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 list of all possible traffic between resources for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets the list of all possible traffic between resources for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription 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 the list of all possible traffic between resources for the subscription and location along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @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 of all possible traffic between resources for the subscription 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 the list of all possible traffic between resources for the subscription 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsImpl.java deleted file mode 100644 index 0eacf2d892c5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.AllowedConnectionsClient; -import com.azure.resourcemanager.security.fluent.models.AllowedConnectionsResourceInner; -import com.azure.resourcemanager.security.models.AllowedConnections; -import com.azure.resourcemanager.security.models.AllowedConnectionsResource; -import com.azure.resourcemanager.security.models.ConnectionType; - -public final class AllowedConnectionsImpl implements AllowedConnections { - private static final ClientLogger LOGGER = new ClientLogger(AllowedConnectionsImpl.class); - - private final AllowedConnectionsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AllowedConnectionsImpl(AllowedConnectionsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String ascLocation, - ConnectionType connectionType, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, ascLocation, connectionType, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AllowedConnectionsResourceImpl(inner.getValue(), this.manager())); - } - - public AllowedConnectionsResource get(String resourceGroupName, String ascLocation, ConnectionType connectionType) { - AllowedConnectionsResourceInner inner - = this.serviceClient().get(resourceGroupName, ascLocation, connectionType); - if (inner != null) { - return new AllowedConnectionsResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listByHomeRegion(String ascLocation) { - PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new AllowedConnectionsResourceImpl(inner1, this.manager())); - } - - public PagedIterable listByHomeRegion(String ascLocation, Context context) { - PagedIterable inner - = this.serviceClient().listByHomeRegion(ascLocation, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new AllowedConnectionsResourceImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new AllowedConnectionsResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new AllowedConnectionsResourceImpl(inner1, this.manager())); - } - - private AllowedConnectionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsResourceImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsResourceImpl.java deleted file mode 100644 index c8d600916caa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsResourceImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.AllowedConnectionsResourceInner; -import com.azure.resourcemanager.security.models.AllowedConnectionsResource; -import com.azure.resourcemanager.security.models.ConnectableResource; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class AllowedConnectionsResourceImpl implements AllowedConnectionsResource { - private AllowedConnectionsResourceInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AllowedConnectionsResourceImpl(AllowedConnectionsResourceInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 String location() { - return this.innerModel().location(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public OffsetDateTime calculatedDateTime() { - return this.innerModel().calculatedDateTime(); - } - - public List connectableResources() { - List inner = this.innerModel().connectableResources(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public AllowedConnectionsResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionImpl.java deleted file mode 100644 index 27b08ff50280..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionInner; -import com.azure.resourcemanager.security.models.ApiCollection; -import com.azure.resourcemanager.security.models.ProvisioningState; - -public final class ApiCollectionImpl implements ApiCollection { - private ApiCollectionInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ApiCollectionImpl(ApiCollectionInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String discoveredVia() { - return this.innerModel().discoveredVia(); - } - - public String baseUrl() { - return this.innerModel().baseUrl(); - } - - public Long numberOfApiEndpoints() { - return this.innerModel().numberOfApiEndpoints(); - } - - public Long numberOfInactiveApiEndpoints() { - return this.innerModel().numberOfInactiveApiEndpoints(); - } - - public Long numberOfUnauthenticatedApiEndpoints() { - return this.innerModel().numberOfUnauthenticatedApiEndpoints(); - } - - public Long numberOfExternalApiEndpoints() { - return this.innerModel().numberOfExternalApiEndpoints(); - } - - public Long numberOfApiEndpointsWithSensitiveDataExposed() { - return this.innerModel().numberOfApiEndpointsWithSensitiveDataExposed(); - } - - public String sensitivityLabel() { - return this.innerModel().sensitivityLabel(); - } - - public ApiCollectionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsClientImpl.java deleted file mode 100644 index fa946ab5a361..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsClientImpl.java +++ /dev/null @@ -1,1428 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -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.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.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.security.fluent.ApiCollectionsClient; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionInner; -import com.azure.resourcemanager.security.implementation.models.ApiCollectionList; -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 ApiCollectionsClient. - */ -public final class ApiCollectionsClientImpl implements ApiCollectionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ApiCollectionsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of ApiCollectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ApiCollectionsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(ApiCollectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterApiCollections to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterApiCollections") - public interface ApiCollectionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByAzureApiManagementService(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName, - @PathParam("apiId") String apiId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> onboardAzureApiManagementApi(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName, - @PathParam("apiId") String apiId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiId}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> offboardAzureApiManagementApi(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName, - @PathParam("apiId") String apiId, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAzureApiManagementService(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("serviceName") String serviceName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/apiCollections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/apiCollections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - 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" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByAzureApiManagementServiceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets an onboarded Azure API Management API - * - * Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. If an Azure API - * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the - * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 onboarded Azure API Management API - * - * Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByAzureApiManagementServiceWithResponseAsync(String resourceGroupName, - String serviceName, String apiId) { - 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 (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - if (apiId == null) { - return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); - } - final String apiVersion = "2023-11-15"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByAzureApiManagementService(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serviceName, apiId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an onboarded Azure API Management API - * - * Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. If an Azure API - * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the - * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 onboarded Azure API Management API - * - * Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByAzureApiManagementServiceWithResponseAsync(String resourceGroupName, - String serviceName, String apiId, 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 (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - if (apiId == null) { - return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); - } - final String apiVersion = "2023-11-15"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByAzureApiManagementService(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serviceName, apiId, accept, context); - } - - /** - * Gets an onboarded Azure API Management API - * - * Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. If an Azure API - * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the - * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 onboarded Azure API Management API - * - * Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByAzureApiManagementServiceAsync(String resourceGroupName, String serviceName, - String apiId) { - return getByAzureApiManagementServiceWithResponseAsync(resourceGroupName, serviceName, apiId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets an onboarded Azure API Management API - * - * Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. If an Azure API - * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the - * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 onboarded Azure API Management API - * - * Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByAzureApiManagementServiceWithResponse(String resourceGroupName, - String serviceName, String apiId, Context context) { - return getByAzureApiManagementServiceWithResponseAsync(resourceGroupName, serviceName, apiId, context).block(); - } - - /** - * Gets an onboarded Azure API Management API - * - * Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. If an Azure API - * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the - * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 onboarded Azure API Management API - * - * Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApiCollectionInner getByAzureApiManagementService(String resourceGroupName, String serviceName, - String apiId) { - return getByAzureApiManagementServiceWithResponse(resourceGroupName, serviceName, apiId, Context.NONE) - .getValue(); - } - - /** - * Onboard an Azure API Management API to Microsoft Defender for APIs - * - * Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the - * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been - * detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 API collection as represented by Microsoft Defender for APIs along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> onboardAzureApiManagementApiWithResponseAsync(String resourceGroupName, - String serviceName, String apiId) { - 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 (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - if (apiId == null) { - return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); - } - final String apiVersion = "2023-11-15"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.onboardAzureApiManagementApi(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serviceName, apiId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Onboard an Azure API Management API to Microsoft Defender for APIs - * - * Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the - * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been - * detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 API collection as represented by Microsoft Defender for APIs along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> onboardAzureApiManagementApiWithResponseAsync(String resourceGroupName, - String serviceName, String apiId, 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 (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - if (apiId == null) { - return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); - } - final String apiVersion = "2023-11-15"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.onboardAzureApiManagementApi(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serviceName, apiId, accept, context); - } - - /** - * Onboard an Azure API Management API to Microsoft Defender for APIs - * - * Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the - * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been - * detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 an API collection as represented by Microsoft Defender for APIs. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ApiCollectionInner> - beginOnboardAzureApiManagementApiAsync(String resourceGroupName, String serviceName, String apiId) { - Mono>> mono - = onboardAzureApiManagementApiWithResponseAsync(resourceGroupName, serviceName, apiId); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ApiCollectionInner.class, ApiCollectionInner.class, this.client.getContext()); - } - - /** - * Onboard an Azure API Management API to Microsoft Defender for APIs - * - * Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the - * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been - * detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 an API collection as represented by Microsoft Defender for APIs. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ApiCollectionInner> beginOnboardAzureApiManagementApiAsync( - String resourceGroupName, String serviceName, String apiId, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = onboardAzureApiManagementApiWithResponseAsync(resourceGroupName, serviceName, apiId, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ApiCollectionInner.class, ApiCollectionInner.class, context); - } - - /** - * Onboard an Azure API Management API to Microsoft Defender for APIs - * - * Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the - * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been - * detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 an API collection as represented by Microsoft Defender for APIs. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ApiCollectionInner> - beginOnboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId) { - return this.beginOnboardAzureApiManagementApiAsync(resourceGroupName, serviceName, apiId).getSyncPoller(); - } - - /** - * Onboard an Azure API Management API to Microsoft Defender for APIs - * - * Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the - * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been - * detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 an API collection as represented by Microsoft Defender for APIs. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ApiCollectionInner> - beginOnboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId, Context context) { - return this.beginOnboardAzureApiManagementApiAsync(resourceGroupName, serviceName, apiId, context) - .getSyncPoller(); - } - - /** - * Onboard an Azure API Management API to Microsoft Defender for APIs - * - * Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the - * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been - * detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 API collection as represented by Microsoft Defender for APIs on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono onboardAzureApiManagementApiAsync(String resourceGroupName, String serviceName, - String apiId) { - return beginOnboardAzureApiManagementApiAsync(resourceGroupName, serviceName, apiId).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Onboard an Azure API Management API to Microsoft Defender for APIs - * - * Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the - * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been - * detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 API collection as represented by Microsoft Defender for APIs on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono onboardAzureApiManagementApiAsync(String resourceGroupName, String serviceName, - String apiId, Context context) { - return beginOnboardAzureApiManagementApiAsync(resourceGroupName, serviceName, apiId, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Onboard an Azure API Management API to Microsoft Defender for APIs - * - * Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the - * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been - * detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 API collection as represented by Microsoft Defender for APIs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApiCollectionInner onboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId) { - return onboardAzureApiManagementApiAsync(resourceGroupName, serviceName, apiId).block(); - } - - /** - * Onboard an Azure API Management API to Microsoft Defender for APIs - * - * Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the - * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been - * detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 API collection as represented by Microsoft Defender for APIs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApiCollectionInner onboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId, - Context context) { - return onboardAzureApiManagementApiAsync(resourceGroupName, serviceName, apiId, context).block(); - } - - /** - * Offboard an Azure API Management API from Microsoft Defender for APIs - * - * Offboard an Azure API Management API from Microsoft Defender for APIs. The system will stop monitoring the - * operations within the Azure API Management API for intrusive behaviors. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> offboardAzureApiManagementApiWithResponseAsync(String resourceGroupName, - String serviceName, String apiId) { - 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 (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - if (apiId == null) { - return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); - } - final String apiVersion = "2023-11-15"; - return FluxUtil - .withContext(context -> service.offboardAzureApiManagementApi(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serviceName, apiId, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Offboard an Azure API Management API from Microsoft Defender for APIs - * - * Offboard an Azure API Management API from Microsoft Defender for APIs. The system will stop monitoring the - * operations within the Azure API Management API for intrusive behaviors. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> offboardAzureApiManagementApiWithResponseAsync(String resourceGroupName, - String serviceName, String apiId, 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 (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - if (apiId == null) { - return Mono.error(new IllegalArgumentException("Parameter apiId is required and cannot be null.")); - } - final String apiVersion = "2023-11-15"; - context = this.client.mergeContext(context); - return service.offboardAzureApiManagementApi(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serviceName, apiId, context); - } - - /** - * Offboard an Azure API Management API from Microsoft Defender for APIs - * - * Offboard an Azure API Management API from Microsoft Defender for APIs. The system will stop monitoring the - * operations within the Azure API Management API for intrusive behaviors. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 offboardAzureApiManagementApiAsync(String resourceGroupName, String serviceName, String apiId) { - return offboardAzureApiManagementApiWithResponseAsync(resourceGroupName, serviceName, apiId) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Offboard an Azure API Management API from Microsoft Defender for APIs - * - * Offboard an Azure API Management API from Microsoft Defender for APIs. The system will stop monitoring the - * operations within the Azure API Management API for intrusive behaviors. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 offboardAzureApiManagementApiWithResponse(String resourceGroupName, String serviceName, - String apiId, Context context) { - return offboardAzureApiManagementApiWithResponseAsync(resourceGroupName, serviceName, apiId, context).block(); - } - - /** - * Offboard an Azure API Management API from Microsoft Defender for APIs - * - * Offboard an Azure API Management API from Microsoft Defender for APIs. The system will stop monitoring the - * operations within the Azure API Management API for intrusive behaviors. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 offboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId) { - offboardAzureApiManagementApiWithResponse(resourceGroupName, serviceName, apiId, Context.NONE); - } - - /** - * Gets a list of onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. If an Azure API - * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the - * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByAzureApiManagementServiceSinglePageAsync(String resourceGroupName, String serviceName) { - 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 (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - final String apiVersion = "2023-11-15"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByAzureApiManagementService(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, serviceName, 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 onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. If an Azure API - * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the - * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management 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 list of onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByAzureApiManagementServiceSinglePageAsync(String resourceGroupName, String serviceName, 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 (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - final String apiVersion = "2023-11-15"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByAzureApiManagementService(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, serviceName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets a list of onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. If an Azure API - * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the - * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAzureApiManagementServiceAsync(String resourceGroupName, - String serviceName) { - return new PagedFlux<>(() -> listByAzureApiManagementServiceSinglePageAsync(resourceGroupName, serviceName), - nextLink -> listByAzureApiManagementServiceNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. If an Azure API - * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the - * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management 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 list of onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByAzureApiManagementServiceAsync(String resourceGroupName, - String serviceName, Context context) { - return new PagedFlux<>( - () -> listByAzureApiManagementServiceSinglePageAsync(resourceGroupName, serviceName, context), - nextLink -> listByAzureApiManagementServiceNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. If an Azure API - * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the - * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAzureApiManagementService(String resourceGroupName, - String serviceName) { - return new PagedIterable<>(listByAzureApiManagementServiceAsync(resourceGroupName, serviceName)); - } - - /** - * Gets a list of onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. If an Azure API - * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the - * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management 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 list of onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByAzureApiManagementService(String resourceGroupName, - String serviceName, Context context) { - return new PagedIterable<>(listByAzureApiManagementServiceAsync(resourceGroupName, serviceName, context)); - } - - /** - * Gets a list of API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs. - * - * @throws 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 API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs - * 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2023-11-15"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs - * 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2023-11-15"; - 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)); - } - - /** - * Gets a list of API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs. - * - * @throws 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 API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs. - * - * @throws 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 API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets a list of API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets a list of API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs. - * - * @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 a list of API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs - * 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 (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.")); - } - final String apiVersion = "2023-11-15"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), apiVersion, - 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())); - } - - /** - * Gets a list of API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs. - * - * @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 API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs - * along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 (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.")); - } - final String apiVersion = "2023-11-15"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets a list of API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs. - * - * @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 a list of API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs. - * - * @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 API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs. - * - * @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 a list of API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Gets a list of API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs. - * - * @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 API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Gets a list of onboarded Azure API Management APIs - * - * 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 onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByAzureApiManagementServiceNextSinglePageAsync(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.listByAzureApiManagementServiceNext(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())); - } - - /** - * Gets a list of onboarded Azure API Management APIs - * - * 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 onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByAzureApiManagementServiceNextSinglePageAsync(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.listByAzureApiManagementServiceNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets a list of API collections within a subscription - * - * 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 API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs - * along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of API collections within a subscription - * - * 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 API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs - * along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets a list of API collections within a resource group - * - * 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 API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs - * along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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( - context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of API collections within a resource group - * - * 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 API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs - * along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsImpl.java deleted file mode 100644 index 59b2d8d9ffee..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsImpl.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.ApiCollectionsClient; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionInner; -import com.azure.resourcemanager.security.models.ApiCollection; -import com.azure.resourcemanager.security.models.ApiCollections; - -public final class ApiCollectionsImpl implements ApiCollections { - private static final ClientLogger LOGGER = new ClientLogger(ApiCollectionsImpl.class); - - private final ApiCollectionsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ApiCollectionsImpl(ApiCollectionsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getByAzureApiManagementServiceWithResponse(String resourceGroupName, - String serviceName, String apiId, Context context) { - Response inner = this.serviceClient() - .getByAzureApiManagementServiceWithResponse(resourceGroupName, serviceName, apiId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApiCollectionImpl(inner.getValue(), this.manager())); - } - - public ApiCollection getByAzureApiManagementService(String resourceGroupName, String serviceName, String apiId) { - ApiCollectionInner inner - = this.serviceClient().getByAzureApiManagementService(resourceGroupName, serviceName, apiId); - if (inner != null) { - return new ApiCollectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public ApiCollection onboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId) { - ApiCollectionInner inner - = this.serviceClient().onboardAzureApiManagementApi(resourceGroupName, serviceName, apiId); - if (inner != null) { - return new ApiCollectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public ApiCollection onboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId, - Context context) { - ApiCollectionInner inner - = this.serviceClient().onboardAzureApiManagementApi(resourceGroupName, serviceName, apiId, context); - if (inner != null) { - return new ApiCollectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response offboardAzureApiManagementApiWithResponse(String resourceGroupName, String serviceName, - String apiId, Context context) { - return this.serviceClient() - .offboardAzureApiManagementApiWithResponse(resourceGroupName, serviceName, apiId, context); - } - - public void offboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId) { - this.serviceClient().offboardAzureApiManagementApi(resourceGroupName, serviceName, apiId); - } - - public PagedIterable listByAzureApiManagementService(String resourceGroupName, String serviceName) { - PagedIterable inner - = this.serviceClient().listByAzureApiManagementService(resourceGroupName, serviceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiCollectionImpl(inner1, this.manager())); - } - - public PagedIterable listByAzureApiManagementService(String resourceGroupName, String serviceName, - Context context) { - PagedIterable inner - = this.serviceClient().listByAzureApiManagementService(resourceGroupName, serviceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiCollectionImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiCollectionImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiCollectionImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiCollectionImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApiCollectionImpl(inner1, this.manager())); - } - - private ApiCollectionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationImpl.java deleted file mode 100644 index 19f01d03355c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationImpl.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.util.Collections; -import java.util.List; - -public final class ApplicationImpl implements Application, Application.Definition, Application.Update { - private ApplicationInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager 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 String displayName() { - return this.innerModel().displayName(); - } - - public String description() { - return this.innerModel().description(); - } - - public ApplicationSourceResourceType sourceResourceType() { - return this.innerModel().sourceResourceType(); - } - - public List conditionSets() { - List inner = this.innerModel().conditionSets(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public ApplicationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String applicationId; - - public Application create() { - this.innerObject = serviceManager.serviceClient() - .getApplications() - .createOrUpdateWithResponse(applicationId, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public Application create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getApplications() - .createOrUpdateWithResponse(applicationId, this.innerModel(), context) - .getValue(); - return this; - } - - ApplicationImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new ApplicationInner(); - this.serviceManager = serviceManager; - this.applicationId = name; - } - - public ApplicationImpl update() { - return this; - } - - public Application apply() { - this.innerObject = serviceManager.serviceClient() - .getApplications() - .createOrUpdateWithResponse(applicationId, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public Application apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getApplications() - .createOrUpdateWithResponse(applicationId, this.innerModel(), context) - .getValue(); - return this; - } - - ApplicationImpl(ApplicationInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.applicationId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "applications"); - } - - public Application refresh() { - this.innerObject - = serviceManager.serviceClient().getApplications().getWithResponse(applicationId, Context.NONE).getValue(); - return this; - } - - public Application refresh(Context context) { - this.innerObject - = serviceManager.serviceClient().getApplications().getWithResponse(applicationId, context).getValue(); - return this; - } - - public ApplicationImpl withDisplayName(String displayName) { - this.innerModel().withDisplayName(displayName); - return this; - } - - public ApplicationImpl withDescription(String description) { - this.innerModel().withDescription(description); - return this; - } - - public ApplicationImpl withSourceResourceType(ApplicationSourceResourceType sourceResourceType) { - this.innerModel().withSourceResourceType(sourceResourceType); - return this; - } - - public ApplicationImpl withConditionSets(List conditionSets) { - this.innerModel().withConditionSets(conditionSets); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationsClientImpl.java deleted file mode 100644 index 54030e0b8228..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationsClientImpl.java +++ /dev/null @@ -1,605 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.resourcemanager.security.fluent.ApplicationsClient; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.implementation.models.ApplicationsList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ApplicationsClient. - */ -public final class ApplicationsClientImpl implements ApplicationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ApplicationsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of ApplicationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ApplicationsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(ApplicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterApplications to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterApplications") - public interface ApplicationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("applicationId") String applicationId, @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("applicationId") String applicationId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") ApplicationInner application, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("applicationId") String applicationId, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 application for the requested scope by applicationId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String applicationId) { - 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 (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - applicationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 application for the requested scope by applicationId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String applicationId, 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 (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), applicationId, - accept, context); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 application for the requested scope by applicationId on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String applicationId) { - return getWithResponseAsync(applicationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 application for the requested scope by applicationId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String applicationId, Context context) { - return getWithResponseAsync(applicationId, context).block(); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 application for the requested scope by applicationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationInner get(String applicationId) { - return getWithResponse(applicationId, Context.NONE).getValue(); - } - - /** - * Creates or update a security application on the given subscription. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String applicationId, - ApplicationInner application) { - 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 (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - if (application == null) { - return Mono.error(new IllegalArgumentException("Parameter application is required and cannot be null.")); - } else { - application.validate(); - } - final String apiVersion = "2022-07-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), applicationId, contentType, accept, application, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or update a security application on the given subscription. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String applicationId, - ApplicationInner application, 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 (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - if (application == null) { - return Mono.error(new IllegalArgumentException("Parameter application is required and cannot be null.")); - } else { - application.validate(); - } - final String apiVersion = "2022-07-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - applicationId, contentType, accept, application, context); - } - - /** - * Creates or update a security application on the given subscription. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String applicationId, ApplicationInner application) { - return createOrUpdateWithResponseAsync(applicationId, application) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or update a security application on the given subscription. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String applicationId, ApplicationInner application, - Context context) { - return createOrUpdateWithResponseAsync(applicationId, application, context).block(); - } - - /** - * Creates or update a security application on the given subscription. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationInner createOrUpdate(String applicationId, ApplicationInner application) { - return createOrUpdateWithResponse(applicationId, application, Context.NONE).getValue(); - } - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 applicationId) { - 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 (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), applicationId, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 applicationId, 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 (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), applicationId, - context); - } - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 applicationId) { - return deleteWithResponseAsync(applicationId).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String applicationId, Context context) { - return deleteWithResponseAsync(applicationId, context).block(); - } - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 applicationId) { - deleteWithResponse(applicationId, Context.NONE); - } - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @throws 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 relevant applications over a subscription level scope 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 relevant applications over a subscription level scope 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - 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)); - } - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @throws 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 relevant applications over a subscription level scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 relevant applications over a subscription level scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @throws 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 relevant applications over a subscription level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 relevant applications over a subscription level scope 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 a list of all relevant applications over a subscription level scope 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 a list of all relevant applications over a subscription level scope 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationsImpl.java deleted file mode 100644 index d28156841200..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationsImpl.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.ApplicationsClient; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.Applications; - -public final class ApplicationsImpl implements Applications { - private static final ClientLogger LOGGER = new ClientLogger(ApplicationsImpl.class); - - private final ApplicationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ApplicationsImpl(ApplicationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String applicationId, Context context) { - Response inner = this.serviceClient().getWithResponse(applicationId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApplicationImpl(inner.getValue(), this.manager())); - } - - public Application get(String applicationId) { - ApplicationInner inner = this.serviceClient().get(applicationId); - if (inner != null) { - return new ApplicationImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String applicationId, Context context) { - return this.serviceClient().deleteWithResponse(applicationId, context); - } - - public void delete(String applicationId) { - this.serviceClient().delete(applicationId); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); - } - - public Application getById(String id) { - String applicationId = ResourceManagerUtils.getValueFromIdByName(id, "applications"); - if (applicationId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); - } - return this.getWithResponse(applicationId, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String applicationId = ResourceManagerUtils.getValueFromIdByName(id, "applications"); - if (applicationId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); - } - return this.getWithResponse(applicationId, context); - } - - public void deleteById(String id) { - String applicationId = ResourceManagerUtils.getValueFromIdByName(id, "applications"); - if (applicationId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); - } - this.deleteWithResponse(applicationId, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String applicationId = ResourceManagerUtils.getValueFromIdByName(id, "applications"); - if (applicationId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); - } - return this.deleteWithResponse(applicationId, context); - } - - private ApplicationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public ApplicationImpl define(String name) { - return new ApplicationImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AscLocationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AscLocationImpl.java deleted file mode 100644 index 4a673acd5c1c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AscLocationImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.AscLocationInner; -import com.azure.resourcemanager.security.models.AscLocation; - -public final class AscLocationImpl implements AscLocation { - private AscLocationInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AscLocationImpl(AscLocationInner innerObject, com.azure.resourcemanager.security.SecurityManager 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 Object properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public AscLocationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsClientImpl.java deleted file mode 100644 index 3601476d13e8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsClientImpl.java +++ /dev/null @@ -1,646 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.resourcemanager.security.fluent.AssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner; -import com.azure.resourcemanager.security.implementation.models.SecurityAssessmentList; -import com.azure.resourcemanager.security.models.ExpandEnum; -import com.azure.resourcemanager.security.models.SecurityAssessment; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AssessmentsClient. - */ -public final class AssessmentsClientImpl implements AssessmentsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AssessmentsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AssessmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AssessmentsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(AssessmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAssessments to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterAssessments") - public interface AssessmentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("assessmentName") String assessmentName, @QueryParam("$expand") ExpandEnum expand, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("assessmentName") String assessmentName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") SecurityAssessment assessment, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("assessmentName") String assessmentName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/assessments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get a security assessment on your scanned resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param expand OData expand. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security assessment on your scanned resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, - String assessmentName, ExpandEnum expand) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - final String apiVersion = "2025-05-04"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, resourceId, assessmentName, - expand, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a security assessment on your scanned resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security assessment on your scanned resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, - String assessmentName, ExpandEnum expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - final String apiVersion = "2025-05-04"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, resourceId, assessmentName, expand, accept, context); - } - - /** - * Get a security assessment on your scanned resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security assessment on your scanned resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId, String assessmentName) { - final ExpandEnum expand = null; - return getWithResponseAsync(resourceId, assessmentName, expand) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a security assessment on your scanned resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security assessment on your scanned resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceId, String assessmentName, - ExpandEnum expand, Context context) { - return getWithResponseAsync(resourceId, assessmentName, expand, context).block(); - } - - /** - * Get a security assessment on your scanned resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security assessment on your scanned resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentResponseInner get(String resourceId, String assessmentName) { - final ExpandEnum expand = null; - return getWithResponse(resourceId, assessmentName, expand, Context.NONE).getValue(); - } - - /** - * Create a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assessment Calculated assessment on a pre-defined assessment metadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment on a resource - response format along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceId, - String assessmentName, SecurityAssessment assessment) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assessment == null) { - return Mono.error(new IllegalArgumentException("Parameter assessment is required and cannot be null.")); - } else { - assessment.validate(); - } - final String apiVersion = "2025-05-04"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, resourceId, - assessmentName, contentType, accept, assessment, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assessment Calculated assessment on a pre-defined assessment metadata. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment on a resource - response format along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceId, - String assessmentName, SecurityAssessment assessment, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assessment == null) { - return Mono.error(new IllegalArgumentException("Parameter assessment is required and cannot be null.")); - } else { - assessment.validate(); - } - final String apiVersion = "2025-05-04"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, resourceId, assessmentName, contentType, - accept, assessment, context); - } - - /** - * Create a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assessment Calculated assessment on a pre-defined assessment metadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment on a resource - response format on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceId, String assessmentName, - SecurityAssessment assessment) { - return createOrUpdateWithResponseAsync(resourceId, assessmentName, assessment) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assessment Calculated assessment on a pre-defined assessment metadata. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment on a resource - response format along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceId, - String assessmentName, SecurityAssessment assessment, Context context) { - return createOrUpdateWithResponseAsync(resourceId, assessmentName, assessment, context).block(); - } - - /** - * Create a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assessment Calculated assessment on a pre-defined assessment metadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment on a resource - response format. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentResponseInner createOrUpdate(String resourceId, String assessmentName, - SecurityAssessment assessment) { - return createOrUpdateWithResponse(resourceId, assessmentName, assessment, Context.NONE).getValue(); - } - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 resourceId, String assessmentName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - final String apiVersion = "2025-05-04"; - return FluxUtil - .withContext( - context -> service.delete(this.client.getEndpoint(), apiVersion, resourceId, assessmentName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment 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 resourceId, String assessmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - final String apiVersion = "2025-05-04"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, resourceId, assessmentName, context); - } - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 resourceId, String assessmentName) { - return deleteWithResponseAsync(resourceId, assessmentName).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceId, String assessmentName, Context context) { - return deleteWithResponseAsync(resourceId, assessmentName, context).block(); - } - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 resourceId, String assessmentName) { - deleteWithResponse(resourceId, assessmentName, Context.NONE); - } - - /** - * Get security assessments on all your scanned resources inside a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 security assessments on all your scanned resources inside a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2025-05-04"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, 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 security assessments on all your scanned resources inside a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 security assessments on all your scanned resources inside a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2025-05-04"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get security assessments on all your scanned resources inside a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 security assessments on all your scanned resources inside a scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get security assessments on all your scanned resources inside a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 security assessments on all your scanned resources inside a scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get security assessments on all your scanned resources inside a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 security assessments on all your scanned resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(listAsync(scope)); - } - - /** - * Get security assessments on all your scanned resources inside a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 security assessments on all your scanned resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(listAsync(scope, 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 security assessments on all your scanned resources inside a scope 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 security assessments on all your scanned resources inside a scope 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsImpl.java deleted file mode 100644 index 1eebf9cb92f3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsImpl.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.AssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner; -import com.azure.resourcemanager.security.models.Assessments; -import com.azure.resourcemanager.security.models.ExpandEnum; -import com.azure.resourcemanager.security.models.SecurityAssessmentResponse; - -public final class AssessmentsImpl implements Assessments { - private static final ClientLogger LOGGER = new ClientLogger(AssessmentsImpl.class); - - private final AssessmentsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AssessmentsImpl(AssessmentsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceId, String assessmentName, - ExpandEnum expand, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceId, assessmentName, expand, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityAssessmentResponseImpl(inner.getValue(), this.manager())); - } - - public SecurityAssessmentResponse get(String resourceId, String assessmentName) { - SecurityAssessmentResponseInner inner = this.serviceClient().get(resourceId, assessmentName); - if (inner != null) { - return new SecurityAssessmentResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse(String resourceId, String assessmentName, Context context) { - return this.serviceClient().deleteWithResponse(resourceId, assessmentName, context); - } - - public void deleteByResourceGroup(String resourceId, String assessmentName) { - this.serviceClient().delete(resourceId, assessmentName); - } - - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new SecurityAssessmentResponseImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new SecurityAssessmentResponseImpl(inner1, this.manager())); - } - - public SecurityAssessmentResponse getById(String id) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String assessmentName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "assessmentName"); - if (assessmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); - } - ExpandEnum localExpand = null; - return this.getWithResponse(resourceId, assessmentName, localExpand, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, ExpandEnum expand, Context context) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String assessmentName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "assessmentName"); - if (assessmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); - } - return this.getWithResponse(resourceId, assessmentName, expand, context); - } - - public void deleteById(String id) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String assessmentName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "assessmentName"); - if (assessmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); - } - this.deleteByResourceGroupWithResponse(resourceId, assessmentName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String assessmentName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "assessmentName"); - if (assessmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); - } - return this.deleteByResourceGroupWithResponse(resourceId, assessmentName, context); - } - - private AssessmentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public SecurityAssessmentResponseImpl define(String name) { - return new SecurityAssessmentResponseImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasClientImpl.java deleted file mode 100644 index 36ebdd8c78c3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasClientImpl.java +++ /dev/null @@ -1,917 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.resourcemanager.security.fluent.AssessmentsMetadatasClient; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner; -import com.azure.resourcemanager.security.implementation.models.SecurityAssessmentMetadataResponseList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AssessmentsMetadatasClient. - */ -public final class AssessmentsMetadatasClientImpl implements AssessmentsMetadatasClient { - /** - * The proxy service used to perform REST calls. - */ - private final AssessmentsMetadatasService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AssessmentsMetadatasClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AssessmentsMetadatasClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(AssessmentsMetadatasService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAssessmentsMetadatas to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterAssessmentsMetadatas") - public interface AssessmentsMetadatasService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getInSubscription( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("assessmentMetadataName") String assessmentMetadataName, @HeaderParam("Accept") String accept, - Context context); - - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createInSubscription( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("assessmentMetadataName") String assessmentMetadataName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") SecurityAssessmentMetadataResponseInner assessmentMetadata, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteInSubscription(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("assessmentMetadataName") String assessmentMetadataName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscription( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("assessmentMetadataName") String assessmentMetadataName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Security/assessmentMetadata") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") 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> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type in a specific subscription along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getInSubscriptionWithResponseAsync(String assessmentMetadataName) { - 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 (assessmentMetadataName == null) { - return Mono.error( - new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); - } - final String apiVersion = "2025-05-04"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getInSubscription(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), assessmentMetadataName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment 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 metadata information on an assessment type in a specific subscription along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getInSubscriptionWithResponseAsync(String assessmentMetadataName, 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 (assessmentMetadataName == null) { - return Mono.error( - new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); - } - final String apiVersion = "2025-05-04"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getInSubscription(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - assessmentMetadataName, accept, context); - } - - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type in a specific subscription on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getInSubscriptionAsync(String assessmentMetadataName) { - return getInSubscriptionWithResponseAsync(assessmentMetadataName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment 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 metadata information on an assessment type in a specific subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response - getInSubscriptionWithResponse(String assessmentMetadataName, Context context) { - return getInSubscriptionWithResponseAsync(assessmentMetadataName, context).block(); - } - - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type in a specific subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentMetadataResponseInner getInSubscription(String assessmentMetadataName) { - return getInSubscriptionWithResponse(assessmentMetadataName, Context.NONE).getValue(); - } - - /** - * Create metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param assessmentMetadata AssessmentMetadata object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata response along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createInSubscriptionWithResponseAsync( - String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata) { - 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 (assessmentMetadataName == null) { - return Mono.error( - new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); - } - if (assessmentMetadata == null) { - return Mono - .error(new IllegalArgumentException("Parameter assessmentMetadata is required and cannot be null.")); - } else { - assessmentMetadata.validate(); - } - final String apiVersion = "2025-05-04"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createInSubscription(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), assessmentMetadataName, contentType, accept, assessmentMetadata, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param assessmentMetadata AssessmentMetadata object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata response along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createInSubscriptionWithResponseAsync( - String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata, 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 (assessmentMetadataName == null) { - return Mono.error( - new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); - } - if (assessmentMetadata == null) { - return Mono - .error(new IllegalArgumentException("Parameter assessmentMetadata is required and cannot be null.")); - } else { - assessmentMetadata.validate(); - } - final String apiVersion = "2025-05-04"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createInSubscription(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - assessmentMetadataName, contentType, accept, assessmentMetadata, context); - } - - /** - * Create metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param assessmentMetadata AssessmentMetadata object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createInSubscriptionAsync(String assessmentMetadataName, - SecurityAssessmentMetadataResponseInner assessmentMetadata) { - return createInSubscriptionWithResponseAsync(assessmentMetadataName, assessmentMetadata) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param assessmentMetadata AssessmentMetadata object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createInSubscriptionWithResponse( - String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata, Context context) { - return createInSubscriptionWithResponseAsync(assessmentMetadataName, assessmentMetadata, context).block(); - } - - /** - * Create metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param assessmentMetadata AssessmentMetadata object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentMetadataResponseInner createInSubscription(String assessmentMetadataName, - SecurityAssessmentMetadataResponseInner assessmentMetadata) { - return createInSubscriptionWithResponse(assessmentMetadataName, assessmentMetadata, Context.NONE).getValue(); - } - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> deleteInSubscriptionWithResponseAsync(String assessmentMetadataName) { - 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 (assessmentMetadataName == null) { - return Mono.error( - new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); - } - final String apiVersion = "2025-05-04"; - return FluxUtil - .withContext(context -> service.deleteInSubscription(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), assessmentMetadataName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment 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> deleteInSubscriptionWithResponseAsync(String assessmentMetadataName, 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 (assessmentMetadataName == null) { - return Mono.error( - new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); - } - final String apiVersion = "2025-05-04"; - context = this.client.mergeContext(context); - return service.deleteInSubscription(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - assessmentMetadataName, context); - } - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 deleteInSubscriptionAsync(String assessmentMetadataName) { - return deleteInSubscriptionWithResponseAsync(assessmentMetadataName).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteInSubscriptionWithResponse(String assessmentMetadataName, Context context) { - return deleteInSubscriptionWithResponseAsync(assessmentMetadataName, context).block(); - } - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 deleteInSubscription(String assessmentMetadataName) { - deleteInSubscriptionWithResponse(assessmentMetadataName, Context.NONE); - } - - /** - * Get metadata information on all assessment types in a specific 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 metadata information on all assessment types in a specific subscription along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionSinglePageAsync() { - 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 = "2025-05-04"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listBySubscription(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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get metadata information on all assessment types in a specific 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 metadata information on all assessment types in a specific subscription along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBySubscriptionSinglePageAsync(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 = "2025-05-04"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscription(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)); - } - - /** - * Get metadata information on all assessment types in a specific 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 metadata information on all assessment types in a specific subscription as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionAsync() { - return new PagedFlux<>(() -> listBySubscriptionSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Get metadata information on all assessment types in a specific 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 metadata information on all assessment types in a specific subscription as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionAsync(Context context) { - return new PagedFlux<>(() -> listBySubscriptionSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Get metadata information on all assessment types in a specific 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 metadata information on all assessment types in a specific subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySubscription() { - return new PagedIterable<>(listBySubscriptionAsync()); - } - - /** - * Get metadata information on all assessment types in a specific 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 metadata information on all assessment types in a specific subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySubscription(Context context) { - return new PagedIterable<>(listBySubscriptionAsync(context)); - } - - /** - * Get metadata information on an assessment type. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getWithResponseAsync(String assessmentMetadataName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (assessmentMetadataName == null) { - return Mono.error( - new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); - } - final String apiVersion = "2025-05-04"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), apiVersion, assessmentMetadataName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get metadata information on an assessment type. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment 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 metadata information on an assessment type along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String assessmentMetadataName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (assessmentMetadataName == null) { - return Mono.error( - new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); - } - final String apiVersion = "2025-05-04"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, assessmentMetadataName, accept, context); - } - - /** - * Get metadata information on an assessment type. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String assessmentMetadataName) { - return getWithResponseAsync(assessmentMetadataName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get metadata information on an assessment type. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment 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 metadata information on an assessment type along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String assessmentMetadataName, - Context context) { - return getWithResponseAsync(assessmentMetadataName, context).block(); - } - - /** - * Get metadata information on an assessment type. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentMetadataResponseInner get(String assessmentMetadataName) { - return getWithResponse(assessmentMetadataName, Context.NONE).getValue(); - } - - /** - * Get metadata information on all assessment types. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on all assessment types 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 = "2025-05-04"; - 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())); - } - - /** - * Get metadata information on all assessment types. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on all assessment types 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 = "2025-05-04"; - 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)); - } - - /** - * Get metadata information on all assessment types. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on all assessment types as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get metadata information on all assessment types. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on all assessment types as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get metadata information on all assessment types. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on all assessment types as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Get metadata information on all assessment types. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on all assessment types 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 metadata information on all assessment types in a specific subscription along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on all assessment types in a specific subscription along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @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 metadata information on all assessment types 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 metadata information on all assessment types 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasImpl.java deleted file mode 100644 index 536739f58efa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasImpl.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.AssessmentsMetadatasClient; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner; -import com.azure.resourcemanager.security.models.AssessmentsMetadatas; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataResponse; - -public final class AssessmentsMetadatasImpl implements AssessmentsMetadatas { - private static final ClientLogger LOGGER = new ClientLogger(AssessmentsMetadatasImpl.class); - - private final AssessmentsMetadatasClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AssessmentsMetadatasImpl(AssessmentsMetadatasClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getInSubscriptionWithResponse(String assessmentMetadataName, - Context context) { - Response inner - = this.serviceClient().getInSubscriptionWithResponse(assessmentMetadataName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityAssessmentMetadataResponseImpl(inner.getValue(), this.manager())); - } - - public SecurityAssessmentMetadataResponse getInSubscription(String assessmentMetadataName) { - SecurityAssessmentMetadataResponseInner inner = this.serviceClient().getInSubscription(assessmentMetadataName); - if (inner != null) { - return new SecurityAssessmentMetadataResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteInSubscriptionWithResponse(String assessmentMetadataName, Context context) { - return this.serviceClient().deleteInSubscriptionWithResponse(assessmentMetadataName, context); - } - - public void deleteInSubscription(String assessmentMetadataName) { - this.serviceClient().deleteInSubscription(assessmentMetadataName); - } - - public PagedIterable listBySubscription() { - PagedIterable inner = this.serviceClient().listBySubscription(); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new SecurityAssessmentMetadataResponseImpl(inner1, this.manager())); - } - - public PagedIterable listBySubscription(Context context) { - PagedIterable inner = this.serviceClient().listBySubscription(context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new SecurityAssessmentMetadataResponseImpl(inner1, this.manager())); - } - - public Response getWithResponse(String assessmentMetadataName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(assessmentMetadataName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityAssessmentMetadataResponseImpl(inner.getValue(), this.manager())); - } - - public SecurityAssessmentMetadataResponse get(String assessmentMetadataName) { - SecurityAssessmentMetadataResponseInner inner = this.serviceClient().get(assessmentMetadataName); - if (inner != null) { - return new SecurityAssessmentMetadataResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new SecurityAssessmentMetadataResponseImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new SecurityAssessmentMetadataResponseImpl(inner1, this.manager())); - } - - public SecurityAssessmentMetadataResponse getInSubscriptionById(String id) { - String assessmentMetadataName = ResourceManagerUtils.getValueFromIdByName(id, "assessmentMetadata"); - if (assessmentMetadataName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessmentMetadata'.", id))); - } - return this.getInSubscriptionWithResponse(assessmentMetadataName, Context.NONE).getValue(); - } - - public Response getInSubscriptionByIdWithResponse(String id, Context context) { - String assessmentMetadataName = ResourceManagerUtils.getValueFromIdByName(id, "assessmentMetadata"); - if (assessmentMetadataName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessmentMetadata'.", id))); - } - return this.getInSubscriptionWithResponse(assessmentMetadataName, context); - } - - public void deleteInSubscriptionById(String id) { - String assessmentMetadataName = ResourceManagerUtils.getValueFromIdByName(id, "assessmentMetadata"); - if (assessmentMetadataName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessmentMetadata'.", id))); - } - this.deleteInSubscriptionWithResponse(assessmentMetadataName, Context.NONE); - } - - public Response deleteInSubscriptionByIdWithResponse(String id, Context context) { - String assessmentMetadataName = ResourceManagerUtils.getValueFromIdByName(id, "assessmentMetadata"); - if (assessmentMetadataName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessmentMetadata'.", id))); - } - return this.deleteInSubscriptionWithResponse(assessmentMetadataName, context); - } - - private AssessmentsMetadatasClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public SecurityAssessmentMetadataResponseImpl define(String name) { - return new SecurityAssessmentMetadataResponseImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssignmentImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssignmentImpl.java deleted file mode 100644 index 2736eacf5677..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssignmentImpl.java +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AssignmentInner; -import com.azure.resourcemanager.security.models.AssignedComponentItem; -import com.azure.resourcemanager.security.models.AssignedStandardItem; -import com.azure.resourcemanager.security.models.Assignment; -import com.azure.resourcemanager.security.models.AssignmentPropertiesAdditionalData; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.Map; - -public final class AssignmentImpl implements Assignment, Assignment.Definition, Assignment.Update { - private AssignmentInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String location() { - return this.innerModel().location(); - } - - public String kind() { - return this.innerModel().kind(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String description() { - return this.innerModel().description(); - } - - public AssignedStandardItem assignedStandard() { - return this.innerModel().assignedStandard(); - } - - public AssignedComponentItem assignedComponent() { - return this.innerModel().assignedComponent(); - } - - public String scope() { - return this.innerModel().scope(); - } - - public String effect() { - return this.innerModel().effect(); - } - - public OffsetDateTime expiresOn() { - return this.innerModel().expiresOn(); - } - - public AssignmentPropertiesAdditionalData additionalData() { - return this.innerModel().additionalData(); - } - - public Object metadata() { - return this.innerModel().metadata(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public AssignmentInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String assignmentId; - - public AssignmentImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public Assignment create() { - this.innerObject = serviceManager.serviceClient() - .getAssignments() - .createOrUpdateWithResponse(resourceGroupName, assignmentId, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public Assignment create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAssignments() - .createOrUpdateWithResponse(resourceGroupName, assignmentId, this.innerModel(), context) - .getValue(); - return this; - } - - AssignmentImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new AssignmentInner(); - this.serviceManager = serviceManager; - this.assignmentId = name; - } - - public AssignmentImpl update() { - return this; - } - - public Assignment apply() { - this.innerObject = serviceManager.serviceClient() - .getAssignments() - .createOrUpdateWithResponse(resourceGroupName, assignmentId, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public Assignment apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAssignments() - .createOrUpdateWithResponse(resourceGroupName, assignmentId, this.innerModel(), context) - .getValue(); - return this; - } - - AssignmentImpl(AssignmentInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.assignmentId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "assignments"); - } - - public Assignment refresh() { - this.innerObject = serviceManager.serviceClient() - .getAssignments() - .getByResourceGroupWithResponse(resourceGroupName, assignmentId, Context.NONE) - .getValue(); - return this; - } - - public Assignment refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAssignments() - .getByResourceGroupWithResponse(resourceGroupName, assignmentId, context) - .getValue(); - return this; - } - - public AssignmentImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public AssignmentImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public AssignmentImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public AssignmentImpl withKind(String kind) { - this.innerModel().withKind(kind); - return this; - } - - public AssignmentImpl withEtag(String etag) { - this.innerModel().withEtag(etag); - return this; - } - - public AssignmentImpl withDisplayName(String displayName) { - this.innerModel().withDisplayName(displayName); - return this; - } - - public AssignmentImpl withDescription(String description) { - this.innerModel().withDescription(description); - return this; - } - - public AssignmentImpl withAssignedStandard(AssignedStandardItem assignedStandard) { - this.innerModel().withAssignedStandard(assignedStandard); - return this; - } - - public AssignmentImpl withAssignedComponent(AssignedComponentItem assignedComponent) { - this.innerModel().withAssignedComponent(assignedComponent); - return this; - } - - public AssignmentImpl withScope(String scope) { - this.innerModel().withScope(scope); - return this; - } - - public AssignmentImpl withEffect(String effect) { - this.innerModel().withEffect(effect); - return this; - } - - public AssignmentImpl withExpiresOn(OffsetDateTime expiresOn) { - this.innerModel().withExpiresOn(expiresOn); - return this; - } - - public AssignmentImpl withAdditionalData(AssignmentPropertiesAdditionalData additionalData) { - this.innerModel().withAdditionalData(additionalData); - return this; - } - - public AssignmentImpl withMetadata(Object metadata) { - this.innerModel().withMetadata(metadata); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssignmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssignmentsClientImpl.java deleted file mode 100644 index c8948deb7942..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssignmentsClientImpl.java +++ /dev/null @@ -1,860 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.resourcemanager.security.fluent.AssignmentsClient; -import com.azure.resourcemanager.security.fluent.models.AssignmentInner; -import com.azure.resourcemanager.security.implementation.models.AssignmentList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AssignmentsClient. - */ -public final class AssignmentsClientImpl implements AssignmentsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AssignmentsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AssignmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AssignmentsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(AssignmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAssignments to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterAssignments") - public interface AssignmentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("assignmentId") String assignmentId, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("assignmentId") String assignmentId, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") AssignmentInner assignment, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("assignmentId") String assignmentId, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - 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" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assignments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get a specific standard assignment for the requested scope by resourceId. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 standard assignment for the requested scope by resourceId along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String assignmentId) { - 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 (assignmentId == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentId is required and cannot be null.")); - } - final String apiVersion = "2021-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, assignmentId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific standard assignment for the requested scope by resourceId. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 standard assignment for the requested scope by resourceId along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String assignmentId, 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 (assignmentId == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentId is required and cannot be null.")); - } - final String apiVersion = "2021-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, assignmentId, accept, context); - } - - /** - * Get a specific standard assignment for the requested scope by resourceId. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 standard assignment for the requested scope by resourceId on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String assignmentId) { - return getByResourceGroupWithResponseAsync(resourceGroupName, assignmentId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a specific standard assignment for the requested scope by resourceId. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 standard assignment for the requested scope by resourceId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String assignmentId, - Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, assignmentId, context).block(); - } - - /** - * Get a specific standard assignment for the requested scope by resourceId. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 standard assignment for the requested scope by resourceId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AssignmentInner getByResourceGroup(String resourceGroupName, String assignmentId) { - return getByResourceGroupWithResponse(resourceGroupName, assignmentId, Context.NONE).getValue(); - } - - /** - * Create a security assignment on the given scope. Will create/update the required standard assignment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @param assignment Custom standard assignment over a pre-defined scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Assignment on a resource group over a given scope along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String assignmentId, AssignmentInner assignment) { - 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 (assignmentId == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentId is required and cannot be null.")); - } - if (assignment == null) { - return Mono.error(new IllegalArgumentException("Parameter assignment is required and cannot be null.")); - } else { - assignment.validate(); - } - final String apiVersion = "2021-08-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, assignmentId, contentType, accept, assignment, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a security assignment on the given scope. Will create/update the required standard assignment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @param assignment Custom standard assignment over a pre-defined scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Assignment on a resource group over a given scope along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String assignmentId, AssignmentInner assignment, 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 (assignmentId == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentId is required and cannot be null.")); - } - if (assignment == null) { - return Mono.error(new IllegalArgumentException("Parameter assignment is required and cannot be null.")); - } else { - assignment.validate(); - } - final String apiVersion = "2021-08-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, assignmentId, contentType, accept, assignment, context); - } - - /** - * Create a security assignment on the given scope. Will create/update the required standard assignment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @param assignment Custom standard assignment over a pre-defined scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Assignment on a resource group over a given scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String assignmentId, - AssignmentInner assignment) { - return createOrUpdateWithResponseAsync(resourceGroupName, assignmentId, assignment) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create a security assignment on the given scope. Will create/update the required standard assignment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @param assignment Custom standard assignment over a pre-defined scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Assignment on a resource group over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String assignmentId, - AssignmentInner assignment, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, assignmentId, assignment, context).block(); - } - - /** - * Create a security assignment on the given scope. Will create/update the required standard assignment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @param assignment Custom standard assignment over a pre-defined scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Assignment on a resource group over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AssignmentInner createOrUpdate(String resourceGroupName, String assignmentId, AssignmentInner assignment) { - return createOrUpdateWithResponse(resourceGroupName, assignmentId, assignment, Context.NONE).getValue(); - } - - /** - * Delete a standard assignment over a given scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 assignmentId) { - 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 (assignmentId == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentId is required and cannot be null.")); - } - final String apiVersion = "2021-08-01-preview"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, assignmentId, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a standard assignment over a given scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 assignmentId, - 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 (assignmentId == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentId is required and cannot be null.")); - } - final String apiVersion = "2021-08-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - assignmentId, context); - } - - /** - * Delete a standard assignment over a given scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 assignmentId) { - return deleteWithResponseAsync(resourceGroupName, assignmentId).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a standard assignment over a given scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String assignmentId, Context context) { - return deleteWithResponseAsync(resourceGroupName, assignmentId, context).block(); - } - - /** - * Delete a standard assignment over a given scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 assignmentId) { - deleteWithResponse(resourceGroupName, assignmentId, Context.NONE); - } - - /** - * Get a list of all relevant standardAssignments available for scope. - * - * @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 a list of all relevant standardAssignments available for scope 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 (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.")); - } - final String apiVersion = "2021-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), apiVersion, - 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())); - } - - /** - * Get a list of all relevant standardAssignments available for scope. - * - * @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 all relevant standardAssignments available for scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @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 (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.")); - } - final String apiVersion = "2021-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get a list of all relevant standardAssignments available for scope. - * - * @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 a list of all relevant standardAssignments available for scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of all relevant standardAssignments available for scope. - * - * @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 all relevant standardAssignments available for scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of all relevant standardAssignments available for scope. - * - * @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 a list of all relevant standardAssignments available for scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Get a list of all relevant standardAssignments available for scope. - * - * @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 all relevant standardAssignments available for scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Get a list of all relevant standardAssignments over a subscription level scope. - * - * @throws 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 relevant standardAssignments over a subscription level scope 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a list of all relevant standardAssignments over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 relevant standardAssignments over a subscription level scope 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-08-01-preview"; - 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)); - } - - /** - * Get a list of all relevant standardAssignments over a subscription level scope. - * - * @throws 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 relevant standardAssignments over a subscription level scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of all relevant standardAssignments over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 relevant standardAssignments over a subscription level scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of all relevant standardAssignments over a subscription level scope. - * - * @throws 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 relevant standardAssignments over a subscription level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Get a list of all relevant standardAssignments over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 relevant standardAssignments over a subscription level scope 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 a list of all relevant standardAssignments available for scope 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 a list of all relevant standardAssignments available for scope 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)); - } - - /** - * 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 relevant standardAssignments over a subscription level scope along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 relevant standardAssignments over a subscription level scope along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssignmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssignmentsImpl.java deleted file mode 100644 index cffe7e601502..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssignmentsImpl.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.AssignmentsClient; -import com.azure.resourcemanager.security.fluent.models.AssignmentInner; -import com.azure.resourcemanager.security.models.Assignment; -import com.azure.resourcemanager.security.models.Assignments; - -public final class AssignmentsImpl implements Assignments { - private static final ClientLogger LOGGER = new ClientLogger(AssignmentsImpl.class); - - private final AssignmentsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AssignmentsImpl(AssignmentsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getByResourceGroupWithResponse(String resourceGroupName, String assignmentId, - Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, assignmentId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AssignmentImpl(inner.getValue(), this.manager())); - } - - public Assignment getByResourceGroup(String resourceGroupName, String assignmentId) { - AssignmentInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, assignmentId); - if (inner != null) { - return new AssignmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse(String resourceGroupName, String assignmentId, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, assignmentId, context); - } - - public void deleteByResourceGroup(String resourceGroupName, String assignmentId) { - this.serviceClient().delete(resourceGroupName, assignmentId); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AssignmentImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AssignmentImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AssignmentImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AssignmentImpl(inner1, this.manager())); - } - - public Assignment 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 assignmentId = ResourceManagerUtils.getValueFromIdByName(id, "assignments"); - if (assignmentId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assignments'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, assignmentId, 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 assignmentId = ResourceManagerUtils.getValueFromIdByName(id, "assignments"); - if (assignmentId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assignments'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, assignmentId, 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 assignmentId = ResourceManagerUtils.getValueFromIdByName(id, "assignments"); - if (assignmentId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assignments'.", id))); - } - this.deleteByResourceGroupWithResponse(resourceGroupName, assignmentId, Context.NONE); - } - - public Response 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 assignmentId = ResourceManagerUtils.getValueFromIdByName(id, "assignments"); - if (assignmentId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assignments'.", id))); - } - return this.deleteByResourceGroupWithResponse(resourceGroupName, assignmentId, context); - } - - private AssignmentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public AssignmentImpl define(String name) { - return new AssignmentImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingImpl.java deleted file mode 100644 index 942b0193ec03..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.AutoProvisioningSetting; - -public final class AutoProvisioningSettingImpl implements AutoProvisioningSetting, AutoProvisioningSetting.Definition { - private AutoProvisioningSettingInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AutoProvisioningSettingImpl(AutoProvisioningSettingInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public AutoProvision autoProvision() { - return this.innerModel().autoProvision(); - } - - public AutoProvisioningSettingInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String settingName; - - public AutoProvisioningSetting create() { - this.innerObject = serviceManager.serviceClient() - .getAutoProvisioningSettings() - .createWithResponse(settingName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public AutoProvisioningSetting create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAutoProvisioningSettings() - .createWithResponse(settingName, this.innerModel(), context) - .getValue(); - return this; - } - - AutoProvisioningSettingImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new AutoProvisioningSettingInner(); - this.serviceManager = serviceManager; - this.settingName = name; - } - - public AutoProvisioningSetting refresh() { - this.innerObject = serviceManager.serviceClient() - .getAutoProvisioningSettings() - .getWithResponse(settingName, Context.NONE) - .getValue(); - return this; - } - - public AutoProvisioningSetting refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAutoProvisioningSettings() - .getWithResponse(settingName, context) - .getValue(); - return this; - } - - public AutoProvisioningSettingImpl withAutoProvision(AutoProvision autoProvision) { - this.innerModel().withAutoProvision(autoProvision); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingsClientImpl.java deleted file mode 100644 index 36b3ad7a7303..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingsClientImpl.java +++ /dev/null @@ -1,489 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.resourcemanager.security.fluent.AutoProvisioningSettingsClient; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; -import com.azure.resourcemanager.security.implementation.models.AutoProvisioningSettingList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AutoProvisioningSettingsClient. - */ -public final class AutoProvisioningSettingsClientImpl implements AutoProvisioningSettingsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AutoProvisioningSettingsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AutoProvisioningSettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AutoProvisioningSettingsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(AutoProvisioningSettingsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAutoProvisioningSettings to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterAutoProvisioningSettings") - public interface AutoProvisioningSettingsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("settingName") String settingName, @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("settingName") String settingName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") AutoProvisioningSettingInner setting, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String settingName) { - 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 (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - settingName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String settingName, 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 (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), settingName, accept, - context); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String settingName) { - return getWithResponseAsync(settingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String settingName, Context context) { - return getWithResponseAsync(settingName, context).block(); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AutoProvisioningSettingInner get(String settingName) { - return getWithResponse(settingName, Context.NONE).getValue(); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param setting Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String settingName, - AutoProvisioningSettingInner setting) { - 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 (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (setting == null) { - return Mono.error(new IllegalArgumentException("Parameter setting is required and cannot be null.")); - } else { - setting.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), settingName, contentType, accept, setting, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param setting Auto provisioning setting key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String settingName, - AutoProvisioningSettingInner setting, 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 (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (setting == null) { - return Mono.error(new IllegalArgumentException("Parameter setting is required and cannot be null.")); - } else { - setting.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), settingName, - contentType, accept, setting, context); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param setting Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String settingName, AutoProvisioningSettingInner setting) { - return createWithResponseAsync(settingName, setting).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param setting Auto provisioning setting key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String settingName, - AutoProvisioningSettingInner setting, Context context) { - return createWithResponseAsync(settingName, setting, context).block(); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param setting Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AutoProvisioningSettingInner create(String settingName, AutoProvisioningSettingInner setting) { - return createWithResponse(settingName, setting, Context.NONE).getValue(); - } - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - 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)); - } - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response 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 list of all the auto provisioning settings response 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 list of all the auto provisioning settings response 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingsImpl.java deleted file mode 100644 index 5e72cd217440..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingsImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.AutoProvisioningSettingsClient; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; -import com.azure.resourcemanager.security.models.AutoProvisioningSetting; -import com.azure.resourcemanager.security.models.AutoProvisioningSettings; - -public final class AutoProvisioningSettingsImpl implements AutoProvisioningSettings { - private static final ClientLogger LOGGER = new ClientLogger(AutoProvisioningSettingsImpl.class); - - private final AutoProvisioningSettingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AutoProvisioningSettingsImpl(AutoProvisioningSettingsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String settingName, Context context) { - Response inner = this.serviceClient().getWithResponse(settingName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AutoProvisioningSettingImpl(inner.getValue(), this.manager())); - } - - public AutoProvisioningSetting get(String settingName) { - AutoProvisioningSettingInner inner = this.serviceClient().get(settingName); - if (inner != null) { - return new AutoProvisioningSettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AutoProvisioningSettingImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AutoProvisioningSettingImpl(inner1, this.manager())); - } - - public AutoProvisioningSetting getById(String id) { - String settingName = ResourceManagerUtils.getValueFromIdByName(id, "autoProvisioningSettings"); - if (settingName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'autoProvisioningSettings'.", id))); - } - return this.getWithResponse(settingName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String settingName = ResourceManagerUtils.getValueFromIdByName(id, "autoProvisioningSettings"); - if (settingName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'autoProvisioningSettings'.", id))); - } - return this.getWithResponse(settingName, context); - } - - private AutoProvisioningSettingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public AutoProvisioningSettingImpl define(String name) { - return new AutoProvisioningSettingImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationImpl.java deleted file mode 100644 index 67e912488df0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationImpl.java +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import com.azure.resourcemanager.security.models.Automation; -import com.azure.resourcemanager.security.models.AutomationAction; -import com.azure.resourcemanager.security.models.AutomationScope; -import com.azure.resourcemanager.security.models.AutomationSource; -import com.azure.resourcemanager.security.models.AutomationUpdateModel; -import com.azure.resourcemanager.security.models.AutomationValidationStatus; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class AutomationImpl implements Automation, Automation.Definition, Automation.Update { - private AutomationInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String location() { - return this.innerModel().location(); - } - - public String kind() { - return this.innerModel().kind(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String description() { - return this.innerModel().description(); - } - - public Boolean isEnabled() { - return this.innerModel().isEnabled(); - } - - public List scopes() { - List inner = this.innerModel().scopes(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List sources() { - List inner = this.innerModel().sources(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List actions() { - List inner = this.innerModel().actions(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public AutomationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String automationName; - - private AutomationUpdateModel updateAutomation; - - public AutomationImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public Automation create() { - this.innerObject = serviceManager.serviceClient() - .getAutomations() - .createOrUpdateWithResponse(resourceGroupName, automationName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public Automation create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAutomations() - .createOrUpdateWithResponse(resourceGroupName, automationName, this.innerModel(), context) - .getValue(); - return this; - } - - AutomationImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new AutomationInner(); - this.serviceManager = serviceManager; - this.automationName = name; - } - - public AutomationImpl update() { - this.updateAutomation = new AutomationUpdateModel(); - return this; - } - - public Automation apply() { - this.innerObject = serviceManager.serviceClient() - .getAutomations() - .updateWithResponse(resourceGroupName, automationName, updateAutomation, Context.NONE) - .getValue(); - return this; - } - - public Automation apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAutomations() - .updateWithResponse(resourceGroupName, automationName, updateAutomation, context) - .getValue(); - return this; - } - - AutomationImpl(AutomationInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.automationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "automations"); - } - - public Automation refresh() { - this.innerObject = serviceManager.serviceClient() - .getAutomations() - .getByResourceGroupWithResponse(resourceGroupName, automationName, Context.NONE) - .getValue(); - return this; - } - - public Automation refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAutomations() - .getByResourceGroupWithResponse(resourceGroupName, automationName, context) - .getValue(); - return this; - } - - public Response validateWithResponse(AutomationInner automation, Context context) { - return serviceManager.automations() - .validateWithResponse(resourceGroupName, automationName, automation, context); - } - - public AutomationValidationStatus validate(AutomationInner automation) { - return serviceManager.automations().validate(resourceGroupName, automationName, automation); - } - - public AutomationImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public AutomationImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public AutomationImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateAutomation.withTags(tags); - return this; - } - } - - public AutomationImpl withKind(String kind) { - this.innerModel().withKind(kind); - return this; - } - - public AutomationImpl withEtag(String etag) { - this.innerModel().withEtag(etag); - return this; - } - - public AutomationImpl withDescription(String description) { - if (isInCreateMode()) { - this.innerModel().withDescription(description); - return this; - } else { - this.updateAutomation.withDescription(description); - return this; - } - } - - public AutomationImpl withIsEnabled(Boolean isEnabled) { - if (isInCreateMode()) { - this.innerModel().withIsEnabled(isEnabled); - return this; - } else { - this.updateAutomation.withIsEnabled(isEnabled); - return this; - } - } - - public AutomationImpl withScopes(List scopes) { - if (isInCreateMode()) { - this.innerModel().withScopes(scopes); - return this; - } else { - this.updateAutomation.withScopes(scopes); - return this; - } - } - - public AutomationImpl withSources(List sources) { - if (isInCreateMode()) { - this.innerModel().withSources(sources); - return this; - } else { - this.updateAutomation.withSources(sources); - return this; - } - } - - public AutomationImpl withActions(List actions) { - if (isInCreateMode()) { - this.innerModel().withActions(actions); - return this; - } else { - this.updateAutomation.withActions(actions); - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel() == null || this.innerModel().id() == null; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationValidationStatusImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationValidationStatusImpl.java deleted file mode 100644 index aae13a4b156c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationValidationStatusImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner; -import com.azure.resourcemanager.security.models.AutomationValidationStatus; - -public final class AutomationValidationStatusImpl implements AutomationValidationStatus { - private AutomationValidationStatusInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AutomationValidationStatusImpl(AutomationValidationStatusInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public Boolean isValid() { - return this.innerModel().isValid(); - } - - public String message() { - return this.innerModel().message(); - } - - public AutomationValidationStatusInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsClientImpl.java deleted file mode 100644 index 2131279ec2e2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsClientImpl.java +++ /dev/null @@ -1,1176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.AutomationsClient; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner; -import com.azure.resourcemanager.security.implementation.models.AutomationList; -import com.azure.resourcemanager.security.models.AutomationUpdateModel; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in AutomationsClient. - */ -public final class AutomationsClientImpl implements AutomationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AutomationsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AutomationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AutomationsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(AutomationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAutomations to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterAutomations") - public interface AutomationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("automationName") String automationName, @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("automationName") String automationName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") AutomationInner automation, - Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("automationName") String automationName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") AutomationUpdateModel automation, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("automationName") String automationName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - 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" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/automations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}/validate") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> validate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("automationName") String automationName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") AutomationInner automation, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation 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 security automation resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String automationName) { - 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 (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, automationName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation 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 security automation resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String automationName, 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 (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, automationName, accept, context); - } - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation 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 security automation resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String automationName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, automationName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation 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 security automation resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String automationName, - Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, automationName, context).block(); - } - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation 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 security automation resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AutomationInner getByResourceGroup(String resourceGroupName, String automationName) { - return getByResourceGroupWithResponse(resourceGroupName, automationName, Context.NONE).getValue(); - } - - /** - * Creates or updates a security automation. If a security automation is already created and a subsequent request is - * issued for the same automation id, then it will be updated. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 security automation resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String automationName, AutomationInner automation) { - 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 (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - if (automation == null) { - return Mono.error(new IllegalArgumentException("Parameter automation is required and cannot be null.")); - } else { - automation.validate(); - } - final String apiVersion = "2023-12-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, automationName, contentType, accept, automation, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a security automation. If a security automation is already created and a subsequent request is - * issued for the same automation id, then it will be updated. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 security automation resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String automationName, AutomationInner automation, 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 (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - if (automation == null) { - return Mono.error(new IllegalArgumentException("Parameter automation is required and cannot be null.")); - } else { - automation.validate(); - } - final String apiVersion = "2023-12-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, automationName, contentType, accept, automation, context); - } - - /** - * Creates or updates a security automation. If a security automation is already created and a subsequent request is - * issued for the same automation id, then it will be updated. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 security automation resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String automationName, - AutomationInner automation) { - return createOrUpdateWithResponseAsync(resourceGroupName, automationName, automation) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates a security automation. If a security automation is already created and a subsequent request is - * issued for the same automation id, then it will be updated. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 security automation resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String automationName, - AutomationInner automation, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, automationName, automation, context).block(); - } - - /** - * Creates or updates a security automation. If a security automation is already created and a subsequent request is - * issued for the same automation id, then it will be updated. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 security automation resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AutomationInner createOrUpdate(String resourceGroupName, String automationName, AutomationInner automation) { - return createOrUpdateWithResponse(resourceGroupName, automationName, automation, Context.NONE).getValue(); - } - - /** - * Updates a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The update model of security automation 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 security automation resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String automationName, - AutomationUpdateModel automation) { - 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 (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - if (automation == null) { - return Mono.error(new IllegalArgumentException("Parameter automation is required and cannot be null.")); - } else { - automation.validate(); - } - final String apiVersion = "2023-12-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, automationName, contentType, accept, automation, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The update model of security automation 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 security automation resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String automationName, - AutomationUpdateModel automation, 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 (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - if (automation == null) { - return Mono.error(new IllegalArgumentException("Parameter automation is required and cannot be null.")); - } else { - automation.validate(); - } - final String apiVersion = "2023-12-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - automationName, contentType, accept, automation, context); - } - - /** - * Updates a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The update model of security automation 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 security automation resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String automationName, - AutomationUpdateModel automation) { - return updateWithResponseAsync(resourceGroupName, automationName, automation) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Updates a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The update model of security automation 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 security automation resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String automationName, - AutomationUpdateModel automation, Context context) { - return updateWithResponseAsync(resourceGroupName, automationName, automation, context).block(); - } - - /** - * Updates a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The update model of security automation 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 security automation resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AutomationInner update(String resourceGroupName, String automationName, AutomationUpdateModel automation) { - return updateWithResponse(resourceGroupName, automationName, automation, Context.NONE).getValue(); - } - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String automationName) { - 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 (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - final String apiVersion = "2023-12-01-preview"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, automationName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation 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 automationName, - 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 (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - final String apiVersion = "2023-12-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - automationName, context); - } - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String automationName) { - return deleteWithResponseAsync(resourceGroupName, automationName).flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String automationName, Context context) { - return deleteWithResponseAsync(resourceGroupName, automationName, context).block(); - } - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String automationName) { - deleteWithResponse(resourceGroupName, automationName, Context.NONE); - } - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations for the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations 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 (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.")); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), apiVersion, - 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())); - } - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations for the specified 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 list of security automations response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @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 (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.")); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations for the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations for the specified 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 list of security automations response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations for the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations for the specified 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 list of security automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations for the specified 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 list of security automations response 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations for the specified 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 list of security automations response 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2023-12-01-preview"; - 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)); - } - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations for the specified 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 list of security automations response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations for the specified 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 list of security automations response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations for the specified 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 list of security automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations for the specified 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 list of security automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 security automation model state property bag along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateWithResponseAsync(String resourceGroupName, - String automationName, AutomationInner automation) { - 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 (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - if (automation == null) { - return Mono.error(new IllegalArgumentException("Parameter automation is required and cannot be null.")); - } else { - automation.validate(); - } - final String apiVersion = "2023-12-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.validate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, automationName, contentType, accept, automation, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 security automation model state property bag along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateWithResponseAsync(String resourceGroupName, - String automationName, AutomationInner automation, 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 (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - if (automation == null) { - return Mono.error(new IllegalArgumentException("Parameter automation is required and cannot be null.")); - } else { - automation.validate(); - } - final String apiVersion = "2023-12-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.validate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, automationName, contentType, accept, automation, context); - } - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 security automation model state property bag on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateAsync(String resourceGroupName, String automationName, - AutomationInner automation) { - return validateWithResponseAsync(resourceGroupName, automationName, automation) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 security automation model state property bag along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateWithResponse(String resourceGroupName, - String automationName, AutomationInner automation, Context context) { - return validateWithResponseAsync(resourceGroupName, automationName, automation, context).block(); - } - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 security automation model state property bag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AutomationValidationStatusInner validate(String resourceGroupName, String automationName, - AutomationInner automation) { - return validateWithResponse(resourceGroupName, automationName, automation, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @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( - context -> 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)) - .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 list of security automations response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response 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 list of security automations response 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsImpl.java deleted file mode 100644 index a64479ac260c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsImpl.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.AutomationsClient; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner; -import com.azure.resourcemanager.security.models.Automation; -import com.azure.resourcemanager.security.models.AutomationValidationStatus; -import com.azure.resourcemanager.security.models.Automations; - -public final class AutomationsImpl implements Automations { - private static final ClientLogger LOGGER = new ClientLogger(AutomationsImpl.class); - - private final AutomationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AutomationsImpl(AutomationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getByResourceGroupWithResponse(String resourceGroupName, String automationName, - Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, automationName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AutomationImpl(inner.getValue(), this.manager())); - } - - public Automation getByResourceGroup(String resourceGroupName, String automationName) { - AutomationInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, automationName); - if (inner != null) { - return new AutomationImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse(String resourceGroupName, String automationName, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, automationName, context); - } - - public void deleteByResourceGroup(String resourceGroupName, String automationName) { - this.serviceClient().delete(resourceGroupName, automationName); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AutomationImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AutomationImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AutomationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AutomationImpl(inner1, this.manager())); - } - - public Response validateWithResponse(String resourceGroupName, String automationName, - AutomationInner automation, Context context) { - Response inner - = this.serviceClient().validateWithResponse(resourceGroupName, automationName, automation, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AutomationValidationStatusImpl(inner.getValue(), this.manager())); - } - - public AutomationValidationStatus validate(String resourceGroupName, String automationName, - AutomationInner automation) { - AutomationValidationStatusInner inner - = this.serviceClient().validate(resourceGroupName, automationName, automation); - if (inner != null) { - return new AutomationValidationStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - public Automation 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 automationName = ResourceManagerUtils.getValueFromIdByName(id, "automations"); - if (automationName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'automations'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, automationName, 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 automationName = ResourceManagerUtils.getValueFromIdByName(id, "automations"); - if (automationName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'automations'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, automationName, 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 automationName = ResourceManagerUtils.getValueFromIdByName(id, "automations"); - if (automationName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'automations'.", id))); - } - this.deleteByResourceGroupWithResponse(resourceGroupName, automationName, Context.NONE); - } - - public Response 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 automationName = ResourceManagerUtils.getValueFromIdByName(id, "automations"); - if (automationName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'automations'.", id))); - } - return this.deleteByResourceGroupWithResponse(resourceGroupName, automationName, context); - } - - private AutomationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public AutomationImpl define(String name) { - return new AutomationImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgImpl.java deleted file mode 100644 index 8730205750ea..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgImpl.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgInner; -import com.azure.resourcemanager.security.models.AzureDevOpsOrg; -import com.azure.resourcemanager.security.models.AzureDevOpsOrgProperties; - -public final class AzureDevOpsOrgImpl implements AzureDevOpsOrg, AzureDevOpsOrg.Definition, AzureDevOpsOrg.Update { - private AzureDevOpsOrgInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public AzureDevOpsOrgProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public AzureDevOpsOrgInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String securityConnectorName; - - private String orgName; - - public AzureDevOpsOrgImpl withExistingSecurityConnector(String resourceGroupName, String securityConnectorName) { - this.resourceGroupName = resourceGroupName; - this.securityConnectorName = securityConnectorName; - return this; - } - - public AzureDevOpsOrg create() { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsOrgs() - .createOrUpdate(resourceGroupName, securityConnectorName, orgName, this.innerModel(), Context.NONE); - return this; - } - - public AzureDevOpsOrg create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsOrgs() - .createOrUpdate(resourceGroupName, securityConnectorName, orgName, this.innerModel(), context); - return this; - } - - AzureDevOpsOrgImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new AzureDevOpsOrgInner(); - this.serviceManager = serviceManager; - this.orgName = name; - } - - public AzureDevOpsOrgImpl update() { - return this; - } - - public AzureDevOpsOrg apply() { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsOrgs() - .update(resourceGroupName, securityConnectorName, orgName, this.innerModel(), Context.NONE); - return this; - } - - public AzureDevOpsOrg apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsOrgs() - .update(resourceGroupName, securityConnectorName, orgName, this.innerModel(), context); - return this; - } - - AzureDevOpsOrgImpl(AzureDevOpsOrgInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.securityConnectorName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "securityConnectors"); - this.orgName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "azureDevOpsOrgs"); - } - - public AzureDevOpsOrg refresh() { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsOrgs() - .getWithResponse(resourceGroupName, securityConnectorName, orgName, Context.NONE) - .getValue(); - return this; - } - - public AzureDevOpsOrg refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsOrgs() - .getWithResponse(resourceGroupName, securityConnectorName, orgName, context) - .getValue(); - return this; - } - - public AzureDevOpsOrgImpl withProperties(AzureDevOpsOrgProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgListResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgListResponseImpl.java deleted file mode 100644 index e980eb0390d7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgListResponseImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgInner; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgListResponseInner; -import com.azure.resourcemanager.security.models.AzureDevOpsOrg; -import com.azure.resourcemanager.security.models.AzureDevOpsOrgListResponse; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class AzureDevOpsOrgListResponseImpl implements AzureDevOpsOrgListResponse { - private AzureDevOpsOrgListResponseInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AzureDevOpsOrgListResponseImpl(AzureDevOpsOrgListResponseInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new AzureDevOpsOrgImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public String nextLink() { - return this.innerModel().nextLink(); - } - - public AzureDevOpsOrgListResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsClientImpl.java deleted file mode 100644 index aa01a6d8d8fc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsClientImpl.java +++ /dev/null @@ -1,1108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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; -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.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.security.fluent.AzureDevOpsOrgsClient; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgInner; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgListResponseInner; -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 AzureDevOpsOrgsClient. - */ -public final class AzureDevOpsOrgsClientImpl implements AzureDevOpsOrgsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AzureDevOpsOrgsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AzureDevOpsOrgsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AzureDevOpsOrgsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(AzureDevOpsOrgsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAzureDevOpsOrgs to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterAzureDevOpsOrgs") - public interface AzureDevOpsOrgsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") AzureDevOpsOrgInner azureDevOpsOrg, Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") AzureDevOpsOrgInner azureDevOpsOrg, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/listAvailableAzureDevOpsOrgs") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAvailable(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Returns a monitored Azure DevOps organization resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName 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 azure DevOps Organization resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, orgName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a monitored Azure DevOps organization resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName 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 azure DevOps Organization resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, orgName, accept, context); - } - - /** - * Returns a monitored Azure DevOps organization resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName 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 azure DevOps Organization resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName, String orgName) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, orgName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a monitored Azure DevOps organization resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName 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 azure DevOps Organization resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String orgName, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, orgName, context).block(); - } - - /** - * Returns a monitored Azure DevOps organization resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName 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 azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsOrgInner get(String resourceGroupName, String securityConnectorName, String orgName) { - return getWithResponse(resourceGroupName, securityConnectorName, orgName, Context.NONE).getValue(); - } - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (azureDevOpsOrg == null) { - return Mono.error(new IllegalArgumentException("Parameter azureDevOpsOrg is required and cannot be null.")); - } else { - azureDevOpsOrg.validate(); - } - final String apiVersion = "2025-11-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, orgName, contentType, accept, - azureDevOpsOrg, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (azureDevOpsOrg == null) { - return Mono.error(new IllegalArgumentException("Parameter azureDevOpsOrg is required and cannot be null.")); - } else { - azureDevOpsOrg.validate(); - } - final String apiVersion = "2025-11-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, orgName, contentType, accept, azureDevOpsOrg, context); - } - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsOrgInner> beginCreateOrUpdateAsync( - String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - AzureDevOpsOrgInner.class, AzureDevOpsOrgInner.class, this.client.getContext()); - } - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsOrgInner> beginCreateOrUpdateAsync( - String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, - securityConnectorName, orgName, azureDevOpsOrg, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - AzureDevOpsOrgInner.class, AzureDevOpsOrgInner.class, context); - } - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsOrgInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { - return this.beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg) - .getSyncPoller(); - } - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsOrgInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg, - Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context) - .getSyncPoller(); - } - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String securityConnectorName, - String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { - return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String securityConnectorName, - String orgName, AzureDevOpsOrgInner azureDevOpsOrg, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsOrgInner createOrUpdate(String resourceGroupName, String securityConnectorName, String orgName, - AzureDevOpsOrgInner azureDevOpsOrg) { - return createOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg).block(); - } - - /** - * Creates or updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsOrgInner createOrUpdate(String resourceGroupName, String securityConnectorName, String orgName, - AzureDevOpsOrgInner azureDevOpsOrg, Context context) { - return createOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context).block(); - } - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (azureDevOpsOrg == null) { - return Mono.error(new IllegalArgumentException("Parameter azureDevOpsOrg is required and cannot be null.")); - } else { - azureDevOpsOrg.validate(); - } - final String apiVersion = "2025-11-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, orgName, contentType, accept, azureDevOpsOrg, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (azureDevOpsOrg == null) { - return Mono.error(new IllegalArgumentException("Parameter azureDevOpsOrg is required and cannot be null.")); - } else { - azureDevOpsOrg.validate(); - } - final String apiVersion = "2025-11-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, orgName, contentType, accept, azureDevOpsOrg, context); - } - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsOrgInner> beginUpdateAsync(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - AzureDevOpsOrgInner.class, AzureDevOpsOrgInner.class, this.client.getContext()); - } - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsOrgInner> beginUpdateAsync(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - AzureDevOpsOrgInner.class, AzureDevOpsOrgInner.class, context); - } - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsOrgInner> beginUpdate(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { - return this.beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg).getSyncPoller(); - } - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsOrgInner> beginUpdate(String resourceGroupName, - String securityConnectorName, String orgName, AzureDevOpsOrgInner azureDevOpsOrg, Context context) { - return this.beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context) - .getSyncPoller(); - } - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String securityConnectorName, - String orgName, AzureDevOpsOrgInner azureDevOpsOrg) { - return beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String securityConnectorName, - String orgName, AzureDevOpsOrgInner azureDevOpsOrg, Context context) { - return beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsOrgInner update(String resourceGroupName, String securityConnectorName, String orgName, - AzureDevOpsOrgInner azureDevOpsOrg) { - return updateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg).block(); - } - - /** - * Updates monitored Azure DevOps organization details. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param azureDevOpsOrg The Azure DevOps organization resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Organization resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsOrgInner update(String resourceGroupName, String securityConnectorName, String orgName, - AzureDevOpsOrgInner azureDevOpsOrg, Context context) { - return updateAsync(resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, context).block(); - } - - /** - * Returns a list of Azure DevOps organizations onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, 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 a list of Azure DevOps organizations onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Returns a list of Azure DevOps organizations onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of Azure DevOps organizations onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of Azure DevOps organizations onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName)); - } - - /** - * Returns a list of Azure DevOps organizations onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, context)); - } - - /** - * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAvailableWithResponseAsync(String resourceGroupName, - String securityConnectorName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAvailable(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAvailableWithResponseAsync(String resourceGroupName, - String securityConnectorName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listAvailable(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, accept, context); - } - - /** - * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAvailableAsync(String resourceGroupName, - String securityConnectorName) { - return listAvailableWithResponseAsync(resourceGroupName, securityConnectorName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAvailableWithResponse(String resourceGroupName, - String securityConnectorName, Context context) { - return listAvailableWithResponseAsync(resourceGroupName, securityConnectorName, context).block(); - } - - /** - * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsOrgListResponseInner listAvailable(String resourceGroupName, String securityConnectorName) { - return listAvailableWithResponse(resourceGroupName, securityConnectorName, Context.NONE).getValue(); - } - - /** - * Returns a list of Azure DevOps organizations onboarded to the connector. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination 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())); - } - - /** - * Returns a list of Azure DevOps organizations onboarded to the connector. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsImpl.java deleted file mode 100644 index a0b313a1a491..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsOrgsImpl.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.AzureDevOpsOrgsClient; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgInner; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgListResponseInner; -import com.azure.resourcemanager.security.models.AzureDevOpsOrg; -import com.azure.resourcemanager.security.models.AzureDevOpsOrgListResponse; -import com.azure.resourcemanager.security.models.AzureDevOpsOrgs; - -public final class AzureDevOpsOrgsImpl implements AzureDevOpsOrgs { - private static final ClientLogger LOGGER = new ClientLogger(AzureDevOpsOrgsImpl.class); - - private final AzureDevOpsOrgsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AzureDevOpsOrgsImpl(AzureDevOpsOrgsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String orgName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, orgName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AzureDevOpsOrgImpl(inner.getValue(), this.manager())); - } - - public AzureDevOpsOrg get(String resourceGroupName, String securityConnectorName, String orgName) { - AzureDevOpsOrgInner inner = this.serviceClient().get(resourceGroupName, securityConnectorName, orgName); - if (inner != null) { - return new AzureDevOpsOrgImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, securityConnectorName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureDevOpsOrgImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureDevOpsOrgImpl(inner1, this.manager())); - } - - public Response listAvailableWithResponse(String resourceGroupName, - String securityConnectorName, Context context) { - Response inner - = this.serviceClient().listAvailableWithResponse(resourceGroupName, securityConnectorName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AzureDevOpsOrgListResponseImpl(inner.getValue(), this.manager())); - } - - public AzureDevOpsOrgListResponse listAvailable(String resourceGroupName, String securityConnectorName) { - AzureDevOpsOrgListResponseInner inner - = this.serviceClient().listAvailable(resourceGroupName, securityConnectorName); - if (inner != null) { - return new AzureDevOpsOrgListResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public AzureDevOpsOrg 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 securityConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - String orgName = ResourceManagerUtils.getValueFromIdByName(id, "azureDevOpsOrgs"); - if (orgName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'azureDevOpsOrgs'.", id))); - } - return this.getWithResponse(resourceGroupName, securityConnectorName, orgName, 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 securityConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - String orgName = ResourceManagerUtils.getValueFromIdByName(id, "azureDevOpsOrgs"); - if (orgName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'azureDevOpsOrgs'.", id))); - } - return this.getWithResponse(resourceGroupName, securityConnectorName, orgName, context); - } - - private AzureDevOpsOrgsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public AzureDevOpsOrgImpl define(String name) { - return new AzureDevOpsOrgImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectImpl.java deleted file mode 100644 index 4c313f4da2c6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectImpl.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner; -import com.azure.resourcemanager.security.models.AzureDevOpsProject; -import com.azure.resourcemanager.security.models.AzureDevOpsProjectProperties; - -public final class AzureDevOpsProjectImpl - implements AzureDevOpsProject, AzureDevOpsProject.Definition, AzureDevOpsProject.Update { - private AzureDevOpsProjectInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public AzureDevOpsProjectProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public AzureDevOpsProjectInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String securityConnectorName; - - private String orgName; - - private String projectName; - - public AzureDevOpsProjectImpl withExistingAzureDevOpsOrg(String resourceGroupName, String securityConnectorName, - String orgName) { - this.resourceGroupName = resourceGroupName; - this.securityConnectorName = securityConnectorName; - this.orgName = orgName; - return this; - } - - public AzureDevOpsProject create() { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsProjects() - .createOrUpdate(resourceGroupName, securityConnectorName, orgName, projectName, this.innerModel(), - Context.NONE); - return this; - } - - public AzureDevOpsProject create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsProjects() - .createOrUpdate(resourceGroupName, securityConnectorName, orgName, projectName, this.innerModel(), context); - return this; - } - - AzureDevOpsProjectImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new AzureDevOpsProjectInner(); - this.serviceManager = serviceManager; - this.projectName = name; - } - - public AzureDevOpsProjectImpl update() { - return this; - } - - public AzureDevOpsProject apply() { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsProjects() - .update(resourceGroupName, securityConnectorName, orgName, projectName, this.innerModel(), Context.NONE); - return this; - } - - public AzureDevOpsProject apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsProjects() - .update(resourceGroupName, securityConnectorName, orgName, projectName, this.innerModel(), context); - return this; - } - - AzureDevOpsProjectImpl(AzureDevOpsProjectInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.securityConnectorName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "securityConnectors"); - this.orgName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "azureDevOpsOrgs"); - this.projectName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "projects"); - } - - public AzureDevOpsProject refresh() { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsProjects() - .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, Context.NONE) - .getValue(); - return this; - } - - public AzureDevOpsProject refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsProjects() - .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, context) - .getValue(); - return this; - } - - public AzureDevOpsProjectImpl withProperties(AzureDevOpsProjectProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsClientImpl.java deleted file mode 100644 index bd7e5f0d203b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsClientImpl.java +++ /dev/null @@ -1,1058 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.Patch; -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.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.security.fluent.AzureDevOpsProjectsClient; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner; -import com.azure.resourcemanager.security.implementation.models.AzureDevOpsProjectListResponse; -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 AzureDevOpsProjectsClient. - */ -public final class AzureDevOpsProjectsClientImpl implements AzureDevOpsProjectsClient { - /** - * The proxy service used to perform REST calls. - */ - private final AzureDevOpsProjectsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AzureDevOpsProjectsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AzureDevOpsProjectsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(AzureDevOpsProjectsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAzureDevOpsProjects to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterAzureDevOpsProjects") - public interface AzureDevOpsProjectsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @PathParam("projectName") String projectName, @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @PathParam("projectName") String projectName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") AzureDevOpsProjectInner azureDevOpsProject, Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @PathParam("projectName") String projectName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") AzureDevOpsProjectInner azureDevOpsProject, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Returns a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName 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 azure DevOps Project resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, orgName, projectName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName 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 azure DevOps Project resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, orgName, projectName, accept, context); - } - - /** - * Returns a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName 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 azure DevOps Project resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, orgName, projectName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName 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 azure DevOps Project resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, orgName, projectName, context).block(); - } - - /** - * Returns a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName 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 azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsProjectInner get(String resourceGroupName, String securityConnectorName, String orgName, - String projectName) { - return getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, Context.NONE).getValue(); - } - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (azureDevOpsProject == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureDevOpsProject is required and cannot be null.")); - } else { - azureDevOpsProject.validate(); - } - final String apiVersion = "2025-11-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, orgName, projectName, - contentType, accept, azureDevOpsProject, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject, - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (azureDevOpsProject == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureDevOpsProject is required and cannot be null.")); - } else { - azureDevOpsProject.validate(); - } - final String apiVersion = "2025-11-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, orgName, projectName, contentType, accept, azureDevOpsProject, - context); - } - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsProjectInner> beginCreateOrUpdateAsync( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, - AzureDevOpsProjectInner azureDevOpsProject) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, - securityConnectorName, orgName, projectName, azureDevOpsProject); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AzureDevOpsProjectInner.class, AzureDevOpsProjectInner.class, - this.client.getContext()); - } - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsProjectInner> beginCreateOrUpdateAsync( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, - AzureDevOpsProjectInner azureDevOpsProject, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, - securityConnectorName, orgName, projectName, azureDevOpsProject, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AzureDevOpsProjectInner.class, AzureDevOpsProjectInner.class, context); - } - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsProjectInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, - AzureDevOpsProjectInner azureDevOpsProject) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, - azureDevOpsProject) - .getSyncPoller(); - } - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsProjectInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, - AzureDevOpsProjectInner azureDevOpsProject, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, - azureDevOpsProject, context) - .getSyncPoller(); - } - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject) { - return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, - azureDevOpsProject).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, - azureDevOpsProject, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsProjectInner createOrUpdate(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject) { - return createOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject) - .block(); - } - - /** - * Creates or updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsProjectInner createOrUpdate(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject, Context context) { - return createOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject, - context).block(); - } - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (azureDevOpsProject == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureDevOpsProject is required and cannot be null.")); - } else { - azureDevOpsProject.validate(); - } - final String apiVersion = "2025-11-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, orgName, projectName, - contentType, accept, azureDevOpsProject, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject, - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (azureDevOpsProject == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureDevOpsProject is required and cannot be null.")); - } else { - azureDevOpsProject.validate(); - } - final String apiVersion = "2025-11-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, orgName, projectName, contentType, accept, azureDevOpsProject, context); - } - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsProjectInner> beginUpdateAsync( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, - AzureDevOpsProjectInner azureDevOpsProject) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, securityConnectorName, - orgName, projectName, azureDevOpsProject); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AzureDevOpsProjectInner.class, AzureDevOpsProjectInner.class, - this.client.getContext()); - } - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsProjectInner> beginUpdateAsync( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, - AzureDevOpsProjectInner azureDevOpsProject, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updateWithResponseAsync(resourceGroupName, securityConnectorName, - orgName, projectName, azureDevOpsProject, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AzureDevOpsProjectInner.class, AzureDevOpsProjectInner.class, context); - } - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsProjectInner> beginUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, - AzureDevOpsProjectInner azureDevOpsProject) { - return this.beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject) - .getSyncPoller(); - } - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsProjectInner> beginUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, - AzureDevOpsProjectInner azureDevOpsProject, Context context) { - return this - .beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject, - context) - .getSyncPoller(); - } - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject) { - return beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, AzureDevOpsProjectInner azureDevOpsProject, Context context) { - return beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject, - context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsProjectInner update(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, AzureDevOpsProjectInner azureDevOpsProject) { - return updateAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject).block(); - } - - /** - * Updates a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param azureDevOpsProject The Azure DevOps project resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsProjectInner update(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, AzureDevOpsProjectInner azureDevOpsProject, Context context) { - return updateAsync(resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject, context) - .block(); - } - - /** - * Returns a list of Azure DevOps projects onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName 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 list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, String orgName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, orgName, 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 a list of Azure DevOps projects onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName 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 list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, String orgName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, orgName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Returns a list of Azure DevOps projects onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName 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 list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - String orgName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, orgName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of Azure DevOps projects onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName 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 list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - String orgName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, orgName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of Azure DevOps projects onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String orgName) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, orgName)); - } - - /** - * Returns a list of Azure DevOps projects onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String orgName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, orgName, context)); - } - - /** - * Returns a list of Azure DevOps projects onboarded to the connector. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination 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())); - } - - /** - * Returns a list of Azure DevOps projects onboarded to the connector. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsImpl.java deleted file mode 100644 index 057a61841b67..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsProjectsImpl.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.AzureDevOpsProjectsClient; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner; -import com.azure.resourcemanager.security.models.AzureDevOpsProject; -import com.azure.resourcemanager.security.models.AzureDevOpsProjects; - -public final class AzureDevOpsProjectsImpl implements AzureDevOpsProjects { - private static final ClientLogger LOGGER = new ClientLogger(AzureDevOpsProjectsImpl.class); - - private final AzureDevOpsProjectsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AzureDevOpsProjectsImpl(AzureDevOpsProjectsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AzureDevOpsProjectImpl(inner.getValue(), this.manager())); - } - - public AzureDevOpsProject get(String resourceGroupName, String securityConnectorName, String orgName, - String projectName) { - AzureDevOpsProjectInner inner - = this.serviceClient().get(resourceGroupName, securityConnectorName, orgName, projectName); - if (inner != null) { - return new AzureDevOpsProjectImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String orgName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, orgName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureDevOpsProjectImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String orgName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, orgName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureDevOpsProjectImpl(inner1, this.manager())); - } - - public AzureDevOpsProject 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 securityConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - String orgName = ResourceManagerUtils.getValueFromIdByName(id, "azureDevOpsOrgs"); - if (orgName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'azureDevOpsOrgs'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - return this.getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, 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 securityConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - String orgName = ResourceManagerUtils.getValueFromIdByName(id, "azureDevOpsOrgs"); - if (orgName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'azureDevOpsOrgs'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - return this.getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, context); - } - - private AzureDevOpsProjectsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public AzureDevOpsProjectImpl define(String name) { - return new AzureDevOpsProjectImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposClientImpl.java deleted file mode 100644 index 81cd5a8b4898..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposClientImpl.java +++ /dev/null @@ -1,1125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.Patch; -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.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.security.fluent.AzureDevOpsReposClient; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsRepositoryInner; -import com.azure.resourcemanager.security.implementation.models.AzureDevOpsRepositoryListResponse; -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 AzureDevOpsReposClient. - */ -public final class AzureDevOpsReposClientImpl implements AzureDevOpsReposClient { - /** - * The proxy service used to perform REST calls. - */ - private final AzureDevOpsReposService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AzureDevOpsReposClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AzureDevOpsReposClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(AzureDevOpsReposService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAzureDevOpsRepos to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterAzureDevOpsRepos") - public interface AzureDevOpsReposService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}/repos/{repoName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @PathParam("projectName") String projectName, @PathParam("repoName") String repoName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}/repos/{repoName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @PathParam("projectName") String projectName, @PathParam("repoName") String repoName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") AzureDevOpsRepositoryInner azureDevOpsRepository, Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}/repos/{repoName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @PathParam("projectName") String projectName, @PathParam("repoName") String repoName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") AzureDevOpsRepositoryInner azureDevOpsRepository, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}/repos") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("orgName") String orgName, - @PathParam("projectName") String projectName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Returns a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName 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 azure DevOps Repository resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, String repoName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (repoName == null) { - return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, orgName, projectName, repoName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName 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 azure DevOps Repository resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, String repoName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (repoName == null) { - return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, orgName, projectName, repoName, accept, context); - } - - /** - * Returns a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName 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 azure DevOps Repository resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName 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 azure DevOps Repository resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, context) - .block(); - } - - /** - * Returns a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName 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 azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsRepositoryInner get(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, String repoName) { - return getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, repoName, Context.NONE) - .getValue(); - } - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (repoName == null) { - return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); - } - if (azureDevOpsRepository == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureDevOpsRepository is required and cannot be null.")); - } else { - azureDevOpsRepository.validate(); - } - final String apiVersion = "2025-11-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, orgName, projectName, - repoName, contentType, accept, azureDevOpsRepository, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (repoName == null) { - return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); - } - if (azureDevOpsRepository == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureDevOpsRepository is required and cannot be null.")); - } else { - azureDevOpsRepository.validate(); - } - final String apiVersion = "2025-11-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, orgName, projectName, repoName, contentType, accept, - azureDevOpsRepository, context); - } - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsRepositoryInner> beginCreateOrUpdateAsync( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, - securityConnectorName, orgName, projectName, repoName, azureDevOpsRepository); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AzureDevOpsRepositoryInner.class, AzureDevOpsRepositoryInner.class, - this.client.getContext()); - } - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsRepositoryInner> beginCreateOrUpdateAsync( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, - securityConnectorName, orgName, projectName, repoName, azureDevOpsRepository, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AzureDevOpsRepositoryInner.class, AzureDevOpsRepositoryInner.class, context); - } - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsRepositoryInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository) - .getSyncPoller(); - } - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsRepositoryInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository, context) - .getSyncPoller(); - } - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository) { - return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsRepositoryInner createOrUpdate(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository) { - return createOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository).block(); - } - - /** - * Creates or updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsRepositoryInner createOrUpdate(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository, - Context context) { - return createOrUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository, context).block(); - } - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (repoName == null) { - return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); - } - if (azureDevOpsRepository == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureDevOpsRepository is required and cannot be null.")); - } else { - azureDevOpsRepository.validate(); - } - final String apiVersion = "2025-11-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, orgName, projectName, - repoName, contentType, accept, azureDevOpsRepository, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (repoName == null) { - return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); - } - if (azureDevOpsRepository == null) { - return Mono - .error(new IllegalArgumentException("Parameter azureDevOpsRepository is required and cannot be null.")); - } else { - azureDevOpsRepository.validate(); - } - final String apiVersion = "2025-11-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, orgName, projectName, repoName, contentType, accept, azureDevOpsRepository, context); - } - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsRepositoryInner> beginUpdateAsync( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, securityConnectorName, - orgName, projectName, repoName, azureDevOpsRepository); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AzureDevOpsRepositoryInner.class, AzureDevOpsRepositoryInner.class, - this.client.getContext()); - } - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AzureDevOpsRepositoryInner> beginUpdateAsync( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updateWithResponseAsync(resourceGroupName, securityConnectorName, - orgName, projectName, repoName, azureDevOpsRepository, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), AzureDevOpsRepositoryInner.class, AzureDevOpsRepositoryInner.class, context); - } - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsRepositoryInner> beginUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository) { - return this - .beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository) - .getSyncPoller(); - } - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AzureDevOpsRepositoryInner> beginUpdate( - String resourceGroupName, String securityConnectorName, String orgName, String projectName, String repoName, - AzureDevOpsRepositoryInner azureDevOpsRepository, Context context) { - return this - .beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository, context) - .getSyncPoller(); - } - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository) { - return beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository, - Context context) { - return beginUpdateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsRepositoryInner update(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository) { - return updateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository).block(); - } - - /** - * Updates a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName parameter. - * @param azureDevOpsRepository The Azure DevOps repository resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure DevOps Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AzureDevOpsRepositoryInner update(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, String repoName, AzureDevOpsRepositoryInner azureDevOpsRepository, Context context) { - return updateAsync(resourceGroupName, securityConnectorName, orgName, projectName, repoName, - azureDevOpsRepository, context).block(); - } - - /** - * Returns a list of Azure DevOps repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName 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 list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, orgName, projectName, 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 a list of Azure DevOps repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName 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 list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, String orgName, String projectName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (orgName == null) { - return Mono.error(new IllegalArgumentException("Parameter orgName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, orgName, projectName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Returns a list of Azure DevOps repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName 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 list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, securityConnectorName, orgName, projectName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of Azure DevOps repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName 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 list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, securityConnectorName, orgName, projectName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of Azure DevOps repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String orgName, String projectName) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, orgName, projectName)); - } - - /** - * Returns a list of Azure DevOps repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, orgName, projectName, context)); - } - - /** - * Returns a list of Azure DevOps repositories onboarded to the connector. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination 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())); - } - - /** - * Returns a list of Azure DevOps repositories onboarded to the connector. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposImpl.java deleted file mode 100644 index cc7f0dcc1130..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsReposImpl.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.AzureDevOpsReposClient; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsRepositoryInner; -import com.azure.resourcemanager.security.models.AzureDevOpsRepos; -import com.azure.resourcemanager.security.models.AzureDevOpsRepository; - -public final class AzureDevOpsReposImpl implements AzureDevOpsRepos { - private static final ClientLogger LOGGER = new ClientLogger(AzureDevOpsReposImpl.class); - - private final AzureDevOpsReposClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AzureDevOpsReposImpl(AzureDevOpsReposClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, repoName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AzureDevOpsRepositoryImpl(inner.getValue(), this.manager())); - } - - public AzureDevOpsRepository get(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, String repoName) { - AzureDevOpsRepositoryInner inner - = this.serviceClient().get(resourceGroupName, securityConnectorName, orgName, projectName, repoName); - if (inner != null) { - return new AzureDevOpsRepositoryImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String orgName, String projectName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, orgName, projectName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureDevOpsRepositoryImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, orgName, projectName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AzureDevOpsRepositoryImpl(inner1, this.manager())); - } - - public AzureDevOpsRepository 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 securityConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - String orgName = ResourceManagerUtils.getValueFromIdByName(id, "azureDevOpsOrgs"); - if (orgName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'azureDevOpsOrgs'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String repoName = ResourceManagerUtils.getValueFromIdByName(id, "repos"); - if (repoName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'repos'.", id))); - } - return this - .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, repoName, 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 securityConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - String orgName = ResourceManagerUtils.getValueFromIdByName(id, "azureDevOpsOrgs"); - if (orgName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'azureDevOpsOrgs'.", id))); - } - String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); - if (projectName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); - } - String repoName = ResourceManagerUtils.getValueFromIdByName(id, "repos"); - if (repoName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'repos'.", id))); - } - return this.getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, repoName, context); - } - - private AzureDevOpsReposClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public AzureDevOpsRepositoryImpl define(String name) { - return new AzureDevOpsRepositoryImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsRepositoryImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsRepositoryImpl.java deleted file mode 100644 index e71d4329baf2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AzureDevOpsRepositoryImpl.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsRepositoryInner; -import com.azure.resourcemanager.security.models.AzureDevOpsRepository; -import com.azure.resourcemanager.security.models.AzureDevOpsRepositoryProperties; - -public final class AzureDevOpsRepositoryImpl - implements AzureDevOpsRepository, AzureDevOpsRepository.Definition, AzureDevOpsRepository.Update { - private AzureDevOpsRepositoryInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public AzureDevOpsRepositoryProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public AzureDevOpsRepositoryInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String securityConnectorName; - - private String orgName; - - private String projectName; - - private String repoName; - - public AzureDevOpsRepositoryImpl withExistingProject(String resourceGroupName, String securityConnectorName, - String orgName, String projectName) { - this.resourceGroupName = resourceGroupName; - this.securityConnectorName = securityConnectorName; - this.orgName = orgName; - this.projectName = projectName; - return this; - } - - public AzureDevOpsRepository create() { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsRepos() - .createOrUpdate(resourceGroupName, securityConnectorName, orgName, projectName, repoName, this.innerModel(), - Context.NONE); - return this; - } - - public AzureDevOpsRepository create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsRepos() - .createOrUpdate(resourceGroupName, securityConnectorName, orgName, projectName, repoName, this.innerModel(), - context); - return this; - } - - AzureDevOpsRepositoryImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new AzureDevOpsRepositoryInner(); - this.serviceManager = serviceManager; - this.repoName = name; - } - - public AzureDevOpsRepositoryImpl update() { - return this; - } - - public AzureDevOpsRepository apply() { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsRepos() - .update(resourceGroupName, securityConnectorName, orgName, projectName, repoName, this.innerModel(), - Context.NONE); - return this; - } - - public AzureDevOpsRepository apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsRepos() - .update(resourceGroupName, securityConnectorName, orgName, projectName, repoName, this.innerModel(), - context); - return this; - } - - AzureDevOpsRepositoryImpl(AzureDevOpsRepositoryInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.securityConnectorName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "securityConnectors"); - this.orgName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "azureDevOpsOrgs"); - this.projectName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "projects"); - this.repoName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "repos"); - } - - public AzureDevOpsRepository refresh() { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsRepos() - .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, repoName, Context.NONE) - .getValue(); - return this; - } - - public AzureDevOpsRepository refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAzureDevOpsRepos() - .getWithResponse(resourceGroupName, securityConnectorName, orgName, projectName, repoName, context) - .getValue(); - return this; - } - - public AzureDevOpsRepositoryImpl withProperties(AzureDevOpsRepositoryProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceImpl.java deleted file mode 100644 index 4ee1433818d0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.ComplianceInner; -import com.azure.resourcemanager.security.models.Compliance; -import com.azure.resourcemanager.security.models.ComplianceSegment; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class ComplianceImpl implements Compliance { - private ComplianceInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ComplianceImpl(ComplianceInner innerObject, com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public OffsetDateTime assessmentTimestampUtcDate() { - return this.innerModel().assessmentTimestampUtcDate(); - } - - public Integer resourceCount() { - return this.innerModel().resourceCount(); - } - - public List assessmentResult() { - List inner = this.innerModel().assessmentResult(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public ComplianceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceResultImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceResultImpl.java deleted file mode 100644 index b1166a5951ec..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceResultImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.ComplianceResultInner; -import com.azure.resourcemanager.security.models.ComplianceResult; -import com.azure.resourcemanager.security.models.ResourceStatus; - -public final class ComplianceResultImpl implements ComplianceResult { - private ComplianceResultInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ComplianceResultImpl(ComplianceResultInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public ResourceStatus resourceStatus() { - return this.innerModel().resourceStatus(); - } - - public ComplianceResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceResultsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceResultsClientImpl.java deleted file mode 100644 index bc5a3cda2417..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceResultsClientImpl.java +++ /dev/null @@ -1,367 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.ComplianceResultsClient; -import com.azure.resourcemanager.security.fluent.models.ComplianceResultInner; -import com.azure.resourcemanager.security.implementation.models.ComplianceResultList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ComplianceResultsClient. - */ -public final class ComplianceResultsClientImpl implements ComplianceResultsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ComplianceResultsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of ComplianceResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ComplianceResultsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(ComplianceResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterComplianceResults to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterComplianceResults") - public interface ComplianceResultsService { - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("complianceResultName") String complianceResultName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/complianceResults") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Security Compliance Result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param complianceResultName The compliance result key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 compliance result along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, String complianceResultName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (complianceResultName == null) { - return Mono - .error(new IllegalArgumentException("Parameter complianceResultName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, resourceId, complianceResultName, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Security Compliance Result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param complianceResultName The compliance result key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 compliance result along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, String complianceResultName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (complianceResultName == null) { - return Mono - .error(new IllegalArgumentException("Parameter complianceResultName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, resourceId, complianceResultName, accept, context); - } - - /** - * Security Compliance Result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param complianceResultName The compliance result key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 compliance result on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId, String complianceResultName) { - return getWithResponseAsync(resourceId, complianceResultName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Security Compliance Result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param complianceResultName The compliance result key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 compliance result along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceId, String complianceResultName, - Context context) { - return getWithResponseAsync(resourceId, complianceResultName, context).block(); - } - - /** - * Security Compliance Result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param complianceResultName The compliance result key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 compliance result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ComplianceResultInner get(String resourceId, String complianceResultName) { - return getWithResponse(resourceId, complianceResultName, Context.NONE).getValue(); - } - - /** - * Security compliance results in the subscription. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of compliance results response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2017-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, 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())); - } - - /** - * Security compliance results in the subscription. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of compliance results response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2017-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Security compliance results in the subscription. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of compliance results response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Security compliance results in the subscription. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of compliance results response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Security compliance results in the subscription. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of compliance results response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(listAsync(scope)); - } - - /** - * Security compliance results in the subscription. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of compliance results response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(listAsync(scope, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of compliance results response 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 list of compliance results response 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceResultsImpl.java deleted file mode 100644 index 4d5bc808f879..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceResultsImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.ComplianceResultsClient; -import com.azure.resourcemanager.security.fluent.models.ComplianceResultInner; -import com.azure.resourcemanager.security.models.ComplianceResult; -import com.azure.resourcemanager.security.models.ComplianceResults; - -public final class ComplianceResultsImpl implements ComplianceResults { - private static final ClientLogger LOGGER = new ClientLogger(ComplianceResultsImpl.class); - - private final ComplianceResultsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ComplianceResultsImpl(ComplianceResultsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceId, String complianceResultName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceId, complianceResultName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ComplianceResultImpl(inner.getValue(), this.manager())); - } - - public ComplianceResult get(String resourceId, String complianceResultName) { - ComplianceResultInner inner = this.serviceClient().get(resourceId, complianceResultName); - if (inner != null) { - return new ComplianceResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ComplianceResultImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ComplianceResultImpl(inner1, this.manager())); - } - - private ComplianceResultsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CompliancesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CompliancesClientImpl.java deleted file mode 100644 index 1c2f4016e127..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CompliancesClientImpl.java +++ /dev/null @@ -1,361 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.CompliancesClient; -import com.azure.resourcemanager.security.fluent.models.ComplianceInner; -import com.azure.resourcemanager.security.implementation.models.ComplianceList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in CompliancesClient. - */ -public final class CompliancesClientImpl implements CompliancesClient { - /** - * The proxy service used to perform REST calls. - */ - private final CompliancesService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of CompliancesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CompliancesClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(CompliancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterCompliances to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterCompliances") - public interface CompliancesService { - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/compliances/{complianceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("complianceName") String complianceName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/compliances") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Details of a specific Compliance. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param complianceName name of the Compliance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String complianceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (complianceName == null) { - return Mono.error(new IllegalArgumentException("Parameter complianceName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), apiVersion, scope, complianceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details of a specific Compliance. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param complianceName name of the Compliance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String complianceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (complianceName == null) { - return Mono.error(new IllegalArgumentException("Parameter complianceName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, complianceName, accept, context); - } - - /** - * Details of a specific Compliance. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param complianceName name of the Compliance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, String complianceName) { - return getWithResponseAsync(scope, complianceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Details of a specific Compliance. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param complianceName name of the Compliance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String complianceName, Context context) { - return getWithResponseAsync(scope, complianceName, context).block(); - } - - /** - * Details of a specific Compliance. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param complianceName name of the Compliance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ComplianceInner get(String scope, String complianceName) { - return getWithResponse(scope, complianceName, Context.NONE).getValue(); - } - - /** - * The Compliance scores of the specific management group. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of Compliance objects response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, 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())); - } - - /** - * The Compliance scores of the specific management group. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of Compliance objects response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * The Compliance scores of the specific management group. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of Compliance objects response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * The Compliance scores of the specific management group. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of Compliance objects response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * The Compliance scores of the specific management group. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of Compliance objects response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(listAsync(scope)); - } - - /** - * The Compliance scores of the specific management group. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of Compliance objects response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(listAsync(scope, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response 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 list of Compliance objects response 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CompliancesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CompliancesImpl.java deleted file mode 100644 index 9bf91a382612..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CompliancesImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.CompliancesClient; -import com.azure.resourcemanager.security.fluent.models.ComplianceInner; -import com.azure.resourcemanager.security.models.Compliance; -import com.azure.resourcemanager.security.models.Compliances; - -public final class CompliancesImpl implements Compliances { - private static final ClientLogger LOGGER = new ClientLogger(CompliancesImpl.class); - - private final CompliancesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public CompliancesImpl(CompliancesClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String scope, String complianceName, Context context) { - Response inner = this.serviceClient().getWithResponse(scope, complianceName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ComplianceImpl(inner.getValue(), this.manager())); - } - - public Compliance get(String scope, String complianceName) { - ComplianceInner inner = this.serviceClient().get(scope, complianceName); - if (inner != null) { - return new ComplianceImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ComplianceImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ComplianceImpl(inner1, this.manager())); - } - - private CompliancesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomRecommendationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomRecommendationImpl.java deleted file mode 100644 index 7ed223a7a2c7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomRecommendationImpl.java +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.CustomRecommendationInner; -import com.azure.resourcemanager.security.models.CustomRecommendation; -import com.azure.resourcemanager.security.models.RecommendationSupportedClouds; -import com.azure.resourcemanager.security.models.SecurityIssue; -import com.azure.resourcemanager.security.models.SeverityEnum; -import java.util.Collections; -import java.util.List; - -public final class CustomRecommendationImpl - implements CustomRecommendation, CustomRecommendation.Definition, CustomRecommendation.Update { - private CustomRecommendationInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager 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 String query() { - return this.innerModel().query(); - } - - public List cloudProviders() { - List inner = this.innerModel().cloudProviders(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public SeverityEnum severity() { - return this.innerModel().severity(); - } - - public SecurityIssue securityIssue() { - return this.innerModel().securityIssue(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String description() { - return this.innerModel().description(); - } - - public String remediationDescription() { - return this.innerModel().remediationDescription(); - } - - public String assessmentKey() { - return this.innerModel().assessmentKey(); - } - - public CustomRecommendationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String scope; - - private String customRecommendationName; - - public CustomRecommendationImpl withExistingScope(String scope) { - this.scope = scope; - return this; - } - - public CustomRecommendation create() { - this.innerObject = serviceManager.serviceClient() - .getCustomRecommendations() - .createOrUpdateWithResponse(scope, customRecommendationName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public CustomRecommendation create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getCustomRecommendations() - .createOrUpdateWithResponse(scope, customRecommendationName, this.innerModel(), context) - .getValue(); - return this; - } - - CustomRecommendationImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new CustomRecommendationInner(); - this.serviceManager = serviceManager; - this.customRecommendationName = name; - } - - public CustomRecommendationImpl update() { - return this; - } - - public CustomRecommendation apply() { - this.innerObject = serviceManager.serviceClient() - .getCustomRecommendations() - .createOrUpdateWithResponse(scope, customRecommendationName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public CustomRecommendation apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getCustomRecommendations() - .createOrUpdateWithResponse(scope, customRecommendationName, this.innerModel(), context) - .getValue(); - return this; - } - - CustomRecommendationImpl(CustomRecommendationInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.scope = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{scope}/providers/Microsoft.Security/customRecommendations/{customRecommendationName}", "scope"); - this.customRecommendationName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{scope}/providers/Microsoft.Security/customRecommendations/{customRecommendationName}", - "customRecommendationName"); - } - - public CustomRecommendation refresh() { - this.innerObject = serviceManager.serviceClient() - .getCustomRecommendations() - .getWithResponse(scope, customRecommendationName, Context.NONE) - .getValue(); - return this; - } - - public CustomRecommendation refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getCustomRecommendations() - .getWithResponse(scope, customRecommendationName, context) - .getValue(); - return this; - } - - public CustomRecommendationImpl withQuery(String query) { - this.innerModel().withQuery(query); - return this; - } - - public CustomRecommendationImpl withCloudProviders(List cloudProviders) { - this.innerModel().withCloudProviders(cloudProviders); - return this; - } - - public CustomRecommendationImpl withSeverity(SeverityEnum severity) { - this.innerModel().withSeverity(severity); - return this; - } - - public CustomRecommendationImpl withSecurityIssue(SecurityIssue securityIssue) { - this.innerModel().withSecurityIssue(securityIssue); - return this; - } - - public CustomRecommendationImpl withDisplayName(String displayName) { - this.innerModel().withDisplayName(displayName); - return this; - } - - public CustomRecommendationImpl withDescription(String description) { - this.innerModel().withDescription(description); - return this; - } - - public CustomRecommendationImpl withRemediationDescription(String remediationDescription) { - this.innerModel().withRemediationDescription(remediationDescription); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomRecommendationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomRecommendationsClientImpl.java deleted file mode 100644 index 7303ba93e228..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomRecommendationsClientImpl.java +++ /dev/null @@ -1,633 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.resourcemanager.security.fluent.CustomRecommendationsClient; -import com.azure.resourcemanager.security.fluent.models.CustomRecommendationInner; -import com.azure.resourcemanager.security.implementation.models.CustomRecommendationsList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in CustomRecommendationsClient. - */ -public final class CustomRecommendationsClientImpl implements CustomRecommendationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final CustomRecommendationsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of CustomRecommendationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CustomRecommendationsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(CustomRecommendationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterCustomRecommendations to be used by the proxy service - * to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterCustomRecommendations") - public interface CustomRecommendationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/customRecommendations/{customRecommendationName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("customRecommendationName") String customRecommendationName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{scope}/providers/Microsoft.Security/customRecommendations/{customRecommendationName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("customRecommendationName") String customRecommendationName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") CustomRecommendationInner customRecommendationBody, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/{scope}/providers/Microsoft.Security/customRecommendations/{customRecommendationName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("customRecommendationName") String customRecommendationName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/customRecommendations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get a specific custom recommendation for the requested scope by customRecommendationName. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 custom recommendation for the requested scope by customRecommendationName along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, - String customRecommendationName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (customRecommendationName == null) { - return Mono.error( - new IllegalArgumentException("Parameter customRecommendationName is required and cannot be null.")); - } - final String apiVersion = "2024-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, scope, customRecommendationName, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific custom recommendation for the requested scope by customRecommendationName. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 custom recommendation for the requested scope by customRecommendationName along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, - String customRecommendationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (customRecommendationName == null) { - return Mono.error( - new IllegalArgumentException("Parameter customRecommendationName is required and cannot be null.")); - } - final String apiVersion = "2024-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, customRecommendationName, accept, context); - } - - /** - * Get a specific custom recommendation for the requested scope by customRecommendationName. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 custom recommendation for the requested scope by customRecommendationName on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, String customRecommendationName) { - return getWithResponseAsync(scope, customRecommendationName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a specific custom recommendation for the requested scope by customRecommendationName. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 custom recommendation for the requested scope by customRecommendationName along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String customRecommendationName, - Context context) { - return getWithResponseAsync(scope, customRecommendationName, context).block(); - } - - /** - * Get a specific custom recommendation for the requested scope by customRecommendationName. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 custom recommendation for the requested scope by customRecommendationName. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CustomRecommendationInner get(String scope, String customRecommendationName) { - return getWithResponse(scope, customRecommendationName, Context.NONE).getValue(); - } - - /** - * Creates or updates a custom recommendation over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @param customRecommendationBody Custom Recommendation body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom Recommendation along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String scope, - String customRecommendationName, CustomRecommendationInner customRecommendationBody) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (customRecommendationName == null) { - return Mono.error( - new IllegalArgumentException("Parameter customRecommendationName is required and cannot be null.")); - } - if (customRecommendationBody == null) { - return Mono.error( - new IllegalArgumentException("Parameter customRecommendationBody is required and cannot be null.")); - } else { - customRecommendationBody.validate(); - } - final String apiVersion = "2024-08-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, - customRecommendationName, contentType, accept, customRecommendationBody, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a custom recommendation over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @param customRecommendationBody Custom Recommendation body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom Recommendation along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String scope, - String customRecommendationName, CustomRecommendationInner customRecommendationBody, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (customRecommendationName == null) { - return Mono.error( - new IllegalArgumentException("Parameter customRecommendationName is required and cannot be null.")); - } - if (customRecommendationBody == null) { - return Mono.error( - new IllegalArgumentException("Parameter customRecommendationBody is required and cannot be null.")); - } else { - customRecommendationBody.validate(); - } - final String apiVersion = "2024-08-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, customRecommendationName, - contentType, accept, customRecommendationBody, context); - } - - /** - * Creates or updates a custom recommendation over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @param customRecommendationBody Custom Recommendation body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom Recommendation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String scope, String customRecommendationName, - CustomRecommendationInner customRecommendationBody) { - return createOrUpdateWithResponseAsync(scope, customRecommendationName, customRecommendationBody) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates a custom recommendation over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @param customRecommendationBody Custom Recommendation body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom Recommendation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String scope, String customRecommendationName, - CustomRecommendationInner customRecommendationBody, Context context) { - return createOrUpdateWithResponseAsync(scope, customRecommendationName, customRecommendationBody, context) - .block(); - } - - /** - * Creates or updates a custom recommendation over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @param customRecommendationBody Custom Recommendation body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom Recommendation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CustomRecommendationInner createOrUpdate(String scope, String customRecommendationName, - CustomRecommendationInner customRecommendationBody) { - return createOrUpdateWithResponse(scope, customRecommendationName, customRecommendationBody, Context.NONE) - .getValue(); - } - - /** - * Delete a custom recommendation over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 scope, String customRecommendationName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (customRecommendationName == null) { - return Mono.error( - new IllegalArgumentException("Parameter customRecommendationName is required and cannot be null.")); - } - final String apiVersion = "2024-08-01"; - return FluxUtil.withContext( - context -> service.delete(this.client.getEndpoint(), apiVersion, scope, customRecommendationName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a custom recommendation over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 scope, String customRecommendationName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (customRecommendationName == null) { - return Mono.error( - new IllegalArgumentException("Parameter customRecommendationName is required and cannot be null.")); - } - final String apiVersion = "2024-08-01"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, scope, customRecommendationName, context); - } - - /** - * Delete a custom recommendation over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 scope, String customRecommendationName) { - return deleteWithResponseAsync(scope, customRecommendationName).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a custom recommendation over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String scope, String customRecommendationName, Context context) { - return deleteWithResponseAsync(scope, customRecommendationName, context).block(); - } - - /** - * Delete a custom recommendation over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 scope, String customRecommendationName) { - deleteWithResponse(scope, customRecommendationName, Context.NONE); - } - - /** - * Get a list of all relevant custom recommendations over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant custom recommendations over a scope along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2024-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, 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 a list of all relevant custom recommendations over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant custom recommendations over a scope along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2024-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get a list of all relevant custom recommendations over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant custom recommendations over a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of all relevant custom recommendations over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant custom recommendations over a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of all relevant custom recommendations over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant custom recommendations over a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(listAsync(scope)); - } - - /** - * Get a list of all relevant custom recommendations over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant custom recommendations over a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(listAsync(scope, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant custom recommendations over a scope 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 a list of all relevant custom recommendations over a scope 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomRecommendationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomRecommendationsImpl.java deleted file mode 100644 index 86e1a0177fa1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomRecommendationsImpl.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.CustomRecommendationsClient; -import com.azure.resourcemanager.security.fluent.models.CustomRecommendationInner; -import com.azure.resourcemanager.security.models.CustomRecommendation; -import com.azure.resourcemanager.security.models.CustomRecommendations; - -public final class CustomRecommendationsImpl implements CustomRecommendations { - private static final ClientLogger LOGGER = new ClientLogger(CustomRecommendationsImpl.class); - - private final CustomRecommendationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public CustomRecommendationsImpl(CustomRecommendationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String scope, String customRecommendationName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(scope, customRecommendationName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CustomRecommendationImpl(inner.getValue(), this.manager())); - } - - public CustomRecommendation get(String scope, String customRecommendationName) { - CustomRecommendationInner inner = this.serviceClient().get(scope, customRecommendationName); - if (inner != null) { - return new CustomRecommendationImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse(String scope, String customRecommendationName, - Context context) { - return this.serviceClient().deleteWithResponse(scope, customRecommendationName, context); - } - - public void deleteByResourceGroup(String scope, String customRecommendationName) { - this.serviceClient().delete(scope, customRecommendationName); - } - - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomRecommendationImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CustomRecommendationImpl(inner1, this.manager())); - } - - public CustomRecommendation getById(String id) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/customRecommendations/{customRecommendationName}", "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String customRecommendationName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/customRecommendations/{customRecommendationName}", - "customRecommendationName"); - if (customRecommendationName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'customRecommendations'.", id))); - } - return this.getWithResponse(scope, customRecommendationName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/customRecommendations/{customRecommendationName}", "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String customRecommendationName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/customRecommendations/{customRecommendationName}", - "customRecommendationName"); - if (customRecommendationName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'customRecommendations'.", id))); - } - return this.getWithResponse(scope, customRecommendationName, context); - } - - public void deleteById(String id) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/customRecommendations/{customRecommendationName}", "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String customRecommendationName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/customRecommendations/{customRecommendationName}", - "customRecommendationName"); - if (customRecommendationName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'customRecommendations'.", id))); - } - this.deleteByResourceGroupWithResponse(scope, customRecommendationName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/customRecommendations/{customRecommendationName}", "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String customRecommendationName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/customRecommendations/{customRecommendationName}", - "customRecommendationName"); - if (customRecommendationName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'customRecommendations'.", id))); - } - return this.deleteByResourceGroupWithResponse(scope, customRecommendationName, context); - } - - private CustomRecommendationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public CustomRecommendationImpl define(String name) { - return new CustomRecommendationImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStorageSettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStorageSettingImpl.java deleted file mode 100644 index 4f1a5f67f24c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStorageSettingImpl.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.DefenderForStorageSettingInner; -import com.azure.resourcemanager.security.models.DefenderForStorageSetting; -import com.azure.resourcemanager.security.models.DefenderForStorageSettingProperties; -import com.azure.resourcemanager.security.models.MalwareScan; -import com.azure.resourcemanager.security.models.SettingName; - -public final class DefenderForStorageSettingImpl - implements DefenderForStorageSetting, DefenderForStorageSetting.Definition { - private DefenderForStorageSettingInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - DefenderForStorageSettingImpl(DefenderForStorageSettingInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 DefenderForStorageSettingProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public DefenderForStorageSettingInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceId; - - private SettingName settingName; - - public DefenderForStorageSettingImpl withExistingResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - public DefenderForStorageSetting create() { - this.innerObject = serviceManager.serviceClient() - .getDefenderForStorages() - .createWithResponse(resourceId, settingName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public DefenderForStorageSetting create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDefenderForStorages() - .createWithResponse(resourceId, settingName, this.innerModel(), context) - .getValue(); - return this; - } - - DefenderForStorageSettingImpl(SettingName name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new DefenderForStorageSettingInner(); - this.serviceManager = serviceManager; - this.settingName = name; - } - - public DefenderForStorageSetting refresh() { - this.innerObject = serviceManager.serviceClient() - .getDefenderForStorages() - .getWithResponse(resourceId, settingName, Context.NONE) - .getValue(); - return this; - } - - public DefenderForStorageSetting refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDefenderForStorages() - .getWithResponse(resourceId, settingName, context) - .getValue(); - return this; - } - - public Response startMalwareScanWithResponse(Context context) { - return serviceManager.defenderForStorages().startMalwareScanWithResponse(resourceId, settingName, context); - } - - public MalwareScan startMalwareScan() { - return serviceManager.defenderForStorages().startMalwareScan(resourceId, settingName); - } - - public DefenderForStorageSettingImpl withProperties(DefenderForStorageSettingProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesClientImpl.java deleted file mode 100644 index 37a28aaa6d44..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesClientImpl.java +++ /dev/null @@ -1,911 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.DefenderForStoragesClient; -import com.azure.resourcemanager.security.fluent.models.DefenderForStorageSettingInner; -import com.azure.resourcemanager.security.fluent.models.MalwareScanInner; -import com.azure.resourcemanager.security.implementation.models.DefenderForStorageSettingList; -import com.azure.resourcemanager.security.models.SettingName; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in DefenderForStoragesClient. - */ -public final class DefenderForStoragesClientImpl implements DefenderForStoragesClient { - /** - * The proxy service used to perform REST calls. - */ - private final DefenderForStoragesService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of DefenderForStoragesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DefenderForStoragesClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(DefenderForStoragesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterDefenderForStorages to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterDefenderForStorages") - public interface DefenderForStoragesService { - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("settingName") SettingName settingName, @HeaderParam("Accept") String accept, Context context); - - @Put("/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("settingName") SettingName settingName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") DefenderForStorageSettingInner defenderForStorageSetting, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}/startMalwareScan") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> startMalwareScan(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("settingName") SettingName settingName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}/malwareScans/{scanId}/cancelMalwareScan") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> cancelMalwareScan(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("settingName") SettingName settingName, @PathParam("scanId") String scanId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}/malwareScans/{scanId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getMalwareScan(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("settingName") SettingName settingName, @PathParam("scanId") String scanId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting 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 Defender for Storage settings for the specified storage account along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, - SettingName settingName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - final String apiVersion = "2025-09-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), apiVersion, resourceId, settingName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting 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 Defender for Storage settings for the specified storage account along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, - SettingName settingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - final String apiVersion = "2025-09-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, resourceId, settingName, accept, context); - } - - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting 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 Defender for Storage settings for the specified storage account on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId, SettingName settingName) { - return getWithResponseAsync(resourceId, settingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting 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 Defender for Storage settings for the specified storage account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceId, SettingName settingName, - Context context) { - return getWithResponseAsync(resourceId, settingName, context).block(); - } - - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting 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 Defender for Storage settings for the specified storage account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DefenderForStorageSettingInner get(String resourceId, SettingName settingName) { - return getWithResponse(resourceId, settingName, Context.NONE).getValue(); - } - - /** - * Creates or updates the Defender for Storage settings on a specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param defenderForStorageSetting Defender for Storage Settings. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceId, - SettingName settingName, DefenderForStorageSettingInner defenderForStorageSetting) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (defenderForStorageSetting == null) { - return Mono.error( - new IllegalArgumentException("Parameter defenderForStorageSetting is required and cannot be null.")); - } else { - defenderForStorageSetting.validate(); - } - final String apiVersion = "2025-09-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, resourceId, settingName, - contentType, accept, defenderForStorageSetting, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates the Defender for Storage settings on a specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param defenderForStorageSetting Defender for Storage Settings. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceId, - SettingName settingName, DefenderForStorageSettingInner defenderForStorageSetting, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (defenderForStorageSetting == null) { - return Mono.error( - new IllegalArgumentException("Parameter defenderForStorageSetting is required and cannot be null.")); - } else { - defenderForStorageSetting.validate(); - } - final String apiVersion = "2025-09-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, resourceId, settingName, contentType, accept, - defenderForStorageSetting, context); - } - - /** - * Creates or updates the Defender for Storage settings on a specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param defenderForStorageSetting Defender for Storage Settings. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceId, SettingName settingName, - DefenderForStorageSettingInner defenderForStorageSetting) { - return createWithResponseAsync(resourceId, settingName, defenderForStorageSetting) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates the Defender for Storage settings on a specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param defenderForStorageSetting Defender for Storage Settings. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String resourceId, SettingName settingName, - DefenderForStorageSettingInner defenderForStorageSetting, Context context) { - return createWithResponseAsync(resourceId, settingName, defenderForStorageSetting, context).block(); - } - - /** - * Creates or updates the Defender for Storage settings on a specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param defenderForStorageSetting Defender for Storage Settings. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DefenderForStorageSettingInner create(String resourceId, SettingName settingName, - DefenderForStorageSettingInner defenderForStorageSetting) { - return createWithResponse(resourceId, settingName, defenderForStorageSetting, Context.NONE).getValue(); - } - - /** - * Lists the Defender for Storage settings for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of Defender for Storage settings along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2025-09-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, resourceId, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the Defender for Storage settings for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of Defender for Storage settings along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2025-09-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, resourceId, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists the Defender for Storage settings for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of Defender for Storage settings as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceId) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceId), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the Defender for Storage settings for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of Defender for Storage settings as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceId, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceId, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the Defender for Storage settings for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of Defender for Storage settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceId) { - return new PagedIterable<>(listAsync(resourceId)); - } - - /** - * Lists the Defender for Storage settings for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of Defender for Storage settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceId, Context context) { - return new PagedIterable<>(listAsync(resourceId, context)); - } - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. Blobs and Files will be scanned - * for malware. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting 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 describes the state of a malware scan operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> startMalwareScanWithResponseAsync(String resourceId, - SettingName settingName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - final String apiVersion = "2025-09-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.startMalwareScan(this.client.getEndpoint(), apiVersion, resourceId, - settingName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. Blobs and Files will be scanned - * for malware. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting 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 describes the state of a malware scan operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> startMalwareScanWithResponseAsync(String resourceId, - SettingName settingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - final String apiVersion = "2025-09-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.startMalwareScan(this.client.getEndpoint(), apiVersion, resourceId, settingName, accept, - context); - } - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. Blobs and Files will be scanned - * for malware. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting 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 describes the state of a malware scan operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startMalwareScanAsync(String resourceId, SettingName settingName) { - return startMalwareScanWithResponseAsync(resourceId, settingName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. Blobs and Files will be scanned - * for malware. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting 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 describes the state of a malware scan operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response startMalwareScanWithResponse(String resourceId, SettingName settingName, - Context context) { - return startMalwareScanWithResponseAsync(resourceId, settingName, context).block(); - } - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. Blobs and Files will be scanned - * for malware. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting 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 describes the state of a malware scan operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MalwareScanInner startMalwareScan(String resourceId, SettingName settingName) { - return startMalwareScanWithResponse(resourceId, settingName, Context.NONE).getValue(); - } - - /** - * Cancels a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 state of a malware scan operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> cancelMalwareScanWithResponseAsync(String resourceId, - SettingName settingName, String scanId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - final String apiVersion = "2025-09-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.cancelMalwareScan(this.client.getEndpoint(), apiVersion, resourceId, - settingName, scanId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Cancels a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 state of a malware scan operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> cancelMalwareScanWithResponseAsync(String resourceId, - SettingName settingName, String scanId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - final String apiVersion = "2025-09-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.cancelMalwareScan(this.client.getEndpoint(), apiVersion, resourceId, settingName, scanId, accept, - context); - } - - /** - * Cancels a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 state of a malware scan operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono cancelMalwareScanAsync(String resourceId, SettingName settingName, String scanId) { - return cancelMalwareScanWithResponseAsync(resourceId, settingName, scanId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Cancels a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 state of a malware scan operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelMalwareScanWithResponse(String resourceId, SettingName settingName, - String scanId, Context context) { - return cancelMalwareScanWithResponseAsync(resourceId, settingName, scanId, context).block(); - } - - /** - * Cancels a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 state of a malware scan operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MalwareScanInner cancelMalwareScan(String resourceId, SettingName settingName, String scanId) { - return cancelMalwareScanWithResponse(resourceId, settingName, scanId, Context.NONE).getValue(); - } - - /** - * Gets the Defender for Storage malware scan for the specified storage resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage malware scan for the specified storage resource along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMalwareScanWithResponseAsync(String resourceId, SettingName settingName, - String scanId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - final String apiVersion = "2025-09-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getMalwareScan(this.client.getEndpoint(), apiVersion, resourceId, - settingName, scanId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the Defender for Storage malware scan for the specified storage resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage malware scan for the specified storage resource along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMalwareScanWithResponseAsync(String resourceId, SettingName settingName, - String scanId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - final String apiVersion = "2025-09-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getMalwareScan(this.client.getEndpoint(), apiVersion, resourceId, settingName, scanId, accept, - context); - } - - /** - * Gets the Defender for Storage malware scan for the specified storage resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage malware scan for the specified storage resource on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getMalwareScanAsync(String resourceId, SettingName settingName, String scanId) { - return getMalwareScanWithResponseAsync(resourceId, settingName, scanId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the Defender for Storage malware scan for the specified storage resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage malware scan for the specified storage resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMalwareScanWithResponse(String resourceId, SettingName settingName, - String scanId, Context context) { - return getMalwareScanWithResponseAsync(resourceId, settingName, scanId, context).block(); - } - - /** - * Gets the Defender for Storage malware scan for the specified storage resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage malware scan for the specified storage resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MalwareScanInner getMalwareScan(String resourceId, SettingName settingName, String scanId) { - return getMalwareScanWithResponse(resourceId, settingName, scanId, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Defender for Storage settings 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 list of Defender for Storage settings 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesImpl.java deleted file mode 100644 index 084697426ec2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DefenderForStoragesImpl.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.DefenderForStoragesClient; -import com.azure.resourcemanager.security.fluent.models.DefenderForStorageSettingInner; -import com.azure.resourcemanager.security.fluent.models.MalwareScanInner; -import com.azure.resourcemanager.security.models.DefenderForStorageSetting; -import com.azure.resourcemanager.security.models.DefenderForStorages; -import com.azure.resourcemanager.security.models.MalwareScan; -import com.azure.resourcemanager.security.models.SettingName; - -public final class DefenderForStoragesImpl implements DefenderForStorages { - private static final ClientLogger LOGGER = new ClientLogger(DefenderForStoragesImpl.class); - - private final DefenderForStoragesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public DefenderForStoragesImpl(DefenderForStoragesClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceId, SettingName settingName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceId, settingName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DefenderForStorageSettingImpl(inner.getValue(), this.manager())); - } - - public DefenderForStorageSetting get(String resourceId, SettingName settingName) { - DefenderForStorageSettingInner inner = this.serviceClient().get(resourceId, settingName); - if (inner != null) { - return new DefenderForStorageSettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceId) { - PagedIterable inner = this.serviceClient().list(resourceId); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DefenderForStorageSettingImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceId, Context context) { - PagedIterable inner = this.serviceClient().list(resourceId, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DefenderForStorageSettingImpl(inner1, this.manager())); - } - - public Response startMalwareScanWithResponse(String resourceId, SettingName settingName, - Context context) { - Response inner - = this.serviceClient().startMalwareScanWithResponse(resourceId, settingName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new MalwareScanImpl(inner.getValue(), this.manager())); - } - - public MalwareScan startMalwareScan(String resourceId, SettingName settingName) { - MalwareScanInner inner = this.serviceClient().startMalwareScan(resourceId, settingName); - if (inner != null) { - return new MalwareScanImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response cancelMalwareScanWithResponse(String resourceId, SettingName settingName, - String scanId, Context context) { - Response inner - = this.serviceClient().cancelMalwareScanWithResponse(resourceId, settingName, scanId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new MalwareScanImpl(inner.getValue(), this.manager())); - } - - public MalwareScan cancelMalwareScan(String resourceId, SettingName settingName, String scanId) { - MalwareScanInner inner = this.serviceClient().cancelMalwareScan(resourceId, settingName, scanId); - if (inner != null) { - return new MalwareScanImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getMalwareScanWithResponse(String resourceId, SettingName settingName, String scanId, - Context context) { - Response inner - = this.serviceClient().getMalwareScanWithResponse(resourceId, settingName, scanId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new MalwareScanImpl(inner.getValue(), this.manager())); - } - - public MalwareScan getMalwareScan(String resourceId, SettingName settingName, String scanId) { - MalwareScanInner inner = this.serviceClient().getMalwareScan(resourceId, settingName, scanId); - if (inner != null) { - return new MalwareScanImpl(inner, this.manager()); - } else { - return null; - } - } - - public DefenderForStorageSetting getById(String id) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}", "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String settingNameLocal = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}", "settingName"); - if (settingNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'defenderForStorageSettings'.", id))); - } - SettingName settingName = SettingName.fromString(settingNameLocal); - return this.getWithResponse(resourceId, settingName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}", "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String settingNameLocal = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}", "settingName"); - if (settingNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'defenderForStorageSettings'.", id))); - } - SettingName settingName = SettingName.fromString(settingNameLocal); - return this.getWithResponse(resourceId, settingName, context); - } - - private DefenderForStoragesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public DefenderForStorageSettingImpl define(SettingName name) { - return new DefenderForStorageSettingImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationImpl.java deleted file mode 100644 index b7813646d495..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; -import com.azure.resourcemanager.security.models.DevOpsConfiguration; -import com.azure.resourcemanager.security.models.DevOpsConfigurationProperties; - -public final class DevOpsConfigurationImpl implements DevOpsConfiguration { - private DevOpsConfigurationInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - DevOpsConfigurationImpl(DevOpsConfigurationInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 DevOpsConfigurationProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public DevOpsConfigurationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsClientImpl.java deleted file mode 100644 index f471088a416b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsClientImpl.java +++ /dev/null @@ -1,1151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.Patch; -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.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.security.fluent.DevOpsConfigurationsClient; -import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; -import com.azure.resourcemanager.security.implementation.models.DevOpsConfigurationListResponse; -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 DevOpsConfigurationsClient. - */ -public final class DevOpsConfigurationsClientImpl implements DevOpsConfigurationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final DevOpsConfigurationsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of DevOpsConfigurationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DevOpsConfigurationsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(DevOpsConfigurationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterDevOpsConfigurations to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterDevOpsConfigurations") - public interface DevOpsConfigurationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @HeaderParam("Accept") String accept, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default") - @ExpectedResponses({ 200, 201, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") DevOpsConfigurationInner devOpsConfiguration, Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") DevOpsConfigurationInner devOpsConfiguration, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 a DevOps Configuration along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 DevOps Configuration along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, accept, context); - } - - /** - * Gets a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 a DevOps Configuration on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName) { - return getWithResponseAsync(resourceGroupName, securityConnectorName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 DevOps Configuration along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, context).block(); - } - - /** - * Gets a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 a DevOps Configuration. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DevOpsConfigurationInner get(String resourceGroupName, String securityConnectorName) { - return getWithResponse(resourceGroupName, securityConnectorName, Context.NONE).getValue(); - } - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (devOpsConfiguration == null) { - return Mono - .error(new IllegalArgumentException("Parameter devOpsConfiguration is required and cannot be null.")); - } else { - devOpsConfiguration.validate(); - } - final String apiVersion = "2025-11-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, contentType, accept, - devOpsConfiguration, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (devOpsConfiguration == null) { - return Mono - .error(new IllegalArgumentException("Parameter devOpsConfiguration is required and cannot be null.")); - } else { - devOpsConfiguration.validate(); - } - final String apiVersion = "2025-11-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, contentType, accept, devOpsConfiguration, context); - } - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DevOpsConfigurationInner> beginCreateOrUpdateAsync( - String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, devOpsConfiguration); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DevOpsConfigurationInner.class, DevOpsConfigurationInner.class, - this.client.getContext()); - } - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DevOpsConfigurationInner> beginCreateOrUpdateAsync( - String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DevOpsConfigurationInner.class, DevOpsConfigurationInner.class, context); - } - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DevOpsConfigurationInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { - return this.beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration) - .getSyncPoller(); - } - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DevOpsConfigurationInner> beginCreateOrUpdate( - String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration, - Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context) - .getSyncPoller(); - } - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration) { - return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DevOpsConfigurationInner createOrUpdate(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration) { - return createOrUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration).block(); - } - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DevOpsConfigurationInner createOrUpdate(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration, Context context) { - return createOrUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context).block(); - } - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (devOpsConfiguration == null) { - return Mono - .error(new IllegalArgumentException("Parameter devOpsConfiguration is required and cannot be null.")); - } else { - devOpsConfiguration.validate(); - } - final String apiVersion = "2025-11-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, contentType, accept, devOpsConfiguration, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (devOpsConfiguration == null) { - return Mono - .error(new IllegalArgumentException("Parameter devOpsConfiguration is required and cannot be null.")); - } else { - devOpsConfiguration.validate(); - } - final String apiVersion = "2025-11-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, contentType, accept, devOpsConfiguration, context); - } - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DevOpsConfigurationInner> beginUpdateAsync( - String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, securityConnectorName, devOpsConfiguration); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DevOpsConfigurationInner.class, DevOpsConfigurationInner.class, - this.client.getContext()); - } - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DevOpsConfigurationInner> beginUpdateAsync( - String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DevOpsConfigurationInner.class, DevOpsConfigurationInner.class, context); - } - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DevOpsConfigurationInner> beginUpdate( - String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration) { - return this.beginUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration).getSyncPoller(); - } - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DevOpsConfigurationInner> beginUpdate( - String resourceGroupName, String securityConnectorName, DevOpsConfigurationInner devOpsConfiguration, - Context context) { - return this.beginUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context) - .getSyncPoller(); - } - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration) { - return beginUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration, Context context) { - return beginUpdateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DevOpsConfigurationInner update(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration) { - return updateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration).block(); - } - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DevOpsConfigurationInner update(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration, Context context) { - return updateAsync(resourceGroupName, securityConnectorName, devOpsConfiguration, context).block(); - } - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, - String securityConnectorName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 securityConnectorName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, context); - } - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, - String securityConnectorName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, securityConnectorName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String securityConnectorName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, securityConnectorName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String securityConnectorName) { - return this.beginDeleteAsync(resourceGroupName, securityConnectorName).getSyncPoller(); - } - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String securityConnectorName, - Context context) { - return this.beginDeleteAsync(resourceGroupName, securityConnectorName, context).getSyncPoller(); - } - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String securityConnectorName) { - return beginDeleteAsync(resourceGroupName, securityConnectorName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String securityConnectorName, Context context) { - return beginDeleteAsync(resourceGroupName, securityConnectorName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String securityConnectorName) { - deleteAsync(resourceGroupName, securityConnectorName).block(); - } - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String securityConnectorName, Context context) { - deleteAsync(resourceGroupName, securityConnectorName, context).block(); - } - - /** - * List DevOps Configurations. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, 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 DevOps Configurations. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List DevOps Configurations. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List DevOps Configurations. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List DevOps Configurations. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName)); - } - - /** - * List DevOps Configurations. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, context)); - } - - /** - * List DevOps Configurations. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination 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())); - } - - /** - * List DevOps Configurations. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsImpl.java deleted file mode 100644 index ef81d5b43e3a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsConfigurationsImpl.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.DevOpsConfigurationsClient; -import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; -import com.azure.resourcemanager.security.models.DevOpsConfiguration; -import com.azure.resourcemanager.security.models.DevOpsConfigurations; - -public final class DevOpsConfigurationsImpl implements DevOpsConfigurations { - private static final ClientLogger LOGGER = new ClientLogger(DevOpsConfigurationsImpl.class); - - private final DevOpsConfigurationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public DevOpsConfigurationsImpl(DevOpsConfigurationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DevOpsConfigurationImpl(inner.getValue(), this.manager())); - } - - public DevOpsConfiguration get(String resourceGroupName, String securityConnectorName) { - DevOpsConfigurationInner inner = this.serviceClient().get(resourceGroupName, securityConnectorName); - if (inner != null) { - return new DevOpsConfigurationImpl(inner, this.manager()); - } else { - return null; - } - } - - public DevOpsConfiguration createOrUpdate(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration) { - DevOpsConfigurationInner inner - = this.serviceClient().createOrUpdate(resourceGroupName, securityConnectorName, devOpsConfiguration); - if (inner != null) { - return new DevOpsConfigurationImpl(inner, this.manager()); - } else { - return null; - } - } - - public DevOpsConfiguration createOrUpdate(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration, Context context) { - DevOpsConfigurationInner inner = this.serviceClient() - .createOrUpdate(resourceGroupName, securityConnectorName, devOpsConfiguration, context); - if (inner != null) { - return new DevOpsConfigurationImpl(inner, this.manager()); - } else { - return null; - } - } - - public DevOpsConfiguration update(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration) { - DevOpsConfigurationInner inner - = this.serviceClient().update(resourceGroupName, securityConnectorName, devOpsConfiguration); - if (inner != null) { - return new DevOpsConfigurationImpl(inner, this.manager()); - } else { - return null; - } - } - - public DevOpsConfiguration update(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration, Context context) { - DevOpsConfigurationInner inner - = this.serviceClient().update(resourceGroupName, securityConnectorName, devOpsConfiguration, context); - if (inner != null) { - return new DevOpsConfigurationImpl(inner, this.manager()); - } else { - return null; - } - } - - public void deleteByResourceGroup(String resourceGroupName, String securityConnectorName) { - this.serviceClient().delete(resourceGroupName, securityConnectorName); - } - - public void delete(String resourceGroupName, String securityConnectorName, Context context) { - this.serviceClient().delete(resourceGroupName, securityConnectorName, context); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DevOpsConfigurationImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, - Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DevOpsConfigurationImpl(inner1, this.manager())); - } - - private DevOpsConfigurationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsClientImpl.java deleted file mode 100644 index 2257866b7426..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsClientImpl.java +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.DevOpsOperationResultsClient; -import com.azure.resourcemanager.security.fluent.models.OperationStatusResultInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in DevOpsOperationResultsClient. - */ -public final class DevOpsOperationResultsClientImpl implements DevOpsOperationResultsClient { - /** - * The proxy service used to perform REST calls. - */ - private final DevOpsOperationResultsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of DevOpsOperationResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DevOpsOperationResultsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(DevOpsOperationResultsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterDevOpsOperationResults to be used by the proxy service - * to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterDevOpsOperationResults") - public interface DevOpsOperationResultsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/operationResults/{operationResultId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("operationResultId") String operationResultId, @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get devops long running operation result. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param operationResultId The operationResultId 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 devops long running operation result along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String operationResultId) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (operationResultId == null) { - return Mono - .error(new IllegalArgumentException("Parameter operationResultId is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, operationResultId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get devops long running operation result. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param operationResultId The operationResultId 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 devops long running operation result along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String operationResultId, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (operationResultId == null) { - return Mono - .error(new IllegalArgumentException("Parameter operationResultId is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, operationResultId, accept, context); - } - - /** - * Get devops long running operation result. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param operationResultId The operationResultId 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 devops long running operation result on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName, - String operationResultId) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, operationResultId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get devops long running operation result. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param operationResultId The operationResultId 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 devops long running operation result along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String operationResultId, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, operationResultId, context).block(); - } - - /** - * Get devops long running operation result. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param operationResultId The operationResultId 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 devops long running operation result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner get(String resourceGroupName, String securityConnectorName, - String operationResultId) { - return getWithResponse(resourceGroupName, securityConnectorName, operationResultId, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsImpl.java deleted file mode 100644 index 2f845f1f68ec..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DevOpsOperationResultsImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.DevOpsOperationResultsClient; -import com.azure.resourcemanager.security.fluent.models.OperationStatusResultInner; -import com.azure.resourcemanager.security.models.DevOpsOperationResults; -import com.azure.resourcemanager.security.models.OperationStatusResult; - -public final class DevOpsOperationResultsImpl implements DevOpsOperationResults { - private static final ClientLogger LOGGER = new ClientLogger(DevOpsOperationResultsImpl.class); - - private final DevOpsOperationResultsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public DevOpsOperationResultsImpl(DevOpsOperationResultsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String operationResultId, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, securityConnectorName, operationResultId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationStatusResultImpl(inner.getValue(), this.manager())); - } - - public OperationStatusResult get(String resourceGroupName, String securityConnectorName, String operationResultId) { - OperationStatusResultInner inner - = this.serviceClient().get(resourceGroupName, securityConnectorName, operationResultId); - if (inner != null) { - return new OperationStatusResultImpl(inner, this.manager()); - } else { - return null; - } - } - - private DevOpsOperationResultsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupImpl.java deleted file mode 100644 index a1ec1e9e342d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupImpl.java +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.DeviceSecurityGroupInner; -import com.azure.resourcemanager.security.models.AllowlistCustomAlertRule; -import com.azure.resourcemanager.security.models.DenylistCustomAlertRule; -import com.azure.resourcemanager.security.models.DeviceSecurityGroup; -import com.azure.resourcemanager.security.models.ThresholdCustomAlertRule; -import com.azure.resourcemanager.security.models.TimeWindowCustomAlertRule; -import java.util.Collections; -import java.util.List; - -public final class DeviceSecurityGroupImpl - implements DeviceSecurityGroup, DeviceSecurityGroup.Definition, DeviceSecurityGroup.Update { - private DeviceSecurityGroupInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager 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 List thresholdRules() { - List inner = this.innerModel().thresholdRules(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List timeWindowRules() { - List inner = this.innerModel().timeWindowRules(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List allowlistRules() { - List inner = this.innerModel().allowlistRules(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List denylistRules() { - List inner = this.innerModel().denylistRules(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public DeviceSecurityGroupInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceId; - - private String deviceSecurityGroupName; - - public DeviceSecurityGroupImpl withExistingResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - public DeviceSecurityGroup create() { - this.innerObject = serviceManager.serviceClient() - .getDeviceSecurityGroups() - .createOrUpdateWithResponse(resourceId, deviceSecurityGroupName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public DeviceSecurityGroup create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDeviceSecurityGroups() - .createOrUpdateWithResponse(resourceId, deviceSecurityGroupName, this.innerModel(), context) - .getValue(); - return this; - } - - DeviceSecurityGroupImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new DeviceSecurityGroupInner(); - this.serviceManager = serviceManager; - this.deviceSecurityGroupName = name; - } - - public DeviceSecurityGroupImpl update() { - return this; - } - - public DeviceSecurityGroup apply() { - this.innerObject = serviceManager.serviceClient() - .getDeviceSecurityGroups() - .createOrUpdateWithResponse(resourceId, deviceSecurityGroupName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public DeviceSecurityGroup apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDeviceSecurityGroups() - .createOrUpdateWithResponse(resourceId, deviceSecurityGroupName, this.innerModel(), context) - .getValue(); - return this; - } - - DeviceSecurityGroupImpl(DeviceSecurityGroupInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceId = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", "resourceId"); - this.deviceSecurityGroupName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "deviceSecurityGroupName"); - } - - public DeviceSecurityGroup refresh() { - this.innerObject = serviceManager.serviceClient() - .getDeviceSecurityGroups() - .getWithResponse(resourceId, deviceSecurityGroupName, Context.NONE) - .getValue(); - return this; - } - - public DeviceSecurityGroup refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDeviceSecurityGroups() - .getWithResponse(resourceId, deviceSecurityGroupName, context) - .getValue(); - return this; - } - - public DeviceSecurityGroupImpl withThresholdRules(List thresholdRules) { - this.innerModel().withThresholdRules(thresholdRules); - return this; - } - - public DeviceSecurityGroupImpl withTimeWindowRules(List timeWindowRules) { - this.innerModel().withTimeWindowRules(timeWindowRules); - return this; - } - - public DeviceSecurityGroupImpl withAllowlistRules(List allowlistRules) { - this.innerModel().withAllowlistRules(allowlistRules); - return this; - } - - public DeviceSecurityGroupImpl withDenylistRules(List denylistRules) { - this.innerModel().withDenylistRules(denylistRules); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupsClientImpl.java deleted file mode 100644 index 6372d0cbabbd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupsClientImpl.java +++ /dev/null @@ -1,643 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.resourcemanager.security.fluent.DeviceSecurityGroupsClient; -import com.azure.resourcemanager.security.fluent.models.DeviceSecurityGroupInner; -import com.azure.resourcemanager.security.implementation.models.DeviceSecurityGroupList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in DeviceSecurityGroupsClient. - */ -public final class DeviceSecurityGroupsClientImpl implements DeviceSecurityGroupsClient { - /** - * The proxy service used to perform REST calls. - */ - private final DeviceSecurityGroupsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of DeviceSecurityGroupsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DeviceSecurityGroupsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(DeviceSecurityGroupsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterDeviceSecurityGroups to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterDeviceSecurityGroups") - public interface DeviceSecurityGroupsService { - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("deviceSecurityGroupName") String deviceSecurityGroupName, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("deviceSecurityGroupName") String deviceSecurityGroupName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") DeviceSecurityGroupInner deviceSecurityGroup, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("deviceSecurityGroupName") String deviceSecurityGroupName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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 the device security group resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, - String deviceSecurityGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (deviceSecurityGroupName == null) { - return Mono.error( - new IllegalArgumentException("Parameter deviceSecurityGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, resourceId, - deviceSecurityGroupName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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 the device security group resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, - String deviceSecurityGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (deviceSecurityGroupName == null) { - return Mono.error( - new IllegalArgumentException("Parameter deviceSecurityGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, resourceId, deviceSecurityGroupName, accept, context); - } - - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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 the device security group resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId, String deviceSecurityGroupName) { - return getWithResponseAsync(resourceId, deviceSecurityGroupName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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 the device security group resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceId, String deviceSecurityGroupName, - Context context) { - return getWithResponseAsync(resourceId, deviceSecurityGroupName, context).block(); - } - - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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 the device security group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceSecurityGroupInner get(String resourceId, String deviceSecurityGroupName) { - return getWithResponse(resourceId, deviceSecurityGroupName, Context.NONE).getValue(); - } - - /** - * Use this method to creates or updates the device security group on a specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param deviceSecurityGroup Security group object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceId, - String deviceSecurityGroupName, DeviceSecurityGroupInner deviceSecurityGroup) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (deviceSecurityGroupName == null) { - return Mono.error( - new IllegalArgumentException("Parameter deviceSecurityGroupName is required and cannot be null.")); - } - if (deviceSecurityGroup == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceSecurityGroup is required and cannot be null.")); - } else { - deviceSecurityGroup.validate(); - } - final String apiVersion = "2019-08-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, resourceId, - deviceSecurityGroupName, contentType, accept, deviceSecurityGroup, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to creates or updates the device security group on a specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param deviceSecurityGroup Security group object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceId, - String deviceSecurityGroupName, DeviceSecurityGroupInner deviceSecurityGroup, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (deviceSecurityGroupName == null) { - return Mono.error( - new IllegalArgumentException("Parameter deviceSecurityGroupName is required and cannot be null.")); - } - if (deviceSecurityGroup == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceSecurityGroup is required and cannot be null.")); - } else { - deviceSecurityGroup.validate(); - } - final String apiVersion = "2019-08-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, resourceId, deviceSecurityGroupName, - contentType, accept, deviceSecurityGroup, context); - } - - /** - * Use this method to creates or updates the device security group on a specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param deviceSecurityGroup Security group object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceId, String deviceSecurityGroupName, - DeviceSecurityGroupInner deviceSecurityGroup) { - return createOrUpdateWithResponseAsync(resourceId, deviceSecurityGroupName, deviceSecurityGroup) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Use this method to creates or updates the device security group on a specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param deviceSecurityGroup Security group object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceId, - String deviceSecurityGroupName, DeviceSecurityGroupInner deviceSecurityGroup, Context context) { - return createOrUpdateWithResponseAsync(resourceId, deviceSecurityGroupName, deviceSecurityGroup, context) - .block(); - } - - /** - * Use this method to creates or updates the device security group on a specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param deviceSecurityGroup Security group object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceSecurityGroupInner createOrUpdate(String resourceId, String deviceSecurityGroupName, - DeviceSecurityGroupInner deviceSecurityGroup) { - return createOrUpdateWithResponse(resourceId, deviceSecurityGroupName, deviceSecurityGroup, Context.NONE) - .getValue(); - } - - /** - * User this method to deletes the device security group. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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 the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceId, String deviceSecurityGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (deviceSecurityGroupName == null) { - return Mono.error( - new IllegalArgumentException("Parameter deviceSecurityGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, resourceId, - deviceSecurityGroupName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * User this method to deletes the device security group. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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 the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceId, String deviceSecurityGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (deviceSecurityGroupName == null) { - return Mono.error( - new IllegalArgumentException("Parameter deviceSecurityGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, resourceId, deviceSecurityGroupName, context); - } - - /** - * User this method to deletes the device security group. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceId, String deviceSecurityGroupName) { - return deleteWithResponseAsync(resourceId, deviceSecurityGroupName).flatMap(ignored -> Mono.empty()); - } - - /** - * User this method to deletes the device security group. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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 the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceId, String deviceSecurityGroupName, Context context) { - return deleteWithResponseAsync(resourceId, deviceSecurityGroupName, context).block(); - } - - /** - * User this method to deletes the device security group. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceId, String deviceSecurityGroupName) { - deleteWithResponse(resourceId, deviceSecurityGroupName, Context.NONE); - } - - /** - * Use this method get the list of device security groups for the specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of device security groups along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, resourceId, 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())); - } - - /** - * Use this method get the list of device security groups for the specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of device security groups along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, resourceId, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Use this method get the list of device security groups for the specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of device security groups as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceId) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceId), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Use this method get the list of device security groups for the specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of device security groups as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceId, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceId, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Use this method get the list of device security groups for the specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of device security groups as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceId) { - return new PagedIterable<>(listAsync(resourceId)); - } - - /** - * Use this method get the list of device security groups for the specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of device security groups as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceId, Context context) { - return new PagedIterable<>(listAsync(resourceId, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of device security groups 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 list of device security groups 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupsImpl.java deleted file mode 100644 index 7b5f7dfb893a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupsImpl.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.DeviceSecurityGroupsClient; -import com.azure.resourcemanager.security.fluent.models.DeviceSecurityGroupInner; -import com.azure.resourcemanager.security.models.DeviceSecurityGroup; -import com.azure.resourcemanager.security.models.DeviceSecurityGroups; - -public final class DeviceSecurityGroupsImpl implements DeviceSecurityGroups { - private static final ClientLogger LOGGER = new ClientLogger(DeviceSecurityGroupsImpl.class); - - private final DeviceSecurityGroupsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public DeviceSecurityGroupsImpl(DeviceSecurityGroupsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceId, String deviceSecurityGroupName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceId, deviceSecurityGroupName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DeviceSecurityGroupImpl(inner.getValue(), this.manager())); - } - - public DeviceSecurityGroup get(String resourceId, String deviceSecurityGroupName) { - DeviceSecurityGroupInner inner = this.serviceClient().get(resourceId, deviceSecurityGroupName); - if (inner != null) { - return new DeviceSecurityGroupImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse(String resourceId, String deviceSecurityGroupName, - Context context) { - return this.serviceClient().deleteWithResponse(resourceId, deviceSecurityGroupName, context); - } - - public void deleteByResourceGroup(String resourceId, String deviceSecurityGroupName) { - this.serviceClient().delete(resourceId, deviceSecurityGroupName); - } - - public PagedIterable list(String resourceId) { - PagedIterable inner = this.serviceClient().list(resourceId); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceSecurityGroupImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceId, Context context) { - PagedIterable inner = this.serviceClient().list(resourceId, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceSecurityGroupImpl(inner1, this.manager())); - } - - public DeviceSecurityGroup getById(String id) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String deviceSecurityGroupName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "deviceSecurityGroupName"); - if (deviceSecurityGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceSecurityGroups'.", id))); - } - return this.getWithResponse(resourceId, deviceSecurityGroupName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String deviceSecurityGroupName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "deviceSecurityGroupName"); - if (deviceSecurityGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceSecurityGroups'.", id))); - } - return this.getWithResponse(resourceId, deviceSecurityGroupName, context); - } - - public void deleteById(String id) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String deviceSecurityGroupName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "deviceSecurityGroupName"); - if (deviceSecurityGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceSecurityGroups'.", id))); - } - this.deleteByResourceGroupWithResponse(resourceId, deviceSecurityGroupName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String deviceSecurityGroupName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "deviceSecurityGroupName"); - if (deviceSecurityGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceSecurityGroups'.", id))); - } - return this.deleteByResourceGroupWithResponse(resourceId, deviceSecurityGroupName, context); - } - - private DeviceSecurityGroupsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public DeviceSecurityGroupImpl define(String name) { - return new DeviceSecurityGroupImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionImpl.java deleted file mode 100644 index 3e9f30e34db7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner; -import com.azure.resourcemanager.security.models.DiscoveredSecuritySolution; -import com.azure.resourcemanager.security.models.SecurityFamily; - -public final class DiscoveredSecuritySolutionImpl implements DiscoveredSecuritySolution { - private DiscoveredSecuritySolutionInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - DiscoveredSecuritySolutionImpl(DiscoveredSecuritySolutionInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 String location() { - return this.innerModel().location(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public SecurityFamily securityFamily() { - return this.innerModel().securityFamily(); - } - - public String offer() { - return this.innerModel().offer(); - } - - public String publisher() { - return this.innerModel().publisher(); - } - - public String sku() { - return this.innerModel().sku(); - } - - public DiscoveredSecuritySolutionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionsClientImpl.java deleted file mode 100644 index 3a2e53f49d84..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionsClientImpl.java +++ /dev/null @@ -1,609 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.DiscoveredSecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner; -import com.azure.resourcemanager.security.implementation.models.DiscoveredSecuritySolutionList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in DiscoveredSecuritySolutionsClient. - */ -public final class DiscoveredSecuritySolutionsClientImpl implements DiscoveredSecuritySolutionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final DiscoveredSecuritySolutionsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of DiscoveredSecuritySolutionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DiscoveredSecuritySolutionsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(DiscoveredSecuritySolutionsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterDiscoveredSecuritySolutions to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterDiscoveredSecuritySolutions") - public interface DiscoveredSecuritySolutionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions/{discoveredSecuritySolutionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @PathParam("discoveredSecuritySolutionName") String discoveredSecuritySolutionName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegion(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/discoveredSecuritySolutions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets a specific discovered Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param discoveredSecuritySolutionName Name of a discovered security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 discovered Security Solution along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String ascLocation, String discoveredSecuritySolutionName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (discoveredSecuritySolutionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter discoveredSecuritySolutionName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, ascLocation, discoveredSecuritySolutionName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a specific discovered Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param discoveredSecuritySolutionName Name of a discovered security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 discovered Security Solution along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String ascLocation, String discoveredSecuritySolutionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (discoveredSecuritySolutionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter discoveredSecuritySolutionName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - ascLocation, discoveredSecuritySolutionName, accept, context); - } - - /** - * Gets a specific discovered Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param discoveredSecuritySolutionName Name of a discovered security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 discovered Security Solution on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String ascLocation, - String discoveredSecuritySolutionName) { - return getWithResponseAsync(resourceGroupName, ascLocation, discoveredSecuritySolutionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a specific discovered Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param discoveredSecuritySolutionName Name of a discovered security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 discovered Security Solution along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String ascLocation, - String discoveredSecuritySolutionName, Context context) { - return getWithResponseAsync(resourceGroupName, ascLocation, discoveredSecuritySolutionName, context).block(); - } - - /** - * Gets a specific discovered Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param discoveredSecuritySolutionName Name of a discovered security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 discovered Security Solution. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiscoveredSecuritySolutionInner get(String resourceGroupName, String ascLocation, - String discoveredSecuritySolutionName) { - return getWithResponse(resourceGroupName, ascLocation, discoveredSecuritySolutionName, Context.NONE).getValue(); - } - - /** - * Gets a list of discovered Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription and location along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync(String ascLocation) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByHomeRegion(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of discovered Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription and location along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync(String ascLocation, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByHomeRegion(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), ascLocation, - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets a list of discovered Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription and location as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation) { - return new PagedFlux<>(() -> listByHomeRegionSinglePageAsync(ascLocation), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of discovered Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription and location as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation, Context context) { - return new PagedFlux<>(() -> listByHomeRegionSinglePageAsync(ascLocation, context), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of discovered Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation) { - return new PagedIterable<>(listByHomeRegionAsync(ascLocation)); - } - - /** - * Gets a list of discovered Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation, Context context) { - return new PagedIterable<>(listByHomeRegionAsync(ascLocation, context)); - } - - /** - * Gets a list of discovered Security Solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of discovered Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-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)); - } - - /** - * Gets a list of discovered Security Solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of discovered Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription 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 a list of discovered Security Solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets a list of discovered Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription 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 a list of discovered Security Solutions for the subscription and location along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription and location along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @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 discovered Security Solutions for the subscription 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 a list of discovered Security Solutions for the subscription 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionsImpl.java deleted file mode 100644 index 649aa0c5e03f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionsImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.DiscoveredSecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner; -import com.azure.resourcemanager.security.models.DiscoveredSecuritySolution; -import com.azure.resourcemanager.security.models.DiscoveredSecuritySolutions; - -public final class DiscoveredSecuritySolutionsImpl implements DiscoveredSecuritySolutions { - private static final ClientLogger LOGGER = new ClientLogger(DiscoveredSecuritySolutionsImpl.class); - - private final DiscoveredSecuritySolutionsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public DiscoveredSecuritySolutionsImpl(DiscoveredSecuritySolutionsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String ascLocation, - String discoveredSecuritySolutionName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, ascLocation, discoveredSecuritySolutionName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DiscoveredSecuritySolutionImpl(inner.getValue(), this.manager())); - } - - public DiscoveredSecuritySolution get(String resourceGroupName, String ascLocation, - String discoveredSecuritySolutionName) { - DiscoveredSecuritySolutionInner inner - = this.serviceClient().get(resourceGroupName, ascLocation, discoveredSecuritySolutionName); - if (inner != null) { - return new DiscoveredSecuritySolutionImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listByHomeRegion(String ascLocation) { - PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new DiscoveredSecuritySolutionImpl(inner1, this.manager())); - } - - public PagedIterable listByHomeRegion(String ascLocation, Context context) { - PagedIterable inner - = this.serviceClient().listByHomeRegion(ascLocation, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new DiscoveredSecuritySolutionImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new DiscoveredSecuritySolutionImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new DiscoveredSecuritySolutionImpl(inner1, this.manager())); - } - - private DiscoveredSecuritySolutionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExternalSecuritySolutionImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExternalSecuritySolutionImpl.java deleted file mode 100644 index 437d7a545997..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExternalSecuritySolutionImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner; -import com.azure.resourcemanager.security.models.ExternalSecuritySolution; -import com.azure.resourcemanager.security.models.ExternalSecuritySolutionKind; - -public final class ExternalSecuritySolutionImpl implements ExternalSecuritySolution { - private ExternalSecuritySolutionInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ExternalSecuritySolutionImpl(ExternalSecuritySolutionInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 ExternalSecuritySolutionKind kind() { - return this.innerModel().kind(); - } - - public Object properties() { - return this.innerModel().properties(); - } - - public String location() { - return this.innerModel().location(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ExternalSecuritySolutionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExternalSecuritySolutionsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExternalSecuritySolutionsClientImpl.java deleted file mode 100644 index 5511ff4a4006..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExternalSecuritySolutionsClientImpl.java +++ /dev/null @@ -1,607 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.ExternalSecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner; -import com.azure.resourcemanager.security.implementation.models.ExternalSecuritySolutionList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ExternalSecuritySolutionsClient. - */ -public final class ExternalSecuritySolutionsClientImpl implements ExternalSecuritySolutionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ExternalSecuritySolutionsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of ExternalSecuritySolutionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ExternalSecuritySolutionsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(ExternalSecuritySolutionsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterExternalSecuritySolutions to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterExternalSecuritySolutions") - public interface ExternalSecuritySolutionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions/{externalSecuritySolutionsName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @PathParam("externalSecuritySolutionsName") String externalSecuritySolutionsName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegion(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/externalSecuritySolutions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets a specific external Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param externalSecuritySolutionsName Name of an external security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 external Security Solution along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String ascLocation, String externalSecuritySolutionsName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (externalSecuritySolutionsName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter externalSecuritySolutionsName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, ascLocation, externalSecuritySolutionsName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a specific external Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param externalSecuritySolutionsName Name of an external security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 external Security Solution along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String ascLocation, String externalSecuritySolutionsName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (externalSecuritySolutionsName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter externalSecuritySolutionsName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - ascLocation, externalSecuritySolutionsName, accept, context); - } - - /** - * Gets a specific external Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param externalSecuritySolutionsName Name of an external security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 external Security Solution on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String ascLocation, - String externalSecuritySolutionsName) { - return getWithResponseAsync(resourceGroupName, ascLocation, externalSecuritySolutionsName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a specific external Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param externalSecuritySolutionsName Name of an external security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 external Security Solution along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String ascLocation, - String externalSecuritySolutionsName, Context context) { - return getWithResponseAsync(resourceGroupName, ascLocation, externalSecuritySolutionsName, context).block(); - } - - /** - * Gets a specific external Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param externalSecuritySolutionsName Name of an external security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 external Security Solution. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExternalSecuritySolutionInner get(String resourceGroupName, String ascLocation, - String externalSecuritySolutionsName) { - return getWithResponse(resourceGroupName, ascLocation, externalSecuritySolutionsName, Context.NONE).getValue(); - } - - /** - * Gets a list of external Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external Security Solutions for the subscription and location along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync(String ascLocation) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByHomeRegion(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of external Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external Security Solutions for the subscription and location along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync(String ascLocation, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByHomeRegion(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), ascLocation, - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets a list of external Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external Security Solutions for the subscription and location as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation) { - return new PagedFlux<>(() -> listByHomeRegionSinglePageAsync(ascLocation), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of external Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external Security Solutions for the subscription and location as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation, Context context) { - return new PagedFlux<>(() -> listByHomeRegionSinglePageAsync(ascLocation, context), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of external Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external Security Solutions for the subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation) { - return new PagedIterable<>(listByHomeRegionAsync(ascLocation)); - } - - /** - * Gets a list of external Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external Security Solutions for the subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation, Context context) { - return new PagedIterable<>(listByHomeRegionAsync(ascLocation, context)); - } - - /** - * Gets a list of external security solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external security solutions for the subscription 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of external security solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external security solutions for the subscription 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-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)); - } - - /** - * Gets a list of external security solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external security solutions for the subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of external security solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external security solutions for the subscription 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 a list of external security solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external security solutions for the subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets a list of external security solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external security solutions for the subscription 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 a list of external Security Solutions for the subscription and location along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external Security Solutions for the subscription and location along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @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 external security solutions for the subscription 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 a list of external security solutions for the subscription 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExternalSecuritySolutionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExternalSecuritySolutionsImpl.java deleted file mode 100644 index 83bff50f0ae0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExternalSecuritySolutionsImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.ExternalSecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner; -import com.azure.resourcemanager.security.models.ExternalSecuritySolution; -import com.azure.resourcemanager.security.models.ExternalSecuritySolutions; - -public final class ExternalSecuritySolutionsImpl implements ExternalSecuritySolutions { - private static final ClientLogger LOGGER = new ClientLogger(ExternalSecuritySolutionsImpl.class); - - private final ExternalSecuritySolutionsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ExternalSecuritySolutionsImpl(ExternalSecuritySolutionsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String ascLocation, - String externalSecuritySolutionsName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, ascLocation, externalSecuritySolutionsName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ExternalSecuritySolutionImpl(inner.getValue(), this.manager())); - } - - public ExternalSecuritySolution get(String resourceGroupName, String ascLocation, - String externalSecuritySolutionsName) { - ExternalSecuritySolutionInner inner - = this.serviceClient().get(resourceGroupName, ascLocation, externalSecuritySolutionsName); - if (inner != null) { - return new ExternalSecuritySolutionImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listByHomeRegion(String ascLocation) { - PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ExternalSecuritySolutionImpl(inner1, this.manager())); - } - - public PagedIterable listByHomeRegion(String ascLocation, Context context) { - PagedIterable inner - = this.serviceClient().listByHomeRegion(ascLocation, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ExternalSecuritySolutionImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ExternalSecuritySolutionImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ExternalSecuritySolutionImpl(inner1, this.manager())); - } - - private ExternalSecuritySolutionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsListResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsListResponseImpl.java deleted file mode 100644 index 70d5872b67c5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsListResponseImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner; -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; -import com.azure.resourcemanager.security.models.GetSensitivitySettingsListResponse; -import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponse; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class GetSensitivitySettingsListResponseImpl implements GetSensitivitySettingsListResponse { - private GetSensitivitySettingsListResponseInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - GetSensitivitySettingsListResponseImpl(GetSensitivitySettingsListResponseInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new GetSensitivitySettingsResponseImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public GetSensitivitySettingsListResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsResponseImpl.java deleted file mode 100644 index 349bf2c2d34c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsResponseImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; -import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponse; -import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponseProperties; - -public final class GetSensitivitySettingsResponseImpl implements GetSensitivitySettingsResponse { - private GetSensitivitySettingsResponseInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - GetSensitivitySettingsResponseImpl(GetSensitivitySettingsResponseInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 GetSensitivitySettingsResponseProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public GetSensitivitySettingsResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubIssuesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubIssuesClientImpl.java deleted file mode 100644 index 019707257b0b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubIssuesClientImpl.java +++ /dev/null @@ -1,384 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.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.security.fluent.GitHubIssuesClient; -import com.azure.resourcemanager.security.models.IssueCreationRequest; -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 GitHubIssuesClient. - */ -public final class GitHubIssuesClientImpl implements GitHubIssuesClient { - /** - * The proxy service used to perform REST calls. - */ - private final GitHubIssuesService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of GitHubIssuesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GitHubIssuesClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(GitHubIssuesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterGitHubIssues to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterGitHubIssues") - public interface GitHubIssuesService { - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitHubOwners/{ownerName}/repos/{repoName}/issues") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("ownerName") String ownerName, - @PathParam("repoName") String repoName, - @BodyParam("application/json") IssueCreationRequest createIssueRequest, Context context); - } - - /** - * Creates a GitHub issue for the specified repository and assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName parameter. - * @param createIssueRequest The request model containing details for creating the GitHub issue. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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>> createWithResponseAsync(String resourceGroupName, - String securityConnectorName, String ownerName, String repoName, IssueCreationRequest createIssueRequest) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ownerName == null) { - return Mono.error(new IllegalArgumentException("Parameter ownerName is required and cannot be null.")); - } - if (repoName == null) { - return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); - } - if (createIssueRequest != null) { - createIssueRequest.validate(); - } - final String apiVersion = "2025-11-01-preview"; - return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, ownerName, repoName, createIssueRequest, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a GitHub issue for the specified repository and assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName parameter. - * @param createIssueRequest The request model containing details for creating the GitHub issue. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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>> createWithResponseAsync(String resourceGroupName, - String securityConnectorName, String ownerName, String repoName, IssueCreationRequest createIssueRequest, - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ownerName == null) { - return Mono.error(new IllegalArgumentException("Parameter ownerName is required and cannot be null.")); - } - if (repoName == null) { - return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); - } - if (createIssueRequest != null) { - createIssueRequest.validate(); - } - final String apiVersion = "2025-11-01-preview"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, ownerName, repoName, createIssueRequest, context); - } - - /** - * Creates a GitHub issue for the specified repository and assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName parameter. - * @param createIssueRequest The request model containing details for creating the GitHub issue. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginCreateAsync(String resourceGroupName, String securityConnectorName, - String ownerName, String repoName, IssueCreationRequest createIssueRequest) { - Mono>> mono = createWithResponseAsync(resourceGroupName, securityConnectorName, - ownerName, repoName, createIssueRequest); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Creates a GitHub issue for the specified repository and assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName 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> beginCreateAsync(String resourceGroupName, String securityConnectorName, - String ownerName, String repoName) { - final IssueCreationRequest createIssueRequest = null; - Mono>> mono = createWithResponseAsync(resourceGroupName, securityConnectorName, - ownerName, repoName, createIssueRequest); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Creates a GitHub issue for the specified repository and assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName parameter. - * @param createIssueRequest The request model containing details for creating the GitHub issue. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginCreateAsync(String resourceGroupName, String securityConnectorName, - String ownerName, String repoName, IssueCreationRequest createIssueRequest, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createWithResponseAsync(resourceGroupName, securityConnectorName, - ownerName, repoName, createIssueRequest, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Creates a GitHub issue for the specified repository and assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName 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 SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginCreate(String resourceGroupName, String securityConnectorName, - String ownerName, String repoName) { - final IssueCreationRequest createIssueRequest = null; - return this.beginCreateAsync(resourceGroupName, securityConnectorName, ownerName, repoName, createIssueRequest) - .getSyncPoller(); - } - - /** - * Creates a GitHub issue for the specified repository and assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName parameter. - * @param createIssueRequest The request model containing details for creating the GitHub issue. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginCreate(String resourceGroupName, String securityConnectorName, - String ownerName, String repoName, IssueCreationRequest createIssueRequest, Context context) { - return this - .beginCreateAsync(resourceGroupName, securityConnectorName, ownerName, repoName, createIssueRequest, - context) - .getSyncPoller(); - } - - /** - * Creates a GitHub issue for the specified repository and assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName parameter. - * @param createIssueRequest The request model containing details for creating the GitHub issue. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 createAsync(String resourceGroupName, String securityConnectorName, String ownerName, - String repoName, IssueCreationRequest createIssueRequest) { - return beginCreateAsync(resourceGroupName, securityConnectorName, ownerName, repoName, createIssueRequest) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a GitHub issue for the specified repository and assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName 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 createAsync(String resourceGroupName, String securityConnectorName, String ownerName, - String repoName) { - final IssueCreationRequest createIssueRequest = null; - return beginCreateAsync(resourceGroupName, securityConnectorName, ownerName, repoName, createIssueRequest) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a GitHub issue for the specified repository and assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName parameter. - * @param createIssueRequest The request model containing details for creating the GitHub issue. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 createAsync(String resourceGroupName, String securityConnectorName, String ownerName, - String repoName, IssueCreationRequest createIssueRequest, Context context) { - return beginCreateAsync(resourceGroupName, securityConnectorName, ownerName, repoName, createIssueRequest, - context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Creates a GitHub issue for the specified repository and assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void create(String resourceGroupName, String securityConnectorName, String ownerName, String repoName) { - final IssueCreationRequest createIssueRequest = null; - createAsync(resourceGroupName, securityConnectorName, ownerName, repoName, createIssueRequest).block(); - } - - /** - * Creates a GitHub issue for the specified repository and assessment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName parameter. - * @param createIssueRequest The request model containing details for creating the GitHub issue. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 create(String resourceGroupName, String securityConnectorName, String ownerName, String repoName, - IssueCreationRequest createIssueRequest, Context context) { - createAsync(resourceGroupName, securityConnectorName, ownerName, repoName, createIssueRequest, context).block(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubIssuesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubIssuesImpl.java deleted file mode 100644 index 75e455faad37..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubIssuesImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.GitHubIssuesClient; -import com.azure.resourcemanager.security.models.GitHubIssues; -import com.azure.resourcemanager.security.models.IssueCreationRequest; - -public final class GitHubIssuesImpl implements GitHubIssues { - private static final ClientLogger LOGGER = new ClientLogger(GitHubIssuesImpl.class); - - private final GitHubIssuesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public GitHubIssuesImpl(GitHubIssuesClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public void create(String resourceGroupName, String securityConnectorName, String ownerName, String repoName) { - this.serviceClient().create(resourceGroupName, securityConnectorName, ownerName, repoName); - } - - public void create(String resourceGroupName, String securityConnectorName, String ownerName, String repoName, - IssueCreationRequest createIssueRequest, Context context) { - this.serviceClient() - .create(resourceGroupName, securityConnectorName, ownerName, repoName, createIssueRequest, context); - } - - private GitHubIssuesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerImpl.java deleted file mode 100644 index e0fab31d0f05..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.GitHubOwnerInner; -import com.azure.resourcemanager.security.models.GitHubOwner; -import com.azure.resourcemanager.security.models.GitHubOwnerProperties; - -public final class GitHubOwnerImpl implements GitHubOwner { - private GitHubOwnerInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - GitHubOwnerImpl(GitHubOwnerInner innerObject, com.azure.resourcemanager.security.SecurityManager 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 GitHubOwnerProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public GitHubOwnerInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerListResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerListResponseImpl.java deleted file mode 100644 index 47683f605bee..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnerListResponseImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.GitHubOwnerInner; -import com.azure.resourcemanager.security.fluent.models.GitHubOwnerListResponseInner; -import com.azure.resourcemanager.security.models.GitHubOwner; -import com.azure.resourcemanager.security.models.GitHubOwnerListResponse; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class GitHubOwnerListResponseImpl implements GitHubOwnerListResponse { - private GitHubOwnerListResponseInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - GitHubOwnerListResponseImpl(GitHubOwnerListResponseInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList( - inner.stream().map(inner1 -> new GitHubOwnerImpl(inner1, this.manager())).collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public String nextLink() { - return this.innerModel().nextLink(); - } - - public GitHubOwnerListResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersClientImpl.java deleted file mode 100644 index 766ac41899c0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersClientImpl.java +++ /dev/null @@ -1,566 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.GitHubOwnersClient; -import com.azure.resourcemanager.security.fluent.models.GitHubOwnerInner; -import com.azure.resourcemanager.security.fluent.models.GitHubOwnerListResponseInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in GitHubOwnersClient. - */ -public final class GitHubOwnersClientImpl implements GitHubOwnersClient { - /** - * The proxy service used to perform REST calls. - */ - private final GitHubOwnersService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of GitHubOwnersClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GitHubOwnersClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(GitHubOwnersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterGitHubOwners to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterGitHubOwners") - public interface GitHubOwnersService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitHubOwners/{ownerName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("ownerName") String ownerName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitHubOwners") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/listAvailableGitHubOwners") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAvailable(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Returns a monitored GitHub owner. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName 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 gitHub Owner resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String ownerName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ownerName == null) { - return Mono.error(new IllegalArgumentException("Parameter ownerName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, ownerName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a monitored GitHub owner. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName 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 gitHub Owner resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String ownerName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ownerName == null) { - return Mono.error(new IllegalArgumentException("Parameter ownerName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, ownerName, accept, context); - } - - /** - * Returns a monitored GitHub owner. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName 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 gitHub Owner resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName, String ownerName) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, ownerName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a monitored GitHub owner. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName 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 gitHub Owner resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String ownerName, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, ownerName, context).block(); - } - - /** - * Returns a monitored GitHub owner. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName 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 gitHub Owner resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GitHubOwnerInner get(String resourceGroupName, String securityConnectorName, String ownerName) { - return getWithResponse(resourceGroupName, securityConnectorName, ownerName, Context.NONE).getValue(); - } - - /** - * Returns a list of GitHub owners onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, 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 a list of GitHub owners onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Returns a list of GitHub owners onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of GitHub owners onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of GitHub owners onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName)); - } - - /** - * Returns a list of GitHub owners onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, context)); - } - - /** - * Returns a list of all GitHub owners accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAvailableWithResponseAsync(String resourceGroupName, - String securityConnectorName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAvailable(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of all GitHub owners accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAvailableWithResponseAsync(String resourceGroupName, - String securityConnectorName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listAvailable(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, accept, context); - } - - /** - * Returns a list of all GitHub owners accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAvailableAsync(String resourceGroupName, - String securityConnectorName) { - return listAvailableWithResponseAsync(resourceGroupName, securityConnectorName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a list of all GitHub owners accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAvailableWithResponse(String resourceGroupName, - String securityConnectorName, Context context) { - return listAvailableWithResponseAsync(resourceGroupName, securityConnectorName, context).block(); - } - - /** - * Returns a list of all GitHub owners accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GitHubOwnerListResponseInner listAvailable(String resourceGroupName, String securityConnectorName) { - return listAvailableWithResponse(resourceGroupName, securityConnectorName, Context.NONE).getValue(); - } - - /** - * Returns a list of GitHub owners onboarded to the connector. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination 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())); - } - - /** - * Returns a list of GitHub owners onboarded to the connector. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersImpl.java deleted file mode 100644 index a38e6dfeee81..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubOwnersImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.GitHubOwnersClient; -import com.azure.resourcemanager.security.fluent.models.GitHubOwnerInner; -import com.azure.resourcemanager.security.fluent.models.GitHubOwnerListResponseInner; -import com.azure.resourcemanager.security.models.GitHubOwner; -import com.azure.resourcemanager.security.models.GitHubOwnerListResponse; -import com.azure.resourcemanager.security.models.GitHubOwners; - -public final class GitHubOwnersImpl implements GitHubOwners { - private static final ClientLogger LOGGER = new ClientLogger(GitHubOwnersImpl.class); - - private final GitHubOwnersClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public GitHubOwnersImpl(GitHubOwnersClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String ownerName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, ownerName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GitHubOwnerImpl(inner.getValue(), this.manager())); - } - - public GitHubOwner get(String resourceGroupName, String securityConnectorName, String ownerName) { - GitHubOwnerInner inner = this.serviceClient().get(resourceGroupName, securityConnectorName, ownerName); - if (inner != null) { - return new GitHubOwnerImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, securityConnectorName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GitHubOwnerImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GitHubOwnerImpl(inner1, this.manager())); - } - - public Response listAvailableWithResponse(String resourceGroupName, - String securityConnectorName, Context context) { - Response inner - = this.serviceClient().listAvailableWithResponse(resourceGroupName, securityConnectorName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GitHubOwnerListResponseImpl(inner.getValue(), this.manager())); - } - - public GitHubOwnerListResponse listAvailable(String resourceGroupName, String securityConnectorName) { - GitHubOwnerListResponseInner inner - = this.serviceClient().listAvailable(resourceGroupName, securityConnectorName); - if (inner != null) { - return new GitHubOwnerListResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private GitHubOwnersClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposClientImpl.java deleted file mode 100644 index f2f65589cc5a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposClientImpl.java +++ /dev/null @@ -1,457 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.GitHubReposClient; -import com.azure.resourcemanager.security.fluent.models.GitHubRepositoryInner; -import com.azure.resourcemanager.security.implementation.models.GitHubRepositoryListResponse; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in GitHubReposClient. - */ -public final class GitHubReposClientImpl implements GitHubReposClient { - /** - * The proxy service used to perform REST calls. - */ - private final GitHubReposService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of GitHubReposClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GitHubReposClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(GitHubReposService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterGitHubRepos to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterGitHubRepos") - public interface GitHubReposService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitHubOwners/{ownerName}/repos/{repoName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("ownerName") String ownerName, - @PathParam("repoName") String repoName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitHubOwners/{ownerName}/repos") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @PathParam("ownerName") String ownerName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Returns a monitored GitHub repository. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName 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 gitHub Repository resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String ownerName, String repoName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ownerName == null) { - return Mono.error(new IllegalArgumentException("Parameter ownerName is required and cannot be null.")); - } - if (repoName == null) { - return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, ownerName, repoName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a monitored GitHub repository. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName 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 gitHub Repository resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String ownerName, String repoName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ownerName == null) { - return Mono.error(new IllegalArgumentException("Parameter ownerName is required and cannot be null.")); - } - if (repoName == null) { - return Mono.error(new IllegalArgumentException("Parameter repoName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, ownerName, repoName, accept, context); - } - - /** - * Returns a monitored GitHub repository. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName 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 gitHub Repository resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName, - String ownerName, String repoName) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, ownerName, repoName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a monitored GitHub repository. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName 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 gitHub Repository resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String ownerName, String repoName, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, ownerName, repoName, context).block(); - } - - /** - * Returns a monitored GitHub repository. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName parameter. - * @param repoName The repoName 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 gitHub Repository resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GitHubRepositoryInner get(String resourceGroupName, String securityConnectorName, String ownerName, - String repoName) { - return getWithResponse(resourceGroupName, securityConnectorName, ownerName, repoName, Context.NONE).getValue(); - } - - /** - * Returns a list of GitHub repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName 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 list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, String ownerName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ownerName == null) { - return Mono.error(new IllegalArgumentException("Parameter ownerName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, ownerName, 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 a list of GitHub repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName 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 list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, String ownerName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (ownerName == null) { - return Mono.error(new IllegalArgumentException("Parameter ownerName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, ownerName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Returns a list of GitHub repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName 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 list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - String ownerName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, ownerName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of GitHub repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName 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 list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - String ownerName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, ownerName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of GitHub repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String ownerName) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, ownerName)); - } - - /** - * Returns a list of GitHub repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param ownerName The ownerName 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String ownerName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, ownerName, context)); - } - - /** - * Returns a list of GitHub repositories onboarded to the connector. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination 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())); - } - - /** - * Returns a list of GitHub repositories onboarded to the connector. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposImpl.java deleted file mode 100644 index d8ea616d8d99..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubReposImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.GitHubReposClient; -import com.azure.resourcemanager.security.fluent.models.GitHubRepositoryInner; -import com.azure.resourcemanager.security.models.GitHubRepos; -import com.azure.resourcemanager.security.models.GitHubRepository; - -public final class GitHubReposImpl implements GitHubRepos { - private static final ClientLogger LOGGER = new ClientLogger(GitHubReposImpl.class); - - private final GitHubReposClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public GitHubReposImpl(GitHubReposClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String ownerName, String repoName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, securityConnectorName, ownerName, repoName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GitHubRepositoryImpl(inner.getValue(), this.manager())); - } - - public GitHubRepository get(String resourceGroupName, String securityConnectorName, String ownerName, - String repoName) { - GitHubRepositoryInner inner - = this.serviceClient().get(resourceGroupName, securityConnectorName, ownerName, repoName); - if (inner != null) { - return new GitHubRepositoryImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String ownerName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, ownerName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GitHubRepositoryImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String ownerName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, ownerName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GitHubRepositoryImpl(inner1, this.manager())); - } - - private GitHubReposClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubRepositoryImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubRepositoryImpl.java deleted file mode 100644 index 6944d1b9aafb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitHubRepositoryImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.GitHubRepositoryInner; -import com.azure.resourcemanager.security.models.GitHubRepository; -import com.azure.resourcemanager.security.models.GitHubRepositoryProperties; - -public final class GitHubRepositoryImpl implements GitHubRepository { - private GitHubRepositoryInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - GitHubRepositoryImpl(GitHubRepositoryInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 GitHubRepositoryProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public GitHubRepositoryInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupImpl.java deleted file mode 100644 index 7209e107c997..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupInner; -import com.azure.resourcemanager.security.models.GitLabGroup; -import com.azure.resourcemanager.security.models.GitLabGroupProperties; - -public final class GitLabGroupImpl implements GitLabGroup { - private GitLabGroupInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - GitLabGroupImpl(GitLabGroupInner innerObject, com.azure.resourcemanager.security.SecurityManager 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 GitLabGroupProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public GitLabGroupInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupListResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupListResponseImpl.java deleted file mode 100644 index 7f47a50f2527..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupListResponseImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.GitLabGroupInner; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner; -import com.azure.resourcemanager.security.models.GitLabGroup; -import com.azure.resourcemanager.security.models.GitLabGroupListResponse; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class GitLabGroupListResponseImpl implements GitLabGroupListResponse { - private GitLabGroupListResponseInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - GitLabGroupListResponseImpl(GitLabGroupListResponseInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList( - inner.stream().map(inner1 -> new GitLabGroupImpl(inner1, this.manager())).collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public String nextLink() { - return this.innerModel().nextLink(); - } - - public GitLabGroupListResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsClientImpl.java deleted file mode 100644 index e936ff7e2489..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsClientImpl.java +++ /dev/null @@ -1,567 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.GitLabGroupsClient; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupInner; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in GitLabGroupsClient. - */ -public final class GitLabGroupsClientImpl implements GitLabGroupsClient { - /** - * The proxy service used to perform REST calls. - */ - private final GitLabGroupsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of GitLabGroupsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GitLabGroupsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(GitLabGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterGitLabGroups to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterGitLabGroups") - public interface GitLabGroupsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitLabGroups/{groupFQName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("groupFQName") String groupFQName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitLabGroups") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/listAvailableGitLabGroups") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAvailable(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Returns a monitored GitLab Group resource for a given fully-qualified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 gitLab Group resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String groupFQName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (groupFQName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, groupFQName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a monitored GitLab Group resource for a given fully-qualified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 gitLab Group resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String groupFQName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (groupFQName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, groupFQName, accept, context); - } - - /** - * Returns a monitored GitLab Group resource for a given fully-qualified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 gitLab Group resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName, - String groupFQName) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, groupFQName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a monitored GitLab Group resource for a given fully-qualified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 gitLab Group resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String groupFQName, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, groupFQName, context).block(); - } - - /** - * Returns a monitored GitLab Group resource for a given fully-qualified name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 gitLab Group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GitLabGroupInner get(String resourceGroupName, String securityConnectorName, String groupFQName) { - return getWithResponse(resourceGroupName, securityConnectorName, groupFQName, Context.NONE).getValue(); - } - - /** - * Returns a list of GitLab groups onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, 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 a list of GitLab groups onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Returns a list of GitLab groups onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Returns a list of GitLab groups onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Returns a list of GitLab groups onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName)); - } - - /** - * Returns a list of GitLab groups onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, context)); - } - - /** - * Returns a list of all GitLab groups accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAvailableWithResponseAsync(String resourceGroupName, - String securityConnectorName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAvailable(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a list of all GitLab groups accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAvailableWithResponseAsync(String resourceGroupName, - String securityConnectorName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listAvailable(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, accept, context); - } - - /** - * Returns a list of all GitLab groups accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAvailableAsync(String resourceGroupName, - String securityConnectorName) { - return listAvailableWithResponseAsync(resourceGroupName, securityConnectorName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a list of all GitLab groups accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listAvailableWithResponse(String resourceGroupName, - String securityConnectorName, Context context) { - return listAvailableWithResponseAsync(resourceGroupName, securityConnectorName, context).block(); - } - - /** - * Returns a list of all GitLab groups accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GitLabGroupListResponseInner listAvailable(String resourceGroupName, String securityConnectorName) { - return listAvailableWithResponse(resourceGroupName, securityConnectorName, Context.NONE).getValue(); - } - - /** - * Returns a list of GitLab groups onboarded to the connector. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination 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())); - } - - /** - * Returns a list of GitLab groups onboarded to the connector. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsImpl.java deleted file mode 100644 index a20f25209be8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabGroupsImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.GitLabGroupsClient; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupInner; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner; -import com.azure.resourcemanager.security.models.GitLabGroup; -import com.azure.resourcemanager.security.models.GitLabGroupListResponse; -import com.azure.resourcemanager.security.models.GitLabGroups; - -public final class GitLabGroupsImpl implements GitLabGroups { - private static final ClientLogger LOGGER = new ClientLogger(GitLabGroupsImpl.class); - - private final GitLabGroupsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public GitLabGroupsImpl(GitLabGroupsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String groupFQName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, groupFQName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GitLabGroupImpl(inner.getValue(), this.manager())); - } - - public GitLabGroup get(String resourceGroupName, String securityConnectorName, String groupFQName) { - GitLabGroupInner inner = this.serviceClient().get(resourceGroupName, securityConnectorName, groupFQName); - if (inner != null) { - return new GitLabGroupImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, securityConnectorName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GitLabGroupImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GitLabGroupImpl(inner1, this.manager())); - } - - public Response listAvailableWithResponse(String resourceGroupName, - String securityConnectorName, Context context) { - Response inner - = this.serviceClient().listAvailableWithResponse(resourceGroupName, securityConnectorName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GitLabGroupListResponseImpl(inner.getValue(), this.manager())); - } - - public GitLabGroupListResponse listAvailable(String resourceGroupName, String securityConnectorName) { - GitLabGroupListResponseInner inner - = this.serviceClient().listAvailable(resourceGroupName, securityConnectorName); - if (inner != null) { - return new GitLabGroupListResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private GitLabGroupsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectImpl.java deleted file mode 100644 index a6e6bbd566d4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.GitLabProjectInner; -import com.azure.resourcemanager.security.models.GitLabProject; -import com.azure.resourcemanager.security.models.GitLabProjectProperties; - -public final class GitLabProjectImpl implements GitLabProject { - private GitLabProjectInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - GitLabProjectImpl(GitLabProjectInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 GitLabProjectProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public GitLabProjectInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsClientImpl.java deleted file mode 100644 index 4003f983e28c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsClientImpl.java +++ /dev/null @@ -1,465 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.GitLabProjectsClient; -import com.azure.resourcemanager.security.fluent.models.GitLabProjectInner; -import com.azure.resourcemanager.security.implementation.models.GitLabProjectListResponse; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in GitLabProjectsClient. - */ -public final class GitLabProjectsClientImpl implements GitLabProjectsClient { - /** - * The proxy service used to perform REST calls. - */ - private final GitLabProjectsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of GitLabProjectsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GitLabProjectsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(GitLabProjectsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterGitLabProjects to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterGitLabProjects") - public interface GitLabProjectsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitLabGroups/{groupFQName}/projects/{projectName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("groupFQName") String groupFQName, @PathParam("projectName") String projectName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitLabGroups/{groupFQName}/projects") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("groupFQName") String groupFQName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName parameter. - * @param projectName The projectName 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 gitLab Project resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String groupFQName, String projectName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (groupFQName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, groupFQName, projectName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName parameter. - * @param projectName The projectName 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 gitLab Project resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String groupFQName, String projectName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (groupFQName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, groupFQName, projectName, accept, context); - } - - /** - * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName parameter. - * @param projectName The projectName 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 gitLab Project resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName, - String groupFQName, String projectName) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, groupFQName, projectName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName parameter. - * @param projectName The projectName 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 gitLab Project resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String groupFQName, String projectName, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, groupFQName, projectName, context) - .block(); - } - - /** - * Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName parameter. - * @param projectName The projectName 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 gitLab Project resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GitLabProjectInner get(String resourceGroupName, String securityConnectorName, String groupFQName, - String projectName) { - return getWithResponse(resourceGroupName, securityConnectorName, groupFQName, projectName, Context.NONE) - .getValue(); - } - - /** - * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 list of GitLab projects that are directly owned by given group and onboarded to the connector along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, String groupFQName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (groupFQName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, groupFQName, 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 GitLab projects that are directly owned by given group and onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 a list of GitLab projects that are directly owned by given group and onboarded to the connector along - * with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, String groupFQName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (groupFQName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, groupFQName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 list of GitLab projects that are directly owned by given group and onboarded to the connector as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - String groupFQName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, groupFQName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 a list of GitLab projects that are directly owned by given group and onboarded to the connector as - * paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - String groupFQName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, securityConnectorName, groupFQName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 list of GitLab projects that are directly owned by given group and onboarded to the connector as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String groupFQName) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, groupFQName)); - } - - /** - * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 a list of GitLab projects that are directly owned by given group and onboarded to the connector as - * paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String groupFQName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, groupFQName, context)); - } - - /** - * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. - * - * 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 GitLab projects that are directly owned by given group and onboarded to the connector 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())); - } - - /** - * Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. - * - * 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 GitLab projects that are directly owned by given group and onboarded to the connector 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsImpl.java deleted file mode 100644 index bdf74b2bd4a8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabProjectsImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.GitLabProjectsClient; -import com.azure.resourcemanager.security.fluent.models.GitLabProjectInner; -import com.azure.resourcemanager.security.models.GitLabProject; -import com.azure.resourcemanager.security.models.GitLabProjects; - -public final class GitLabProjectsImpl implements GitLabProjects { - private static final ClientLogger LOGGER = new ClientLogger(GitLabProjectsImpl.class); - - private final GitLabProjectsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public GitLabProjectsImpl(GitLabProjectsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String groupFQName, String projectName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, securityConnectorName, groupFQName, projectName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GitLabProjectImpl(inner.getValue(), this.manager())); - } - - public GitLabProject get(String resourceGroupName, String securityConnectorName, String groupFQName, - String projectName) { - GitLabProjectInner inner - = this.serviceClient().get(resourceGroupName, securityConnectorName, groupFQName, projectName); - if (inner != null) { - return new GitLabProjectImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, - String groupFQName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, groupFQName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GitLabProjectImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, String groupFQName, - Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, groupFQName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GitLabProjectImpl(inner1, this.manager())); - } - - private GitLabProjectsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsClientImpl.java deleted file mode 100644 index aa9fd3449e06..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsClientImpl.java +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.GitLabSubgroupsClient; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in GitLabSubgroupsClient. - */ -public final class GitLabSubgroupsClientImpl implements GitLabSubgroupsClient { - /** - * The proxy service used to perform REST calls. - */ - private final GitLabSubgroupsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of GitLabSubgroupsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GitLabSubgroupsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(GitLabSubgroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterGitLabSubgroups to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterGitLabSubgroups") - public interface GitLabSubgroupsService { - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitLabGroups/{groupFQName}/listSubgroups") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("groupFQName") String groupFQName, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets nested subgroups of given GitLab Group which are onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 nested subgroups of given GitLab Group which are onboarded to the connector along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String resourceGroupName, - String securityConnectorName, String groupFQName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (groupFQName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, groupFQName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets nested subgroups of given GitLab Group which are onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 nested subgroups of given GitLab Group which are onboarded to the connector along with {@link Response} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String resourceGroupName, - String securityConnectorName, String groupFQName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (groupFQName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupFQName is required and cannot be null.")); - } - final String apiVersion = "2025-11-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, groupFQName, accept, context); - } - - /** - * Gets nested subgroups of given GitLab Group which are onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 nested subgroups of given GitLab Group which are onboarded to the connector on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String resourceGroupName, String securityConnectorName, - String groupFQName) { - return listWithResponseAsync(resourceGroupName, securityConnectorName, groupFQName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets nested subgroups of given GitLab Group which are onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 nested subgroups of given GitLab Group which are onboarded to the connector along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String resourceGroupName, - String securityConnectorName, String groupFQName, Context context) { - return listWithResponseAsync(resourceGroupName, securityConnectorName, groupFQName, context).block(); - } - - /** - * Gets nested subgroups of given GitLab Group which are onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param groupFQName The groupFQName 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 nested subgroups of given GitLab Group which are onboarded to the connector. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GitLabGroupListResponseInner list(String resourceGroupName, String securityConnectorName, - String groupFQName) { - return listWithResponse(resourceGroupName, securityConnectorName, groupFQName, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsImpl.java deleted file mode 100644 index c10d111ed591..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GitLabSubgroupsImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.GitLabSubgroupsClient; -import com.azure.resourcemanager.security.fluent.models.GitLabGroupListResponseInner; -import com.azure.resourcemanager.security.models.GitLabGroupListResponse; -import com.azure.resourcemanager.security.models.GitLabSubgroups; - -public final class GitLabSubgroupsImpl implements GitLabSubgroups { - private static final ClientLogger LOGGER = new ClientLogger(GitLabSubgroupsImpl.class); - - private final GitLabSubgroupsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public GitLabSubgroupsImpl(GitLabSubgroupsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response listWithResponse(String resourceGroupName, String securityConnectorName, - String groupFQName, Context context) { - Response inner - = this.serviceClient().listWithResponse(resourceGroupName, securityConnectorName, groupFQName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GitLabGroupListResponseImpl(inner.getValue(), this.manager())); - } - - public GitLabGroupListResponse list(String resourceGroupName, String securityConnectorName, String groupFQName) { - GitLabGroupListResponseInner inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, groupFQName); - if (inner != null) { - return new GitLabGroupListResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private GitLabSubgroupsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentImpl.java deleted file mode 100644 index a44e7c1575d6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentImpl.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GovernanceAssignmentInner; -import com.azure.resourcemanager.security.models.GovernanceAssignment; -import com.azure.resourcemanager.security.models.GovernanceAssignmentAdditionalData; -import com.azure.resourcemanager.security.models.GovernanceEmailNotification; -import com.azure.resourcemanager.security.models.RemediationEta; -import java.time.OffsetDateTime; - -public final class GovernanceAssignmentImpl - implements GovernanceAssignment, GovernanceAssignment.Definition, GovernanceAssignment.Update { - private GovernanceAssignmentInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager 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 String owner() { - return this.innerModel().owner(); - } - - public OffsetDateTime remediationDueDate() { - return this.innerModel().remediationDueDate(); - } - - public RemediationEta remediationEta() { - return this.innerModel().remediationEta(); - } - - public Boolean isGracePeriod() { - return this.innerModel().isGracePeriod(); - } - - public GovernanceEmailNotification governanceEmailNotification() { - return this.innerModel().governanceEmailNotification(); - } - - public GovernanceAssignmentAdditionalData additionalData() { - return this.innerModel().additionalData(); - } - - public GovernanceAssignmentInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String scope; - - private String assessmentName; - - private String assignmentKey; - - public GovernanceAssignmentImpl withExistingAssessment(String scope, String assessmentName) { - this.scope = scope; - this.assessmentName = assessmentName; - return this; - } - - public GovernanceAssignment create() { - this.innerObject = serviceManager.serviceClient() - .getGovernanceAssignments() - .createOrUpdateWithResponse(scope, assessmentName, assignmentKey, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public GovernanceAssignment create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getGovernanceAssignments() - .createOrUpdateWithResponse(scope, assessmentName, assignmentKey, this.innerModel(), context) - .getValue(); - return this; - } - - GovernanceAssignmentImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new GovernanceAssignmentInner(); - this.serviceManager = serviceManager; - this.assignmentKey = name; - } - - public GovernanceAssignmentImpl update() { - return this; - } - - public GovernanceAssignment apply() { - this.innerObject = serviceManager.serviceClient() - .getGovernanceAssignments() - .createOrUpdateWithResponse(scope, assessmentName, assignmentKey, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public GovernanceAssignment apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getGovernanceAssignments() - .createOrUpdateWithResponse(scope, assessmentName, assignmentKey, this.innerModel(), context) - .getValue(); - return this; - } - - GovernanceAssignmentImpl(GovernanceAssignmentInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.scope = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "scope"); - this.assessmentName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assessmentName"); - this.assignmentKey = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assignmentKey"); - } - - public GovernanceAssignment refresh() { - this.innerObject = serviceManager.serviceClient() - .getGovernanceAssignments() - .getWithResponse(scope, assessmentName, assignmentKey, Context.NONE) - .getValue(); - return this; - } - - public GovernanceAssignment refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getGovernanceAssignments() - .getWithResponse(scope, assessmentName, assignmentKey, context) - .getValue(); - return this; - } - - public GovernanceAssignmentImpl withOwner(String owner) { - this.innerModel().withOwner(owner); - return this; - } - - public GovernanceAssignmentImpl withRemediationDueDate(OffsetDateTime remediationDueDate) { - this.innerModel().withRemediationDueDate(remediationDueDate); - return this; - } - - public GovernanceAssignmentImpl withRemediationEta(RemediationEta remediationEta) { - this.innerModel().withRemediationEta(remediationEta); - return this; - } - - public GovernanceAssignmentImpl withIsGracePeriod(Boolean isGracePeriod) { - this.innerModel().withIsGracePeriod(isGracePeriod); - return this; - } - - public GovernanceAssignmentImpl - withGovernanceEmailNotification(GovernanceEmailNotification governanceEmailNotification) { - this.innerModel().withGovernanceEmailNotification(governanceEmailNotification); - return this; - } - - public GovernanceAssignmentImpl withAdditionalData(GovernanceAssignmentAdditionalData additionalData) { - this.innerModel().withAdditionalData(additionalData); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsClientImpl.java deleted file mode 100644 index a99524c9e19d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsClientImpl.java +++ /dev/null @@ -1,683 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.resourcemanager.security.fluent.GovernanceAssignmentsClient; -import com.azure.resourcemanager.security.fluent.models.GovernanceAssignmentInner; -import com.azure.resourcemanager.security.implementation.models.GovernanceAssignmentsList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in GovernanceAssignmentsClient. - */ -public final class GovernanceAssignmentsClientImpl implements GovernanceAssignmentsClient { - /** - * The proxy service used to perform REST calls. - */ - private final GovernanceAssignmentsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of GovernanceAssignmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GovernanceAssignmentsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(GovernanceAssignmentsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterGovernanceAssignments to be used by the proxy service - * to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterGovernanceAssignments") - public interface GovernanceAssignmentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("assessmentName") String assessmentName, @PathParam("assignmentKey") String assignmentKey, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("assessmentName") String assessmentName, @PathParam("assignmentKey") String assignmentKey, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") GovernanceAssignmentInner governanceAssignment, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("assessmentName") String assessmentName, @PathParam("assignmentKey") String assignmentKey, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("assessmentName") String assessmentName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param assignmentKey The governance assignment key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 governanceAssignment for the requested scope by AssignmentKey along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String assessmentName, - String assignmentKey) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assignmentKey == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentKey is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, scope, assessmentName, - assignmentKey, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param assignmentKey The governance assignment key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 governanceAssignment for the requested scope by AssignmentKey along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String assessmentName, - String assignmentKey, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assignmentKey == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentKey is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, assessmentName, assignmentKey, accept, - context); - } - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param assignmentKey The governance assignment key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 governanceAssignment for the requested scope by AssignmentKey on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, String assessmentName, String assignmentKey) { - return getWithResponseAsync(scope, assessmentName, assignmentKey) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param assignmentKey The governance assignment key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 governanceAssignment for the requested scope by AssignmentKey along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String assessmentName, - String assignmentKey, Context context) { - return getWithResponseAsync(scope, assessmentName, assignmentKey, context).block(); - } - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param assignmentKey The governance assignment key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 governanceAssignment for the requested scope by AssignmentKey. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GovernanceAssignmentInner get(String scope, String assessmentName, String assignmentKey) { - return getWithResponse(scope, assessmentName, assignmentKey, Context.NONE).getValue(); - } - - /** - * Creates or updates a governance assignment on the given subscription. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param assignmentKey The governance assignment key. - * @param governanceAssignment Governance assignment over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignment over a given scope along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String scope, - String assessmentName, String assignmentKey, GovernanceAssignmentInner governanceAssignment) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assignmentKey == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentKey is required and cannot be null.")); - } - if (governanceAssignment == null) { - return Mono - .error(new IllegalArgumentException("Parameter governanceAssignment is required and cannot be null.")); - } else { - governanceAssignment.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, assessmentName, - assignmentKey, contentType, accept, governanceAssignment, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a governance assignment on the given subscription. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param assignmentKey The governance assignment key. - * @param governanceAssignment Governance assignment over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignment over a given scope along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String scope, - String assessmentName, String assignmentKey, GovernanceAssignmentInner governanceAssignment, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assignmentKey == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentKey is required and cannot be null.")); - } - if (governanceAssignment == null) { - return Mono - .error(new IllegalArgumentException("Parameter governanceAssignment is required and cannot be null.")); - } else { - governanceAssignment.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, assessmentName, assignmentKey, - contentType, accept, governanceAssignment, context); - } - - /** - * Creates or updates a governance assignment on the given subscription. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param assignmentKey The governance assignment key. - * @param governanceAssignment Governance assignment over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignment over a given scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String scope, String assessmentName, - String assignmentKey, GovernanceAssignmentInner governanceAssignment) { - return createOrUpdateWithResponseAsync(scope, assessmentName, assignmentKey, governanceAssignment) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates a governance assignment on the given subscription. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param assignmentKey The governance assignment key. - * @param governanceAssignment Governance assignment over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignment over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String scope, String assessmentName, - String assignmentKey, GovernanceAssignmentInner governanceAssignment, Context context) { - return createOrUpdateWithResponseAsync(scope, assessmentName, assignmentKey, governanceAssignment, context) - .block(); - } - - /** - * Creates or updates a governance assignment on the given subscription. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param assignmentKey The governance assignment key. - * @param governanceAssignment Governance assignment over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignment over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GovernanceAssignmentInner createOrUpdate(String scope, String assessmentName, String assignmentKey, - GovernanceAssignmentInner governanceAssignment) { - return createOrUpdateWithResponse(scope, assessmentName, assignmentKey, governanceAssignment, Context.NONE) - .getValue(); - } - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param assignmentKey The governance assignment key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 scope, String assessmentName, String assignmentKey) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assignmentKey == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentKey is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, scope, assessmentName, - assignmentKey, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param assignmentKey The governance assignment key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 scope, String assessmentName, String assignmentKey, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assignmentKey == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentKey is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, scope, assessmentName, assignmentKey, context); - } - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param assignmentKey The governance assignment key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 scope, String assessmentName, String assignmentKey) { - return deleteWithResponseAsync(scope, assessmentName, assignmentKey).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param assignmentKey The governance assignment key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String scope, String assessmentName, String assignmentKey, - Context context) { - return deleteWithResponseAsync(scope, assessmentName, assignmentKey, context).block(); - } - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param assignmentKey The governance assignment key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 scope, String assessmentName, String assignmentKey) { - deleteWithResponse(scope, assessmentName, assignmentKey, Context.NONE); - } - - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignments on all of your resources inside a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, String assessmentName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), apiVersion, scope, assessmentName, 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 governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignments on all of your resources inside a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, String assessmentName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scope, assessmentName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignments on all of your resources inside a scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, String assessmentName) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, assessmentName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignments on all of your resources inside a scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, String assessmentName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, assessmentName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignments on all of your resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, String assessmentName) { - return new PagedIterable<>(listAsync(scope, assessmentName)); - } - - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the governance assignment. - * @param assessmentName The assessment key of the governance assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignments on all of your resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, String assessmentName, Context context) { - return new PagedIterable<>(listAsync(scope, assessmentName, 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 governance assignments on all of your resources inside a scope 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 governance assignments on all of your resources inside a scope 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsImpl.java deleted file mode 100644 index ba0b217af9a8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsImpl.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.GovernanceAssignmentsClient; -import com.azure.resourcemanager.security.fluent.models.GovernanceAssignmentInner; -import com.azure.resourcemanager.security.models.GovernanceAssignment; -import com.azure.resourcemanager.security.models.GovernanceAssignments; - -public final class GovernanceAssignmentsImpl implements GovernanceAssignments { - private static final ClientLogger LOGGER = new ClientLogger(GovernanceAssignmentsImpl.class); - - private final GovernanceAssignmentsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public GovernanceAssignmentsImpl(GovernanceAssignmentsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String scope, String assessmentName, String assignmentKey, - Context context) { - Response inner - = this.serviceClient().getWithResponse(scope, assessmentName, assignmentKey, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GovernanceAssignmentImpl(inner.getValue(), this.manager())); - } - - public GovernanceAssignment get(String scope, String assessmentName, String assignmentKey) { - GovernanceAssignmentInner inner = this.serviceClient().get(scope, assessmentName, assignmentKey); - if (inner != null) { - return new GovernanceAssignmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String scope, String assessmentName, String assignmentKey, - Context context) { - return this.serviceClient().deleteWithResponse(scope, assessmentName, assignmentKey, context); - } - - public void delete(String scope, String assessmentName, String assignmentKey) { - this.serviceClient().delete(scope, assessmentName, assignmentKey); - } - - public PagedIterable list(String scope, String assessmentName) { - PagedIterable inner = this.serviceClient().list(scope, assessmentName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GovernanceAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, String assessmentName, Context context) { - PagedIterable inner = this.serviceClient().list(scope, assessmentName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GovernanceAssignmentImpl(inner1, this.manager())); - } - - public GovernanceAssignment getById(String id) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String assessmentName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assessmentName"); - if (assessmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); - } - String assignmentKey = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assignmentKey"); - if (assignmentKey == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'governanceAssignments'.", id))); - } - return this.getWithResponse(scope, assessmentName, assignmentKey, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String assessmentName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assessmentName"); - if (assessmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); - } - String assignmentKey = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assignmentKey"); - if (assignmentKey == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'governanceAssignments'.", id))); - } - return this.getWithResponse(scope, assessmentName, assignmentKey, context); - } - - public void deleteById(String id) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String assessmentName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assessmentName"); - if (assessmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); - } - String assignmentKey = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assignmentKey"); - if (assignmentKey == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'governanceAssignments'.", id))); - } - this.deleteWithResponse(scope, assessmentName, assignmentKey, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String assessmentName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assessmentName"); - if (assessmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); - } - String assignmentKey = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assignmentKey"); - if (assignmentKey == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'governanceAssignments'.", id))); - } - return this.deleteWithResponse(scope, assessmentName, assignmentKey, context); - } - - private GovernanceAssignmentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public GovernanceAssignmentImpl define(String name) { - return new GovernanceAssignmentImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRuleImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRuleImpl.java deleted file mode 100644 index e273fa61e222..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRuleImpl.java +++ /dev/null @@ -1,272 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams; -import com.azure.resourcemanager.security.models.GovernanceRule; -import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; -import com.azure.resourcemanager.security.models.GovernanceRuleMetadata; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.util.Collections; -import java.util.List; - -public final class GovernanceRuleImpl implements GovernanceRule, GovernanceRule.Definition, GovernanceRule.Update { - private GovernanceRuleInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager 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 String tenantId() { - return this.innerModel().tenantId(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String description() { - return this.innerModel().description(); - } - - public String remediationTimeframe() { - return this.innerModel().remediationTimeframe(); - } - - public Boolean isGracePeriod() { - return this.innerModel().isGracePeriod(); - } - - public int rulePriority() { - return this.innerModel().rulePriority(); - } - - public Boolean isDisabled() { - return this.innerModel().isDisabled(); - } - - public GovernanceRuleType ruleType() { - return this.innerModel().ruleType(); - } - - public GovernanceRuleSourceResourceType sourceResourceType() { - return this.innerModel().sourceResourceType(); - } - - public List excludedScopes() { - List inner = this.innerModel().excludedScopes(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List conditionSets() { - List inner = this.innerModel().conditionSets(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Boolean includeMemberScopes() { - return this.innerModel().includeMemberScopes(); - } - - public GovernanceRuleOwnerSource ownerSource() { - return this.innerModel().ownerSource(); - } - - public GovernanceRuleEmailNotification governanceEmailNotification() { - return this.innerModel().governanceEmailNotification(); - } - - public GovernanceRuleMetadata metadata() { - return this.innerModel().metadata(); - } - - public GovernanceRuleInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String scope; - - private String ruleId; - - public GovernanceRuleImpl withExistingScope(String scope) { - this.scope = scope; - return this; - } - - public GovernanceRule create() { - this.innerObject = serviceManager.serviceClient() - .getGovernanceRules() - .createOrUpdateWithResponse(scope, ruleId, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public GovernanceRule create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getGovernanceRules() - .createOrUpdateWithResponse(scope, ruleId, this.innerModel(), context) - .getValue(); - return this; - } - - GovernanceRuleImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new GovernanceRuleInner(); - this.serviceManager = serviceManager; - this.ruleId = name; - } - - public GovernanceRuleImpl update() { - return this; - } - - public GovernanceRule apply() { - this.innerObject = serviceManager.serviceClient() - .getGovernanceRules() - .createOrUpdateWithResponse(scope, ruleId, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public GovernanceRule apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getGovernanceRules() - .createOrUpdateWithResponse(scope, ruleId, this.innerModel(), context) - .getValue(); - return this; - } - - GovernanceRuleImpl(GovernanceRuleInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.scope = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); - this.ruleId = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); - } - - public GovernanceRule refresh() { - this.innerObject = serviceManager.serviceClient() - .getGovernanceRules() - .getWithResponse(scope, ruleId, Context.NONE) - .getValue(); - return this; - } - - public GovernanceRule refresh(Context context) { - this.innerObject - = serviceManager.serviceClient().getGovernanceRules().getWithResponse(scope, ruleId, context).getValue(); - return this; - } - - public void execute() { - serviceManager.governanceRules().execute(scope, ruleId); - } - - public void execute(ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - serviceManager.governanceRules().execute(scope, ruleId, executeGovernanceRuleParams, context); - } - - public GovernanceRuleImpl withDisplayName(String displayName) { - this.innerModel().withDisplayName(displayName); - return this; - } - - public GovernanceRuleImpl withDescription(String description) { - this.innerModel().withDescription(description); - return this; - } - - public GovernanceRuleImpl withRemediationTimeframe(String remediationTimeframe) { - this.innerModel().withRemediationTimeframe(remediationTimeframe); - return this; - } - - public GovernanceRuleImpl withIsGracePeriod(Boolean isGracePeriod) { - this.innerModel().withIsGracePeriod(isGracePeriod); - return this; - } - - public GovernanceRuleImpl withRulePriority(int rulePriority) { - this.innerModel().withRulePriority(rulePriority); - return this; - } - - public GovernanceRuleImpl withIsDisabled(Boolean isDisabled) { - this.innerModel().withIsDisabled(isDisabled); - return this; - } - - public GovernanceRuleImpl withRuleType(GovernanceRuleType ruleType) { - this.innerModel().withRuleType(ruleType); - return this; - } - - public GovernanceRuleImpl withSourceResourceType(GovernanceRuleSourceResourceType sourceResourceType) { - this.innerModel().withSourceResourceType(sourceResourceType); - return this; - } - - public GovernanceRuleImpl withExcludedScopes(List excludedScopes) { - this.innerModel().withExcludedScopes(excludedScopes); - return this; - } - - public GovernanceRuleImpl withConditionSets(List conditionSets) { - this.innerModel().withConditionSets(conditionSets); - return this; - } - - public GovernanceRuleImpl withIncludeMemberScopes(Boolean includeMemberScopes) { - this.innerModel().withIncludeMemberScopes(includeMemberScopes); - return this; - } - - public GovernanceRuleImpl withOwnerSource(GovernanceRuleOwnerSource ownerSource) { - this.innerModel().withOwnerSource(ownerSource); - return this; - } - - public GovernanceRuleImpl - withGovernanceEmailNotification(GovernanceRuleEmailNotification governanceEmailNotification) { - this.innerModel().withGovernanceEmailNotification(governanceEmailNotification); - return this; - } - - public GovernanceRuleImpl withMetadata(GovernanceRuleMetadata metadata) { - this.innerModel().withMetadata(metadata); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesClientImpl.java deleted file mode 100644 index d2062dc410de..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesClientImpl.java +++ /dev/null @@ -1,1091 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.security.fluent.GovernanceRulesClient; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.fluent.models.OperationResultInner; -import com.azure.resourcemanager.security.implementation.models.GovernanceRuleList; -import com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams; -import com.azure.resourcemanager.security.models.GovernanceRulesOperationResultsResponse; -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 GovernanceRulesClient. - */ -public final class GovernanceRulesClientImpl implements GovernanceRulesClient { - /** - * The proxy service used to perform REST calls. - */ - private final GovernanceRulesService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of GovernanceRulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GovernanceRulesClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(GovernanceRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterGovernanceRules to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterGovernanceRules") - public interface GovernanceRulesService { - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("ruleId") String ruleId, @HeaderParam("Accept") String accept, Context context); - - @Put("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("ruleId") String ruleId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") GovernanceRuleInner governanceRule, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("ruleId") String ruleId, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/governanceRules") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}/execute") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> execute(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("ruleId") String ruleId, - @BodyParam("application/json") ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono operationResults(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("ruleId") String ruleId, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 governance rule for the requested scope by ruleId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String ruleId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, scope, ruleId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 governance rule for the requested scope by ruleId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String ruleId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, ruleId, accept, context); - } - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 governance rule for the requested scope by ruleId on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, String ruleId) { - return getWithResponseAsync(scope, ruleId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 governance rule for the requested scope by ruleId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String ruleId, Context context) { - return getWithResponseAsync(scope, ruleId, context).block(); - } - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 governance rule for the requested scope by ruleId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GovernanceRuleInner get(String scope, String ruleId) { - return getWithResponse(scope, ruleId, Context.NONE).getValue(); - } - - /** - * Creates or updates a governance rule over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param governanceRule Governance rule over a given scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rule over a given scope along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String scope, String ruleId, - GovernanceRuleInner governanceRule) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (governanceRule == null) { - return Mono.error(new IllegalArgumentException("Parameter governanceRule is required and cannot be null.")); - } else { - governanceRule.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, ruleId, - contentType, accept, governanceRule, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a governance rule over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param governanceRule Governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rule over a given scope along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String scope, String ruleId, - GovernanceRuleInner governanceRule, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (governanceRule == null) { - return Mono.error(new IllegalArgumentException("Parameter governanceRule is required and cannot be null.")); - } else { - governanceRule.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, ruleId, contentType, accept, - governanceRule, context); - } - - /** - * Creates or updates a governance rule over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param governanceRule Governance rule over a given scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rule over a given scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String scope, String ruleId, - GovernanceRuleInner governanceRule) { - return createOrUpdateWithResponseAsync(scope, ruleId, governanceRule) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates a governance rule over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param governanceRule Governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rule over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String scope, String ruleId, - GovernanceRuleInner governanceRule, Context context) { - return createOrUpdateWithResponseAsync(scope, ruleId, governanceRule, context).block(); - } - - /** - * Creates or updates a governance rule over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param governanceRule Governance rule over a given scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rule over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GovernanceRuleInner createOrUpdate(String scope, String ruleId, GovernanceRuleInner governanceRule) { - return createOrUpdateWithResponse(scope, ruleId, governanceRule, Context.NONE).getValue(); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 scope, String ruleId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, scope, ruleId, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 scope, String ruleId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, scope, ruleId, context); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 scope, String ruleId) { - Mono>> mono = deleteWithResponseAsync(scope, ruleId); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 scope, String ruleId, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(scope, ruleId, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 scope, String ruleId) { - return this.beginDeleteAsync(scope, ruleId).getSyncPoller(); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 scope, String ruleId, Context context) { - return this.beginDeleteAsync(scope, ruleId, context).getSyncPoller(); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 scope, String ruleId) { - return beginDeleteAsync(scope, ruleId).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 scope, String ruleId, Context context) { - return beginDeleteAsync(scope, ruleId, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 scope, String ruleId) { - deleteAsync(scope, ruleId).block(); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 scope, String ruleId, Context context) { - deleteAsync(scope, ruleId, context).block(); - } - - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant governance rules over a scope along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, 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 a list of all relevant governance rules over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant governance rules over a scope along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant governance rules over a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant governance rules over a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant governance rules over a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(listAsync(scope)); - } - - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant governance rules over a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(listAsync(scope, context)); - } - - /** - * Execute a governance rule. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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>> executeWithResponseAsync(String scope, String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (executeGovernanceRuleParams != null) { - executeGovernanceRuleParams.validate(); - } - final String apiVersion = "2022-01-01-preview"; - return FluxUtil - .withContext(context -> service.execute(this.client.getEndpoint(), apiVersion, scope, ruleId, - executeGovernanceRuleParams, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Execute a governance rule. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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>> executeWithResponseAsync(String scope, String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (executeGovernanceRuleParams != null) { - executeGovernanceRuleParams.validate(); - } - final String apiVersion = "2022-01-01-preview"; - context = this.client.mergeContext(context); - return service.execute(this.client.getEndpoint(), apiVersion, scope, ruleId, executeGovernanceRuleParams, - context); - } - - /** - * Execute a governance rule. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginExecuteAsync(String scope, String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams) { - Mono>> mono = executeWithResponseAsync(scope, ruleId, executeGovernanceRuleParams); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Execute a governance rule. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginExecuteAsync(String scope, String ruleId) { - final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; - Mono>> mono = executeWithResponseAsync(scope, ruleId, executeGovernanceRuleParams); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Execute a governance rule. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginExecuteAsync(String scope, String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = executeWithResponseAsync(scope, ruleId, executeGovernanceRuleParams, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Execute a governance rule. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginExecute(String scope, String ruleId) { - final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; - return this.beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams).getSyncPoller(); - } - - /** - * Execute a governance rule. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> beginExecute(String scope, String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - return this.beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams, context).getSyncPoller(); - } - - /** - * Execute a governance rule. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 executeAsync(String scope, String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams) { - return beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Execute a governance rule. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 executeAsync(String scope, String ruleId) { - final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; - return beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Execute a governance rule. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 executeAsync(String scope, String ruleId, - ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - return beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Execute a governance rule. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 execute(String scope, String ruleId) { - final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; - executeAsync(scope, ruleId, executeGovernanceRuleParams).block(); - } - - /** - * Execute a governance rule. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 execute(String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, - Context context) { - executeAsync(scope, ruleId, executeGovernanceRuleParams, context).block(); - } - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the governance rule. - * @param ruleId The governance rule key. - * @param operationId The governance rule long running operation unique key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono operationResultsWithResponseAsync(String scope, String ruleId, - String operationId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId 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 = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.operationResults(this.client.getEndpoint(), apiVersion, scope, ruleId, - operationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the governance rule. - * @param ruleId The governance rule key. - * @param operationId The governance rule long running operation unique key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono operationResultsWithResponseAsync(String scope, String ruleId, - String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId 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 = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.operationResults(this.client.getEndpoint(), apiVersion, scope, ruleId, operationId, accept, - context); - } - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the governance rule. - * @param ruleId The governance rule key. - * @param operationId The governance rule long running operation unique key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono operationResultsAsync(String scope, String ruleId, String operationId) { - return operationResultsWithResponseAsync(scope, ruleId, operationId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the governance rule. - * @param ruleId The governance rule key. - * @param operationId The governance rule long running operation unique key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GovernanceRulesOperationResultsResponse operationResultsWithResponse(String scope, String ruleId, - String operationId, Context context) { - return operationResultsWithResponseAsync(scope, ruleId, operationId, context).block(); - } - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the governance rule. - * @param ruleId The governance rule key. - * @param operationId The governance rule long running operation unique key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationResultInner operationResults(String scope, String ruleId, String operationId) { - return operationResultsWithResponse(scope, ruleId, operationId, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governance rules over a scope 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 a list of all relevant governance rules over a scope 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesImpl.java deleted file mode 100644 index 531998472d11..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesImpl.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.GovernanceRulesClient; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.fluent.models.OperationResultInner; -import com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams; -import com.azure.resourcemanager.security.models.GovernanceRule; -import com.azure.resourcemanager.security.models.GovernanceRules; -import com.azure.resourcemanager.security.models.GovernanceRulesOperationResultsResponse; -import com.azure.resourcemanager.security.models.OperationResult; - -public final class GovernanceRulesImpl implements GovernanceRules { - private static final ClientLogger LOGGER = new ClientLogger(GovernanceRulesImpl.class); - - private final GovernanceRulesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public GovernanceRulesImpl(GovernanceRulesClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String scope, String ruleId, Context context) { - Response inner = this.serviceClient().getWithResponse(scope, ruleId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GovernanceRuleImpl(inner.getValue(), this.manager())); - } - - public GovernanceRule get(String scope, String ruleId) { - GovernanceRuleInner inner = this.serviceClient().get(scope, ruleId); - if (inner != null) { - return new GovernanceRuleImpl(inner, this.manager()); - } else { - return null; - } - } - - public void deleteByResourceGroup(String scope, String ruleId) { - this.serviceClient().delete(scope, ruleId); - } - - public void delete(String scope, String ruleId, Context context) { - this.serviceClient().delete(scope, ruleId, context); - } - - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GovernanceRuleImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new GovernanceRuleImpl(inner1, this.manager())); - } - - public void execute(String scope, String ruleId) { - this.serviceClient().execute(scope, ruleId); - } - - public void execute(String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, - Context context) { - this.serviceClient().execute(scope, ruleId, executeGovernanceRuleParams, context); - } - - public Response operationResultsWithResponse(String scope, String ruleId, String operationId, - Context context) { - GovernanceRulesOperationResultsResponse inner - = this.serviceClient().operationResultsWithResponse(scope, ruleId, operationId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public OperationResult operationResults(String scope, String ruleId, String operationId) { - OperationResultInner inner = this.serviceClient().operationResults(scope, ruleId, operationId); - if (inner != null) { - return new OperationResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public GovernanceRule getById(String id) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String ruleId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); - if (ruleId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'governanceRules'.", id))); - } - return this.getWithResponse(scope, ruleId, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String ruleId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); - if (ruleId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'governanceRules'.", id))); - } - return this.getWithResponse(scope, ruleId, context); - } - - public void deleteById(String id) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String ruleId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); - if (ruleId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'governanceRules'.", id))); - } - this.delete(scope, ruleId, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String ruleId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); - if (ruleId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'governanceRules'.", id))); - } - this.delete(scope, ruleId, context); - } - - private GovernanceRulesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public GovernanceRuleImpl define(String name) { - return new GovernanceRuleImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportImpl.java deleted file mode 100644 index 2c0342e85176..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportImpl.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.HealthReportInner; -import com.azure.resourcemanager.security.models.EnvironmentDetails; -import com.azure.resourcemanager.security.models.HealthDataClassification; -import com.azure.resourcemanager.security.models.HealthReport; -import com.azure.resourcemanager.security.models.HealthReportResourceDetails; -import com.azure.resourcemanager.security.models.HealthReportStatus; -import com.azure.resourcemanager.security.models.Issue; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class HealthReportImpl implements HealthReport { - private HealthReportInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - HealthReportImpl(HealthReportInner innerObject, com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public HealthReportResourceDetails resourceDetails() { - return this.innerModel().resourceDetails(); - } - - public EnvironmentDetails environmentDetails() { - return this.innerModel().environmentDetails(); - } - - public HealthDataClassification healthDataClassification() { - return this.innerModel().healthDataClassification(); - } - - public HealthReportStatus status() { - return this.innerModel().status(); - } - - public List affectedDefendersPlans() { - List inner = this.innerModel().affectedDefendersPlans(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List affectedDefendersSubPlans() { - List inner = this.innerModel().affectedDefendersSubPlans(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Map reportAdditionalData() { - Map inner = this.innerModel().reportAdditionalData(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public List issues() { - List inner = this.innerModel().issues(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public HealthReportInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsClientImpl.java deleted file mode 100644 index 7ffbce7c96e2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsClientImpl.java +++ /dev/null @@ -1,378 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.HealthReportsClient; -import com.azure.resourcemanager.security.fluent.models.HealthReportInner; -import com.azure.resourcemanager.security.implementation.models.HealthReportsList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in HealthReportsClient. - */ -public final class HealthReportsClientImpl implements HealthReportsClient { - /** - * The proxy service used to perform REST calls. - */ - private final HealthReportsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of HealthReportsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - HealthReportsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(HealthReportsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterHealthReports to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterHealthReports") - public interface HealthReportsService { - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/healthReports/{healthReportName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("healthReportName") String healthReportName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/healthReports") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get health report of resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param healthReportName The health report key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 report of resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, String healthReportName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (healthReportName == null) { - return Mono - .error(new IllegalArgumentException("Parameter healthReportName is required and cannot be null.")); - } - final String apiVersion = "2023-05-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, resourceId, healthReportName, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get health report of resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param healthReportName The health report key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 report of resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, String healthReportName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (healthReportName == null) { - return Mono - .error(new IllegalArgumentException("Parameter healthReportName is required and cannot be null.")); - } - final String apiVersion = "2023-05-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, resourceId, healthReportName, accept, context); - } - - /** - * Get health report of resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param healthReportName The health report key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 report of resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId, String healthReportName) { - return getWithResponseAsync(resourceId, healthReportName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get health report of resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param healthReportName The health report key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 report of resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceId, String healthReportName, Context context) { - return getWithResponseAsync(resourceId, healthReportName, context).block(); - } - - /** - * Get health report of resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param healthReportName The health report key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 report of resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HealthReportInner get(String resourceId, String healthReportName) { - return getWithResponse(resourceId, healthReportName, Context.NONE).getValue(); - } - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all health reports inside a scope along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2023-05-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, 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 a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all health reports inside a scope along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2023-05-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all health reports inside a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all health reports inside a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all health reports inside a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(listAsync(scope)); - } - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all health reports inside a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(listAsync(scope, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all health reports inside a scope 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 a list of all health reports inside a scope 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsImpl.java deleted file mode 100644 index 251876f4a1c6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.HealthReportsClient; -import com.azure.resourcemanager.security.fluent.models.HealthReportInner; -import com.azure.resourcemanager.security.models.HealthReport; -import com.azure.resourcemanager.security.models.HealthReports; - -public final class HealthReportsImpl implements HealthReports { - private static final ClientLogger LOGGER = new ClientLogger(HealthReportsImpl.class); - - private final HealthReportsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public HealthReportsImpl(HealthReportsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceId, String healthReportName, Context context) { - Response inner = this.serviceClient().getWithResponse(resourceId, healthReportName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new HealthReportImpl(inner.getValue(), this.manager())); - } - - public HealthReport get(String resourceId, String healthReportName) { - HealthReportInner inner = this.serviceClient().get(resourceId, healthReportName); - if (inner != null) { - return new HealthReportImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return ResourceManagerUtils.mapPage(inner, inner1 -> new HealthReportImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new HealthReportImpl(inner1, this.manager())); - } - - private HealthReportsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPoliciesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPoliciesClientImpl.java deleted file mode 100644 index a4d699fb8045..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPoliciesClientImpl.java +++ /dev/null @@ -1,526 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.resourcemanager.security.fluent.InformationProtectionPoliciesClient; -import com.azure.resourcemanager.security.fluent.models.InformationProtectionPolicyInner; -import com.azure.resourcemanager.security.implementation.models.InformationProtectionPolicyList; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in InformationProtectionPoliciesClient. - */ -public final class InformationProtectionPoliciesClientImpl implements InformationProtectionPoliciesClient { - /** - * The proxy service used to perform REST calls. - */ - private final InformationProtectionPoliciesService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of InformationProtectionPoliciesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - InformationProtectionPoliciesClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(InformationProtectionPoliciesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterInformationProtectionPolicies to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterInformationProtectionPolicies") - public interface InformationProtectionPoliciesService { - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("informationProtectionPolicyName") InformationProtectionPolicyName informationProtectionPolicyName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("informationProtectionPolicyName") InformationProtectionPolicyName informationProtectionPolicyName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") InformationProtectionPolicyInner informationProtectionPolicy, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/informationProtectionPolicies") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Details of the information protection policy. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param informationProtectionPolicyName Name of the information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, - InformationProtectionPolicyName informationProtectionPolicyName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (informationProtectionPolicyName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter informationProtectionPolicyName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, scope, - informationProtectionPolicyName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details of the information protection policy. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param informationProtectionPolicyName Name of the information protection policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (informationProtectionPolicyName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter informationProtectionPolicyName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, informationProtectionPolicyName, accept, - context); - } - - /** - * Details of the information protection policy. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param informationProtectionPolicyName Name of the information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, - InformationProtectionPolicyName informationProtectionPolicyName) { - return getWithResponseAsync(scope, informationProtectionPolicyName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Details of the information protection policy. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param informationProtectionPolicyName Name of the information protection policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, Context context) { - return getWithResponseAsync(scope, informationProtectionPolicyName, context).block(); - } - - /** - * Details of the information protection policy. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param informationProtectionPolicyName Name of the information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InformationProtectionPolicyInner get(String scope, - InformationProtectionPolicyName informationProtectionPolicyName) { - return getWithResponse(scope, informationProtectionPolicyName, Context.NONE).getValue(); - } - - /** - * Details of the information protection policy. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param informationProtectionPolicyName Name of the information protection policy. - * @param informationProtectionPolicy Information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (informationProtectionPolicyName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter informationProtectionPolicyName is required and cannot be null.")); - } - if (informationProtectionPolicy == null) { - return Mono.error( - new IllegalArgumentException("Parameter informationProtectionPolicy is required and cannot be null.")); - } else { - informationProtectionPolicy.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, - informationProtectionPolicyName, contentType, accept, informationProtectionPolicy, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details of the information protection policy. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param informationProtectionPolicyName Name of the information protection policy. - * @param informationProtectionPolicy Information protection policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (informationProtectionPolicyName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter informationProtectionPolicyName is required and cannot be null.")); - } - if (informationProtectionPolicy == null) { - return Mono.error( - new IllegalArgumentException("Parameter informationProtectionPolicy is required and cannot be null.")); - } else { - informationProtectionPolicy.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, informationProtectionPolicyName, - contentType, accept, informationProtectionPolicy, context); - } - - /** - * Details of the information protection policy. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param informationProtectionPolicyName Name of the information protection policy. - * @param informationProtectionPolicy Information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy) { - return createOrUpdateWithResponseAsync(scope, informationProtectionPolicyName, informationProtectionPolicy) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Details of the information protection policy. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param informationProtectionPolicyName Name of the information protection policy. - * @param informationProtectionPolicy Information protection policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy, Context context) { - return createOrUpdateWithResponseAsync(scope, informationProtectionPolicyName, informationProtectionPolicy, - context).block(); - } - - /** - * Details of the information protection policy. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param informationProtectionPolicyName Name of the information protection policy. - * @param informationProtectionPolicy Information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InformationProtectionPolicyInner createOrUpdate(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy) { - return createOrUpdateWithResponse(scope, informationProtectionPolicyName, informationProtectionPolicy, - Context.NONE).getValue(); - } - - /** - * Information protection policies of a specific management group. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 information protection policies response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, 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())); - } - - /** - * Information protection policies of a specific management group. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 information protection policies response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Information protection policies of a specific management group. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 information protection policies response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Information protection policies of a specific management group. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 information protection policies response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Information protection policies of a specific management group. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 information protection policies response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(listAsync(scope)); - } - - /** - * Information protection policies of a specific management group. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 information protection policies response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(listAsync(scope, 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 information protection policies response 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 information protection policies response 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPoliciesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPoliciesImpl.java deleted file mode 100644 index 181bddd1985e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPoliciesImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.InformationProtectionPoliciesClient; -import com.azure.resourcemanager.security.fluent.models.InformationProtectionPolicyInner; -import com.azure.resourcemanager.security.models.InformationProtectionPolicies; -import com.azure.resourcemanager.security.models.InformationProtectionPolicy; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; - -public final class InformationProtectionPoliciesImpl implements InformationProtectionPolicies { - private static final ClientLogger LOGGER = new ClientLogger(InformationProtectionPoliciesImpl.class); - - private final InformationProtectionPoliciesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public InformationProtectionPoliciesImpl(InformationProtectionPoliciesClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String scope, - InformationProtectionPolicyName informationProtectionPolicyName, Context context) { - Response inner - = this.serviceClient().getWithResponse(scope, informationProtectionPolicyName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new InformationProtectionPolicyImpl(inner.getValue(), this.manager())); - } - - public InformationProtectionPolicy get(String scope, - InformationProtectionPolicyName informationProtectionPolicyName) { - InformationProtectionPolicyInner inner = this.serviceClient().get(scope, informationProtectionPolicyName); - if (inner != null) { - return new InformationProtectionPolicyImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new InformationProtectionPolicyImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new InformationProtectionPolicyImpl(inner1, this.manager())); - } - - public InformationProtectionPolicy getById(String id) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String informationProtectionPolicyNameLocal = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "informationProtectionPolicyName"); - if (informationProtectionPolicyNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( - "The resource ID '%s' is not valid. Missing path segment 'informationProtectionPolicies'.", id))); - } - InformationProtectionPolicyName informationProtectionPolicyName - = InformationProtectionPolicyName.fromString(informationProtectionPolicyNameLocal); - return this.getWithResponse(scope, informationProtectionPolicyName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String informationProtectionPolicyNameLocal = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "informationProtectionPolicyName"); - if (informationProtectionPolicyNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( - "The resource ID '%s' is not valid. Missing path segment 'informationProtectionPolicies'.", id))); - } - InformationProtectionPolicyName informationProtectionPolicyName - = InformationProtectionPolicyName.fromString(informationProtectionPolicyNameLocal); - return this.getWithResponse(scope, informationProtectionPolicyName, context); - } - - private InformationProtectionPoliciesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public InformationProtectionPolicyImpl define(InformationProtectionPolicyName name) { - return new InformationProtectionPolicyImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPolicyImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPolicyImpl.java deleted file mode 100644 index 43629489a831..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPolicyImpl.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.InformationProtectionPolicyInner; -import com.azure.resourcemanager.security.models.InformationProtectionPolicy; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; -import com.azure.resourcemanager.security.models.InformationType; -import com.azure.resourcemanager.security.models.SensitivityLabel; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.Map; - -public final class InformationProtectionPolicyImpl - implements InformationProtectionPolicy, InformationProtectionPolicy.Definition, InformationProtectionPolicy.Update { - private InformationProtectionPolicyInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager 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 OffsetDateTime lastModifiedUtc() { - return this.innerModel().lastModifiedUtc(); - } - - public String version() { - return this.innerModel().version(); - } - - public Map labels() { - Map inner = this.innerModel().labels(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public Map informationTypes() { - Map inner = this.innerModel().informationTypes(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public InformationProtectionPolicyInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String scope; - - private InformationProtectionPolicyName informationProtectionPolicyName; - - public InformationProtectionPolicyImpl withExistingScope(String scope) { - this.scope = scope; - return this; - } - - public InformationProtectionPolicy create() { - this.innerObject = serviceManager.serviceClient() - .getInformationProtectionPolicies() - .createOrUpdateWithResponse(scope, informationProtectionPolicyName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public InformationProtectionPolicy create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getInformationProtectionPolicies() - .createOrUpdateWithResponse(scope, informationProtectionPolicyName, this.innerModel(), context) - .getValue(); - return this; - } - - InformationProtectionPolicyImpl(InformationProtectionPolicyName name, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new InformationProtectionPolicyInner(); - this.serviceManager = serviceManager; - this.informationProtectionPolicyName = name; - } - - public InformationProtectionPolicyImpl update() { - return this; - } - - public InformationProtectionPolicy apply() { - this.innerObject = serviceManager.serviceClient() - .getInformationProtectionPolicies() - .createOrUpdateWithResponse(scope, informationProtectionPolicyName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public InformationProtectionPolicy apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getInformationProtectionPolicies() - .createOrUpdateWithResponse(scope, informationProtectionPolicyName, this.innerModel(), context) - .getValue(); - return this; - } - - InformationProtectionPolicyImpl(InformationProtectionPolicyInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.scope = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "scope"); - this.informationProtectionPolicyName = InformationProtectionPolicyName - .fromString(ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "informationProtectionPolicyName")); - } - - public InformationProtectionPolicy refresh() { - this.innerObject = serviceManager.serviceClient() - .getInformationProtectionPolicies() - .getWithResponse(scope, informationProtectionPolicyName, Context.NONE) - .getValue(); - return this; - } - - public InformationProtectionPolicy refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getInformationProtectionPolicies() - .getWithResponse(scope, informationProtectionPolicyName, context) - .getValue(); - return this; - } - - public InformationProtectionPolicyImpl withLabels(Map labels) { - this.innerModel().withLabels(labels); - return this; - } - - public InformationProtectionPolicyImpl withInformationTypes(Map informationTypes) { - this.innerModel().withInformationTypes(informationTypes); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecurityAggregatedAlertImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecurityAggregatedAlertImpl.java deleted file mode 100644 index 42c86de9d071..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecurityAggregatedAlertImpl.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedAlertInner; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlert; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlertPropertiesTopDevicesListItem; -import com.azure.resourcemanager.security.models.ReportedSeverity; -import java.time.LocalDate; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class IoTSecurityAggregatedAlertImpl implements IoTSecurityAggregatedAlert { - private IoTSecurityAggregatedAlertInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IoTSecurityAggregatedAlertImpl(IoTSecurityAggregatedAlertInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String alertType() { - return this.innerModel().alertType(); - } - - public String alertDisplayName() { - return this.innerModel().alertDisplayName(); - } - - public LocalDate aggregatedDateUtc() { - return this.innerModel().aggregatedDateUtc(); - } - - public String vendorName() { - return this.innerModel().vendorName(); - } - - public ReportedSeverity reportedSeverity() { - return this.innerModel().reportedSeverity(); - } - - public String remediationSteps() { - return this.innerModel().remediationSteps(); - } - - public String description() { - return this.innerModel().description(); - } - - public Long count() { - return this.innerModel().count(); - } - - public String effectedResourceType() { - return this.innerModel().effectedResourceType(); - } - - public String systemSource() { - return this.innerModel().systemSource(); - } - - public String actionTaken() { - return this.innerModel().actionTaken(); - } - - public String logAnalyticsQuery() { - return this.innerModel().logAnalyticsQuery(); - } - - public List topDevicesList() { - List inner = this.innerModel().topDevicesList(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public IoTSecurityAggregatedAlertInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecurityAggregatedRecommendationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecurityAggregatedRecommendationImpl.java deleted file mode 100644 index 170a2357362e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecurityAggregatedRecommendationImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedRecommendationInner; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedRecommendation; -import com.azure.resourcemanager.security.models.ReportedSeverity; -import java.util.Collections; -import java.util.Map; - -public final class IoTSecurityAggregatedRecommendationImpl implements IoTSecurityAggregatedRecommendation { - private IoTSecurityAggregatedRecommendationInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IoTSecurityAggregatedRecommendationImpl(IoTSecurityAggregatedRecommendationInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String recommendationName() { - return this.innerModel().recommendationName(); - } - - public String recommendationDisplayName() { - return this.innerModel().recommendationDisplayName(); - } - - public String description() { - return this.innerModel().description(); - } - - public String recommendationTypeId() { - return this.innerModel().recommendationTypeId(); - } - - public String detectedBy() { - return this.innerModel().detectedBy(); - } - - public String remediationSteps() { - return this.innerModel().remediationSteps(); - } - - public ReportedSeverity reportedSeverity() { - return this.innerModel().reportedSeverity(); - } - - public Long healthyDevices() { - return this.innerModel().healthyDevices(); - } - - public Long unhealthyDeviceCount() { - return this.innerModel().unhealthyDeviceCount(); - } - - public String logAnalyticsQuery() { - return this.innerModel().logAnalyticsQuery(); - } - - public IoTSecurityAggregatedRecommendationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionAnalyticsModelImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionAnalyticsModelImpl.java deleted file mode 100644 index f4ca2f5b2eb8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionAnalyticsModelImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelInner; -import com.azure.resourcemanager.security.models.IoTSecurityAlertedDevice; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceAlert; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceRecommendation; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModel; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem; -import com.azure.resourcemanager.security.models.IoTSeverityMetrics; -import java.util.Collections; -import java.util.List; - -public final class IoTSecuritySolutionAnalyticsModelImpl implements IoTSecuritySolutionAnalyticsModel { - private IoTSecuritySolutionAnalyticsModelInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IoTSecuritySolutionAnalyticsModelImpl(IoTSecuritySolutionAnalyticsModelInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public IoTSeverityMetrics metrics() { - return this.innerModel().metrics(); - } - - public Long unhealthyDeviceCount() { - return this.innerModel().unhealthyDeviceCount(); - } - - public List devicesMetrics() { - List inner = this.innerModel().devicesMetrics(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List topAlertedDevices() { - List inner = this.innerModel().topAlertedDevices(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List mostPrevalentDeviceAlerts() { - List inner = this.innerModel().mostPrevalentDeviceAlerts(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List mostPrevalentDeviceRecommendations() { - List inner = this.innerModel().mostPrevalentDeviceRecommendations(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public IoTSecuritySolutionAnalyticsModelInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionAnalyticsModelListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionAnalyticsModelListImpl.java deleted file mode 100644 index ccfb31e399a7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionAnalyticsModelListImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelInner; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelListInner; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModel; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModelList; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class IoTSecuritySolutionAnalyticsModelListImpl implements IoTSecuritySolutionAnalyticsModelList { - private IoTSecuritySolutionAnalyticsModelListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IoTSecuritySolutionAnalyticsModelListImpl(IoTSecuritySolutionAnalyticsModelListInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new IoTSecuritySolutionAnalyticsModelImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public String nextLink() { - return this.innerModel().nextLink(); - } - - public IoTSecuritySolutionAnalyticsModelListInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionModelImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionModelImpl.java deleted file mode 100644 index d7270f171e7c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionModelImpl.java +++ /dev/null @@ -1,316 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionModelInner; -import com.azure.resourcemanager.security.models.AdditionalWorkspacesProperties; -import com.azure.resourcemanager.security.models.DataSource; -import com.azure.resourcemanager.security.models.ExportData; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionModel; -import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; -import com.azure.resourcemanager.security.models.SecuritySolutionStatus; -import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; -import com.azure.resourcemanager.security.models.UpdateIotSecuritySolutionData; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class IoTSecuritySolutionModelImpl - implements IoTSecuritySolutionModel, IoTSecuritySolutionModel.Definition, IoTSecuritySolutionModel.Update { - private IoTSecuritySolutionModelInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String location() { - return this.innerModel().location(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String workspace() { - return this.innerModel().workspace(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public SecuritySolutionStatus status() { - return this.innerModel().status(); - } - - public List export() { - List inner = this.innerModel().export(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List disabledDataSources() { - List inner = this.innerModel().disabledDataSources(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List iotHubs() { - List inner = this.innerModel().iotHubs(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public UserDefinedResourcesProperties userDefinedResources() { - return this.innerModel().userDefinedResources(); - } - - public List autoDiscoveredResources() { - List inner = this.innerModel().autoDiscoveredResources(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List recommendationsConfiguration() { - List inner = this.innerModel().recommendationsConfiguration(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public UnmaskedIpLoggingStatus unmaskedIpLoggingStatus() { - return this.innerModel().unmaskedIpLoggingStatus(); - } - - public List additionalWorkspaces() { - List inner = this.innerModel().additionalWorkspaces(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public IoTSecuritySolutionModelInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String solutionName; - - private UpdateIotSecuritySolutionData updateUpdateIotSecuritySolutionData; - - public IoTSecuritySolutionModelImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public IoTSecuritySolutionModel create() { - this.innerObject = serviceManager.serviceClient() - .getIotSecuritySolutions() - .createOrUpdateWithResponse(resourceGroupName, solutionName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public IoTSecuritySolutionModel create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getIotSecuritySolutions() - .createOrUpdateWithResponse(resourceGroupName, solutionName, this.innerModel(), context) - .getValue(); - return this; - } - - IoTSecuritySolutionModelImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new IoTSecuritySolutionModelInner(); - this.serviceManager = serviceManager; - this.solutionName = name; - } - - public IoTSecuritySolutionModelImpl update() { - this.updateUpdateIotSecuritySolutionData = new UpdateIotSecuritySolutionData(); - return this; - } - - public IoTSecuritySolutionModel apply() { - this.innerObject = serviceManager.serviceClient() - .getIotSecuritySolutions() - .updateWithResponse(resourceGroupName, solutionName, updateUpdateIotSecuritySolutionData, Context.NONE) - .getValue(); - return this; - } - - public IoTSecuritySolutionModel apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getIotSecuritySolutions() - .updateWithResponse(resourceGroupName, solutionName, updateUpdateIotSecuritySolutionData, context) - .getValue(); - return this; - } - - IoTSecuritySolutionModelImpl(IoTSecuritySolutionModelInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.solutionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "iotSecuritySolutions"); - } - - public IoTSecuritySolutionModel refresh() { - this.innerObject = serviceManager.serviceClient() - .getIotSecuritySolutions() - .getByResourceGroupWithResponse(resourceGroupName, solutionName, Context.NONE) - .getValue(); - return this; - } - - public IoTSecuritySolutionModel refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getIotSecuritySolutions() - .getByResourceGroupWithResponse(resourceGroupName, solutionName, context) - .getValue(); - return this; - } - - public IoTSecuritySolutionModelImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public IoTSecuritySolutionModelImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public IoTSecuritySolutionModelImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateUpdateIotSecuritySolutionData.withTags(tags); - return this; - } - } - - public IoTSecuritySolutionModelImpl withWorkspace(String workspace) { - this.innerModel().withWorkspace(workspace); - return this; - } - - public IoTSecuritySolutionModelImpl withDisplayName(String displayName) { - this.innerModel().withDisplayName(displayName); - return this; - } - - public IoTSecuritySolutionModelImpl withStatus(SecuritySolutionStatus status) { - this.innerModel().withStatus(status); - return this; - } - - public IoTSecuritySolutionModelImpl withExport(List export) { - this.innerModel().withExport(export); - return this; - } - - public IoTSecuritySolutionModelImpl withDisabledDataSources(List disabledDataSources) { - this.innerModel().withDisabledDataSources(disabledDataSources); - return this; - } - - public IoTSecuritySolutionModelImpl withIotHubs(List iotHubs) { - this.innerModel().withIotHubs(iotHubs); - return this; - } - - public IoTSecuritySolutionModelImpl withUserDefinedResources(UserDefinedResourcesProperties userDefinedResources) { - if (isInCreateMode()) { - this.innerModel().withUserDefinedResources(userDefinedResources); - return this; - } else { - this.updateUpdateIotSecuritySolutionData.withUserDefinedResources(userDefinedResources); - return this; - } - } - - public IoTSecuritySolutionModelImpl - withRecommendationsConfiguration(List recommendationsConfiguration) { - if (isInCreateMode()) { - this.innerModel().withRecommendationsConfiguration(recommendationsConfiguration); - return this; - } else { - this.updateUpdateIotSecuritySolutionData.withRecommendationsConfiguration(recommendationsConfiguration); - return this; - } - } - - public IoTSecuritySolutionModelImpl withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus unmaskedIpLoggingStatus) { - this.innerModel().withUnmaskedIpLoggingStatus(unmaskedIpLoggingStatus); - return this; - } - - public IoTSecuritySolutionModelImpl - withAdditionalWorkspaces(List additionalWorkspaces) { - this.innerModel().withAdditionalWorkspaces(additionalWorkspaces); - return this; - } - - private boolean isInCreateMode() { - return this.innerModel() == null || this.innerModel().id() == null; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionAnalyticsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionAnalyticsClientImpl.java deleted file mode 100644 index 393acfa26d21..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionAnalyticsClientImpl.java +++ /dev/null @@ -1,321 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.IotSecuritySolutionAnalyticsClient; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelInner; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelListInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in IotSecuritySolutionAnalyticsClient. - */ -public final class IotSecuritySolutionAnalyticsClientImpl implements IotSecuritySolutionAnalyticsClient { - /** - * The proxy service used to perform REST calls. - */ - private final IotSecuritySolutionAnalyticsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IotSecuritySolutionAnalyticsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotSecuritySolutionAnalyticsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(IotSecuritySolutionAnalyticsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIotSecuritySolutionAnalytics to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterIotSecuritySolutionAnalytics") - public interface IotSecuritySolutionAnalyticsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("solutionName") String solutionName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("solutionName") String solutionName, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Use this method to get IoT Security Analytics metrics. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security analytics of your IoT Security solution along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String solutionName) { - 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, solutionName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to get IoT Security Analytics metrics. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security analytics of your IoT Security solution along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String solutionName, 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - solutionName, accept, context); - } - - /** - * Use this method to get IoT Security Analytics metrics. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security analytics of your IoT Security solution on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String solutionName) { - return getWithResponseAsync(resourceGroupName, solutionName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Use this method to get IoT Security Analytics metrics. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security analytics of your IoT Security solution along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, - String solutionName, Context context) { - return getWithResponseAsync(resourceGroupName, solutionName, context).block(); - } - - /** - * Use this method to get IoT Security Analytics metrics. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security analytics of your IoT Security solution. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IoTSecuritySolutionAnalyticsModelInner get(String resourceGroupName, String solutionName) { - return getWithResponse(resourceGroupName, solutionName, Context.NONE).getValue(); - } - - /** - * Use this method to get IoT security Analytics metrics in an array. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Security analytics of your IoT Security solution along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String resourceGroupName, - String solutionName) { - 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, solutionName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to get IoT security Analytics metrics in an array. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Security analytics of your IoT Security solution along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String resourceGroupName, - String solutionName, 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - solutionName, accept, context); - } - - /** - * Use this method to get IoT security Analytics metrics in an array. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Security analytics of your IoT Security solution on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String resourceGroupName, String solutionName) { - return listWithResponseAsync(resourceGroupName, solutionName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Use this method to get IoT security Analytics metrics in an array. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Security analytics of your IoT Security solution along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String resourceGroupName, - String solutionName, Context context) { - return listWithResponseAsync(resourceGroupName, solutionName, context).block(); - } - - /** - * Use this method to get IoT security Analytics metrics in an array. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Security analytics of your IoT Security solution. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IoTSecuritySolutionAnalyticsModelListInner list(String resourceGroupName, String solutionName) { - return listWithResponse(resourceGroupName, solutionName, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionAnalyticsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionAnalyticsImpl.java deleted file mode 100644 index 22efae9cce91..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionAnalyticsImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.IotSecuritySolutionAnalyticsClient; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelInner; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelListInner; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModel; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModelList; -import com.azure.resourcemanager.security.models.IotSecuritySolutionAnalytics; - -public final class IotSecuritySolutionAnalyticsImpl implements IotSecuritySolutionAnalytics { - private static final ClientLogger LOGGER = new ClientLogger(IotSecuritySolutionAnalyticsImpl.class); - - private final IotSecuritySolutionAnalyticsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotSecuritySolutionAnalyticsImpl(IotSecuritySolutionAnalyticsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String solutionName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, solutionName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new IoTSecuritySolutionAnalyticsModelImpl(inner.getValue(), this.manager())); - } - - public IoTSecuritySolutionAnalyticsModel get(String resourceGroupName, String solutionName) { - IoTSecuritySolutionAnalyticsModelInner inner = this.serviceClient().get(resourceGroupName, solutionName); - if (inner != null) { - return new IoTSecuritySolutionAnalyticsModelImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listWithResponse(String resourceGroupName, - String solutionName, Context context) { - Response inner - = this.serviceClient().listWithResponse(resourceGroupName, solutionName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new IoTSecuritySolutionAnalyticsModelListImpl(inner.getValue(), this.manager())); - } - - public IoTSecuritySolutionAnalyticsModelList list(String resourceGroupName, String solutionName) { - IoTSecuritySolutionAnalyticsModelListInner inner = this.serviceClient().list(resourceGroupName, solutionName); - if (inner != null) { - return new IoTSecuritySolutionAnalyticsModelListImpl(inner, this.manager()); - } else { - return null; - } - } - - private IotSecuritySolutionAnalyticsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl.java deleted file mode 100644 index a87c7f6756b9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl.java +++ /dev/null @@ -1,599 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsAnalyticsAggregatedAlertsClient; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedAlertInner; -import com.azure.resourcemanager.security.implementation.models.IoTSecurityAggregatedAlertList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * IotSecuritySolutionsAnalyticsAggregatedAlertsClient. - */ -public final class IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl - implements IotSecuritySolutionsAnalyticsAggregatedAlertsClient { - /** - * The proxy service used to perform REST calls. - */ - private final IotSecuritySolutionsAnalyticsAggregatedAlertsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(IotSecuritySolutionsAnalyticsAggregatedAlertsService.class, - client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIotSecuritySolutionsAnalyticsAggregatedAlerts to be - * used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterIotSecuritySolutionsAnalyticsAggregatedAlerts") - public interface IotSecuritySolutionsAnalyticsAggregatedAlertsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("solutionName") String solutionName, - @PathParam("aggregatedAlertName") String aggregatedAlertName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("solutionName") String solutionName, - @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}/dismiss") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> dismiss(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("solutionName") String solutionName, - @PathParam("aggregatedAlertName") String aggregatedAlertName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is - * performed by alert name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Solution Aggregated Alert information along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String solutionName, String aggregatedAlertName) { - 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - if (aggregatedAlertName == null) { - return Mono - .error(new IllegalArgumentException("Parameter aggregatedAlertName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, solutionName, aggregatedAlertName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is - * performed by alert name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated alert. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Solution Aggregated Alert information along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String solutionName, String aggregatedAlertName, 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - if (aggregatedAlertName == null) { - return Mono - .error(new IllegalArgumentException("Parameter aggregatedAlertName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - solutionName, aggregatedAlertName, accept, context); - } - - /** - * Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is - * performed by alert name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Solution Aggregated Alert information on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String solutionName, - String aggregatedAlertName) { - return getWithResponseAsync(resourceGroupName, solutionName, aggregatedAlertName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is - * performed by alert name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated alert. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Solution Aggregated Alert information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String solutionName, - String aggregatedAlertName, Context context) { - return getWithResponseAsync(resourceGroupName, solutionName, aggregatedAlertName, context).block(); - } - - /** - * Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is - * performed by alert name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Solution Aggregated Alert information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IoTSecurityAggregatedAlertInner get(String resourceGroupName, String solutionName, - String aggregatedAlertName) { - return getWithResponse(resourceGroupName, solutionName, aggregatedAlertName, Context.NONE).getValue(); - } - - /** - * Use this method to get the aggregated alert list of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solution aggregated alert data along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String solutionName, Integer top) { - 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, solutionName, 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())); - } - - /** - * Use this method to get the aggregated alert list of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solution aggregated alert data along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String solutionName, Integer top, 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - solutionName, top, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Use this method to get the aggregated alert list of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solution aggregated alert data as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String solutionName, - Integer top) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, solutionName, top), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Use this method to get the aggregated alert list of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solution aggregated alert data as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String solutionName) { - final Integer top = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, solutionName, top), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Use this method to get the aggregated alert list of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solution aggregated alert data as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String solutionName, - Integer top, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, solutionName, top, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Use this method to get the aggregated alert list of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solution aggregated alert data as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String solutionName) { - final Integer top = null; - return new PagedIterable<>(listAsync(resourceGroupName, solutionName, top)); - } - - /** - * Use this method to get the aggregated alert list of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solution aggregated alert data as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String solutionName, - Integer top, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, solutionName, top, context)); - } - - /** - * Use this method to dismiss an aggregated IoT Security Solution Alert. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> dismissWithResponseAsync(String resourceGroupName, String solutionName, - String aggregatedAlertName) { - 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - if (aggregatedAlertName == null) { - return Mono - .error(new IllegalArgumentException("Parameter aggregatedAlertName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - return FluxUtil - .withContext(context -> service.dismiss(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, solutionName, aggregatedAlertName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to dismiss an aggregated IoT Security Solution Alert. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated alert. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> dismissWithResponseAsync(String resourceGroupName, String solutionName, - String aggregatedAlertName, 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - if (aggregatedAlertName == null) { - return Mono - .error(new IllegalArgumentException("Parameter aggregatedAlertName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - context = this.client.mergeContext(context); - return service.dismiss(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, solutionName, aggregatedAlertName, context); - } - - /** - * Use this method to dismiss an aggregated IoT Security Solution Alert. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 dismissAsync(String resourceGroupName, String solutionName, String aggregatedAlertName) { - return dismissWithResponseAsync(resourceGroupName, solutionName, aggregatedAlertName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Use this method to dismiss an aggregated IoT Security Solution Alert. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated alert. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 dismissWithResponse(String resourceGroupName, String solutionName, String aggregatedAlertName, - Context context) { - return dismissWithResponseAsync(resourceGroupName, solutionName, aggregatedAlertName, context).block(); - } - - /** - * Use this method to dismiss an aggregated IoT Security Solution Alert. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated alert. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 dismiss(String resourceGroupName, String solutionName, String aggregatedAlertName) { - dismissWithResponse(resourceGroupName, solutionName, aggregatedAlertName, Context.NONE); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solution aggregated alert data 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 list of IoT Security solution aggregated alert data 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsAggregatedAlertsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsAggregatedAlertsImpl.java deleted file mode 100644 index d39912cb4e16..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsAggregatedAlertsImpl.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsAnalyticsAggregatedAlertsClient; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedAlertInner; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlert; -import com.azure.resourcemanager.security.models.IotSecuritySolutionsAnalyticsAggregatedAlerts; - -public final class IotSecuritySolutionsAnalyticsAggregatedAlertsImpl - implements IotSecuritySolutionsAnalyticsAggregatedAlerts { - private static final ClientLogger LOGGER - = new ClientLogger(IotSecuritySolutionsAnalyticsAggregatedAlertsImpl.class); - - private final IotSecuritySolutionsAnalyticsAggregatedAlertsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotSecuritySolutionsAnalyticsAggregatedAlertsImpl( - IotSecuritySolutionsAnalyticsAggregatedAlertsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String solutionName, - String aggregatedAlertName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, solutionName, aggregatedAlertName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new IoTSecurityAggregatedAlertImpl(inner.getValue(), this.manager())); - } - - public IoTSecurityAggregatedAlert get(String resourceGroupName, String solutionName, String aggregatedAlertName) { - IoTSecurityAggregatedAlertInner inner - = this.serviceClient().get(resourceGroupName, solutionName, aggregatedAlertName); - if (inner != null) { - return new IoTSecurityAggregatedAlertImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String solutionName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, solutionName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new IoTSecurityAggregatedAlertImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String solutionName, Integer top, - Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, solutionName, top, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new IoTSecurityAggregatedAlertImpl(inner1, this.manager())); - } - - public Response dismissWithResponse(String resourceGroupName, String solutionName, String aggregatedAlertName, - Context context) { - return this.serviceClient().dismissWithResponse(resourceGroupName, solutionName, aggregatedAlertName, context); - } - - public void dismiss(String resourceGroupName, String solutionName, String aggregatedAlertName) { - this.serviceClient().dismiss(resourceGroupName, solutionName, aggregatedAlertName); - } - - private IotSecuritySolutionsAnalyticsAggregatedAlertsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsRecommendationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsRecommendationsClientImpl.java deleted file mode 100644 index ad4b8ab05971..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsRecommendationsClientImpl.java +++ /dev/null @@ -1,464 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsAnalyticsRecommendationsClient; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedRecommendationInner; -import com.azure.resourcemanager.security.implementation.models.IoTSecurityAggregatedRecommendationList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * IotSecuritySolutionsAnalyticsRecommendationsClient. - */ -public final class IotSecuritySolutionsAnalyticsRecommendationsClientImpl - implements IotSecuritySolutionsAnalyticsRecommendationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final IotSecuritySolutionsAnalyticsRecommendationsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IotSecuritySolutionsAnalyticsRecommendationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotSecuritySolutionsAnalyticsRecommendationsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(IotSecuritySolutionsAnalyticsRecommendationsService.class, - client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIotSecuritySolutionsAnalyticsRecommendations to be used - * by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterIotSecuritySolutionsAnalyticsRecommendations") - public interface IotSecuritySolutionsAnalyticsRecommendationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("solutionName") String solutionName, - @PathParam("aggregatedRecommendationName") String aggregatedRecommendationName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("solutionName") String solutionName, - @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This - * aggregation is performed by recommendation name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedRecommendationName Name of the recommendation aggregated for this query. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution recommendation information along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String solutionName, String aggregatedRecommendationName) { - 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - if (aggregatedRecommendationName == null) { - return Mono.error( - new IllegalArgumentException("Parameter aggregatedRecommendationName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, solutionName, aggregatedRecommendationName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This - * aggregation is performed by recommendation name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedRecommendationName Name of the recommendation aggregated for this query. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution recommendation information along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String solutionName, String aggregatedRecommendationName, 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - if (aggregatedRecommendationName == null) { - return Mono.error( - new IllegalArgumentException("Parameter aggregatedRecommendationName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - solutionName, aggregatedRecommendationName, accept, context); - } - - /** - * Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This - * aggregation is performed by recommendation name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedRecommendationName Name of the recommendation aggregated for this query. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution recommendation information on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String solutionName, - String aggregatedRecommendationName) { - return getWithResponseAsync(resourceGroupName, solutionName, aggregatedRecommendationName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This - * aggregation is performed by recommendation name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedRecommendationName Name of the recommendation aggregated for this query. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution recommendation information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, - String solutionName, String aggregatedRecommendationName, Context context) { - return getWithResponseAsync(resourceGroupName, solutionName, aggregatedRecommendationName, context).block(); - } - - /** - * Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This - * aggregation is performed by recommendation name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedRecommendationName Name of the recommendation aggregated for this query. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution recommendation information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IoTSecurityAggregatedRecommendationInner get(String resourceGroupName, String solutionName, - String aggregatedRecommendationName) { - return getWithResponse(resourceGroupName, solutionName, aggregatedRecommendationName, Context.NONE).getValue(); - } - - /** - * Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solution aggregated recommendations along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String solutionName, Integer top) { - 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, solutionName, 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())); - } - - /** - * Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solution aggregated recommendations along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String solutionName, Integer top, 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - solutionName, top, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solution aggregated recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String solutionName, - Integer top) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, solutionName, top), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solution aggregated recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, - String solutionName) { - final Integer top = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, solutionName, top), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solution aggregated recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String solutionName, - Integer top, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, solutionName, top, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solution aggregated recommendations as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String solutionName) { - final Integer top = null; - return new PagedIterable<>(listAsync(resourceGroupName, solutionName, top)); - } - - /** - * Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solution aggregated recommendations as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String solutionName, - Integer top, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, solutionName, top, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solution aggregated recommendations 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 list of IoT Security solution aggregated recommendations 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsRecommendationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsRecommendationsImpl.java deleted file mode 100644 index c8e4e7bed2db..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsRecommendationsImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsAnalyticsRecommendationsClient; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedRecommendationInner; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedRecommendation; -import com.azure.resourcemanager.security.models.IotSecuritySolutionsAnalyticsRecommendations; - -public final class IotSecuritySolutionsAnalyticsRecommendationsImpl - implements IotSecuritySolutionsAnalyticsRecommendations { - private static final ClientLogger LOGGER = new ClientLogger(IotSecuritySolutionsAnalyticsRecommendationsImpl.class); - - private final IotSecuritySolutionsAnalyticsRecommendationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotSecuritySolutionsAnalyticsRecommendationsImpl( - IotSecuritySolutionsAnalyticsRecommendationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String solutionName, - String aggregatedRecommendationName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, solutionName, aggregatedRecommendationName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new IoTSecurityAggregatedRecommendationImpl(inner.getValue(), this.manager())); - } - - public IoTSecurityAggregatedRecommendation get(String resourceGroupName, String solutionName, - String aggregatedRecommendationName) { - IoTSecurityAggregatedRecommendationInner inner - = this.serviceClient().get(resourceGroupName, solutionName, aggregatedRecommendationName); - if (inner != null) { - return new IoTSecurityAggregatedRecommendationImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String solutionName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, solutionName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new IoTSecurityAggregatedRecommendationImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String solutionName, - Integer top, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, solutionName, top, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new IoTSecurityAggregatedRecommendationImpl(inner1, this.manager())); - } - - private IotSecuritySolutionsAnalyticsRecommendationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsClientImpl.java deleted file mode 100644 index 296c223f0727..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsClientImpl.java +++ /dev/null @@ -1,1064 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.Patch; -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.resourcemanager.security.fluent.IotSecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionModelInner; -import com.azure.resourcemanager.security.implementation.models.IoTSecuritySolutionsList; -import com.azure.resourcemanager.security.models.UpdateIotSecuritySolutionData; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in IotSecuritySolutionsClient. - */ -public final class IotSecuritySolutionsClientImpl implements IotSecuritySolutionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final IotSecuritySolutionsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IotSecuritySolutionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotSecuritySolutionsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(IotSecuritySolutionsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIotSecuritySolutions to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterIotSecuritySolutions") - public interface IotSecuritySolutionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("solutionName") String solutionName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("solutionName") String solutionName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") IoTSecuritySolutionModelInner iotSecuritySolutionData, Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("solutionName") String solutionName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") UpdateIotSecuritySolutionData updateIotSecuritySolutionData, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("solutionName") String solutionName, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotSecuritySolutions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * User this method to get details of a specific IoT Security solution based on solution name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution configuration and resource information along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String solutionName) { - 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, solutionName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * User this method to get details of a specific IoT Security solution based on solution name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution configuration and resource information along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String solutionName, 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, solutionName, accept, context); - } - - /** - * User this method to get details of a specific IoT Security solution based on solution name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution configuration and resource information on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String solutionName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, solutionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * User this method to get details of a specific IoT Security solution based on solution name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution configuration and resource information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String solutionName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, solutionName, context).block(); - } - - /** - * User this method to get details of a specific IoT Security solution based on solution name. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution configuration and resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IoTSecuritySolutionModelInner getByResourceGroup(String resourceGroupName, String solutionName) { - return getByResourceGroupWithResponse(resourceGroupName, solutionName, Context.NONE).getValue(); - } - - /** - * Use this method to create or update yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param iotSecuritySolutionData The security solution data. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution configuration and resource information along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String solutionName, IoTSecuritySolutionModelInner iotSecuritySolutionData) { - 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - if (iotSecuritySolutionData == null) { - return Mono.error( - new IllegalArgumentException("Parameter iotSecuritySolutionData is required and cannot be null.")); - } else { - iotSecuritySolutionData.validate(); - } - final String apiVersion = "2019-08-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, solutionName, contentType, accept, - iotSecuritySolutionData, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to create or update yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param iotSecuritySolutionData The security solution data. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution configuration and resource information along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String solutionName, IoTSecuritySolutionModelInner iotSecuritySolutionData, 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - if (iotSecuritySolutionData == null) { - return Mono.error( - new IllegalArgumentException("Parameter iotSecuritySolutionData is required and cannot be null.")); - } else { - iotSecuritySolutionData.validate(); - } - final String apiVersion = "2019-08-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, solutionName, contentType, accept, iotSecuritySolutionData, context); - } - - /** - * Use this method to create or update yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param iotSecuritySolutionData The security solution data. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution configuration and resource information on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String solutionName, - IoTSecuritySolutionModelInner iotSecuritySolutionData) { - return createOrUpdateWithResponseAsync(resourceGroupName, solutionName, iotSecuritySolutionData) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Use this method to create or update yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param iotSecuritySolutionData The security solution data. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution configuration and resource information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, - String solutionName, IoTSecuritySolutionModelInner iotSecuritySolutionData, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, solutionName, iotSecuritySolutionData, context) - .block(); - } - - /** - * Use this method to create or update yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param iotSecuritySolutionData The security solution data. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution configuration and resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IoTSecuritySolutionModelInner createOrUpdate(String resourceGroupName, String solutionName, - IoTSecuritySolutionModelInner iotSecuritySolutionData) { - return createOrUpdateWithResponse(resourceGroupName, solutionName, iotSecuritySolutionData, Context.NONE) - .getValue(); - } - - /** - * Use this method to update existing IoT Security solution tags or user defined resources. To update other fields - * use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param updateIotSecuritySolutionData The security solution data. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution configuration and resource information along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String solutionName, UpdateIotSecuritySolutionData updateIotSecuritySolutionData) { - 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - if (updateIotSecuritySolutionData == null) { - return Mono.error(new IllegalArgumentException( - "Parameter updateIotSecuritySolutionData is required and cannot be null.")); - } else { - updateIotSecuritySolutionData.validate(); - } - final String apiVersion = "2019-08-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, solutionName, contentType, accept, updateIotSecuritySolutionData, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to update existing IoT Security solution tags or user defined resources. To update other fields - * use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param updateIotSecuritySolutionData The security solution data. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution configuration and resource information along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String solutionName, UpdateIotSecuritySolutionData updateIotSecuritySolutionData, 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - if (updateIotSecuritySolutionData == null) { - return Mono.error(new IllegalArgumentException( - "Parameter updateIotSecuritySolutionData is required and cannot be null.")); - } else { - updateIotSecuritySolutionData.validate(); - } - final String apiVersion = "2019-08-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - solutionName, contentType, accept, updateIotSecuritySolutionData, context); - } - - /** - * Use this method to update existing IoT Security solution tags or user defined resources. To update other fields - * use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param updateIotSecuritySolutionData The security solution data. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution configuration and resource information on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String solutionName, - UpdateIotSecuritySolutionData updateIotSecuritySolutionData) { - return updateWithResponseAsync(resourceGroupName, solutionName, updateIotSecuritySolutionData) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Use this method to update existing IoT Security solution tags or user defined resources. To update other fields - * use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param updateIotSecuritySolutionData The security solution data. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution configuration and resource information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String solutionName, - UpdateIotSecuritySolutionData updateIotSecuritySolutionData, Context context) { - return updateWithResponseAsync(resourceGroupName, solutionName, updateIotSecuritySolutionData, context).block(); - } - - /** - * Use this method to update existing IoT Security solution tags or user defined resources. To update other fields - * use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param updateIotSecuritySolutionData The security solution data. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution configuration and resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IoTSecuritySolutionModelInner update(String resourceGroupName, String solutionName, - UpdateIotSecuritySolutionData updateIotSecuritySolutionData) { - return updateWithResponse(resourceGroupName, solutionName, updateIotSecuritySolutionData, Context.NONE) - .getValue(); - } - - /** - * Use this method to delete yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 solutionName) { - 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, solutionName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to delete yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 solutionName, - 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - solutionName, context); - } - - /** - * Use this method to delete yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 solutionName) { - return deleteWithResponseAsync(resourceGroupName, solutionName).flatMap(ignored -> Mono.empty()); - } - - /** - * Use this method to delete yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String solutionName, Context context) { - return deleteWithResponseAsync(resourceGroupName, solutionName, context).block(); - } - - /** - * Use this method to delete yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 solutionName) { - deleteWithResponse(resourceGroupName, solutionName, Context.NONE); - } - - /** - * Use this method to get the list IoT Security solutions organized by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupSinglePageAsync(String resourceGroupName, String filter) { - 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.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, 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())); - } - - /** - * Use this method to get the list IoT Security solutions organized by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupSinglePageAsync(String resourceGroupName, String filter, 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.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Use this method to get the list IoT Security solutions organized by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Use this method to get the list IoT Security solutions organized by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String filter = null; - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Use this method to get the list IoT Security solutions organized by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, - Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Use this method to get the list IoT Security solutions organized by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final String filter = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter)); - } - - /** - * Use this method to get the list IoT Security solutions organized by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, String filter, - Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, context)); - } - - /** - * Use this method to get the list of IoT Security solutions by subscription. - * - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter) { - 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-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - 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())); - } - - /** - * Use this method to get the list of IoT Security solutions by subscription. - * - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, 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-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Use this method to get the list of IoT Security solutions by subscription. - * - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(filter), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Use this method to get the list of IoT Security solutions by 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 list of IoT Security solutions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Use this method to get the list of IoT Security solutions by subscription. - * - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Use this method to get the list of IoT Security solutions by 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 list of IoT Security solutions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - return new PagedIterable<>(listAsync(filter)); - } - - /** - * Use this method to get the list of IoT Security solutions by subscription. - * - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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( - context -> 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)) - .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 list of IoT Security solutions along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsImpl.java deleted file mode 100644 index adf7648b83b4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsImpl.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionModelInner; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionModel; -import com.azure.resourcemanager.security.models.IotSecuritySolutions; - -public final class IotSecuritySolutionsImpl implements IotSecuritySolutions { - private static final ClientLogger LOGGER = new ClientLogger(IotSecuritySolutionsImpl.class); - - private final IotSecuritySolutionsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotSecuritySolutionsImpl(IotSecuritySolutionsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getByResourceGroupWithResponse(String resourceGroupName, - String solutionName, Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, solutionName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new IoTSecuritySolutionModelImpl(inner.getValue(), this.manager())); - } - - public IoTSecuritySolutionModel getByResourceGroup(String resourceGroupName, String solutionName) { - IoTSecuritySolutionModelInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, solutionName); - if (inner != null) { - return new IoTSecuritySolutionModelImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse(String resourceGroupName, String solutionName, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, solutionName, context); - } - - public void deleteByResourceGroup(String resourceGroupName, String solutionName) { - this.serviceClient().delete(resourceGroupName, solutionName); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new IoTSecuritySolutionModelImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, String filter, - Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new IoTSecuritySolutionModelImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new IoTSecuritySolutionModelImpl(inner1, this.manager())); - } - - public PagedIterable list(String filter, Context context) { - PagedIterable inner = this.serviceClient().list(filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new IoTSecuritySolutionModelImpl(inner1, this.manager())); - } - - public IoTSecuritySolutionModel 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 solutionName = ResourceManagerUtils.getValueFromIdByName(id, "iotSecuritySolutions"); - if (solutionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'iotSecuritySolutions'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, solutionName, 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 solutionName = ResourceManagerUtils.getValueFromIdByName(id, "iotSecuritySolutions"); - if (solutionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'iotSecuritySolutions'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, solutionName, 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 solutionName = ResourceManagerUtils.getValueFromIdByName(id, "iotSecuritySolutions"); - if (solutionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'iotSecuritySolutions'.", id))); - } - this.deleteByResourceGroupWithResponse(resourceGroupName, solutionName, Context.NONE); - } - - public Response 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 solutionName = ResourceManagerUtils.getValueFromIdByName(id, "iotSecuritySolutions"); - if (solutionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'iotSecuritySolutions'.", id))); - } - return this.deleteByResourceGroupWithResponse(resourceGroupName, solutionName, context); - } - - private IotSecuritySolutionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public IoTSecuritySolutionModelImpl define(String name) { - return new IoTSecuritySolutionModelImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPoliciesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPoliciesClientImpl.java deleted file mode 100644 index 6d82ae0e3bad..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPoliciesClientImpl.java +++ /dev/null @@ -1,1517 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.JitNetworkAccessPoliciesClient; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyInner; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; -import com.azure.resourcemanager.security.implementation.models.JitNetworkAccessPoliciesList; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateRequest; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in JitNetworkAccessPoliciesClient. - */ -public final class JitNetworkAccessPoliciesClientImpl implements JitNetworkAccessPoliciesClient { - /** - * The proxy service used to perform REST calls. - */ - private final JitNetworkAccessPoliciesService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of JitNetworkAccessPoliciesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - JitNetworkAccessPoliciesClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(JitNetworkAccessPoliciesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterJitNetworkAccessPolicies to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterJitNetworkAccessPolicies") - public interface JitNetworkAccessPoliciesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @PathParam("jitNetworkAccessPolicyName") String jitNetworkAccessPolicyName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @PathParam("jitNetworkAccessPolicyName") String jitNetworkAccessPolicyName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") JitNetworkAccessPolicyInner body, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @PathParam("jitNetworkAccessPolicyName") String jitNetworkAccessPolicyName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupAndRegion( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByRegion(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @HeaderParam("Accept") String accept, Context context); - - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}/{jitNetworkAccessPolicyInitiateType}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> initiate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @PathParam("jitNetworkAccessPolicyName") String jitNetworkAccessPolicyName, - @PathParam("jitNetworkAccessPolicyInitiateType") String jitNetworkAccessPolicyInitiateType, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") JitNetworkAccessPolicyInitiateRequest body, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/jitNetworkAccessPolicies") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/jitNetworkAccessPolicies") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - 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" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupAndRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String ascLocation, String jitNetworkAccessPolicyName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (jitNetworkAccessPolicyName == null) { - return Mono.error( - new IllegalArgumentException("Parameter jitNetworkAccessPolicyName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, ascLocation, jitNetworkAccessPolicyName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String ascLocation, String jitNetworkAccessPolicyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (jitNetworkAccessPolicyName == null) { - return Mono.error( - new IllegalArgumentException("Parameter jitNetworkAccessPolicyName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - ascLocation, jitNetworkAccessPolicyName, accept, context); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String ascLocation, - String jitNetworkAccessPolicyName) { - return getWithResponseAsync(resourceGroupName, ascLocation, jitNetworkAccessPolicyName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String ascLocation, - String jitNetworkAccessPolicyName, Context context) { - return getWithResponseAsync(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, context).block(); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return concrete proxy resource types can be created by aliasing this type using a specific property type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public JitNetworkAccessPolicyInner get(String resourceGroupName, String ascLocation, - String jitNetworkAccessPolicyName) { - return getWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, Context.NONE).getValue(); - } - - /** - * Create a policy for protecting resources using Just-in-Time access control. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @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 concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String ascLocation, String jitNetworkAccessPolicyName, JitNetworkAccessPolicyInner body) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (jitNetworkAccessPolicyName == null) { - return Mono.error( - new IllegalArgumentException("Parameter jitNetworkAccessPolicyName 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-01-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, ascLocation, jitNetworkAccessPolicyName, - contentType, accept, body, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a policy for protecting resources using Just-in-Time access control. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @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 concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String ascLocation, String jitNetworkAccessPolicyName, JitNetworkAccessPolicyInner body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (jitNetworkAccessPolicyName == null) { - return Mono.error( - new IllegalArgumentException("Parameter jitNetworkAccessPolicyName 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-01-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, ascLocation, jitNetworkAccessPolicyName, contentType, accept, body, context); - } - - /** - * Create a policy for protecting resources using Just-in-Time access control. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @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 concrete proxy resource types can be created by aliasing this type using a specific property type on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String ascLocation, - String jitNetworkAccessPolicyName, JitNetworkAccessPolicyInner body) { - return createOrUpdateWithResponseAsync(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create a policy for protecting resources using Just-in-Time access control. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @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 concrete proxy resource types can be created by aliasing this type using a specific property type along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, - String ascLocation, String jitNetworkAccessPolicyName, JitNetworkAccessPolicyInner body, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body, - context).block(); - } - - /** - * Create a policy for protecting resources using Just-in-Time access control. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @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 concrete proxy resource types can be created by aliasing this type using a specific property type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public JitNetworkAccessPolicyInner createOrUpdate(String resourceGroupName, String ascLocation, - String jitNetworkAccessPolicyName, JitNetworkAccessPolicyInner body) { - return createOrUpdateWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body, - Context.NONE).getValue(); - } - - /** - * Delete a Just-in-Time access control policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 ascLocation, - String jitNetworkAccessPolicyName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (jitNetworkAccessPolicyName == null) { - return Mono.error( - new IllegalArgumentException("Parameter jitNetworkAccessPolicyName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, ascLocation, jitNetworkAccessPolicyName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a Just-in-Time access control policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 ascLocation, - String jitNetworkAccessPolicyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (jitNetworkAccessPolicyName == null) { - return Mono.error( - new IllegalArgumentException("Parameter jitNetworkAccessPolicyName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - ascLocation, jitNetworkAccessPolicyName, context); - } - - /** - * Delete a Just-in-Time access control policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 ascLocation, String jitNetworkAccessPolicyName) { - return deleteWithResponseAsync(resourceGroupName, ascLocation, jitNetworkAccessPolicyName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a Just-in-Time access control policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String ascLocation, - String jitNetworkAccessPolicyName, Context context) { - return deleteWithResponseAsync(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, context).block(); - } - - /** - * Delete a Just-in-Time access control policy. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 ascLocation, String jitNetworkAccessPolicyName) { - deleteWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, Context.NONE); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupAndRegionSinglePageAsync(String resourceGroupName, String ascLocation) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroupAndRegion(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, ascLocation, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupAndRegionSinglePageAsync(String resourceGroupName, String ascLocation, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupAndRegion(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, ascLocation, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAndRegionAsync(String resourceGroupName, - String ascLocation) { - return new PagedFlux<>(() -> listByResourceGroupAndRegionSinglePageAsync(resourceGroupName, ascLocation), - nextLink -> listByResourceGroupAndRegionNextSinglePageAsync(nextLink)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAndRegionAsync(String resourceGroupName, - String ascLocation, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupAndRegionSinglePageAsync(resourceGroupName, ascLocation, context), - nextLink -> listByResourceGroupAndRegionNextSinglePageAsync(nextLink, context)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroupAndRegion(String resourceGroupName, - String ascLocation) { - return new PagedIterable<>(listByResourceGroupAndRegionAsync(resourceGroupName, ascLocation)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroupAndRegion(String resourceGroupName, - String ascLocation, Context context) { - return new PagedIterable<>(listByResourceGroupAndRegionAsync(resourceGroupName, ascLocation, context)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByRegionSinglePageAsync(String ascLocation) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByRegion(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByRegionSinglePageAsync(String ascLocation, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByRegion(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), ascLocation, accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByRegionAsync(String ascLocation) { - return new PagedFlux<>(() -> listByRegionSinglePageAsync(ascLocation), - nextLink -> listByRegionNextSinglePageAsync(nextLink)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByRegionAsync(String ascLocation, Context context) { - return new PagedFlux<>(() -> listByRegionSinglePageAsync(ascLocation, context), - nextLink -> listByRegionNextSinglePageAsync(nextLink, context)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByRegion(String ascLocation) { - return new PagedIterable<>(listByRegionAsync(ascLocation)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByRegion(String ascLocation, Context context) { - return new PagedIterable<>(listByRegionAsync(ascLocation, context)); - } - - /** - * Initiate a JIT access from a specific Just-in-Time policy configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @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} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> initiateWithResponseAsync(String resourceGroupName, - String ascLocation, String jitNetworkAccessPolicyName, JitNetworkAccessPolicyInitiateRequest body) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (jitNetworkAccessPolicyName == null) { - return Mono.error( - new IllegalArgumentException("Parameter jitNetworkAccessPolicyName 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-01-01"; - final String jitNetworkAccessPolicyInitiateType = "initiate"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.initiate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, ascLocation, jitNetworkAccessPolicyName, - jitNetworkAccessPolicyInitiateType, contentType, accept, body, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Initiate a JIT access from a specific Just-in-Time policy configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @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 response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> initiateWithResponseAsync(String resourceGroupName, - String ascLocation, String jitNetworkAccessPolicyName, JitNetworkAccessPolicyInitiateRequest body, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (jitNetworkAccessPolicyName == null) { - return Mono.error( - new IllegalArgumentException("Parameter jitNetworkAccessPolicyName 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-01-01"; - final String jitNetworkAccessPolicyInitiateType = "initiate"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.initiate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, ascLocation, jitNetworkAccessPolicyName, jitNetworkAccessPolicyInitiateType, contentType, - accept, body, context); - } - - /** - * Initiate a JIT access from a specific Just-in-Time policy configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono initiateAsync(String resourceGroupName, String ascLocation, - String jitNetworkAccessPolicyName, JitNetworkAccessPolicyInitiateRequest body) { - return initiateWithResponseAsync(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Initiate a JIT access from a specific Just-in-Time policy configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @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 response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response initiateWithResponse(String resourceGroupName, String ascLocation, - String jitNetworkAccessPolicyName, JitNetworkAccessPolicyInitiateRequest body, Context context) { - return initiateWithResponseAsync(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body, context) - .block(); - } - - /** - * Initiate a JIT access from a specific Just-in-Time policy configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public JitNetworkAccessRequestInner initiate(String resourceGroupName, String ascLocation, - String jitNetworkAccessPolicyName, JitNetworkAccessPolicyInitiateRequest body) { - return initiateWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body, Context.NONE) - .getValue(); - } - - /** - * Policies for protecting resources using Just-in-Time access control. - * - * @throws ManagementException 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 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Policies for protecting resources using Just-in-Time access control. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-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)); - } - - /** - * Policies for protecting resources using Just-in-Time access control. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Policies for protecting resources using Just-in-Time access control. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Policies for protecting resources using Just-in-Time access control. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Policies for protecting resources using Just-in-Time access control. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @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 the response body 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 (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.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), apiVersion, - 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())); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @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 the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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 (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.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @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 the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @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 the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @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 the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @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 the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, 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 response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupAndRegionNextSinglePageAsync(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.listByResourceGroupAndRegionNext(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 the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupAndRegionNextSinglePageAsync(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.listByResourceGroupAndRegionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByRegionNextSinglePageAsync(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.listByRegionNext(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 the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByRegionNextSinglePageAsync(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.listByRegionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body 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 the response body 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)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @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( - context -> 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)) - .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 the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPoliciesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPoliciesImpl.java deleted file mode 100644 index bac8a095463c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPoliciesImpl.java +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.JitNetworkAccessPoliciesClient; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyInner; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicies; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicy; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateRequest; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequest; - -public final class JitNetworkAccessPoliciesImpl implements JitNetworkAccessPolicies { - private static final ClientLogger LOGGER = new ClientLogger(JitNetworkAccessPoliciesImpl.class); - - private final JitNetworkAccessPoliciesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public JitNetworkAccessPoliciesImpl(JitNetworkAccessPoliciesClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String ascLocation, - String jitNetworkAccessPolicyName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new JitNetworkAccessPolicyImpl(inner.getValue(), this.manager())); - } - - public JitNetworkAccessPolicy get(String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName) { - JitNetworkAccessPolicyInner inner - = this.serviceClient().get(resourceGroupName, ascLocation, jitNetworkAccessPolicyName); - if (inner != null) { - return new JitNetworkAccessPolicyImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String resourceGroupName, String ascLocation, - String jitNetworkAccessPolicyName, Context context) { - return this.serviceClient() - .deleteWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, context); - } - - public void delete(String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName) { - this.serviceClient().delete(resourceGroupName, ascLocation, jitNetworkAccessPolicyName); - } - - public PagedIterable listByResourceGroupAndRegion(String resourceGroupName, - String ascLocation) { - PagedIterable inner - = this.serviceClient().listByResourceGroupAndRegion(resourceGroupName, ascLocation); - return ResourceManagerUtils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroupAndRegion(String resourceGroupName, - String ascLocation, Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroupAndRegion(resourceGroupName, ascLocation, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); - } - - public PagedIterable listByRegion(String ascLocation) { - PagedIterable inner = this.serviceClient().listByRegion(ascLocation); - return ResourceManagerUtils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); - } - - public PagedIterable listByRegion(String ascLocation, Context context) { - PagedIterable inner = this.serviceClient().listByRegion(ascLocation, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); - } - - public Response initiateWithResponse(String resourceGroupName, String ascLocation, - String jitNetworkAccessPolicyName, JitNetworkAccessPolicyInitiateRequest body, Context context) { - Response inner = this.serviceClient() - .initiateWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new JitNetworkAccessRequestImpl(inner.getValue(), this.manager())); - } - - public JitNetworkAccessRequest initiate(String resourceGroupName, String ascLocation, - String jitNetworkAccessPolicyName, JitNetworkAccessPolicyInitiateRequest body) { - JitNetworkAccessRequestInner inner - = this.serviceClient().initiate(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body); - if (inner != null) { - return new JitNetworkAccessRequestImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); - } - - public JitNetworkAccessPolicy 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 ascLocation = ResourceManagerUtils.getValueFromIdByName(id, "locations"); - if (ascLocation == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); - } - String jitNetworkAccessPolicyName = ResourceManagerUtils.getValueFromIdByName(id, "jitNetworkAccessPolicies"); - if (jitNetworkAccessPolicyName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'jitNetworkAccessPolicies'.", id))); - } - return this.getWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, 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 ascLocation = ResourceManagerUtils.getValueFromIdByName(id, "locations"); - if (ascLocation == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); - } - String jitNetworkAccessPolicyName = ResourceManagerUtils.getValueFromIdByName(id, "jitNetworkAccessPolicies"); - if (jitNetworkAccessPolicyName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'jitNetworkAccessPolicies'.", id))); - } - return this.getWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, 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 ascLocation = ResourceManagerUtils.getValueFromIdByName(id, "locations"); - if (ascLocation == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); - } - String jitNetworkAccessPolicyName = ResourceManagerUtils.getValueFromIdByName(id, "jitNetworkAccessPolicies"); - if (jitNetworkAccessPolicyName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'jitNetworkAccessPolicies'.", id))); - } - this.deleteWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, Context.NONE); - } - - public Response 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 ascLocation = ResourceManagerUtils.getValueFromIdByName(id, "locations"); - if (ascLocation == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); - } - String jitNetworkAccessPolicyName = ResourceManagerUtils.getValueFromIdByName(id, "jitNetworkAccessPolicies"); - if (jitNetworkAccessPolicyName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'jitNetworkAccessPolicies'.", id))); - } - return this.deleteWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, context); - } - - private JitNetworkAccessPoliciesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public JitNetworkAccessPolicyImpl define(String name) { - return new JitNetworkAccessPolicyImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPolicyImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPolicyImpl.java deleted file mode 100644 index 99356480fb29..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPolicyImpl.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyInner; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicy; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyVirtualMachine; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequest; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class JitNetworkAccessPolicyImpl - implements JitNetworkAccessPolicy, JitNetworkAccessPolicy.Definition, JitNetworkAccessPolicy.Update { - private JitNetworkAccessPolicyInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String kind() { - return this.innerModel().kind(); - } - - public String location() { - return this.innerModel().location(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public List virtualMachines() { - List inner = this.innerModel().virtualMachines(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List requests() { - List inner = this.innerModel().requests(); - if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new JitNetworkAccessRequestImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public String provisioningState() { - return this.innerModel().provisioningState(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public JitNetworkAccessPolicyInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String ascLocation; - - private String jitNetworkAccessPolicyName; - - public JitNetworkAccessPolicyImpl withExistingLocation(String resourceGroupName, String ascLocation) { - this.resourceGroupName = resourceGroupName; - this.ascLocation = ascLocation; - return this; - } - - public JitNetworkAccessPolicy create() { - this.innerObject = serviceManager.serviceClient() - .getJitNetworkAccessPolicies() - .createOrUpdateWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public JitNetworkAccessPolicy create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getJitNetworkAccessPolicies() - .createOrUpdateWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, this.innerModel(), - context) - .getValue(); - return this; - } - - JitNetworkAccessPolicyImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new JitNetworkAccessPolicyInner(); - this.serviceManager = serviceManager; - this.jitNetworkAccessPolicyName = name; - } - - public JitNetworkAccessPolicyImpl update() { - return this; - } - - public JitNetworkAccessPolicy apply() { - this.innerObject = serviceManager.serviceClient() - .getJitNetworkAccessPolicies() - .createOrUpdateWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public JitNetworkAccessPolicy apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getJitNetworkAccessPolicies() - .createOrUpdateWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, this.innerModel(), - context) - .getValue(); - return this; - } - - JitNetworkAccessPolicyImpl(JitNetworkAccessPolicyInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.ascLocation = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "locations"); - this.jitNetworkAccessPolicyName - = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "jitNetworkAccessPolicies"); - } - - public JitNetworkAccessPolicy refresh() { - this.innerObject = serviceManager.serviceClient() - .getJitNetworkAccessPolicies() - .getWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, Context.NONE) - .getValue(); - return this; - } - - public JitNetworkAccessPolicy refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getJitNetworkAccessPolicies() - .getWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, context) - .getValue(); - return this; - } - - public JitNetworkAccessPolicyImpl withVirtualMachines(List virtualMachines) { - this.innerModel().withVirtualMachines(virtualMachines); - return this; - } - - public JitNetworkAccessPolicyImpl withKind(String kind) { - this.innerModel().withKind(kind); - return this; - } - - public JitNetworkAccessPolicyImpl withRequests(List requests) { - this.innerModel().withRequests(requests); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessRequestImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessRequestImpl.java deleted file mode 100644 index b69294b73900..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessRequestImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequest; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequestVirtualMachine; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class JitNetworkAccessRequestImpl implements JitNetworkAccessRequest { - private JitNetworkAccessRequestInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - JitNetworkAccessRequestImpl(JitNetworkAccessRequestInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List virtualMachines() { - List inner = this.innerModel().virtualMachines(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public OffsetDateTime startTimeUtc() { - return this.innerModel().startTimeUtc(); - } - - public String requestor() { - return this.innerModel().requestor(); - } - - public String justification() { - return this.innerModel().justification(); - } - - public JitNetworkAccessRequestInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/LocationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/LocationsClientImpl.java deleted file mode 100644 index 2f3ccb7830fe..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/LocationsClientImpl.java +++ /dev/null @@ -1,372 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.LocationsClient; -import com.azure.resourcemanager.security.fluent.models.AscLocationInner; -import com.azure.resourcemanager.security.implementation.models.AscLocationList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in LocationsClient. - */ -public final class LocationsClientImpl implements LocationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final LocationsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of LocationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LocationsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(LocationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterLocations to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterLocations") - public interface LocationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String ascLocation) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - ascLocation, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String ascLocation, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), ascLocation, accept, - context); - } - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String ascLocation) { - return getWithResponseAsync(ascLocation).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String ascLocation, Context context) { - return getWithResponseAsync(ascLocation, context).block(); - } - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AscLocationInner get(String ascLocation) { - return getWithResponse(ascLocation, Context.NONE).getValue(); - } - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their ID. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their 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 list of locations where ASC saves your data 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - 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)); - } - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their ID. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their 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 list of locations where ASC saves your data as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their ID. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their 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 list of locations where ASC saves your data 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 list of locations where ASC saves your data 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 list of locations where ASC saves your data 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/LocationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/LocationsImpl.java deleted file mode 100644 index 13ad46e8b724..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/LocationsImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.LocationsClient; -import com.azure.resourcemanager.security.fluent.models.AscLocationInner; -import com.azure.resourcemanager.security.models.AscLocation; -import com.azure.resourcemanager.security.models.Locations; - -public final class LocationsImpl implements Locations { - private static final ClientLogger LOGGER = new ClientLogger(LocationsImpl.class); - - private final LocationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public LocationsImpl(LocationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String ascLocation, Context context) { - Response inner = this.serviceClient().getWithResponse(ascLocation, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AscLocationImpl(inner.getValue(), this.manager())); - } - - public AscLocation get(String ascLocation) { - AscLocationInner inner = this.serviceClient().get(ascLocation); - if (inner != null) { - return new AscLocationImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AscLocationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new AscLocationImpl(inner1, this.manager())); - } - - private LocationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MalwareScanImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MalwareScanImpl.java deleted file mode 100644 index 29abe0a4f159..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MalwareScanImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.MalwareScanInner; -import com.azure.resourcemanager.security.models.MalwareScan; -import com.azure.resourcemanager.security.models.MalwareScanProperties; - -public final class MalwareScanImpl implements MalwareScan { - private MalwareScanInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - MalwareScanImpl(MalwareScanInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public MalwareScanProperties properties() { - return this.innerModel().properties(); - } - - public MalwareScanInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataImpl.java deleted file mode 100644 index 49edf07ea707..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner; -import com.azure.resourcemanager.security.models.MdeOnboardingData; - -public final class MdeOnboardingDataImpl implements MdeOnboardingData { - private MdeOnboardingDataInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - MdeOnboardingDataImpl(MdeOnboardingDataInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public byte[] onboardingPackageWindows() { - return this.innerModel().onboardingPackageWindows(); - } - - public byte[] onboardingPackageLinux() { - return this.innerModel().onboardingPackageLinux(); - } - - public MdeOnboardingDataInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataListImpl.java deleted file mode 100644 index e90e1ef2e762..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataListImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataListInner; -import com.azure.resourcemanager.security.models.MdeOnboardingData; -import com.azure.resourcemanager.security.models.MdeOnboardingDataList; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class MdeOnboardingDataListImpl implements MdeOnboardingDataList { - private MdeOnboardingDataListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - MdeOnboardingDataListImpl(MdeOnboardingDataListInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new MdeOnboardingDataImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public MdeOnboardingDataListInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsClientImpl.java deleted file mode 100644 index 8b94505bc560..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsClientImpl.java +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.MdeOnboardingsClient; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataListInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in MdeOnboardingsClient. - */ -public final class MdeOnboardingsClientImpl implements MdeOnboardingsClient { - /** - * The proxy service used to perform REST calls. - */ - private final MdeOnboardingsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of MdeOnboardingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - MdeOnboardingsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(MdeOnboardingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterMdeOnboardings to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterMdeOnboardings") - public interface MdeOnboardingsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings/default") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * The default configuration or data needed to onboard the machine to MDE. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource of the configuration or data needed to onboard the machine to MDE along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync() { - 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 = "2021-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The default configuration or data needed to onboard the machine to MDE. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource of the configuration or data needed to onboard the machine to MDE along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(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 = "2021-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * The default configuration or data needed to onboard the machine to MDE. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource of the configuration or data needed to onboard the machine to MDE on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync() { - return getWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * The default configuration or data needed to onboard the machine to MDE. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource of the configuration or data needed to onboard the machine to MDE along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(Context context) { - return getWithResponseAsync(context).block(); - } - - /** - * The default configuration or data needed to onboard the machine to MDE. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource of the configuration or data needed to onboard the machine to MDE. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MdeOnboardingDataInner get() { - return getWithResponse(Context.NONE).getValue(); - } - - /** - * The configuration or data needed to onboard the machine to MDE. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all MDE onboarding data resources along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync() { - 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 = "2021-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The configuration or data needed to onboard the machine to MDE. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all MDE onboarding data resources 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * The configuration or data needed to onboard the machine to MDE. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all MDE onboarding data resources on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { - return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * The configuration or data needed to onboard the machine to MDE. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all MDE onboarding data resources along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); - } - - /** - * The configuration or data needed to onboard the machine to MDE. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all MDE onboarding data resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MdeOnboardingDataListInner list() { - return listWithResponse(Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsImpl.java deleted file mode 100644 index d5840f957b7c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.MdeOnboardingsClient; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataListInner; -import com.azure.resourcemanager.security.models.MdeOnboardingData; -import com.azure.resourcemanager.security.models.MdeOnboardingDataList; -import com.azure.resourcemanager.security.models.MdeOnboardings; - -public final class MdeOnboardingsImpl implements MdeOnboardings { - private static final ClientLogger LOGGER = new ClientLogger(MdeOnboardingsImpl.class); - - private final MdeOnboardingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public MdeOnboardingsImpl(MdeOnboardingsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(Context context) { - Response inner = this.serviceClient().getWithResponse(context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new MdeOnboardingDataImpl(inner.getValue(), this.manager())); - } - - public MdeOnboardingData get() { - MdeOnboardingDataInner inner = this.serviceClient().get(); - if (inner != null) { - return new MdeOnboardingDataImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listWithResponse(Context context) { - Response inner = this.serviceClient().listWithResponse(context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new MdeOnboardingDataListImpl(inner.getValue(), this.manager())); - } - - public MdeOnboardingDataList list() { - MdeOnboardingDataListInner inner = this.serviceClient().list(); - if (inner != null) { - return new MdeOnboardingDataListImpl(inner, this.manager()); - } else { - return null; - } - } - - private MdeOnboardingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationImpl.java deleted file mode 100644 index 62473d270246..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.OperationInner; -import com.azure.resourcemanager.security.models.ArmActionType; -import com.azure.resourcemanager.security.models.Operation; -import com.azure.resourcemanager.security.models.OperationDisplay; -import com.azure.resourcemanager.security.models.Origin; - -public final class OperationImpl implements Operation { - private OperationInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - OperationImpl(OperationInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public Boolean isDataAction() { - return this.innerModel().isDataAction(); - } - - public OperationDisplay display() { - return this.innerModel().display(); - } - - public Origin origin() { - return this.innerModel().origin(); - } - - public ArmActionType actionType() { - return this.innerModel().actionType(); - } - - public OperationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultImpl.java deleted file mode 100644 index cb8ee70f1a7d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.OperationResultInner; -import com.azure.resourcemanager.security.models.OperationResult; -import com.azure.resourcemanager.security.models.OperationResultStatus; - -public final class OperationResultImpl implements OperationResult { - private OperationResultInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - OperationResultImpl(OperationResultInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public OperationResultStatus status() { - return this.innerModel().status(); - } - - public OperationResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultsClientImpl.java deleted file mode 100644 index 03da4460edc7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultsClientImpl.java +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -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.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.OperationResultsClient; -import com.azure.resourcemanager.security.models.OperationResultsGetResponse; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in OperationResultsClient. - */ -public final class OperationResultsClientImpl implements OperationResultsClient { - /** - * The proxy service used to perform REST calls. - */ - private final OperationResultsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of OperationResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationResultsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(OperationResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterOperationResults to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterOperationResults") - public interface OperationResultsService { - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{location}/operationResults/{operationId}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @PathParam("operationId") String operationId, Context context); - } - - /** - * Returns operation results for long running operations. - * - * @param location The name of the Azure region. - * @param operationId The ID of an ongoing async operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 getWithResponseAsync(String location, String operationId) { - 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 (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location 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 = "2025-10-01-preview"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - location, operationId, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns operation results for long running operations. - * - * @param location The name of the Azure region. - * @param operationId The ID of an ongoing async operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getWithResponseAsync(String location, String operationId, - 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 (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location 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 = "2025-10-01-preview"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), location, - operationId, context); - } - - /** - * Returns operation results for long running operations. - * - * @param location The name of the Azure region. - * @param operationId The ID of an ongoing async operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 getAsync(String location, String operationId) { - return getWithResponseAsync(location, operationId).flatMap(ignored -> Mono.empty()); - } - - /** - * Returns operation results for long running operations. - * - * @param location The name of the Azure region. - * @param operationId The ID of an ongoing async operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationResultsGetResponse getWithResponse(String location, String operationId, Context context) { - return getWithResponseAsync(location, operationId, context).block(); - } - - /** - * Returns operation results for long running operations. - * - * @param location The name of the Azure region. - * @param operationId The ID of an ongoing async operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void get(String location, String operationId) { - getWithResponse(location, operationId, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultsImpl.java deleted file mode 100644 index 3be3a635d2b5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultsImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.OperationResultsClient; -import com.azure.resourcemanager.security.models.OperationResults; -import com.azure.resourcemanager.security.models.OperationResultsGetResponse; - -public final class OperationResultsImpl implements OperationResults { - private static final ClientLogger LOGGER = new ClientLogger(OperationResultsImpl.class); - - private final OperationResultsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public OperationResultsImpl(OperationResultsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public OperationResultsGetResponse getWithResponse(String location, String operationId, Context context) { - return this.serviceClient().getWithResponse(location, operationId, context); - } - - public void get(String location, String operationId) { - this.serviceClient().get(location, operationId); - } - - private OperationResultsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationStatusResultImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationStatusResultImpl.java deleted file mode 100644 index df5f5f2488b4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationStatusResultImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.security.fluent.models.OperationStatusResultInner; -import com.azure.resourcemanager.security.models.OperationStatusResult; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class OperationStatusResultImpl implements OperationStatusResult { - private OperationStatusResultInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - OperationStatusResultImpl(OperationStatusResultInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String status() { - return this.innerModel().status(); - } - - public Double percentComplete() { - return this.innerModel().percentComplete(); - } - - public OffsetDateTime startTime() { - return this.innerModel().startTime(); - } - - public OffsetDateTime endTime() { - return this.innerModel().endTime(); - } - - public List operations() { - List inner = this.innerModel().operations(); - if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new OperationStatusResultImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public ManagementError error() { - return this.innerModel().error(); - } - - public String resourceId() { - return this.innerModel().resourceId(); - } - - public OperationStatusResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationStatusesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationStatusesClientImpl.java deleted file mode 100644 index e467185a55ca..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationStatusesClientImpl.java +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.OperationStatusesClient; -import com.azure.resourcemanager.security.fluent.models.OperationStatusResultInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in OperationStatusesClient. - */ -public final class OperationStatusesClientImpl implements OperationStatusesClient { - /** - * The proxy service used to perform REST calls. - */ - private final OperationStatusesService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of OperationStatusesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationStatusesClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(OperationStatusesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterOperationStatuses to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterOperationStatuses") - public interface OperationStatusesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{location}/operationStatuses/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get the status of a long running azure asynchronous operation. - * - * @param location The name of the Azure region. - * @param operationId The ID of an ongoing async operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 operationId) { - 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 (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location 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 = "2025-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - location, operationId, 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 name of the Azure region. - * @param operationId The ID of an ongoing async operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the 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 operationId, - 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 (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location 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 = "2025-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), location, - operationId, accept, context); - } - - /** - * Get the status of a long running azure asynchronous operation. - * - * @param location The name of the Azure region. - * @param operationId The ID of an ongoing async operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String location, String operationId) { - return getWithResponseAsync(location, operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the status of a long running azure asynchronous operation. - * - * @param location The name of the Azure region. - * @param operationId The ID of an ongoing async operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a long running azure asynchronous operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String location, String operationId, Context context) { - return getWithResponseAsync(location, operationId, context).block(); - } - - /** - * Get the status of a long running azure asynchronous operation. - * - * @param location The name of the Azure region. - * @param operationId The ID of an ongoing async operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusResultInner get(String location, String operationId) { - return getWithResponse(location, operationId, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationStatusesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationStatusesImpl.java deleted file mode 100644 index a26f095d4bce..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationStatusesImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.OperationStatusesClient; -import com.azure.resourcemanager.security.fluent.models.OperationStatusResultInner; -import com.azure.resourcemanager.security.models.OperationStatusResult; -import com.azure.resourcemanager.security.models.OperationStatuses; - -public final class OperationStatusesImpl implements OperationStatuses { - private static final ClientLogger LOGGER = new ClientLogger(OperationStatusesImpl.class); - - private final OperationStatusesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public OperationStatusesImpl(OperationStatusesClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String location, String operationId, Context context) { - Response inner - = this.serviceClient().getWithResponse(location, operationId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationStatusResultImpl(inner.getValue(), this.manager())); - } - - public OperationStatusResult get(String location, String operationId) { - OperationStatusResultInner inner = this.serviceClient().get(location, operationId); - if (inner != null) { - return new OperationStatusResultImpl(inner, this.manager()); - } else { - return null; - } - } - - private OperationStatusesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsClientImpl.java deleted file mode 100644 index 4168b8a404e1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.OperationsClient; -import com.azure.resourcemanager.security.fluent.models.OperationInner; -import com.azure.resourcemanager.security.implementation.models.OperationListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in OperationsClient. - */ -public final class OperationsClientImpl implements OperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final OperationsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterOperations to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterOperations") - public interface OperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Security/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Exposes all available operations for discovery purposes. - * - * @throws 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 REST API operations supported by an Azure Resource Provider 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 = "2025-10-01-preview"; - 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())); - } - - /** - * Exposes all available operations for discovery purposes. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 REST API operations supported by an Azure Resource Provider 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 = "2025-10-01-preview"; - 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)); - } - - /** - * Exposes all available operations for discovery purposes. - * - * @throws 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 REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Exposes all available operations for discovery purposes. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Exposes all available operations for discovery purposes. - * - * @throws 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 REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Exposes all available operations for discovery purposes. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 REST API operations supported by an Azure Resource Provider 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 a list of REST API operations supported by an Azure Resource Provider 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 a list of REST API operations supported by an Azure Resource Provider 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsImpl.java deleted file mode 100644 index 1cbeee618b7f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.OperationsClient; -import com.azure.resourcemanager.security.fluent.models.OperationInner; -import com.azure.resourcemanager.security.models.Operation; -import com.azure.resourcemanager.security.models.Operations; - -public final class OperationsImpl implements Operations { - private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); - - private final OperationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public OperationsImpl(OperationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - private OperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingImpl.java deleted file mode 100644 index 6eb82bef6d71..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingImpl.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.PricingInner; -import com.azure.resourcemanager.security.models.Enforce; -import com.azure.resourcemanager.security.models.Extension; -import com.azure.resourcemanager.security.models.Inherited; -import com.azure.resourcemanager.security.models.Pricing; -import com.azure.resourcemanager.security.models.PricingTier; -import com.azure.resourcemanager.security.models.ResourcesCoverageStatus; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class PricingImpl implements Pricing { - private PricingInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - PricingImpl(PricingInner innerObject, com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public PricingTier pricingTier() { - return this.innerModel().pricingTier(); - } - - public String subPlan() { - return this.innerModel().subPlan(); - } - - public Duration freeTrialRemainingTime() { - return this.innerModel().freeTrialRemainingTime(); - } - - public OffsetDateTime enablementTime() { - return this.innerModel().enablementTime(); - } - - public Enforce enforce() { - return this.innerModel().enforce(); - } - - public Inherited inherited() { - return this.innerModel().inherited(); - } - - public String inheritedFrom() { - return this.innerModel().inheritedFrom(); - } - - public ResourcesCoverageStatus resourcesCoverageStatus() { - return this.innerModel().resourcesCoverageStatus(); - } - - public List extensions() { - List inner = this.innerModel().extensions(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Boolean deprecated() { - return this.innerModel().deprecated(); - } - - public List replacedBy() { - List inner = this.innerModel().replacedBy(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public PricingInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingListImpl.java deleted file mode 100644 index 31495e87359d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingListImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.PricingInner; -import com.azure.resourcemanager.security.fluent.models.PricingListInner; -import com.azure.resourcemanager.security.models.Pricing; -import com.azure.resourcemanager.security.models.PricingList; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class PricingListImpl implements PricingList { - private PricingListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - PricingListImpl(PricingListInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList( - inner.stream().map(inner1 -> new PricingImpl(inner1, this.manager())).collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public PricingListInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingsClientImpl.java deleted file mode 100644 index c9cf8981651a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingsClientImpl.java +++ /dev/null @@ -1,578 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.PricingsClient; -import com.azure.resourcemanager.security.fluent.models.PricingInner; -import com.azure.resourcemanager.security.fluent.models.PricingListInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in PricingsClient. - */ -public final class PricingsClientImpl implements PricingsClient { - /** - * The proxy service used to perform REST calls. - */ - private final PricingsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of PricingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PricingsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(PricingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterPricings to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterPricings") - public interface PricingsService { - @Headers({ "Content-Type: application/json" }) - @Get("/{scopeId}/providers/Microsoft.Security/pricings/{pricingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scopeId", encoded = true) String scopeId, - @PathParam("pricingName") String pricingName, @HeaderParam("Accept") String accept, Context context); - - @Put("/{scopeId}/providers/Microsoft.Security/pricings/{pricingName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scopeId", encoded = true) String scopeId, - @PathParam("pricingName") String pricingName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") PricingInner pricing, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/{scopeId}/providers/Microsoft.Security/pricings/{pricingName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scopeId", encoded = true) String scopeId, - @PathParam("pricingName") String pricingName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scopeId}/providers/Microsoft.Security/pricings") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scopeId", encoded = true) String scopeId, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a - * subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'. - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param pricingName name of the pricing 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 Defender plans pricing configurations of the selected scope (valid scopes are resource id or a - * subscription id) along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scopeId, String pricingName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scopeId == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeId is required and cannot be null.")); - } - if (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - final String apiVersion = "2024-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), apiVersion, scopeId, pricingName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a - * subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'. - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param pricingName name of the pricing 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 Defender plans pricing configurations of the selected scope (valid scopes are resource id or a - * subscription id) along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scopeId, String pricingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scopeId == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeId is required and cannot be null.")); - } - if (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - final String apiVersion = "2024-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scopeId, pricingName, accept, context); - } - - /** - * Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a - * subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'. - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param pricingName name of the pricing 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 Defender plans pricing configurations of the selected scope (valid scopes are resource id or a - * subscription id) on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scopeId, String pricingName) { - return getWithResponseAsync(scopeId, pricingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a - * subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'. - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param pricingName name of the pricing 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 Defender plans pricing configurations of the selected scope (valid scopes are resource id or a - * subscription id) along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scopeId, String pricingName, Context context) { - return getWithResponseAsync(scopeId, pricingName, context).block(); - } - - /** - * Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a - * subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'. - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param pricingName name of the pricing 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 Defender plans pricing configurations of the selected scope (valid scopes are resource id or a - * subscription id). - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PricingInner get(String scopeId, String pricingName) { - return getWithResponse(scopeId, pricingName, Context.NONE).getValue(); - } - - /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the scope. Valid scopes are: - * subscription id or a specific resource id (Supported resources are: 'VirtualMachines, VMSS and ARC Machines' and - * only for plan='VirtualMachines' and subPlan='P1'). - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param pricingName name of the pricing configuration. - * @param pricing Pricing object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return microsoft Defender for Cloud is provided in two pricing tiers: free and standard along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String scopeId, String pricingName, - PricingInner pricing) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scopeId == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeId is required and cannot be null.")); - } - if (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (pricing == null) { - return Mono.error(new IllegalArgumentException("Parameter pricing is required and cannot be null.")); - } else { - pricing.validate(); - } - final String apiVersion = "2024-01-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, scopeId, pricingName, - contentType, accept, pricing, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the scope. Valid scopes are: - * subscription id or a specific resource id (Supported resources are: 'VirtualMachines, VMSS and ARC Machines' and - * only for plan='VirtualMachines' and subPlan='P1'). - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param pricingName name of the pricing configuration. - * @param pricing Pricing object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return microsoft Defender for Cloud is provided in two pricing tiers: free and standard along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String scopeId, String pricingName, - PricingInner pricing, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scopeId == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeId is required and cannot be null.")); - } - if (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (pricing == null) { - return Mono.error(new IllegalArgumentException("Parameter pricing is required and cannot be null.")); - } else { - pricing.validate(); - } - final String apiVersion = "2024-01-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, scopeId, pricingName, contentType, accept, pricing, - context); - } - - /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the scope. Valid scopes are: - * subscription id or a specific resource id (Supported resources are: 'VirtualMachines, VMSS and ARC Machines' and - * only for plan='VirtualMachines' and subPlan='P1'). - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param pricingName name of the pricing configuration. - * @param pricing Pricing object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return microsoft Defender for Cloud is provided in two pricing tiers: free and standard on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String scopeId, String pricingName, PricingInner pricing) { - return updateWithResponseAsync(scopeId, pricingName, pricing).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the scope. Valid scopes are: - * subscription id or a specific resource id (Supported resources are: 'VirtualMachines, VMSS and ARC Machines' and - * only for plan='VirtualMachines' and subPlan='P1'). - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param pricingName name of the pricing configuration. - * @param pricing Pricing object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return microsoft Defender for Cloud is provided in two pricing tiers: free and standard along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String scopeId, String pricingName, PricingInner pricing, - Context context) { - return updateWithResponseAsync(scopeId, pricingName, pricing, context).block(); - } - - /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the scope. Valid scopes are: - * subscription id or a specific resource id (Supported resources are: 'VirtualMachines, VMSS and ARC Machines' and - * only for plan='VirtualMachines' and subPlan='P1'). - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param pricingName name of the pricing configuration. - * @param pricing Pricing object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return microsoft Defender for Cloud is provided in two pricing tiers: free and standard. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PricingInner update(String scopeId, String pricingName, PricingInner pricing) { - return updateWithResponse(scopeId, pricingName, pricing, Context.NONE).getValue(); - } - - /** - * Deletes a provided Microsoft Defender for Cloud pricing configuration in a specific resource. Valid only for - * resource scope (Supported resources are: 'VirtualMachines, VMSS, ARC Machines, and Containers'). - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param pricingName name of the pricing 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> deleteWithResponseAsync(String scopeId, String pricingName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scopeId == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeId is required and cannot be null.")); - } - if (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - final String apiVersion = "2024-01-01"; - return FluxUtil - .withContext( - context -> service.delete(this.client.getEndpoint(), apiVersion, scopeId, pricingName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a provided Microsoft Defender for Cloud pricing configuration in a specific resource. Valid only for - * resource scope (Supported resources are: 'VirtualMachines, VMSS, ARC Machines, and Containers'). - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param pricingName name of the pricing 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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String scopeId, String pricingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scopeId == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeId is required and cannot be null.")); - } - if (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - final String apiVersion = "2024-01-01"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, scopeId, pricingName, context); - } - - /** - * Deletes a provided Microsoft Defender for Cloud pricing configuration in a specific resource. Valid only for - * resource scope (Supported resources are: 'VirtualMachines, VMSS, ARC Machines, and Containers'). - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param pricingName name of the pricing 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 deleteAsync(String scopeId, String pricingName) { - return deleteWithResponseAsync(scopeId, pricingName).flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes a provided Microsoft Defender for Cloud pricing configuration in a specific resource. Valid only for - * resource scope (Supported resources are: 'VirtualMachines, VMSS, ARC Machines, and Containers'). - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param pricingName name of the pricing 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 Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String scopeId, String pricingName, Context context) { - return deleteWithResponseAsync(scopeId, pricingName, context).block(); - } - - /** - * Deletes a provided Microsoft Defender for Cloud pricing configuration in a specific resource. Valid only for - * resource scope (Supported resources are: 'VirtualMachines, VMSS, ARC Machines, and Containers'). - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param pricingName name of the pricing 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 delete(String scopeId, String pricingName) { - deleteWithResponse(scopeId, pricingName, Context.NONE); - } - - /** - * Lists Microsoft Defender for Cloud pricing configurations of the scopeId, that match the optional given $filter. - * Valid scopes are: subscription id or a specific resource id (Supported resources are: 'VirtualMachines, VMSS and - * ARC Machines'). Valid $filter is: 'name in ({planName1},{planName2},...)'. If $filter is not provided, the - * unfiltered list will be returned. If '$filter=name in (planName1,planName2)' is provided, the returned list - * includes the pricings set for 'planName1' and 'planName2' only. - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of pricing configurations response along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String scopeId, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scopeId == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeId is required and cannot be null.")); - } - final String apiVersion = "2024-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), apiVersion, scopeId, filter, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists Microsoft Defender for Cloud pricing configurations of the scopeId, that match the optional given $filter. - * Valid scopes are: subscription id or a specific resource id (Supported resources are: 'VirtualMachines, VMSS and - * ARC Machines'). Valid $filter is: 'name in ({planName1},{planName2},...)'. If $filter is not provided, the - * unfiltered list will be returned. If '$filter=name in (planName1,planName2)' is provided, the returned list - * includes the pricings set for 'planName1' and 'planName2' only. - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of pricing configurations response along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String scopeId, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scopeId == null) { - return Mono.error(new IllegalArgumentException("Parameter scopeId is required and cannot be null.")); - } - final String apiVersion = "2024-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scopeId, filter, accept, context); - } - - /** - * Lists Microsoft Defender for Cloud pricing configurations of the scopeId, that match the optional given $filter. - * Valid scopes are: subscription id or a specific resource id (Supported resources are: 'VirtualMachines, VMSS and - * ARC Machines'). Valid $filter is: 'name in ({planName1},{planName2},...)'. If $filter is not provided, the - * unfiltered list will be returned. If '$filter=name in (planName1,planName2)' is provided, the returned list - * includes the pricings set for 'planName1' and 'planName2' only. - * - * @param scopeId The fully qualified Azure Resource manager identifier of the 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 list of pricing configurations response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String scopeId) { - final String filter = null; - return listWithResponseAsync(scopeId, filter).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Lists Microsoft Defender for Cloud pricing configurations of the scopeId, that match the optional given $filter. - * Valid scopes are: subscription id or a specific resource id (Supported resources are: 'VirtualMachines, VMSS and - * ARC Machines'). Valid $filter is: 'name in ({planName1},{planName2},...)'. If $filter is not provided, the - * unfiltered list will be returned. If '$filter=name in (planName1,planName2)' is provided, the returned list - * includes the pricings set for 'planName1' and 'planName2' only. - * - * @param scopeId The fully qualified Azure Resource manager identifier of the resource. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of pricing configurations response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String scopeId, String filter, Context context) { - return listWithResponseAsync(scopeId, filter, context).block(); - } - - /** - * Lists Microsoft Defender for Cloud pricing configurations of the scopeId, that match the optional given $filter. - * Valid scopes are: subscription id or a specific resource id (Supported resources are: 'VirtualMachines, VMSS and - * ARC Machines'). Valid $filter is: 'name in ({planName1},{planName2},...)'. If $filter is not provided, the - * unfiltered list will be returned. If '$filter=name in (planName1,planName2)' is provided, the returned list - * includes the pricings set for 'planName1' and 'planName2' only. - * - * @param scopeId The fully qualified Azure Resource manager identifier of the 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 list of pricing configurations response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PricingListInner list(String scopeId) { - final String filter = null; - return listWithResponse(scopeId, filter, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingsImpl.java deleted file mode 100644 index ef874da03092..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingsImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.PricingsClient; -import com.azure.resourcemanager.security.fluent.models.PricingInner; -import com.azure.resourcemanager.security.fluent.models.PricingListInner; -import com.azure.resourcemanager.security.models.Pricing; -import com.azure.resourcemanager.security.models.PricingList; -import com.azure.resourcemanager.security.models.Pricings; - -public final class PricingsImpl implements Pricings { - private static final ClientLogger LOGGER = new ClientLogger(PricingsImpl.class); - - private final PricingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public PricingsImpl(PricingsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String scopeId, String pricingName, Context context) { - Response inner = this.serviceClient().getWithResponse(scopeId, pricingName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PricingImpl(inner.getValue(), this.manager())); - } - - public Pricing get(String scopeId, String pricingName) { - PricingInner inner = this.serviceClient().get(scopeId, pricingName); - if (inner != null) { - return new PricingImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response updateWithResponse(String scopeId, String pricingName, PricingInner pricing, - Context context) { - Response inner = this.serviceClient().updateWithResponse(scopeId, pricingName, pricing, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PricingImpl(inner.getValue(), this.manager())); - } - - public Pricing update(String scopeId, String pricingName, PricingInner pricing) { - PricingInner inner = this.serviceClient().update(scopeId, pricingName, pricing); - if (inner != null) { - return new PricingImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse(String scopeId, String pricingName, Context context) { - return this.serviceClient().deleteWithResponse(scopeId, pricingName, context); - } - - public void deleteByResourceGroup(String scopeId, String pricingName) { - this.serviceClient().delete(scopeId, pricingName); - } - - public Response listWithResponse(String scopeId, String filter, Context context) { - Response inner = this.serviceClient().listWithResponse(scopeId, filter, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PricingListImpl(inner.getValue(), this.manager())); - } - - public PricingList list(String scopeId) { - PricingListInner inner = this.serviceClient().list(scopeId); - if (inner != null) { - return new PricingListImpl(inner, this.manager()); - } else { - return null; - } - } - - private PricingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateEndpointConnectionImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateEndpointConnectionImpl.java deleted file mode 100644 index bade8c8ba7dd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateEndpointConnectionImpl.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.security.models.PrivateEndpoint; -import com.azure.resourcemanager.security.models.PrivateEndpointConnection; -import com.azure.resourcemanager.security.models.PrivateEndpointConnectionProvisioningState; -import com.azure.resourcemanager.security.models.PrivateLinkServiceConnectionState; -import java.util.Collections; -import java.util.List; - -public final class PrivateEndpointConnectionImpl - implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { - private PrivateEndpointConnectionInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager 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 List groupIds() { - List inner = this.innerModel().groupIds(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public PrivateEndpoint privateEndpoint() { - return this.innerModel().privateEndpoint(); - } - - public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { - return this.innerModel().privateLinkServiceConnectionState(); - } - - public PrivateEndpointConnectionProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public PrivateEndpointConnectionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String privateLinkName; - - private String privateEndpointConnectionName; - - public PrivateEndpointConnectionImpl withExistingPrivateLink(String resourceGroupName, String privateLinkName) { - this.resourceGroupName = resourceGroupName; - this.privateLinkName = privateLinkName; - return this; - } - - public PrivateEndpointConnection create() { - this.innerObject = serviceManager.serviceClient() - .getPrivateEndpointConnections() - .createOrUpdate(resourceGroupName, privateLinkName, privateEndpointConnectionName, this.innerModel(), - Context.NONE); - return this; - } - - public PrivateEndpointConnection create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getPrivateEndpointConnections() - .createOrUpdate(resourceGroupName, privateLinkName, privateEndpointConnectionName, this.innerModel(), - context); - return this; - } - - PrivateEndpointConnectionImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new PrivateEndpointConnectionInner(); - this.serviceManager = serviceManager; - this.privateEndpointConnectionName = name; - } - - public PrivateEndpointConnectionImpl update() { - return this; - } - - public PrivateEndpointConnection apply() { - this.innerObject = serviceManager.serviceClient() - .getPrivateEndpointConnections() - .createOrUpdate(resourceGroupName, privateLinkName, privateEndpointConnectionName, this.innerModel(), - Context.NONE); - return this; - } - - public PrivateEndpointConnection apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getPrivateEndpointConnections() - .createOrUpdate(resourceGroupName, privateLinkName, privateEndpointConnectionName, this.innerModel(), - context); - return this; - } - - PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.privateLinkName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateLinks"); - this.privateEndpointConnectionName - = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateEndpointConnections"); - } - - public PrivateEndpointConnection refresh() { - this.innerObject = serviceManager.serviceClient() - .getPrivateEndpointConnections() - .getWithResponse(resourceGroupName, privateLinkName, privateEndpointConnectionName, Context.NONE) - .getValue(); - return this; - } - - public PrivateEndpointConnection refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getPrivateEndpointConnections() - .getWithResponse(resourceGroupName, privateLinkName, privateEndpointConnectionName, context) - .getValue(); - return this; - } - - public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - this.innerModel().withPrivateEndpoint(privateEndpoint); - return this; - } - - public PrivateEndpointConnectionImpl - withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { - this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateEndpointConnectionsClientImpl.java deleted file mode 100644 index 02e224e8a5d5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateEndpointConnectionsClientImpl.java +++ /dev/null @@ -1,1061 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.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.security.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.security.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.security.implementation.models.PrivateEndpointConnectionListResult; -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 PrivateEndpointConnectionsClient. - */ -public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final PrivateEndpointConnectionsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of PrivateEndpointConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateEndpointConnectionsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterPrivateEndpointConnections to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterPrivateEndpointConnections") - public interface PrivateEndpointConnectionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/privateLinks/{privateLinkName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateLinkName") String privateLinkName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/privateLinks/{privateLinkName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateLinkName") String privateLinkName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") PrivateEndpointConnectionInner privateEndpointConnection, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/privateLinks/{privateLinkName}/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateLinkName") String privateLinkName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/privateLinks/{privateLinkName}/privateEndpointConnections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateLinkName") String privateLinkName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the specified private endpoint connection associated with the private link. Returns the connection details, - * status, and configuration for a specific private endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * 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 specified private endpoint connection associated with the private link along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String privateLinkName, String privateEndpointConnectionName) { - 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String apiVersion = "2026-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, privateLinkName, privateEndpointConnectionName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the specified private endpoint connection associated with the private link. Returns the connection details, - * status, and configuration for a specific private endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * 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 specified private endpoint connection associated with the private link along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String privateLinkName, String privateEndpointConnectionName, 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String apiVersion = "2026-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - privateLinkName, privateEndpointConnectionName, accept, context); - } - - /** - * Gets the specified private endpoint connection associated with the private link. Returns the connection details, - * status, and configuration for a specific private endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * 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 specified private endpoint connection associated with the private link on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName) { - return getWithResponseAsync(resourceGroupName, privateLinkName, privateEndpointConnectionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the specified private endpoint connection associated with the private link. Returns the connection details, - * status, and configuration for a specific private endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * 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 specified private endpoint connection associated with the private link along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName, Context context) { - return getWithResponseAsync(resourceGroupName, privateLinkName, privateEndpointConnectionName, context).block(); - } - - /** - * Gets the specified private endpoint connection associated with the private link. Returns the connection details, - * status, and configuration for a specific private endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * 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 specified private endpoint connection associated with the private link. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner get(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName) { - return getWithResponse(resourceGroupName, privateLinkName, privateEndpointConnectionName, Context.NONE) - .getValue(); - } - - /** - * Update the state of specified private endpoint connection associated with the private link. This operation is - * typically used to approve or reject pending private endpoint connections. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param privateEndpointConnection The private endpoint connection 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 private endpoint connection resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String privateLinkName, String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection) { - 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (privateEndpointConnection == null) { - return Mono.error( - new IllegalArgumentException("Parameter privateEndpointConnection is required and cannot be null.")); - } else { - privateEndpointConnection.validate(); - } - final String apiVersion = "2026-01-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, privateLinkName, privateEndpointConnectionName, - contentType, accept, privateEndpointConnection, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the state of specified private endpoint connection associated with the private link. This operation is - * typically used to approve or reject pending private endpoint connections. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param privateEndpointConnection The private endpoint connection 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 private endpoint connection resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String privateLinkName, String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection, 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (privateEndpointConnection == null) { - return Mono.error( - new IllegalArgumentException("Parameter privateEndpointConnection is required and cannot be null.")); - } else { - privateEndpointConnection.validate(); - } - final String apiVersion = "2026-01-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, privateLinkName, privateEndpointConnectionName, contentType, accept, - privateEndpointConnection, context); - } - - /** - * Update the state of specified private endpoint connection associated with the private link. This operation is - * typically used to approve or reject pending private endpoint connections. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param privateEndpointConnection The private endpoint connection 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 PollerFlux} for polling of the private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, PrivateEndpointConnectionInner> - beginCreateOrUpdateAsync(String resourceGroupName, String privateLinkName, String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, privateLinkName, - privateEndpointConnectionName, privateEndpointConnection); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, - this.client.getContext()); - } - - /** - * Update the state of specified private endpoint connection associated with the private link. This operation is - * typically used to approve or reject pending private endpoint connections. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param privateEndpointConnection The private endpoint connection 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 PollerFlux} for polling of the private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, PrivateEndpointConnectionInner> - beginCreateOrUpdateAsync(String resourceGroupName, String privateLinkName, String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, privateLinkName, - privateEndpointConnectionName, privateEndpointConnection, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, - context); - } - - /** - * Update the state of specified private endpoint connection associated with the private link. This operation is - * typically used to approve or reject pending private endpoint connections. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param privateEndpointConnection The private endpoint connection 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 SyncPoller} for polling of the private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( - String resourceGroupName, String privateLinkName, String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, privateLinkName, privateEndpointConnectionName, - privateEndpointConnection) - .getSyncPoller(); - } - - /** - * Update the state of specified private endpoint connection associated with the private link. This operation is - * typically used to approve or reject pending private endpoint connections. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param privateEndpointConnection The private endpoint connection 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 SyncPoller} for polling of the private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( - String resourceGroupName, String privateLinkName, String privateEndpointConnectionName, - PrivateEndpointConnectionInner privateEndpointConnection, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, privateLinkName, privateEndpointConnectionName, - privateEndpointConnection, context) - .getSyncPoller(); - } - - /** - * Update the state of specified private endpoint connection associated with the private link. This operation is - * typically used to approve or reject pending private endpoint connections. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param privateEndpointConnection The private endpoint connection 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 private endpoint connection resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { - return beginCreateOrUpdateAsync(resourceGroupName, privateLinkName, privateEndpointConnectionName, - privateEndpointConnection).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update the state of specified private endpoint connection associated with the private link. This operation is - * typically used to approve or reject pending private endpoint connections. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param privateEndpointConnection The private endpoint connection 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 private endpoint connection resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, - Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, privateLinkName, privateEndpointConnectionName, - privateEndpointConnection, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update the state of specified private endpoint connection associated with the private link. This operation is - * typically used to approve or reject pending private endpoint connections. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param privateEndpointConnection The private endpoint connection 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 private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { - return createOrUpdateAsync(resourceGroupName, privateLinkName, privateEndpointConnectionName, - privateEndpointConnection).block(); - } - - /** - * Update the state of specified private endpoint connection associated with the private link. This operation is - * typically used to approve or reject pending private endpoint connections. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * resource. - * @param privateEndpointConnection The private endpoint connection 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 private endpoint connection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, - Context context) { - return createOrUpdateAsync(resourceGroupName, privateLinkName, privateEndpointConnectionName, - privateEndpointConnection, context).block(); - } - - /** - * Deletes the specified private endpoint connection associated with the private link. This operation will - * disconnect the private endpoint and remove the connection configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName) { - 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String apiVersion = "2026-01-01"; - return FluxUtil - .withContext( - context -> service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, privateLinkName, privateEndpointConnectionName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the specified private endpoint connection associated with the private link. This operation will - * disconnect the private endpoint and remove the connection configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * 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 privateLinkName, - String privateEndpointConnectionName, 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String apiVersion = "2026-01-01"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - privateLinkName, privateEndpointConnectionName, context); - } - - /** - * Deletes the specified private endpoint connection associated with the private link. This operation will - * disconnect the private endpoint and remove the connection configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * 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 PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, privateLinkName, privateEndpointConnectionName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes the specified private endpoint connection associated with the private link. This operation will - * disconnect the private endpoint and remove the connection configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * 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 PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, privateLinkName, privateEndpointConnectionName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Deletes the specified private endpoint connection associated with the private link. This operation will - * disconnect the private endpoint and remove the connection configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * 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 SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName) { - return this.beginDeleteAsync(resourceGroupName, privateLinkName, privateEndpointConnectionName).getSyncPoller(); - } - - /** - * Deletes the specified private endpoint connection associated with the private link. This operation will - * disconnect the private endpoint and remove the connection configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * 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 SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName, Context context) { - return this.beginDeleteAsync(resourceGroupName, privateLinkName, privateEndpointConnectionName, context) - .getSyncPoller(); - } - - /** - * Deletes the specified private endpoint connection associated with the private link. This operation will - * disconnect the private endpoint and remove the connection configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName) { - return beginDeleteAsync(resourceGroupName, privateLinkName, privateEndpointConnectionName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified private endpoint connection associated with the private link. This operation will - * disconnect the private endpoint and remove the connection configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName, Context context) { - return beginDeleteAsync(resourceGroupName, privateLinkName, privateEndpointConnectionName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes the specified private endpoint connection associated with the private link. This operation will - * disconnect the private endpoint and remove the connection configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String privateLinkName, String privateEndpointConnectionName) { - deleteAsync(resourceGroupName, privateLinkName, privateEndpointConnectionName).block(); - } - - /** - * Deletes the specified private endpoint connection associated with the private link. This operation will - * disconnect the private endpoint and remove the connection configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure - * 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String privateLinkName, String privateEndpointConnectionName, - Context context) { - deleteAsync(resourceGroupName, privateLinkName, privateEndpointConnectionName, context).block(); - } - - /** - * Gets all private endpoint connections for a private link. Returns the list of private endpoints that are - * connected or in the process of connecting to this private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 private endpoint connections for a private link along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String privateLinkName) { - 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - final String apiVersion = "2026-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, privateLinkName, 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 private endpoint connections for a private link. Returns the list of private endpoints that are - * connected or in the process of connecting to this private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 private endpoint connections for a private link along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String privateLinkName, 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - final String apiVersion = "2026-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - privateLinkName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets all private endpoint connections for a private link. Returns the list of private endpoints that are - * connected or in the process of connecting to this private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 private endpoint connections for a private link as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateLinkName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateLinkName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets all private endpoint connections for a private link. Returns the list of private endpoints that are - * connected or in the process of connecting to this private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 private endpoint connections for a private link as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateLinkName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateLinkName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets all private endpoint connections for a private link. Returns the list of private endpoints that are - * connected or in the process of connecting to this private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 private endpoint connections for a private link as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String privateLinkName) { - return new PagedIterable<>(listAsync(resourceGroupName, privateLinkName)); - } - - /** - * Gets all private endpoint connections for a private link. Returns the list of private endpoints that are - * connected or in the process of connecting to this private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 private endpoint connections for a private link as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String privateLinkName, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, privateLinkName, 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 all private endpoint connections for a private link 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 all private endpoint connections for a private link 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateEndpointConnectionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateEndpointConnectionsImpl.java deleted file mode 100644 index c25be50262d5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateEndpointConnectionsImpl.java +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.security.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.security.models.PrivateEndpointConnection; -import com.azure.resourcemanager.security.models.PrivateEndpointConnections; - -public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { - private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); - - private final PrivateEndpointConnectionsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, privateLinkName, privateEndpointConnectionName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); - } - - public PrivateEndpointConnection get(String resourceGroupName, String privateLinkName, - String privateEndpointConnectionName) { - PrivateEndpointConnectionInner inner - = this.serviceClient().get(resourceGroupName, privateLinkName, privateEndpointConnectionName); - if (inner != null) { - return new PrivateEndpointConnectionImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String privateLinkName, String privateEndpointConnectionName) { - this.serviceClient().delete(resourceGroupName, privateLinkName, privateEndpointConnectionName); - } - - public void delete(String resourceGroupName, String privateLinkName, String privateEndpointConnectionName, - Context context) { - this.serviceClient().delete(resourceGroupName, privateLinkName, privateEndpointConnectionName, context); - } - - public PagedIterable list(String resourceGroupName, String privateLinkName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, privateLinkName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String privateLinkName, - Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, privateLinkName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); - } - - public PrivateEndpointConnection 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 privateLinkName = ResourceManagerUtils.getValueFromIdByName(id, "privateLinks"); - if (privateLinkName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'privateLinks'.", id))); - } - String privateEndpointConnectionName - = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); - if (privateEndpointConnectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); - } - return this.getWithResponse(resourceGroupName, privateLinkName, privateEndpointConnectionName, 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 privateLinkName = ResourceManagerUtils.getValueFromIdByName(id, "privateLinks"); - if (privateLinkName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'privateLinks'.", id))); - } - String privateEndpointConnectionName - = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); - if (privateEndpointConnectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); - } - return this.getWithResponse(resourceGroupName, privateLinkName, privateEndpointConnectionName, 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 privateLinkName = ResourceManagerUtils.getValueFromIdByName(id, "privateLinks"); - if (privateLinkName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'privateLinks'.", id))); - } - String privateEndpointConnectionName - = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); - if (privateEndpointConnectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); - } - this.delete(resourceGroupName, privateLinkName, privateEndpointConnectionName, 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 privateLinkName = ResourceManagerUtils.getValueFromIdByName(id, "privateLinks"); - if (privateLinkName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'privateLinks'.", id))); - } - String privateEndpointConnectionName - = ResourceManagerUtils.getValueFromIdByName(id, "privateEndpointConnections"); - if (privateEndpointConnectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String - .format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); - } - this.delete(resourceGroupName, privateLinkName, privateEndpointConnectionName, context); - } - - private PrivateEndpointConnectionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public PrivateEndpointConnectionImpl define(String name) { - return new PrivateEndpointConnectionImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinkGroupResourceImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinkGroupResourceImpl.java deleted file mode 100644 index 79387b15d2ae..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinkGroupResourceImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.PrivateLinkGroupResourceInner; -import com.azure.resourcemanager.security.models.PrivateLinkGroupResource; -import java.util.Collections; -import java.util.List; - -public final class PrivateLinkGroupResourceImpl implements PrivateLinkGroupResource { - private PrivateLinkGroupResourceInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - PrivateLinkGroupResourceImpl(PrivateLinkGroupResourceInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public String groupId() { - return this.innerModel().groupId(); - } - - public List requiredMembers() { - List inner = this.innerModel().requiredMembers(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List requiredZoneNames() { - List inner = this.innerModel().requiredZoneNames(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public PrivateLinkGroupResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinkResourceImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinkResourceImpl.java deleted file mode 100644 index 924af837fcbd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinkResourceImpl.java +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.security.fluent.models.PrivateLinkGroupResourceInner; -import com.azure.resourcemanager.security.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.security.models.PrivateEndpointConnection; -import com.azure.resourcemanager.security.models.PrivateLinkGroupResource; -import com.azure.resourcemanager.security.models.PrivateLinkResource; -import com.azure.resourcemanager.security.models.PrivateLinkUpdate; -import com.azure.resourcemanager.security.models.ProvisioningState; -import com.azure.resourcemanager.security.models.PublicNetworkAccess; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -public final class PrivateLinkResourceImpl - implements PrivateLinkResource, PrivateLinkResource.Definition, PrivateLinkResource.Update { - private PrivateLinkResourceInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public List privateEndpointConnections() { - List inner = this.innerModel().privateEndpointConnections(); - if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public List privateLinkResources() { - List inner = this.innerModel().privateLinkResources(); - if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new PrivateLinkGroupResourceImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public PublicNetworkAccess publicNetworkAccess() { - return this.innerModel().publicNetworkAccess(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public PrivateLinkResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String privateLinkName; - - private PrivateLinkUpdate updatePrivateLink; - - public PrivateLinkResourceImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public PrivateLinkResource create() { - this.innerObject = serviceManager.serviceClient() - .getPrivateLinks() - .create(resourceGroupName, privateLinkName, this.innerModel(), Context.NONE); - return this; - } - - public PrivateLinkResource create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getPrivateLinks() - .create(resourceGroupName, privateLinkName, this.innerModel(), context); - return this; - } - - PrivateLinkResourceImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new PrivateLinkResourceInner(); - this.serviceManager = serviceManager; - this.privateLinkName = name; - } - - public PrivateLinkResourceImpl update() { - this.updatePrivateLink = new PrivateLinkUpdate(); - return this; - } - - public PrivateLinkResource apply() { - this.innerObject = serviceManager.serviceClient() - .getPrivateLinks() - .updateWithResponse(resourceGroupName, privateLinkName, updatePrivateLink, Context.NONE) - .getValue(); - return this; - } - - public PrivateLinkResource apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getPrivateLinks() - .updateWithResponse(resourceGroupName, privateLinkName, updatePrivateLink, context) - .getValue(); - return this; - } - - PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.privateLinkName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "privateLinks"); - } - - public PrivateLinkResource refresh() { - this.innerObject = serviceManager.serviceClient() - .getPrivateLinks() - .getByResourceGroupWithResponse(resourceGroupName, privateLinkName, Context.NONE) - .getValue(); - return this; - } - - public PrivateLinkResource refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getPrivateLinks() - .getByResourceGroupWithResponse(resourceGroupName, privateLinkName, context) - .getValue(); - return this; - } - - public PrivateLinkResourceImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public PrivateLinkResourceImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public PrivateLinkResourceImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updatePrivateLink.withTags(tags); - return this; - } - } - - public PrivateLinkResourceImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { - this.innerModel().withPublicNetworkAccess(publicNetworkAccess); - return this; - } - - private boolean isInCreateMode() { - return this.innerModel() == null || this.innerModel().id() == null; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinkResourcesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinkResourcesClientImpl.java deleted file mode 100644 index 0933d0e56a87..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinkResourcesClientImpl.java +++ /dev/null @@ -1,444 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.security.fluent.models.PrivateLinkGroupResourceInner; -import com.azure.resourcemanager.security.implementation.models.PrivateLinkGroupResourceListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. - */ -public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { - /** - * The proxy service used to perform REST calls. - */ - private final PrivateLinkResourcesService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of PrivateLinkResourcesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateLinkResourcesClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(PrivateLinkResourcesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterPrivateLinkResources to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterPrivateLinkResources") - public interface PrivateLinkResourcesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/privateLinks/{privateLinkName}/privateLinkResources/{groupId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateLinkName") String privateLinkName, @PathParam("groupId") String groupId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/privateLinks/{privateLinkName}/privateLinkResources") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateLinkName") String privateLinkName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get the specified private link resource associated with the private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param groupId The group ID of the private link 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 specified private link resource associated with the private link along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String privateLinkName, String groupId) { - 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - final String apiVersion = "2026-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, privateLinkName, groupId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the specified private link resource associated with the private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param groupId The group ID of the private link 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 specified private link resource associated with the private link along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String privateLinkName, String groupId, 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - if (groupId == null) { - return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); - } - final String apiVersion = "2026-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - privateLinkName, groupId, accept, context); - } - - /** - * Get the specified private link resource associated with the private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param groupId The group ID of the private link 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 specified private link resource associated with the private link on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String privateLinkName, - String groupId) { - return getWithResponseAsync(resourceGroupName, privateLinkName, groupId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the specified private link resource associated with the private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param groupId The group ID of the private link 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 specified private link resource associated with the private link along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String privateLinkName, - String groupId, Context context) { - return getWithResponseAsync(resourceGroupName, privateLinkName, groupId, context).block(); - } - - /** - * Get the specified private link resource associated with the private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param groupId The group ID of the private link 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 specified private link resource associated with the private link. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkGroupResourceInner get(String resourceGroupName, String privateLinkName, String groupId) { - return getWithResponse(resourceGroupName, privateLinkName, groupId, Context.NONE).getValue(); - } - - /** - * List all private link resources in a private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a PrivateLinkGroupResource list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String privateLinkName) { - 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - final String apiVersion = "2026-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, privateLinkName, 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 private link resources in a private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a PrivateLinkGroupResource list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String privateLinkName, 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - final String apiVersion = "2026-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - privateLinkName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List all private link resources in a private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a PrivateLinkGroupResource list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateLinkName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateLinkName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List all private link resources in a private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a PrivateLinkGroupResource list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String privateLinkName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, privateLinkName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List all private link resources in a private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a PrivateLinkGroupResource list operation as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String privateLinkName) { - return new PagedIterable<>(listAsync(resourceGroupName, privateLinkName)); - } - - /** - * List all private link resources in a private link. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a PrivateLinkGroupResource list operation as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String privateLinkName, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, privateLinkName, 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 response of a PrivateLinkGroupResource list operation 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 the response of a PrivateLinkGroupResource list operation 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinkResourcesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinkResourcesImpl.java deleted file mode 100644 index 5fa9050ede0c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinkResourcesImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.security.fluent.models.PrivateLinkGroupResourceInner; -import com.azure.resourcemanager.security.models.PrivateLinkGroupResource; -import com.azure.resourcemanager.security.models.PrivateLinkResources; - -public final class PrivateLinkResourcesImpl implements PrivateLinkResources { - private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesImpl.class); - - private final PrivateLinkResourcesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String privateLinkName, - String groupId, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, privateLinkName, groupId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PrivateLinkGroupResourceImpl(inner.getValue(), this.manager())); - } - - public PrivateLinkGroupResource get(String resourceGroupName, String privateLinkName, String groupId) { - PrivateLinkGroupResourceInner inner = this.serviceClient().get(resourceGroupName, privateLinkName, groupId); - if (inner != null) { - return new PrivateLinkGroupResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String privateLinkName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, privateLinkName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkGroupResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String privateLinkName, - Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, privateLinkName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkGroupResourceImpl(inner1, this.manager())); - } - - private PrivateLinkResourcesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinksClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinksClientImpl.java deleted file mode 100644 index 84bebe38c34a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinksClientImpl.java +++ /dev/null @@ -1,1440 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.Head; -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.Patch; -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.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.security.fluent.PrivateLinksClient; -import com.azure.resourcemanager.security.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.security.implementation.models.PrivateLinksList; -import com.azure.resourcemanager.security.models.PrivateLinkUpdate; -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 PrivateLinksClient. - */ -public final class PrivateLinksClientImpl implements PrivateLinksClient { - /** - * The proxy service used to perform REST calls. - */ - private final PrivateLinksService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of PrivateLinksClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PrivateLinksClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(PrivateLinksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterPrivateLinks to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterPrivateLinks") - public interface PrivateLinksService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/privateLinks/{privateLinkName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateLinkName") String privateLinkName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Head("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/privateLinks/{privateLinkName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> head(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateLinkName") String privateLinkName, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/privateLinks/{privateLinkName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateLinkName") String privateLinkName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") PrivateLinkResourceInner privateLink, - Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/privateLinks/{privateLinkName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateLinkName") String privateLinkName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") PrivateLinkUpdate privateLink, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/privateLinks/{privateLinkName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("privateLinkName") String privateLinkName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/privateLinks") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - 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" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/privateLinks") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get a private link resource. Returns the configuration and status of private endpoint connectivity for Microsoft - * Defender for Cloud services in the specified region. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 private link resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String privateLinkName) { - 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - final String apiVersion = "2026-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, privateLinkName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a private link resource. Returns the configuration and status of private endpoint connectivity for Microsoft - * Defender for Cloud services in the specified region. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 private link resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String privateLinkName, 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - final String apiVersion = "2026-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, privateLinkName, accept, context); - } - - /** - * Get a private link resource. Returns the configuration and status of private endpoint connectivity for Microsoft - * Defender for Cloud services in the specified region. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 private link resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String privateLinkName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, privateLinkName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a private link resource. Returns the configuration and status of private endpoint connectivity for Microsoft - * Defender for Cloud services in the specified region. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 private link resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String privateLinkName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, privateLinkName, context).block(); - } - - /** - * Get a private link resource. Returns the configuration and status of private endpoint connectivity for Microsoft - * Defender for Cloud services in the specified region. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 private link resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkResourceInner getByResourceGroup(String resourceGroupName, String privateLinkName) { - return getByResourceGroupWithResponse(resourceGroupName, privateLinkName, Context.NONE).getValue(); - } - - /** - * Checks whether private link exists. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> headWithResponseAsync(String resourceGroupName, String privateLinkName) { - 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - final String apiVersion = "2026-01-01"; - return FluxUtil - .withContext(context -> service.head(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, privateLinkName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Checks whether private link exists. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> headWithResponseAsync(String resourceGroupName, String privateLinkName, - 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - final String apiVersion = "2026-01-01"; - context = this.client.mergeContext(context); - return service.head(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - privateLinkName, context); - } - - /** - * Checks whether private link exists. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 headAsync(String resourceGroupName, String privateLinkName) { - return headWithResponseAsync(resourceGroupName, privateLinkName).flatMap(ignored -> Mono.empty()); - } - - /** - * Checks whether private link exists. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 headWithResponse(String resourceGroupName, String privateLinkName, Context context) { - return headWithResponseAsync(resourceGroupName, privateLinkName, context).block(); - } - - /** - * Checks whether private link exists. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 head(String resourceGroupName, String privateLinkName) { - headWithResponse(resourceGroupName, privateLinkName, Context.NONE); - } - - /** - * Create a private link resource. This operation creates the necessary infrastructure to enable private endpoint - * connections to Microsoft Defender for Cloud services. For updates to existing resources, use the PATCH operation. - * The operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateLink Private link request payload containing the resource information for create operations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 private link resource that enables secure, private connectivity to Microsoft Defender for Cloud - * services along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String privateLinkName, - PrivateLinkResourceInner privateLink) { - 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - if (privateLink == null) { - return Mono.error(new IllegalArgumentException("Parameter privateLink is required and cannot be null.")); - } else { - privateLink.validate(); - } - final String apiVersion = "2026-01-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, privateLinkName, contentType, accept, privateLink, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a private link resource. This operation creates the necessary infrastructure to enable private endpoint - * connections to Microsoft Defender for Cloud services. For updates to existing resources, use the PATCH operation. - * The operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateLink Private link request payload containing the resource information for create 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 a private link resource that enables secure, private connectivity to Microsoft Defender for Cloud - * services along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String privateLinkName, - PrivateLinkResourceInner privateLink, 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - if (privateLink == null) { - return Mono.error(new IllegalArgumentException("Parameter privateLink is required and cannot be null.")); - } else { - privateLink.validate(); - } - final String apiVersion = "2026-01-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - privateLinkName, contentType, accept, privateLink, context); - } - - /** - * Create a private link resource. This operation creates the necessary infrastructure to enable private endpoint - * connections to Microsoft Defender for Cloud services. For updates to existing resources, use the PATCH operation. - * The operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateLink Private link request payload containing the resource information for create operations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of a private link resource that enables secure, private connectivity - * to Microsoft Defender for Cloud services. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, PrivateLinkResourceInner> - beginCreateAsync(String resourceGroupName, String privateLinkName, PrivateLinkResourceInner privateLink) { - Mono>> mono - = createWithResponseAsync(resourceGroupName, privateLinkName, privateLink); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), PrivateLinkResourceInner.class, PrivateLinkResourceInner.class, - this.client.getContext()); - } - - /** - * Create a private link resource. This operation creates the necessary infrastructure to enable private endpoint - * connections to Microsoft Defender for Cloud services. For updates to existing resources, use the PATCH operation. - * The operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateLink Private link request payload containing the resource information for create 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 the {@link PollerFlux} for polling of a private link resource that enables secure, private connectivity - * to Microsoft Defender for Cloud services. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, PrivateLinkResourceInner> beginCreateAsync( - String resourceGroupName, String privateLinkName, PrivateLinkResourceInner privateLink, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createWithResponseAsync(resourceGroupName, privateLinkName, privateLink, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), PrivateLinkResourceInner.class, PrivateLinkResourceInner.class, context); - } - - /** - * Create a private link resource. This operation creates the necessary infrastructure to enable private endpoint - * connections to Microsoft Defender for Cloud services. For updates to existing resources, use the PATCH operation. - * The operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateLink Private link request payload containing the resource information for create operations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of a private link resource that enables secure, private connectivity - * to Microsoft Defender for Cloud services. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, PrivateLinkResourceInner> - beginCreate(String resourceGroupName, String privateLinkName, PrivateLinkResourceInner privateLink) { - return this.beginCreateAsync(resourceGroupName, privateLinkName, privateLink).getSyncPoller(); - } - - /** - * Create a private link resource. This operation creates the necessary infrastructure to enable private endpoint - * connections to Microsoft Defender for Cloud services. For updates to existing resources, use the PATCH operation. - * The operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateLink Private link request payload containing the resource information for create 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 the {@link SyncPoller} for polling of a private link resource that enables secure, private connectivity - * to Microsoft Defender for Cloud services. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, PrivateLinkResourceInner> beginCreate( - String resourceGroupName, String privateLinkName, PrivateLinkResourceInner privateLink, Context context) { - return this.beginCreateAsync(resourceGroupName, privateLinkName, privateLink, context).getSyncPoller(); - } - - /** - * Create a private link resource. This operation creates the necessary infrastructure to enable private endpoint - * connections to Microsoft Defender for Cloud services. For updates to existing resources, use the PATCH operation. - * The operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateLink Private link request payload containing the resource information for create operations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 private link resource that enables secure, private connectivity to Microsoft Defender for Cloud - * services on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String privateLinkName, - PrivateLinkResourceInner privateLink) { - return beginCreateAsync(resourceGroupName, privateLinkName, privateLink).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a private link resource. This operation creates the necessary infrastructure to enable private endpoint - * connections to Microsoft Defender for Cloud services. For updates to existing resources, use the PATCH operation. - * The operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateLink Private link request payload containing the resource information for create 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 a private link resource that enables secure, private connectivity to Microsoft Defender for Cloud - * services on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String privateLinkName, - PrivateLinkResourceInner privateLink, Context context) { - return beginCreateAsync(resourceGroupName, privateLinkName, privateLink, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a private link resource. This operation creates the necessary infrastructure to enable private endpoint - * connections to Microsoft Defender for Cloud services. For updates to existing resources, use the PATCH operation. - * The operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateLink Private link request payload containing the resource information for create operations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 private link resource that enables secure, private connectivity to Microsoft Defender for Cloud - * services. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkResourceInner create(String resourceGroupName, String privateLinkName, - PrivateLinkResourceInner privateLink) { - return createAsync(resourceGroupName, privateLinkName, privateLink).block(); - } - - /** - * Create a private link resource. This operation creates the necessary infrastructure to enable private endpoint - * connections to Microsoft Defender for Cloud services. For updates to existing resources, use the PATCH operation. - * The operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateLink Private link request payload containing the resource information for create 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 a private link resource that enables secure, private connectivity to Microsoft Defender for Cloud - * services. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkResourceInner create(String resourceGroupName, String privateLinkName, - PrivateLinkResourceInner privateLink, Context context) { - return createAsync(resourceGroupName, privateLinkName, privateLink, context).block(); - } - - /** - * Update specific properties of a private link resource. Use this operation to update mutable properties like tags - * without affecting the entire resource configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateLink private link update payload containing only the properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 private link resource that enables secure, private connectivity to Microsoft Defender for Cloud - * services along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String privateLinkName, PrivateLinkUpdate privateLink) { - 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - if (privateLink == null) { - return Mono.error(new IllegalArgumentException("Parameter privateLink is required and cannot be null.")); - } else { - privateLink.validate(); - } - final String apiVersion = "2026-01-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, privateLinkName, contentType, accept, privateLink, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update specific properties of a private link resource. Use this operation to update mutable properties like tags - * without affecting the entire resource configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateLink private link update payload containing only the properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 private link resource that enables secure, private connectivity to Microsoft Defender for Cloud - * services along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String privateLinkName, PrivateLinkUpdate privateLink, 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - if (privateLink == null) { - return Mono.error(new IllegalArgumentException("Parameter privateLink is required and cannot be null.")); - } else { - privateLink.validate(); - } - final String apiVersion = "2026-01-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - privateLinkName, contentType, accept, privateLink, context); - } - - /** - * Update specific properties of a private link resource. Use this operation to update mutable properties like tags - * without affecting the entire resource configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateLink private link update payload containing only the properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 private link resource that enables secure, private connectivity to Microsoft Defender for Cloud - * services on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String privateLinkName, - PrivateLinkUpdate privateLink) { - return updateWithResponseAsync(resourceGroupName, privateLinkName, privateLink) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Update specific properties of a private link resource. Use this operation to update mutable properties like tags - * without affecting the entire resource configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateLink private link update payload containing only the properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 private link resource that enables secure, private connectivity to Microsoft Defender for Cloud - * services along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String privateLinkName, - PrivateLinkUpdate privateLink, Context context) { - return updateWithResponseAsync(resourceGroupName, privateLinkName, privateLink, context).block(); - } - - /** - * Update specific properties of a private link resource. Use this operation to update mutable properties like tags - * without affecting the entire resource configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param privateLink private link update payload containing only the properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 private link resource that enables secure, private connectivity to Microsoft Defender for Cloud - * services. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkResourceInner update(String resourceGroupName, String privateLinkName, - PrivateLinkUpdate privateLink) { - return updateWithResponse(resourceGroupName, privateLinkName, privateLink, Context.NONE).getValue(); - } - - /** - * Delete a private link resource. This operation will remove the private link infrastructure and disconnect all - * associated private endpoints. This operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 privateLinkName) { - 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - final String apiVersion = "2026-01-01"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, privateLinkName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a private link resource. This operation will remove the private link infrastructure and disconnect all - * associated private endpoints. This operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 privateLinkName, - 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 (privateLinkName == null) { - return Mono - .error(new IllegalArgumentException("Parameter privateLinkName is required and cannot be null.")); - } - final String apiVersion = "2026-01-01"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - privateLinkName, context); - } - - /** - * Delete a private link resource. This operation will remove the private link infrastructure and disconnect all - * associated private endpoints. This operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 privateLinkName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, privateLinkName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Delete a private link resource. This operation will remove the private link infrastructure and disconnect all - * associated private endpoints. This operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 privateLinkName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, privateLinkName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Delete a private link resource. This operation will remove the private link infrastructure and disconnect all - * associated private endpoints. This operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 privateLinkName) { - return this.beginDeleteAsync(resourceGroupName, privateLinkName).getSyncPoller(); - } - - /** - * Delete a private link resource. This operation will remove the private link infrastructure and disconnect all - * associated private endpoints. This operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 privateLinkName, - Context context) { - return this.beginDeleteAsync(resourceGroupName, privateLinkName, context).getSyncPoller(); - } - - /** - * Delete a private link resource. This operation will remove the private link infrastructure and disconnect all - * associated private endpoints. This operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 privateLinkName) { - return beginDeleteAsync(resourceGroupName, privateLinkName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a private link resource. This operation will remove the private link infrastructure and disconnect all - * associated private endpoints. This operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 privateLinkName, Context context) { - return beginDeleteAsync(resourceGroupName, privateLinkName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a private link resource. This operation will remove the private link infrastructure and disconnect all - * associated private endpoints. This operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 privateLinkName) { - deleteAsync(resourceGroupName, privateLinkName).block(); - } - - /** - * Delete a private link resource. This operation will remove the private link infrastructure and disconnect all - * associated private endpoints. This operation is asynchronous and may take several minutes to complete. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkName The name of the private link resource. Must be unique within the resource group and follow - * Azure naming conventions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 privateLinkName, Context context) { - deleteAsync(resourceGroupName, privateLinkName, context).block(); - } - - /** - * Lists all the private links in the specified resource group. private links enable secure, private connectivity to - * Microsoft Defender for Cloud services without exposing traffic to the public internet. Use the 'nextLink' - * property in the response to get the next page of private links for the specified resource group. - * - * @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 paginated list of private link resources 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 (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.")); - } - final String apiVersion = "2026-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), apiVersion, - 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())); - } - - /** - * Lists all the private links in the specified resource group. private links enable secure, private connectivity to - * Microsoft Defender for Cloud services without exposing traffic to the public internet. Use the 'nextLink' - * property in the response to get the next page of private links for the specified 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 paginated list of private link resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @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 (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.")); - } - final String apiVersion = "2026-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists all the private links in the specified resource group. private links enable secure, private connectivity to - * Microsoft Defender for Cloud services without exposing traffic to the public internet. Use the 'nextLink' - * property in the response to get the next page of private links for the specified resource group. - * - * @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 paginated list of private link resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the private links in the specified resource group. private links enable secure, private connectivity to - * Microsoft Defender for Cloud services without exposing traffic to the public internet. Use the 'nextLink' - * property in the response to get the next page of private links for the specified 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 paginated list of private link resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the private links in the specified resource group. private links enable secure, private connectivity to - * Microsoft Defender for Cloud services without exposing traffic to the public internet. Use the 'nextLink' - * property in the response to get the next page of private links for the specified resource group. - * - * @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 paginated list of private link resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all the private links in the specified resource group. private links enable secure, private connectivity to - * Microsoft Defender for Cloud services without exposing traffic to the public internet. Use the 'nextLink' - * property in the response to get the next page of private links for the specified 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 paginated list of private link resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Lists all the private links in the specified subscription. private links enable secure, private connectivity to - * Microsoft Defender for Cloud services without exposing traffic to the public internet. Use the 'nextLink' - * property in the response to get the next page of private links for the specified 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 paginated list of private link resources 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2026-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the private links in the specified subscription. private links enable secure, private connectivity to - * Microsoft Defender for Cloud services without exposing traffic to the public internet. Use the 'nextLink' - * property in the response to get the next page of private links for the specified 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 paginated list of private link resources 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2026-01-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)); - } - - /** - * Lists all the private links in the specified subscription. private links enable secure, private connectivity to - * Microsoft Defender for Cloud services without exposing traffic to the public internet. Use the 'nextLink' - * property in the response to get the next page of private links for the specified 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 paginated list of private link resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the private links in the specified subscription. private links enable secure, private connectivity to - * Microsoft Defender for Cloud services without exposing traffic to the public internet. Use the 'nextLink' - * property in the response to get the next page of private links for the specified 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 paginated list of private link resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the private links in the specified subscription. private links enable secure, private connectivity to - * Microsoft Defender for Cloud services without exposing traffic to the public internet. Use the 'nextLink' - * property in the response to get the next page of private links for the specified 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 paginated list of private link resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all the private links in the specified subscription. private links enable secure, private connectivity to - * Microsoft Defender for Cloud services without exposing traffic to the public internet. Use the 'nextLink' - * property in the response to get the next page of private links for the specified 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 paginated list of private link resources 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 paginated list of private link resources 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 paginated list of private link resources 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)); - } - - /** - * 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 paginated list of private link resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paginated list of private link resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinksImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinksImpl.java deleted file mode 100644 index 4f4aa2221987..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PrivateLinksImpl.java +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.PrivateLinksClient; -import com.azure.resourcemanager.security.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.security.models.PrivateLinkResource; -import com.azure.resourcemanager.security.models.PrivateLinks; - -public final class PrivateLinksImpl implements PrivateLinks { - private static final ClientLogger LOGGER = new ClientLogger(PrivateLinksImpl.class); - - private final PrivateLinksClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public PrivateLinksImpl(PrivateLinksClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getByResourceGroupWithResponse(String resourceGroupName, - String privateLinkName, Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, privateLinkName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PrivateLinkResourceImpl(inner.getValue(), this.manager())); - } - - public PrivateLinkResource getByResourceGroup(String resourceGroupName, String privateLinkName) { - PrivateLinkResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, privateLinkName); - if (inner != null) { - return new PrivateLinkResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response headWithResponse(String resourceGroupName, String privateLinkName, Context context) { - return this.serviceClient().headWithResponse(resourceGroupName, privateLinkName, context); - } - - public void head(String resourceGroupName, String privateLinkName) { - this.serviceClient().head(resourceGroupName, privateLinkName); - } - - public void deleteByResourceGroup(String resourceGroupName, String privateLinkName) { - this.serviceClient().delete(resourceGroupName, privateLinkName); - } - - public void delete(String resourceGroupName, String privateLinkName, Context context) { - this.serviceClient().delete(resourceGroupName, privateLinkName, context); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); - } - - public PrivateLinkResource 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 privateLinkName = ResourceManagerUtils.getValueFromIdByName(id, "privateLinks"); - if (privateLinkName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'privateLinks'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, privateLinkName, 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 privateLinkName = ResourceManagerUtils.getValueFromIdByName(id, "privateLinks"); - if (privateLinkName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'privateLinks'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, privateLinkName, 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 privateLinkName = ResourceManagerUtils.getValueFromIdByName(id, "privateLinks"); - if (privateLinkName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'privateLinks'.", id))); - } - this.delete(resourceGroupName, privateLinkName, 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 privateLinkName = ResourceManagerUtils.getValueFromIdByName(id, "privateLinks"); - if (privateLinkName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'privateLinks'.", id))); - } - this.delete(resourceGroupName, privateLinkName, context); - } - - private PrivateLinksClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public PrivateLinkResourceImpl define(String name) { - return new PrivateLinkResourceImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentImpl.java deleted file mode 100644 index 2f4b0dfe6293..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentImpl.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessment; -import com.azure.resourcemanager.security.models.State; - -public final class RegulatoryComplianceAssessmentImpl implements RegulatoryComplianceAssessment { - private RegulatoryComplianceAssessmentInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - RegulatoryComplianceAssessmentImpl(RegulatoryComplianceAssessmentInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public String description() { - return this.innerModel().description(); - } - - public String assessmentType() { - return this.innerModel().assessmentType(); - } - - public String assessmentDetailsLink() { - return this.innerModel().assessmentDetailsLink(); - } - - public State state() { - return this.innerModel().state(); - } - - public Integer passedResources() { - return this.innerModel().passedResources(); - } - - public Integer failedResources() { - return this.innerModel().failedResources(); - } - - public Integer skippedResources() { - return this.innerModel().skippedResources(); - } - - public Integer unsupportedResources() { - return this.innerModel().unsupportedResources(); - } - - public RegulatoryComplianceAssessmentInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentsClientImpl.java deleted file mode 100644 index 0fd7a8a34361..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentsClientImpl.java +++ /dev/null @@ -1,471 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceAssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentInner; -import com.azure.resourcemanager.security.implementation.models.RegulatoryComplianceAssessmentList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in RegulatoryComplianceAssessmentsClient. - */ -public final class RegulatoryComplianceAssessmentsClientImpl implements RegulatoryComplianceAssessmentsClient { - /** - * The proxy service used to perform REST calls. - */ - private final RegulatoryComplianceAssessmentsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of RegulatoryComplianceAssessmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RegulatoryComplianceAssessmentsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(RegulatoryComplianceAssessmentsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterRegulatoryComplianceAssessments to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterRegulatoryComplianceAssessments") - public interface RegulatoryComplianceAssessmentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments/{regulatoryComplianceAssessmentName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("regulatoryComplianceStandardName") String regulatoryComplianceStandardName, - @PathParam("regulatoryComplianceControlName") String regulatoryComplianceControlName, - @PathParam("regulatoryComplianceAssessmentName") String regulatoryComplianceAssessmentName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("regulatoryComplianceStandardName") String regulatoryComplianceStandardName, - @PathParam("regulatoryComplianceControlName") String regulatoryComplianceControlName, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName, - String regulatoryComplianceAssessmentName) { - 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 (regulatoryComplianceStandardName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - if (regulatoryComplianceControlName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceControlName is required and cannot be null.")); - } - if (regulatoryComplianceAssessmentName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceAssessmentName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - regulatoryComplianceStandardName, regulatoryComplianceControlName, regulatoryComplianceAssessmentName, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName, - String regulatoryComplianceAssessmentName, 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 (regulatoryComplianceStandardName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - if (regulatoryComplianceControlName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceControlName is required and cannot be null.")); - } - if (regulatoryComplianceAssessmentName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceAssessmentName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - regulatoryComplianceStandardName, regulatoryComplianceControlName, regulatoryComplianceAssessmentName, - accept, context); - } - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String regulatoryComplianceAssessmentName) { - return getWithResponseAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, - regulatoryComplianceAssessmentName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String regulatoryComplianceAssessmentName, Context context) { - return getWithResponseAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, - regulatoryComplianceAssessmentName, context).block(); - } - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RegulatoryComplianceAssessmentInner get(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String regulatoryComplianceAssessmentName) { - return getWithResponse(regulatoryComplianceStandardName, regulatoryComplianceControlName, - regulatoryComplianceAssessmentName, Context.NONE).getValue(); - } - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName, String filter) { - 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 (regulatoryComplianceStandardName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - if (regulatoryComplianceControlName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceControlName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - regulatoryComplianceStandardName, regulatoryComplianceControlName, 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())); - } - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName, String filter, - 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 (regulatoryComplianceStandardName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - if (regulatoryComplianceControlName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceControlName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - regulatoryComplianceStandardName, regulatoryComplianceControlName, filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName) { - final String filter = null; - return new PagedFlux<>( - () -> listSinglePageAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String filter, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(regulatoryComplianceStandardName, - regulatoryComplianceControlName, filter, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName) { - final String filter = null; - return new PagedIterable<>( - listAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, filter)); - } - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String filter, Context context) { - return new PagedIterable<>( - listAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, filter, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response 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 list of regulatory compliance assessment response 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentsImpl.java deleted file mode 100644 index 95ddf0a1537a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentsImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceAssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessment; -import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessments; - -public final class RegulatoryComplianceAssessmentsImpl implements RegulatoryComplianceAssessments { - private static final ClientLogger LOGGER = new ClientLogger(RegulatoryComplianceAssessmentsImpl.class); - - private final RegulatoryComplianceAssessmentsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public RegulatoryComplianceAssessmentsImpl(RegulatoryComplianceAssessmentsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String regulatoryComplianceAssessmentName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(regulatoryComplianceStandardName, regulatoryComplianceControlName, - regulatoryComplianceAssessmentName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RegulatoryComplianceAssessmentImpl(inner.getValue(), this.manager())); - } - - public RegulatoryComplianceAssessment get(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String regulatoryComplianceAssessmentName) { - RegulatoryComplianceAssessmentInner inner = this.serviceClient() - .get(regulatoryComplianceStandardName, regulatoryComplianceControlName, regulatoryComplianceAssessmentName); - if (inner != null) { - return new RegulatoryComplianceAssessmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName) { - PagedIterable inner - = this.serviceClient().list(regulatoryComplianceStandardName, regulatoryComplianceControlName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new RegulatoryComplianceAssessmentImpl(inner1, this.manager())); - } - - public PagedIterable list(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, String filter, Context context) { - PagedIterable inner = this.serviceClient() - .list(regulatoryComplianceStandardName, regulatoryComplianceControlName, filter, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new RegulatoryComplianceAssessmentImpl(inner1, this.manager())); - } - - private RegulatoryComplianceAssessmentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlImpl.java deleted file mode 100644 index ebd7fc130560..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceControlInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceControl; -import com.azure.resourcemanager.security.models.State; - -public final class RegulatoryComplianceControlImpl implements RegulatoryComplianceControl { - private RegulatoryComplianceControlInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - RegulatoryComplianceControlImpl(RegulatoryComplianceControlInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public String description() { - return this.innerModel().description(); - } - - public State state() { - return this.innerModel().state(); - } - - public Integer passedAssessments() { - return this.innerModel().passedAssessments(); - } - - public Integer failedAssessments() { - return this.innerModel().failedAssessments(); - } - - public Integer skippedAssessments() { - return this.innerModel().skippedAssessments(); - } - - public RegulatoryComplianceControlInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlsClientImpl.java deleted file mode 100644 index 489d22f0af22..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlsClientImpl.java +++ /dev/null @@ -1,429 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceControlsClient; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceControlInner; -import com.azure.resourcemanager.security.implementation.models.RegulatoryComplianceControlList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in RegulatoryComplianceControlsClient. - */ -public final class RegulatoryComplianceControlsClientImpl implements RegulatoryComplianceControlsClient { - /** - * The proxy service used to perform REST calls. - */ - private final RegulatoryComplianceControlsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of RegulatoryComplianceControlsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RegulatoryComplianceControlsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(RegulatoryComplianceControlsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterRegulatoryComplianceControls to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterRegulatoryComplianceControls") - public interface RegulatoryComplianceControlsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("regulatoryComplianceStandardName") String regulatoryComplianceStandardName, - @PathParam("regulatoryComplianceControlName") String regulatoryComplianceControlName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("regulatoryComplianceStandardName") String regulatoryComplianceStandardName, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getWithResponseAsync(String regulatoryComplianceStandardName, String regulatoryComplianceControlName) { - 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 (regulatoryComplianceStandardName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - if (regulatoryComplianceControlName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceControlName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - regulatoryComplianceStandardName, regulatoryComplianceControlName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName, 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 (regulatoryComplianceStandardName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - if (regulatoryComplianceControlName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceControlName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - regulatoryComplianceStandardName, regulatoryComplianceControlName, accept, context); - } - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName) { - return getWithResponseAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, Context context) { - return getWithResponseAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, context).block(); - } - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RegulatoryComplianceControlInner get(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName) { - return getWithResponse(regulatoryComplianceStandardName, regulatoryComplianceControlName, Context.NONE) - .getValue(); - } - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listSinglePageAsync(String regulatoryComplianceStandardName, String filter) { - 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 (regulatoryComplianceStandardName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - regulatoryComplianceStandardName, 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())); - } - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listSinglePageAsync(String regulatoryComplianceStandardName, String filter, 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 (regulatoryComplianceStandardName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - regulatoryComplianceStandardName, filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String regulatoryComplianceStandardName, - String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(regulatoryComplianceStandardName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String regulatoryComplianceStandardName) { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(regulatoryComplianceStandardName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String regulatoryComplianceStandardName, - String filter, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(regulatoryComplianceStandardName, filter, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String regulatoryComplianceStandardName) { - final String filter = null; - return new PagedIterable<>(listAsync(regulatoryComplianceStandardName, filter)); - } - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String regulatoryComplianceStandardName, String filter, - Context context) { - return new PagedIterable<>(listAsync(regulatoryComplianceStandardName, filter, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response 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 list of regulatory compliance controls response 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlsImpl.java deleted file mode 100644 index 5560dec2aba0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlsImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceControlsClient; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceControlInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceControl; -import com.azure.resourcemanager.security.models.RegulatoryComplianceControls; - -public final class RegulatoryComplianceControlsImpl implements RegulatoryComplianceControls { - private static final ClientLogger LOGGER = new ClientLogger(RegulatoryComplianceControlsImpl.class); - - private final RegulatoryComplianceControlsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public RegulatoryComplianceControlsImpl(RegulatoryComplianceControlsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(regulatoryComplianceStandardName, regulatoryComplianceControlName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RegulatoryComplianceControlImpl(inner.getValue(), this.manager())); - } - - public RegulatoryComplianceControl get(String regulatoryComplianceStandardName, - String regulatoryComplianceControlName) { - RegulatoryComplianceControlInner inner - = this.serviceClient().get(regulatoryComplianceStandardName, regulatoryComplianceControlName); - if (inner != null) { - return new RegulatoryComplianceControlImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String regulatoryComplianceStandardName) { - PagedIterable inner - = this.serviceClient().list(regulatoryComplianceStandardName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new RegulatoryComplianceControlImpl(inner1, this.manager())); - } - - public PagedIterable list(String regulatoryComplianceStandardName, String filter, - Context context) { - PagedIterable inner - = this.serviceClient().list(regulatoryComplianceStandardName, filter, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new RegulatoryComplianceControlImpl(inner1, this.manager())); - } - - private RegulatoryComplianceControlsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardImpl.java deleted file mode 100644 index 1fdf17f1016a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceStandard; -import com.azure.resourcemanager.security.models.State; - -public final class RegulatoryComplianceStandardImpl implements RegulatoryComplianceStandard { - private RegulatoryComplianceStandardInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - RegulatoryComplianceStandardImpl(RegulatoryComplianceStandardInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public State state() { - return this.innerModel().state(); - } - - public Integer passedControls() { - return this.innerModel().passedControls(); - } - - public Integer failedControls() { - return this.innerModel().failedControls(); - } - - public Integer skippedControls() { - return this.innerModel().skippedControls(); - } - - public Integer unsupportedControls() { - return this.innerModel().unsupportedControls(); - } - - public RegulatoryComplianceStandardInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardsClientImpl.java deleted file mode 100644 index e3c1d57c9ff8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardsClientImpl.java +++ /dev/null @@ -1,385 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceStandardsClient; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardInner; -import com.azure.resourcemanager.security.implementation.models.RegulatoryComplianceStandardList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in RegulatoryComplianceStandardsClient. - */ -public final class RegulatoryComplianceStandardsClientImpl implements RegulatoryComplianceStandardsClient { - /** - * The proxy service used to perform REST calls. - */ - private final RegulatoryComplianceStandardsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of RegulatoryComplianceStandardsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RegulatoryComplianceStandardsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(RegulatoryComplianceStandardsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterRegulatoryComplianceStandards to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterRegulatoryComplianceStandards") - public interface RegulatoryComplianceStandardsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("regulatoryComplianceStandardName") String regulatoryComplianceStandardName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getWithResponseAsync(String regulatoryComplianceStandardName) { - 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 (regulatoryComplianceStandardName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - regulatoryComplianceStandardName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getWithResponseAsync(String regulatoryComplianceStandardName, 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 (regulatoryComplianceStandardName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - regulatoryComplianceStandardName, accept, context); - } - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String regulatoryComplianceStandardName) { - return getWithResponseAsync(regulatoryComplianceStandardName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String regulatoryComplianceStandardName, - Context context) { - return getWithResponseAsync(regulatoryComplianceStandardName, context).block(); - } - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RegulatoryComplianceStandardInner get(String regulatoryComplianceStandardName) { - return getWithResponse(regulatoryComplianceStandardName, Context.NONE).getValue(); - } - - /** - * Supported regulatory compliance standards details and state. - * - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter) { - 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-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - 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())); - } - - /** - * Supported regulatory compliance standards details and state. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, 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-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Supported regulatory compliance standards details and state. - * - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Supported regulatory compliance standards details and state. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Supported regulatory compliance standards details and state. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Supported regulatory compliance standards details and state. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - return new PagedIterable<>(listAsync(filter)); - } - - /** - * Supported regulatory compliance standards details and state. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response 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 list of regulatory compliance standards response 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardsImpl.java deleted file mode 100644 index 705a4e60c28e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardsImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceStandardsClient; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceStandard; -import com.azure.resourcemanager.security.models.RegulatoryComplianceStandards; - -public final class RegulatoryComplianceStandardsImpl implements RegulatoryComplianceStandards { - private static final ClientLogger LOGGER = new ClientLogger(RegulatoryComplianceStandardsImpl.class); - - private final RegulatoryComplianceStandardsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public RegulatoryComplianceStandardsImpl(RegulatoryComplianceStandardsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String regulatoryComplianceStandardName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(regulatoryComplianceStandardName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RegulatoryComplianceStandardImpl(inner.getValue(), this.manager())); - } - - public RegulatoryComplianceStandard get(String regulatoryComplianceStandardName) { - RegulatoryComplianceStandardInner inner = this.serviceClient().get(regulatoryComplianceStandardName); - if (inner != null) { - return new RegulatoryComplianceStandardImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new RegulatoryComplianceStandardImpl(inner1, this.manager())); - } - - public PagedIterable list(String filter, Context context) { - PagedIterable inner = this.serviceClient().list(filter, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new RegulatoryComplianceStandardImpl(inner1, this.manager())); - } - - private RegulatoryComplianceStandardsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceManagerUtils.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceManagerUtils.java deleted file mode 100644 index 667239c36084..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceManagerUtils.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -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.util.CoreUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import reactor.core.publisher.Flux; - -final class ResourceManagerUtils { - private ResourceManagerUtils() { - } - - static String getValueFromIdByName(String id, String name) { - if (id == null) { - return null; - } - Iterator itr = Arrays.stream(id.split("/")).iterator(); - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && !part.trim().isEmpty()) { - if (part.equalsIgnoreCase(name)) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } - } - } - } - return null; - } - - static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { - if (id == null || pathTemplate == null) { - return null; - } - String parameterNameParentheses = "{" + parameterName + "}"; - List idSegmentsReverted = Arrays.asList(id.split("/")); - List pathSegments = Arrays.asList(pathTemplate.split("/")); - Collections.reverse(idSegmentsReverted); - Iterator idItrReverted = idSegmentsReverted.iterator(); - int pathIndex = pathSegments.size(); - while (idItrReverted.hasNext() && pathIndex > 0) { - String idSegment = idItrReverted.next(); - String pathSegment = pathSegments.get(--pathIndex); - if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { - if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { - if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { - List segments = new ArrayList<>(); - segments.add(idSegment); - idItrReverted.forEachRemaining(segments::add); - Collections.reverse(segments); - if (!segments.isEmpty() && segments.get(0).isEmpty()) { - segments.remove(0); - } - return String.join("/", segments); - } else { - return idSegment; - } - } - } - } - return null; - } - - static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl<>(pageIterable, mapper); - } - - private static final class PagedIterableImpl extends PagedIterable { - - private final PagedIterable pagedIterable; - private final Function mapper; - private final Function, PagedResponse> pageMapper; - - private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux - .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); - this.pagedIterable = pagedIterable; - this.mapper = mapper; - this.pageMapper = getPageMapper(mapper); - } - - private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), - null); - } - - @Override - public Stream stream() { - return pagedIterable.stream().map(mapper); - } - - @Override - public Stream> streamByPage() { - return pagedIterable.streamByPage().map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken) { - return pagedIterable.streamByPage(continuationToken).map(pageMapper); - } - - @Override - public Stream> streamByPage(int preferredPageSize) { - return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken, int preferredPageSize) { - return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); - } - - @Override - public Iterator iterator() { - return new IteratorImpl<>(pagedIterable.iterator(), mapper); - } - - @Override - public Iterable> iterableByPage() { - return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); - } - - @Override - public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); - } - } - - private static final class IteratorImpl implements Iterator { - - private final Iterator iterator; - private final Function mapper; - - private IteratorImpl(Iterator iterator, Function mapper) { - this.iterator = iterator; - this.mapper = mapper; - } - - @Override - public boolean hasNext() { - return iterator.hasNext(); - } - - @Override - public S next() { - return mapper.apply(iterator.next()); - } - - @Override - public void remove() { - iterator.remove(); - } - } - - private static final class IterableImpl implements Iterable { - - private final Iterable iterable; - private final Function mapper; - - private IterableImpl(Iterable iterable, Function mapper) { - this.iterable = iterable; - this.mapper = mapper; - } - - @Override - public Iterator iterator() { - return new IteratorImpl<>(iterable.iterator(), mapper); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RuleResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RuleResultsImpl.java deleted file mode 100644 index 907e43d05175..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RuleResultsImpl.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.RuleResultsInner; -import com.azure.resourcemanager.security.models.RuleResults; -import com.azure.resourcemanager.security.models.RuleResultsInput; -import com.azure.resourcemanager.security.models.RuleResultsProperties; -import java.util.List; - -public final class RuleResultsImpl implements RuleResults, RuleResults.Definition, RuleResults.Update { - private RuleResultsInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public RuleResultsProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public RuleResultsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceId; - - private String ruleId; - - private String createDatabaseName; - - private RuleResultsInput createBody; - - private String updateDatabaseName; - - private RuleResultsInput updateBody; - - public RuleResultsImpl withExistingResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - public RuleResults create() { - this.innerObject = serviceManager.serviceClient() - .getSqlVulnerabilityAssessmentBaselineRules() - .createOrUpdateWithResponse(resourceId, ruleId, createDatabaseName, createBody, Context.NONE) - .getValue(); - return this; - } - - public RuleResults create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSqlVulnerabilityAssessmentBaselineRules() - .createOrUpdateWithResponse(resourceId, ruleId, createDatabaseName, createBody, context) - .getValue(); - return this; - } - - RuleResultsImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.serviceManager = serviceManager; - this.ruleId = name; - this.createDatabaseName = null; - this.createBody = new RuleResultsInput(); - } - - public RuleResultsImpl update() { - this.updateDatabaseName = null; - this.updateBody = new RuleResultsInput(); - return this; - } - - public RuleResults apply() { - this.innerObject = serviceManager.serviceClient() - .getSqlVulnerabilityAssessmentBaselineRules() - .createOrUpdateWithResponse(resourceId, ruleId, updateDatabaseName, updateBody, Context.NONE) - .getValue(); - return this; - } - - public RuleResults apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSqlVulnerabilityAssessmentBaselineRules() - .createOrUpdateWithResponse(resourceId, ruleId, updateDatabaseName, updateBody, context) - .getValue(); - return this; - } - - RuleResultsImpl(RuleResultsInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceId = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}", - "resourceId"); - this.ruleId = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}", - "ruleId"); - } - - public RuleResults refresh() { - String localDatabaseName = null; - this.innerObject = serviceManager.serviceClient() - .getSqlVulnerabilityAssessmentBaselineRules() - .getWithResponse(resourceId, ruleId, localDatabaseName, Context.NONE) - .getValue(); - return this; - } - - public RuleResults refresh(Context context) { - String localDatabaseName = null; - this.innerObject = serviceManager.serviceClient() - .getSqlVulnerabilityAssessmentBaselineRules() - .getWithResponse(resourceId, ruleId, localDatabaseName, context) - .getValue(); - return this; - } - - public RuleResultsImpl withLatestScan(Boolean latestScan) { - if (isInCreateMode()) { - this.createBody.withLatestScan(latestScan); - return this; - } else { - this.updateBody.withLatestScan(latestScan); - return this; - } - } - - public RuleResultsImpl withResults(List> results) { - if (isInCreateMode()) { - this.createBody.withResults(results); - return this; - } else { - this.updateBody.withResults(results); - return this; - } - } - - public RuleResultsImpl withDatabaseName(String databaseName) { - if (isInCreateMode()) { - this.createDatabaseName = databaseName; - return this; - } else { - this.updateDatabaseName = databaseName; - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel() == null || this.innerModel().id() == null; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RulesResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RulesResultsImpl.java deleted file mode 100644 index c98721b82b03..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RulesResultsImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.RuleResultsInner; -import com.azure.resourcemanager.security.fluent.models.RulesResultsInner; -import com.azure.resourcemanager.security.models.RuleResults; -import com.azure.resourcemanager.security.models.RulesResults; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class RulesResultsImpl implements RulesResults { - private RulesResultsInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - RulesResultsImpl(RulesResultsInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList( - inner.stream().map(inner1 -> new RuleResultsImpl(inner1, this.manager())).collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public String nextLink() { - return this.innerModel().nextLink(); - } - - public RulesResultsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanResultImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanResultImpl.java deleted file mode 100644 index 9fc82677fa44..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanResultImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.ScanResultInner; -import com.azure.resourcemanager.security.models.ScanResult; -import com.azure.resourcemanager.security.models.ScanResultProperties; - -public final class ScanResultImpl implements ScanResult { - private ScanResultInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ScanResultImpl(ScanResultInner innerObject, com.azure.resourcemanager.security.SecurityManager 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 ScanResultProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ScanResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanV2Impl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanV2Impl.java deleted file mode 100644 index d619bf6dac0e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanV2Impl.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.ScanV2Inner; -import com.azure.resourcemanager.security.models.ScanPropertiesV2; -import com.azure.resourcemanager.security.models.ScanV2; - -public final class ScanV2Impl implements ScanV2 { - private ScanV2Inner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ScanV2Impl(ScanV2Inner innerObject, com.azure.resourcemanager.security.SecurityManager 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 ScanPropertiesV2 properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ScanV2Inner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDefinitionItemImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDefinitionItemImpl.java deleted file mode 100644 index 5a786482c09d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDefinitionItemImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner; -import com.azure.resourcemanager.security.models.AzureResourceLink; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionItem; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionSource; -import java.util.Collections; -import java.util.List; - -public final class SecureScoreControlDefinitionItemImpl implements SecureScoreControlDefinitionItem { - private SecureScoreControlDefinitionItemInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecureScoreControlDefinitionItemImpl(SecureScoreControlDefinitionItemInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String description() { - return this.innerModel().description(); - } - - public Integer maxScore() { - return this.innerModel().maxScore(); - } - - public SecureScoreControlDefinitionSource source() { - return this.innerModel().source(); - } - - public List assessmentDefinitions() { - List inner = this.innerModel().assessmentDefinitions(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public SecureScoreControlDefinitionItemInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDefinitionsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDefinitionsClientImpl.java deleted file mode 100644 index 2de14bf93423..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDefinitionsClientImpl.java +++ /dev/null @@ -1,418 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SecureScoreControlDefinitionsClient; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner; -import com.azure.resourcemanager.security.implementation.models.SecureScoreControlDefinitionList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SecureScoreControlDefinitionsClient. - */ -public final class SecureScoreControlDefinitionsClientImpl implements SecureScoreControlDefinitionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SecureScoreControlDefinitionsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecureScoreControlDefinitionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecureScoreControlDefinitionsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(SecureScoreControlDefinitionsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecureScoreControlDefinitions to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterSecureScoreControlDefinitions") - public interface SecureScoreControlDefinitionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Security/secureScoreControlDefinitions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControlDefinitions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscription(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * List the available security controls, their assessments, and the max score. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition 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 = "2020-01-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())); - } - - /** - * List the available security controls, their assessments, and the max score. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition 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 = "2020-01-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)); - } - - /** - * List the available security controls, their assessments, and the max score. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List the available security controls, their assessments, and the max score. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List the available security controls, their assessments, and the max score. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List the available security controls, their assessments, and the max score. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * For a specified subscription, list the available security controls, their assessments, and the max score. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionSinglePageAsync() { - 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 = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listBySubscription(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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * For a specified subscription, list the available security controls, their assessments, and the max score. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBySubscriptionSinglePageAsync(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 = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscription(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)); - } - - /** - * For a specified subscription, list the available security controls, their assessments, and the max score. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionAsync() { - return new PagedFlux<>(() -> listBySubscriptionSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * For a specified subscription, list the available security controls, their assessments, and the max score. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionAsync(Context context) { - return new PagedFlux<>(() -> listBySubscriptionSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * For a specified subscription, list the available security controls, their assessments, and the max score. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySubscription() { - return new PagedIterable<>(listBySubscriptionAsync()); - } - - /** - * For a specified subscription, list the available security controls, their assessments, and the max score. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySubscription(Context context) { - return new PagedIterable<>(listBySubscriptionAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition 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 list of security controls definition 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)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDefinitionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDefinitionsImpl.java deleted file mode 100644 index 95109f4b1ae6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDefinitionsImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.SecureScoreControlDefinitionsClient; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionItem; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitions; - -public final class SecureScoreControlDefinitionsImpl implements SecureScoreControlDefinitions { - private static final ClientLogger LOGGER = new ClientLogger(SecureScoreControlDefinitionsImpl.class); - - private final SecureScoreControlDefinitionsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecureScoreControlDefinitionsImpl(SecureScoreControlDefinitionsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new SecureScoreControlDefinitionItemImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new SecureScoreControlDefinitionItemImpl(inner1, this.manager())); - } - - public PagedIterable listBySubscription() { - PagedIterable inner = this.serviceClient().listBySubscription(); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new SecureScoreControlDefinitionItemImpl(inner1, this.manager())); - } - - public PagedIterable listBySubscription(Context context) { - PagedIterable inner = this.serviceClient().listBySubscription(context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new SecureScoreControlDefinitionItemImpl(inner1, this.manager())); - } - - private SecureScoreControlDefinitionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDetailsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDetailsImpl.java deleted file mode 100644 index 5367484caa36..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDetailsImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDetailsInner; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionItem; -import com.azure.resourcemanager.security.models.SecureScoreControlDetails; - -public final class SecureScoreControlDetailsImpl implements SecureScoreControlDetails { - private SecureScoreControlDetailsInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecureScoreControlDetailsImpl(SecureScoreControlDetailsInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public Integer healthyResourceCount() { - return this.innerModel().healthyResourceCount(); - } - - public Integer unhealthyResourceCount() { - return this.innerModel().unhealthyResourceCount(); - } - - public Integer notApplicableResourceCount() { - return this.innerModel().notApplicableResourceCount(); - } - - public Long weight() { - return this.innerModel().weight(); - } - - public SecureScoreControlDefinitionItem definition() { - SecureScoreControlDefinitionItemInner inner = this.innerModel().definition(); - if (inner != null) { - return new SecureScoreControlDefinitionItemImpl(inner, this.manager()); - } else { - return null; - } - } - - public Integer max() { - return this.innerModel().max(); - } - - public Double current() { - return this.innerModel().current(); - } - - public Double percentage() { - return this.innerModel().percentage(); - } - - public SecureScoreControlDetailsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlScoreDetailsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlScoreDetailsImpl.java deleted file mode 100644 index 51f5442ad9f8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlScoreDetailsImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlScoreDetailsInner; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionItem; -import com.azure.resourcemanager.security.models.SecureScoreControlScoreDetails; - -public final class SecureScoreControlScoreDetailsImpl implements SecureScoreControlScoreDetails { - private SecureScoreControlScoreDetailsInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecureScoreControlScoreDetailsImpl(SecureScoreControlScoreDetailsInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public Integer healthyResourceCount() { - return this.innerModel().healthyResourceCount(); - } - - public Integer unhealthyResourceCount() { - return this.innerModel().unhealthyResourceCount(); - } - - public Integer notApplicableResourceCount() { - return this.innerModel().notApplicableResourceCount(); - } - - public Long weight() { - return this.innerModel().weight(); - } - - public SecureScoreControlDefinitionItem definition() { - SecureScoreControlDefinitionItemInner inner = this.innerModel().definition(); - if (inner != null) { - return new SecureScoreControlDefinitionItemImpl(inner, this.manager()); - } else { - return null; - } - } - - public Integer max() { - return this.innerModel().max(); - } - - public Double current() { - return this.innerModel().current(); - } - - public Double percentage() { - return this.innerModel().percentage(); - } - - public SecureScoreControlScoreDetailsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlsClientImpl.java deleted file mode 100644 index 2d28f4a81dae..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlsClientImpl.java +++ /dev/null @@ -1,507 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SecureScoreControlsClient; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDetailsInner; -import com.azure.resourcemanager.security.implementation.models.SecureScoreControlList; -import com.azure.resourcemanager.security.models.ExpandControlsEnum; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SecureScoreControlsClient. - */ -public final class SecureScoreControlsClientImpl implements SecureScoreControlsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SecureScoreControlsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecureScoreControlsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecureScoreControlsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(SecureScoreControlsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecureScoreControls to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterSecureScoreControls") - public interface SecureScoreControlsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}/secureScoreControls") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySecureScore(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("secureScoreName") String secureScoreName, @QueryParam("$expand") ExpandControlsEnum expand, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControls") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") ExpandControlsEnum expand, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySecureScoreNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get all security controls for a specific initiative within a scope. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @param expand OData expand. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security controls for a specific initiative within a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySecureScoreSinglePageAsync(String secureScoreName, - ExpandControlsEnum expand) { - 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 (secureScoreName == null) { - return Mono - .error(new IllegalArgumentException("Parameter secureScoreName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listBySecureScore(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), secureScoreName, expand, 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 all security controls for a specific initiative within a scope. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security controls for a specific initiative within a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySecureScoreSinglePageAsync(String secureScoreName, - ExpandControlsEnum expand, 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 (secureScoreName == null) { - return Mono - .error(new IllegalArgumentException("Parameter secureScoreName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySecureScore(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), secureScoreName, - expand, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get all security controls for a specific initiative within a scope. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @param expand OData expand. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security controls for a specific initiative within a scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySecureScoreAsync(String secureScoreName, - ExpandControlsEnum expand) { - return new PagedFlux<>(() -> listBySecureScoreSinglePageAsync(secureScoreName, expand), - nextLink -> listBySecureScoreNextSinglePageAsync(nextLink)); - } - - /** - * Get all security controls for a specific initiative within a scope. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security controls for a specific initiative within a scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySecureScoreAsync(String secureScoreName) { - final ExpandControlsEnum expand = null; - return new PagedFlux<>(() -> listBySecureScoreSinglePageAsync(secureScoreName, expand), - nextLink -> listBySecureScoreNextSinglePageAsync(nextLink)); - } - - /** - * Get all security controls for a specific initiative within a scope. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security controls for a specific initiative within a scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySecureScoreAsync(String secureScoreName, - ExpandControlsEnum expand, Context context) { - return new PagedFlux<>(() -> listBySecureScoreSinglePageAsync(secureScoreName, expand, context), - nextLink -> listBySecureScoreNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all security controls for a specific initiative within a scope. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security controls for a specific initiative within a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySecureScore(String secureScoreName) { - final ExpandControlsEnum expand = null; - return new PagedIterable<>(listBySecureScoreAsync(secureScoreName, expand)); - } - - /** - * Get all security controls for a specific initiative within a scope. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security controls for a specific initiative within a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySecureScore(String secureScoreName, - ExpandControlsEnum expand, Context context) { - return new PagedIterable<>(listBySecureScoreAsync(secureScoreName, expand, context)); - } - - /** - * Get all security controls within a scope. - * - * @param expand OData expand. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security controls within a scope along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(ExpandControlsEnum expand) { - 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 = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - expand, 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 all security controls within a scope. - * - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security controls within a scope along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(ExpandControlsEnum expand, - 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 = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), expand, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get all security controls within a scope. - * - * @param expand OData expand. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security controls within a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(ExpandControlsEnum expand) { - return new PagedFlux<>(() -> listSinglePageAsync(expand), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all security controls within a scope. - * - * @throws 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 security controls within a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final ExpandControlsEnum expand = null; - return new PagedFlux<>(() -> listSinglePageAsync(expand), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all security controls within a scope. - * - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security controls within a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(ExpandControlsEnum expand, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(expand, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all security controls within a scope. - * - * @throws 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 security controls within a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final ExpandControlsEnum expand = null; - return new PagedIterable<>(listAsync(expand)); - } - - /** - * Get all security controls within a scope. - * - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security controls within a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(ExpandControlsEnum expand, Context context) { - return new PagedIterable<>(listAsync(expand, 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 all security controls for a specific initiative within a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySecureScoreNextSinglePageAsync(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.listBySecureScoreNext(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 all security controls for a specific initiative within a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySecureScoreNextSinglePageAsync(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.listBySecureScoreNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @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 security controls within a scope 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 all security controls within a scope 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlsImpl.java deleted file mode 100644 index 73971b9693cb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlsImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.SecureScoreControlsClient; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDetailsInner; -import com.azure.resourcemanager.security.models.ExpandControlsEnum; -import com.azure.resourcemanager.security.models.SecureScoreControlDetails; -import com.azure.resourcemanager.security.models.SecureScoreControls; - -public final class SecureScoreControlsImpl implements SecureScoreControls { - private static final ClientLogger LOGGER = new ClientLogger(SecureScoreControlsImpl.class); - - private final SecureScoreControlsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecureScoreControlsImpl(SecureScoreControlsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listBySecureScore(String secureScoreName) { - PagedIterable inner = this.serviceClient().listBySecureScore(secureScoreName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecureScoreControlDetailsImpl(inner1, this.manager())); - } - - public PagedIterable listBySecureScore(String secureScoreName, ExpandControlsEnum expand, - Context context) { - PagedIterable inner - = this.serviceClient().listBySecureScore(secureScoreName, expand, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecureScoreControlDetailsImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecureScoreControlDetailsImpl(inner1, this.manager())); - } - - public PagedIterable list(ExpandControlsEnum expand, Context context) { - PagedIterable inner = this.serviceClient().list(expand, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecureScoreControlDetailsImpl(inner1, this.manager())); - } - - private SecureScoreControlsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreItemImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreItemImpl.java deleted file mode 100644 index 3231158bb364..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreItemImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.SecureScoreItemInner; -import com.azure.resourcemanager.security.models.SecureScoreItem; - -public final class SecureScoreItemImpl implements SecureScoreItem { - private SecureScoreItemInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecureScoreItemImpl(SecureScoreItemInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public Long weight() { - return this.innerModel().weight(); - } - - public Integer max() { - return this.innerModel().max(); - } - - public Double current() { - return this.innerModel().current(); - } - - public Double percentage() { - return this.innerModel().percentage(); - } - - public SecureScoreItemInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoresClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoresClientImpl.java deleted file mode 100644 index 324d1352b493..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoresClientImpl.java +++ /dev/null @@ -1,366 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SecureScoresClient; -import com.azure.resourcemanager.security.fluent.models.SecureScoreItemInner; -import com.azure.resourcemanager.security.implementation.models.SecureScoresList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SecureScoresClient. - */ -public final class SecureScoresClientImpl implements SecureScoresClient { - /** - * The proxy service used to perform REST calls. - */ - private final SecureScoresService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecureScoresClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecureScoresClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(SecureScoresService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecureScores to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterSecureScores") - public interface SecureScoresService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("secureScoreName") String secureScoreName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC - * Default initiative, use 'ascScore'. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secure score for a specific Microsoft Defender for Cloud initiative within your current scope along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String secureScoreName) { - 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 (secureScoreName == null) { - return Mono - .error(new IllegalArgumentException("Parameter secureScoreName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - secureScoreName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC - * Default initiative, use 'ascScore'. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secure score for a specific Microsoft Defender for Cloud initiative within your current scope along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String secureScoreName, 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 (secureScoreName == null) { - return Mono - .error(new IllegalArgumentException("Parameter secureScoreName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), secureScoreName, - accept, context); - } - - /** - * Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC - * Default initiative, use 'ascScore'. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secure score for a specific Microsoft Defender for Cloud initiative within your current scope on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String secureScoreName) { - return getWithResponseAsync(secureScoreName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC - * Default initiative, use 'ascScore'. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secure score for a specific Microsoft Defender for Cloud initiative within your current scope along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String secureScoreName, Context context) { - return getWithResponseAsync(secureScoreName, context).block(); - } - - /** - * Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC - * Default initiative, use 'ascScore'. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secure score for a specific Microsoft Defender for Cloud initiative within your current scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecureScoreItemInner get(String secureScoreName) { - return getWithResponse(secureScoreName, Context.NONE).getValue(); - } - - /** - * List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of secure scores 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of secure scores 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-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)); - } - - /** - * List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of secure scores as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of secure scores as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of secure scores as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of secure scores 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 list of secure scores 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 list of secure scores 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoresImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoresImpl.java deleted file mode 100644 index 809eb8161cb6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoresImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SecureScoresClient; -import com.azure.resourcemanager.security.fluent.models.SecureScoreItemInner; -import com.azure.resourcemanager.security.models.SecureScoreItem; -import com.azure.resourcemanager.security.models.SecureScores; - -public final class SecureScoresImpl implements SecureScores { - private static final ClientLogger LOGGER = new ClientLogger(SecureScoresImpl.class); - - private final SecureScoresClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecureScoresImpl(SecureScoresClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String secureScoreName, Context context) { - Response inner = this.serviceClient().getWithResponse(secureScoreName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecureScoreItemImpl(inner.getValue(), this.manager())); - } - - public SecureScoreItem get(String secureScoreName) { - SecureScoreItemInner inner = this.serviceClient().get(secureScoreName); - if (inner != null) { - return new SecureScoreItemImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecureScoreItemImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecureScoreItemImpl(inner1, this.manager())); - } - - private SecureScoresClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentMetadataResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentMetadataResponseImpl.java deleted file mode 100644 index 9830ff379bdb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentMetadataResponseImpl.java +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner; -import com.azure.resourcemanager.security.models.AssessmentType; -import com.azure.resourcemanager.security.models.Categories; -import com.azure.resourcemanager.security.models.ImplementationEffort; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPartnerData; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataResponse; -import com.azure.resourcemanager.security.models.Severity; -import com.azure.resourcemanager.security.models.Tactics; -import com.azure.resourcemanager.security.models.Techniques; -import com.azure.resourcemanager.security.models.Threats; -import com.azure.resourcemanager.security.models.UserImpact; -import java.util.Collections; -import java.util.List; - -public final class SecurityAssessmentMetadataResponseImpl - implements SecurityAssessmentMetadataResponse, SecurityAssessmentMetadataResponse.Definition { - private SecurityAssessmentMetadataResponseInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecurityAssessmentMetadataResponseImpl(SecurityAssessmentMetadataResponseInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates() { - return this.innerModel().publishDates(); - } - - public String plannedDeprecationDate() { - return this.innerModel().plannedDeprecationDate(); - } - - public List tactics() { - List inner = this.innerModel().tactics(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List techniques() { - List inner = this.innerModel().techniques(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String policyDefinitionId() { - return this.innerModel().policyDefinitionId(); - } - - public String description() { - return this.innerModel().description(); - } - - public String remediationDescription() { - return this.innerModel().remediationDescription(); - } - - public List categories() { - List inner = this.innerModel().categories(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Severity severity() { - return this.innerModel().severity(); - } - - public UserImpact userImpact() { - return this.innerModel().userImpact(); - } - - public ImplementationEffort implementationEffort() { - return this.innerModel().implementationEffort(); - } - - public List threats() { - List inner = this.innerModel().threats(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Boolean preview() { - return this.innerModel().preview(); - } - - public AssessmentType assessmentType() { - return this.innerModel().assessmentType(); - } - - public SecurityAssessmentMetadataPartnerData partnerData() { - return this.innerModel().partnerData(); - } - - public SecurityAssessmentMetadataResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String assessmentMetadataName; - - public SecurityAssessmentMetadataResponse create() { - this.innerObject = serviceManager.serviceClient() - .getAssessmentsMetadatas() - .createInSubscriptionWithResponse(assessmentMetadataName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public SecurityAssessmentMetadataResponse create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAssessmentsMetadatas() - .createInSubscriptionWithResponse(assessmentMetadataName, this.innerModel(), context) - .getValue(); - return this; - } - - SecurityAssessmentMetadataResponseImpl(String name, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new SecurityAssessmentMetadataResponseInner(); - this.serviceManager = serviceManager; - this.assessmentMetadataName = name; - } - - public SecurityAssessmentMetadataResponse refresh() { - this.innerObject = serviceManager.serviceClient() - .getAssessmentsMetadatas() - .getInSubscriptionWithResponse(assessmentMetadataName, Context.NONE) - .getValue(); - return this; - } - - public SecurityAssessmentMetadataResponse refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAssessmentsMetadatas() - .getInSubscriptionWithResponse(assessmentMetadataName, context) - .getValue(); - return this; - } - - public SecurityAssessmentMetadataResponseImpl - withPublishDates(SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates) { - this.innerModel().withPublishDates(publishDates); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withPlannedDeprecationDate(String plannedDeprecationDate) { - this.innerModel().withPlannedDeprecationDate(plannedDeprecationDate); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withTactics(List tactics) { - this.innerModel().withTactics(tactics); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withTechniques(List techniques) { - this.innerModel().withTechniques(techniques); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withDisplayName(String displayName) { - this.innerModel().withDisplayName(displayName); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withDescription(String description) { - this.innerModel().withDescription(description); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withRemediationDescription(String remediationDescription) { - this.innerModel().withRemediationDescription(remediationDescription); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withCategories(List categories) { - this.innerModel().withCategories(categories); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withSeverity(Severity severity) { - this.innerModel().withSeverity(severity); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withUserImpact(UserImpact userImpact) { - this.innerModel().withUserImpact(userImpact); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withImplementationEffort(ImplementationEffort implementationEffort) { - this.innerModel().withImplementationEffort(implementationEffort); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withThreats(List threats) { - this.innerModel().withThreats(threats); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withPreview(Boolean preview) { - this.innerModel().withPreview(preview); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withAssessmentType(AssessmentType assessmentType) { - this.innerModel().withAssessmentType(assessmentType); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withPartnerData(SecurityAssessmentMetadataPartnerData partnerData) { - this.innerModel().withPartnerData(partnerData); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentResponseImpl.java deleted file mode 100644 index 0e33684afbd5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentResponseImpl.java +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner; -import com.azure.resourcemanager.security.models.AssessmentLinks; -import com.azure.resourcemanager.security.models.AssessmentStatus; -import com.azure.resourcemanager.security.models.AssessmentStatusResponse; -import com.azure.resourcemanager.security.models.ExpandEnum; -import com.azure.resourcemanager.security.models.ResourceDetails; -import com.azure.resourcemanager.security.models.SecurityAssessment; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataProperties; -import com.azure.resourcemanager.security.models.SecurityAssessmentPartnerData; -import com.azure.resourcemanager.security.models.SecurityAssessmentPropertiesBaseRisk; -import com.azure.resourcemanager.security.models.SecurityAssessmentResponse; -import java.util.Collections; -import java.util.Map; - -public final class SecurityAssessmentResponseImpl - implements SecurityAssessmentResponse, SecurityAssessmentResponse.Definition, SecurityAssessmentResponse.Update { - private SecurityAssessmentResponseInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager 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 AssessmentStatusResponse status() { - return this.innerModel().status(); - } - - public SecurityAssessmentPropertiesBaseRisk risk() { - return this.innerModel().risk(); - } - - public ResourceDetails resourceDetails() { - return this.innerModel().resourceDetails(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public Map additionalData() { - Map inner = this.innerModel().additionalData(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public AssessmentLinks links() { - return this.innerModel().links(); - } - - public SecurityAssessmentMetadataProperties metadata() { - return this.innerModel().metadata(); - } - - public SecurityAssessmentPartnerData partnersData() { - return this.innerModel().partnersData(); - } - - public SecurityAssessmentResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceId; - - private String assessmentName; - - private SecurityAssessment createAssessment; - - private SecurityAssessment updateAssessment; - - public SecurityAssessmentResponseImpl withExistingResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - public SecurityAssessmentResponse create() { - this.innerObject = serviceManager.serviceClient() - .getAssessments() - .createOrUpdateWithResponse(resourceId, assessmentName, createAssessment, Context.NONE) - .getValue(); - return this; - } - - public SecurityAssessmentResponse create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAssessments() - .createOrUpdateWithResponse(resourceId, assessmentName, createAssessment, context) - .getValue(); - return this; - } - - SecurityAssessmentResponseImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.serviceManager = serviceManager; - this.assessmentName = name; - this.createAssessment = new SecurityAssessment(); - } - - public SecurityAssessmentResponseImpl update() { - this.updateAssessment = new SecurityAssessment(); - return this; - } - - public SecurityAssessmentResponse apply() { - this.innerObject = serviceManager.serviceClient() - .getAssessments() - .createOrUpdateWithResponse(resourceId, assessmentName, updateAssessment, Context.NONE) - .getValue(); - return this; - } - - public SecurityAssessmentResponse apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getAssessments() - .createOrUpdateWithResponse(resourceId, assessmentName, updateAssessment, context) - .getValue(); - return this; - } - - SecurityAssessmentResponseImpl(SecurityAssessmentResponseInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceId = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "resourceId"); - this.assessmentName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "assessmentName"); - } - - public SecurityAssessmentResponse refresh() { - ExpandEnum localExpand = null; - this.innerObject = serviceManager.serviceClient() - .getAssessments() - .getWithResponse(resourceId, assessmentName, localExpand, Context.NONE) - .getValue(); - return this; - } - - public SecurityAssessmentResponse refresh(Context context) { - ExpandEnum localExpand = null; - this.innerObject = serviceManager.serviceClient() - .getAssessments() - .getWithResponse(resourceId, assessmentName, localExpand, context) - .getValue(); - return this; - } - - public SecurityAssessmentResponseImpl withStatus(AssessmentStatus status) { - if (isInCreateMode()) { - this.createAssessment.withStatus(status); - return this; - } else { - this.updateAssessment.withStatus(status); - return this; - } - } - - public SecurityAssessmentResponseImpl withRisk(SecurityAssessmentPropertiesBaseRisk risk) { - if (isInCreateMode()) { - this.createAssessment.withRisk(risk); - return this; - } else { - this.updateAssessment.withRisk(risk); - return this; - } - } - - public SecurityAssessmentResponseImpl withResourceDetails(ResourceDetails resourceDetails) { - if (isInCreateMode()) { - this.createAssessment.withResourceDetails(resourceDetails); - return this; - } else { - this.updateAssessment.withResourceDetails(resourceDetails); - return this; - } - } - - public SecurityAssessmentResponseImpl withAdditionalData(Map additionalData) { - if (isInCreateMode()) { - this.createAssessment.withAdditionalData(additionalData); - return this; - } else { - this.updateAssessment.withAdditionalData(additionalData); - return this; - } - } - - public SecurityAssessmentResponseImpl withMetadata(SecurityAssessmentMetadataProperties metadata) { - if (isInCreateMode()) { - this.createAssessment.withMetadata(metadata); - return this; - } else { - this.updateAssessment.withMetadata(metadata); - return this; - } - } - - public SecurityAssessmentResponseImpl withPartnersData(SecurityAssessmentPartnerData partnersData) { - if (isInCreateMode()) { - this.createAssessment.withPartnersData(partnersData); - return this; - } else { - this.updateAssessment.withPartnersData(partnersData); - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel() == null || this.innerModel().id() == null; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterBuilder.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterBuilder.java deleted file mode 100644 index b2a8f4fe8f23..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterBuilder.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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 SecurityCenterImpl type. - */ -@ServiceClientBuilder(serviceClients = { SecurityCenterImpl.class }) -public final class SecurityCenterBuilder { - /* - * Service host - */ - private String endpoint; - - /** - * Sets Service host. - * - * @param endpoint the endpoint value. - * @return the SecurityCenterBuilder. - */ - public SecurityCenterBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The ID of the target subscription. The value must be an UUID. - */ - private String subscriptionId; - - /** - * Sets The ID of the target subscription. The value must be an UUID. - * - * @param subscriptionId the subscriptionId value. - * @return the SecurityCenterBuilder. - */ - public SecurityCenterBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the SecurityCenterBuilder. - */ - public SecurityCenterBuilder 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 SecurityCenterBuilder. - */ - public SecurityCenterBuilder 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 SecurityCenterBuilder. - */ - public SecurityCenterBuilder 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 SecurityCenterBuilder. - */ - public SecurityCenterBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of SecurityCenterImpl with the provided parameters. - * - * @return an instance of SecurityCenterImpl. - */ - public SecurityCenterImpl 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(); - SecurityCenterImpl client = new SecurityCenterImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); - return client; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java deleted file mode 100644 index 2328e982e761..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java +++ /dev/null @@ -1,1444 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.Response; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.exception.ManagementError; -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.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.serializer.SerializerAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.security.fluent.AdvancedThreatProtectionsClient; -import com.azure.resourcemanager.security.fluent.AlertsClient; -import com.azure.resourcemanager.security.fluent.AlertsSuppressionRulesClient; -import com.azure.resourcemanager.security.fluent.AllowedConnectionsClient; -import com.azure.resourcemanager.security.fluent.ApiCollectionsClient; -import com.azure.resourcemanager.security.fluent.ApplicationsClient; -import com.azure.resourcemanager.security.fluent.AssessmentsClient; -import com.azure.resourcemanager.security.fluent.AssessmentsMetadatasClient; -import com.azure.resourcemanager.security.fluent.AssignmentsClient; -import com.azure.resourcemanager.security.fluent.AutoProvisioningSettingsClient; -import com.azure.resourcemanager.security.fluent.AutomationsClient; -import com.azure.resourcemanager.security.fluent.AzureDevOpsOrgsClient; -import com.azure.resourcemanager.security.fluent.AzureDevOpsProjectsClient; -import com.azure.resourcemanager.security.fluent.AzureDevOpsReposClient; -import com.azure.resourcemanager.security.fluent.ComplianceResultsClient; -import com.azure.resourcemanager.security.fluent.CompliancesClient; -import com.azure.resourcemanager.security.fluent.CustomRecommendationsClient; -import com.azure.resourcemanager.security.fluent.DefenderForStoragesClient; -import com.azure.resourcemanager.security.fluent.DevOpsConfigurationsClient; -import com.azure.resourcemanager.security.fluent.DevOpsOperationResultsClient; -import com.azure.resourcemanager.security.fluent.DeviceSecurityGroupsClient; -import com.azure.resourcemanager.security.fluent.DiscoveredSecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.ExternalSecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.GitHubIssuesClient; -import com.azure.resourcemanager.security.fluent.GitHubOwnersClient; -import com.azure.resourcemanager.security.fluent.GitHubReposClient; -import com.azure.resourcemanager.security.fluent.GitLabGroupsClient; -import com.azure.resourcemanager.security.fluent.GitLabProjectsClient; -import com.azure.resourcemanager.security.fluent.GitLabSubgroupsClient; -import com.azure.resourcemanager.security.fluent.GovernanceAssignmentsClient; -import com.azure.resourcemanager.security.fluent.GovernanceRulesClient; -import com.azure.resourcemanager.security.fluent.HealthReportsClient; -import com.azure.resourcemanager.security.fluent.InformationProtectionPoliciesClient; -import com.azure.resourcemanager.security.fluent.IotSecuritySolutionAnalyticsClient; -import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsAnalyticsAggregatedAlertsClient; -import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsAnalyticsRecommendationsClient; -import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.JitNetworkAccessPoliciesClient; -import com.azure.resourcemanager.security.fluent.LocationsClient; -import com.azure.resourcemanager.security.fluent.MdeOnboardingsClient; -import com.azure.resourcemanager.security.fluent.OperationResultsClient; -import com.azure.resourcemanager.security.fluent.OperationStatusesClient; -import com.azure.resourcemanager.security.fluent.OperationsClient; -import com.azure.resourcemanager.security.fluent.PricingsClient; -import com.azure.resourcemanager.security.fluent.PrivateEndpointConnectionsClient; -import com.azure.resourcemanager.security.fluent.PrivateLinkResourcesClient; -import com.azure.resourcemanager.security.fluent.PrivateLinksClient; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceAssessmentsClient; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceControlsClient; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceStandardsClient; -import com.azure.resourcemanager.security.fluent.SecureScoreControlDefinitionsClient; -import com.azure.resourcemanager.security.fluent.SecureScoreControlsClient; -import com.azure.resourcemanager.security.fluent.SecureScoresClient; -import com.azure.resourcemanager.security.fluent.SecurityCenter; -import com.azure.resourcemanager.security.fluent.SecurityConnectorApplicationsClient; -import com.azure.resourcemanager.security.fluent.SecurityConnectorsClient; -import com.azure.resourcemanager.security.fluent.SecurityContactsClient; -import com.azure.resourcemanager.security.fluent.SecurityOperatorsClient; -import com.azure.resourcemanager.security.fluent.SecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.SecuritySolutionsReferenceDatasClient; -import com.azure.resourcemanager.security.fluent.SecurityStandardsClient; -import com.azure.resourcemanager.security.fluent.SensitivitySettingsClient; -import com.azure.resourcemanager.security.fluent.ServerVulnerabilityAssessmentsClient; -import com.azure.resourcemanager.security.fluent.ServerVulnerabilityAssessmentsSettingsClient; -import com.azure.resourcemanager.security.fluent.SettingsClient; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentBaselineRulesClient; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentScanResultsClient; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentScansClient; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentSettingsOperationsClient; -import com.azure.resourcemanager.security.fluent.StandardAssignmentsClient; -import com.azure.resourcemanager.security.fluent.StandardsClient; -import com.azure.resourcemanager.security.fluent.SubAssessmentsClient; -import com.azure.resourcemanager.security.fluent.TasksClient; -import com.azure.resourcemanager.security.fluent.TopologiesClient; -import com.azure.resourcemanager.security.fluent.WorkspaceSettingsClient; -import java.io.IOException; -import java.lang.reflect.Type; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the SecurityCenterImpl type. - */ -@ServiceClient(builder = SecurityCenterBuilder.class) -public final class SecurityCenterImpl implements SecurityCenter { - /** - * Service host. - */ - private final String endpoint; - - /** - * Gets Service host. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** - * 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. - */ - 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 AlertsClient object to access its operations. - */ - private final AlertsClient alerts; - - /** - * Gets the AlertsClient object to access its operations. - * - * @return the AlertsClient object. - */ - public AlertsClient getAlerts() { - return this.alerts; - } - - /** - * The AlertsSuppressionRulesClient object to access its operations. - */ - private final AlertsSuppressionRulesClient alertsSuppressionRules; - - /** - * Gets the AlertsSuppressionRulesClient object to access its operations. - * - * @return the AlertsSuppressionRulesClient object. - */ - public AlertsSuppressionRulesClient getAlertsSuppressionRules() { - return this.alertsSuppressionRules; - } - - /** - * The ApiCollectionsClient object to access its operations. - */ - private final ApiCollectionsClient apiCollections; - - /** - * Gets the ApiCollectionsClient object to access its operations. - * - * @return the ApiCollectionsClient object. - */ - public ApiCollectionsClient getApiCollections() { - return this.apiCollections; - } - - /** - * The ApplicationsClient object to access its operations. - */ - private final ApplicationsClient applications; - - /** - * Gets the ApplicationsClient object to access its operations. - * - * @return the ApplicationsClient object. - */ - public ApplicationsClient getApplications() { - return this.applications; - } - - /** - * The AssessmentsMetadatasClient object to access its operations. - */ - private final AssessmentsMetadatasClient assessmentsMetadatas; - - /** - * Gets the AssessmentsMetadatasClient object to access its operations. - * - * @return the AssessmentsMetadatasClient object. - */ - public AssessmentsMetadatasClient getAssessmentsMetadatas() { - return this.assessmentsMetadatas; - } - - /** - * The AutomationsClient object to access its operations. - */ - private final AutomationsClient automations; - - /** - * Gets the AutomationsClient object to access its operations. - * - * @return the AutomationsClient object. - */ - public AutomationsClient getAutomations() { - return this.automations; - } - - /** - * The SecurityContactsClient object to access its operations. - */ - private final SecurityContactsClient securityContacts; - - /** - * Gets the SecurityContactsClient object to access its operations. - * - * @return the SecurityContactsClient object. - */ - public SecurityContactsClient getSecurityContacts() { - return this.securityContacts; - } - - /** - * The ComplianceResultsClient object to access its operations. - */ - private final ComplianceResultsClient complianceResults; - - /** - * Gets the ComplianceResultsClient object to access its operations. - * - * @return the ComplianceResultsClient object. - */ - public ComplianceResultsClient getComplianceResults() { - return this.complianceResults; - } - - /** - * The GovernanceAssignmentsClient object to access its operations. - */ - private final GovernanceAssignmentsClient governanceAssignments; - - /** - * Gets the GovernanceAssignmentsClient object to access its operations. - * - * @return the GovernanceAssignmentsClient object. - */ - public GovernanceAssignmentsClient getGovernanceAssignments() { - return this.governanceAssignments; - } - - /** - * The GovernanceRulesClient object to access its operations. - */ - private final GovernanceRulesClient governanceRules; - - /** - * Gets the GovernanceRulesClient object to access its operations. - * - * @return the GovernanceRulesClient object. - */ - public GovernanceRulesClient getGovernanceRules() { - return this.governanceRules; - } - - /** - * The HealthReportsClient object to access its operations. - */ - private final HealthReportsClient healthReports; - - /** - * Gets the HealthReportsClient object to access its operations. - * - * @return the HealthReportsClient object. - */ - public HealthReportsClient getHealthReports() { - return this.healthReports; - } - - /** - * The DeviceSecurityGroupsClient object to access its operations. - */ - private final DeviceSecurityGroupsClient deviceSecurityGroups; - - /** - * Gets the DeviceSecurityGroupsClient object to access its operations. - * - * @return the DeviceSecurityGroupsClient object. - */ - public DeviceSecurityGroupsClient getDeviceSecurityGroups() { - return this.deviceSecurityGroups; - } - - /** - * The AutoProvisioningSettingsClient object to access its operations. - */ - private final AutoProvisioningSettingsClient autoProvisioningSettings; - - /** - * Gets the AutoProvisioningSettingsClient object to access its operations. - * - * @return the AutoProvisioningSettingsClient object. - */ - public AutoProvisioningSettingsClient getAutoProvisioningSettings() { - return this.autoProvisioningSettings; - } - - /** - * The CompliancesClient object to access its operations. - */ - private final CompliancesClient compliances; - - /** - * Gets the CompliancesClient object to access its operations. - * - * @return the CompliancesClient object. - */ - public CompliancesClient getCompliances() { - return this.compliances; - } - - /** - * The InformationProtectionPoliciesClient object to access its operations. - */ - private final InformationProtectionPoliciesClient informationProtectionPolicies; - - /** - * Gets the InformationProtectionPoliciesClient object to access its operations. - * - * @return the InformationProtectionPoliciesClient object. - */ - public InformationProtectionPoliciesClient getInformationProtectionPolicies() { - return this.informationProtectionPolicies; - } - - /** - * The WorkspaceSettingsClient object to access its operations. - */ - private final WorkspaceSettingsClient workspaceSettings; - - /** - * Gets the WorkspaceSettingsClient object to access its operations. - * - * @return the WorkspaceSettingsClient object. - */ - public WorkspaceSettingsClient getWorkspaceSettings() { - return this.workspaceSettings; - } - - /** - * The MdeOnboardingsClient object to access its operations. - */ - private final MdeOnboardingsClient mdeOnboardings; - - /** - * Gets the MdeOnboardingsClient object to access its operations. - * - * @return the MdeOnboardingsClient object. - */ - public MdeOnboardingsClient getMdeOnboardings() { - return this.mdeOnboardings; - } - - /** - * The OperationsClient object to access its operations. - */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** - * The PricingsClient object to access its operations. - */ - private final PricingsClient pricings; - - /** - * Gets the PricingsClient object to access its operations. - * - * @return the PricingsClient object. - */ - public PricingsClient getPricings() { - return this.pricings; - } - - /** - * The PrivateLinkResourcesClient object to access its operations. - */ - private final PrivateLinkResourcesClient privateLinkResources; - - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - public PrivateLinkResourcesClient getPrivateLinkResources() { - return this.privateLinkResources; - } - - /** - * The PrivateEndpointConnectionsClient object to access its operations. - */ - private final PrivateEndpointConnectionsClient privateEndpointConnections; - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** - * The RegulatoryComplianceStandardsClient object to access its operations. - */ - private final RegulatoryComplianceStandardsClient regulatoryComplianceStandards; - - /** - * Gets the RegulatoryComplianceStandardsClient object to access its operations. - * - * @return the RegulatoryComplianceStandardsClient object. - */ - public RegulatoryComplianceStandardsClient getRegulatoryComplianceStandards() { - return this.regulatoryComplianceStandards; - } - - /** - * The RegulatoryComplianceControlsClient object to access its operations. - */ - private final RegulatoryComplianceControlsClient regulatoryComplianceControls; - - /** - * Gets the RegulatoryComplianceControlsClient object to access its operations. - * - * @return the RegulatoryComplianceControlsClient object. - */ - public RegulatoryComplianceControlsClient getRegulatoryComplianceControls() { - return this.regulatoryComplianceControls; - } - - /** - * The RegulatoryComplianceAssessmentsClient object to access its operations. - */ - private final RegulatoryComplianceAssessmentsClient regulatoryComplianceAssessments; - - /** - * Gets the RegulatoryComplianceAssessmentsClient object to access its operations. - * - * @return the RegulatoryComplianceAssessmentsClient object. - */ - public RegulatoryComplianceAssessmentsClient getRegulatoryComplianceAssessments() { - return this.regulatoryComplianceAssessments; - } - - /** - * The SecurityConnectorsClient object to access its operations. - */ - private final SecurityConnectorsClient securityConnectors; - - /** - * Gets the SecurityConnectorsClient object to access its operations. - * - * @return the SecurityConnectorsClient object. - */ - public SecurityConnectorsClient getSecurityConnectors() { - return this.securityConnectors; - } - - /** - * The AzureDevOpsOrgsClient object to access its operations. - */ - private final AzureDevOpsOrgsClient azureDevOpsOrgs; - - /** - * Gets the AzureDevOpsOrgsClient object to access its operations. - * - * @return the AzureDevOpsOrgsClient object. - */ - public AzureDevOpsOrgsClient getAzureDevOpsOrgs() { - return this.azureDevOpsOrgs; - } - - /** - * The GitHubOwnersClient object to access its operations. - */ - private final GitHubOwnersClient gitHubOwners; - - /** - * Gets the GitHubOwnersClient object to access its operations. - * - * @return the GitHubOwnersClient object. - */ - public GitHubOwnersClient getGitHubOwners() { - return this.gitHubOwners; - } - - /** - * The GitLabGroupsClient object to access its operations. - */ - private final GitLabGroupsClient gitLabGroups; - - /** - * Gets the GitLabGroupsClient object to access its operations. - * - * @return the GitLabGroupsClient object. - */ - public GitLabGroupsClient getGitLabGroups() { - return this.gitLabGroups; - } - - /** - * The DevOpsConfigurationsClient object to access its operations. - */ - private final DevOpsConfigurationsClient devOpsConfigurations; - - /** - * Gets the DevOpsConfigurationsClient object to access its operations. - * - * @return the DevOpsConfigurationsClient object. - */ - public DevOpsConfigurationsClient getDevOpsConfigurations() { - return this.devOpsConfigurations; - } - - /** - * The AzureDevOpsProjectsClient object to access its operations. - */ - private final AzureDevOpsProjectsClient azureDevOpsProjects; - - /** - * Gets the AzureDevOpsProjectsClient object to access its operations. - * - * @return the AzureDevOpsProjectsClient object. - */ - public AzureDevOpsProjectsClient getAzureDevOpsProjects() { - return this.azureDevOpsProjects; - } - - /** - * The GitLabProjectsClient object to access its operations. - */ - private final GitLabProjectsClient gitLabProjects; - - /** - * Gets the GitLabProjectsClient object to access its operations. - * - * @return the GitLabProjectsClient object. - */ - public GitLabProjectsClient getGitLabProjects() { - return this.gitLabProjects; - } - - /** - * The SecurityOperatorsClient object to access its operations. - */ - private final SecurityOperatorsClient securityOperators; - - /** - * Gets the SecurityOperatorsClient object to access its operations. - * - * @return the SecurityOperatorsClient object. - */ - public SecurityOperatorsClient getSecurityOperators() { - return this.securityOperators; - } - - /** - * The DiscoveredSecuritySolutionsClient object to access its operations. - */ - private final DiscoveredSecuritySolutionsClient discoveredSecuritySolutions; - - /** - * Gets the DiscoveredSecuritySolutionsClient object to access its operations. - * - * @return the DiscoveredSecuritySolutionsClient object. - */ - public DiscoveredSecuritySolutionsClient getDiscoveredSecuritySolutions() { - return this.discoveredSecuritySolutions; - } - - /** - * The ExternalSecuritySolutionsClient object to access its operations. - */ - private final ExternalSecuritySolutionsClient externalSecuritySolutions; - - /** - * Gets the ExternalSecuritySolutionsClient object to access its operations. - * - * @return the ExternalSecuritySolutionsClient object. - */ - public ExternalSecuritySolutionsClient getExternalSecuritySolutions() { - return this.externalSecuritySolutions; - } - - /** - * The JitNetworkAccessPoliciesClient object to access its operations. - */ - private final JitNetworkAccessPoliciesClient jitNetworkAccessPolicies; - - /** - * Gets the JitNetworkAccessPoliciesClient object to access its operations. - * - * @return the JitNetworkAccessPoliciesClient object. - */ - public JitNetworkAccessPoliciesClient getJitNetworkAccessPolicies() { - return this.jitNetworkAccessPolicies; - } - - /** - * The SecuritySolutionsClient object to access its operations. - */ - private final SecuritySolutionsClient securitySolutions; - - /** - * Gets the SecuritySolutionsClient object to access its operations. - * - * @return the SecuritySolutionsClient object. - */ - public SecuritySolutionsClient getSecuritySolutions() { - return this.securitySolutions; - } - - /** - * The SecurityStandardsClient object to access its operations. - */ - private final SecurityStandardsClient securityStandards; - - /** - * Gets the SecurityStandardsClient object to access its operations. - * - * @return the SecurityStandardsClient object. - */ - public SecurityStandardsClient getSecurityStandards() { - return this.securityStandards; - } - - /** - * The StandardAssignmentsClient object to access its operations. - */ - private final StandardAssignmentsClient standardAssignments; - - /** - * Gets the StandardAssignmentsClient object to access its operations. - * - * @return the StandardAssignmentsClient object. - */ - public StandardAssignmentsClient getStandardAssignments() { - return this.standardAssignments; - } - - /** - * The CustomRecommendationsClient object to access its operations. - */ - private final CustomRecommendationsClient customRecommendations; - - /** - * Gets the CustomRecommendationsClient object to access its operations. - * - * @return the CustomRecommendationsClient object. - */ - public CustomRecommendationsClient getCustomRecommendations() { - return this.customRecommendations; - } - - /** - * The ServerVulnerabilityAssessmentsSettingsClient object to access its operations. - */ - private final ServerVulnerabilityAssessmentsSettingsClient serverVulnerabilityAssessmentsSettings; - - /** - * Gets the ServerVulnerabilityAssessmentsSettingsClient object to access its operations. - * - * @return the ServerVulnerabilityAssessmentsSettingsClient object. - */ - public ServerVulnerabilityAssessmentsSettingsClient getServerVulnerabilityAssessmentsSettings() { - return this.serverVulnerabilityAssessmentsSettings; - } - - /** - * The SettingsClient object to access its operations. - */ - private final SettingsClient settings; - - /** - * Gets the SettingsClient object to access its operations. - * - * @return the SettingsClient object. - */ - public SettingsClient getSettings() { - return this.settings; - } - - /** - * The SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. - */ - private final SqlVulnerabilityAssessmentBaselineRulesClient sqlVulnerabilityAssessmentBaselineRules; - - /** - * Gets the SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentBaselineRulesClient object. - */ - public SqlVulnerabilityAssessmentBaselineRulesClient getSqlVulnerabilityAssessmentBaselineRules() { - return this.sqlVulnerabilityAssessmentBaselineRules; - } - - /** - * The SqlVulnerabilityAssessmentScanResultsClient object to access its operations. - */ - private final SqlVulnerabilityAssessmentScanResultsClient sqlVulnerabilityAssessmentScanResults; - - /** - * Gets the SqlVulnerabilityAssessmentScanResultsClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentScanResultsClient object. - */ - public SqlVulnerabilityAssessmentScanResultsClient getSqlVulnerabilityAssessmentScanResults() { - return this.sqlVulnerabilityAssessmentScanResults; - } - - /** - * The StandardsClient object to access its operations. - */ - private final StandardsClient standards; - - /** - * Gets the StandardsClient object to access its operations. - * - * @return the StandardsClient object. - */ - public StandardsClient getStandards() { - return this.standards; - } - - /** - * The AssignmentsClient object to access its operations. - */ - private final AssignmentsClient assignments; - - /** - * Gets the AssignmentsClient object to access its operations. - * - * @return the AssignmentsClient object. - */ - public AssignmentsClient getAssignments() { - return this.assignments; - } - - /** - * 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; - } - - /** - * The SecurityConnectorApplicationsClient object to access its operations. - */ - private final SecurityConnectorApplicationsClient securityConnectorApplications; - - /** - * Gets the SecurityConnectorApplicationsClient object to access its operations. - * - * @return the SecurityConnectorApplicationsClient object. - */ - public SecurityConnectorApplicationsClient getSecurityConnectorApplications() { - return this.securityConnectorApplications; - } - - /** - * The AssessmentsClient object to access its operations. - */ - private final AssessmentsClient assessments; - - /** - * Gets the AssessmentsClient object to access its operations. - * - * @return the AssessmentsClient object. - */ - public AssessmentsClient getAssessments() { - return this.assessments; - } - - /** - * The AdvancedThreatProtectionsClient object to access its operations. - */ - private final AdvancedThreatProtectionsClient advancedThreatProtections; - - /** - * Gets the AdvancedThreatProtectionsClient object to access its operations. - * - * @return the AdvancedThreatProtectionsClient object. - */ - public AdvancedThreatProtectionsClient getAdvancedThreatProtections() { - return this.advancedThreatProtections; - } - - /** - * The DefenderForStoragesClient object to access its operations. - */ - private final DefenderForStoragesClient defenderForStorages; - - /** - * Gets the DefenderForStoragesClient object to access its operations. - * - * @return the DefenderForStoragesClient object. - */ - public DefenderForStoragesClient getDefenderForStorages() { - return this.defenderForStorages; - } - - /** - * The IotSecuritySolutionAnalyticsClient object to access its operations. - */ - private final IotSecuritySolutionAnalyticsClient iotSecuritySolutionAnalytics; - - /** - * Gets the IotSecuritySolutionAnalyticsClient object to access its operations. - * - * @return the IotSecuritySolutionAnalyticsClient object. - */ - public IotSecuritySolutionAnalyticsClient getIotSecuritySolutionAnalytics() { - return this.iotSecuritySolutionAnalytics; - } - - /** - * The IotSecuritySolutionsClient object to access its operations. - */ - private final IotSecuritySolutionsClient iotSecuritySolutions; - - /** - * Gets the IotSecuritySolutionsClient object to access its operations. - * - * @return the IotSecuritySolutionsClient object. - */ - public IotSecuritySolutionsClient getIotSecuritySolutions() { - return this.iotSecuritySolutions; - } - - /** - * The IotSecuritySolutionsAnalyticsAggregatedAlertsClient object to access its operations. - */ - private final IotSecuritySolutionsAnalyticsAggregatedAlertsClient iotSecuritySolutionsAnalyticsAggregatedAlerts; - - /** - * Gets the IotSecuritySolutionsAnalyticsAggregatedAlertsClient object to access its operations. - * - * @return the IotSecuritySolutionsAnalyticsAggregatedAlertsClient object. - */ - public IotSecuritySolutionsAnalyticsAggregatedAlertsClient getIotSecuritySolutionsAnalyticsAggregatedAlerts() { - return this.iotSecuritySolutionsAnalyticsAggregatedAlerts; - } - - /** - * The IotSecuritySolutionsAnalyticsRecommendationsClient object to access its operations. - */ - private final IotSecuritySolutionsAnalyticsRecommendationsClient iotSecuritySolutionsAnalyticsRecommendations; - - /** - * Gets the IotSecuritySolutionsAnalyticsRecommendationsClient object to access its operations. - * - * @return the IotSecuritySolutionsAnalyticsRecommendationsClient object. - */ - public IotSecuritySolutionsAnalyticsRecommendationsClient getIotSecuritySolutionsAnalyticsRecommendations() { - return this.iotSecuritySolutionsAnalyticsRecommendations; - } - - /** - * The LocationsClient object to access its operations. - */ - private final LocationsClient locations; - - /** - * Gets the LocationsClient object to access its operations. - * - * @return the LocationsClient object. - */ - public LocationsClient getLocations() { - return this.locations; - } - - /** - * The OperationResultsClient object to access its operations. - */ - private final OperationResultsClient operationResults; - - /** - * Gets the OperationResultsClient object to access its operations. - * - * @return the OperationResultsClient object. - */ - public OperationResultsClient getOperationResults() { - return this.operationResults; - } - - /** - * The OperationStatusesClient object to access its operations. - */ - private final OperationStatusesClient operationStatuses; - - /** - * Gets the OperationStatusesClient object to access its operations. - * - * @return the OperationStatusesClient object. - */ - public OperationStatusesClient getOperationStatuses() { - return this.operationStatuses; - } - - /** - * The PrivateLinksClient object to access its operations. - */ - private final PrivateLinksClient privateLinks; - - /** - * Gets the PrivateLinksClient object to access its operations. - * - * @return the PrivateLinksClient object. - */ - public PrivateLinksClient getPrivateLinks() { - return this.privateLinks; - } - - /** - * The SecureScoresClient object to access its operations. - */ - private final SecureScoresClient secureScores; - - /** - * Gets the SecureScoresClient object to access its operations. - * - * @return the SecureScoresClient object. - */ - public SecureScoresClient getSecureScores() { - return this.secureScores; - } - - /** - * The SecureScoreControlsClient object to access its operations. - */ - private final SecureScoreControlsClient secureScoreControls; - - /** - * Gets the SecureScoreControlsClient object to access its operations. - * - * @return the SecureScoreControlsClient object. - */ - public SecureScoreControlsClient getSecureScoreControls() { - return this.secureScoreControls; - } - - /** - * The SecureScoreControlDefinitionsClient object to access its operations. - */ - private final SecureScoreControlDefinitionsClient secureScoreControlDefinitions; - - /** - * Gets the SecureScoreControlDefinitionsClient object to access its operations. - * - * @return the SecureScoreControlDefinitionsClient object. - */ - public SecureScoreControlDefinitionsClient getSecureScoreControlDefinitions() { - return this.secureScoreControlDefinitions; - } - - /** - * The GitLabSubgroupsClient object to access its operations. - */ - private final GitLabSubgroupsClient gitLabSubgroups; - - /** - * Gets the GitLabSubgroupsClient object to access its operations. - * - * @return the GitLabSubgroupsClient object. - */ - public GitLabSubgroupsClient getGitLabSubgroups() { - return this.gitLabSubgroups; - } - - /** - * The DevOpsOperationResultsClient object to access its operations. - */ - private final DevOpsOperationResultsClient devOpsOperationResults; - - /** - * Gets the DevOpsOperationResultsClient object to access its operations. - * - * @return the DevOpsOperationResultsClient object. - */ - public DevOpsOperationResultsClient getDevOpsOperationResults() { - return this.devOpsOperationResults; - } - - /** - * The AzureDevOpsReposClient object to access its operations. - */ - private final AzureDevOpsReposClient azureDevOpsRepos; - - /** - * Gets the AzureDevOpsReposClient object to access its operations. - * - * @return the AzureDevOpsReposClient object. - */ - public AzureDevOpsReposClient getAzureDevOpsRepos() { - return this.azureDevOpsRepos; - } - - /** - * The GitHubReposClient object to access its operations. - */ - private final GitHubReposClient gitHubRepos; - - /** - * Gets the GitHubReposClient object to access its operations. - * - * @return the GitHubReposClient object. - */ - public GitHubReposClient getGitHubRepos() { - return this.gitHubRepos; - } - - /** - * The GitHubIssuesClient object to access its operations. - */ - private final GitHubIssuesClient gitHubIssues; - - /** - * Gets the GitHubIssuesClient object to access its operations. - * - * @return the GitHubIssuesClient object. - */ - public GitHubIssuesClient getGitHubIssues() { - return this.gitHubIssues; - } - - /** - * The AllowedConnectionsClient object to access its operations. - */ - private final AllowedConnectionsClient allowedConnections; - - /** - * Gets the AllowedConnectionsClient object to access its operations. - * - * @return the AllowedConnectionsClient object. - */ - public AllowedConnectionsClient getAllowedConnections() { - return this.allowedConnections; - } - - /** - * The ServerVulnerabilityAssessmentsClient object to access its operations. - */ - private final ServerVulnerabilityAssessmentsClient serverVulnerabilityAssessments; - - /** - * Gets the ServerVulnerabilityAssessmentsClient object to access its operations. - * - * @return the ServerVulnerabilityAssessmentsClient object. - */ - public ServerVulnerabilityAssessmentsClient getServerVulnerabilityAssessments() { - return this.serverVulnerabilityAssessments; - } - - /** - * The TopologiesClient object to access its operations. - */ - private final TopologiesClient topologies; - - /** - * Gets the TopologiesClient object to access its operations. - * - * @return the TopologiesClient object. - */ - public TopologiesClient getTopologies() { - return this.topologies; - } - - /** - * The SecuritySolutionsReferenceDatasClient object to access its operations. - */ - private final SecuritySolutionsReferenceDatasClient securitySolutionsReferenceDatas; - - /** - * Gets the SecuritySolutionsReferenceDatasClient object to access its operations. - * - * @return the SecuritySolutionsReferenceDatasClient object. - */ - public SecuritySolutionsReferenceDatasClient getSecuritySolutionsReferenceDatas() { - return this.securitySolutionsReferenceDatas; - } - - /** - * The SensitivitySettingsClient object to access its operations. - */ - private final SensitivitySettingsClient sensitivitySettings; - - /** - * Gets the SensitivitySettingsClient object to access its operations. - * - * @return the SensitivitySettingsClient object. - */ - public SensitivitySettingsClient getSensitivitySettings() { - return this.sensitivitySettings; - } - - /** - * The SqlVulnerabilityAssessmentSettingsOperationsClient object to access its operations. - */ - private final SqlVulnerabilityAssessmentSettingsOperationsClient sqlVulnerabilityAssessmentSettingsOperations; - - /** - * Gets the SqlVulnerabilityAssessmentSettingsOperationsClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentSettingsOperationsClient object. - */ - public SqlVulnerabilityAssessmentSettingsOperationsClient getSqlVulnerabilityAssessmentSettingsOperations() { - return this.sqlVulnerabilityAssessmentSettingsOperations; - } - - /** - * The SqlVulnerabilityAssessmentScansClient object to access its operations. - */ - private final SqlVulnerabilityAssessmentScansClient sqlVulnerabilityAssessmentScans; - - /** - * Gets the SqlVulnerabilityAssessmentScansClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentScansClient object. - */ - public SqlVulnerabilityAssessmentScansClient getSqlVulnerabilityAssessmentScans() { - return this.sqlVulnerabilityAssessmentScans; - } - - /** - * The SubAssessmentsClient object to access its operations. - */ - private final SubAssessmentsClient subAssessments; - - /** - * Gets the SubAssessmentsClient object to access its operations. - * - * @return the SubAssessmentsClient object. - */ - public SubAssessmentsClient getSubAssessments() { - return this.subAssessments; - } - - /** - * Initializes an instance of SecurityCenter 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 endpoint Service host. - * @param subscriptionId The ID of the target subscription. The value must be an UUID. - */ - SecurityCenterImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, - AzureEnvironment environment, String endpoint, String subscriptionId) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.endpoint = endpoint; - this.subscriptionId = subscriptionId; - this.alerts = new AlertsClientImpl(this); - this.alertsSuppressionRules = new AlertsSuppressionRulesClientImpl(this); - this.apiCollections = new ApiCollectionsClientImpl(this); - this.applications = new ApplicationsClientImpl(this); - this.assessmentsMetadatas = new AssessmentsMetadatasClientImpl(this); - this.automations = new AutomationsClientImpl(this); - this.securityContacts = new SecurityContactsClientImpl(this); - this.complianceResults = new ComplianceResultsClientImpl(this); - this.governanceAssignments = new GovernanceAssignmentsClientImpl(this); - this.governanceRules = new GovernanceRulesClientImpl(this); - this.healthReports = new HealthReportsClientImpl(this); - this.deviceSecurityGroups = new DeviceSecurityGroupsClientImpl(this); - this.autoProvisioningSettings = new AutoProvisioningSettingsClientImpl(this); - this.compliances = new CompliancesClientImpl(this); - this.informationProtectionPolicies = new InformationProtectionPoliciesClientImpl(this); - this.workspaceSettings = new WorkspaceSettingsClientImpl(this); - this.mdeOnboardings = new MdeOnboardingsClientImpl(this); - this.operations = new OperationsClientImpl(this); - this.pricings = new PricingsClientImpl(this); - this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); - this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); - this.regulatoryComplianceStandards = new RegulatoryComplianceStandardsClientImpl(this); - this.regulatoryComplianceControls = new RegulatoryComplianceControlsClientImpl(this); - this.regulatoryComplianceAssessments = new RegulatoryComplianceAssessmentsClientImpl(this); - this.securityConnectors = new SecurityConnectorsClientImpl(this); - this.azureDevOpsOrgs = new AzureDevOpsOrgsClientImpl(this); - this.gitHubOwners = new GitHubOwnersClientImpl(this); - this.gitLabGroups = new GitLabGroupsClientImpl(this); - this.devOpsConfigurations = new DevOpsConfigurationsClientImpl(this); - this.azureDevOpsProjects = new AzureDevOpsProjectsClientImpl(this); - this.gitLabProjects = new GitLabProjectsClientImpl(this); - this.securityOperators = new SecurityOperatorsClientImpl(this); - this.discoveredSecuritySolutions = new DiscoveredSecuritySolutionsClientImpl(this); - this.externalSecuritySolutions = new ExternalSecuritySolutionsClientImpl(this); - this.jitNetworkAccessPolicies = new JitNetworkAccessPoliciesClientImpl(this); - this.securitySolutions = new SecuritySolutionsClientImpl(this); - this.securityStandards = new SecurityStandardsClientImpl(this); - this.standardAssignments = new StandardAssignmentsClientImpl(this); - this.customRecommendations = new CustomRecommendationsClientImpl(this); - this.serverVulnerabilityAssessmentsSettings = new ServerVulnerabilityAssessmentsSettingsClientImpl(this); - this.settings = new SettingsClientImpl(this); - this.sqlVulnerabilityAssessmentBaselineRules = new SqlVulnerabilityAssessmentBaselineRulesClientImpl(this); - this.sqlVulnerabilityAssessmentScanResults = new SqlVulnerabilityAssessmentScanResultsClientImpl(this); - this.standards = new StandardsClientImpl(this); - this.assignments = new AssignmentsClientImpl(this); - this.tasks = new TasksClientImpl(this); - this.securityConnectorApplications = new SecurityConnectorApplicationsClientImpl(this); - this.assessments = new AssessmentsClientImpl(this); - this.advancedThreatProtections = new AdvancedThreatProtectionsClientImpl(this); - this.defenderForStorages = new DefenderForStoragesClientImpl(this); - this.iotSecuritySolutionAnalytics = new IotSecuritySolutionAnalyticsClientImpl(this); - this.iotSecuritySolutions = new IotSecuritySolutionsClientImpl(this); - this.iotSecuritySolutionsAnalyticsAggregatedAlerts - = new IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl(this); - this.iotSecuritySolutionsAnalyticsRecommendations - = new IotSecuritySolutionsAnalyticsRecommendationsClientImpl(this); - this.locations = new LocationsClientImpl(this); - this.operationResults = new OperationResultsClientImpl(this); - this.operationStatuses = new OperationStatusesClientImpl(this); - this.privateLinks = new PrivateLinksClientImpl(this); - this.secureScores = new SecureScoresClientImpl(this); - this.secureScoreControls = new SecureScoreControlsClientImpl(this); - this.secureScoreControlDefinitions = new SecureScoreControlDefinitionsClientImpl(this); - this.gitLabSubgroups = new GitLabSubgroupsClientImpl(this); - this.devOpsOperationResults = new DevOpsOperationResultsClientImpl(this); - this.azureDevOpsRepos = new AzureDevOpsReposClientImpl(this); - this.gitHubRepos = new GitHubReposClientImpl(this); - this.gitHubIssues = new GitHubIssuesClientImpl(this); - this.allowedConnections = new AllowedConnectionsClientImpl(this); - this.serverVulnerabilityAssessments = new ServerVulnerabilityAssessmentsClientImpl(this); - this.topologies = new TopologiesClientImpl(this); - this.securitySolutionsReferenceDatas = new SecuritySolutionsReferenceDatasClientImpl(this); - this.sensitivitySettings = new SensitivitySettingsClientImpl(this); - this.sqlVulnerabilityAssessmentSettingsOperations - = new SqlVulnerabilityAssessmentSettingsOperationsClientImpl(this); - this.sqlVulnerabilityAssessmentScans = new SqlVulnerabilityAssessmentScansClientImpl(this); - this.subAssessments = new SubAssessmentsClientImpl(this); - } - - /** - * Gets default client context. - * - * @return the default client context. - */ - public Context getContext() { - return Context.NONE; - } - - /** - * Merges default client context with provided context. - * - * @param context the context to be merged with default client context. - * @return the merged context. - */ - public Context mergeContext(Context context) { - return CoreUtils.mergeContexts(this.getContext(), context); - } - - /** - * Gets long running operation result. - * - * @param activationResponse the response of activation operation. - * @param httpPipeline the http pipeline. - * @param pollResultType type of poll result. - * @param finalResultType type of final result. - * @param context the context shared by all requests. - * @param type of poll result. - * @param type of final result. - * @return poller flux for poll result and final result. - */ - public PollerFlux, U> getLroResult(Mono>> activationResponse, - HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { - return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, - defaultPollInterval, activationResponse, context); - } - - /** - * Gets the final result, or an error, based on last async poll response. - * - * @param response the last async poll response. - * @param type of poll result. - * @param type of final result. - * @return the final result, or an error. - */ - public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { - if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { - String errorMessage; - ManagementError managementError = null; - HttpResponse errorResponse = null; - PollResult.Error lroError = response.getValue().getError(); - if (lroError != null) { - errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), - lroError.getResponseBody()); - - errorMessage = response.getValue().getError().getMessage(); - String errorBody = response.getValue().getError().getResponseBody(); - if (errorBody != null) { - // try to deserialize error body to ManagementError - try { - managementError = this.getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); - if (managementError.getCode() == null || managementError.getMessage() == null) { - managementError = null; - } - } catch (IOException | RuntimeException ioe) { - LOGGER.logThrowableAsWarning(ioe); - } - } - } else { - // fallback to default error message - errorMessage = "Long running operation failed."; - } - if (managementError == null) { - // fallback to default ManagementError - managementError = new ManagementError(response.getStatus().toString(), errorMessage); - } - return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); - } else { - return response.getFinalResult(); - } - } - - private static final class HttpResponseImpl extends HttpResponse { - private final int statusCode; - - private final byte[] responseBody; - - private final HttpHeaders httpHeaders; - - HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { - super(null); - this.statusCode = statusCode; - this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? new byte[0] : responseBody.getBytes(StandardCharsets.UTF_8); - } - - public int getStatusCode() { - return statusCode; - } - - public String getHeaderValue(String s) { - return httpHeaders.getValue(HttpHeaderName.fromString(s)); - } - - public HttpHeaders getHeaders() { - return httpHeaders; - } - - public Flux getBody() { - return Flux.just(ByteBuffer.wrap(responseBody)); - } - - public Mono getBodyAsByteArray() { - return Mono.just(responseBody); - } - - public Mono getBodyAsString() { - return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); - } - - public Mono getBodyAsString(Charset charset) { - return Mono.just(new String(responseBody, charset)); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecurityCenterImpl.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationsClientImpl.java deleted file mode 100644 index 70584314a8f4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationsClientImpl.java +++ /dev/null @@ -1,743 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.resourcemanager.security.fluent.SecurityConnectorApplicationsClient; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.implementation.models.ApplicationsList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SecurityConnectorApplicationsClient. - */ -public final class SecurityConnectorApplicationsClientImpl implements SecurityConnectorApplicationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SecurityConnectorApplicationsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecurityConnectorApplicationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecurityConnectorApplicationsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(SecurityConnectorApplicationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecurityConnectorApplications to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterSecurityConnectorApplications") - public interface SecurityConnectorApplicationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("applicationId") String applicationId, @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("applicationId") String applicationId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") ApplicationInner application, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("applicationId") String applicationId, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 application for the requested scope by applicationId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String applicationId) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, applicationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 application for the requested scope by applicationId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String securityConnectorName, String applicationId, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, applicationId, accept, context); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 application for the requested scope by applicationId on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String securityConnectorName, - String applicationId) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, applicationId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 application for the requested scope by applicationId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String applicationId, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, applicationId, context).block(); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 application for the requested scope by applicationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationInner get(String resourceGroupName, String securityConnectorName, String applicationId) { - return getWithResponse(resourceGroupName, securityConnectorName, applicationId, Context.NONE).getValue(); - } - - /** - * Creates or update a security Application on the given security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String applicationId, ApplicationInner application) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - if (application == null) { - return Mono.error(new IllegalArgumentException("Parameter application is required and cannot be null.")); - } else { - application.validate(); - } - final String apiVersion = "2022-07-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, applicationId, contentType, - accept, application, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or update a security Application on the given security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, String applicationId, ApplicationInner application, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - if (application == null) { - return Mono.error(new IllegalArgumentException("Parameter application is required and cannot be null.")); - } else { - application.validate(); - } - final String apiVersion = "2022-07-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, applicationId, contentType, accept, application, context); - } - - /** - * Creates or update a security Application on the given security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String securityConnectorName, - String applicationId, ApplicationInner application) { - return createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, applicationId, application) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or update a security Application on the given security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String securityConnectorName, - String applicationId, ApplicationInner application, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, applicationId, application, - context).block(); - } - - /** - * Creates or update a security Application on the given security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationInner createOrUpdate(String resourceGroupName, String securityConnectorName, String applicationId, - ApplicationInner application) { - return createOrUpdateWithResponse(resourceGroupName, securityConnectorName, applicationId, application, - Context.NONE).getValue(); - } - - /** - * Delete an Application over a given scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 securityConnectorName, - String applicationId) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, applicationId, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete an Application over a given scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 securityConnectorName, - String applicationId, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, applicationId, context); - } - - /** - * Delete an Application over a given scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 securityConnectorName, String applicationId) { - return deleteWithResponseAsync(resourceGroupName, securityConnectorName, applicationId) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Delete an Application over a given scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String securityConnectorName, - String applicationId, Context context) { - return deleteWithResponseAsync(resourceGroupName, securityConnectorName, applicationId, context).block(); - } - - /** - * Delete an Application over a given scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 securityConnectorName, String applicationId) { - deleteWithResponse(resourceGroupName, securityConnectorName, applicationId, Context.NONE); - } - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 a list of all relevant applications over a security connector level scope along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, 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 a list of all relevant applications over a security connector level scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of all relevant applications over a security connector level scope along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String securityConnectorName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 a list of all relevant applications over a security connector level scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of all relevant applications over a security connector level scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, securityConnectorName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 a list of all relevant applications over a security connector level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName)); - } - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of all relevant applications over a security connector level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName, - Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a security connector level scope 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 a list of all relevant applications over a security connector level scope 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationsImpl.java deleted file mode 100644 index df7bd9afaedf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationsImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SecurityConnectorApplicationsClient; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.SecurityConnectorApplications; - -public final class SecurityConnectorApplicationsImpl implements SecurityConnectorApplications { - private static final ClientLogger LOGGER = new ClientLogger(SecurityConnectorApplicationsImpl.class); - - private final SecurityConnectorApplicationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecurityConnectorApplicationsImpl(SecurityConnectorApplicationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String securityConnectorName, - String applicationId, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, applicationId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApplicationImpl(inner.getValue(), this.manager())); - } - - public Application get(String resourceGroupName, String securityConnectorName, String applicationId) { - ApplicationInner inner = this.serviceClient().get(resourceGroupName, securityConnectorName, applicationId); - if (inner != null) { - return new ApplicationImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse(String resourceGroupName, String securityConnectorName, - String applicationId, ApplicationInner application, Context context) { - Response inner = this.serviceClient() - .createOrUpdateWithResponse(resourceGroupName, securityConnectorName, applicationId, application, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApplicationImpl(inner.getValue(), this.manager())); - } - - public Application createOrUpdate(String resourceGroupName, String securityConnectorName, String applicationId, - ApplicationInner application) { - ApplicationInner inner - = this.serviceClient().createOrUpdate(resourceGroupName, securityConnectorName, applicationId, application); - if (inner != null) { - return new ApplicationImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String resourceGroupName, String securityConnectorName, - String applicationId, Context context) { - return this.serviceClient() - .deleteWithResponse(resourceGroupName, securityConnectorName, applicationId, context); - } - - public void delete(String resourceGroupName, String securityConnectorName, String applicationId) { - this.serviceClient().delete(resourceGroupName, securityConnectorName, applicationId); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, securityConnectorName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, securityConnectorName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); - } - - private SecurityConnectorApplicationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorImpl.java deleted file mode 100644 index 47f5601ce9b1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorImpl.java +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.CloudOffering; -import com.azure.resourcemanager.security.models.EnvironmentData; -import com.azure.resourcemanager.security.models.SecurityConnector; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class SecurityConnectorImpl - implements SecurityConnector, SecurityConnector.Definition, SecurityConnector.Update { - private SecurityConnectorInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String location() { - return this.innerModel().location(); - } - - public String kind() { - return this.innerModel().kind(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String hierarchyIdentifier() { - return this.innerModel().hierarchyIdentifier(); - } - - public OffsetDateTime hierarchyIdentifierTrialEndDate() { - return this.innerModel().hierarchyIdentifierTrialEndDate(); - } - - public CloudName environmentName() { - return this.innerModel().environmentName(); - } - - public List offerings() { - List inner = this.innerModel().offerings(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public EnvironmentData environmentData() { - return this.innerModel().environmentData(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public SecurityConnectorInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String securityConnectorName; - - public SecurityConnectorImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public SecurityConnector create() { - this.innerObject = serviceManager.serviceClient() - .getSecurityConnectors() - .createOrUpdateWithResponse(resourceGroupName, securityConnectorName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public SecurityConnector create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSecurityConnectors() - .createOrUpdateWithResponse(resourceGroupName, securityConnectorName, this.innerModel(), context) - .getValue(); - return this; - } - - SecurityConnectorImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new SecurityConnectorInner(); - this.serviceManager = serviceManager; - this.securityConnectorName = name; - } - - public SecurityConnectorImpl update() { - return this; - } - - public SecurityConnector apply() { - this.innerObject = serviceManager.serviceClient() - .getSecurityConnectors() - .updateWithResponse(resourceGroupName, securityConnectorName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public SecurityConnector apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSecurityConnectors() - .updateWithResponse(resourceGroupName, securityConnectorName, this.innerModel(), context) - .getValue(); - return this; - } - - SecurityConnectorImpl(SecurityConnectorInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.securityConnectorName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "securityConnectors"); - } - - public SecurityConnector refresh() { - this.innerObject = serviceManager.serviceClient() - .getSecurityConnectors() - .getByResourceGroupWithResponse(resourceGroupName, securityConnectorName, Context.NONE) - .getValue(); - return this; - } - - public SecurityConnector refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSecurityConnectors() - .getByResourceGroupWithResponse(resourceGroupName, securityConnectorName, context) - .getValue(); - return this; - } - - public SecurityConnectorImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public SecurityConnectorImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public SecurityConnectorImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public SecurityConnectorImpl withKind(String kind) { - this.innerModel().withKind(kind); - return this; - } - - public SecurityConnectorImpl withEtag(String etag) { - this.innerModel().withEtag(etag); - return this; - } - - public SecurityConnectorImpl withHierarchyIdentifier(String hierarchyIdentifier) { - this.innerModel().withHierarchyIdentifier(hierarchyIdentifier); - return this; - } - - public SecurityConnectorImpl withEnvironmentName(CloudName environmentName) { - this.innerModel().withEnvironmentName(environmentName); - return this; - } - - public SecurityConnectorImpl withOfferings(List offerings) { - this.innerModel().withOfferings(offerings); - return this; - } - - public SecurityConnectorImpl withEnvironmentData(EnvironmentData environmentData) { - this.innerModel().withEnvironmentData(environmentData); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsClientImpl.java deleted file mode 100644 index 171903815a0a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsClientImpl.java +++ /dev/null @@ -1,1034 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.Patch; -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.resourcemanager.security.fluent.SecurityConnectorsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner; -import com.azure.resourcemanager.security.implementation.models.SecurityConnectorsList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SecurityConnectorsClient. - */ -public final class SecurityConnectorsClientImpl implements SecurityConnectorsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SecurityConnectorsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecurityConnectorsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecurityConnectorsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(SecurityConnectorsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecurityConnectors to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterSecurityConnectors") - public interface SecurityConnectorsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, @HeaderParam("Accept") String accept, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") SecurityConnectorInner securityConnector, Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") SecurityConnectorInner securityConnector, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - 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" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Retrieves details of a specific security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 security connector resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String securityConnectorName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves details of a specific security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 security connector resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String securityConnectorName, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, accept, context); - } - - /** - * Retrieves details of a specific security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 security connector resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, - String securityConnectorName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, securityConnectorName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Retrieves details of a specific security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 security connector resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String securityConnectorName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, securityConnectorName, context).block(); - } - - /** - * Retrieves details of a specific security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 security connector resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityConnectorInner getByResourceGroup(String resourceGroupName, String securityConnectorName) { - return getByResourceGroupWithResponse(resourceGroupName, securityConnectorName, Context.NONE).getValue(); - } - - /** - * Creates or updates a security connector. If a security connector is already created and a subsequent request is - * issued for the same security connector id, then it will be updated. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector 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 security connector resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, SecurityConnectorInner securityConnector) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (securityConnector == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnector is required and cannot be null.")); - } else { - securityConnector.validate(); - } - final String apiVersion = "2024-08-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, contentType, accept, - securityConnector, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a security connector. If a security connector is already created and a subsequent request is - * issued for the same security connector id, then it will be updated. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector 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 security connector resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String securityConnectorName, SecurityConnectorInner securityConnector, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (securityConnector == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnector is required and cannot be null.")); - } else { - securityConnector.validate(); - } - final String apiVersion = "2024-08-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, contentType, accept, securityConnector, context); - } - - /** - * Creates or updates a security connector. If a security connector is already created and a subsequent request is - * issued for the same security connector id, then it will be updated. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector 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 security connector resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String securityConnectorName, - SecurityConnectorInner securityConnector) { - return createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, securityConnector) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates a security connector. If a security connector is already created and a subsequent request is - * issued for the same security connector id, then it will be updated. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector 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 security connector resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, - String securityConnectorName, SecurityConnectorInner securityConnector, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, securityConnector, context) - .block(); - } - - /** - * Creates or updates a security connector. If a security connector is already created and a subsequent request is - * issued for the same security connector id, then it will be updated. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector 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 security connector resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityConnectorInner createOrUpdate(String resourceGroupName, String securityConnectorName, - SecurityConnectorInner securityConnector) { - return createOrUpdateWithResponse(resourceGroupName, securityConnectorName, securityConnector, Context.NONE) - .getValue(); - } - - /** - * Updates a security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector 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 security connector resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String securityConnectorName, SecurityConnectorInner securityConnector) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (securityConnector == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnector is required and cannot be null.")); - } else { - securityConnector.validate(); - } - final String apiVersion = "2024-08-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, securityConnectorName, contentType, accept, securityConnector, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector 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 security connector resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String securityConnectorName, SecurityConnectorInner securityConnector, 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (securityConnector == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnector is required and cannot be null.")); - } else { - securityConnector.validate(); - } - final String apiVersion = "2024-08-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, contentType, accept, securityConnector, context); - } - - /** - * Updates a security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector 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 security connector resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String securityConnectorName, - SecurityConnectorInner securityConnector) { - return updateWithResponseAsync(resourceGroupName, securityConnectorName, securityConnector) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Updates a security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector 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 security connector resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String securityConnectorName, - SecurityConnectorInner securityConnector, Context context) { - return updateWithResponseAsync(resourceGroupName, securityConnectorName, securityConnector, context).block(); - } - - /** - * Updates a security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector 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 security connector resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityConnectorInner update(String resourceGroupName, String securityConnectorName, - SecurityConnectorInner securityConnector) { - return updateWithResponse(resourceGroupName, securityConnectorName, securityConnector, Context.NONE).getValue(); - } - - /** - * Deletes a security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String securityConnectorName) { - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-08-01-preview"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, securityConnectorName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 securityConnectorName, - 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 (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2024-08-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - securityConnectorName, context); - } - - /** - * Deletes a security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String securityConnectorName) { - return deleteWithResponseAsync(resourceGroupName, securityConnectorName).flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes a security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String securityConnectorName, Context context) { - return deleteWithResponseAsync(resourceGroupName, securityConnectorName, context).block(); - } - - /** - * Deletes a security connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String securityConnectorName) { - deleteWithResponse(resourceGroupName, securityConnectorName, Context.NONE); - } - - /** - * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors 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 (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.")); - } - final String apiVersion = "2024-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), apiVersion, - 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())); - } - - /** - * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified 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 list of security connectors response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @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 (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.")); - } - final String apiVersion = "2024-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified 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 list of security connectors response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified 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 list of security connectors response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified 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 list of security connectors response 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2024-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified 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 list of security connectors response 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2024-08-01-preview"; - 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)); - } - - /** - * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified 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 list of security connectors response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified 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 list of security connectors response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified 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 list of security connectors response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified 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 list of security connectors response 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 list of security connectors response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @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( - context -> 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)) - .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 list of security connectors response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response 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 list of security connectors response 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsImpl.java deleted file mode 100644 index a59ca5bf3590..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsImpl.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SecurityConnectorsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner; -import com.azure.resourcemanager.security.models.SecurityConnector; -import com.azure.resourcemanager.security.models.SecurityConnectors; - -public final class SecurityConnectorsImpl implements SecurityConnectors { - private static final ClientLogger LOGGER = new ClientLogger(SecurityConnectorsImpl.class); - - private final SecurityConnectorsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecurityConnectorsImpl(SecurityConnectorsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getByResourceGroupWithResponse(String resourceGroupName, - String securityConnectorName, Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, securityConnectorName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityConnectorImpl(inner.getValue(), this.manager())); - } - - public SecurityConnector getByResourceGroup(String resourceGroupName, String securityConnectorName) { - SecurityConnectorInner inner - = this.serviceClient().getByResourceGroup(resourceGroupName, securityConnectorName); - if (inner != null) { - return new SecurityConnectorImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse(String resourceGroupName, String securityConnectorName, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, securityConnectorName, context); - } - - public void deleteByResourceGroup(String resourceGroupName, String securityConnectorName) { - this.serviceClient().delete(resourceGroupName, securityConnectorName); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); - } - - public SecurityConnector 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 securityConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, securityConnectorName, 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 securityConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, securityConnectorName, 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 securityConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - this.deleteByResourceGroupWithResponse(resourceGroupName, securityConnectorName, Context.NONE); - } - - public Response 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 securityConnectorName = ResourceManagerUtils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - return this.deleteByResourceGroupWithResponse(resourceGroupName, securityConnectorName, context); - } - - private SecurityConnectorsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public SecurityConnectorImpl define(String name) { - return new SecurityConnectorImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactImpl.java deleted file mode 100644 index 18231e20e42e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactImpl.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityContactInner; -import com.azure.resourcemanager.security.models.NotificationsSource; -import com.azure.resourcemanager.security.models.SecurityContact; -import com.azure.resourcemanager.security.models.SecurityContactName; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; -import java.util.Collections; -import java.util.List; - -public final class SecurityContactImpl implements SecurityContact, SecurityContact.Definition { - private SecurityContactInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecurityContactImpl(SecurityContactInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public String emails() { - return this.innerModel().emails(); - } - - public String phone() { - return this.innerModel().phone(); - } - - public Boolean isEnabled() { - return this.innerModel().isEnabled(); - } - - public List notificationsSources() { - List inner = this.innerModel().notificationsSources(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public SecurityContactPropertiesNotificationsByRole notificationsByRole() { - return this.innerModel().notificationsByRole(); - } - - public SecurityContactInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private SecurityContactName securityContactName; - - public SecurityContact create() { - this.innerObject = serviceManager.serviceClient() - .getSecurityContacts() - .createWithResponse(securityContactName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public SecurityContact create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSecurityContacts() - .createWithResponse(securityContactName, this.innerModel(), context) - .getValue(); - return this; - } - - SecurityContactImpl(SecurityContactName name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new SecurityContactInner(); - this.serviceManager = serviceManager; - this.securityContactName = name; - } - - public SecurityContact refresh() { - this.innerObject = serviceManager.serviceClient() - .getSecurityContacts() - .getWithResponse(securityContactName, Context.NONE) - .getValue(); - return this; - } - - public SecurityContact refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSecurityContacts() - .getWithResponse(securityContactName, context) - .getValue(); - return this; - } - - public SecurityContactImpl withEmails(String emails) { - this.innerModel().withEmails(emails); - return this; - } - - public SecurityContactImpl withPhone(String phone) { - this.innerModel().withPhone(phone); - return this; - } - - public SecurityContactImpl withIsEnabled(Boolean isEnabled) { - this.innerModel().withIsEnabled(isEnabled); - return this; - } - - public SecurityContactImpl withNotificationsSources(List notificationsSources) { - this.innerModel().withNotificationsSources(notificationsSources); - return this; - } - - public SecurityContactImpl - withNotificationsByRole(SecurityContactPropertiesNotificationsByRole notificationsByRole) { - this.innerModel().withNotificationsByRole(notificationsByRole); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsClientImpl.java deleted file mode 100644 index b79059a4a7a4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsClientImpl.java +++ /dev/null @@ -1,615 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.resourcemanager.security.fluent.SecurityContactsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityContactInner; -import com.azure.resourcemanager.security.implementation.models.SecurityContactList; -import com.azure.resourcemanager.security.models.SecurityContactName; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SecurityContactsClient. - */ -public final class SecurityContactsClientImpl implements SecurityContactsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SecurityContactsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecurityContactsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecurityContactsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(SecurityContactsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecurityContacts to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterSecurityContacts") - public interface SecurityContactsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("securityContactName") SecurityContactName securityContactName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("securityContactName") SecurityContactName securityContactName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") SecurityContactInner securityContact, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("securityContactName") SecurityContactName securityContactName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(SecurityContactName securityContactName) { - 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 (securityContactName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContactName is required and cannot be null.")); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - securityContactName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(SecurityContactName securityContactName, - 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 (securityContactName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContactName is required and cannot be null.")); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), securityContactName, - accept, context); - } - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(SecurityContactName securityContactName) { - return getWithResponseAsync(securityContactName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(SecurityContactName securityContactName, Context context) { - return getWithResponseAsync(securityContactName, context).block(); - } - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityContactInner get(SecurityContactName securityContactName) { - return getWithResponse(securityContactName, Context.NONE).getValue(); - } - - /** - * Create security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param securityContact Security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(SecurityContactName securityContactName, - SecurityContactInner securityContact) { - 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 (securityContactName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContactName is required and cannot be null.")); - } - if (securityContact == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContact is required and cannot be null.")); - } else { - securityContact.validate(); - } - final String apiVersion = "2023-12-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), securityContactName, contentType, accept, securityContact, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param securityContact Security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(SecurityContactName securityContactName, - SecurityContactInner securityContact, 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 (securityContactName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContactName is required and cannot be null.")); - } - if (securityContact == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContact is required and cannot be null.")); - } else { - securityContact.validate(); - } - final String apiVersion = "2023-12-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - securityContactName, contentType, accept, securityContact, context); - } - - /** - * Create security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param securityContact Security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(SecurityContactName securityContactName, - SecurityContactInner securityContact) { - return createWithResponseAsync(securityContactName, securityContact) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param securityContact Security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(SecurityContactName securityContactName, - SecurityContactInner securityContact, Context context) { - return createWithResponseAsync(securityContactName, securityContact, context).block(); - } - - /** - * Create security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param securityContact Security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityContactInner create(SecurityContactName securityContactName, SecurityContactInner securityContact) { - return createWithResponse(securityContactName, securityContact, Context.NONE).getValue(); - } - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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(SecurityContactName securityContactName) { - 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 (securityContactName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContactName is required and cannot be null.")); - } - final String apiVersion = "2023-12-01-preview"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), securityContactName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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(SecurityContactName securityContactName, 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 (securityContactName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContactName is required and cannot be null.")); - } - final String apiVersion = "2023-12-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - securityContactName, context); - } - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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(SecurityContactName securityContactName) { - return deleteWithResponseAsync(securityContactName).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(SecurityContactName securityContactName, Context context) { - return deleteWithResponseAsync(securityContactName, context).block(); - } - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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(SecurityContactName securityContactName) { - deleteWithResponse(securityContactName, Context.NONE); - } - - /** - * List all security contact configurations for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2023-12-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all security contact configurations for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2023-12-01-preview"; - 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)); - } - - /** - * List all security contact configurations for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List all security contact configurations for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List all security contact configurations for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List all security contact configurations for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response 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 list of security contacts response 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 list of security contacts response 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsImpl.java deleted file mode 100644 index cc7d4e28e1df..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsImpl.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SecurityContactsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityContactInner; -import com.azure.resourcemanager.security.models.SecurityContact; -import com.azure.resourcemanager.security.models.SecurityContactName; -import com.azure.resourcemanager.security.models.SecurityContacts; - -public final class SecurityContactsImpl implements SecurityContacts { - private static final ClientLogger LOGGER = new ClientLogger(SecurityContactsImpl.class); - - private final SecurityContactsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecurityContactsImpl(SecurityContactsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(SecurityContactName securityContactName, Context context) { - Response inner = this.serviceClient().getWithResponse(securityContactName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityContactImpl(inner.getValue(), this.manager())); - } - - public SecurityContact get(SecurityContactName securityContactName) { - SecurityContactInner inner = this.serviceClient().get(securityContactName); - if (inner != null) { - return new SecurityContactImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(SecurityContactName securityContactName, Context context) { - return this.serviceClient().deleteWithResponse(securityContactName, context); - } - - public void delete(SecurityContactName securityContactName) { - this.serviceClient().delete(securityContactName); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityContactImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityContactImpl(inner1, this.manager())); - } - - public SecurityContact getById(String id) { - String securityContactNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "securityContacts"); - if (securityContactNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityContacts'.", id))); - } - SecurityContactName securityContactName = SecurityContactName.fromString(securityContactNameLocal); - return this.getWithResponse(securityContactName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String securityContactNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "securityContacts"); - if (securityContactNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityContacts'.", id))); - } - SecurityContactName securityContactName = SecurityContactName.fromString(securityContactNameLocal); - return this.getWithResponse(securityContactName, context); - } - - public void deleteById(String id) { - String securityContactNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "securityContacts"); - if (securityContactNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityContacts'.", id))); - } - SecurityContactName securityContactName = SecurityContactName.fromString(securityContactNameLocal); - this.deleteWithResponse(securityContactName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String securityContactNameLocal = ResourceManagerUtils.getValueFromIdByName(id, "securityContacts"); - if (securityContactNameLocal == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityContacts'.", id))); - } - SecurityContactName securityContactName = SecurityContactName.fromString(securityContactNameLocal); - return this.deleteWithResponse(securityContactName, context); - } - - private SecurityContactsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public SecurityContactImpl define(SecurityContactName name) { - return new SecurityContactImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorImpl.java deleted file mode 100644 index 3be550485d1c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorInner; -import com.azure.resourcemanager.security.models.Identity; -import com.azure.resourcemanager.security.models.SecurityOperator; - -public final class SecurityOperatorImpl implements SecurityOperator { - private SecurityOperatorInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecurityOperatorImpl(SecurityOperatorInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 Identity identity() { - return this.innerModel().identity(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public SecurityOperatorInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorsClientImpl.java deleted file mode 100644 index 702695276468..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorsClientImpl.java +++ /dev/null @@ -1,585 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -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.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.resourcemanager.security.fluent.SecurityOperatorsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorInner; -import com.azure.resourcemanager.security.implementation.models.SecurityOperatorList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SecurityOperatorsClient. - */ -public final class SecurityOperatorsClientImpl implements SecurityOperatorsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SecurityOperatorsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecurityOperatorsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecurityOperatorsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(SecurityOperatorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecurityOperators to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterSecurityOperators") - public interface SecurityOperatorsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators/{securityOperatorName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("pricingName") String pricingName, - @PathParam("securityOperatorName") String securityOperatorName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators/{securityOperatorName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("pricingName") String pricingName, - @PathParam("securityOperatorName") String securityOperatorName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators/{securityOperatorName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("pricingName") String pricingName, - @PathParam("securityOperatorName") String securityOperatorName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("pricingName") String pricingName, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName Name of the pricing configuration. - * @param securityOperatorName Name of the security operator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security operator for the requested scope along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String pricingName, - String securityOperatorName) { - 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 (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (securityOperatorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityOperatorName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - pricingName, securityOperatorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName Name of the pricing configuration. - * @param securityOperatorName Name of the security operator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security operator for the requested scope along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String pricingName, String securityOperatorName, - 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 (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (securityOperatorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityOperatorName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), pricingName, - securityOperatorName, accept, context); - } - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName Name of the pricing configuration. - * @param securityOperatorName Name of the security operator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security operator for the requested scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String pricingName, String securityOperatorName) { - return getWithResponseAsync(pricingName, securityOperatorName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName Name of the pricing configuration. - * @param securityOperatorName Name of the security operator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security operator for the requested scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String pricingName, String securityOperatorName, - Context context) { - return getWithResponseAsync(pricingName, securityOperatorName, context).block(); - } - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName Name of the pricing configuration. - * @param securityOperatorName Name of the security operator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security operator for the requested scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityOperatorInner get(String pricingName, String securityOperatorName) { - return getWithResponse(pricingName, securityOperatorName, Context.NONE).getValue(); - } - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName Name of the pricing configuration. - * @param securityOperatorName Name of the security operator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security operator under a given subscription and pricing along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String pricingName, - String securityOperatorName) { - 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 (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (securityOperatorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityOperatorName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), pricingName, securityOperatorName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName Name of the pricing configuration. - * @param securityOperatorName Name of the security operator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security operator under a given subscription and pricing along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String pricingName, - String securityOperatorName, 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 (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (securityOperatorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityOperatorName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - pricingName, securityOperatorName, accept, context); - } - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName Name of the pricing configuration. - * @param securityOperatorName Name of the security operator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security operator under a given subscription and pricing on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String pricingName, String securityOperatorName) { - return createOrUpdateWithResponseAsync(pricingName, securityOperatorName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName Name of the pricing configuration. - * @param securityOperatorName Name of the security operator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security operator under a given subscription and pricing along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String pricingName, String securityOperatorName, - Context context) { - return createOrUpdateWithResponseAsync(pricingName, securityOperatorName, context).block(); - } - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName Name of the pricing configuration. - * @param securityOperatorName Name of the security operator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security operator under a given subscription and pricing. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityOperatorInner createOrUpdate(String pricingName, String securityOperatorName) { - return createOrUpdateWithResponse(pricingName, securityOperatorName, Context.NONE).getValue(); - } - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName Name of the pricing configuration. - * @param securityOperatorName Name of the security operator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 pricingName, String securityOperatorName) { - 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 (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (securityOperatorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityOperatorName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), pricingName, securityOperatorName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName Name of the pricing configuration. - * @param securityOperatorName Name of the security operator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 pricingName, String securityOperatorName, - 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 (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (securityOperatorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityOperatorName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), pricingName, - securityOperatorName, context); - } - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName Name of the pricing configuration. - * @param securityOperatorName Name of the security operator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 pricingName, String securityOperatorName) { - return deleteWithResponseAsync(pricingName, securityOperatorName).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName Name of the pricing configuration. - * @param securityOperatorName Name of the security operator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String pricingName, String securityOperatorName, Context context) { - return deleteWithResponseAsync(pricingName, securityOperatorName, context).block(); - } - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName Name of the pricing configuration. - * @param securityOperatorName Name of the security operator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 pricingName, String securityOperatorName) { - deleteWithResponse(pricingName, securityOperatorName, Context.NONE); - } - - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName Name of the pricing 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 list of SecurityOperator response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String pricingName) { - 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 (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - pricingName, 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())); - } - - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName Name of the pricing 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 list of SecurityOperator response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String pricingName, 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 (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), pricingName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); - } - - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName Name of the pricing 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 list of SecurityOperator response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String pricingName) { - return new PagedFlux<>(() -> listSinglePageAsync(pricingName)); - } - - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName Name of the pricing 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 list of SecurityOperator response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String pricingName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(pricingName, context)); - } - - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName Name of the pricing 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 list of SecurityOperator response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String pricingName) { - return new PagedIterable<>(listAsync(pricingName)); - } - - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName Name of the pricing 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 list of SecurityOperator response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String pricingName, Context context) { - return new PagedIterable<>(listAsync(pricingName, context)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorsImpl.java deleted file mode 100644 index 049b5b0207c4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorsImpl.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SecurityOperatorsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorInner; -import com.azure.resourcemanager.security.models.SecurityOperator; -import com.azure.resourcemanager.security.models.SecurityOperators; - -public final class SecurityOperatorsImpl implements SecurityOperators { - private static final ClientLogger LOGGER = new ClientLogger(SecurityOperatorsImpl.class); - - private final SecurityOperatorsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecurityOperatorsImpl(SecurityOperatorsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String pricingName, String securityOperatorName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(pricingName, securityOperatorName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityOperatorImpl(inner.getValue(), this.manager())); - } - - public SecurityOperator get(String pricingName, String securityOperatorName) { - SecurityOperatorInner inner = this.serviceClient().get(pricingName, securityOperatorName); - if (inner != null) { - return new SecurityOperatorImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse(String pricingName, String securityOperatorName, - Context context) { - Response inner - = this.serviceClient().createOrUpdateWithResponse(pricingName, securityOperatorName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityOperatorImpl(inner.getValue(), this.manager())); - } - - public SecurityOperator createOrUpdate(String pricingName, String securityOperatorName) { - SecurityOperatorInner inner = this.serviceClient().createOrUpdate(pricingName, securityOperatorName); - if (inner != null) { - return new SecurityOperatorImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse(String pricingName, String securityOperatorName, - Context context) { - return this.serviceClient().deleteWithResponse(pricingName, securityOperatorName, context); - } - - public void deleteByResourceGroup(String pricingName, String securityOperatorName) { - this.serviceClient().delete(pricingName, securityOperatorName); - } - - public PagedIterable list(String pricingName) { - PagedIterable inner = this.serviceClient().list(pricingName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityOperatorImpl(inner1, this.manager())); - } - - public PagedIterable list(String pricingName, Context context) { - PagedIterable inner = this.serviceClient().list(pricingName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityOperatorImpl(inner1, this.manager())); - } - - private SecurityOperatorsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionImpl.java deleted file mode 100644 index 0a7979533a79..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionInner; -import com.azure.resourcemanager.security.models.ProvisioningState; -import com.azure.resourcemanager.security.models.SecurityFamily; -import com.azure.resourcemanager.security.models.SecuritySolution; - -public final class SecuritySolutionImpl implements SecuritySolution { - private SecuritySolutionInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecuritySolutionImpl(SecuritySolutionInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 String location() { - return this.innerModel().location(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public SecurityFamily securityFamily() { - return this.innerModel().securityFamily(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public String template() { - return this.innerModel().template(); - } - - public String protectionStatus() { - return this.innerModel().protectionStatus(); - } - - public SecuritySolutionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsClientImpl.java deleted file mode 100644 index 2f40dd354f30..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsClientImpl.java +++ /dev/null @@ -1,391 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionInner; -import com.azure.resourcemanager.security.implementation.models.SecuritySolutionList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SecuritySolutionsClient. - */ -public final class SecuritySolutionsClientImpl implements SecuritySolutionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SecuritySolutionsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecuritySolutionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecuritySolutionsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(SecuritySolutionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecuritySolutions to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterSecuritySolutions") - public interface SecuritySolutionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutions/{securitySolutionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @PathParam("securitySolutionName") String securitySolutionName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets a specific Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param securitySolutionName Name of security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security Solution along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String ascLocation, - String securitySolutionName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (securitySolutionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securitySolutionName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, ascLocation, securitySolutionName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a specific Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param securitySolutionName Name of security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security Solution along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String ascLocation, - String securitySolutionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (securitySolutionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securitySolutionName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - ascLocation, securitySolutionName, accept, context); - } - - /** - * Gets a specific Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param securitySolutionName Name of security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security Solution on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String ascLocation, - String securitySolutionName) { - return getWithResponseAsync(resourceGroupName, ascLocation, securitySolutionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a specific Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param securitySolutionName Name of security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security Solution along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String ascLocation, - String securitySolutionName, Context context) { - return getWithResponseAsync(resourceGroupName, ascLocation, securitySolutionName, context).block(); - } - - /** - * Gets a specific Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param securitySolutionName Name of security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security Solution. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecuritySolutionInner get(String resourceGroupName, String ascLocation, String securitySolutionName) { - return getWithResponse(resourceGroupName, ascLocation, securitySolutionName, Context.NONE).getValue(); - } - - /** - * Gets a list of Security Solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Security Solutions for the subscription 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Security Solutions for the subscription 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-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)); - } - - /** - * Gets a list of Security Solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Security Solutions for the subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Security Solutions for the subscription 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 a list of Security Solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Security Solutions for the subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets a list of Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Security Solutions for the subscription 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 a list of Security Solutions for the subscription 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 a list of Security Solutions for the subscription 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsImpl.java deleted file mode 100644 index 394b424678f5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionInner; -import com.azure.resourcemanager.security.models.SecuritySolution; -import com.azure.resourcemanager.security.models.SecuritySolutions; - -public final class SecuritySolutionsImpl implements SecuritySolutions { - private static final ClientLogger LOGGER = new ClientLogger(SecuritySolutionsImpl.class); - - private final SecuritySolutionsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecuritySolutionsImpl(SecuritySolutionsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String ascLocation, - String securitySolutionName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, ascLocation, securitySolutionName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecuritySolutionImpl(inner.getValue(), this.manager())); - } - - public SecuritySolution get(String resourceGroupName, String ascLocation, String securitySolutionName) { - SecuritySolutionInner inner = this.serviceClient().get(resourceGroupName, ascLocation, securitySolutionName); - if (inner != null) { - return new SecuritySolutionImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecuritySolutionImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecuritySolutionImpl(inner1, this.manager())); - } - - private SecuritySolutionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsReferenceDataListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsReferenceDataListImpl.java deleted file mode 100644 index e565ba915823..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsReferenceDataListImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionsReferenceDataListInner; -import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceData; -import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceDataList; -import java.util.Collections; -import java.util.List; - -public final class SecuritySolutionsReferenceDataListImpl implements SecuritySolutionsReferenceDataList { - private SecuritySolutionsReferenceDataListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecuritySolutionsReferenceDataListImpl(SecuritySolutionsReferenceDataListInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SecuritySolutionsReferenceDataListInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsReferenceDatasClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsReferenceDatasClientImpl.java deleted file mode 100644 index 78ba8768ee90..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsReferenceDatasClientImpl.java +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SecuritySolutionsReferenceDatasClient; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionsReferenceDataListInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SecuritySolutionsReferenceDatasClient. - */ -public final class SecuritySolutionsReferenceDatasClientImpl implements SecuritySolutionsReferenceDatasClient { - /** - * The proxy service used to perform REST calls. - */ - private final SecuritySolutionsReferenceDatasService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecuritySolutionsReferenceDatasClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecuritySolutionsReferenceDatasClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(SecuritySolutionsReferenceDatasService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecuritySolutionsReferenceDatas to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterSecuritySolutionsReferenceDatas") - public interface SecuritySolutionsReferenceDatasService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutionsReferenceData") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutionsReferenceData") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegion(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets a list of all supported Security Solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all supported Security Solutions for the subscription along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync() { - 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 = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of all supported Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all supported Security Solutions for the 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * Gets a list of all supported Security Solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all supported Security Solutions for the subscription on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { - return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a list of all supported Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all supported Security Solutions for the subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); - } - - /** - * Gets a list of all supported Security Solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all supported Security Solutions for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecuritySolutionsReferenceDataListInner list() { - return listWithResponse(Context.NONE).getValue(); - } - - /** - * Gets list of all supported Security Solutions for subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all supported Security Solutions for subscription and location along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByHomeRegionWithResponseAsync(String ascLocation) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByHomeRegion(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets list of all supported Security Solutions for subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all supported Security Solutions for subscription and location along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByHomeRegionWithResponseAsync(String ascLocation, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByHomeRegion(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - ascLocation, accept, context); - } - - /** - * Gets list of all supported Security Solutions for subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all supported Security Solutions for subscription and location on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listByHomeRegionAsync(String ascLocation) { - return listByHomeRegionWithResponseAsync(ascLocation).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets list of all supported Security Solutions for subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all supported Security Solutions for subscription and location along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listByHomeRegionWithResponse(String ascLocation, - Context context) { - return listByHomeRegionWithResponseAsync(ascLocation, context).block(); - } - - /** - * Gets list of all supported Security Solutions for subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all supported Security Solutions for subscription and location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecuritySolutionsReferenceDataListInner listByHomeRegion(String ascLocation) { - return listByHomeRegionWithResponse(ascLocation, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsReferenceDatasImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsReferenceDatasImpl.java deleted file mode 100644 index d968f41a4159..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsReferenceDatasImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.SecuritySolutionsReferenceDatasClient; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionsReferenceDataListInner; -import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceDataList; -import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceDatas; - -public final class SecuritySolutionsReferenceDatasImpl implements SecuritySolutionsReferenceDatas { - private static final ClientLogger LOGGER = new ClientLogger(SecuritySolutionsReferenceDatasImpl.class); - - private final SecuritySolutionsReferenceDatasClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecuritySolutionsReferenceDatasImpl(SecuritySolutionsReferenceDatasClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response listWithResponse(Context context) { - Response inner = this.serviceClient().listWithResponse(context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecuritySolutionsReferenceDataListImpl(inner.getValue(), this.manager())); - } - - public SecuritySolutionsReferenceDataList list() { - SecuritySolutionsReferenceDataListInner inner = this.serviceClient().list(); - if (inner != null) { - return new SecuritySolutionsReferenceDataListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listByHomeRegionWithResponse(String ascLocation, - Context context) { - Response inner - = this.serviceClient().listByHomeRegionWithResponse(ascLocation, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecuritySolutionsReferenceDataListImpl(inner.getValue(), this.manager())); - } - - public SecuritySolutionsReferenceDataList listByHomeRegion(String ascLocation) { - SecuritySolutionsReferenceDataListInner inner = this.serviceClient().listByHomeRegion(ascLocation); - if (inner != null) { - return new SecuritySolutionsReferenceDataListImpl(inner, this.manager()); - } else { - return null; - } - } - - private SecuritySolutionsReferenceDatasClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityStandardImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityStandardImpl.java deleted file mode 100644 index 5fb9b208ccc7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityStandardImpl.java +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityStandardInner; -import com.azure.resourcemanager.security.models.PartialAssessmentProperties; -import com.azure.resourcemanager.security.models.SecurityStandard; -import com.azure.resourcemanager.security.models.StandardMetadata; -import com.azure.resourcemanager.security.models.StandardSupportedCloud; -import com.azure.resourcemanager.security.models.StandardType; -import java.util.Collections; -import java.util.List; - -public final class SecurityStandardImpl - implements SecurityStandard, SecurityStandard.Definition, SecurityStandard.Update { - private SecurityStandardInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager 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 String displayName() { - return this.innerModel().displayName(); - } - - public StandardType standardType() { - return this.innerModel().standardType(); - } - - public String description() { - return this.innerModel().description(); - } - - public List assessments() { - List inner = this.innerModel().assessments(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List cloudProviders() { - List inner = this.innerModel().cloudProviders(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String policySetDefinitionId() { - return this.innerModel().policySetDefinitionId(); - } - - public StandardMetadata metadata() { - return this.innerModel().metadata(); - } - - public SecurityStandardInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String scope; - - private String standardId; - - public SecurityStandardImpl withExistingScope(String scope) { - this.scope = scope; - return this; - } - - public SecurityStandard create() { - this.innerObject = serviceManager.serviceClient() - .getSecurityStandards() - .createOrUpdateWithResponse(scope, standardId, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public SecurityStandard create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSecurityStandards() - .createOrUpdateWithResponse(scope, standardId, this.innerModel(), context) - .getValue(); - return this; - } - - SecurityStandardImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new SecurityStandardInner(); - this.serviceManager = serviceManager; - this.standardId = name; - } - - public SecurityStandardImpl update() { - return this; - } - - public SecurityStandard apply() { - this.innerObject = serviceManager.serviceClient() - .getSecurityStandards() - .createOrUpdateWithResponse(scope, standardId, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public SecurityStandard apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSecurityStandards() - .createOrUpdateWithResponse(scope, standardId, this.innerModel(), context) - .getValue(); - return this; - } - - SecurityStandardImpl(SecurityStandardInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.scope = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{scope}/providers/Microsoft.Security/securityStandards/{standardId}", "scope"); - this.standardId = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), - "/{scope}/providers/Microsoft.Security/securityStandards/{standardId}", "standardId"); - } - - public SecurityStandard refresh() { - this.innerObject = serviceManager.serviceClient() - .getSecurityStandards() - .getWithResponse(scope, standardId, Context.NONE) - .getValue(); - return this; - } - - public SecurityStandard refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSecurityStandards() - .getWithResponse(scope, standardId, context) - .getValue(); - return this; - } - - public SecurityStandardImpl withDisplayName(String displayName) { - this.innerModel().withDisplayName(displayName); - return this; - } - - public SecurityStandardImpl withDescription(String description) { - this.innerModel().withDescription(description); - return this; - } - - public SecurityStandardImpl withAssessments(List assessments) { - this.innerModel().withAssessments(assessments); - return this; - } - - public SecurityStandardImpl withCloudProviders(List cloudProviders) { - this.innerModel().withCloudProviders(cloudProviders); - return this; - } - - public SecurityStandardImpl withPolicySetDefinitionId(String policySetDefinitionId) { - this.innerModel().withPolicySetDefinitionId(policySetDefinitionId); - return this; - } - - public SecurityStandardImpl withMetadata(StandardMetadata metadata) { - this.innerModel().withMetadata(metadata); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityStandardsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityStandardsClientImpl.java deleted file mode 100644 index 2ff4481ead35..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityStandardsClientImpl.java +++ /dev/null @@ -1,614 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.resourcemanager.security.fluent.SecurityStandardsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityStandardInner; -import com.azure.resourcemanager.security.implementation.models.SecurityStandardList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SecurityStandardsClient. - */ -public final class SecurityStandardsClientImpl implements SecurityStandardsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SecurityStandardsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecurityStandardsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecurityStandardsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(SecurityStandardsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecurityStandards to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterSecurityStandards") - public interface SecurityStandardsService { - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/securityStandards/{standardId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("standardId") String standardId, @HeaderParam("Accept") String accept, Context context); - - @Put("/{scope}/providers/Microsoft.Security/securityStandards/{standardId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("standardId") String standardId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") SecurityStandardInner standard, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/{scope}/providers/Microsoft.Security/securityStandards/{standardId}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("standardId") String standardId, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/securityStandards") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get a specific security standard for the requested scope by standardId. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param standardId The Security Standard key - unique key for the standard type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security standard for the requested scope by standardId along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String standardId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (standardId == null) { - return Mono.error(new IllegalArgumentException("Parameter standardId is required and cannot be null.")); - } - final String apiVersion = "2024-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), apiVersion, scope, standardId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific security standard for the requested scope by standardId. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param standardId The Security Standard key - unique key for the standard 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 a specific security standard for the requested scope by standardId along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String standardId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (standardId == null) { - return Mono.error(new IllegalArgumentException("Parameter standardId is required and cannot be null.")); - } - final String apiVersion = "2024-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, standardId, accept, context); - } - - /** - * Get a specific security standard for the requested scope by standardId. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param standardId The Security Standard key - unique key for the standard type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security standard for the requested scope by standardId on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, String standardId) { - return getWithResponseAsync(scope, standardId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a specific security standard for the requested scope by standardId. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param standardId The Security Standard key - unique key for the standard 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 a specific security standard for the requested scope by standardId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String standardId, Context context) { - return getWithResponseAsync(scope, standardId, context).block(); - } - - /** - * Get a specific security standard for the requested scope by standardId. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param standardId The Security Standard key - unique key for the standard type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security standard for the requested scope by standardId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityStandardInner get(String scope, String standardId) { - return getWithResponse(scope, standardId, Context.NONE).getValue(); - } - - /** - * Creates or updates a security standard over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param standardId The Security Standard key - unique key for the standard type. - * @param standard Custom security standard over a pre-defined scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Standard on a resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String scope, String standardId, - SecurityStandardInner standard) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (standardId == null) { - return Mono.error(new IllegalArgumentException("Parameter standardId is required and cannot be null.")); - } - if (standard == null) { - return Mono.error(new IllegalArgumentException("Parameter standard is required and cannot be null.")); - } else { - standard.validate(); - } - final String apiVersion = "2024-08-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, standardId, - contentType, accept, standard, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a security standard over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param standardId The Security Standard key - unique key for the standard type. - * @param standard Custom security standard over a pre-defined scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Standard on a resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String scope, String standardId, - SecurityStandardInner standard, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (standardId == null) { - return Mono.error(new IllegalArgumentException("Parameter standardId is required and cannot be null.")); - } - if (standard == null) { - return Mono.error(new IllegalArgumentException("Parameter standard is required and cannot be null.")); - } else { - standard.validate(); - } - final String apiVersion = "2024-08-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, scope, standardId, contentType, accept, - standard, context); - } - - /** - * Creates or updates a security standard over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param standardId The Security Standard key - unique key for the standard type. - * @param standard Custom security standard over a pre-defined scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Standard on a resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String scope, String standardId, - SecurityStandardInner standard) { - return createOrUpdateWithResponseAsync(scope, standardId, standard) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates a security standard over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param standardId The Security Standard key - unique key for the standard type. - * @param standard Custom security standard over a pre-defined scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Standard on a resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String scope, String standardId, - SecurityStandardInner standard, Context context) { - return createOrUpdateWithResponseAsync(scope, standardId, standard, context).block(); - } - - /** - * Creates or updates a security standard over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param standardId The Security Standard key - unique key for the standard type. - * @param standard Custom security standard over a pre-defined scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Standard on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityStandardInner createOrUpdate(String scope, String standardId, SecurityStandardInner standard) { - return createOrUpdateWithResponse(scope, standardId, standard, Context.NONE).getValue(); - } - - /** - * Delete a security standard over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param standardId The Security Standard key - unique key for the standard type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 scope, String standardId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (standardId == null) { - return Mono.error(new IllegalArgumentException("Parameter standardId is required and cannot be null.")); - } - final String apiVersion = "2024-08-01"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, scope, standardId, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a security standard over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param standardId The Security Standard key - unique key for the standard 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 scope, String standardId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (standardId == null) { - return Mono.error(new IllegalArgumentException("Parameter standardId is required and cannot be null.")); - } - final String apiVersion = "2024-08-01"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, scope, standardId, context); - } - - /** - * Delete a security standard over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param standardId The Security Standard key - unique key for the standard type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 scope, String standardId) { - return deleteWithResponseAsync(scope, standardId).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a security standard over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param standardId The Security Standard key - unique key for the standard 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String scope, String standardId, Context context) { - return deleteWithResponseAsync(scope, standardId, context).block(); - } - - /** - * Delete a security standard over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param standardId The Security Standard key - unique key for the standard type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 scope, String standardId) { - deleteWithResponse(scope, standardId, Context.NONE); - } - - /** - * Get a list of all relevant security standards over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant security standards over a scope along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2024-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, 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 a list of all relevant security standards over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant security standards over a scope along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2024-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get a list of all relevant security standards over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant security standards over a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of all relevant security standards over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant security standards over a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of all relevant security standards over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant security standards over a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(listAsync(scope)); - } - - /** - * Get a list of all relevant security standards over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant security standards over a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(listAsync(scope, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant security standards over a scope 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 a list of all relevant security standards over a scope 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityStandardsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityStandardsImpl.java deleted file mode 100644 index e04090591001..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityStandardsImpl.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SecurityStandardsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityStandardInner; -import com.azure.resourcemanager.security.models.SecurityStandard; -import com.azure.resourcemanager.security.models.SecurityStandards; - -public final class SecurityStandardsImpl implements SecurityStandards { - private static final ClientLogger LOGGER = new ClientLogger(SecurityStandardsImpl.class); - - private final SecurityStandardsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecurityStandardsImpl(SecurityStandardsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String scope, String standardId, Context context) { - Response inner = this.serviceClient().getWithResponse(scope, standardId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityStandardImpl(inner.getValue(), this.manager())); - } - - public SecurityStandard get(String scope, String standardId) { - SecurityStandardInner inner = this.serviceClient().get(scope, standardId); - if (inner != null) { - return new SecurityStandardImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse(String scope, String standardId, Context context) { - return this.serviceClient().deleteWithResponse(scope, standardId, context); - } - - public void deleteByResourceGroup(String scope, String standardId) { - this.serviceClient().delete(scope, standardId); - } - - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityStandardImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityStandardImpl(inner1, this.manager())); - } - - public SecurityStandard getById(String id) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/securityStandards/{standardId}", "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String standardId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/securityStandards/{standardId}", "standardId"); - if (standardId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityStandards'.", id))); - } - return this.getWithResponse(scope, standardId, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/securityStandards/{standardId}", "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String standardId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/securityStandards/{standardId}", "standardId"); - if (standardId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityStandards'.", id))); - } - return this.getWithResponse(scope, standardId, context); - } - - public void deleteById(String id) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/securityStandards/{standardId}", "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String standardId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/securityStandards/{standardId}", "standardId"); - if (standardId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityStandards'.", id))); - } - this.deleteByResourceGroupWithResponse(scope, standardId, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/securityStandards/{standardId}", "scope"); - if (scope == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String standardId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{scope}/providers/Microsoft.Security/securityStandards/{standardId}", "standardId"); - if (standardId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'securityStandards'.", id))); - } - return this.deleteByResourceGroupWithResponse(scope, standardId, context); - } - - private SecurityStandardsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public SecurityStandardImpl define(String name) { - return new SecurityStandardImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySubAssessmentImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySubAssessmentImpl.java deleted file mode 100644 index 145fa6a00237..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySubAssessmentImpl.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.SecuritySubAssessmentInner; -import com.azure.resourcemanager.security.models.AdditionalData; -import com.azure.resourcemanager.security.models.ResourceDetails; -import com.azure.resourcemanager.security.models.SecuritySubAssessment; -import com.azure.resourcemanager.security.models.SubAssessmentStatus; -import java.time.OffsetDateTime; - -public final class SecuritySubAssessmentImpl implements SecuritySubAssessment { - private SecuritySubAssessmentInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecuritySubAssessmentImpl(SecuritySubAssessmentInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public String idPropertiesId() { - return this.innerModel().idPropertiesId(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public SubAssessmentStatus status() { - return this.innerModel().status(); - } - - public String remediation() { - return this.innerModel().remediation(); - } - - public String impact() { - return this.innerModel().impact(); - } - - public String category() { - return this.innerModel().category(); - } - - public String description() { - return this.innerModel().description(); - } - - public OffsetDateTime timeGenerated() { - return this.innerModel().timeGenerated(); - } - - public ResourceDetails resourceDetails() { - return this.innerModel().resourceDetails(); - } - - public AdditionalData additionalData() { - return this.innerModel().additionalData(); - } - - public SecuritySubAssessmentInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityTaskImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityTaskImpl.java deleted file mode 100644 index 52cd09b80130..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityTaskImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.SecurityTaskInner; -import com.azure.resourcemanager.security.models.SecurityTask; -import com.azure.resourcemanager.security.models.SecurityTaskParameters; -import java.time.OffsetDateTime; - -public final class SecurityTaskImpl implements SecurityTask { - private SecurityTaskInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecurityTaskImpl(SecurityTaskInner innerObject, com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public String state() { - return this.innerModel().state(); - } - - public OffsetDateTime creationTimeUtc() { - return this.innerModel().creationTimeUtc(); - } - - public SecurityTaskParameters securityTaskParameters() { - return this.innerModel().securityTaskParameters(); - } - - public OffsetDateTime lastStateChangeTimeUtc() { - return this.innerModel().lastStateChangeTimeUtc(); - } - - public String subState() { - return this.innerModel().subState(); - } - - public SecurityTaskInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsClientImpl.java deleted file mode 100644 index 22d9acf38a50..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsClientImpl.java +++ /dev/null @@ -1,354 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SensitivitySettingsClient; -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner; -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; -import com.azure.resourcemanager.security.models.UpdateSensitivitySettingsRequest; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SensitivitySettingsClient. - */ -public final class SensitivitySettingsClientImpl implements SensitivitySettingsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SensitivitySettingsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SensitivitySettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SensitivitySettingsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(SensitivitySettingsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSensitivitySettings to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterSensitivitySettings") - public interface SensitivitySettingsService { - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Security/sensitivitySettings/current") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - - @Put("/providers/Microsoft.Security/sensitivitySettings/current") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, - @BodyParam("application/json") UpdateSensitivitySettingsRequest sensitivitySettings, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Security/sensitivitySettings") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets data sensitivity settings for sensitive data discovery. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2023-02-15-preview"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets data sensitivity settings for sensitive data discovery. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(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 = "2023-02-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, accept, context); - } - - /** - * Gets data sensitivity settings for sensitive data discovery. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync() { - return getWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets data sensitivity settings for sensitive data discovery. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(Context context) { - return getWithResponseAsync(context).block(); - } - - /** - * Gets data sensitivity settings for sensitive data discovery. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GetSensitivitySettingsResponseInner get() { - return getWithResponse(Context.NONE).getValue(); - } - - /** - * Create or update data sensitivity settings for sensitive data discovery. - * - * @param sensitivitySettings The data sensitivity settings to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - createOrUpdateWithResponseAsync(UpdateSensitivitySettingsRequest sensitivitySettings) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (sensitivitySettings == null) { - return Mono - .error(new IllegalArgumentException("Parameter sensitivitySettings is required and cannot be null.")); - } else { - sensitivitySettings.validate(); - } - final String apiVersion = "2023-02-15-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, contentType, accept, - sensitivitySettings, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update data sensitivity settings for sensitive data discovery. - * - * @param sensitivitySettings The data sensitivity settings to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - createOrUpdateWithResponseAsync(UpdateSensitivitySettingsRequest sensitivitySettings, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (sensitivitySettings == null) { - return Mono - .error(new IllegalArgumentException("Parameter sensitivitySettings is required and cannot be null.")); - } else { - sensitivitySettings.validate(); - } - final String apiVersion = "2023-02-15-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, contentType, accept, sensitivitySettings, - context); - } - - /** - * Create or update data sensitivity settings for sensitive data discovery. - * - * @param sensitivitySettings The data sensitivity settings to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono - createOrUpdateAsync(UpdateSensitivitySettingsRequest sensitivitySettings) { - return createOrUpdateWithResponseAsync(sensitivitySettings).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create or update data sensitivity settings for sensitive data discovery. - * - * @param sensitivitySettings The data sensitivity settings to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response - createOrUpdateWithResponse(UpdateSensitivitySettingsRequest sensitivitySettings, Context context) { - return createOrUpdateWithResponseAsync(sensitivitySettings, context).block(); - } - - /** - * Create or update data sensitivity settings for sensitive data discovery. - * - * @param sensitivitySettings The data sensitivity settings to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return data sensitivity settings for sensitive data discovery. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GetSensitivitySettingsResponseInner createOrUpdate(UpdateSensitivitySettingsRequest sensitivitySettings) { - return createOrUpdateWithResponse(sensitivitySettings, Context.NONE).getValue(); - } - - /** - * Gets a list with a single sensitivity settings resource. - * - * @throws 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 with a single sensitivity settings resource along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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 = "2023-02-15-preview"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list with a single sensitivity settings 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 list with a single sensitivity settings resource 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 = "2023-02-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, accept, context); - } - - /** - * Gets a list with a single sensitivity settings resource. - * - * @throws 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 with a single sensitivity settings resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { - return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a list with a single sensitivity settings 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 list with a single sensitivity settings resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); - } - - /** - * Gets a list with a single sensitivity settings resource. - * - * @throws 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 with a single sensitivity settings resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GetSensitivitySettingsListResponseInner list() { - return listWithResponse(Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsImpl.java deleted file mode 100644 index 36010d6973b4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.SensitivitySettingsClient; -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner; -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; -import com.azure.resourcemanager.security.models.GetSensitivitySettingsListResponse; -import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponse; -import com.azure.resourcemanager.security.models.SensitivitySettings; -import com.azure.resourcemanager.security.models.UpdateSensitivitySettingsRequest; - -public final class SensitivitySettingsImpl implements SensitivitySettings { - private static final ClientLogger LOGGER = new ClientLogger(SensitivitySettingsImpl.class); - - private final SensitivitySettingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SensitivitySettingsImpl(SensitivitySettingsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(Context context) { - Response inner = this.serviceClient().getWithResponse(context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GetSensitivitySettingsResponseImpl(inner.getValue(), this.manager())); - } - - public GetSensitivitySettingsResponse get() { - GetSensitivitySettingsResponseInner inner = this.serviceClient().get(); - if (inner != null) { - return new GetSensitivitySettingsResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response - createOrUpdateWithResponse(UpdateSensitivitySettingsRequest sensitivitySettings, Context context) { - Response inner - = this.serviceClient().createOrUpdateWithResponse(sensitivitySettings, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GetSensitivitySettingsResponseImpl(inner.getValue(), this.manager())); - } - - public GetSensitivitySettingsResponse createOrUpdate(UpdateSensitivitySettingsRequest sensitivitySettings) { - GetSensitivitySettingsResponseInner inner = this.serviceClient().createOrUpdate(sensitivitySettings); - if (inner != null) { - return new GetSensitivitySettingsResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listWithResponse(Context context) { - Response inner = this.serviceClient().listWithResponse(context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new GetSensitivitySettingsListResponseImpl(inner.getValue(), this.manager())); - } - - public GetSensitivitySettingsListResponse list() { - GetSensitivitySettingsListResponseInner inner = this.serviceClient().list(); - if (inner != null) { - return new GetSensitivitySettingsListResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private SensitivitySettingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentImpl.java deleted file mode 100644 index 46974c2d9456..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentInner; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessment; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentPropertiesProvisioningState; - -public final class ServerVulnerabilityAssessmentImpl implements ServerVulnerabilityAssessment { - private ServerVulnerabilityAssessmentInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ServerVulnerabilityAssessmentImpl(ServerVulnerabilityAssessmentInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public ServerVulnerabilityAssessmentPropertiesProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public ServerVulnerabilityAssessmentInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsClientImpl.java deleted file mode 100644 index 6ec6b7086f8e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsClientImpl.java +++ /dev/null @@ -1,826 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -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.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.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.security.fluent.ServerVulnerabilityAssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentInner; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsListInner; -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 ServerVulnerabilityAssessmentsClient. - */ -public final class ServerVulnerabilityAssessmentsClientImpl implements ServerVulnerabilityAssessmentsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ServerVulnerabilityAssessmentsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of ServerVulnerabilityAssessmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ServerVulnerabilityAssessmentsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(ServerVulnerabilityAssessmentsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterServerVulnerabilityAssessments to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterServerVulnerabilityAssessments") - public interface ServerVulnerabilityAssessmentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, - @PathParam("serverVulnerabilityAssessment") String serverVulnerabilityAssessment, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, - @PathParam("serverVulnerabilityAssessment") String serverVulnerabilityAssessment, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}") - @ExpectedResponses({ 200, 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, - @PathParam("serverVulnerabilityAssessment") String serverVulnerabilityAssessment, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByExtendedResource( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets a server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 server vulnerability assessment onboarding statuses on a given resource along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String resourceNamespace, String resourceType, String resourceName) { - 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 (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String serverVulnerabilityAssessment = "default"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, resourceNamespace, resourceType, resourceName, serverVulnerabilityAssessment, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 server vulnerability assessment onboarding statuses on a given resource along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String resourceNamespace, String resourceType, String resourceName, 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 (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String serverVulnerabilityAssessment = "default"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - resourceNamespace, resourceType, resourceName, serverVulnerabilityAssessment, accept, context); - } - - /** - * Gets a server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 server vulnerability assessment onboarding statuses on a given resource on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName) { - return getWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 server vulnerability assessment onboarding statuses on a given resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, - String resourceNamespace, String resourceType, String resourceName, Context context) { - return getWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, context).block(); - } - - /** - * Gets a server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 server vulnerability assessment onboarding statuses on a given resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerVulnerabilityAssessmentInner get(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName) { - return getWithResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, Context.NONE) - .getValue(); - } - - /** - * Creating a server vulnerability assessment on a resource, which will onboard a resource for having a - * vulnerability assessment on it. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 describes the server vulnerability assessment details on a resource along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceNamespace, String resourceType, String resourceName) { - 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 (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String serverVulnerabilityAssessment = "default"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, resourceNamespace, resourceType, resourceName, - serverVulnerabilityAssessment, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creating a server vulnerability assessment on a resource, which will onboard a resource for having a - * vulnerability assessment on it. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 describes the server vulnerability assessment details on a resource along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String resourceNamespace, String resourceType, String resourceName, 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 (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String serverVulnerabilityAssessment = "default"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, resourceNamespace, resourceType, resourceName, serverVulnerabilityAssessment, accept, - context); - } - - /** - * Creating a server vulnerability assessment on a resource, which will onboard a resource for having a - * vulnerability assessment on it. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 describes the server vulnerability assessment details on a resource on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, - String resourceNamespace, String resourceType, String resourceName) { - return createOrUpdateWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creating a server vulnerability assessment on a resource, which will onboard a resource for having a - * vulnerability assessment on it. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 describes the server vulnerability assessment details on a resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, - String resourceNamespace, String resourceType, String resourceName, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, - context).block(); - } - - /** - * Creating a server vulnerability assessment on a resource, which will onboard a resource for having a - * vulnerability assessment on it. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 describes the server vulnerability assessment details on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerVulnerabilityAssessmentInner createOrUpdate(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName) { - return createOrUpdateWithResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, - Context.NONE).getValue(); - } - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName) { - 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 (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String serverVulnerabilityAssessment = "default"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, resourceNamespace, resourceType, resourceName, - serverVulnerabilityAssessment, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 resourceNamespace, - String resourceType, String resourceName, 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 (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String serverVulnerabilityAssessment = "default"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - resourceNamespace, resourceType, resourceName, serverVulnerabilityAssessment, context); - } - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName) { - return this.beginDeleteAsync(resourceGroupName, resourceNamespace, resourceType, resourceName).getSyncPoller(); - } - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName, Context context) { - return this.beginDeleteAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, context) - .getSyncPoller(); - } - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String resourceNamespace, String resourceType, - String resourceName) { - return beginDeleteAsync(resourceGroupName, resourceNamespace, resourceType, resourceName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String resourceNamespace, String resourceType, - String resourceName, Context context) { - return beginDeleteAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - deleteAsync(resourceGroupName, resourceNamespace, resourceType, resourceName).block(); - } - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, - Context context) { - deleteAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, context).block(); - } - - /** - * Gets a list of server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 list of server vulnerability assessment onboarding statuses on a given resource along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByExtendedResourceWithResponseAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - 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 (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByExtendedResource(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, resourceNamespace, resourceType, resourceName, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 list of server vulnerability assessment onboarding statuses on a given resource along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByExtendedResourceWithResponseAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, 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 (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByExtendedResource(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, resourceNamespace, resourceType, resourceName, accept, context); - } - - /** - * Gets a list of server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 list of server vulnerability assessment onboarding statuses on a given resource on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listByExtendedResourceAsync(String resourceGroupName, - String resourceNamespace, String resourceType, String resourceName) { - return listByExtendedResourceWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a list of server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 list of server vulnerability assessment onboarding statuses on a given resource along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listByExtendedResourceWithResponse( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - return listByExtendedResourceWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, - context).block(); - } - - /** - * Gets a list of server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param resourceNamespace The parent resource provider namespace. - * @param resourceType The type of the resource. - * @param resourceName The name of the 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 list of server vulnerability assessment onboarding statuses on a given resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerVulnerabilityAssessmentsListInner listByExtendedResource(String resourceGroupName, - String resourceNamespace, String resourceType, String resourceName) { - return listByExtendedResourceWithResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, - Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsImpl.java deleted file mode 100644 index 594c46c0b6e1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.ServerVulnerabilityAssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentInner; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsListInner; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessment; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessments; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsList; - -public final class ServerVulnerabilityAssessmentsImpl implements ServerVulnerabilityAssessments { - private static final ClientLogger LOGGER = new ClientLogger(ServerVulnerabilityAssessmentsImpl.class); - - private final ServerVulnerabilityAssessmentsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ServerVulnerabilityAssessmentsImpl(ServerVulnerabilityAssessmentsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ServerVulnerabilityAssessmentImpl(inner.getValue(), this.manager())); - } - - public ServerVulnerabilityAssessment get(String resourceGroupName, String resourceNamespace, String resourceType, - String resourceName) { - ServerVulnerabilityAssessmentInner inner - = this.serviceClient().get(resourceGroupName, resourceNamespace, resourceType, resourceName); - if (inner != null) { - return new ServerVulnerabilityAssessmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse(String resourceGroupName, - String resourceNamespace, String resourceType, String resourceName, Context context) { - Response inner = this.serviceClient() - .createOrUpdateWithResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ServerVulnerabilityAssessmentImpl(inner.getValue(), this.manager())); - } - - public ServerVulnerabilityAssessment createOrUpdate(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName) { - ServerVulnerabilityAssessmentInner inner - = this.serviceClient().createOrUpdate(resourceGroupName, resourceNamespace, resourceType, resourceName); - if (inner != null) { - return new ServerVulnerabilityAssessmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - this.serviceClient().delete(resourceGroupName, resourceNamespace, resourceType, resourceName); - } - - public void delete(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, - Context context) { - this.serviceClient().delete(resourceGroupName, resourceNamespace, resourceType, resourceName, context); - } - - public Response listByExtendedResourceWithResponse(String resourceGroupName, - String resourceNamespace, String resourceType, String resourceName, Context context) { - Response inner = this.serviceClient() - .listByExtendedResourceWithResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, - context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ServerVulnerabilityAssessmentsListImpl(inner.getValue(), this.manager())); - } - - public ServerVulnerabilityAssessmentsList listByExtendedResource(String resourceGroupName, String resourceNamespace, - String resourceType, String resourceName) { - ServerVulnerabilityAssessmentsListInner inner = this.serviceClient() - .listByExtendedResource(resourceGroupName, resourceNamespace, resourceType, resourceName); - if (inner != null) { - return new ServerVulnerabilityAssessmentsListImpl(inner, this.manager()); - } else { - return null; - } - } - - private ServerVulnerabilityAssessmentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsListImpl.java deleted file mode 100644 index 47e53614668f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsListImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentInner; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsListInner; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessment; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsList; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class ServerVulnerabilityAssessmentsListImpl implements ServerVulnerabilityAssessmentsList { - private ServerVulnerabilityAssessmentsListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ServerVulnerabilityAssessmentsListImpl(ServerVulnerabilityAssessmentsListInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new ServerVulnerabilityAssessmentImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public ServerVulnerabilityAssessmentsListInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingImpl.java deleted file mode 100644 index ed7b886876d0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsSettingInner; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSetting; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKind; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingProperties; - -public final class ServerVulnerabilityAssessmentsSettingImpl implements ServerVulnerabilityAssessmentsSetting { - private ServerVulnerabilityAssessmentsSettingInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ServerVulnerabilityAssessmentsSettingImpl(ServerVulnerabilityAssessmentsSettingInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 ServerVulnerabilityAssessmentsSettingKind kind() { - return this.innerModel().kind(); - } - - public ServerVulnerabilityAssessmentsSettingProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ServerVulnerabilityAssessmentsSettingInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingsClientImpl.java deleted file mode 100644 index 68e07d1c178b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingsClientImpl.java +++ /dev/null @@ -1,638 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.resourcemanager.security.fluent.ServerVulnerabilityAssessmentsSettingsClient; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsSettingInner; -import com.azure.resourcemanager.security.implementation.models.ServerVulnerabilityAssessmentsSettingsList; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * ServerVulnerabilityAssessmentsSettingsClient. - */ -public final class ServerVulnerabilityAssessmentsSettingsClientImpl - implements ServerVulnerabilityAssessmentsSettingsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ServerVulnerabilityAssessmentsSettingsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of ServerVulnerabilityAssessmentsSettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ServerVulnerabilityAssessmentsSettingsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(ServerVulnerabilityAssessmentsSettingsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterServerVulnerabilityAssessmentsSettings to be used by - * the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterServerVulnerabilityAssessmentsSettings") - public interface ServerVulnerabilityAssessmentsSettingsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings/{settingKind}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("settingKind") ServerVulnerabilityAssessmentsSettingKindName settingKind, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings/{settingKind}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("settingKind") ServerVulnerabilityAssessmentsSettingKindName settingKind, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting, - Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings/{settingKind}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("settingKind") ServerVulnerabilityAssessmentsSettingKindName settingKind, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get a server vulnerability assessments setting of the requested kind, that is set on the subscription. - * - * @param settingKind The kind of the server vulnerability assessments setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server vulnerability assessments setting of the requested kind, that is set on the subscription along - * with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getWithResponseAsync(ServerVulnerabilityAssessmentsSettingKindName settingKind) { - 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 (settingKind == null) { - return Mono.error(new IllegalArgumentException("Parameter settingKind is required and cannot be null.")); - } - final String apiVersion = "2023-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - settingKind, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a server vulnerability assessments setting of the requested kind, that is set on the subscription. - * - * @param settingKind The kind of the server vulnerability assessments setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server vulnerability assessments setting of the requested kind, that is set on the subscription along - * with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getWithResponseAsync(ServerVulnerabilityAssessmentsSettingKindName settingKind, 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 (settingKind == null) { - return Mono.error(new IllegalArgumentException("Parameter settingKind is required and cannot be null.")); - } - final String apiVersion = "2023-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), settingKind, accept, - context); - } - - /** - * Get a server vulnerability assessments setting of the requested kind, that is set on the subscription. - * - * @param settingKind The kind of the server vulnerability assessments setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server vulnerability assessments setting of the requested kind, that is set on the subscription on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono - getAsync(ServerVulnerabilityAssessmentsSettingKindName settingKind) { - return getWithResponseAsync(settingKind).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a server vulnerability assessments setting of the requested kind, that is set on the subscription. - * - * @param settingKind The kind of the server vulnerability assessments setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server vulnerability assessments setting of the requested kind, that is set on the subscription along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response - getWithResponse(ServerVulnerabilityAssessmentsSettingKindName settingKind, Context context) { - return getWithResponseAsync(settingKind, context).block(); - } - - /** - * Get a server vulnerability assessments setting of the requested kind, that is set on the subscription. - * - * @param settingKind The kind of the server vulnerability assessments setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 server vulnerability assessments setting of the requested kind, that is set on the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerVulnerabilityAssessmentsSettingInner get(ServerVulnerabilityAssessmentsSettingKindName settingKind) { - return getWithResponse(settingKind, Context.NONE).getValue(); - } - - /** - * Create or update a server vulnerability assessments setting of the requested kind on the subscription. - * - * @param settingKind The kind of the server vulnerability assessments setting. - * @param serverVulnerabilityAssessmentsSetting A server vulnerability assessments setting over a predefined scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 base vulnerability assessments setting on servers in the defined scope along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - ServerVulnerabilityAssessmentsSettingKindName settingKind, - ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting) { - 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 (settingKind == null) { - return Mono.error(new IllegalArgumentException("Parameter settingKind is required and cannot be null.")); - } - if (serverVulnerabilityAssessmentsSetting == null) { - return Mono.error(new IllegalArgumentException( - "Parameter serverVulnerabilityAssessmentsSetting is required and cannot be null.")); - } else { - serverVulnerabilityAssessmentsSetting.validate(); - } - final String apiVersion = "2023-05-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), settingKind, contentType, accept, - serverVulnerabilityAssessmentsSetting, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create or update a server vulnerability assessments setting of the requested kind on the subscription. - * - * @param settingKind The kind of the server vulnerability assessments setting. - * @param serverVulnerabilityAssessmentsSetting A server vulnerability assessments setting over a predefined scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 base vulnerability assessments setting on servers in the defined scope along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - ServerVulnerabilityAssessmentsSettingKindName settingKind, - ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting, 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 (settingKind == null) { - return Mono.error(new IllegalArgumentException("Parameter settingKind is required and cannot be null.")); - } - if (serverVulnerabilityAssessmentsSetting == null) { - return Mono.error(new IllegalArgumentException( - "Parameter serverVulnerabilityAssessmentsSetting is required and cannot be null.")); - } else { - serverVulnerabilityAssessmentsSetting.validate(); - } - final String apiVersion = "2023-05-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - settingKind, contentType, accept, serverVulnerabilityAssessmentsSetting, context); - } - - /** - * Create or update a server vulnerability assessments setting of the requested kind on the subscription. - * - * @param settingKind The kind of the server vulnerability assessments setting. - * @param serverVulnerabilityAssessmentsSetting A server vulnerability assessments setting over a predefined scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 base vulnerability assessments setting on servers in the defined scope on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - ServerVulnerabilityAssessmentsSettingKindName settingKind, - ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting) { - return createOrUpdateWithResponseAsync(settingKind, serverVulnerabilityAssessmentsSetting) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create or update a server vulnerability assessments setting of the requested kind on the subscription. - * - * @param settingKind The kind of the server vulnerability assessments setting. - * @param serverVulnerabilityAssessmentsSetting A server vulnerability assessments setting over a predefined scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 base vulnerability assessments setting on servers in the defined scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - ServerVulnerabilityAssessmentsSettingKindName settingKind, - ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting, Context context) { - return createOrUpdateWithResponseAsync(settingKind, serverVulnerabilityAssessmentsSetting, context).block(); - } - - /** - * Create or update a server vulnerability assessments setting of the requested kind on the subscription. - * - * @param settingKind The kind of the server vulnerability assessments setting. - * @param serverVulnerabilityAssessmentsSetting A server vulnerability assessments setting over a predefined scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 base vulnerability assessments setting on servers in the defined scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerVulnerabilityAssessmentsSettingInner createOrUpdate( - ServerVulnerabilityAssessmentsSettingKindName settingKind, - ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting) { - return createOrUpdateWithResponse(settingKind, serverVulnerabilityAssessmentsSetting, Context.NONE).getValue(); - } - - /** - * Delete the server vulnerability assessments setting of the requested kind from the subscription. - * - * @param settingKind The kind of the server vulnerability assessments setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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(ServerVulnerabilityAssessmentsSettingKindName settingKind) { - 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 (settingKind == null) { - return Mono.error(new IllegalArgumentException("Parameter settingKind is required and cannot be null.")); - } - final String apiVersion = "2023-05-01"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), settingKind, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete the server vulnerability assessments setting of the requested kind from the subscription. - * - * @param settingKind The kind of the server vulnerability assessments setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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(ServerVulnerabilityAssessmentsSettingKindName settingKind, - 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 (settingKind == null) { - return Mono.error(new IllegalArgumentException("Parameter settingKind is required and cannot be null.")); - } - final String apiVersion = "2023-05-01"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), settingKind, - context); - } - - /** - * Delete the server vulnerability assessments setting of the requested kind from the subscription. - * - * @param settingKind The kind of the server vulnerability assessments setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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(ServerVulnerabilityAssessmentsSettingKindName settingKind) { - return deleteWithResponseAsync(settingKind).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete the server vulnerability assessments setting of the requested kind from the subscription. - * - * @param settingKind The kind of the server vulnerability assessments setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(ServerVulnerabilityAssessmentsSettingKindName settingKind, - Context context) { - return deleteWithResponseAsync(settingKind, context).block(); - } - - /** - * Delete the server vulnerability assessments setting of the requested kind from the subscription. - * - * @param settingKind The kind of the server vulnerability assessments setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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(ServerVulnerabilityAssessmentsSettingKindName settingKind) { - deleteWithResponse(settingKind, Context.NONE); - } - - /** - * Get a list of all the server vulnerability assessments settings over a subscription level scope. - * - * @throws 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 the server vulnerability assessments settings over a subscription level scope 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2023-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a list of all the server vulnerability assessments settings over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 the server vulnerability assessments settings over a subscription level scope 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2023-05-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)); - } - - /** - * Get a list of all the server vulnerability assessments settings over a subscription level scope. - * - * @throws 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 the server vulnerability assessments settings over a subscription level scope as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of all the server vulnerability assessments settings over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 the server vulnerability assessments settings over a subscription level scope as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of all the server vulnerability assessments settings over a subscription level scope. - * - * @throws 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 the server vulnerability assessments settings over a subscription level scope as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Get a list of all the server vulnerability assessments settings over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 the server vulnerability assessments settings over a subscription level scope 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 a list of all the server vulnerability assessments settings over a subscription level scope along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 the server vulnerability assessments settings over a subscription level scope along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingsImpl.java deleted file mode 100644 index 61271faf8c07..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingsImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.ServerVulnerabilityAssessmentsSettingsClient; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsSettingInner; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSetting; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettings; - -public final class ServerVulnerabilityAssessmentsSettingsImpl implements ServerVulnerabilityAssessmentsSettings { - private static final ClientLogger LOGGER = new ClientLogger(ServerVulnerabilityAssessmentsSettingsImpl.class); - - private final ServerVulnerabilityAssessmentsSettingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ServerVulnerabilityAssessmentsSettingsImpl(ServerVulnerabilityAssessmentsSettingsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response - getWithResponse(ServerVulnerabilityAssessmentsSettingKindName settingKind, Context context) { - Response inner - = this.serviceClient().getWithResponse(settingKind, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ServerVulnerabilityAssessmentsSettingImpl(inner.getValue(), this.manager())); - } - - public ServerVulnerabilityAssessmentsSetting get(ServerVulnerabilityAssessmentsSettingKindName settingKind) { - ServerVulnerabilityAssessmentsSettingInner inner = this.serviceClient().get(settingKind); - if (inner != null) { - return new ServerVulnerabilityAssessmentsSettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse( - ServerVulnerabilityAssessmentsSettingKindName settingKind, - ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting, Context context) { - Response inner = this.serviceClient() - .createOrUpdateWithResponse(settingKind, serverVulnerabilityAssessmentsSetting, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ServerVulnerabilityAssessmentsSettingImpl(inner.getValue(), this.manager())); - } - - public ServerVulnerabilityAssessmentsSetting createOrUpdate( - ServerVulnerabilityAssessmentsSettingKindName settingKind, - ServerVulnerabilityAssessmentsSettingInner serverVulnerabilityAssessmentsSetting) { - ServerVulnerabilityAssessmentsSettingInner inner - = this.serviceClient().createOrUpdate(settingKind, serverVulnerabilityAssessmentsSetting); - if (inner != null) { - return new ServerVulnerabilityAssessmentsSettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(ServerVulnerabilityAssessmentsSettingKindName settingKind, - Context context) { - return this.serviceClient().deleteWithResponse(settingKind, context); - } - - public void delete(ServerVulnerabilityAssessmentsSettingKindName settingKind) { - this.serviceClient().delete(settingKind); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ServerVulnerabilityAssessmentsSettingImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ServerVulnerabilityAssessmentsSettingImpl(inner1, this.manager())); - } - - private ServerVulnerabilityAssessmentsSettingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingImpl.java deleted file mode 100644 index 0a3e814cb301..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.SettingInner; -import com.azure.resourcemanager.security.models.Setting; -import com.azure.resourcemanager.security.models.SettingKind; -import com.azure.resourcemanager.security.models.SettingProperties; - -public final class SettingImpl implements Setting { - private SettingInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SettingImpl(SettingInner innerObject, com.azure.resourcemanager.security.SecurityManager 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 SettingKind kind() { - return this.innerModel().kind(); - } - - public SettingProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public SettingInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsClientImpl.java deleted file mode 100644 index 2d7aaadd2b0b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsClientImpl.java +++ /dev/null @@ -1,480 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.resourcemanager.security.fluent.SettingsClient; -import com.azure.resourcemanager.security.fluent.models.SettingInner; -import com.azure.resourcemanager.security.implementation.models.SettingsList; -import com.azure.resourcemanager.security.models.SettingName; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SettingsClient. - */ -public final class SettingsClientImpl implements SettingsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SettingsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SettingsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(SettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSettings to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterSettings") - public interface SettingsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("settingName") SettingName settingName, @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("settingName") SettingName settingName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") SettingInner setting, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Settings of different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(SettingName settingName) { - 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 (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - final String apiVersion = "2022-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - settingName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Settings of different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(SettingName settingName, 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 (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - final String apiVersion = "2022-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), settingName, accept, - context); - } - - /** - * Settings of different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(SettingName settingName) { - return getWithResponseAsync(settingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Settings of different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(SettingName settingName, Context context) { - return getWithResponseAsync(settingName, context).block(); - } - - /** - * Settings of different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SettingInner get(SettingName settingName) { - return getWithResponse(settingName, Context.NONE).getValue(); - } - - /** - * updating settings about different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param setting Setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(SettingName settingName, SettingInner setting) { - 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 (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (setting == null) { - return Mono.error(new IllegalArgumentException("Parameter setting is required and cannot be null.")); - } else { - setting.validate(); - } - final String apiVersion = "2022-05-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), settingName, contentType, accept, setting, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * updating settings about different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param setting Setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(SettingName settingName, SettingInner setting, - 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 (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (setting == null) { - return Mono.error(new IllegalArgumentException("Parameter setting is required and cannot be null.")); - } else { - setting.validate(); - } - final String apiVersion = "2022-05-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), settingName, - contentType, accept, setting, context); - } - - /** - * updating settings about different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param setting Setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(SettingName settingName, SettingInner setting) { - return updateWithResponseAsync(settingName, setting).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * updating settings about different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param setting Setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(SettingName settingName, SettingInner setting, Context context) { - return updateWithResponseAsync(settingName, setting, context).block(); - } - - /** - * updating settings about different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param setting Setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SettingInner update(SettingName settingName, SettingInner setting) { - return updateWithResponse(settingName, setting, Context.NONE).getValue(); - } - - /** - * Settings about different configurations in Microsoft Defender for Cloud. - * - * @throws 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 settings list 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Settings about different configurations in Microsoft Defender for Cloud. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 settings list 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-05-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)); - } - - /** - * Settings about different configurations in Microsoft Defender for Cloud. - * - * @throws 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 settings list as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Settings about different configurations in Microsoft Defender for Cloud. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 settings list as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Settings about different configurations in Microsoft Defender for Cloud. - * - * @throws 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 settings list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Settings about different configurations in Microsoft Defender for Cloud. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 settings list 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 subscription settings list 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 subscription settings list 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsImpl.java deleted file mode 100644 index d68c96951952..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SettingsClient; -import com.azure.resourcemanager.security.fluent.models.SettingInner; -import com.azure.resourcemanager.security.models.Setting; -import com.azure.resourcemanager.security.models.SettingName; -import com.azure.resourcemanager.security.models.Settings; - -public final class SettingsImpl implements Settings { - private static final ClientLogger LOGGER = new ClientLogger(SettingsImpl.class); - - private final SettingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SettingsImpl(SettingsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(SettingName settingName, Context context) { - Response inner = this.serviceClient().getWithResponse(settingName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SettingImpl(inner.getValue(), this.manager())); - } - - public Setting get(SettingName settingName) { - SettingInner inner = this.serviceClient().get(settingName); - if (inner != null) { - return new SettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response updateWithResponse(SettingName settingName, SettingInner setting, Context context) { - Response inner = this.serviceClient().updateWithResponse(settingName, setting, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SettingImpl(inner.getValue(), this.manager())); - } - - public Setting update(SettingName settingName, SettingInner setting) { - SettingInner inner = this.serviceClient().update(settingName, setting); - if (inner != null) { - return new SettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SettingImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SettingImpl(inner1, this.manager())); - } - - private SettingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesClientImpl.java deleted file mode 100644 index 9f4b7b8c9402..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesClientImpl.java +++ /dev/null @@ -1,835 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentBaselineRulesClient; -import com.azure.resourcemanager.security.fluent.models.RuleResultsInner; -import com.azure.resourcemanager.security.fluent.models.RulesResultsInner; -import com.azure.resourcemanager.security.models.RuleResultsInput; -import com.azure.resourcemanager.security.models.RulesResultsInput; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * SqlVulnerabilityAssessmentBaselineRulesClient. - */ -public final class SqlVulnerabilityAssessmentBaselineRulesClientImpl - implements SqlVulnerabilityAssessmentBaselineRulesClient { - /** - * The proxy service used to perform REST calls. - */ - private final SqlVulnerabilityAssessmentBaselineRulesService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SqlVulnerabilityAssessmentBaselineRulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SqlVulnerabilityAssessmentBaselineRulesClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(SqlVulnerabilityAssessmentBaselineRulesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSqlVulnerabilityAssessmentBaselineRules to be used by - * the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterSqlVulnerabilityAssessmentBaselineRules") - public interface SqlVulnerabilityAssessmentBaselineRulesService { - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, @PathParam("ruleId") String ruleId, - @QueryParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, @PathParam("ruleId") String ruleId, - @QueryParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, - @BodyParam("application/json") RuleResultsInput body, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, @PathParam("ruleId") String ruleId, - @QueryParam("databaseName") String databaseName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @QueryParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> add(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @QueryParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, - @BodyParam("application/json") RulesResultsInput body, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the results for a given rule in the Baseline. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The rule Id. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for a given rule in the Baseline along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, String ruleId, - String databaseName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, resourceId, ruleId, databaseName, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the results for a given rule in the Baseline. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The rule Id. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for a given rule in the Baseline along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, String ruleId, String databaseName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, resourceId, ruleId, databaseName, accept, context); - } - - /** - * Gets the results for a given rule in the Baseline. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The rule 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 results for a given rule in the Baseline on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId, String ruleId) { - final String databaseName = null; - return getWithResponseAsync(resourceId, ruleId, databaseName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the results for a given rule in the Baseline. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The rule Id. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for a given rule in the Baseline along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceId, String ruleId, String databaseName, - Context context) { - return getWithResponseAsync(resourceId, ruleId, databaseName, context).block(); - } - - /** - * Gets the results for a given rule in the Baseline. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The rule 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 results for a given rule in the Baseline. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RuleResultsInner get(String resourceId, String ruleId) { - final String databaseName = null; - return getWithResponse(resourceId, ruleId, databaseName, Context.NONE).getValue(); - } - - /** - * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The rule Id. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param body The baseline results for this rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return rule results along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceId, String ruleId, - String databaseName, RuleResultsInput body) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, resourceId, ruleId, - databaseName, accept, body, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The rule Id. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param body The baseline results for this rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return rule results along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceId, String ruleId, - String databaseName, RuleResultsInput body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, resourceId, ruleId, databaseName, accept, - body, context); - } - - /** - * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The rule 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 rule results on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceId, String ruleId) { - final String databaseName = null; - final RuleResultsInput body = null; - return createOrUpdateWithResponseAsync(resourceId, ruleId, databaseName, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The rule Id. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param body The baseline results for this rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return rule results along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceId, String ruleId, String databaseName, - RuleResultsInput body, Context context) { - return createOrUpdateWithResponseAsync(resourceId, ruleId, databaseName, body, context).block(); - } - - /** - * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The rule 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 rule results. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RuleResultsInner createOrUpdate(String resourceId, String ruleId) { - final String databaseName = null; - final RuleResultsInput body = null; - return createOrUpdateWithResponse(resourceId, ruleId, databaseName, body, Context.NONE).getValue(); - } - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The rule Id. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 resourceId, String ruleId, String databaseName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2026-04-01-preview"; - return FluxUtil.withContext( - context -> service.delete(this.client.getEndpoint(), apiVersion, resourceId, ruleId, databaseName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The rule Id. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 resourceId, String ruleId, String databaseName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2026-04-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, resourceId, ruleId, databaseName, context); - } - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The rule 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceId, String ruleId) { - final String databaseName = null; - return deleteWithResponseAsync(resourceId, ruleId, databaseName).flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The rule Id. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceId, String ruleId, String databaseName, Context context) { - return deleteWithResponseAsync(resourceId, ruleId, databaseName, context).block(); - } - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param ruleId The rule 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceId, String ruleId) { - final String databaseName = null; - deleteWithResponse(resourceId, ruleId, databaseName, Context.NONE); - } - - /** - * Gets the results for all rules in the Baseline. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for all rules in the Baseline along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceId, String databaseName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.list(this.client.getEndpoint(), apiVersion, resourceId, databaseName, 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 results for all rules in the Baseline. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for all rules in the Baseline along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceId, String databaseName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, resourceId, databaseName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets the results for all rules in the Baseline. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for all rules in the Baseline as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceId, String databaseName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceId, databaseName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the results for all rules in the Baseline. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 results for all rules in the Baseline as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceId) { - final String databaseName = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceId, databaseName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the results for all rules in the Baseline. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for all rules in the Baseline as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceId, String databaseName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceId, databaseName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the results for all rules in the Baseline. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 results for all rules in the Baseline as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceId) { - final String databaseName = null; - return new PagedIterable<>(listAsync(resourceId, databaseName)); - } - - /** - * Gets the results for all rules in the Baseline. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for all rules in the Baseline as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceId, String databaseName, Context context) { - return new PagedIterable<>(listAsync(resourceId, databaseName, context)); - } - - /** - * Set a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param body The content of the action request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of rules results along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> addWithResponseAsync(String resourceId, String databaseName, - RulesResultsInput body) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.add(this.client.getEndpoint(), apiVersion, resourceId, databaseName, accept, - body, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Set a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param body The content of the action request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of rules results along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> addWithResponseAsync(String resourceId, String databaseName, - RulesResultsInput body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.add(this.client.getEndpoint(), apiVersion, resourceId, databaseName, accept, body, context); - } - - /** - * Set a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of rules results on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono addAsync(String resourceId) { - final String databaseName = null; - final RulesResultsInput body = null; - return addWithResponseAsync(resourceId, databaseName, body).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Set a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param body The content of the action request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of rules results along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response addWithResponse(String resourceId, String databaseName, RulesResultsInput body, - Context context) { - return addWithResponseAsync(resourceId, databaseName, body, context).block(); - } - - /** - * Set a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of rules results. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RulesResultsInner add(String resourceId) { - final String databaseName = null; - final RulesResultsInput body = null; - return addWithResponse(resourceId, databaseName, body, Context.NONE).getValue(); - } - - /** - * Gets the results for all rules in the Baseline. - * - * 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 results for all rules in the Baseline 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())); - } - - /** - * Gets the results for all rules in the Baseline. - * - * 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 results for all rules in the Baseline 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesImpl.java deleted file mode 100644 index e34bb9aa43a1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesImpl.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentBaselineRulesClient; -import com.azure.resourcemanager.security.fluent.models.RuleResultsInner; -import com.azure.resourcemanager.security.fluent.models.RulesResultsInner; -import com.azure.resourcemanager.security.models.RuleResults; -import com.azure.resourcemanager.security.models.RulesResults; -import com.azure.resourcemanager.security.models.RulesResultsInput; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentBaselineRules; - -public final class SqlVulnerabilityAssessmentBaselineRulesImpl implements SqlVulnerabilityAssessmentBaselineRules { - private static final ClientLogger LOGGER = new ClientLogger(SqlVulnerabilityAssessmentBaselineRulesImpl.class); - - private final SqlVulnerabilityAssessmentBaselineRulesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SqlVulnerabilityAssessmentBaselineRulesImpl(SqlVulnerabilityAssessmentBaselineRulesClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceId, String ruleId, String databaseName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceId, ruleId, databaseName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RuleResultsImpl(inner.getValue(), this.manager())); - } - - public RuleResults get(String resourceId, String ruleId) { - RuleResultsInner inner = this.serviceClient().get(resourceId, ruleId); - if (inner != null) { - return new RuleResultsImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String resourceId, String ruleId, String databaseName, Context context) { - return this.serviceClient().deleteWithResponse(resourceId, ruleId, databaseName, context); - } - - public void delete(String resourceId, String ruleId) { - this.serviceClient().delete(resourceId, ruleId); - } - - public PagedIterable list(String resourceId) { - PagedIterable inner = this.serviceClient().list(resourceId); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RuleResultsImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceId, String databaseName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceId, databaseName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RuleResultsImpl(inner1, this.manager())); - } - - public Response addWithResponse(String resourceId, String databaseName, RulesResultsInput body, - Context context) { - Response inner - = this.serviceClient().addWithResponse(resourceId, databaseName, body, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RulesResultsImpl(inner.getValue(), this.manager())); - } - - public RulesResults add(String resourceId) { - RulesResultsInner inner = this.serviceClient().add(resourceId); - if (inner != null) { - return new RulesResultsImpl(inner, this.manager()); - } else { - return null; - } - } - - public RuleResults getById(String id) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}", - "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String ruleId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}", - "ruleId"); - if (ruleId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'baselineRules'.", id))); - } - String localDatabaseName = null; - return this.getWithResponse(resourceId, ruleId, localDatabaseName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, String databaseName, Context context) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}", - "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String ruleId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}", - "ruleId"); - if (ruleId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'baselineRules'.", id))); - } - return this.getWithResponse(resourceId, ruleId, databaseName, context); - } - - public void deleteById(String id) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}", - "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String ruleId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}", - "ruleId"); - if (ruleId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'baselineRules'.", id))); - } - String localDatabaseName = null; - this.deleteWithResponse(resourceId, ruleId, localDatabaseName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, String databaseName, Context context) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}", - "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String ruleId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}", - "ruleId"); - if (ruleId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'baselineRules'.", id))); - } - return this.deleteWithResponse(resourceId, ruleId, databaseName, context); - } - - private SqlVulnerabilityAssessmentBaselineRulesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public RuleResultsImpl define(String name) { - return new RuleResultsImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanOperationResultImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanOperationResultImpl.java deleted file mode 100644 index f2434a7f7eb1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanOperationResultImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.SqlVulnerabilityAssessmentScanOperationResultInner; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentScanOperationResult; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentScanOperationResultProperties; - -public final class SqlVulnerabilityAssessmentScanOperationResultImpl - implements SqlVulnerabilityAssessmentScanOperationResult { - private SqlVulnerabilityAssessmentScanOperationResultInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SqlVulnerabilityAssessmentScanOperationResultImpl(SqlVulnerabilityAssessmentScanOperationResultInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SqlVulnerabilityAssessmentScanOperationResultProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public SqlVulnerabilityAssessmentScanOperationResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsClientImpl.java deleted file mode 100644 index c421f7f32215..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsClientImpl.java +++ /dev/null @@ -1,433 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentScanResultsClient; -import com.azure.resourcemanager.security.fluent.models.ScanResultInner; -import com.azure.resourcemanager.security.implementation.models.ScanResults; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * SqlVulnerabilityAssessmentScanResultsClient. - */ -public final class SqlVulnerabilityAssessmentScanResultsClientImpl - implements SqlVulnerabilityAssessmentScanResultsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SqlVulnerabilityAssessmentScanResultsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SqlVulnerabilityAssessmentScanResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SqlVulnerabilityAssessmentScanResultsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(SqlVulnerabilityAssessmentScanResultsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSqlVulnerabilityAssessmentScanResults to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterSqlVulnerabilityAssessmentScanResults") - public interface SqlVulnerabilityAssessmentScanResultsService { - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults/{scanResultId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, @PathParam("scanId") String scanId, - @PathParam("scanResultId") String scanResultId, @QueryParam("databaseName") String databaseName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, @PathParam("scanId") String scanId, - @QueryParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. - * @param scanResultId The rule Id of the results. - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan results of a single rule in a scan record along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scanId, String scanResultId, String resourceId, - String databaseName) { - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - if (scanResultId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanResultId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, resourceId, scanId, scanResultId, - databaseName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. - * @param scanResultId The rule Id of the results. - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan results of a single rule in a scan record along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scanId, String scanResultId, String resourceId, - String databaseName, Context context) { - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - if (scanResultId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanResultId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, resourceId, scanId, scanResultId, databaseName, - accept, context); - } - - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. - * @param scanResultId The rule Id of the results. - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 scan results of a single rule in a scan record on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scanId, String scanResultId, String resourceId) { - final String databaseName = null; - return getWithResponseAsync(scanId, scanResultId, resourceId, databaseName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. - * @param scanResultId The rule Id of the results. - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan results of a single rule in a scan record along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scanId, String scanResultId, String resourceId, - String databaseName, Context context) { - return getWithResponseAsync(scanId, scanResultId, resourceId, databaseName, context).block(); - } - - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. - * @param scanResultId The rule Id of the results. - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 scan results of a single rule in a scan record. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScanResultInner get(String scanId, String scanResultId, String resourceId) { - final String databaseName = null; - return getWithResponse(scanId, scanResultId, resourceId, databaseName, Context.NONE).getValue(); - } - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 scan results for a single scan record along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scanId, String resourceId, - String databaseName) { - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, resourceId, scanId, - databaseName, 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 scan results for a single scan record. - * - * @param scanId The scan Id. - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 scan results for a single scan record along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scanId, String resourceId, - String databaseName, Context context) { - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, resourceId, scanId, databaseName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 scan results for a single scan record as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scanId, String resourceId, String databaseName) { - return new PagedFlux<>(() -> listSinglePageAsync(scanId, resourceId, databaseName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of scan results for a single scan record as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scanId, String resourceId) { - final String databaseName = null; - return new PagedFlux<>(() -> listSinglePageAsync(scanId, resourceId, databaseName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 scan results for a single scan record as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scanId, String resourceId, String databaseName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(scanId, resourceId, databaseName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of scan results for a single scan record as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scanId, String resourceId) { - final String databaseName = null; - return new PagedIterable<>(listAsync(scanId, resourceId, databaseName)); - } - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 scan results for a single scan record as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scanId, String resourceId, String databaseName, Context context) { - return new PagedIterable<>(listAsync(scanId, resourceId, databaseName, context)); - } - - /** - * Gets a list of scan results for a single scan record. - * - * 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 scan results for a single scan record 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.")); - } - 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())); - } - - /** - * Gets a list of scan results for a single scan record. - * - * 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 scan results for a single scan record 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.")); - } - 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsImpl.java deleted file mode 100644 index 682c44194149..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentScanResultsClient; -import com.azure.resourcemanager.security.fluent.models.ScanResultInner; -import com.azure.resourcemanager.security.models.ScanResult; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentScanResults; - -public final class SqlVulnerabilityAssessmentScanResultsImpl implements SqlVulnerabilityAssessmentScanResults { - private static final ClientLogger LOGGER = new ClientLogger(SqlVulnerabilityAssessmentScanResultsImpl.class); - - private final SqlVulnerabilityAssessmentScanResultsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SqlVulnerabilityAssessmentScanResultsImpl(SqlVulnerabilityAssessmentScanResultsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String scanId, String scanResultId, String resourceId, - String databaseName, Context context) { - Response inner - = this.serviceClient().getWithResponse(scanId, scanResultId, resourceId, databaseName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScanResultImpl(inner.getValue(), this.manager())); - } - - public ScanResult get(String scanId, String scanResultId, String resourceId) { - ScanResultInner inner = this.serviceClient().get(scanId, scanResultId, resourceId); - if (inner != null) { - return new ScanResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String scanId, String resourceId) { - PagedIterable inner = this.serviceClient().list(scanId, resourceId); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScanResultImpl(inner1, this.manager())); - } - - public PagedIterable list(String scanId, String resourceId, String databaseName, Context context) { - PagedIterable inner = this.serviceClient().list(scanId, resourceId, databaseName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScanResultImpl(inner1, this.manager())); - } - - private SqlVulnerabilityAssessmentScanResultsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansClientImpl.java deleted file mode 100644 index caba8397fcc5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansClientImpl.java +++ /dev/null @@ -1,805 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.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.security.fluent.SqlVulnerabilityAssessmentScansClient; -import com.azure.resourcemanager.security.fluent.models.ScanV2Inner; -import com.azure.resourcemanager.security.fluent.models.SqlVulnerabilityAssessmentScanOperationResultInner; -import com.azure.resourcemanager.security.implementation.models.ScansV2; -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 SqlVulnerabilityAssessmentScansClient. - */ -public final class SqlVulnerabilityAssessmentScansClientImpl implements SqlVulnerabilityAssessmentScansClient { - /** - * The proxy service used to perform REST calls. - */ - private final SqlVulnerabilityAssessmentScansService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SqlVulnerabilityAssessmentScansClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SqlVulnerabilityAssessmentScansClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(SqlVulnerabilityAssessmentScansService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSqlVulnerabilityAssessmentScans to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterSqlVulnerabilityAssessmentScans") - public interface SqlVulnerabilityAssessmentScansService { - @Headers({ "Content-Type: application/json" }) - @Post("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/initiateScan") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> initiateScan(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @QueryParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/scanOperationResults/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getScanOperationResult( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("operationId") String operationId, @QueryParam("databaseName") String databaseName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, @PathParam("scanId") String scanId, - @QueryParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @QueryParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Initiates a vulnerability assessment scan. - * - * @param resourceId The resourceId parameter. - * @param databaseName The databaseName 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 represents the result of a SQL Vulnerability Assessment scan operation, wrapped in the ARM resource - * envelope along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> initiateScanWithResponseAsync(String resourceId, String databaseName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.initiateScan(this.client.getEndpoint(), apiVersion, resourceId, - databaseName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Initiates a vulnerability assessment scan. - * - * @param resourceId The resourceId parameter. - * @param databaseName The databaseName 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 represents the result of a SQL Vulnerability Assessment scan operation, wrapped in the ARM resource - * envelope along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> initiateScanWithResponseAsync(String resourceId, String databaseName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.initiateScan(this.client.getEndpoint(), apiVersion, resourceId, databaseName, accept, context); - } - - /** - * Initiates a vulnerability assessment scan. - * - * @param resourceId The resourceId parameter. - * @param databaseName The databaseName 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 represents the result of a SQL Vulnerability Assessment scan - * operation, wrapped in the ARM resource envelope. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private - PollerFlux, SqlVulnerabilityAssessmentScanOperationResultInner> - beginInitiateScanAsync(String resourceId, String databaseName) { - Mono>> mono = initiateScanWithResponseAsync(resourceId, databaseName); - return this.client - .getLroResult( - mono, this.client.getHttpPipeline(), SqlVulnerabilityAssessmentScanOperationResultInner.class, - SqlVulnerabilityAssessmentScanOperationResultInner.class, this.client.getContext()); - } - - /** - * Initiates a vulnerability assessment scan. - * - * @param resourceId The resourceId 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 represents the result of a SQL Vulnerability Assessment scan - * operation, wrapped in the ARM resource envelope. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private - PollerFlux, SqlVulnerabilityAssessmentScanOperationResultInner> - beginInitiateScanAsync(String resourceId) { - final String databaseName = null; - Mono>> mono = initiateScanWithResponseAsync(resourceId, databaseName); - return this.client - .getLroResult( - mono, this.client.getHttpPipeline(), SqlVulnerabilityAssessmentScanOperationResultInner.class, - SqlVulnerabilityAssessmentScanOperationResultInner.class, this.client.getContext()); - } - - /** - * Initiates a vulnerability assessment scan. - * - * @param resourceId The resourceId parameter. - * @param databaseName The databaseName 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 represents the result of a SQL Vulnerability Assessment scan - * operation, wrapped in the ARM resource envelope. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private - PollerFlux, SqlVulnerabilityAssessmentScanOperationResultInner> - beginInitiateScanAsync(String resourceId, String databaseName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = initiateScanWithResponseAsync(resourceId, databaseName, context); - return this.client - .getLroResult( - mono, this.client.getHttpPipeline(), SqlVulnerabilityAssessmentScanOperationResultInner.class, - SqlVulnerabilityAssessmentScanOperationResultInner.class, context); - } - - /** - * Initiates a vulnerability assessment scan. - * - * @param resourceId The resourceId 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 SyncPoller} for polling of represents the result of a SQL Vulnerability Assessment scan - * operation, wrapped in the ARM resource envelope. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public - SyncPoller, SqlVulnerabilityAssessmentScanOperationResultInner> - beginInitiateScan(String resourceId) { - final String databaseName = null; - return this.beginInitiateScanAsync(resourceId, databaseName).getSyncPoller(); - } - - /** - * Initiates a vulnerability assessment scan. - * - * @param resourceId The resourceId parameter. - * @param databaseName The databaseName 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 SyncPoller} for polling of represents the result of a SQL Vulnerability Assessment scan - * operation, wrapped in the ARM resource envelope. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public - SyncPoller, SqlVulnerabilityAssessmentScanOperationResultInner> - beginInitiateScan(String resourceId, String databaseName, Context context) { - return this.beginInitiateScanAsync(resourceId, databaseName, context).getSyncPoller(); - } - - /** - * Initiates a vulnerability assessment scan. - * - * @param resourceId The resourceId parameter. - * @param databaseName The databaseName 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 represents the result of a SQL Vulnerability Assessment scan operation, wrapped in the ARM resource - * envelope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono initiateScanAsync(String resourceId, - String databaseName) { - return beginInitiateScanAsync(resourceId, databaseName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Initiates a vulnerability assessment scan. - * - * @param resourceId The resourceId 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 represents the result of a SQL Vulnerability Assessment scan operation, wrapped in the ARM resource - * envelope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono initiateScanAsync(String resourceId) { - final String databaseName = null; - return beginInitiateScanAsync(resourceId, databaseName).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Initiates a vulnerability assessment scan. - * - * @param resourceId The resourceId parameter. - * @param databaseName The databaseName 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 represents the result of a SQL Vulnerability Assessment scan operation, wrapped in the ARM resource - * envelope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono initiateScanAsync(String resourceId, - String databaseName, Context context) { - return beginInitiateScanAsync(resourceId, databaseName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Initiates a vulnerability assessment scan. - * - * @param resourceId The resourceId 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 represents the result of a SQL Vulnerability Assessment scan operation, wrapped in the ARM resource - * envelope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SqlVulnerabilityAssessmentScanOperationResultInner initiateScan(String resourceId) { - final String databaseName = null; - return initiateScanAsync(resourceId, databaseName).block(); - } - - /** - * Initiates a vulnerability assessment scan. - * - * @param resourceId The resourceId parameter. - * @param databaseName The databaseName 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 represents the result of a SQL Vulnerability Assessment scan operation, wrapped in the ARM resource - * envelope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SqlVulnerabilityAssessmentScanOperationResultInner initiateScan(String resourceId, String databaseName, - Context context) { - return initiateScanAsync(resourceId, databaseName, context).block(); - } - - /** - * Gets the result of a scan operation initiated by the InitiateScan action. - * - * @param resourceId The resourceId parameter. - * @param operationId The operationId parameter. - * @param databaseName The databaseName 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 result of a scan operation initiated by the InitiateScan action along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getScanOperationResultWithResponseAsync(String resourceId, String operationId, String databaseName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId 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 = "2026-04-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getScanOperationResult(this.client.getEndpoint(), apiVersion, resourceId, - operationId, databaseName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the result of a scan operation initiated by the InitiateScan action. - * - * @param resourceId The resourceId parameter. - * @param operationId The operationId parameter. - * @param databaseName The databaseName 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 result of a scan operation initiated by the InitiateScan action along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getScanOperationResultWithResponseAsync( - String resourceId, String operationId, String databaseName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId 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 = "2026-04-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getScanOperationResult(this.client.getEndpoint(), apiVersion, resourceId, operationId, - databaseName, accept, context); - } - - /** - * Gets the result of a scan operation initiated by the InitiateScan action. - * - * @param resourceId The resourceId parameter. - * @param operationId The operationId 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 result of a scan operation initiated by the InitiateScan action on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getScanOperationResultAsync(String resourceId, - String operationId) { - final String databaseName = null; - return getScanOperationResultWithResponseAsync(resourceId, operationId, databaseName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the result of a scan operation initiated by the InitiateScan action. - * - * @param resourceId The resourceId parameter. - * @param operationId The operationId parameter. - * @param databaseName The databaseName 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 result of a scan operation initiated by the InitiateScan action along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getScanOperationResultWithResponse( - String resourceId, String operationId, String databaseName, Context context) { - return getScanOperationResultWithResponseAsync(resourceId, operationId, databaseName, context).block(); - } - - /** - * Gets the result of a scan operation initiated by the InitiateScan action. - * - * @param resourceId The resourceId parameter. - * @param operationId The operationId 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 result of a scan operation initiated by the InitiateScan action. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SqlVulnerabilityAssessmentScanOperationResultInner getScanOperationResult(String resourceId, - String operationId) { - final String databaseName = null; - return getScanOperationResultWithResponse(resourceId, operationId, databaseName, Context.NONE).getValue(); - } - - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan details of a single scan record along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scanId, String resourceId, String databaseName) { - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, resourceId, scanId, databaseName, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan details of a single scan record along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scanId, String resourceId, String databaseName, - Context context) { - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, resourceId, scanId, databaseName, accept, context); - } - - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 scan details of a single scan record on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scanId, String resourceId) { - final String databaseName = null; - return getWithResponseAsync(scanId, resourceId, databaseName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan details of a single scan record along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scanId, String resourceId, String databaseName, - Context context) { - return getWithResponseAsync(scanId, resourceId, databaseName, context).block(); - } - - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 scan details of a single scan record. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScanV2Inner get(String scanId, String resourceId) { - final String databaseName = null; - return getWithResponse(scanId, resourceId, databaseName, Context.NONE).getValue(); - } - - /** - * Gets a list of scan records. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 scan records along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceId, String databaseName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.list(this.client.getEndpoint(), apiVersion, resourceId, databaseName, 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 scan records. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 scan records along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceId, String databaseName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, resourceId, databaseName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets a list of scan records. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 scan records as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceId, String databaseName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceId, databaseName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of scan records. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of scan records as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceId) { - final String databaseName = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceId, databaseName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of scan records. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 scan records as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceId, String databaseName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceId, databaseName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of scan records. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of scan records as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceId) { - final String databaseName = null; - return new PagedIterable<>(listAsync(resourceId, databaseName)); - } - - /** - * Gets a list of scan records. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param databaseName The name of the database to assess. Required when the API is called on the parent resource - * (e.g., server level) rather than on a specific database resource, since the database name is not part of the - * resource URI. This is the only way to assess system databases (e.g., master), which cannot be referenced directly - * in the resource URI. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 scan records as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceId, String databaseName, Context context) { - return new PagedIterable<>(listAsync(resourceId, databaseName, context)); - } - - /** - * Gets a list of scan records. - * - * 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 scan records 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())); - } - - /** - * Gets a list of scan records. - * - * 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 scan records 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansImpl.java deleted file mode 100644 index 9e58d6ba708d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansImpl.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentScansClient; -import com.azure.resourcemanager.security.fluent.models.ScanV2Inner; -import com.azure.resourcemanager.security.fluent.models.SqlVulnerabilityAssessmentScanOperationResultInner; -import com.azure.resourcemanager.security.models.ScanV2; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentScanOperationResult; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentScans; - -public final class SqlVulnerabilityAssessmentScansImpl implements SqlVulnerabilityAssessmentScans { - private static final ClientLogger LOGGER = new ClientLogger(SqlVulnerabilityAssessmentScansImpl.class); - - private final SqlVulnerabilityAssessmentScansClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SqlVulnerabilityAssessmentScansImpl(SqlVulnerabilityAssessmentScansClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public SqlVulnerabilityAssessmentScanOperationResult initiateScan(String resourceId) { - SqlVulnerabilityAssessmentScanOperationResultInner inner = this.serviceClient().initiateScan(resourceId); - if (inner != null) { - return new SqlVulnerabilityAssessmentScanOperationResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public SqlVulnerabilityAssessmentScanOperationResult initiateScan(String resourceId, String databaseName, - Context context) { - SqlVulnerabilityAssessmentScanOperationResultInner inner - = this.serviceClient().initiateScan(resourceId, databaseName, context); - if (inner != null) { - return new SqlVulnerabilityAssessmentScanOperationResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getScanOperationResultWithResponse(String resourceId, - String operationId, String databaseName, Context context) { - Response inner - = this.serviceClient().getScanOperationResultWithResponse(resourceId, operationId, databaseName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SqlVulnerabilityAssessmentScanOperationResultImpl(inner.getValue(), this.manager())); - } - - public SqlVulnerabilityAssessmentScanOperationResult getScanOperationResult(String resourceId, String operationId) { - SqlVulnerabilityAssessmentScanOperationResultInner inner - = this.serviceClient().getScanOperationResult(resourceId, operationId); - if (inner != null) { - return new SqlVulnerabilityAssessmentScanOperationResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String scanId, String resourceId, String databaseName, Context context) { - Response inner = this.serviceClient().getWithResponse(scanId, resourceId, databaseName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ScanV2Impl(inner.getValue(), this.manager())); - } - - public ScanV2 get(String scanId, String resourceId) { - ScanV2Inner inner = this.serviceClient().get(scanId, resourceId); - if (inner != null) { - return new ScanV2Impl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceId) { - PagedIterable inner = this.serviceClient().list(resourceId); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScanV2Impl(inner1, this.manager())); - } - - public PagedIterable list(String resourceId, String databaseName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceId, databaseName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ScanV2Impl(inner1, this.manager())); - } - - private SqlVulnerabilityAssessmentScansClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentSettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentSettingsImpl.java deleted file mode 100644 index d72d820d279e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentSettingsImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.SqlVulnerabilityAssessmentSettingsInner; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentSettings; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentSettingsProperties; - -public final class SqlVulnerabilityAssessmentSettingsImpl implements SqlVulnerabilityAssessmentSettings { - private SqlVulnerabilityAssessmentSettingsInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SqlVulnerabilityAssessmentSettingsImpl(SqlVulnerabilityAssessmentSettingsInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SqlVulnerabilityAssessmentSettingsProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public SqlVulnerabilityAssessmentSettingsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentSettingsOperationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentSettingsOperationsClientImpl.java deleted file mode 100644 index 4594b1608b44..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentSettingsOperationsClientImpl.java +++ /dev/null @@ -1,386 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentSettingsOperationsClient; -import com.azure.resourcemanager.security.fluent.models.SqlVulnerabilityAssessmentSettingsInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * SqlVulnerabilityAssessmentSettingsOperationsClient. - */ -public final class SqlVulnerabilityAssessmentSettingsOperationsClientImpl - implements SqlVulnerabilityAssessmentSettingsOperationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SqlVulnerabilityAssessmentSettingsOperationsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SqlVulnerabilityAssessmentSettingsOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SqlVulnerabilityAssessmentSettingsOperationsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(SqlVulnerabilityAssessmentSettingsOperationsService.class, - client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSqlVulnerabilityAssessmentSettingsOperations to be used - * by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterSqlVulnerabilityAssessmentSettingsOperations") - public interface SqlVulnerabilityAssessmentSettingsOperationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Put("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, @HeaderParam("Accept") String accept, - @BodyParam("application/json") SqlVulnerabilityAssessmentSettingsInner body, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, Context context); - } - - /** - * Gets the SQL Vulnerability Assessment settings. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 SQL Vulnerability Assessment settings along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, resourceId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the SQL Vulnerability Assessment settings. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 SQL Vulnerability Assessment settings along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, resourceId, accept, context); - } - - /** - * Gets the SQL Vulnerability Assessment settings. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 SQL Vulnerability Assessment settings on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId) { - return getWithResponseAsync(resourceId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the SQL Vulnerability Assessment settings. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 SQL Vulnerability Assessment settings along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceId, Context context) { - return getWithResponseAsync(resourceId, context).block(); - } - - /** - * Gets the SQL Vulnerability Assessment settings. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 SQL Vulnerability Assessment settings. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SqlVulnerabilityAssessmentSettingsInner get(String resourceId) { - return getWithResponse(resourceId, Context.NONE).getValue(); - } - - /** - * Creates or updates the SQL Vulnerability Assessment settings. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param body The SQL Vulnerability Assessment settings. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sQL Vulnerability Assessment settings resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceId, - SqlVulnerabilityAssessmentSettingsInner body) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, resourceId, accept, body, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates the SQL Vulnerability Assessment settings. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param body The SQL Vulnerability Assessment settings. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sQL Vulnerability Assessment settings resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceId, - SqlVulnerabilityAssessmentSettingsInner body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String apiVersion = "2026-04-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, resourceId, accept, body, context); - } - - /** - * Creates or updates the SQL Vulnerability Assessment settings. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 sQL Vulnerability Assessment settings resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceId) { - final SqlVulnerabilityAssessmentSettingsInner body = null; - return createOrUpdateWithResponseAsync(resourceId, body).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates the SQL Vulnerability Assessment settings. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param body The SQL Vulnerability Assessment settings. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sQL Vulnerability Assessment settings resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceId, - SqlVulnerabilityAssessmentSettingsInner body, Context context) { - return createOrUpdateWithResponseAsync(resourceId, body, context).block(); - } - - /** - * Creates or updates the SQL Vulnerability Assessment settings. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 sQL Vulnerability Assessment settings resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SqlVulnerabilityAssessmentSettingsInner createOrUpdate(String resourceId) { - final SqlVulnerabilityAssessmentSettingsInner body = null; - return createOrUpdateWithResponse(resourceId, body, Context.NONE).getValue(); - } - - /** - * Deletes the SQL Vulnerability Assessment settings. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2026-04-01-preview"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, resourceId, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the SQL Vulnerability Assessment settings. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 resourceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2026-04-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, resourceId, context); - } - - /** - * Deletes the SQL Vulnerability Assessment settings. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceId) { - return deleteWithResponseAsync(resourceId).flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes the SQL Vulnerability Assessment settings. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceId, Context context) { - return deleteWithResponseAsync(resourceId, context).block(); - } - - /** - * Deletes the SQL Vulnerability Assessment settings. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceId) { - deleteWithResponse(resourceId, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentSettingsOperationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentSettingsOperationsImpl.java deleted file mode 100644 index 60fd21019a33..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentSettingsOperationsImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.security.fluent.SqlVulnerabilityAssessmentSettingsOperationsClient; -import com.azure.resourcemanager.security.fluent.models.SqlVulnerabilityAssessmentSettingsInner; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentSettings; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentSettingsOperations; - -public final class SqlVulnerabilityAssessmentSettingsOperationsImpl - implements SqlVulnerabilityAssessmentSettingsOperations { - private static final ClientLogger LOGGER = new ClientLogger(SqlVulnerabilityAssessmentSettingsOperationsImpl.class); - - private final SqlVulnerabilityAssessmentSettingsOperationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SqlVulnerabilityAssessmentSettingsOperationsImpl( - SqlVulnerabilityAssessmentSettingsOperationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceId, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SqlVulnerabilityAssessmentSettingsImpl(inner.getValue(), this.manager())); - } - - public SqlVulnerabilityAssessmentSettings get(String resourceId) { - SqlVulnerabilityAssessmentSettingsInner inner = this.serviceClient().get(resourceId); - if (inner != null) { - return new SqlVulnerabilityAssessmentSettingsImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse(String resourceId, - SqlVulnerabilityAssessmentSettingsInner body, Context context) { - Response inner - = this.serviceClient().createOrUpdateWithResponse(resourceId, body, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SqlVulnerabilityAssessmentSettingsImpl(inner.getValue(), this.manager())); - } - - public SqlVulnerabilityAssessmentSettings createOrUpdate(String resourceId) { - SqlVulnerabilityAssessmentSettingsInner inner = this.serviceClient().createOrUpdate(resourceId); - if (inner != null) { - return new SqlVulnerabilityAssessmentSettingsImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String resourceId, Context context) { - return this.serviceClient().deleteWithResponse(resourceId, context); - } - - public void delete(String resourceId) { - this.serviceClient().delete(resourceId); - } - - private SqlVulnerabilityAssessmentSettingsOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardAssignmentImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardAssignmentImpl.java deleted file mode 100644 index 999c40f2c81b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardAssignmentImpl.java +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.StandardAssignmentInner; -import com.azure.resourcemanager.security.models.AssignedStandardItem; -import com.azure.resourcemanager.security.models.Effect; -import com.azure.resourcemanager.security.models.StandardAssignment; -import com.azure.resourcemanager.security.models.StandardAssignmentMetadata; -import com.azure.resourcemanager.security.models.StandardAssignmentPropertiesAttestationData; -import com.azure.resourcemanager.security.models.StandardAssignmentPropertiesExemptionData; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class StandardAssignmentImpl implements StandardAssignment, StandardAssignment.Definition { - private StandardAssignmentInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - StandardAssignmentImpl(StandardAssignmentInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 SystemData systemData() { - return this.innerModel().systemData(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String description() { - return this.innerModel().description(); - } - - public AssignedStandardItem assignedStandard() { - return this.innerModel().assignedStandard(); - } - - public Effect effect() { - return this.innerModel().effect(); - } - - public List excludedScopes() { - List inner = this.innerModel().excludedScopes(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public OffsetDateTime expiresOn() { - return this.innerModel().expiresOn(); - } - - public StandardAssignmentPropertiesExemptionData exemptionData() { - return this.innerModel().exemptionData(); - } - - public StandardAssignmentPropertiesAttestationData attestationData() { - return this.innerModel().attestationData(); - } - - public StandardAssignmentMetadata metadata() { - return this.innerModel().metadata(); - } - - public StandardAssignmentInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceId; - - private String standardAssignmentName; - - public StandardAssignmentImpl withExistingResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - public StandardAssignment create() { - this.innerObject = serviceManager.serviceClient() - .getStandardAssignments() - .createWithResponse(resourceId, standardAssignmentName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public StandardAssignment create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getStandardAssignments() - .createWithResponse(resourceId, standardAssignmentName, this.innerModel(), context) - .getValue(); - return this; - } - - StandardAssignmentImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new StandardAssignmentInner(); - this.serviceManager = serviceManager; - this.standardAssignmentName = name; - } - - public StandardAssignment refresh() { - this.innerObject = serviceManager.serviceClient() - .getStandardAssignments() - .getWithResponse(resourceId, standardAssignmentName, Context.NONE) - .getValue(); - return this; - } - - public StandardAssignment refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getStandardAssignments() - .getWithResponse(resourceId, standardAssignmentName, context) - .getValue(); - return this; - } - - public StandardAssignmentImpl withDisplayName(String displayName) { - this.innerModel().withDisplayName(displayName); - return this; - } - - public StandardAssignmentImpl withDescription(String description) { - this.innerModel().withDescription(description); - return this; - } - - public StandardAssignmentImpl withAssignedStandard(AssignedStandardItem assignedStandard) { - this.innerModel().withAssignedStandard(assignedStandard); - return this; - } - - public StandardAssignmentImpl withEffect(Effect effect) { - this.innerModel().withEffect(effect); - return this; - } - - public StandardAssignmentImpl withExcludedScopes(List excludedScopes) { - this.innerModel().withExcludedScopes(excludedScopes); - return this; - } - - public StandardAssignmentImpl withExpiresOn(OffsetDateTime expiresOn) { - this.innerModel().withExpiresOn(expiresOn); - return this; - } - - public StandardAssignmentImpl withExemptionData(StandardAssignmentPropertiesExemptionData exemptionData) { - this.innerModel().withExemptionData(exemptionData); - return this; - } - - public StandardAssignmentImpl withAttestationData(StandardAssignmentPropertiesAttestationData attestationData) { - this.innerModel().withAttestationData(attestationData); - return this; - } - - public StandardAssignmentImpl withMetadata(StandardAssignmentMetadata metadata) { - this.innerModel().withMetadata(metadata); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardAssignmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardAssignmentsClientImpl.java deleted file mode 100644 index 3242ac81687a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardAssignmentsClientImpl.java +++ /dev/null @@ -1,685 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.resourcemanager.security.fluent.StandardAssignmentsClient; -import com.azure.resourcemanager.security.fluent.models.StandardAssignmentInner; -import com.azure.resourcemanager.security.implementation.models.StandardAssignmentsList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in StandardAssignmentsClient. - */ -public final class StandardAssignmentsClientImpl implements StandardAssignmentsClient { - /** - * The proxy service used to perform REST calls. - */ - private final StandardAssignmentsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of StandardAssignmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - StandardAssignmentsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(StandardAssignmentsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterStandardAssignments to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterStandardAssignments") - public interface StandardAssignmentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceId}/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("standardAssignmentName") String standardAssignmentName, @HeaderParam("Accept") String accept, - Context context); - - @Put("/{resourceId}/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("standardAssignmentName") String standardAssignmentName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") StandardAssignmentInner standardAssignment, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/{resourceId}/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("standardAssignmentName") String standardAssignmentName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/standardAssignments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Retrieves a standard assignment. - * - * This operation retrieves a single standard assignment, given its name and the scope it was created at. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param standardAssignmentName The standard assignments assignment key - unique key for the standard assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Assignment on a resource group over a given scope along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, - String standardAssignmentName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (standardAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter standardAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2024-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, resourceId, - standardAssignmentName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves a standard assignment. - * - * This operation retrieves a single standard assignment, given its name and the scope it was created at. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param standardAssignmentName The standard assignments assignment key - unique key for the standard assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Assignment on a resource group over a given scope along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, - String standardAssignmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (standardAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter standardAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2024-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, resourceId, standardAssignmentName, accept, context); - } - - /** - * Retrieves a standard assignment. - * - * This operation retrieves a single standard assignment, given its name and the scope it was created at. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param standardAssignmentName The standard assignments assignment key - unique key for the standard assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Assignment on a resource group over a given scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId, String standardAssignmentName) { - return getWithResponseAsync(resourceId, standardAssignmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Retrieves a standard assignment. - * - * This operation retrieves a single standard assignment, given its name and the scope it was created at. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param standardAssignmentName The standard assignments assignment key - unique key for the standard assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Assignment on a resource group over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceId, String standardAssignmentName, - Context context) { - return getWithResponseAsync(resourceId, standardAssignmentName, context).block(); - } - - /** - * Retrieves a standard assignment. - * - * This operation retrieves a single standard assignment, given its name and the scope it was created at. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param standardAssignmentName The standard assignments assignment key - unique key for the standard assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Assignment on a resource group over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StandardAssignmentInner get(String resourceId, String standardAssignmentName) { - return getWithResponse(resourceId, standardAssignmentName, Context.NONE).getValue(); - } - - /** - * Creates or updates a standard assignment. - * - * This operation creates or updates a standard assignment with the given scope and name. standard assignments apply - * to all resources contained within their scope. For example, when you assign a policy at resource group scope, - * that policy applies to all resources in the group. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param standardAssignmentName The standard assignments assignment key - unique key for the standard assignment. - * @param standardAssignment Custom standard assignment over a pre-defined scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Assignment on a resource group over a given scope along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceId, - String standardAssignmentName, StandardAssignmentInner standardAssignment) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (standardAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter standardAssignmentName is required and cannot be null.")); - } - if (standardAssignment == null) { - return Mono - .error(new IllegalArgumentException("Parameter standardAssignment is required and cannot be null.")); - } else { - standardAssignment.validate(); - } - final String apiVersion = "2024-08-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, resourceId, - standardAssignmentName, contentType, accept, standardAssignment, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a standard assignment. - * - * This operation creates or updates a standard assignment with the given scope and name. standard assignments apply - * to all resources contained within their scope. For example, when you assign a policy at resource group scope, - * that policy applies to all resources in the group. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param standardAssignmentName The standard assignments assignment key - unique key for the standard assignment. - * @param standardAssignment Custom standard assignment over a pre-defined scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Assignment on a resource group over a given scope along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceId, - String standardAssignmentName, StandardAssignmentInner standardAssignment, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (standardAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter standardAssignmentName is required and cannot be null.")); - } - if (standardAssignment == null) { - return Mono - .error(new IllegalArgumentException("Parameter standardAssignment is required and cannot be null.")); - } else { - standardAssignment.validate(); - } - final String apiVersion = "2024-08-01"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, resourceId, standardAssignmentName, contentType, - accept, standardAssignment, context); - } - - /** - * Creates or updates a standard assignment. - * - * This operation creates or updates a standard assignment with the given scope and name. standard assignments apply - * to all resources contained within their scope. For example, when you assign a policy at resource group scope, - * that policy applies to all resources in the group. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param standardAssignmentName The standard assignments assignment key - unique key for the standard assignment. - * @param standardAssignment Custom standard assignment over a pre-defined scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Assignment on a resource group over a given scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceId, String standardAssignmentName, - StandardAssignmentInner standardAssignment) { - return createWithResponseAsync(resourceId, standardAssignmentName, standardAssignment) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates a standard assignment. - * - * This operation creates or updates a standard assignment with the given scope and name. standard assignments apply - * to all resources contained within their scope. For example, when you assign a policy at resource group scope, - * that policy applies to all resources in the group. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param standardAssignmentName The standard assignments assignment key - unique key for the standard assignment. - * @param standardAssignment Custom standard assignment over a pre-defined scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Assignment on a resource group over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String resourceId, String standardAssignmentName, - StandardAssignmentInner standardAssignment, Context context) { - return createWithResponseAsync(resourceId, standardAssignmentName, standardAssignment, context).block(); - } - - /** - * Creates or updates a standard assignment. - * - * This operation creates or updates a standard assignment with the given scope and name. standard assignments apply - * to all resources contained within their scope. For example, when you assign a policy at resource group scope, - * that policy applies to all resources in the group. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param standardAssignmentName The standard assignments assignment key - unique key for the standard assignment. - * @param standardAssignment Custom standard assignment over a pre-defined scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Assignment on a resource group over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StandardAssignmentInner create(String resourceId, String standardAssignmentName, - StandardAssignmentInner standardAssignment) { - return createWithResponse(resourceId, standardAssignmentName, standardAssignment, Context.NONE).getValue(); - } - - /** - * Deletes a standard assignment. - * - * This operation deletes a standard assignment, given its name and the scope it was created in. The scope of a - * standard assignment is the part of its ID preceding - * '/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}'. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param standardAssignmentName The standard assignments assignment key - unique key for the standard assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 resourceId, String standardAssignmentName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (standardAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter standardAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2024-08-01"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, resourceId, - standardAssignmentName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a standard assignment. - * - * This operation deletes a standard assignment, given its name and the scope it was created in. The scope of a - * standard assignment is the part of its ID preceding - * '/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}'. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param standardAssignmentName The standard assignments assignment key - unique key for the standard assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 resourceId, String standardAssignmentName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (standardAssignmentName == null) { - return Mono.error( - new IllegalArgumentException("Parameter standardAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2024-08-01"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, resourceId, standardAssignmentName, context); - } - - /** - * Deletes a standard assignment. - * - * This operation deletes a standard assignment, given its name and the scope it was created in. The scope of a - * standard assignment is the part of its ID preceding - * '/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}'. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param standardAssignmentName The standard assignments assignment key - unique key for the standard assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 resourceId, String standardAssignmentName) { - return deleteWithResponseAsync(resourceId, standardAssignmentName).flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes a standard assignment. - * - * This operation deletes a standard assignment, given its name and the scope it was created in. The scope of a - * standard assignment is the part of its ID preceding - * '/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}'. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param standardAssignmentName The standard assignments assignment key - unique key for the standard assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceId, String standardAssignmentName, Context context) { - return deleteWithResponseAsync(resourceId, standardAssignmentName, context).block(); - } - - /** - * Deletes a standard assignment. - * - * This operation deletes a standard assignment, given its name and the scope it was created in. The scope of a - * standard assignment is the part of its ID preceding - * '/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}'. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param standardAssignmentName The standard assignments assignment key - unique key for the standard assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 resourceId, String standardAssignmentName) { - deleteWithResponse(resourceId, standardAssignmentName, Context.NONE); - } - - /** - * Get a list of all relevant standard assignments over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant standard assignments over a scope along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2024-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, 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 a list of all relevant standard assignments over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant standard assignments over a scope along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2024-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get a list of all relevant standard assignments over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant standard assignments over a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of all relevant standard assignments over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant standard assignments over a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of all relevant standard assignments over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant standard assignments over a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(listAsync(scope)); - } - - /** - * Get a list of all relevant standard assignments over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant standard assignments over a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(listAsync(scope, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant standard assignments over a scope 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 a list of all relevant standard assignments over a scope 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardAssignmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardAssignmentsImpl.java deleted file mode 100644 index 1adc00ae7d47..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardAssignmentsImpl.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.StandardAssignmentsClient; -import com.azure.resourcemanager.security.fluent.models.StandardAssignmentInner; -import com.azure.resourcemanager.security.models.StandardAssignment; -import com.azure.resourcemanager.security.models.StandardAssignments; - -public final class StandardAssignmentsImpl implements StandardAssignments { - private static final ClientLogger LOGGER = new ClientLogger(StandardAssignmentsImpl.class); - - private final StandardAssignmentsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public StandardAssignmentsImpl(StandardAssignmentsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceId, String standardAssignmentName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceId, standardAssignmentName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new StandardAssignmentImpl(inner.getValue(), this.manager())); - } - - public StandardAssignment get(String resourceId, String standardAssignmentName) { - StandardAssignmentInner inner = this.serviceClient().get(resourceId, standardAssignmentName); - if (inner != null) { - return new StandardAssignmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse(String resourceId, String standardAssignmentName, - Context context) { - return this.serviceClient().deleteWithResponse(resourceId, standardAssignmentName, context); - } - - public void deleteByResourceGroup(String resourceId, String standardAssignmentName) { - this.serviceClient().delete(resourceId, standardAssignmentName); - } - - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return ResourceManagerUtils.mapPage(inner, inner1 -> new StandardAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new StandardAssignmentImpl(inner1, this.manager())); - } - - public StandardAssignment getById(String id) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}", "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String standardAssignmentName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}", - "standardAssignmentName"); - if (standardAssignmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'standardAssignments'.", id))); - } - return this.getWithResponse(resourceId, standardAssignmentName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}", "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String standardAssignmentName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}", - "standardAssignmentName"); - if (standardAssignmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'standardAssignments'.", id))); - } - return this.getWithResponse(resourceId, standardAssignmentName, context); - } - - public void deleteById(String id) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}", "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String standardAssignmentName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}", - "standardAssignmentName"); - if (standardAssignmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'standardAssignments'.", id))); - } - this.deleteByResourceGroupWithResponse(resourceId, standardAssignmentName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceId = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}", "resourceId"); - if (resourceId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String standardAssignmentName = ResourceManagerUtils.getValueFromIdByParameterName(id, - "/{resourceId}/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}", - "standardAssignmentName"); - if (standardAssignmentName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'standardAssignments'.", id))); - } - return this.deleteByResourceGroupWithResponse(resourceId, standardAssignmentName, context); - } - - private StandardAssignmentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public StandardAssignmentImpl define(String name) { - return new StandardAssignmentImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardImpl.java deleted file mode 100644 index e2adb6fa24e4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardImpl.java +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.StandardInner; -import com.azure.resourcemanager.security.models.Standard; -import com.azure.resourcemanager.security.models.StandardComponentProperties; -import com.azure.resourcemanager.security.models.StandardSupportedClouds; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class StandardImpl implements Standard, Standard.Definition, Standard.Update { - private StandardInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String location() { - return this.innerModel().location(); - } - - public String kind() { - return this.innerModel().kind(); - } - - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String standardType() { - return this.innerModel().standardType(); - } - - public String description() { - return this.innerModel().description(); - } - - public String category() { - return this.innerModel().category(); - } - - public List components() { - List inner = this.innerModel().components(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List supportedClouds() { - List inner = this.innerModel().supportedClouds(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public StandardInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String standardId; - - public StandardImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public Standard create() { - this.innerObject = serviceManager.serviceClient() - .getStandards() - .createOrUpdateWithResponse(resourceGroupName, standardId, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public Standard create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getStandards() - .createOrUpdateWithResponse(resourceGroupName, standardId, this.innerModel(), context) - .getValue(); - return this; - } - - StandardImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new StandardInner(); - this.serviceManager = serviceManager; - this.standardId = name; - } - - public StandardImpl update() { - return this; - } - - public Standard apply() { - this.innerObject = serviceManager.serviceClient() - .getStandards() - .createOrUpdateWithResponse(resourceGroupName, standardId, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public Standard apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getStandards() - .createOrUpdateWithResponse(resourceGroupName, standardId, this.innerModel(), context) - .getValue(); - return this; - } - - StandardImpl(StandardInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.standardId = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "standards"); - } - - public Standard refresh() { - this.innerObject = serviceManager.serviceClient() - .getStandards() - .getByResourceGroupWithResponse(resourceGroupName, standardId, Context.NONE) - .getValue(); - return this; - } - - public Standard refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getStandards() - .getByResourceGroupWithResponse(resourceGroupName, standardId, context) - .getValue(); - return this; - } - - public StandardImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public StandardImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public StandardImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public StandardImpl withKind(String kind) { - this.innerModel().withKind(kind); - return this; - } - - public StandardImpl withEtag(String etag) { - this.innerModel().withEtag(etag); - return this; - } - - public StandardImpl withDisplayName(String displayName) { - this.innerModel().withDisplayName(displayName); - return this; - } - - public StandardImpl withDescription(String description) { - this.innerModel().withDescription(description); - return this; - } - - public StandardImpl withCategory(String category) { - this.innerModel().withCategory(category); - return this; - } - - public StandardImpl withComponents(List components) { - this.innerModel().withComponents(components); - return this; - } - - public StandardImpl withSupportedClouds(List supportedClouds) { - this.innerModel().withSupportedClouds(supportedClouds); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardsClientImpl.java deleted file mode 100644 index fb016612efa7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardsClientImpl.java +++ /dev/null @@ -1,857 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.resourcemanager.security.fluent.StandardsClient; -import com.azure.resourcemanager.security.fluent.models.StandardInner; -import com.azure.resourcemanager.security.implementation.models.StandardList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in StandardsClient. - */ -public final class StandardsClientImpl implements StandardsClient { - /** - * The proxy service used to perform REST calls. - */ - private final StandardsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of StandardsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - StandardsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(StandardsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterStandards to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterStandards") - public interface StandardsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("standardId") String standardId, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("standardId") String standardId, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") StandardInner standard, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("standardId") String standardId, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - 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" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/standards") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get a specific security standard for the requested scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param standardId The Security Standard key - unique key for the standard type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security standard for the requested scope along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String standardId) { - 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 (standardId == null) { - return Mono.error(new IllegalArgumentException("Parameter standardId is required and cannot be null.")); - } - final String apiVersion = "2021-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, standardId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific security standard for the requested scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param standardId The Security Standard key - unique key for the standard 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 a specific security standard for the requested scope along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String standardId, 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 (standardId == null) { - return Mono.error(new IllegalArgumentException("Parameter standardId is required and cannot be null.")); - } - final String apiVersion = "2021-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, standardId, accept, context); - } - - /** - * Get a specific security standard for the requested scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param standardId The Security Standard key - unique key for the standard type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security standard for the requested scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String standardId) { - return getByResourceGroupWithResponseAsync(resourceGroupName, standardId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a specific security standard for the requested scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param standardId The Security Standard key - unique key for the standard 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 a specific security standard for the requested scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String standardId, - Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, standardId, context).block(); - } - - /** - * Get a specific security standard for the requested scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param standardId The Security Standard key - unique key for the standard type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security standard for the requested scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StandardInner getByResourceGroup(String resourceGroupName, String standardId) { - return getByResourceGroupWithResponse(resourceGroupName, standardId, Context.NONE).getValue(); - } - - /** - * Create a security standard on the given scope. Available only for custom standards. Will create/update the - * required standard definitions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param standardId The Security Standard key - unique key for the standard type. - * @param standard Custom security standard over a pre-defined scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Standard on a resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String standardId, - StandardInner standard) { - 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 (standardId == null) { - return Mono.error(new IllegalArgumentException("Parameter standardId is required and cannot be null.")); - } - if (standard == null) { - return Mono.error(new IllegalArgumentException("Parameter standard is required and cannot be null.")); - } else { - standard.validate(); - } - final String apiVersion = "2021-08-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, standardId, contentType, accept, standard, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a security standard on the given scope. Available only for custom standards. Will create/update the - * required standard definitions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param standardId The Security Standard key - unique key for the standard type. - * @param standard Custom security standard over a pre-defined scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Standard on a resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String standardId, - StandardInner standard, 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 (standardId == null) { - return Mono.error(new IllegalArgumentException("Parameter standardId is required and cannot be null.")); - } - if (standard == null) { - return Mono.error(new IllegalArgumentException("Parameter standard is required and cannot be null.")); - } else { - standard.validate(); - } - final String apiVersion = "2021-08-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, standardId, contentType, accept, standard, context); - } - - /** - * Create a security standard on the given scope. Available only for custom standards. Will create/update the - * required standard definitions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param standardId The Security Standard key - unique key for the standard type. - * @param standard Custom security standard over a pre-defined scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Standard on a resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String standardId, - StandardInner standard) { - return createOrUpdateWithResponseAsync(resourceGroupName, standardId, standard) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create a security standard on the given scope. Available only for custom standards. Will create/update the - * required standard definitions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param standardId The Security Standard key - unique key for the standard type. - * @param standard Custom security standard over a pre-defined scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Standard on a resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String standardId, - StandardInner standard, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, standardId, standard, context).block(); - } - - /** - * Create a security standard on the given scope. Available only for custom standards. Will create/update the - * required standard definitions. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param standardId The Security Standard key - unique key for the standard type. - * @param standard Custom security standard over a pre-defined scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Standard on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StandardInner createOrUpdate(String resourceGroupName, String standardId, StandardInner standard) { - return createOrUpdateWithResponse(resourceGroupName, standardId, standard, Context.NONE).getValue(); - } - - /** - * Delete a security standard on a scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param standardId The Security Standard key - unique key for the standard type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 standardId) { - 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 (standardId == null) { - return Mono.error(new IllegalArgumentException("Parameter standardId is required and cannot be null.")); - } - final String apiVersion = "2021-08-01-preview"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, standardId, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a security standard on a scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param standardId The Security Standard key - unique key for the standard 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 standardId, 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 (standardId == null) { - return Mono.error(new IllegalArgumentException("Parameter standardId is required and cannot be null.")); - } - final String apiVersion = "2021-08-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - standardId, context); - } - - /** - * Delete a security standard on a scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param standardId The Security Standard key - unique key for the standard type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 standardId) { - return deleteWithResponseAsync(resourceGroupName, standardId).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a security standard on a scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param standardId The Security Standard key - unique key for the standard 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String standardId, Context context) { - return deleteWithResponseAsync(resourceGroupName, standardId, context).block(); - } - - /** - * Delete a security standard on a scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param standardId The Security Standard key - unique key for the standard type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 standardId) { - deleteWithResponse(resourceGroupName, standardId, Context.NONE); - } - - /** - * Get security standards on all your resources inside a scope. - * - * @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 security standards on all your resources inside a scope 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 (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.")); - } - final String apiVersion = "2021-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), apiVersion, - 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())); - } - - /** - * Get security standards on all your resources inside a scope. - * - * @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 security standards on all your resources inside a scope along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @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 (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.")); - } - final String apiVersion = "2021-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get security standards on all your resources inside a scope. - * - * @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 security standards on all your resources inside a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get security standards on all your resources inside a scope. - * - * @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 security standards on all your resources inside a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get security standards on all your resources inside a scope. - * - * @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 security standards on all your resources inside a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Get security standards on all your resources inside a scope. - * - * @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 security standards on all your resources inside a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Get a list of all relevant security standards over a subscription level scope. - * - * @throws 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 relevant security standards over a subscription level scope 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a list of all relevant security standards over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 relevant security standards over a subscription level scope 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-08-01-preview"; - 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)); - } - - /** - * Get a list of all relevant security standards over a subscription level scope. - * - * @throws 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 relevant security standards over a subscription level scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of all relevant security standards over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 relevant security standards over a subscription level scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of all relevant security standards over a subscription level scope. - * - * @throws 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 relevant security standards over a subscription level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Get a list of all relevant security standards over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 relevant security standards over a subscription level scope 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 security standards on all your resources inside a scope 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 security standards on all your resources inside a scope 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)); - } - - /** - * 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 relevant security standards over a subscription level scope along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 relevant security standards over a subscription level scope along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardsImpl.java deleted file mode 100644 index 436049981a35..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/StandardsImpl.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.StandardsClient; -import com.azure.resourcemanager.security.fluent.models.StandardInner; -import com.azure.resourcemanager.security.models.Standard; -import com.azure.resourcemanager.security.models.Standards; - -public final class StandardsImpl implements Standards { - private static final ClientLogger LOGGER = new ClientLogger(StandardsImpl.class); - - private final StandardsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public StandardsImpl(StandardsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getByResourceGroupWithResponse(String resourceGroupName, String standardId, - Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, standardId, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new StandardImpl(inner.getValue(), this.manager())); - } - - public Standard getByResourceGroup(String resourceGroupName, String standardId) { - StandardInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, standardId); - if (inner != null) { - return new StandardImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse(String resourceGroupName, String standardId, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, standardId, context); - } - - public void deleteByResourceGroup(String resourceGroupName, String standardId) { - this.serviceClient().delete(resourceGroupName, standardId); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new StandardImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new StandardImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new StandardImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new StandardImpl(inner1, this.manager())); - } - - public Standard 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 standardId = ResourceManagerUtils.getValueFromIdByName(id, "standards"); - if (standardId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'standards'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, standardId, 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 standardId = ResourceManagerUtils.getValueFromIdByName(id, "standards"); - if (standardId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'standards'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, standardId, 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 standardId = ResourceManagerUtils.getValueFromIdByName(id, "standards"); - if (standardId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'standards'.", id))); - } - this.deleteByResourceGroupWithResponse(resourceGroupName, standardId, Context.NONE); - } - - public Response 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 standardId = ResourceManagerUtils.getValueFromIdByName(id, "standards"); - if (standardId == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'standards'.", id))); - } - return this.deleteByResourceGroupWithResponse(resourceGroupName, standardId, context); - } - - private StandardsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public StandardImpl define(String name) { - return new StandardImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubAssessmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubAssessmentsClientImpl.java deleted file mode 100644 index 4fd841a5c40b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubAssessmentsClientImpl.java +++ /dev/null @@ -1,593 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SubAssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.SecuritySubAssessmentInner; -import com.azure.resourcemanager.security.implementation.models.SecuritySubAssessmentList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SubAssessmentsClient. - */ -public final class SubAssessmentsClientImpl implements SubAssessmentsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SubAssessmentsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SubAssessmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SubAssessmentsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(SubAssessmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSubAssessments to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterSubAssessments") - public interface SubAssessmentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("assessmentName") String assessmentName, - @PathParam("subAssessmentName") String subAssessmentName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @PathParam("assessmentName") String assessmentName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/{scope}/providers/Microsoft.Security/subAssessments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAll(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope The scope of the sub-assessment. - * @param assessmentName The security assessment key - unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security sub-assessment on your scanned resource along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String assessmentName, - String subAssessmentName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (subAssessmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter subAssessmentName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, scope, assessmentName, - subAssessmentName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope The scope of the sub-assessment. - * @param assessmentName The security assessment key - unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment 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 a security sub-assessment on your scanned resource along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String assessmentName, - String subAssessmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (subAssessmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter subAssessmentName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, assessmentName, subAssessmentName, accept, - context); - } - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope The scope of the sub-assessment. - * @param assessmentName The security assessment key - unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security sub-assessment on your scanned resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, String assessmentName, String subAssessmentName) { - return getWithResponseAsync(scope, assessmentName, subAssessmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope The scope of the sub-assessment. - * @param assessmentName The security assessment key - unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment 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 a security sub-assessment on your scanned resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String assessmentName, - String subAssessmentName, Context context) { - return getWithResponseAsync(scope, assessmentName, subAssessmentName, context).block(); - } - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope The scope of the sub-assessment. - * @param assessmentName The security assessment key - unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 security sub-assessment on your scanned resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecuritySubAssessmentInner get(String scope, String assessmentName, String subAssessmentName) { - return getWithResponse(scope, assessmentName, subAssessmentName, Context.NONE).getValue(); - } - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope The scope of the sub-assessment. - * @param assessmentName The security assessment key - unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, String assessmentName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), apiVersion, scope, assessmentName, 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 security sub-assessments on all your scanned resources inside a scope. - * - * @param scope The scope of the sub-assessment. - * @param assessmentName The security assessment key - unique key for the assessment 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 security sub-assessments on all your scanned resources inside a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, String assessmentName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, scope, assessmentName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope The scope of the sub-assessment. - * @param assessmentName The security assessment key - unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, String assessmentName) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, assessmentName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope The scope of the sub-assessment. - * @param assessmentName The security assessment key - unique key for the assessment 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 security sub-assessments on all your scanned resources inside a scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, String assessmentName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, assessmentName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope The scope of the sub-assessment. - * @param assessmentName The security assessment key - unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, String assessmentName) { - return new PagedIterable<>(listAsync(scope, assessmentName)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope The scope of the sub-assessment. - * @param assessmentName The security assessment key - unique key for the assessment 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 security sub-assessments on all your scanned resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, String assessmentName, Context context) { - return new PagedIterable<>(listAsync(scope, assessmentName, context)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 security sub-assessments on all your scanned resources inside a subscription scope along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllSinglePageAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAll(this.client.getEndpoint(), apiVersion, scope, 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 security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 security sub-assessments on all your scanned resources inside a subscription scope along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllSinglePageAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listAll(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 security sub-assessments on all your scanned resources inside a subscription scope as paginated response - * with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAllAsync(String scope) { - return new PagedFlux<>(() -> listAllSinglePageAsync(scope), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 security sub-assessments on all your scanned resources inside a subscription scope as paginated response - * with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAllAsync(String scope, Context context) { - return new PagedFlux<>(() -> listAllSinglePageAsync(scope, context), - nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 security sub-assessments on all your scanned resources inside a subscription scope as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAll(String scope) { - return new PagedIterable<>(listAllAsync(scope)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 security sub-assessments on all your scanned resources inside a subscription scope as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAll(String scope, Context context) { - return new PagedIterable<>(listAllAsync(scope, 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 security sub-assessments on all your scanned resources inside a scope 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 security sub-assessments on all your scanned resources inside a scope 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)); - } - - /** - * 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 security sub-assessments on all your scanned resources inside a subscription scope along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(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.listAllNext(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 security sub-assessments on all your scanned resources inside a subscription scope along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(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.listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubAssessmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubAssessmentsImpl.java deleted file mode 100644 index 693d05c9f87c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubAssessmentsImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SubAssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.SecuritySubAssessmentInner; -import com.azure.resourcemanager.security.models.SecuritySubAssessment; -import com.azure.resourcemanager.security.models.SubAssessments; - -public final class SubAssessmentsImpl implements SubAssessments { - private static final ClientLogger LOGGER = new ClientLogger(SubAssessmentsImpl.class); - - private final SubAssessmentsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SubAssessmentsImpl(SubAssessmentsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String scope, String assessmentName, - String subAssessmentName, Context context) { - Response inner - = this.serviceClient().getWithResponse(scope, assessmentName, subAssessmentName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecuritySubAssessmentImpl(inner.getValue(), this.manager())); - } - - public SecuritySubAssessment get(String scope, String assessmentName, String subAssessmentName) { - SecuritySubAssessmentInner inner = this.serviceClient().get(scope, assessmentName, subAssessmentName); - if (inner != null) { - return new SecuritySubAssessmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String scope, String assessmentName) { - PagedIterable inner = this.serviceClient().list(scope, assessmentName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecuritySubAssessmentImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, String assessmentName, Context context) { - PagedIterable inner = this.serviceClient().list(scope, assessmentName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecuritySubAssessmentImpl(inner1, this.manager())); - } - - public PagedIterable listAll(String scope) { - PagedIterable inner = this.serviceClient().listAll(scope); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecuritySubAssessmentImpl(inner1, this.manager())); - } - - public PagedIterable listAll(String scope, Context context) { - PagedIterable inner = this.serviceClient().listAll(scope, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecuritySubAssessmentImpl(inner1, this.manager())); - } - - private SubAssessmentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TasksClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TasksClientImpl.java deleted file mode 100644 index 3b63fa9d765a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TasksClientImpl.java +++ /dev/null @@ -1,1334 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.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.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.TasksClient; -import com.azure.resourcemanager.security.fluent.models.SecurityTaskInner; -import com.azure.resourcemanager.security.implementation.models.SecurityTaskList; -import com.azure.resourcemanager.security.models.TaskUpdateActionType; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in TasksClient. - */ -public final class TasksClientImpl implements TasksClient { - /** - * The proxy service used to perform REST calls. - */ - private final TasksService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of TasksClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - TasksClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(TasksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterTasks to be used by the proxy service to perform REST - * calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterTasks") - public interface TasksService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getResourceGroupLevelTask(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @PathParam("taskName") String taskName, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateResourceGroupLevelTaskState(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @PathParam("taskName") String taskName, - @PathParam("taskUpdateActionType") TaskUpdateActionType taskUpdateActionType, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getSubscriptionLevelTask(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @PathParam("taskName") String taskName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegion(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateSubscriptionLevelTaskState(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @PathParam("taskName") String taskName, - @PathParam("taskUpdateActionType") TaskUpdateActionType taskUpdateActionType, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/tasks") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getResourceGroupLevelTaskWithResponseAsync(String resourceGroupName, - String ascLocation, String taskName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getResourceGroupLevelTask(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, ascLocation, taskName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getResourceGroupLevelTaskWithResponseAsync(String resourceGroupName, - String ascLocation, String taskName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getResourceGroupLevelTask(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, ascLocation, taskName, accept, context); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getResourceGroupLevelTaskAsync(String resourceGroupName, String ascLocation, - String taskName) { - return getResourceGroupLevelTaskWithResponseAsync(resourceGroupName, ascLocation, taskName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getResourceGroupLevelTaskWithResponse(String resourceGroupName, - String ascLocation, String taskName, Context context) { - return getResourceGroupLevelTaskWithResponseAsync(resourceGroupName, ascLocation, taskName, context).block(); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityTaskInner getResourceGroupLevelTask(String resourceGroupName, String ascLocation, String taskName) { - return getResourceGroupLevelTaskWithResponse(resourceGroupName, ascLocation, taskName, Context.NONE).getValue(); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String ascLocation, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, ascLocation, 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())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - String ascLocation, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, ascLocation, filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String ascLocation, - String filter) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, ascLocation, filter), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String ascLocation) { - final String filter = null; - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, ascLocation, filter), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String ascLocation, - String filter, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, ascLocation, filter, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, String ascLocation) { - final String filter = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, ascLocation, filter)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, String ascLocation, - String filter, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, ascLocation, filter, context)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> updateResourceGroupLevelTaskStateWithResponseAsync(String resourceGroupName, - String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - if (taskUpdateActionType == null) { - return Mono - .error(new IllegalArgumentException("Parameter taskUpdateActionType is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - return FluxUtil - .withContext(context -> service.updateResourceGroupLevelTaskState(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, ascLocation, taskName, taskUpdateActionType, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> updateResourceGroupLevelTaskStateWithResponseAsync(String resourceGroupName, - String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - if (taskUpdateActionType == null) { - return Mono - .error(new IllegalArgumentException("Parameter taskUpdateActionType is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - context = this.client.mergeContext(context); - return service.updateResourceGroupLevelTaskState(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, ascLocation, taskName, taskUpdateActionType, context); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 updateResourceGroupLevelTaskStateAsync(String resourceGroupName, String ascLocation, - String taskName, TaskUpdateActionType taskUpdateActionType) { - return updateResourceGroupLevelTaskStateWithResponseAsync(resourceGroupName, ascLocation, taskName, - taskUpdateActionType).flatMap(ignored -> Mono.empty()); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 updateResourceGroupLevelTaskStateWithResponse(String resourceGroupName, String ascLocation, - String taskName, TaskUpdateActionType taskUpdateActionType, Context context) { - return updateResourceGroupLevelTaskStateWithResponseAsync(resourceGroupName, ascLocation, taskName, - taskUpdateActionType, context).block(); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 updateResourceGroupLevelTaskState(String resourceGroupName, String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType) { - updateResourceGroupLevelTaskStateWithResponse(resourceGroupName, ascLocation, taskName, taskUpdateActionType, - Context.NONE); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSubscriptionLevelTaskWithResponseAsync(String ascLocation, - String taskName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getSubscriptionLevelTask(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, taskName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSubscriptionLevelTaskWithResponseAsync(String ascLocation, - String taskName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getSubscriptionLevelTask(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - ascLocation, taskName, accept, context); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getSubscriptionLevelTaskAsync(String ascLocation, String taskName) { - return getSubscriptionLevelTaskWithResponseAsync(ascLocation, taskName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSubscriptionLevelTaskWithResponse(String ascLocation, String taskName, - Context context) { - return getSubscriptionLevelTaskWithResponseAsync(ascLocation, taskName, context).block(); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityTaskInner getSubscriptionLevelTask(String ascLocation, String taskName) { - return getSubscriptionLevelTaskWithResponse(ascLocation, taskName, Context.NONE).getValue(); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync(String ascLocation, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByHomeRegion(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, 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())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync(String ascLocation, String filter, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByHomeRegion(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), ascLocation, - filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation, String filter) { - return new PagedFlux<>(() -> listByHomeRegionSinglePageAsync(ascLocation, filter), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation) { - final String filter = null; - return new PagedFlux<>(() -> listByHomeRegionSinglePageAsync(ascLocation, filter), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation, String filter, Context context) { - return new PagedFlux<>(() -> listByHomeRegionSinglePageAsync(ascLocation, filter, context), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink, context)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation) { - final String filter = null; - return new PagedIterable<>(listByHomeRegionAsync(ascLocation, filter)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation, String filter, Context context) { - return new PagedIterable<>(listByHomeRegionAsync(ascLocation, filter, context)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> updateSubscriptionLevelTaskStateWithResponseAsync(String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - if (taskUpdateActionType == null) { - return Mono - .error(new IllegalArgumentException("Parameter taskUpdateActionType is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - return FluxUtil - .withContext(context -> service.updateSubscriptionLevelTaskState(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, taskName, taskUpdateActionType, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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> updateSubscriptionLevelTaskStateWithResponseAsync(String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - if (taskUpdateActionType == null) { - return Mono - .error(new IllegalArgumentException("Parameter taskUpdateActionType is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - context = this.client.mergeContext(context); - return service.updateSubscriptionLevelTaskState(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, taskName, taskUpdateActionType, context); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 updateSubscriptionLevelTaskStateAsync(String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType) { - return updateSubscriptionLevelTaskStateWithResponseAsync(ascLocation, taskName, taskUpdateActionType) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 updateSubscriptionLevelTaskStateWithResponse(String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType, Context context) { - return updateSubscriptionLevelTaskStateWithResponseAsync(ascLocation, taskName, taskUpdateActionType, context) - .block(); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 updateSubscriptionLevelTaskState(String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType) { - updateSubscriptionLevelTaskStateWithResponse(ascLocation, taskName, taskUpdateActionType, Context.NONE); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter) { - 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 = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - 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())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, 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 = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), filter, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - return new PagedIterable<>(listAsync(filter)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @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( - context -> 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)) - .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 list of security task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations 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 list of security task recommendations 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TasksImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TasksImpl.java deleted file mode 100644 index eaec5ee484d6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TasksImpl.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.TasksClient; -import com.azure.resourcemanager.security.fluent.models.SecurityTaskInner; -import com.azure.resourcemanager.security.models.SecurityTask; -import com.azure.resourcemanager.security.models.TaskUpdateActionType; -import com.azure.resourcemanager.security.models.Tasks; - -public final class TasksImpl implements Tasks { - private static final ClientLogger LOGGER = new ClientLogger(TasksImpl.class); - - private final TasksClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public TasksImpl(TasksClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getResourceGroupLevelTaskWithResponse(String resourceGroupName, String ascLocation, - String taskName, Context context) { - Response inner = this.serviceClient() - .getResourceGroupLevelTaskWithResponse(resourceGroupName, ascLocation, taskName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityTaskImpl(inner.getValue(), this.manager())); - } - - public SecurityTask getResourceGroupLevelTask(String resourceGroupName, String ascLocation, String taskName) { - SecurityTaskInner inner - = this.serviceClient().getResourceGroupLevelTask(resourceGroupName, ascLocation, taskName); - if (inner != null) { - return new SecurityTaskImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listByResourceGroup(String resourceGroupName, String ascLocation) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, ascLocation); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, String ascLocation, String filter, - Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, ascLocation, filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); - } - - public Response updateResourceGroupLevelTaskStateWithResponse(String resourceGroupName, String ascLocation, - String taskName, TaskUpdateActionType taskUpdateActionType, Context context) { - return this.serviceClient() - .updateResourceGroupLevelTaskStateWithResponse(resourceGroupName, ascLocation, taskName, - taskUpdateActionType, context); - } - - public void updateResourceGroupLevelTaskState(String resourceGroupName, String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType) { - this.serviceClient() - .updateResourceGroupLevelTaskState(resourceGroupName, ascLocation, taskName, taskUpdateActionType); - } - - public Response getSubscriptionLevelTaskWithResponse(String ascLocation, String taskName, - Context context) { - Response inner - = this.serviceClient().getSubscriptionLevelTaskWithResponse(ascLocation, taskName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SecurityTaskImpl(inner.getValue(), this.manager())); - } - - public SecurityTask getSubscriptionLevelTask(String ascLocation, String taskName) { - SecurityTaskInner inner = this.serviceClient().getSubscriptionLevelTask(ascLocation, taskName); - if (inner != null) { - return new SecurityTaskImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listByHomeRegion(String ascLocation) { - PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); - } - - public PagedIterable listByHomeRegion(String ascLocation, String filter, Context context) { - PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation, filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); - } - - public Response updateSubscriptionLevelTaskStateWithResponse(String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType, Context context) { - return this.serviceClient() - .updateSubscriptionLevelTaskStateWithResponse(ascLocation, taskName, taskUpdateActionType, context); - } - - public void updateSubscriptionLevelTaskState(String ascLocation, String taskName, - TaskUpdateActionType taskUpdateActionType) { - this.serviceClient().updateSubscriptionLevelTaskState(ascLocation, taskName, taskUpdateActionType); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); - } - - public PagedIterable list(String filter, Context context) { - PagedIterable inner = this.serviceClient().list(filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); - } - - private TasksClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesClientImpl.java deleted file mode 100644 index dc0df91a3fc4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesClientImpl.java +++ /dev/null @@ -1,604 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.TopologiesClient; -import com.azure.resourcemanager.security.fluent.models.TopologyResourceInner; -import com.azure.resourcemanager.security.implementation.models.TopologyList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in TopologiesClient. - */ -public final class TopologiesClientImpl implements TopologiesClient { - /** - * The proxy service used to perform REST calls. - */ - private final TopologiesService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of TopologiesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - TopologiesClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(TopologiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterTopologies to be used by the proxy service to perform - * REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterTopologies") - public interface TopologiesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @PathParam("topologyResourceName") String topologyResourceName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/topologies") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegion(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/topologies") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String ascLocation, - String topologyResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (topologyResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter topologyResourceName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, ascLocation, topologyResourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String ascLocation, - String topologyResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (topologyResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter topologyResourceName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - ascLocation, topologyResourceName, accept, context); - } - - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String ascLocation, - String topologyResourceName) { - return getWithResponseAsync(resourceGroupName, ascLocation, topologyResourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String ascLocation, - String topologyResourceName, Context context) { - return getWithResponseAsync(resourceGroupName, ascLocation, topologyResourceName, context).block(); - } - - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TopologyResourceInner get(String resourceGroupName, String ascLocation, String topologyResourceName) { - return getWithResponse(resourceGroupName, ascLocation, topologyResourceName, Context.NONE).getValue(); - } - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync(String ascLocation) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByHomeRegion(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync(String ascLocation, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByHomeRegion(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), ascLocation, - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation) { - return new PagedFlux<>(() -> listByHomeRegionSinglePageAsync(ascLocation), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation, Context context) { - return new PagedFlux<>(() -> listByHomeRegionSinglePageAsync(ascLocation, context), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation) { - return new PagedIterable<>(listByHomeRegionAsync(ascLocation)); - } - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation, Context context) { - return new PagedIterable<>(listByHomeRegionAsync(ascLocation, context)); - } - - /** - * Gets a list that allows to build a topology view of a 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 a list that allows to build a topology view of a subscription 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list that allows to build a topology view of 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 that allows to build a topology view of a subscription 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-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)); - } - - /** - * Gets a list that allows to build a topology view of a 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 a list that allows to build a topology view of a subscription as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list that allows to build a topology view of 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 that allows to build a topology view of a subscription 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 a list that allows to build a topology view of a 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 a list that allows to build a topology view of a subscription as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets a list that allows to build a topology view of 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 that allows to build a topology view of a subscription 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 a list that allows to build a topology view of a subscription and location along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription 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 a list that allows to build a topology view of a subscription 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesImpl.java deleted file mode 100644 index 2f1714b9b58f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.TopologiesClient; -import com.azure.resourcemanager.security.fluent.models.TopologyResourceInner; -import com.azure.resourcemanager.security.models.Topologies; -import com.azure.resourcemanager.security.models.TopologyResource; - -public final class TopologiesImpl implements Topologies { - private static final ClientLogger LOGGER = new ClientLogger(TopologiesImpl.class); - - private final TopologiesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public TopologiesImpl(TopologiesClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String ascLocation, - String topologyResourceName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, ascLocation, topologyResourceName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new TopologyResourceImpl(inner.getValue(), this.manager())); - } - - public TopologyResource get(String resourceGroupName, String ascLocation, String topologyResourceName) { - TopologyResourceInner inner = this.serviceClient().get(resourceGroupName, ascLocation, topologyResourceName); - if (inner != null) { - return new TopologyResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listByHomeRegion(String ascLocation) { - PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation); - return ResourceManagerUtils.mapPage(inner, inner1 -> new TopologyResourceImpl(inner1, this.manager())); - } - - public PagedIterable listByHomeRegion(String ascLocation, Context context) { - PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new TopologyResourceImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new TopologyResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new TopologyResourceImpl(inner1, this.manager())); - } - - private TopologiesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologyResourceImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologyResourceImpl.java deleted file mode 100644 index 28d7d9720b4f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologyResourceImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.TopologyResourceInner; -import com.azure.resourcemanager.security.models.TopologyResource; -import com.azure.resourcemanager.security.models.TopologySingleResource; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class TopologyResourceImpl implements TopologyResource { - private TopologyResourceInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - TopologyResourceImpl(TopologyResourceInner innerObject, - com.azure.resourcemanager.security.SecurityManager 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 String location() { - return this.innerModel().location(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public OffsetDateTime calculatedDateTime() { - return this.innerModel().calculatedDateTime(); - } - - public List topologyResources() { - List inner = this.innerModel().topologyResources(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public TopologyResourceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingImpl.java deleted file mode 100644 index 71401d2b3550..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingImpl.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.WorkspaceSettingInner; -import com.azure.resourcemanager.security.models.WorkspaceSetting; - -public final class WorkspaceSettingImpl - implements WorkspaceSetting, WorkspaceSetting.Definition, WorkspaceSetting.Update { - private WorkspaceSettingInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager 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 String workspaceId() { - return this.innerModel().workspaceId(); - } - - public String scope() { - return this.innerModel().scope(); - } - - public WorkspaceSettingInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String workspaceSettingName; - - public WorkspaceSetting create() { - this.innerObject = serviceManager.serviceClient() - .getWorkspaceSettings() - .createWithResponse(workspaceSettingName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public WorkspaceSetting create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getWorkspaceSettings() - .createWithResponse(workspaceSettingName, this.innerModel(), context) - .getValue(); - return this; - } - - WorkspaceSettingImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new WorkspaceSettingInner(); - this.serviceManager = serviceManager; - this.workspaceSettingName = name; - } - - public WorkspaceSettingImpl update() { - return this; - } - - public WorkspaceSetting apply() { - this.innerObject = serviceManager.serviceClient() - .getWorkspaceSettings() - .updateWithResponse(workspaceSettingName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public WorkspaceSetting apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getWorkspaceSettings() - .updateWithResponse(workspaceSettingName, this.innerModel(), context) - .getValue(); - return this; - } - - WorkspaceSettingImpl(WorkspaceSettingInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.workspaceSettingName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaceSettings"); - } - - public WorkspaceSetting refresh() { - this.innerObject = serviceManager.serviceClient() - .getWorkspaceSettings() - .getWithResponse(workspaceSettingName, Context.NONE) - .getValue(); - return this; - } - - public WorkspaceSetting refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getWorkspaceSettings() - .getWithResponse(workspaceSettingName, context) - .getValue(); - return this; - } - - public WorkspaceSettingImpl withWorkspaceId(String workspaceId) { - this.innerModel().withWorkspaceId(workspaceId); - return this; - } - - public WorkspaceSettingImpl withScope(String scope) { - this.innerModel().withScope(scope); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsClientImpl.java deleted file mode 100644 index ce096fb68c5b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsClientImpl.java +++ /dev/null @@ -1,766 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.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.Patch; -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.resourcemanager.security.fluent.WorkspaceSettingsClient; -import com.azure.resourcemanager.security.fluent.models.WorkspaceSettingInner; -import com.azure.resourcemanager.security.implementation.models.WorkspaceSettingList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in WorkspaceSettingsClient. - */ -public final class WorkspaceSettingsClientImpl implements WorkspaceSettingsClient { - /** - * The proxy service used to perform REST calls. - */ - private final WorkspaceSettingsService service; - - /** - * The service client containing this operation class. - */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of WorkspaceSettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - WorkspaceSettingsClientImpl(SecurityCenterImpl client) { - this.service - = RestProxy.create(WorkspaceSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterWorkspaceSettings to be used by the proxy service to - * perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "SecurityCenterWorkspaceSettings") - public interface WorkspaceSettingsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("workspaceSettingName") String workspaceSettingName, @HeaderParam("Accept") String accept, - Context context); - - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("workspaceSettingName") String workspaceSettingName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") WorkspaceSettingInner workspaceSetting, Context context); - - @Patch("/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("workspaceSettingName") String workspaceSettingName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") WorkspaceSettingInner workspaceSetting, Context context); - - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("workspaceSettingName") String workspaceSettingName, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String workspaceSettingName) { - 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 (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - workspaceSettingName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String workspaceSettingName, 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 (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), workspaceSettingName, - accept, context); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String workspaceSettingName) { - return getWithResponseAsync(workspaceSettingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String workspaceSettingName, Context context) { - return getWithResponseAsync(workspaceSettingName, context).block(); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceSettingInner get(String workspaceSettingName) { - return getWithResponse(workspaceSettingName, Context.NONE).getValue(); - } - - /** - * creating settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String workspaceSettingName, - WorkspaceSettingInner workspaceSetting) { - 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 (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - if (workspaceSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSetting is required and cannot be null.")); - } else { - workspaceSetting.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), workspaceSettingName, contentType, accept, workspaceSetting, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * creating settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String workspaceSettingName, - WorkspaceSettingInner workspaceSetting, 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 (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - if (workspaceSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSetting is required and cannot be null.")); - } else { - workspaceSetting.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - workspaceSettingName, contentType, accept, workspaceSetting, context); - } - - /** - * creating settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String workspaceSettingName, - WorkspaceSettingInner workspaceSetting) { - return createWithResponseAsync(workspaceSettingName, workspaceSetting) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * creating settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String workspaceSettingName, - WorkspaceSettingInner workspaceSetting, Context context) { - return createWithResponseAsync(workspaceSettingName, workspaceSetting, context).block(); - } - - /** - * creating settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceSettingInner create(String workspaceSettingName, WorkspaceSettingInner workspaceSetting) { - return createWithResponse(workspaceSettingName, workspaceSetting, Context.NONE).getValue(); - } - - /** - * Settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String workspaceSettingName, - WorkspaceSettingInner workspaceSetting) { - 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 (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - if (workspaceSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSetting is required and cannot be null.")); - } else { - workspaceSetting.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), workspaceSettingName, contentType, accept, workspaceSetting, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String workspaceSettingName, - WorkspaceSettingInner workspaceSetting, 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 (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - if (workspaceSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSetting is required and cannot be null.")); - } else { - workspaceSetting.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - workspaceSettingName, contentType, accept, workspaceSetting, context); - } - - /** - * Settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String workspaceSettingName, - WorkspaceSettingInner workspaceSetting) { - return updateWithResponseAsync(workspaceSettingName, workspaceSetting) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String workspaceSettingName, - WorkspaceSettingInner workspaceSetting, Context context) { - return updateWithResponseAsync(workspaceSettingName, workspaceSetting, context).block(); - } - - /** - * Settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceSettingInner update(String workspaceSettingName, WorkspaceSettingInner workspaceSetting) { - return updateWithResponse(workspaceSettingName, workspaceSetting, Context.NONE).getValue(); - } - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 workspaceSettingName) { - 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 (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), workspaceSettingName, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 workspaceSettingName, 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 (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - workspaceSettingName, context); - } - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 workspaceSettingName) { - return deleteWithResponseAsync(workspaceSettingName).flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String workspaceSettingName, Context context) { - return deleteWithResponseAsync(workspaceSettingName, context).block(); - } - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 workspaceSettingName) { - deleteWithResponse(workspaceSettingName, Context.NONE); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response 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.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - 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)); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response 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 list of workspace settings response 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 list of workspace settings response 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsImpl.java deleted file mode 100644 index 9cbe9f253866..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsImpl.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.WorkspaceSettingsClient; -import com.azure.resourcemanager.security.fluent.models.WorkspaceSettingInner; -import com.azure.resourcemanager.security.models.WorkspaceSetting; -import com.azure.resourcemanager.security.models.WorkspaceSettings; - -public final class WorkspaceSettingsImpl implements WorkspaceSettings { - private static final ClientLogger LOGGER = new ClientLogger(WorkspaceSettingsImpl.class); - - private final WorkspaceSettingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public WorkspaceSettingsImpl(WorkspaceSettingsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String workspaceSettingName, Context context) { - Response inner = this.serviceClient().getWithResponse(workspaceSettingName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new WorkspaceSettingImpl(inner.getValue(), this.manager())); - } - - public WorkspaceSetting get(String workspaceSettingName) { - WorkspaceSettingInner inner = this.serviceClient().get(workspaceSettingName); - if (inner != null) { - return new WorkspaceSettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String workspaceSettingName, Context context) { - return this.serviceClient().deleteWithResponse(workspaceSettingName, context); - } - - public void delete(String workspaceSettingName) { - this.serviceClient().delete(workspaceSettingName); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceSettingImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new WorkspaceSettingImpl(inner1, this.manager())); - } - - public WorkspaceSetting getById(String id) { - String workspaceSettingName = ResourceManagerUtils.getValueFromIdByName(id, "workspaceSettings"); - if (workspaceSettingName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaceSettings'.", id))); - } - return this.getWithResponse(workspaceSettingName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String workspaceSettingName = ResourceManagerUtils.getValueFromIdByName(id, "workspaceSettings"); - if (workspaceSettingName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaceSettings'.", id))); - } - return this.getWithResponse(workspaceSettingName, context); - } - - public void deleteById(String id) { - String workspaceSettingName = ResourceManagerUtils.getValueFromIdByName(id, "workspaceSettings"); - if (workspaceSettingName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaceSettings'.", id))); - } - this.deleteWithResponse(workspaceSettingName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String workspaceSettingName = ResourceManagerUtils.getValueFromIdByName(id, "workspaceSettings"); - if (workspaceSettingName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'workspaceSettings'.", id))); - } - return this.deleteWithResponse(workspaceSettingName, context); - } - - private WorkspaceSettingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public WorkspaceSettingImpl define(String name) { - return new WorkspaceSettingImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AlertList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AlertList.java deleted file mode 100644 index 8f516f2b3a04..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AlertList.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.AlertInner; -import java.io.IOException; -import java.util.List; - -/** - * List of security alerts. - */ -@Immutable -public final class AlertList implements JsonSerializable { - /* - * The Alert items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of AlertList class. - */ - private AlertList() { - } - - /** - * Get the value property: The Alert items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * 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 AlertList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AlertList 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 AlertList. - */ - public static AlertList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AlertList deserializedAlertList = new AlertList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> AlertInner.fromJson(reader1)); - deserializedAlertList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAlertList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAlertList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AlertsSuppressionRulesList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AlertsSuppressionRulesList.java deleted file mode 100644 index 7252c4f5e6ab..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AlertsSuppressionRulesList.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -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.security.fluent.models.AlertsSuppressionRuleInner; -import java.io.IOException; -import java.util.List; - -/** - * Suppression rules list for subscription. - */ -@Immutable -public final class AlertsSuppressionRulesList implements JsonSerializable { - /* - * The AlertsSuppressionRule items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of AlertsSuppressionRulesList class. - */ - private AlertsSuppressionRulesList() { - } - - /** - * Get the value property: The AlertsSuppressionRule items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property value in model AlertsSuppressionRulesList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AlertsSuppressionRulesList.class); - - /** - * {@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 AlertsSuppressionRulesList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AlertsSuppressionRulesList 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 AlertsSuppressionRulesList. - */ - public static AlertsSuppressionRulesList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AlertsSuppressionRulesList deserializedAlertsSuppressionRulesList = new AlertsSuppressionRulesList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AlertsSuppressionRuleInner.fromJson(reader1)); - deserializedAlertsSuppressionRulesList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAlertsSuppressionRulesList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAlertsSuppressionRulesList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AllowedConnectionsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AllowedConnectionsList.java deleted file mode 100644 index 68e929a67fe8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AllowedConnectionsList.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.AllowedConnectionsResourceInner; -import java.io.IOException; -import java.util.List; - -/** - * List of all possible traffic between Azure resources. - */ -@Immutable -public final class AllowedConnectionsList implements JsonSerializable { - /* - * The value property. - */ - private List value; - - /* - * The URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of AllowedConnectionsList class. - */ - private AllowedConnectionsList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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 AllowedConnectionsList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AllowedConnectionsList 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 AllowedConnectionsList. - */ - public static AllowedConnectionsList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AllowedConnectionsList deserializedAllowedConnectionsList = new AllowedConnectionsList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AllowedConnectionsResourceInner.fromJson(reader1)); - deserializedAllowedConnectionsList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAllowedConnectionsList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAllowedConnectionsList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ApiCollectionList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ApiCollectionList.java deleted file mode 100644 index aba0fd3621b1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ApiCollectionList.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionInner; -import java.io.IOException; -import java.util.List; - -/** - * Page of a list of API collections as represented by Microsoft Defender for APIs. - */ -@Immutable -public final class ApiCollectionList implements JsonSerializable { - /* - * API collections in this page. - */ - private List value; - - /* - * The URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of ApiCollectionList class. - */ - private ApiCollectionList() { - } - - /** - * Get the value property: API collections in this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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 ApiCollectionList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ApiCollectionList 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 ApiCollectionList. - */ - public static ApiCollectionList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ApiCollectionList deserializedApiCollectionList = new ApiCollectionList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> ApiCollectionInner.fromJson(reader1)); - deserializedApiCollectionList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedApiCollectionList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedApiCollectionList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ApplicationsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ApplicationsList.java deleted file mode 100644 index abb43d4884ca..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ApplicationsList.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import java.io.IOException; -import java.util.List; - -/** - * Page of a security applications list. - */ -@Immutable -public final class ApplicationsList implements JsonSerializable { - /* - * Collection of applications in this page - */ - private List value; - - /* - * The URI to fetch the next page - */ - private String nextLink; - - /** - * Creates an instance of ApplicationsList class. - */ - private ApplicationsList() { - } - - /** - * Get the value property: Collection of applications in this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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 ApplicationsList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ApplicationsList 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 ApplicationsList. - */ - public static ApplicationsList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ApplicationsList deserializedApplicationsList = new ApplicationsList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> ApplicationInner.fromJson(reader1)); - deserializedApplicationsList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedApplicationsList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedApplicationsList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AscLocationList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AscLocationList.java deleted file mode 100644 index 8217c94f0eed..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AscLocationList.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.AscLocationInner; -import java.io.IOException; -import java.util.List; - -/** - * List of locations where ASC saves your data. - */ -@Immutable -public final class AscLocationList implements JsonSerializable { - /* - * List of locations - */ - private List value; - - /* - * The URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of AscLocationList class. - */ - private AscLocationList() { - } - - /** - * Get the value property: List of locations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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 AscLocationList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AscLocationList 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 AscLocationList. - */ - public static AscLocationList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AscLocationList deserializedAscLocationList = new AscLocationList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> AscLocationInner.fromJson(reader1)); - deserializedAscLocationList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAscLocationList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAscLocationList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AssignmentList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AssignmentList.java deleted file mode 100644 index 030df10ee48d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AssignmentList.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.AssignmentInner; -import java.io.IOException; -import java.util.List; - -/** - * Page of a standard assignment list. - */ -@Immutable -public final class AssignmentList implements JsonSerializable { - /* - * Collection of standardAssignments in this page - */ - private List value; - - /* - * The URI to fetch the next page - */ - private String nextLink; - - /** - * Creates an instance of AssignmentList class. - */ - private AssignmentList() { - } - - /** - * Get the value property: Collection of standardAssignments in this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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 AssignmentList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssignmentList 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 AssignmentList. - */ - public static AssignmentList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssignmentList deserializedAssignmentList = new AssignmentList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> AssignmentInner.fromJson(reader1)); - deserializedAssignmentList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAssignmentList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAssignmentList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AutoProvisioningSettingList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AutoProvisioningSettingList.java deleted file mode 100644 index 9733fbf9f7fa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AutoProvisioningSettingList.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; -import java.io.IOException; -import java.util.List; - -/** - * List of all the auto provisioning settings response. - */ -@Immutable -public final class AutoProvisioningSettingList implements JsonSerializable { - /* - * List of all the auto provisioning settings - */ - private List value; - - /* - * The URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of AutoProvisioningSettingList class. - */ - private AutoProvisioningSettingList() { - } - - /** - * Get the value property: List of all the auto provisioning settings. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutoProvisioningSettingList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutoProvisioningSettingList 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 AutoProvisioningSettingList. - */ - public static AutoProvisioningSettingList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutoProvisioningSettingList deserializedAutoProvisioningSettingList = new AutoProvisioningSettingList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AutoProvisioningSettingInner.fromJson(reader1)); - deserializedAutoProvisioningSettingList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAutoProvisioningSettingList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAutoProvisioningSettingList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AutomationList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AutomationList.java deleted file mode 100644 index 2fc5e0b8672a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AutomationList.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -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.security.fluent.models.AutomationInner; -import java.io.IOException; -import java.util.List; - -/** - * List of security automations response. - */ -@Immutable -public final class AutomationList implements JsonSerializable { - /* - * The Automation items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of AutomationList class. - */ - private AutomationList() { - } - - /** - * Get the value property: The Automation items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model AutomationList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AutomationList.class); - - /** - * {@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 AutomationList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationList 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 AutomationList. - */ - public static AutomationList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationList deserializedAutomationList = new AutomationList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> AutomationInner.fromJson(reader1)); - deserializedAutomationList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAutomationList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AzureDevOpsProjectListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AzureDevOpsProjectListResponse.java deleted file mode 100644 index de21b3805bc9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AzureDevOpsProjectListResponse.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner; -import java.io.IOException; -import java.util.List; - -/** - * List of RP resources which supports pagination. - */ -@Immutable -public final class AzureDevOpsProjectListResponse implements JsonSerializable { - /* - * The AzureDevOpsProject items on this page. - */ - private List value; - - /* - * The link to the next page of items. - */ - private String nextLink; - - /** - * Creates an instance of AzureDevOpsProjectListResponse class. - */ - private AzureDevOpsProjectListResponse() { - } - - /** - * Get the value property: The AzureDevOpsProject items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * 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 AzureDevOpsProjectListResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureDevOpsProjectListResponse 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 AzureDevOpsProjectListResponse. - */ - public static AzureDevOpsProjectListResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureDevOpsProjectListResponse deserializedAzureDevOpsProjectListResponse - = new AzureDevOpsProjectListResponse(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AzureDevOpsProjectInner.fromJson(reader1)); - deserializedAzureDevOpsProjectListResponse.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAzureDevOpsProjectListResponse.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureDevOpsProjectListResponse; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AzureDevOpsRepositoryListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AzureDevOpsRepositoryListResponse.java deleted file mode 100644 index ee1c3d7b149c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/AzureDevOpsRepositoryListResponse.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsRepositoryInner; -import java.io.IOException; -import java.util.List; - -/** - * List of RP resources which supports pagination. - */ -@Immutable -public final class AzureDevOpsRepositoryListResponse implements JsonSerializable { - /* - * The AzureDevOpsRepository items on this page. - */ - private List value; - - /* - * The link to the next page of items. - */ - private String nextLink; - - /** - * Creates an instance of AzureDevOpsRepositoryListResponse class. - */ - private AzureDevOpsRepositoryListResponse() { - } - - /** - * Get the value property: The AzureDevOpsRepository items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * 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 AzureDevOpsRepositoryListResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureDevOpsRepositoryListResponse 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 AzureDevOpsRepositoryListResponse. - */ - public static AzureDevOpsRepositoryListResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureDevOpsRepositoryListResponse deserializedAzureDevOpsRepositoryListResponse - = new AzureDevOpsRepositoryListResponse(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> AzureDevOpsRepositoryInner.fromJson(reader1)); - deserializedAzureDevOpsRepositoryListResponse.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedAzureDevOpsRepositoryListResponse.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureDevOpsRepositoryListResponse; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ComplianceList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ComplianceList.java deleted file mode 100644 index ae2b4dc6bf93..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ComplianceList.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.ComplianceInner; -import java.io.IOException; -import java.util.List; - -/** - * List of Compliance objects response. - */ -@Immutable -public final class ComplianceList implements JsonSerializable { - /* - * List of Compliance objects - */ - private List value; - - /* - * The URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of ComplianceList class. - */ - private ComplianceList() { - } - - /** - * Get the value property: List of Compliance objects. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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 ComplianceList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComplianceList 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 ComplianceList. - */ - public static ComplianceList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ComplianceList deserializedComplianceList = new ComplianceList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> ComplianceInner.fromJson(reader1)); - deserializedComplianceList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedComplianceList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedComplianceList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ComplianceResultList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ComplianceResultList.java deleted file mode 100644 index 9deacc17b132..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ComplianceResultList.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -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.security.fluent.models.ComplianceResultInner; -import java.io.IOException; -import java.util.List; - -/** - * List of compliance results response. - */ -@Immutable -public final class ComplianceResultList implements JsonSerializable { - /* - * The ComplianceResult items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of ComplianceResultList class. - */ - private ComplianceResultList() { - } - - /** - * Get the value property: The ComplianceResult items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model ComplianceResultList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ComplianceResultList.class); - - /** - * {@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 ComplianceResultList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComplianceResultList 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 ComplianceResultList. - */ - public static ComplianceResultList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ComplianceResultList deserializedComplianceResultList = new ComplianceResultList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ComplianceResultInner.fromJson(reader1)); - deserializedComplianceResultList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedComplianceResultList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedComplianceResultList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/CustomRecommendationsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/CustomRecommendationsList.java deleted file mode 100644 index 2e2c815ea40c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/CustomRecommendationsList.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.CustomRecommendationInner; -import java.io.IOException; -import java.util.List; - -/** - * A list of Custom Recommendations. - */ -@Immutable -public final class CustomRecommendationsList implements JsonSerializable { - /* - * Collection of Custom Recommendations - */ - private List value; - - /* - * The link used to get the next page of operations. - */ - private String nextLink; - - /** - * Creates an instance of CustomRecommendationsList class. - */ - private CustomRecommendationsList() { - } - - /** - * Get the value property: Collection of Custom Recommendations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link used to get the next page of operations. - * - * @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(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CustomRecommendationsList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CustomRecommendationsList 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 CustomRecommendationsList. - */ - public static CustomRecommendationsList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CustomRecommendationsList deserializedCustomRecommendationsList = new CustomRecommendationsList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> CustomRecommendationInner.fromJson(reader1)); - deserializedCustomRecommendationsList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedCustomRecommendationsList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCustomRecommendationsList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/DefenderForStorageSettingList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/DefenderForStorageSettingList.java deleted file mode 100644 index f6978bf01ea0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/DefenderForStorageSettingList.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.DefenderForStorageSettingInner; -import java.io.IOException; -import java.util.List; - -/** - * List of Defender for Storage settings. - */ -@Immutable -public final class DefenderForStorageSettingList implements JsonSerializable { - /* - * List of Defender for Storage settings. - */ - private List value; - - /* - * The URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of DefenderForStorageSettingList class. - */ - private DefenderForStorageSettingList() { - } - - /** - * Get the value property: List of Defender for Storage settings. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForStorageSettingList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForStorageSettingList 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 DefenderForStorageSettingList. - */ - public static DefenderForStorageSettingList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForStorageSettingList deserializedDefenderForStorageSettingList - = new DefenderForStorageSettingList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> DefenderForStorageSettingInner.fromJson(reader1)); - deserializedDefenderForStorageSettingList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedDefenderForStorageSettingList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForStorageSettingList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/DevOpsConfigurationListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/DevOpsConfigurationListResponse.java deleted file mode 100644 index 838228e281a8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/DevOpsConfigurationListResponse.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; -import java.io.IOException; -import java.util.List; - -/** - * List of RP resources which supports pagination. - */ -@Immutable -public final class DevOpsConfigurationListResponse implements JsonSerializable { - /* - * The DevOpsConfiguration items on this page. - */ - private List value; - - /* - * The link to the next page of items. - */ - private String nextLink; - - /** - * Creates an instance of DevOpsConfigurationListResponse class. - */ - private DevOpsConfigurationListResponse() { - } - - /** - * Get the value property: The DevOpsConfiguration items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * 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 DevOpsConfigurationListResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DevOpsConfigurationListResponse 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 DevOpsConfigurationListResponse. - */ - public static DevOpsConfigurationListResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DevOpsConfigurationListResponse deserializedDevOpsConfigurationListResponse - = new DevOpsConfigurationListResponse(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> DevOpsConfigurationInner.fromJson(reader1)); - deserializedDevOpsConfigurationListResponse.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedDevOpsConfigurationListResponse.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDevOpsConfigurationListResponse; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/DeviceSecurityGroupList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/DeviceSecurityGroupList.java deleted file mode 100644 index 730a35231c7c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/DeviceSecurityGroupList.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.DeviceSecurityGroupInner; -import java.io.IOException; -import java.util.List; - -/** - * List of device security groups. - */ -@Immutable -public final class DeviceSecurityGroupList implements JsonSerializable { - /* - * List of device security group objects - */ - private List value; - - /* - * The URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of DeviceSecurityGroupList class. - */ - private DeviceSecurityGroupList() { - } - - /** - * Get the value property: List of device security group objects. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DeviceSecurityGroupList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DeviceSecurityGroupList 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 DeviceSecurityGroupList. - */ - public static DeviceSecurityGroupList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DeviceSecurityGroupList deserializedDeviceSecurityGroupList = new DeviceSecurityGroupList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> DeviceSecurityGroupInner.fromJson(reader1)); - deserializedDeviceSecurityGroupList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedDeviceSecurityGroupList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDeviceSecurityGroupList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/DiscoveredSecuritySolutionList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/DiscoveredSecuritySolutionList.java deleted file mode 100644 index d47ba4379339..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/DiscoveredSecuritySolutionList.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner; -import java.io.IOException; -import java.util.List; - -/** - * The DiscoveredSecuritySolutionList model. - */ -@Immutable -public final class DiscoveredSecuritySolutionList implements JsonSerializable { - /* - * The value property. - */ - private List value; - - /* - * The URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of DiscoveredSecuritySolutionList class. - */ - private DiscoveredSecuritySolutionList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DiscoveredSecuritySolutionList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DiscoveredSecuritySolutionList 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 DiscoveredSecuritySolutionList. - */ - public static DiscoveredSecuritySolutionList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DiscoveredSecuritySolutionList deserializedDiscoveredSecuritySolutionList - = new DiscoveredSecuritySolutionList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> DiscoveredSecuritySolutionInner.fromJson(reader1)); - deserializedDiscoveredSecuritySolutionList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedDiscoveredSecuritySolutionList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDiscoveredSecuritySolutionList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ExternalSecuritySolutionList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ExternalSecuritySolutionList.java deleted file mode 100644 index 6055b33d9802..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ExternalSecuritySolutionList.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner; -import java.io.IOException; -import java.util.List; - -/** - * The ExternalSecuritySolutionList model. - */ -@Immutable -public final class ExternalSecuritySolutionList implements JsonSerializable { - /* - * The value property. - */ - private List value; - - /* - * The nextLink property. - */ - private String nextLink; - - /** - * Creates an instance of ExternalSecuritySolutionList class. - */ - private ExternalSecuritySolutionList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The nextLink property. - * - * @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(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ExternalSecuritySolutionList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ExternalSecuritySolutionList 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 ExternalSecuritySolutionList. - */ - public static ExternalSecuritySolutionList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ExternalSecuritySolutionList deserializedExternalSecuritySolutionList = new ExternalSecuritySolutionList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ExternalSecuritySolutionInner.fromJson(reader1)); - deserializedExternalSecuritySolutionList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedExternalSecuritySolutionList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedExternalSecuritySolutionList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/GitHubRepositoryListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/GitHubRepositoryListResponse.java deleted file mode 100644 index 16a64dd083be..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/GitHubRepositoryListResponse.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.GitHubRepositoryInner; -import java.io.IOException; -import java.util.List; - -/** - * List of RP resources which supports pagination. - */ -@Immutable -public final class GitHubRepositoryListResponse implements JsonSerializable { - /* - * The GitHubRepository items on this page. - */ - private List value; - - /* - * The link to the next page of items. - */ - private String nextLink; - - /** - * Creates an instance of GitHubRepositoryListResponse class. - */ - private GitHubRepositoryListResponse() { - } - - /** - * Get the value property: The GitHubRepository items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * 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 GitHubRepositoryListResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GitHubRepositoryListResponse 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 GitHubRepositoryListResponse. - */ - public static GitHubRepositoryListResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GitHubRepositoryListResponse deserializedGitHubRepositoryListResponse = new GitHubRepositoryListResponse(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> GitHubRepositoryInner.fromJson(reader1)); - deserializedGitHubRepositoryListResponse.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedGitHubRepositoryListResponse.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGitHubRepositoryListResponse; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/GitLabProjectListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/GitLabProjectListResponse.java deleted file mode 100644 index 92d7e1c4b4fe..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/GitLabProjectListResponse.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.GitLabProjectInner; -import java.io.IOException; -import java.util.List; - -/** - * List of RP resources which supports pagination. - */ -@Immutable -public final class GitLabProjectListResponse implements JsonSerializable { - /* - * The GitLabProject items on this page. - */ - private List value; - - /* - * The link to the next page of items. - */ - private String nextLink; - - /** - * Creates an instance of GitLabProjectListResponse class. - */ - private GitLabProjectListResponse() { - } - - /** - * Get the value property: The GitLabProject items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * 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 GitLabProjectListResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GitLabProjectListResponse 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 GitLabProjectListResponse. - */ - public static GitLabProjectListResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GitLabProjectListResponse deserializedGitLabProjectListResponse = new GitLabProjectListResponse(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> GitLabProjectInner.fromJson(reader1)); - deserializedGitLabProjectListResponse.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedGitLabProjectListResponse.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGitLabProjectListResponse; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/GovernanceAssignmentsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/GovernanceAssignmentsList.java deleted file mode 100644 index 0843d3cb6d9d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/GovernanceAssignmentsList.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.GovernanceAssignmentInner; -import java.io.IOException; -import java.util.List; - -/** - * Page of a governance assignments list. - */ -@Immutable -public final class GovernanceAssignmentsList implements JsonSerializable { - /* - * Collection of governance assignments in this page - */ - private List value; - - /* - * The URI to fetch the next page - */ - private String nextLink; - - /** - * Creates an instance of GovernanceAssignmentsList class. - */ - private GovernanceAssignmentsList() { - } - - /** - * Get the value property: Collection of governance assignments in this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GovernanceAssignmentsList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GovernanceAssignmentsList 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 GovernanceAssignmentsList. - */ - public static GovernanceAssignmentsList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GovernanceAssignmentsList deserializedGovernanceAssignmentsList = new GovernanceAssignmentsList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> GovernanceAssignmentInner.fromJson(reader1)); - deserializedGovernanceAssignmentsList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedGovernanceAssignmentsList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGovernanceAssignmentsList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/GovernanceRuleList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/GovernanceRuleList.java deleted file mode 100644 index f801528ee6c7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/GovernanceRuleList.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import java.io.IOException; -import java.util.List; - -/** - * Page of a governance rules list. - */ -@Immutable -public final class GovernanceRuleList implements JsonSerializable { - /* - * Collection of governance rules in this page - */ - private List value; - - /* - * The URI to fetch the next page - */ - private String nextLink; - - /** - * Creates an instance of GovernanceRuleList class. - */ - private GovernanceRuleList() { - } - - /** - * Get the value property: Collection of governance rules in this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GovernanceRuleList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GovernanceRuleList 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 GovernanceRuleList. - */ - public static GovernanceRuleList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GovernanceRuleList deserializedGovernanceRuleList = new GovernanceRuleList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> GovernanceRuleInner.fromJson(reader1)); - deserializedGovernanceRuleList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedGovernanceRuleList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGovernanceRuleList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/HealthReportsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/HealthReportsList.java deleted file mode 100644 index d07338172e4a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/HealthReportsList.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.HealthReportInner; -import java.io.IOException; -import java.util.List; - -/** - * Page of health reports list. - */ -@Immutable -public final class HealthReportsList implements JsonSerializable { - /* - * The HealthReport items on this page. - */ - private List value; - - /* - * The link to the next page of items. - */ - private String nextLink; - - /** - * Creates an instance of HealthReportsList class. - */ - private HealthReportsList() { - } - - /** - * Get the value property: The HealthReport items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * 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.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of HealthReportsList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of HealthReportsList 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 HealthReportsList. - */ - public static HealthReportsList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - HealthReportsList deserializedHealthReportsList = new HealthReportsList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> HealthReportInner.fromJson(reader1)); - deserializedHealthReportsList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedHealthReportsList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedHealthReportsList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/InformationProtectionPolicyList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/InformationProtectionPolicyList.java deleted file mode 100644 index 3098ba9a94fe..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/InformationProtectionPolicyList.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.InformationProtectionPolicyInner; -import java.io.IOException; -import java.util.List; - -/** - * Information protection policies response. - */ -@Immutable -public final class InformationProtectionPolicyList implements JsonSerializable { - /* - * List of information protection policies - */ - private List value; - - /* - * The URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of InformationProtectionPolicyList class. - */ - private InformationProtectionPolicyList() { - } - - /** - * Get the value property: List of information protection policies. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InformationProtectionPolicyList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InformationProtectionPolicyList 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 InformationProtectionPolicyList. - */ - public static InformationProtectionPolicyList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - InformationProtectionPolicyList deserializedInformationProtectionPolicyList - = new InformationProtectionPolicyList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> InformationProtectionPolicyInner.fromJson(reader1)); - deserializedInformationProtectionPolicyList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedInformationProtectionPolicyList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedInformationProtectionPolicyList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/IoTSecurityAggregatedAlertList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/IoTSecurityAggregatedAlertList.java deleted file mode 100644 index e119034e7902..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/IoTSecurityAggregatedAlertList.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -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.security.fluent.models.IoTSecurityAggregatedAlertInner; -import java.io.IOException; -import java.util.List; - -/** - * List of IoT Security solution aggregated alert data. - */ -@Immutable -public final class IoTSecurityAggregatedAlertList implements JsonSerializable { - /* - * The IoTSecurityAggregatedAlert items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of IoTSecurityAggregatedAlertList class. - */ - private IoTSecurityAggregatedAlertList() { - } - - /** - * Get the value property: The IoTSecurityAggregatedAlert items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property value in model IoTSecurityAggregatedAlertList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(IoTSecurityAggregatedAlertList.class); - - /** - * {@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 IoTSecurityAggregatedAlertList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IoTSecurityAggregatedAlertList 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 IoTSecurityAggregatedAlertList. - */ - public static IoTSecurityAggregatedAlertList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IoTSecurityAggregatedAlertList deserializedIoTSecurityAggregatedAlertList - = new IoTSecurityAggregatedAlertList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> IoTSecurityAggregatedAlertInner.fromJson(reader1)); - deserializedIoTSecurityAggregatedAlertList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedIoTSecurityAggregatedAlertList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedIoTSecurityAggregatedAlertList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/IoTSecurityAggregatedRecommendationList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/IoTSecurityAggregatedRecommendationList.java deleted file mode 100644 index 79fcc61790d7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/IoTSecurityAggregatedRecommendationList.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -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.security.fluent.models.IoTSecurityAggregatedRecommendationInner; -import java.io.IOException; -import java.util.List; - -/** - * List of IoT Security solution aggregated recommendations. - */ -@Immutable -public final class IoTSecurityAggregatedRecommendationList - implements JsonSerializable { - /* - * The IoTSecurityAggregatedRecommendation items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of IoTSecurityAggregatedRecommendationList class. - */ - private IoTSecurityAggregatedRecommendationList() { - } - - /** - * Get the value property: The IoTSecurityAggregatedRecommendation items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property value in model IoTSecurityAggregatedRecommendationList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(IoTSecurityAggregatedRecommendationList.class); - - /** - * {@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 IoTSecurityAggregatedRecommendationList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IoTSecurityAggregatedRecommendationList 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 IoTSecurityAggregatedRecommendationList. - */ - public static IoTSecurityAggregatedRecommendationList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IoTSecurityAggregatedRecommendationList deserializedIoTSecurityAggregatedRecommendationList - = new IoTSecurityAggregatedRecommendationList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> IoTSecurityAggregatedRecommendationInner.fromJson(reader1)); - deserializedIoTSecurityAggregatedRecommendationList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedIoTSecurityAggregatedRecommendationList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedIoTSecurityAggregatedRecommendationList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/IoTSecuritySolutionsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/IoTSecuritySolutionsList.java deleted file mode 100644 index f5ff66a5adcc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/IoTSecuritySolutionsList.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -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.security.fluent.models.IoTSecuritySolutionModelInner; -import java.io.IOException; -import java.util.List; - -/** - * List of IoT Security solutions. - */ -@Immutable -public final class IoTSecuritySolutionsList implements JsonSerializable { - /* - * The IoTSecuritySolutionModel items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of IoTSecuritySolutionsList class. - */ - private IoTSecuritySolutionsList() { - } - - /** - * Get the value property: The IoTSecuritySolutionModel items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model IoTSecuritySolutionsList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(IoTSecuritySolutionsList.class); - - /** - * {@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 IoTSecuritySolutionsList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of IoTSecuritySolutionsList 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 IoTSecuritySolutionsList. - */ - public static IoTSecuritySolutionsList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - IoTSecuritySolutionsList deserializedIoTSecuritySolutionsList = new IoTSecuritySolutionsList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> IoTSecuritySolutionModelInner.fromJson(reader1)); - deserializedIoTSecuritySolutionsList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedIoTSecuritySolutionsList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedIoTSecuritySolutionsList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/JitNetworkAccessPoliciesList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/JitNetworkAccessPoliciesList.java deleted file mode 100644 index 394a912f7b8b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/JitNetworkAccessPoliciesList.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyInner; -import java.io.IOException; -import java.util.List; - -/** - * The JitNetworkAccessPoliciesList model. - */ -@Immutable -public final class JitNetworkAccessPoliciesList implements JsonSerializable { - /* - * The value property. - */ - private List value; - - /* - * The nextLink property. - */ - private String nextLink; - - /** - * Creates an instance of JitNetworkAccessPoliciesList class. - */ - private JitNetworkAccessPoliciesList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The nextLink property. - * - * @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(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of JitNetworkAccessPoliciesList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of JitNetworkAccessPoliciesList 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 JitNetworkAccessPoliciesList. - */ - public static JitNetworkAccessPoliciesList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - JitNetworkAccessPoliciesList deserializedJitNetworkAccessPoliciesList = new JitNetworkAccessPoliciesList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> JitNetworkAccessPolicyInner.fromJson(reader1)); - deserializedJitNetworkAccessPoliciesList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedJitNetworkAccessPoliciesList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedJitNetworkAccessPoliciesList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/OperationListResult.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/OperationListResult.java deleted file mode 100644 index 54133dac7c75..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/OperationListResult.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -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.security.fluent.models.OperationInner; -import java.io.IOException; -import java.util.List; - -/** - * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of - * results. - */ -@Immutable -public final class OperationListResult implements JsonSerializable { - /* - * The Operation items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of OperationListResult class. - */ - private OperationListResult() { - } - - /** - * Get the value property: The Operation items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model OperationListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(OperationListResult.class); - - /** - * {@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 OperationListResult from the JsonReader. - * - * @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 IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the OperationListResult. - */ - 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/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/PrivateEndpointConnectionListResult.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/PrivateEndpointConnectionListResult.java deleted file mode 100644 index 332a14e62fb2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/PrivateEndpointConnectionListResult.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -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.security.fluent.models.PrivateEndpointConnectionInner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a PrivateEndpointConnection list operation. - */ -@Immutable -public final class PrivateEndpointConnectionListResult - implements JsonSerializable { - /* - * The PrivateEndpointConnection items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of PrivateEndpointConnectionListResult class. - */ - private PrivateEndpointConnectionListResult() { - } - - /** - * Get the value property: The PrivateEndpointConnection items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property value in model PrivateEndpointConnectionListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionListResult.class); - - /** - * {@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 PrivateEndpointConnectionListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateEndpointConnectionListResult 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 PrivateEndpointConnectionListResult. - */ - public static PrivateEndpointConnectionListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateEndpointConnectionListResult deserializedPrivateEndpointConnectionListResult - = new PrivateEndpointConnectionListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); - deserializedPrivateEndpointConnectionListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedPrivateEndpointConnectionListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateEndpointConnectionListResult; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/PrivateLinkGroupResourceListResult.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/PrivateLinkGroupResourceListResult.java deleted file mode 100644 index 0aeded1bdc3c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/PrivateLinkGroupResourceListResult.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -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.security.fluent.models.PrivateLinkGroupResourceInner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a PrivateLinkGroupResource list operation. - */ -@Immutable -public final class PrivateLinkGroupResourceListResult implements JsonSerializable { - /* - * The PrivateLinkGroupResource items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of PrivateLinkGroupResourceListResult class. - */ - private PrivateLinkGroupResourceListResult() { - } - - /** - * Get the value property: The PrivateLinkGroupResource items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property value in model PrivateLinkGroupResourceListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkGroupResourceListResult.class); - - /** - * {@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 PrivateLinkGroupResourceListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateLinkGroupResourceListResult 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 PrivateLinkGroupResourceListResult. - */ - public static PrivateLinkGroupResourceListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateLinkGroupResourceListResult deserializedPrivateLinkGroupResourceListResult - = new PrivateLinkGroupResourceListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> PrivateLinkGroupResourceInner.fromJson(reader1)); - deserializedPrivateLinkGroupResourceListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedPrivateLinkGroupResourceListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateLinkGroupResourceListResult; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/PrivateLinksList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/PrivateLinksList.java deleted file mode 100644 index 69709d563dc4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/PrivateLinksList.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.PrivateLinkResourceInner; -import java.io.IOException; -import java.util.List; - -/** - * Paginated list of private link resources. Contains an array of private links and optional pagination information. - */ -@Immutable -public final class PrivateLinksList implements JsonSerializable { - /* - * The PrivateLinkResource items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of PrivateLinksList class. - */ - private PrivateLinksList() { - } - - /** - * Get the value property: The PrivateLinkResource items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * 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.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PrivateLinksList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PrivateLinksList 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 PrivateLinksList. - */ - public static PrivateLinksList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PrivateLinksList deserializedPrivateLinksList = new PrivateLinksList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> PrivateLinkResourceInner.fromJson(reader1)); - deserializedPrivateLinksList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedPrivateLinksList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPrivateLinksList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/RegulatoryComplianceAssessmentList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/RegulatoryComplianceAssessmentList.java deleted file mode 100644 index c4ced636e783..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/RegulatoryComplianceAssessmentList.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -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.security.fluent.models.RegulatoryComplianceAssessmentInner; -import java.io.IOException; -import java.util.List; - -/** - * List of regulatory compliance assessment response. - */ -@Immutable -public final class RegulatoryComplianceAssessmentList implements JsonSerializable { - /* - * The RegulatoryComplianceAssessment items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of RegulatoryComplianceAssessmentList class. - */ - private RegulatoryComplianceAssessmentList() { - } - - /** - * Get the value property: The RegulatoryComplianceAssessment items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property value in model RegulatoryComplianceAssessmentList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(RegulatoryComplianceAssessmentList.class); - - /** - * {@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 RegulatoryComplianceAssessmentList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RegulatoryComplianceAssessmentList 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 RegulatoryComplianceAssessmentList. - */ - public static RegulatoryComplianceAssessmentList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RegulatoryComplianceAssessmentList deserializedRegulatoryComplianceAssessmentList - = new RegulatoryComplianceAssessmentList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> RegulatoryComplianceAssessmentInner.fromJson(reader1)); - deserializedRegulatoryComplianceAssessmentList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedRegulatoryComplianceAssessmentList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRegulatoryComplianceAssessmentList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/RegulatoryComplianceControlList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/RegulatoryComplianceControlList.java deleted file mode 100644 index 808c3c165586..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/RegulatoryComplianceControlList.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -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.security.fluent.models.RegulatoryComplianceControlInner; -import java.io.IOException; -import java.util.List; - -/** - * List of regulatory compliance controls response. - */ -@Immutable -public final class RegulatoryComplianceControlList implements JsonSerializable { - /* - * The RegulatoryComplianceControl items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of RegulatoryComplianceControlList class. - */ - private RegulatoryComplianceControlList() { - } - - /** - * Get the value property: The RegulatoryComplianceControl items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property value in model RegulatoryComplianceControlList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(RegulatoryComplianceControlList.class); - - /** - * {@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 RegulatoryComplianceControlList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RegulatoryComplianceControlList 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 RegulatoryComplianceControlList. - */ - public static RegulatoryComplianceControlList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RegulatoryComplianceControlList deserializedRegulatoryComplianceControlList - = new RegulatoryComplianceControlList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> RegulatoryComplianceControlInner.fromJson(reader1)); - deserializedRegulatoryComplianceControlList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedRegulatoryComplianceControlList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRegulatoryComplianceControlList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/RegulatoryComplianceStandardList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/RegulatoryComplianceStandardList.java deleted file mode 100644 index 44bd46cd266f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/RegulatoryComplianceStandardList.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -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.security.fluent.models.RegulatoryComplianceStandardInner; -import java.io.IOException; -import java.util.List; - -/** - * List of regulatory compliance standards response. - */ -@Immutable -public final class RegulatoryComplianceStandardList implements JsonSerializable { - /* - * The RegulatoryComplianceStandard items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of RegulatoryComplianceStandardList class. - */ - private RegulatoryComplianceStandardList() { - } - - /** - * Get the value property: The RegulatoryComplianceStandard items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property value in model RegulatoryComplianceStandardList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(RegulatoryComplianceStandardList.class); - - /** - * {@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 RegulatoryComplianceStandardList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RegulatoryComplianceStandardList 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 RegulatoryComplianceStandardList. - */ - public static RegulatoryComplianceStandardList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - RegulatoryComplianceStandardList deserializedRegulatoryComplianceStandardList - = new RegulatoryComplianceStandardList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> RegulatoryComplianceStandardInner.fromJson(reader1)); - deserializedRegulatoryComplianceStandardList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedRegulatoryComplianceStandardList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedRegulatoryComplianceStandardList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ScanResults.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ScanResults.java deleted file mode 100644 index bf07a050cc4b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ScanResults.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.ScanResultInner; -import java.io.IOException; -import java.util.List; - -/** - * A list of vulnerability assessment scan results. - */ -@Immutable -public final class ScanResults implements JsonSerializable { - /* - * List of vulnerability assessment scan results. - */ - private List value; - - /* - * The nextLink property. - */ - private String nextLink; - - /** - * Creates an instance of ScanResults class. - */ - private ScanResults() { - } - - /** - * Get the value property: List of vulnerability assessment scan results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The nextLink property. - * - * @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(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ScanResults from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ScanResults 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 ScanResults. - */ - public static ScanResults fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ScanResults deserializedScanResults = new ScanResults(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> ScanResultInner.fromJson(reader1)); - deserializedScanResults.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedScanResults.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedScanResults; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ScansV2.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ScansV2.java deleted file mode 100644 index e5d959d4f8c3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ScansV2.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.ScanV2Inner; -import java.io.IOException; -import java.util.List; - -/** - * A list of vulnerability assessment scan records. - */ -@Immutable -public final class ScansV2 implements JsonSerializable { - /* - * List of vulnerability assessment scan records. - */ - private List value; - - /* - * The nextLink property. - */ - private String nextLink; - - /** - * Creates an instance of ScansV2 class. - */ - private ScansV2() { - } - - /** - * Get the value property: List of vulnerability assessment scan records. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The nextLink property. - * - * @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(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ScansV2 from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ScansV2 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 ScansV2. - */ - public static ScansV2 fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ScansV2 deserializedScansV2 = new ScansV2(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> ScanV2Inner.fromJson(reader1)); - deserializedScansV2.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedScansV2.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedScansV2; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecureScoreControlDefinitionList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecureScoreControlDefinitionList.java deleted file mode 100644 index e2724a9d12e1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecureScoreControlDefinitionList.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner; -import java.io.IOException; -import java.util.List; - -/** - * List of security controls definition. - */ -@Immutable -public final class SecureScoreControlDefinitionList implements JsonSerializable { - /* - * Collection of security control definitions. - */ - private List value; - - /* - * The URL to get the next page of results. - */ - private String nextLink; - - /** - * Creates an instance of SecureScoreControlDefinitionList class. - */ - private SecureScoreControlDefinitionList() { - } - - /** - * Get the value property: Collection of security control definitions. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URL to get 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(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecureScoreControlDefinitionList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecureScoreControlDefinitionList 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 SecureScoreControlDefinitionList. - */ - public static SecureScoreControlDefinitionList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecureScoreControlDefinitionList deserializedSecureScoreControlDefinitionList - = new SecureScoreControlDefinitionList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SecureScoreControlDefinitionItemInner.fromJson(reader1)); - deserializedSecureScoreControlDefinitionList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSecureScoreControlDefinitionList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSecureScoreControlDefinitionList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecureScoreControlList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecureScoreControlList.java deleted file mode 100644 index ba3066a34957..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecureScoreControlList.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDetailsInner; -import java.io.IOException; -import java.util.List; - -/** - * List of security controls. - */ -@Immutable -public final class SecureScoreControlList implements JsonSerializable { - /* - * Collection of security controls in this page - */ - private List value; - - /* - * The URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of SecureScoreControlList class. - */ - private SecureScoreControlList() { - } - - /** - * Get the value property: Collection of security controls in this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecureScoreControlList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecureScoreControlList 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 SecureScoreControlList. - */ - public static SecureScoreControlList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecureScoreControlList deserializedSecureScoreControlList = new SecureScoreControlList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SecureScoreControlDetailsInner.fromJson(reader1)); - deserializedSecureScoreControlList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSecureScoreControlList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSecureScoreControlList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecureScoresList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecureScoresList.java deleted file mode 100644 index fef3f652eb32..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecureScoresList.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.SecureScoreItemInner; -import java.io.IOException; -import java.util.List; - -/** - * List of secure scores. - */ -@Immutable -public final class SecureScoresList implements JsonSerializable { - /* - * Collection of secure scores in this page - */ - private List value; - - /* - * The URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of SecureScoresList class. - */ - private SecureScoresList() { - } - - /** - * Get the value property: Collection of secure scores in this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecureScoresList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecureScoresList 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 SecureScoresList. - */ - public static SecureScoresList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecureScoresList deserializedSecureScoresList = new SecureScoresList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SecureScoreItemInner.fromJson(reader1)); - deserializedSecureScoresList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSecureScoresList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSecureScoresList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityAssessmentList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityAssessmentList.java deleted file mode 100644 index 8e5484b8b1bf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityAssessmentList.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner; -import java.io.IOException; -import java.util.List; - -/** - * Page of a security assessments list. - */ -@Immutable -public final class SecurityAssessmentList implements JsonSerializable { - /* - * Collection of security assessments in this page - */ - private List value; - - /* - * The URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of SecurityAssessmentList class. - */ - private SecurityAssessmentList() { - } - - /** - * Get the value property: Collection of security assessments in this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecurityAssessmentList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityAssessmentList 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 SecurityAssessmentList. - */ - public static SecurityAssessmentList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityAssessmentList deserializedSecurityAssessmentList = new SecurityAssessmentList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SecurityAssessmentResponseInner.fromJson(reader1)); - deserializedSecurityAssessmentList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSecurityAssessmentList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityAssessmentList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityAssessmentMetadataResponseList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityAssessmentMetadataResponseList.java deleted file mode 100644 index 8ec501d3ab25..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityAssessmentMetadataResponseList.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner; -import java.io.IOException; -import java.util.List; - -/** - * List of security assessment metadata. - */ -@Immutable -public final class SecurityAssessmentMetadataResponseList - implements JsonSerializable { - /* - * The value property. - */ - private List value; - - /* - * The URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of SecurityAssessmentMetadataResponseList class. - */ - private SecurityAssessmentMetadataResponseList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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(); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecurityAssessmentMetadataResponseList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityAssessmentMetadataResponseList 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 SecurityAssessmentMetadataResponseList. - */ - public static SecurityAssessmentMetadataResponseList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityAssessmentMetadataResponseList deserializedSecurityAssessmentMetadataResponseList - = new SecurityAssessmentMetadataResponseList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SecurityAssessmentMetadataResponseInner.fromJson(reader1)); - deserializedSecurityAssessmentMetadataResponseList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSecurityAssessmentMetadataResponseList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityAssessmentMetadataResponseList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityConnectorsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityConnectorsList.java deleted file mode 100644 index 2dbc2e6306fa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityConnectorsList.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -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.security.fluent.models.SecurityConnectorInner; -import java.io.IOException; -import java.util.List; - -/** - * List of security connectors response. - */ -@Immutable -public final class SecurityConnectorsList implements JsonSerializable { - /* - * The SecurityConnector items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of SecurityConnectorsList class. - */ - private SecurityConnectorsList() { - } - - /** - * Get the value property: The SecurityConnector items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model SecurityConnectorsList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecurityConnectorsList.class); - - /** - * {@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 SecurityConnectorsList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityConnectorsList 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 SecurityConnectorsList. - */ - public static SecurityConnectorsList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityConnectorsList deserializedSecurityConnectorsList = new SecurityConnectorsList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SecurityConnectorInner.fromJson(reader1)); - deserializedSecurityConnectorsList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSecurityConnectorsList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityConnectorsList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityContactList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityContactList.java deleted file mode 100644 index 4dc3f74e4ddb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityContactList.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -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.security.fluent.models.SecurityContactInner; -import java.io.IOException; -import java.util.List; - -/** - * List of security contacts response. - */ -@Immutable -public final class SecurityContactList implements JsonSerializable { - /* - * The SecurityContact items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of SecurityContactList class. - */ - private SecurityContactList() { - } - - /** - * Get the value property: The SecurityContact items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model SecurityContactList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecurityContactList.class); - - /** - * {@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 SecurityContactList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityContactList 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 SecurityContactList. - */ - public static SecurityContactList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityContactList deserializedSecurityContactList = new SecurityContactList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SecurityContactInner.fromJson(reader1)); - deserializedSecurityContactList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSecurityContactList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityContactList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityOperatorList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityOperatorList.java deleted file mode 100644 index 50d932525d9c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityOperatorList.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -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.security.fluent.models.SecurityOperatorInner; -import java.io.IOException; -import java.util.List; - -/** - * List of SecurityOperator response. - */ -@Immutable -public final class SecurityOperatorList implements JsonSerializable { - /* - * List of SecurityOperator configurations - */ - private List value; - - /** - * Creates an instance of SecurityOperatorList class. - */ - private SecurityOperatorList() { - } - - /** - * Get the value property: List of SecurityOperator configurations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model SecurityOperatorList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecurityOperatorList.class); - - /** - * {@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 SecurityOperatorList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityOperatorList 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 SecurityOperatorList. - */ - public static SecurityOperatorList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityOperatorList deserializedSecurityOperatorList = new SecurityOperatorList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SecurityOperatorInner.fromJson(reader1)); - deserializedSecurityOperatorList.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityOperatorList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecuritySolutionList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecuritySolutionList.java deleted file mode 100644 index 070a23d37f65..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecuritySolutionList.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionInner; -import java.io.IOException; -import java.util.List; - -/** - * The SecuritySolutionList model. - */ -@Immutable -public final class SecuritySolutionList implements JsonSerializable { - /* - * The value property. - */ - private List value; - - /* - * The nextLink property. - */ - private String nextLink; - - /** - * Creates an instance of SecuritySolutionList class. - */ - private SecuritySolutionList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The nextLink property. - * - * @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(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SecuritySolutionList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecuritySolutionList 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 SecuritySolutionList. - */ - public static SecuritySolutionList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecuritySolutionList deserializedSecuritySolutionList = new SecuritySolutionList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SecuritySolutionInner.fromJson(reader1)); - deserializedSecuritySolutionList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSecuritySolutionList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSecuritySolutionList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityStandardList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityStandardList.java deleted file mode 100644 index 0fa9d2815282..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityStandardList.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.SecurityStandardInner; -import java.io.IOException; -import java.util.List; - -/** - * Page of a Standard list. - */ -@Immutable -public final class SecurityStandardList implements JsonSerializable { - /* - * Collection of standards in this page - */ - private List value; - - /* - * The URI to fetch the next page - */ - private String nextLink; - - /** - * Creates an instance of SecurityStandardList class. - */ - private SecurityStandardList() { - } - - /** - * Get the value property: Collection of standards in this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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 SecurityStandardList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityStandardList 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 SecurityStandardList. - */ - public static SecurityStandardList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityStandardList deserializedSecurityStandardList = new SecurityStandardList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SecurityStandardInner.fromJson(reader1)); - deserializedSecurityStandardList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSecurityStandardList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityStandardList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecuritySubAssessmentList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecuritySubAssessmentList.java deleted file mode 100644 index 6984adc35ea3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecuritySubAssessmentList.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.SecuritySubAssessmentInner; -import java.io.IOException; -import java.util.List; - -/** - * List of security sub-assessments. - */ -@Immutable -public final class SecuritySubAssessmentList implements JsonSerializable { - /* - * List of security sub-assessments - */ - private List value; - - /* - * The URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of SecuritySubAssessmentList class. - */ - private SecuritySubAssessmentList() { - } - - /** - * Get the value property: List of security sub-assessments. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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 SecuritySubAssessmentList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecuritySubAssessmentList 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 SecuritySubAssessmentList. - */ - public static SecuritySubAssessmentList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecuritySubAssessmentList deserializedSecuritySubAssessmentList = new SecuritySubAssessmentList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SecuritySubAssessmentInner.fromJson(reader1)); - deserializedSecuritySubAssessmentList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSecuritySubAssessmentList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSecuritySubAssessmentList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityTaskList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityTaskList.java deleted file mode 100644 index 4a6bd3cd2db3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SecurityTaskList.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.SecurityTaskInner; -import java.io.IOException; -import java.util.List; - -/** - * List of security task recommendations. - */ -@Immutable -public final class SecurityTaskList implements JsonSerializable { - /* - * The SecurityTask items on this page - */ - private List value; - - /* - * The URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of SecurityTaskList class. - */ - private SecurityTaskList() { - } - - /** - * Get the value property: The SecurityTask items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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 SecurityTaskList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SecurityTaskList 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 SecurityTaskList. - */ - public static SecurityTaskList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SecurityTaskList deserializedSecurityTaskList = new SecurityTaskList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> SecurityTaskInner.fromJson(reader1)); - deserializedSecurityTaskList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSecurityTaskList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSecurityTaskList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ServerVulnerabilityAssessmentsSettingsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ServerVulnerabilityAssessmentsSettingsList.java deleted file mode 100644 index c369483e8d38..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/ServerVulnerabilityAssessmentsSettingsList.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsSettingInner; -import java.io.IOException; -import java.util.List; - -/** - * A page of a server vulnerability assessments settings list. - */ -@Immutable -public final class ServerVulnerabilityAssessmentsSettingsList - implements JsonSerializable { - /* - * The ServerVulnerabilityAssessmentsSetting items on this page. - */ - private List value; - - /* - * The link to the next page of items. - */ - private String nextLink; - - /** - * Creates an instance of ServerVulnerabilityAssessmentsSettingsList class. - */ - private ServerVulnerabilityAssessmentsSettingsList() { - } - - /** - * Get the value property: The ServerVulnerabilityAssessmentsSetting items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * 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.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ServerVulnerabilityAssessmentsSettingsList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServerVulnerabilityAssessmentsSettingsList 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 ServerVulnerabilityAssessmentsSettingsList. - */ - public static ServerVulnerabilityAssessmentsSettingsList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServerVulnerabilityAssessmentsSettingsList deserializedServerVulnerabilityAssessmentsSettingsList - = new ServerVulnerabilityAssessmentsSettingsList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> ServerVulnerabilityAssessmentsSettingInner.fromJson(reader1)); - deserializedServerVulnerabilityAssessmentsSettingsList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedServerVulnerabilityAssessmentsSettingsList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedServerVulnerabilityAssessmentsSettingsList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SettingsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SettingsList.java deleted file mode 100644 index 4dc7ff7c1715..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/SettingsList.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.SettingInner; -import java.io.IOException; -import java.util.List; - -/** - * Subscription settings list. - */ -@Immutable -public final class SettingsList implements JsonSerializable { - /* - * The settings list. - */ - private List value; - - /* - * The URI to fetch the next page. - */ - private String nextLink; - - /** - * Creates an instance of SettingsList class. - */ - private SettingsList() { - } - - /** - * Get the value property: The settings list. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SettingsList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SettingsList 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 SettingsList. - */ - public static SettingsList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SettingsList deserializedSettingsList = new SettingsList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> SettingInner.fromJson(reader1)); - deserializedSettingsList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSettingsList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSettingsList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/StandardAssignmentsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/StandardAssignmentsList.java deleted file mode 100644 index 32826a0fb6cf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/StandardAssignmentsList.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.StandardAssignmentInner; -import java.io.IOException; -import java.util.List; - -/** - * Page of a standard assignment list. - */ -@Immutable -public final class StandardAssignmentsList implements JsonSerializable { - /* - * Collection of standardAssignments in this page - */ - private List value; - - /* - * The URI to fetch the next page - */ - private String nextLink; - - /** - * Creates an instance of StandardAssignmentsList class. - */ - private StandardAssignmentsList() { - } - - /** - * Get the value property: Collection of standardAssignments in this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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 StandardAssignmentsList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of StandardAssignmentsList 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 StandardAssignmentsList. - */ - public static StandardAssignmentsList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - StandardAssignmentsList deserializedStandardAssignmentsList = new StandardAssignmentsList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> StandardAssignmentInner.fromJson(reader1)); - deserializedStandardAssignmentsList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedStandardAssignmentsList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedStandardAssignmentsList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/StandardList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/StandardList.java deleted file mode 100644 index 1dd7e483f4db..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/StandardList.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.StandardInner; -import java.io.IOException; -import java.util.List; - -/** - * Page of a Standard list. - */ -@Immutable -public final class StandardList implements JsonSerializable { - /* - * Collection of standards in this page - */ - private List value; - - /* - * The URI to fetch the next page - */ - private String nextLink; - - /** - * Creates an instance of StandardList class. - */ - private StandardList() { - } - - /** - * Get the value property: Collection of standards in this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @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 StandardList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of StandardList 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 StandardList. - */ - public static StandardList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - StandardList deserializedStandardList = new StandardList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> StandardInner.fromJson(reader1)); - deserializedStandardList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedStandardList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedStandardList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/TopologyList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/TopologyList.java deleted file mode 100644 index 72828820501f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/TopologyList.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.TopologyResourceInner; -import java.io.IOException; -import java.util.List; - -/** - * The TopologyList model. - */ -@Immutable -public final class TopologyList implements JsonSerializable { - /* - * The value property. - */ - private List value; - - /* - * The nextLink property. - */ - private String nextLink; - - /** - * Creates an instance of TopologyList class. - */ - private TopologyList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The nextLink property. - * - * @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 TopologyList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TopologyList 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 TopologyList. - */ - public static TopologyList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - TopologyList deserializedTopologyList = new TopologyList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> TopologyResourceInner.fromJson(reader1)); - deserializedTopologyList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedTopologyList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedTopologyList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/WorkspaceSettingList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/WorkspaceSettingList.java deleted file mode 100644 index ae7959619984..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/models/WorkspaceSettingList.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.implementation.models; - -import com.azure.core.annotation.Immutable; -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.security.fluent.models.WorkspaceSettingInner; -import java.io.IOException; -import java.util.List; - -/** - * List of workspace settings response. - */ -@Immutable -public final class WorkspaceSettingList implements JsonSerializable { - /* - * The WorkspaceSetting items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of WorkspaceSettingList class. - */ - private WorkspaceSettingList() { - } - - /** - * Get the value property: The WorkspaceSetting items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model WorkspaceSettingList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(WorkspaceSettingList.class); - - /** - * {@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 WorkspaceSettingList from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WorkspaceSettingList 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 WorkspaceSettingList. - */ - public static WorkspaceSettingList fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WorkspaceSettingList deserializedWorkspaceSettingList = new WorkspaceSettingList(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> WorkspaceSettingInner.fromJson(reader1)); - deserializedWorkspaceSettingList.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedWorkspaceSettingList.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedWorkspaceSettingList; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/package-info.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/package-info.java deleted file mode 100644 index 121b88bb290f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// 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 Security. - * API spec for Microsoft.Security (Azure Security Center) alerts resource provider. - */ -package com.azure.resourcemanager.security.implementation; diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityState.java deleted file mode 100644 index 4d1ffa9ecccf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityState.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The connectivity state of the external AAD solution. - */ -public final class AadConnectivityState extends ExpandableStringEnum { - /** - * Discovered. - */ - public static final AadConnectivityState DISCOVERED = fromString("Discovered"); - - /** - * NotLicensed. - */ - public static final AadConnectivityState NOT_LICENSED = fromString("NotLicensed"); - - /** - * Connected. - */ - public static final AadConnectivityState CONNECTED = fromString("Connected"); - - /** - * Creates a new instance of AadConnectivityState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AadConnectivityState() { - } - - /** - * Creates or finds a AadConnectivityState from its string representation. - * - * @param name a name to look for. - * @return the corresponding AadConnectivityState. - */ - public static AadConnectivityState fromString(String name) { - return fromString(name, AadConnectivityState.class); - } - - /** - * Gets known AadConnectivityState values. - * - * @return known AadConnectivityState values. - */ - public static Collection values() { - return values(AadConnectivityState.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadExternalSecuritySolution.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadExternalSecuritySolution.java deleted file mode 100644 index 34f05e9ad366..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadExternalSecuritySolution.java +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner; -import java.io.IOException; - -/** - * Represents an AAD identity protection solution which sends logs to an OMS workspace. - */ -@Immutable -public final class AadExternalSecuritySolution extends ExternalSecuritySolutionInner { - /* - * The kind of the external solution - */ - private ExternalSecuritySolutionKind kind = ExternalSecuritySolutionKind.AAD; - - /* - * The external security solution properties for AAD solutions - */ - private AadSolutionProperties properties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * Location where the resource is stored - */ - private String location; - - /* - * 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 AadExternalSecuritySolution class. - */ - private AadExternalSecuritySolution() { - } - - /** - * Get the kind property: The kind of the external solution. - * - * @return the kind value. - */ - @Override - public ExternalSecuritySolutionKind kind() { - return this.kind; - } - - /** - * Get the properties property: The external security solution properties for AAD solutions. - * - * @return the properties value. - */ - @Override - public AadSolutionProperties properties() { - return this.properties; - } - - /** - * 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 location property: Location where the resource is stored. - * - * @return the location value. - */ - @Override - public String location() { - return this.location; - } - - /** - * 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. - */ - @Override - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AadExternalSecuritySolution from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AadExternalSecuritySolution 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 AadExternalSecuritySolution. - */ - public static AadExternalSecuritySolution fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AadExternalSecuritySolution deserializedAadExternalSecuritySolution = new AadExternalSecuritySolution(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAadExternalSecuritySolution.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAadExternalSecuritySolution.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAadExternalSecuritySolution.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedAadExternalSecuritySolution.location = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedAadExternalSecuritySolution.systemData = SystemData.fromJson(reader); - } else if ("kind".equals(fieldName)) { - deserializedAadExternalSecuritySolution.kind - = ExternalSecuritySolutionKind.fromString(reader.getString()); - } else if ("properties".equals(fieldName)) { - deserializedAadExternalSecuritySolution.properties = AadSolutionProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAadExternalSecuritySolution; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadSolutionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadSolutionProperties.java deleted file mode 100644 index 295881ce7644..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadSolutionProperties.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * The external security solution properties for AAD solutions. - */ -@Immutable -public final class AadSolutionProperties extends ExternalSecuritySolutionProperties { - /* - * The connectivity state of the external AAD solution - */ - private AadConnectivityState connectivityState; - - /* - * The solution properties (correspond to the solution kind) - */ - private Map additionalProperties; - - /* - * Represents an OMS workspace to which the solution is connected - */ - private ConnectedWorkspace workspace; - - /* - * The deviceType property. - */ - private String deviceType; - - /* - * The deviceVendor property. - */ - private String deviceVendor; - - /** - * Creates an instance of AadSolutionProperties class. - */ - private AadSolutionProperties() { - } - - /** - * Get the connectivityState property: The connectivity state of the external AAD solution. - * - * @return the connectivityState value. - */ - public AadConnectivityState connectivityState() { - return this.connectivityState; - } - - /** - * Get the additionalProperties property: The solution properties (correspond to the solution kind). - * - * @return the additionalProperties value. - */ - @Override - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Get the workspace property: Represents an OMS workspace to which the solution is connected. - * - * @return the workspace value. - */ - @Override - public ConnectedWorkspace workspace() { - return this.workspace; - } - - /** - * Get the deviceType property: The deviceType property. - * - * @return the deviceType value. - */ - @Override - public String deviceType() { - return this.deviceType; - } - - /** - * Get the deviceVendor property: The deviceVendor property. - * - * @return the deviceVendor value. - */ - @Override - public String deviceVendor() { - return this.deviceVendor; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (workspace() != null) { - workspace().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("deviceVendor", deviceVendor()); - jsonWriter.writeStringField("deviceType", deviceType()); - jsonWriter.writeJsonField("workspace", workspace()); - jsonWriter.writeStringField("connectivityState", - this.connectivityState == null ? null : this.connectivityState.toString()); - if (additionalProperties() != null) { - for (Map.Entry additionalProperty : additionalProperties().entrySet()) { - jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); - } - } - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AadSolutionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AadSolutionProperties 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 AadSolutionProperties. - */ - public static AadSolutionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AadSolutionProperties deserializedAadSolutionProperties = new AadSolutionProperties(); - Map additionalProperties = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("deviceVendor".equals(fieldName)) { - deserializedAadSolutionProperties.deviceVendor = reader.getString(); - } else if ("deviceType".equals(fieldName)) { - deserializedAadSolutionProperties.deviceType = reader.getString(); - } else if ("workspace".equals(fieldName)) { - deserializedAadSolutionProperties.workspace = ConnectedWorkspace.fromJson(reader); - } else if ("connectivityState".equals(fieldName)) { - deserializedAadSolutionProperties.connectivityState - = AadConnectivityState.fromString(reader.getString()); - } else { - if (additionalProperties == null) { - additionalProperties = new LinkedHashMap<>(); - } - - additionalProperties.put(fieldName, reader.readUntyped()); - } - } - deserializedAadSolutionProperties.additionalProperties = additionalProperties; - - return deserializedAadSolutionProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AccessTokenAuthentication.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AccessTokenAuthentication.java deleted file mode 100644 index f498b355d274..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AccessTokenAuthentication.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The environment authentication details. - */ -@Fluent -public final class AccessTokenAuthentication extends Authentication { - /* - * The authentication type - */ - private AuthenticationType authenticationType = AuthenticationType.ACCESS_TOKEN; - - /* - * The user name that will be used while authenticating with the onboarded environment - */ - private String username; - - /* - * The access token that will be used while authenticating with the onboarded environment - */ - private String accessToken; - - /** - * Creates an instance of AccessTokenAuthentication class. - */ - public AccessTokenAuthentication() { - } - - /** - * Get the authenticationType property: The authentication type. - * - * @return the authenticationType value. - */ - @Override - public AuthenticationType authenticationType() { - return this.authenticationType; - } - - /** - * Get the username property: The user name that will be used while authenticating with the onboarded environment. - * - * @return the username value. - */ - public String username() { - return this.username; - } - - /** - * Set the username property: The user name that will be used while authenticating with the onboarded environment. - * - * @param username the username value to set. - * @return the AccessTokenAuthentication object itself. - */ - public AccessTokenAuthentication withUsername(String username) { - this.username = username; - return this; - } - - /** - * Get the accessToken property: The access token that will be used while authenticating with the onboarded - * environment. - * - * @return the accessToken value. - */ - public String accessToken() { - return this.accessToken; - } - - /** - * Set the accessToken property: The access token that will be used while authenticating with the onboarded - * environment. - * - * @param accessToken the accessToken value to set. - * @return the AccessTokenAuthentication object itself. - */ - public AccessTokenAuthentication withAccessToken(String accessToken) { - this.accessToken = accessToken; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("authenticationType", - this.authenticationType == null ? null : this.authenticationType.toString()); - jsonWriter.writeStringField("username", this.username); - jsonWriter.writeStringField("accessToken", this.accessToken); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AccessTokenAuthentication from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AccessTokenAuthentication 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 AccessTokenAuthentication. - */ - public static AccessTokenAuthentication fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AccessTokenAuthentication deserializedAccessTokenAuthentication = new AccessTokenAuthentication(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("authenticationType".equals(fieldName)) { - deserializedAccessTokenAuthentication.authenticationType - = AuthenticationType.fromString(reader.getString()); - } else if ("username".equals(fieldName)) { - deserializedAccessTokenAuthentication.username = reader.getString(); - } else if ("accessToken".equals(fieldName)) { - deserializedAccessTokenAuthentication.accessToken = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAccessTokenAuthentication; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionType.java deleted file mode 100644 index 4d67f6904b89..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionType.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Enum. Indicates the action type. - */ -public final class ActionType extends ExpandableStringEnum { - /** - * LogicApp. - */ - public static final ActionType LOGIC_APP = fromString("LogicApp"); - - /** - * EventHub. - */ - public static final ActionType EVENT_HUB = fromString("EventHub"); - - /** - * Workspace. - */ - public static final ActionType WORKSPACE = fromString("Workspace"); - - /** - * Internal. - */ - public static final ActionType INTERNAL = fromString("Internal"); - - /** - * Creates a new instance of ActionType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ActionType() { - } - - /** - * Creates or finds a ActionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ActionType. - */ - public static ActionType fromString(String name) { - return fromString(name, ActionType.class); - } - - /** - * Gets known ActionType values. - * - * @return known ActionType values. - */ - public static Collection values() { - return values(ActionType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediation.java deleted file mode 100644 index 724b6b25a5f6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediation.java +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * Configuration payload for PR Annotations. - */ -@Fluent -public final class ActionableRemediation implements JsonSerializable { - /* - * ActionableRemediation Setting. - * None - the setting was never set. - * Enabled - ActionableRemediation is enabled. - * Disabled - ActionableRemediation is disabled. - */ - private ActionableRemediationState state; - - /* - * Gets or sets list of categories and severity levels. - */ - private List categoryConfigurations; - - /* - * Repository branch configuration for PR Annotations. - */ - private TargetBranchConfiguration branchConfiguration; - - /* - * Update Settings. - * - * Enabled - Resource should inherit configurations from parent. - * Disabled - Resource should not inherit configurations from parent. - */ - private InheritFromParentState inheritFromParentState; - - /** - * Creates an instance of ActionableRemediation class. - */ - public ActionableRemediation() { - } - - /** - * Get the state property: ActionableRemediation Setting. - * None - the setting was never set. - * Enabled - ActionableRemediation is enabled. - * Disabled - ActionableRemediation is disabled. - * - * @return the state value. - */ - public ActionableRemediationState state() { - return this.state; - } - - /** - * Set the state property: ActionableRemediation Setting. - * None - the setting was never set. - * Enabled - ActionableRemediation is enabled. - * Disabled - ActionableRemediation is disabled. - * - * @param state the state value to set. - * @return the ActionableRemediation object itself. - */ - public ActionableRemediation withState(ActionableRemediationState state) { - this.state = state; - return this; - } - - /** - * Get the categoryConfigurations property: Gets or sets list of categories and severity levels. - * - * @return the categoryConfigurations value. - */ - public List categoryConfigurations() { - return this.categoryConfigurations; - } - - /** - * Set the categoryConfigurations property: Gets or sets list of categories and severity levels. - * - * @param categoryConfigurations the categoryConfigurations value to set. - * @return the ActionableRemediation object itself. - */ - public ActionableRemediation withCategoryConfigurations(List categoryConfigurations) { - this.categoryConfigurations = categoryConfigurations; - return this; - } - - /** - * Get the branchConfiguration property: Repository branch configuration for PR Annotations. - * - * @return the branchConfiguration value. - */ - public TargetBranchConfiguration branchConfiguration() { - return this.branchConfiguration; - } - - /** - * Set the branchConfiguration property: Repository branch configuration for PR Annotations. - * - * @param branchConfiguration the branchConfiguration value to set. - * @return the ActionableRemediation object itself. - */ - public ActionableRemediation withBranchConfiguration(TargetBranchConfiguration branchConfiguration) { - this.branchConfiguration = branchConfiguration; - return this; - } - - /** - * Get the inheritFromParentState property: Update Settings. - * - * Enabled - Resource should inherit configurations from parent. - * Disabled - Resource should not inherit configurations from parent. - * - * @return the inheritFromParentState value. - */ - public InheritFromParentState inheritFromParentState() { - return this.inheritFromParentState; - } - - /** - * Set the inheritFromParentState property: Update Settings. - * - * Enabled - Resource should inherit configurations from parent. - * Disabled - Resource should not inherit configurations from parent. - * - * @param inheritFromParentState the inheritFromParentState value to set. - * @return the ActionableRemediation object itself. - */ - public ActionableRemediation withInheritFromParentState(InheritFromParentState inheritFromParentState) { - this.inheritFromParentState = inheritFromParentState; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (categoryConfigurations() != null) { - categoryConfigurations().forEach(e -> e.validate()); - } - if (branchConfiguration() != null) { - branchConfiguration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); - jsonWriter.writeArrayField("categoryConfigurations", this.categoryConfigurations, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("branchConfiguration", this.branchConfiguration); - jsonWriter.writeStringField("inheritFromParentState", - this.inheritFromParentState == null ? null : this.inheritFromParentState.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ActionableRemediation from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ActionableRemediation 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 ActionableRemediation. - */ - public static ActionableRemediation fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ActionableRemediation deserializedActionableRemediation = new ActionableRemediation(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("state".equals(fieldName)) { - deserializedActionableRemediation.state = ActionableRemediationState.fromString(reader.getString()); - } else if ("categoryConfigurations".equals(fieldName)) { - List categoryConfigurations - = reader.readArray(reader1 -> CategoryConfiguration.fromJson(reader1)); - deserializedActionableRemediation.categoryConfigurations = categoryConfigurations; - } else if ("branchConfiguration".equals(fieldName)) { - deserializedActionableRemediation.branchConfiguration = TargetBranchConfiguration.fromJson(reader); - } else if ("inheritFromParentState".equals(fieldName)) { - deserializedActionableRemediation.inheritFromParentState - = InheritFromParentState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedActionableRemediation; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediationState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediationState.java deleted file mode 100644 index 5cdf3beb56b7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionableRemediationState.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * ActionableRemediation Setting. - * None - the setting was never set. - * Enabled - ActionableRemediation is enabled. - * Disabled - ActionableRemediation is disabled. - */ -public final class ActionableRemediationState extends ExpandableStringEnum { - /** - * None. - */ - public static final ActionableRemediationState NONE = fromString("None"); - - /** - * Disabled. - */ - public static final ActionableRemediationState DISABLED = fromString("Disabled"); - - /** - * Enabled. - */ - public static final ActionableRemediationState ENABLED = fromString("Enabled"); - - /** - * Creates a new instance of ActionableRemediationState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ActionableRemediationState() { - } - - /** - * Creates or finds a ActionableRemediationState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ActionableRemediationState. - */ - public static ActionableRemediationState fromString(String name) { - return fromString(name, ActionableRemediationState.class); - } - - /** - * Gets known ActionableRemediationState values. - * - * @return known ActionableRemediationState values. - */ - public static Collection values() { - return values(ActionableRemediationState.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalData.java deleted file mode 100644 index c276f3b1bf08..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalData.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Details of the sub-assessment. - */ -@Immutable -public class AdditionalData implements JsonSerializable { - /* - * Sub-assessment resource type - */ - private AssessedResourceType assessedResourceType = AssessedResourceType.fromString("AdditionalData"); - - /** - * Creates an instance of AdditionalData class. - */ - protected AdditionalData() { - } - - /** - * Get the assessedResourceType property: Sub-assessment resource type. - * - * @return the assessedResourceType value. - */ - public AssessedResourceType assessedResourceType() { - return this.assessedResourceType; - } - - /** - * 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("assessedResourceType", - this.assessedResourceType == null ? null : this.assessedResourceType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AdditionalData from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AdditionalData 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 AdditionalData. - */ - public static AdditionalData fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("assessedResourceType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("SqlServerVulnerability".equals(discriminatorValue)) { - return SqlServerVulnerabilityProperties.fromJson(readerToUse.reset()); - } else if ("ContainerRegistryVulnerability".equals(discriminatorValue)) { - return ContainerRegistryVulnerabilityProperties.fromJson(readerToUse.reset()); - } else if ("ServerVulnerabilityAssessment".equals(discriminatorValue)) { - return ServerVulnerabilityProperties.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AdditionalData fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AdditionalData deserializedAdditionalData = new AdditionalData(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("assessedResourceType".equals(fieldName)) { - deserializedAdditionalData.assessedResourceType - = AssessedResourceType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAdditionalData; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspaceDataType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspaceDataType.java deleted file mode 100644 index 5f2e523fe5fd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspaceDataType.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Data types sent to workspace. - */ -public final class AdditionalWorkspaceDataType extends ExpandableStringEnum { - /** - * Alerts. - */ - public static final AdditionalWorkspaceDataType ALERTS = fromString("Alerts"); - - /** - * RawEvents. - */ - public static final AdditionalWorkspaceDataType RAW_EVENTS = fromString("RawEvents"); - - /** - * Creates a new instance of AdditionalWorkspaceDataType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AdditionalWorkspaceDataType() { - } - - /** - * Creates or finds a AdditionalWorkspaceDataType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AdditionalWorkspaceDataType. - */ - public static AdditionalWorkspaceDataType fromString(String name) { - return fromString(name, AdditionalWorkspaceDataType.class); - } - - /** - * Gets known AdditionalWorkspaceDataType values. - * - * @return known AdditionalWorkspaceDataType values. - */ - public static Collection values() { - return values(AdditionalWorkspaceDataType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspaceType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspaceType.java deleted file mode 100644 index a022f9dddfb4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspaceType.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Workspace type. - */ -public final class AdditionalWorkspaceType extends ExpandableStringEnum { - /** - * Sentinel. - */ - public static final AdditionalWorkspaceType SENTINEL = fromString("Sentinel"); - - /** - * Creates a new instance of AdditionalWorkspaceType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AdditionalWorkspaceType() { - } - - /** - * Creates or finds a AdditionalWorkspaceType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AdditionalWorkspaceType. - */ - public static AdditionalWorkspaceType fromString(String name) { - return fromString(name, AdditionalWorkspaceType.class); - } - - /** - * Gets known AdditionalWorkspaceType values. - * - * @return known AdditionalWorkspaceType values. - */ - public static Collection values() { - return values(AdditionalWorkspaceType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspacesProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspacesProperties.java deleted file mode 100644 index 403267d404ca..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspacesProperties.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 the additional workspaces. - */ -@Fluent -public final class AdditionalWorkspacesProperties implements JsonSerializable { - /* - * Workspace resource id - */ - private String workspace; - - /* - * Workspace type. - */ - private AdditionalWorkspaceType type; - - /* - * List of data types sent to workspace - */ - private List dataTypes; - - /** - * Creates an instance of AdditionalWorkspacesProperties class. - */ - public AdditionalWorkspacesProperties() { - } - - /** - * Get the workspace property: Workspace resource id. - * - * @return the workspace value. - */ - public String workspace() { - return this.workspace; - } - - /** - * Set the workspace property: Workspace resource id. - * - * @param workspace the workspace value to set. - * @return the AdditionalWorkspacesProperties object itself. - */ - public AdditionalWorkspacesProperties withWorkspace(String workspace) { - this.workspace = workspace; - return this; - } - - /** - * Get the type property: Workspace type. - * - * @return the type value. - */ - public AdditionalWorkspaceType type() { - return this.type; - } - - /** - * Set the type property: Workspace type. - * - * @param type the type value to set. - * @return the AdditionalWorkspacesProperties object itself. - */ - public AdditionalWorkspacesProperties withType(AdditionalWorkspaceType type) { - this.type = type; - return this; - } - - /** - * Get the dataTypes property: List of data types sent to workspace. - * - * @return the dataTypes value. - */ - public List dataTypes() { - return this.dataTypes; - } - - /** - * Set the dataTypes property: List of data types sent to workspace. - * - * @param dataTypes the dataTypes value to set. - * @return the AdditionalWorkspacesProperties object itself. - */ - public AdditionalWorkspacesProperties withDataTypes(List dataTypes) { - this.dataTypes = dataTypes; - 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("workspace", this.workspace); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeArrayField("dataTypes", this.dataTypes, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AdditionalWorkspacesProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AdditionalWorkspacesProperties 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 AdditionalWorkspacesProperties. - */ - public static AdditionalWorkspacesProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AdditionalWorkspacesProperties deserializedAdditionalWorkspacesProperties - = new AdditionalWorkspacesProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("workspace".equals(fieldName)) { - deserializedAdditionalWorkspacesProperties.workspace = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAdditionalWorkspacesProperties.type - = AdditionalWorkspaceType.fromString(reader.getString()); - } else if ("dataTypes".equals(fieldName)) { - List dataTypes - = reader.readArray(reader1 -> AdditionalWorkspaceDataType.fromString(reader1.getString())); - deserializedAdditionalWorkspacesProperties.dataTypes = dataTypes; - } else { - reader.skipChildren(); - } - } - - return deserializedAdditionalWorkspacesProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdvancedThreatProtectionSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdvancedThreatProtectionSetting.java deleted file mode 100644 index 1cce0b2655bd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdvancedThreatProtectionSetting.java +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AdvancedThreatProtectionSettingInner; - -/** - * An immutable client-side representation of AdvancedThreatProtectionSetting. - */ -public interface AdvancedThreatProtectionSetting { - /** - * 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 isEnabled property: Indicates whether Advanced Threat Protection is enabled. - * - * @return the isEnabled value. - */ - Boolean isEnabled(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AdvancedThreatProtectionSettingInner object. - * - * @return the inner object. - */ - AdvancedThreatProtectionSettingInner innerModel(); - - /** - * The entirety of the AdvancedThreatProtectionSetting definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { - } - - /** - * The AdvancedThreatProtectionSetting definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the AdvancedThreatProtectionSetting definition. - */ - interface Blank extends WithScope { - } - - /** - * The stage of the AdvancedThreatProtectionSetting definition allowing to specify parent resource. - */ - interface WithScope { - /** - * Specifies resourceId. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @return the next definition stage. - */ - WithCreate withExistingResourceId(String resourceId); - } - - /** - * The stage of the AdvancedThreatProtectionSetting 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.WithIsEnabled { - /** - * Executes the create request. - * - * @return the created resource. - */ - AdvancedThreatProtectionSetting create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - AdvancedThreatProtectionSetting create(Context context); - } - - /** - * The stage of the AdvancedThreatProtectionSetting definition allowing to specify isEnabled. - */ - interface WithIsEnabled { - /** - * Specifies the isEnabled property: Indicates whether Advanced Threat Protection is enabled.. - * - * @param isEnabled Indicates whether Advanced Threat Protection is enabled. - * @return the next definition stage. - */ - WithCreate withIsEnabled(Boolean isEnabled); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - AdvancedThreatProtectionSetting refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - AdvancedThreatProtectionSetting refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdvancedThreatProtections.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdvancedThreatProtections.java deleted file mode 100644 index 0129d924ff79..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdvancedThreatProtections.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of AdvancedThreatProtections. - */ -public interface AdvancedThreatProtections { - /** - * Gets the Advanced Threat Protection settings for the specified resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 Advanced Threat Protection settings for the specified resource along with {@link Response}. - */ - Response getWithResponse(String resourceId, Context context); - - /** - * Gets the Advanced Threat Protection settings for the specified resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 Advanced Threat Protection settings for the specified resource. - */ - AdvancedThreatProtectionSetting get(String resourceId); - - /** - * Gets the Advanced Threat Protection settings for the specified resource. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advanced Threat Protection settings for the specified resource along with {@link Response}. - */ - AdvancedThreatProtectionSetting getById(String id); - - /** - * Gets the Advanced Threat Protection settings for the specified resource. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advanced Threat Protection settings for the specified resource along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new AdvancedThreatProtectionSetting resource. - * - * @return the first stage of the new AdvancedThreatProtectionSetting definition. - */ - AdvancedThreatProtectionSetting.DefinitionStages.Blank define(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AgentlessConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AgentlessConfiguration.java deleted file mode 100644 index 886250ccc647..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AgentlessConfiguration.java +++ /dev/null @@ -1,220 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * Details about Agentless configuration. - */ -@Fluent -public final class AgentlessConfiguration implements JsonSerializable { - /* - * Agentless Enablement states. - */ - private AgentlessEnablement agentlessEnabled; - - /* - * AutoDiscovery states. - */ - private AutoDiscovery agentlessAutoDiscovery; - - /* - * Gets or sets the scanners for the connector. - */ - private List scanners; - - /* - * Types for inventory list. - */ - private InventoryListKind inventoryListType; - - /* - * Gets or sets the inventory list for inclusion or exclusion from Agentless. - * Will be ignored if agentless auto-discovery is enabled. - */ - private List inventoryList; - - /** - * Creates an instance of AgentlessConfiguration class. - */ - public AgentlessConfiguration() { - } - - /** - * Get the agentlessEnabled property: Agentless Enablement states. - * - * @return the agentlessEnabled value. - */ - public AgentlessEnablement agentlessEnabled() { - return this.agentlessEnabled; - } - - /** - * Set the agentlessEnabled property: Agentless Enablement states. - * - * @param agentlessEnabled the agentlessEnabled value to set. - * @return the AgentlessConfiguration object itself. - */ - public AgentlessConfiguration withAgentlessEnabled(AgentlessEnablement agentlessEnabled) { - this.agentlessEnabled = agentlessEnabled; - return this; - } - - /** - * Get the agentlessAutoDiscovery property: AutoDiscovery states. - * - * @return the agentlessAutoDiscovery value. - */ - public AutoDiscovery agentlessAutoDiscovery() { - return this.agentlessAutoDiscovery; - } - - /** - * Set the agentlessAutoDiscovery property: AutoDiscovery states. - * - * @param agentlessAutoDiscovery the agentlessAutoDiscovery value to set. - * @return the AgentlessConfiguration object itself. - */ - public AgentlessConfiguration withAgentlessAutoDiscovery(AutoDiscovery agentlessAutoDiscovery) { - this.agentlessAutoDiscovery = agentlessAutoDiscovery; - return this; - } - - /** - * Get the scanners property: Gets or sets the scanners for the connector. - * - * @return the scanners value. - */ - public List scanners() { - return this.scanners; - } - - /** - * Set the scanners property: Gets or sets the scanners for the connector. - * - * @param scanners the scanners value to set. - * @return the AgentlessConfiguration object itself. - */ - public AgentlessConfiguration withScanners(List scanners) { - this.scanners = scanners; - return this; - } - - /** - * Get the inventoryListType property: Types for inventory list. - * - * @return the inventoryListType value. - */ - public InventoryListKind inventoryListType() { - return this.inventoryListType; - } - - /** - * Set the inventoryListType property: Types for inventory list. - * - * @param inventoryListType the inventoryListType value to set. - * @return the AgentlessConfiguration object itself. - */ - public AgentlessConfiguration withInventoryListType(InventoryListKind inventoryListType) { - this.inventoryListType = inventoryListType; - return this; - } - - /** - * Get the inventoryList property: Gets or sets the inventory list for inclusion or exclusion from Agentless. - * Will be ignored if agentless auto-discovery is enabled. - * - * @return the inventoryList value. - */ - public List inventoryList() { - return this.inventoryList; - } - - /** - * Set the inventoryList property: Gets or sets the inventory list for inclusion or exclusion from Agentless. - * Will be ignored if agentless auto-discovery is enabled. - * - * @param inventoryList the inventoryList value to set. - * @return the AgentlessConfiguration object itself. - */ - public AgentlessConfiguration withInventoryList(List inventoryList) { - this.inventoryList = inventoryList; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (inventoryList() != null) { - inventoryList().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("agentlessEnabled", - this.agentlessEnabled == null ? null : this.agentlessEnabled.toString()); - jsonWriter.writeStringField("agentlessAutoDiscovery", - this.agentlessAutoDiscovery == null ? null : this.agentlessAutoDiscovery.toString()); - jsonWriter.writeArrayField("scanners", this.scanners, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("inventoryListType", - this.inventoryListType == null ? null : this.inventoryListType.toString()); - jsonWriter.writeArrayField("inventoryList", this.inventoryList, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AgentlessConfiguration from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AgentlessConfiguration 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 AgentlessConfiguration. - */ - public static AgentlessConfiguration fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AgentlessConfiguration deserializedAgentlessConfiguration = new AgentlessConfiguration(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("agentlessEnabled".equals(fieldName)) { - deserializedAgentlessConfiguration.agentlessEnabled - = AgentlessEnablement.fromString(reader.getString()); - } else if ("agentlessAutoDiscovery".equals(fieldName)) { - deserializedAgentlessConfiguration.agentlessAutoDiscovery - = AutoDiscovery.fromString(reader.getString()); - } else if ("scanners".equals(fieldName)) { - List scanners = reader.readArray(reader1 -> reader1.getString()); - deserializedAgentlessConfiguration.scanners = scanners; - } else if ("inventoryListType".equals(fieldName)) { - deserializedAgentlessConfiguration.inventoryListType - = InventoryListKind.fromString(reader.getString()); - } else if ("inventoryList".equals(fieldName)) { - List inventoryList = reader.readArray(reader1 -> InventoryList.fromJson(reader1)); - deserializedAgentlessConfiguration.inventoryList = inventoryList; - } else { - reader.skipChildren(); - } - } - - return deserializedAgentlessConfiguration; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AgentlessEnablement.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AgentlessEnablement.java deleted file mode 100644 index ab8d0636cafd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AgentlessEnablement.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Agentless Enablement states. - */ -public final class AgentlessEnablement extends ExpandableStringEnum { - /** - * Disabled. - */ - public static final AgentlessEnablement DISABLED = fromString("Disabled"); - - /** - * Enabled. - */ - public static final AgentlessEnablement ENABLED = fromString("Enabled"); - - /** - * NotApplicable. - */ - public static final AgentlessEnablement NOT_APPLICABLE = fromString("NotApplicable"); - - /** - * Creates a new instance of AgentlessEnablement value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AgentlessEnablement() { - } - - /** - * Creates or finds a AgentlessEnablement from its string representation. - * - * @param name a name to look for. - * @return the corresponding AgentlessEnablement. - */ - public static AgentlessEnablement fromString(String name) { - return fromString(name, AgentlessEnablement.class); - } - - /** - * Gets known AgentlessEnablement values. - * - * @return known AgentlessEnablement values. - */ - public static Collection values() { - return values(AgentlessEnablement.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alert.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alert.java deleted file mode 100644 index 0bdaea204ea3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alert.java +++ /dev/null @@ -1,251 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.AlertInner; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** - * An immutable client-side representation of Alert. - */ -public interface Alert { - /** - * 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 version property: Schema version. - * - * @return the version value. - */ - String version(); - - /** - * Gets the alertType property: Unique identifier for the detection logic (all alert instances from the same - * detection logic will have the same alertType). - * - * @return the alertType value. - */ - String alertType(); - - /** - * Gets the systemAlertId property: Unique identifier for the alert. - * - * @return the systemAlertId value. - */ - String systemAlertId(); - - /** - * Gets the productComponentName property: The name of Azure Security Center pricing tier which powering this alert. - * Learn more: https://docs.microsoft.com/en-us/azure/security-center/security-center-pricing. - * - * @return the productComponentName value. - */ - String productComponentName(); - - /** - * Gets the alertDisplayName property: The display name of the alert. - * - * @return the alertDisplayName value. - */ - String alertDisplayName(); - - /** - * Gets the description property: Description of the suspicious activity that was detected. - * - * @return the description value. - */ - String description(); - - /** - * Gets the severity property: The risk level of the threat that was detected. Learn more: - * https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified. - * - * @return the severity value. - */ - AlertSeverity severity(); - - /** - * Gets the intent property: The kill chain related intent behind the alert. For list of supported values, and - * explanations of Azure Security Center's supported kill chain intents. - * - * @return the intent value. - */ - Intent intent(); - - /** - * Gets the startTimeUtc property: The UTC time of the first event or activity included in the alert in ISO8601 - * format. - * - * @return the startTimeUtc value. - */ - OffsetDateTime startTimeUtc(); - - /** - * Gets the endTimeUtc property: The UTC time of the last event or activity included in the alert in ISO8601 format. - * - * @return the endTimeUtc value. - */ - OffsetDateTime endTimeUtc(); - - /** - * Gets the resourceIdentifiers property: The resource identifiers that can be used to direct the alert to the right - * product exposure group (tenant, workspace, subscription etc.). There can be multiple identifiers of different - * type per alert. - * - * @return the resourceIdentifiers value. - */ - List resourceIdentifiers(); - - /** - * Gets the remediationSteps property: Manual action items to take to remediate the alert. - * - * @return the remediationSteps value. - */ - List remediationSteps(); - - /** - * Gets the vendorName property: The name of the vendor that raises the alert. - * - * @return the vendorName value. - */ - String vendorName(); - - /** - * Gets the status property: The life cycle status of the alert. - * - * @return the status value. - */ - AlertStatus status(); - - /** - * Gets the extendedLinks property: Links related to the alert. - * - * @return the extendedLinks value. - */ - List> extendedLinks(); - - /** - * Gets the alertUri property: A direct link to the alert page in Azure Portal. - * - * @return the alertUri value. - */ - String alertUri(); - - /** - * Gets the timeGeneratedUtc property: The UTC time the alert was generated in ISO8601 format. - * - * @return the timeGeneratedUtc value. - */ - OffsetDateTime timeGeneratedUtc(); - - /** - * Gets the productName property: The name of the product which published this alert (Microsoft Sentinel, Microsoft - * Defender for Identity, Microsoft Defender for Endpoint, Microsoft Defender for Office, Microsoft Defender for - * Cloud Apps, and so on). - * - * @return the productName value. - */ - String productName(); - - /** - * Gets the processingEndTimeUtc property: The UTC processing end time of the alert in ISO8601 format. - * - * @return the processingEndTimeUtc value. - */ - OffsetDateTime processingEndTimeUtc(); - - /** - * Gets the entities property: A list of entities related to the alert. - * - * @return the entities value. - */ - List entities(); - - /** - * Gets the isIncident property: This field determines whether the alert is an incident (a compound grouping of - * several alerts) or a single alert. - * - * @return the isIncident value. - */ - Boolean isIncident(); - - /** - * Gets the correlationKey property: Key for corelating related alerts. Alerts with the same correlation key - * considered to be related. - * - * @return the correlationKey value. - */ - String correlationKey(); - - /** - * Gets the extendedProperties property: Custom properties for the alert. - * - * @return the extendedProperties value. - */ - Map extendedProperties(); - - /** - * Gets the compromisedEntity property: The display name of the resource most related to this alert. - * - * @return the compromisedEntity value. - */ - String compromisedEntity(); - - /** - * Gets the techniques property: kill chain related techniques behind the alert. - * - * @return the techniques value. - */ - List techniques(); - - /** - * Gets the subTechniques property: Kill chain related sub-techniques behind the alert. - * - * @return the subTechniques value. - */ - List subTechniques(); - - /** - * Gets the supportingEvidence property: Changing set of properties depending on the supportingEvidence type. - * - * @return the supportingEvidence value. - */ - AlertPropertiesSupportingEvidence supportingEvidence(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AlertInner object. - * - * @return the inner object. - */ - AlertInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertEntity.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertEntity.java deleted file mode 100644 index 15fb1a936462..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertEntity.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * Changing set of properties depending on the entity type. - */ -@Immutable -public final class AlertEntity implements JsonSerializable { - /* - * Type of entity - */ - private String type; - - /* - * Changing set of properties depending on the entity type. - */ - private Map additionalProperties; - - /** - * Creates an instance of AlertEntity class. - */ - private AlertEntity() { - } - - /** - * Get the type property: Type of entity. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the additionalProperties property: Changing set of properties depending on the entity type. - * - * @return the additionalProperties value. - */ - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * 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(); - if (additionalProperties != null) { - for (Map.Entry additionalProperty : additionalProperties.entrySet()) { - jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); - } - } - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AlertEntity from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AlertEntity 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 AlertEntity. - */ - public static AlertEntity fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AlertEntity deserializedAlertEntity = new AlertEntity(); - Map additionalProperties = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedAlertEntity.type = reader.getString(); - } else { - if (additionalProperties == null) { - additionalProperties = new LinkedHashMap<>(); - } - - additionalProperties.put(fieldName, reader.readUntyped()); - } - } - deserializedAlertEntity.additionalProperties = additionalProperties; - - return deserializedAlertEntity; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertPropertiesSupportingEvidence.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertPropertiesSupportingEvidence.java deleted file mode 100644 index 86b63550ba9f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertPropertiesSupportingEvidence.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * Changing set of properties depending on the supportingEvidence type. - */ -@Immutable -public final class AlertPropertiesSupportingEvidence implements JsonSerializable { - /* - * Type of the supportingEvidence - */ - private String type; - - /* - * Changing set of properties depending on the supportingEvidence type. - */ - private Map additionalProperties; - - /** - * Creates an instance of AlertPropertiesSupportingEvidence class. - */ - private AlertPropertiesSupportingEvidence() { - } - - /** - * Get the type property: Type of the supportingEvidence. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the additionalProperties property: Changing set of properties depending on the supportingEvidence type. - * - * @return the additionalProperties value. - */ - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * 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(); - if (additionalProperties != null) { - for (Map.Entry additionalProperty : additionalProperties.entrySet()) { - jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); - } - } - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AlertPropertiesSupportingEvidence from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AlertPropertiesSupportingEvidence 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 AlertPropertiesSupportingEvidence. - */ - public static AlertPropertiesSupportingEvidence fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AlertPropertiesSupportingEvidence deserializedAlertPropertiesSupportingEvidence - = new AlertPropertiesSupportingEvidence(); - Map additionalProperties = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedAlertPropertiesSupportingEvidence.type = reader.getString(); - } else { - if (additionalProperties == null) { - additionalProperties = new LinkedHashMap<>(); - } - - additionalProperties.put(fieldName, reader.readUntyped()); - } - } - deserializedAlertPropertiesSupportingEvidence.additionalProperties = additionalProperties; - - return deserializedAlertPropertiesSupportingEvidence; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSeverity.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSeverity.java deleted file mode 100644 index eef3de57f784..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSeverity.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The risk level of the threat that was detected. Learn more: - * https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified. - */ -public final class AlertSeverity extends ExpandableStringEnum { - /** - * Informational. - */ - public static final AlertSeverity INFORMATIONAL = fromString("Informational"); - - /** - * Low. - */ - public static final AlertSeverity LOW = fromString("Low"); - - /** - * Medium. - */ - public static final AlertSeverity MEDIUM = fromString("Medium"); - - /** - * High. - */ - public static final AlertSeverity HIGH = fromString("High"); - - /** - * Creates a new instance of AlertSeverity value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AlertSeverity() { - } - - /** - * Creates or finds a AlertSeverity from its string representation. - * - * @param name a name to look for. - * @return the corresponding AlertSeverity. - */ - public static AlertSeverity fromString(String name) { - return fromString(name, AlertSeverity.class); - } - - /** - * Gets known AlertSeverity values. - * - * @return known AlertSeverity values. - */ - public static Collection values() { - return values(AlertSeverity.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSimulatorBundlesRequestProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSimulatorBundlesRequestProperties.java deleted file mode 100644 index 51945263cc59..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSimulatorBundlesRequestProperties.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -/** - * Simulate alerts according to this bundles. - */ -@Fluent -public final class AlertSimulatorBundlesRequestProperties extends AlertSimulatorRequestProperties { - /* - * The kind of alert simulation. - */ - private Kind kind = Kind.BUNDLES; - - /* - * Bundles list. - */ - private List bundles; - - /** - * Creates an instance of AlertSimulatorBundlesRequestProperties class. - */ - public AlertSimulatorBundlesRequestProperties() { - } - - /** - * Get the kind property: The kind of alert simulation. - * - * @return the kind value. - */ - @Override - public Kind kind() { - return this.kind; - } - - /** - * Get the bundles property: Bundles list. - * - * @return the bundles value. - */ - public List bundles() { - return this.bundles; - } - - /** - * Set the bundles property: Bundles list. - * - * @param bundles the bundles value to set. - * @return the AlertSimulatorBundlesRequestProperties object itself. - */ - public AlertSimulatorBundlesRequestProperties withBundles(List bundles) { - this.bundles = bundles; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); - jsonWriter.writeArrayField("bundles", this.bundles, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - if (additionalProperties() != null) { - for (Map.Entry additionalProperty : additionalProperties().entrySet()) { - jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); - } - } - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AlertSimulatorBundlesRequestProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AlertSimulatorBundlesRequestProperties 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 AlertSimulatorBundlesRequestProperties. - */ - public static AlertSimulatorBundlesRequestProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AlertSimulatorBundlesRequestProperties deserializedAlertSimulatorBundlesRequestProperties - = new AlertSimulatorBundlesRequestProperties(); - Map additionalProperties = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("kind".equals(fieldName)) { - deserializedAlertSimulatorBundlesRequestProperties.kind = Kind.fromString(reader.getString()); - } else if ("bundles".equals(fieldName)) { - List bundles = reader.readArray(reader1 -> BundleType.fromString(reader1.getString())); - deserializedAlertSimulatorBundlesRequestProperties.bundles = bundles; - } else { - if (additionalProperties == null) { - additionalProperties = new LinkedHashMap<>(); - } - - additionalProperties.put(fieldName, reader.readUntyped()); - } - } - deserializedAlertSimulatorBundlesRequestProperties.withAdditionalProperties(additionalProperties); - - return deserializedAlertSimulatorBundlesRequestProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSimulatorRequestBody.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSimulatorRequestBody.java deleted file mode 100644 index 9267f6c529fb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSimulatorRequestBody.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * Alert Simulator request body. - */ -@Fluent -public final class AlertSimulatorRequestBody implements JsonSerializable { - /* - * Alert Simulator request body data. - */ - private AlertSimulatorRequestProperties properties; - - /** - * Creates an instance of AlertSimulatorRequestBody class. - */ - public AlertSimulatorRequestBody() { - } - - /** - * Get the properties property: Alert Simulator request body data. - * - * @return the properties value. - */ - public AlertSimulatorRequestProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Alert Simulator request body data. - * - * @param properties the properties value to set. - * @return the AlertSimulatorRequestBody object itself. - */ - public AlertSimulatorRequestBody withProperties(AlertSimulatorRequestProperties 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 AlertSimulatorRequestBody from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AlertSimulatorRequestBody 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 AlertSimulatorRequestBody. - */ - public static AlertSimulatorRequestBody fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AlertSimulatorRequestBody deserializedAlertSimulatorRequestBody = new AlertSimulatorRequestBody(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedAlertSimulatorRequestBody.properties = AlertSimulatorRequestProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAlertSimulatorRequestBody; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSimulatorRequestProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSimulatorRequestProperties.java deleted file mode 100644 index fb94f65cf46f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSimulatorRequestProperties.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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.LinkedHashMap; -import java.util.Map; - -/** - * Describes properties of an alert simulation request. - */ -@Fluent -public class AlertSimulatorRequestProperties implements JsonSerializable { - /* - * The kind of alert simulation. - */ - private Kind kind = Kind.fromString("AlertSimulatorRequestProperties"); - - /* - * Describes properties of an alert simulation request - */ - private Map additionalProperties; - - /** - * Creates an instance of AlertSimulatorRequestProperties class. - */ - public AlertSimulatorRequestProperties() { - } - - /** - * Get the kind property: The kind of alert simulation. - * - * @return the kind value. - */ - public Kind kind() { - return this.kind; - } - - /** - * Get the additionalProperties property: Describes properties of an alert simulation request. - * - * @return the additionalProperties value. - */ - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Describes properties of an alert simulation request. - * - * @param additionalProperties the additionalProperties value to set. - * @return the AlertSimulatorRequestProperties object itself. - */ - public AlertSimulatorRequestProperties withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - 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("kind", this.kind == null ? null : this.kind.toString()); - if (additionalProperties != null) { - for (Map.Entry additionalProperty : additionalProperties.entrySet()) { - jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); - } - } - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AlertSimulatorRequestProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AlertSimulatorRequestProperties 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 AlertSimulatorRequestProperties. - */ - public static AlertSimulatorRequestProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("kind".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("Bundles".equals(discriminatorValue)) { - return AlertSimulatorBundlesRequestProperties.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AlertSimulatorRequestProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AlertSimulatorRequestProperties deserializedAlertSimulatorRequestProperties - = new AlertSimulatorRequestProperties(); - Map additionalProperties = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("kind".equals(fieldName)) { - deserializedAlertSimulatorRequestProperties.kind = Kind.fromString(reader.getString()); - } else { - if (additionalProperties == null) { - additionalProperties = new LinkedHashMap<>(); - } - - additionalProperties.put(fieldName, reader.readUntyped()); - } - } - deserializedAlertSimulatorRequestProperties.additionalProperties = additionalProperties; - - return deserializedAlertSimulatorRequestProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertStatus.java deleted file mode 100644 index 1aca041ab922..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertStatus.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The life cycle status of the alert. - */ -public final class AlertStatus extends ExpandableStringEnum { - /** - * An alert which doesn't specify a value is assigned the status 'Active'. - */ - public static final AlertStatus ACTIVE = fromString("Active"); - - /** - * An alert which is in handling state. - */ - public static final AlertStatus IN_PROGRESS = fromString("InProgress"); - - /** - * Alert closed after handling. - */ - public static final AlertStatus RESOLVED = fromString("Resolved"); - - /** - * Alert dismissed as false positive. - */ - public static final AlertStatus DISMISSED = fromString("Dismissed"); - - /** - * Creates a new instance of AlertStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AlertStatus() { - } - - /** - * Creates or finds a AlertStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding AlertStatus. - */ - public static AlertStatus fromString(String name) { - return fromString(name, AlertStatus.class); - } - - /** - * Gets known AlertStatus values. - * - * @return known AlertStatus values. - */ - public static Collection values() { - return values(AlertStatus.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSyncSettings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSyncSettings.java deleted file mode 100644 index 833907821069..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSyncSettings.java +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -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.security.fluent.models.AlertSyncSettingProperties; -import com.azure.resourcemanager.security.fluent.models.SettingInner; -import java.io.IOException; - -/** - * Represents an alert sync setting. - */ -@Fluent -public final class AlertSyncSettings extends SettingInner { - /* - * the kind of the settings string - */ - private SettingKind kind = SettingKind.ALERT_SYNC_SETTINGS; - - /* - * Alert sync setting data - */ - private AlertSyncSettingProperties 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 AlertSyncSettings class. - */ - public AlertSyncSettings() { - } - - /** - * Get the kind property: the kind of the settings string. - * - * @return the kind value. - */ - @Override - public SettingKind kind() { - return this.kind; - } - - /** - * Get the innerProperties property: Alert sync setting data. - * - * @return the innerProperties value. - */ - private AlertSyncSettingProperties innerProperties() { - return this.innerProperties; - } - - /** - * 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: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public AlertSyncSettings withProperties(SettingProperties properties) { - super.withProperties(properties); - return this; - } - - /** - * Get the enabled property: Is the alert sync setting enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.innerProperties() == null ? null : this.innerProperties().enabled(); - } - - /** - * Set the enabled property: Is the alert sync setting enabled. - * - * @param enabled the enabled value to set. - * @return the AlertSyncSettings object itself. - */ - public AlertSyncSettings withEnabled(Boolean enabled) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertSyncSettingProperties(); - } - this.innerProperties().withEnabled(enabled); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AlertSyncSettings from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AlertSyncSettings 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 AlertSyncSettings. - */ - public static AlertSyncSettings fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AlertSyncSettings deserializedAlertSyncSettings = new AlertSyncSettings(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAlertSyncSettings.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAlertSyncSettings.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAlertSyncSettings.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedAlertSyncSettings.systemData = SystemData.fromJson(reader); - } else if ("kind".equals(fieldName)) { - deserializedAlertSyncSettings.kind = SettingKind.fromString(reader.getString()); - } else if ("properties".equals(fieldName)) { - deserializedAlertSyncSettings.innerProperties = AlertSyncSettingProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAlertSyncSettings; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alerts.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alerts.java deleted file mode 100644 index 92cc9f92d941..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alerts.java +++ /dev/null @@ -1,416 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of Alerts. - */ -public interface Alerts { - /** - * Get an alert that is associated with a subscription. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @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 alert that is associated with a subscription along with {@link Response}. - */ - Response getSubscriptionLevelWithResponse(String ascLocation, String alertName, Context context); - - /** - * Get an alert that is associated with a subscription. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 alert that is associated with a subscription. - */ - Alert getSubscriptionLevel(String ascLocation, String alertName); - - /** - * List all the alerts that are associated with the subscription that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - PagedIterable listSubscriptionLevelByRegion(String ascLocation); - - /** - * List all the alerts that are associated with the subscription that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - PagedIterable listSubscriptionLevelByRegion(String ascLocation, Context context); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @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 updateSubscriptionLevelStateToDismissWithResponse(String ascLocation, String alertName, - Context context); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 updateSubscriptionLevelStateToDismiss(String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @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 updateSubscriptionLevelStateToResolveWithResponse(String ascLocation, String alertName, - Context context); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 updateSubscriptionLevelStateToResolve(String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @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 updateSubscriptionLevelStateToActivateWithResponse(String ascLocation, String alertName, - Context context); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 updateSubscriptionLevelStateToActivate(String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @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 updateSubscriptionLevelStateToInProgressWithResponse(String ascLocation, String alertName, - Context context); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 updateSubscriptionLevelStateToInProgress(String ascLocation, String alertName); - - /** - * Get an alert that is associated a resource group or a resource in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @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 alert that is associated a resource group or a resource in a resource group along with - * {@link Response}. - */ - Response getResourceGroupLevelWithResponse(String resourceGroupName, String ascLocation, String alertName, - Context context); - - /** - * Get an alert that is associated a resource group or a resource in a resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 alert that is associated a resource group or a resource in a resource group. - */ - Alert getResourceGroupLevel(String resourceGroupName, String ascLocation, String alertName); - - /** - * List all the alerts that are associated with the resource group that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName); - - /** - * List all the alerts that are associated with the resource group that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName, Context context); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @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 updateResourceGroupLevelStateToResolveWithResponse(String resourceGroupName, String ascLocation, - String alertName, Context context); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 updateResourceGroupLevelStateToResolve(String resourceGroupName, String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @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 updateResourceGroupLevelStateToDismissWithResponse(String resourceGroupName, String ascLocation, - String alertName, Context context); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 updateResourceGroupLevelStateToDismiss(String resourceGroupName, String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @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 updateResourceGroupLevelStateToActivateWithResponse(String resourceGroupName, String ascLocation, - String alertName, Context context); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 updateResourceGroupLevelStateToActivate(String resourceGroupName, String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @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 updateResourceGroupLevelStateToInProgressWithResponse(String resourceGroupName, String ascLocation, - String alertName, Context context); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 updateResourceGroupLevelStateToInProgress(String resourceGroupName, String ascLocation, String alertName); - - /** - * List all the alerts that are associated with the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List all the alerts that are associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * List all the alerts that are associated with the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List all the alerts that are associated with the 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody The request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 simulate(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody); - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody The request body. - * @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 simulate(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRule.java deleted file mode 100644 index 92a0eb72de62..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRule.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -import java.time.OffsetDateTime; - -/** - * An immutable client-side representation of AlertsSuppressionRule. - */ -public interface AlertsSuppressionRule { - /** - * 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 alertType property: Type of the alert to automatically suppress. For all alert types, use '*'. - * - * @return the alertType value. - */ - String alertType(); - - /** - * Gets the lastModifiedUtc property: The last time this rule was modified. - * - * @return the lastModifiedUtc value. - */ - OffsetDateTime lastModifiedUtc(); - - /** - * Gets the expirationDateUtc property: Expiration date of the rule, if value is not provided or provided as null - * there will no expiration at all. - * - * @return the expirationDateUtc value. - */ - OffsetDateTime expirationDateUtc(); - - /** - * Gets the reason property: The reason for dismissing the alert. - * - * @return the reason value. - */ - String reason(); - - /** - * Gets the state property: Possible states of the rule. - * - * @return the state value. - */ - RuleState state(); - - /** - * Gets the comment property: Any comment regarding the rule. - * - * @return the comment value. - */ - String comment(); - - /** - * Gets the suppressionAlertsScope property: The suppression conditions. - * - * @return the suppressionAlertsScope value. - */ - SuppressionAlertsScope suppressionAlertsScope(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner object. - * - * @return the inner object. - */ - AlertsSuppressionRuleInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRules.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRules.java deleted file mode 100644 index 03c429a8e478..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRules.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; - -/** - * Resource collection API of AlertsSuppressionRules. - */ -public interface AlertsSuppressionRules { - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert 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 dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription along with - * {@link Response}. - */ - Response getWithResponse(String alertsSuppressionRuleName, Context context); - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - */ - AlertsSuppressionRule get(String alertsSuppressionRuleName); - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @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 describes the suppression rule along with {@link Response}. - */ - Response updateWithResponse(String alertsSuppressionRuleName, - AlertsSuppressionRuleInner alertsSuppressionRule, Context context); - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 suppression rule. - */ - AlertsSuppressionRule update(String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule); - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert 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 deleteWithResponse(String alertsSuppressionRuleName, Context context); - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 alertsSuppressionRuleName); - - /** - * List of all the dismiss rules for the given 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 suppression rules list for subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List of all the dismiss rules for the given subscription. - * - * @param alertType Type of the alert to get rules for. - * @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 suppression rules list for subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String alertType, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnections.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnections.java deleted file mode 100644 index 73b5a6ba90c4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnections.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of AllowedConnections. - */ -public interface AllowedConnections { - /** - * Gets the list of all possible traffic between resources for the subscription and location, based on connection - * type. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param connectionType The type of allowed connections (Internal, External). - * @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 all possible traffic between resources for the subscription and location, based on connection - * type along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String ascLocation, - ConnectionType connectionType, Context context); - - /** - * Gets the list of all possible traffic between resources for the subscription and location, based on connection - * type. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param connectionType The type of allowed connections (Internal, External). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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 all possible traffic between resources for the subscription and location, based on connection - * type. - */ - AllowedConnectionsResource get(String resourceGroupName, String ascLocation, ConnectionType connectionType); - - /** - * Gets the list of all possible traffic between resources for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location as paginated - * response with {@link PagedIterable}. - */ - PagedIterable listByHomeRegion(String ascLocation); - - /** - * Gets the list of all possible traffic between resources for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location as paginated - * response with {@link PagedIterable}. - */ - PagedIterable listByHomeRegion(String ascLocation, Context context); - - /** - * Gets the list of all possible traffic between resources for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Gets the list of all possible traffic between resources for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnectionsResource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnectionsResource.java deleted file mode 100644 index 81f1fe9406fe..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnectionsResource.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.AllowedConnectionsResourceInner; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * An immutable client-side representation of AllowedConnectionsResource. - */ -public interface AllowedConnectionsResource { - /** - * 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 location property: Location where the resource is stored. - * - * @return the location value. - */ - String location(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the calculatedDateTime property: The UTC time on which the allowed connections resource was calculated. - * - * @return the calculatedDateTime value. - */ - OffsetDateTime calculatedDateTime(); - - /** - * Gets the connectableResources property: List of connectable resources. - * - * @return the connectableResources value. - */ - List connectableResources(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AllowedConnectionsResourceInner object. - * - * @return the inner object. - */ - AllowedConnectionsResourceInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowlistCustomAlertRule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowlistCustomAlertRule.java deleted file mode 100644 index e9cdfaf6c3a6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowlistCustomAlertRule.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * A custom alert rule that checks if a value (depends on the custom alert type) is allowed. - */ -@Fluent -public final class AllowlistCustomAlertRule extends ListCustomAlertRule { - /* - * The ruleType property. - */ - private String ruleType = "AllowlistCustomAlertRule"; - - /* - * The values to allow. The format of the values depends on the rule type. - */ - private List allowlistValues; - - /** - * Creates an instance of AllowlistCustomAlertRule class. - */ - public AllowlistCustomAlertRule() { - } - - /** - * Get the ruleType property: The ruleType property. - * - * @return the ruleType value. - */ - @Override - public String ruleType() { - return this.ruleType; - } - - /** - * Get the allowlistValues property: The values to allow. The format of the values depends on the rule type. - * - * @return the allowlistValues value. - */ - public List allowlistValues() { - return this.allowlistValues; - } - - /** - * Set the allowlistValues property: The values to allow. The format of the values depends on the rule type. - * - * @param allowlistValues the allowlistValues value to set. - * @return the AllowlistCustomAlertRule object itself. - */ - public AllowlistCustomAlertRule withAllowlistValues(List allowlistValues) { - this.allowlistValues = allowlistValues; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AllowlistCustomAlertRule withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (allowlistValues() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property allowlistValues in model AllowlistCustomAlertRule")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AllowlistCustomAlertRule.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("isEnabled", isEnabled()); - jsonWriter.writeArrayField("allowlistValues", this.allowlistValues, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("ruleType", this.ruleType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AllowlistCustomAlertRule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AllowlistCustomAlertRule 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 AllowlistCustomAlertRule. - */ - public static AllowlistCustomAlertRule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AllowlistCustomAlertRule deserializedAllowlistCustomAlertRule = new AllowlistCustomAlertRule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("isEnabled".equals(fieldName)) { - deserializedAllowlistCustomAlertRule.withIsEnabled(reader.getBoolean()); - } else if ("displayName".equals(fieldName)) { - deserializedAllowlistCustomAlertRule.withDisplayName(reader.getString()); - } else if ("description".equals(fieldName)) { - deserializedAllowlistCustomAlertRule.withDescription(reader.getString()); - } else if ("valueType".equals(fieldName)) { - deserializedAllowlistCustomAlertRule.withValueType(ValueType.fromString(reader.getString())); - } else if ("allowlistValues".equals(fieldName)) { - List allowlistValues = reader.readArray(reader1 -> reader1.getString()); - deserializedAllowlistCustomAlertRule.allowlistValues = allowlistValues; - } else if ("ruleType".equals(fieldName)) { - deserializedAllowlistCustomAlertRule.ruleType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAllowlistCustomAlertRule; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AnnotateDefaultBranchState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AnnotateDefaultBranchState.java deleted file mode 100644 index c6edfd14020c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AnnotateDefaultBranchState.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Configuration of PR Annotations on default branch. - * - * Enabled - PR Annotations are enabled on the resource's default branch. - * Disabled - PR Annotations are disabled on the resource's default branch. - */ -public final class AnnotateDefaultBranchState extends ExpandableStringEnum { - /** - * Disabled. - */ - public static final AnnotateDefaultBranchState DISABLED = fromString("Disabled"); - - /** - * Enabled. - */ - public static final AnnotateDefaultBranchState ENABLED = fromString("Enabled"); - - /** - * Creates a new instance of AnnotateDefaultBranchState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AnnotateDefaultBranchState() { - } - - /** - * Creates or finds a AnnotateDefaultBranchState from its string representation. - * - * @param name a name to look for. - * @return the corresponding AnnotateDefaultBranchState. - */ - public static AnnotateDefaultBranchState fromString(String name) { - return fromString(name, AnnotateDefaultBranchState.class); - } - - /** - * Gets known AnnotateDefaultBranchState values. - * - * @return known AnnotateDefaultBranchState values. - */ - public static Collection values() { - return values(AnnotateDefaultBranchState.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollection.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollection.java deleted file mode 100644 index e82ef6fbe9d5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollection.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionInner; - -/** - * An immutable client-side representation of ApiCollection. - */ -public interface ApiCollection { - /** - * 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 provisioningState property: Gets the provisioning state of the API collection. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the displayName property: The display name of the API collection. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the discoveredVia property: The resource Id of the resource from where this API collection was discovered. - * - * @return the discoveredVia value. - */ - String discoveredVia(); - - /** - * Gets the baseUrl property: The base URI for this API collection. All endpoints of this API collection extend this - * base URI. - * - * @return the baseUrl value. - */ - String baseUrl(); - - /** - * Gets the numberOfApiEndpoints property: The number of API endpoints discovered in this API collection. - * - * @return the numberOfApiEndpoints value. - */ - Long numberOfApiEndpoints(); - - /** - * Gets the numberOfInactiveApiEndpoints property: The number of API endpoints in this API collection that have not - * received any API traffic in the last 30 days. - * - * @return the numberOfInactiveApiEndpoints value. - */ - Long numberOfInactiveApiEndpoints(); - - /** - * Gets the numberOfUnauthenticatedApiEndpoints property: The number of API endpoints in this API collection that - * are unauthenticated. - * - * @return the numberOfUnauthenticatedApiEndpoints value. - */ - Long numberOfUnauthenticatedApiEndpoints(); - - /** - * Gets the numberOfExternalApiEndpoints property: The number of API endpoints in this API collection for which API - * traffic from the internet was observed. - * - * @return the numberOfExternalApiEndpoints value. - */ - Long numberOfExternalApiEndpoints(); - - /** - * Gets the numberOfApiEndpointsWithSensitiveDataExposed property: The number of API endpoints in this API - * collection which are exposing sensitive data in their requests and/or responses. - * - * @return the numberOfApiEndpointsWithSensitiveDataExposed value. - */ - Long numberOfApiEndpointsWithSensitiveDataExposed(); - - /** - * Gets the sensitivityLabel property: The highest priority sensitivity label from Microsoft Purview in this API - * collection. - * - * @return the sensitivityLabel value. - */ - String sensitivityLabel(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ApiCollectionInner object. - * - * @return the inner object. - */ - ApiCollectionInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollections.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollections.java deleted file mode 100644 index 314be3acdd38..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollections.java +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ApiCollections. - */ -public interface ApiCollections { - /** - * Gets an onboarded Azure API Management API - * - * Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. If an Azure API - * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the - * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @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 onboarded Azure API Management API - * - * Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs along with - * {@link Response}. - */ - Response getByAzureApiManagementServiceWithResponse(String resourceGroupName, String serviceName, - String apiId, Context context); - - /** - * Gets an onboarded Azure API Management API - * - * Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. If an Azure API - * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the - * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 onboarded Azure API Management API - * - * Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. - */ - ApiCollection getByAzureApiManagementService(String resourceGroupName, String serviceName, String apiId); - - /** - * Onboard an Azure API Management API to Microsoft Defender for APIs - * - * Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the - * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been - * detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 API collection as represented by Microsoft Defender for APIs. - */ - ApiCollection onboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId); - - /** - * Onboard an Azure API Management API to Microsoft Defender for APIs - * - * Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the - * operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been - * detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @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 API collection as represented by Microsoft Defender for APIs. - */ - ApiCollection onboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId, - Context context); - - /** - * Offboard an Azure API Management API from Microsoft Defender for APIs - * - * Offboard an Azure API Management API from Microsoft Defender for APIs. The system will stop monitoring the - * operations within the Azure API Management API for intrusive behaviors. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @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 offboardAzureApiManagementApiWithResponse(String resourceGroupName, String serviceName, String apiId, - Context context); - - /** - * Offboard an Azure API Management API from Microsoft Defender for APIs - * - * Offboard an Azure API Management API from Microsoft Defender for APIs. The system will stop monitoring the - * operations within the Azure API Management API for intrusive behaviors. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiId API revision identifier. Must be unique in the API Management service instance. Non-current revision - * has ;rev=n as a suffix where n is the revision number. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 offboardAzureApiManagementApi(String resourceGroupName, String serviceName, String apiId); - - /** - * Gets a list of onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. If an Azure API - * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the - * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs as paginated - * response with {@link PagedIterable}. - */ - PagedIterable listByAzureApiManagementService(String resourceGroupName, String serviceName); - - /** - * Gets a list of onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. If an Azure API - * Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the - * Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @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 onboarded Azure API Management APIs - * - * Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs as paginated - * response with {@link PagedIterable}. - */ - PagedIterable listByAzureApiManagementService(String resourceGroupName, String serviceName, - Context context); - - /** - * Gets a list of API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs. - * - * @throws com.azure.core.management.exception.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 API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs as - * paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Gets a list of API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs. - * - * @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 API collections within a subscription - * - * Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs as - * paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Gets a list of API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs. - * - * @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 a list of API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs as - * paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Gets a list of API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs. - * - * @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 a list of API collections within a resource group - * - * Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs as - * paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Application.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Application.java deleted file mode 100644 index 73156c93b4c0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Application.java +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import java.util.List; - -/** - * An immutable client-side representation of Application. - */ -public interface Application { - /** - * 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 displayName property: display name of the application. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the description property: description of the application. - * - * @return the description value. - */ - String description(); - - /** - * Gets the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * - * @return the sourceResourceType value. - */ - ApplicationSourceResourceType sourceResourceType(); - - /** - * Gets the conditionSets property: The application conditionSets - see examples. - * - * @return the conditionSets value. - */ - List conditionSets(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ApplicationInner object. - * - * @return the inner object. - */ - ApplicationInner innerModel(); - - /** - * The entirety of the Application definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { - } - - /** - * The Application definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the Application definition. - */ - interface Blank extends WithCreate { - } - - /** - * The stage of the Application 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.WithDisplayName, DefinitionStages.WithDescription, - DefinitionStages.WithSourceResourceType, DefinitionStages.WithConditionSets { - /** - * Executes the create request. - * - * @return the created resource. - */ - Application create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Application create(Context context); - } - - /** - * The stage of the Application definition allowing to specify displayName. - */ - interface WithDisplayName { - /** - * Specifies the displayName property: display name of the application. - * - * @param displayName display name of the application. - * @return the next definition stage. - */ - WithCreate withDisplayName(String displayName); - } - - /** - * The stage of the Application definition allowing to specify description. - */ - interface WithDescription { - /** - * Specifies the description property: description of the application. - * - * @param description description of the application. - * @return the next definition stage. - */ - WithCreate withDescription(String description); - } - - /** - * The stage of the Application definition allowing to specify sourceResourceType. - */ - interface WithSourceResourceType { - /** - * Specifies the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * - * @param sourceResourceType The application source, what it affects, e.g. Assessments. - * @return the next definition stage. - */ - WithCreate withSourceResourceType(ApplicationSourceResourceType sourceResourceType); - } - - /** - * The stage of the Application definition allowing to specify conditionSets. - */ - interface WithConditionSets { - /** - * Specifies the conditionSets property: The application conditionSets - see examples. - * - * @param conditionSets The application conditionSets - see examples. - * @return the next definition stage. - */ - WithCreate withConditionSets(List conditionSets); - } - } - - /** - * Begins update for the Application resource. - * - * @return the stage of resource update. - */ - Application.Update update(); - - /** - * The template for Application update. - */ - interface Update extends UpdateStages.WithDisplayName, UpdateStages.WithDescription, - UpdateStages.WithSourceResourceType, UpdateStages.WithConditionSets { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Application apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Application apply(Context context); - } - - /** - * The Application update stages. - */ - interface UpdateStages { - /** - * The stage of the Application update allowing to specify displayName. - */ - interface WithDisplayName { - /** - * Specifies the displayName property: display name of the application. - * - * @param displayName display name of the application. - * @return the next definition stage. - */ - Update withDisplayName(String displayName); - } - - /** - * The stage of the Application update allowing to specify description. - */ - interface WithDescription { - /** - * Specifies the description property: description of the application. - * - * @param description description of the application. - * @return the next definition stage. - */ - Update withDescription(String description); - } - - /** - * The stage of the Application update allowing to specify sourceResourceType. - */ - interface WithSourceResourceType { - /** - * Specifies the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * - * @param sourceResourceType The application source, what it affects, e.g. Assessments. - * @return the next definition stage. - */ - Update withSourceResourceType(ApplicationSourceResourceType sourceResourceType); - } - - /** - * The stage of the Application update allowing to specify conditionSets. - */ - interface WithConditionSets { - /** - * Specifies the conditionSets property: The application conditionSets - see examples. - * - * @param conditionSets The application conditionSets - see examples. - * @return the next definition stage. - */ - Update withConditionSets(List conditionSets); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Application refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Application refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationSourceResourceType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationSourceResourceType.java deleted file mode 100644 index 5958915009f4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationSourceResourceType.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The application source, what it affects, e.g. Assessments. - */ -public final class ApplicationSourceResourceType extends ExpandableStringEnum { - /** - * The source of the application is assessments. - */ - public static final ApplicationSourceResourceType ASSESSMENTS = fromString("Assessments"); - - /** - * Creates a new instance of ApplicationSourceResourceType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ApplicationSourceResourceType() { - } - - /** - * Creates or finds a ApplicationSourceResourceType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ApplicationSourceResourceType. - */ - public static ApplicationSourceResourceType fromString(String name) { - return fromString(name, ApplicationSourceResourceType.class); - } - - /** - * Gets known ApplicationSourceResourceType values. - * - * @return known ApplicationSourceResourceType values. - */ - public static Collection values() { - return values(ApplicationSourceResourceType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Applications.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Applications.java deleted file mode 100644 index 8237b2cf16b8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Applications.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of Applications. - */ -public interface Applications { - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response}. - */ - Response getWithResponse(String applicationId, Context context); - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 application for the requested scope by applicationId. - */ - Application get(String applicationId); - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String applicationId, Context context); - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 applicationId); - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @throws com.azure.core.management.exception.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 relevant applications over a subscription level scope as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @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 all relevant applications over a subscription level scope as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response}. - */ - Application getById(String id); - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete an Application over a given scope. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete an Application over a given scope. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new Application resource. - * - * @param name resource name. - * @return the first stage of the new Application definition. - */ - Application.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioning.java deleted file mode 100644 index 08095af42a33..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioning.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 ARC autoprovisioning configuration. - */ -@Fluent -public class ArcAutoProvisioning implements JsonSerializable { - /* - * Is arc auto provisioning enabled - */ - private Boolean enabled; - - /* - * Configuration for servers Arc auto provisioning for a given environment - */ - private ArcAutoProvisioningConfiguration configuration; - - /** - * Creates an instance of ArcAutoProvisioning class. - */ - public ArcAutoProvisioning() { - } - - /** - * Get the enabled property: Is arc auto provisioning enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is arc auto provisioning enabled. - * - * @param enabled the enabled value to set. - * @return the ArcAutoProvisioning object itself. - */ - public ArcAutoProvisioning withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the configuration property: Configuration for servers Arc auto provisioning for a given environment. - * - * @return the configuration value. - */ - public ArcAutoProvisioningConfiguration configuration() { - return this.configuration; - } - - /** - * Set the configuration property: Configuration for servers Arc auto provisioning for a given environment. - * - * @param configuration the configuration value to set. - * @return the ArcAutoProvisioning object itself. - */ - public ArcAutoProvisioning withConfiguration(ArcAutoProvisioningConfiguration configuration) { - this.configuration = configuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeJsonField("configuration", this.configuration); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ArcAutoProvisioning from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ArcAutoProvisioning 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 ArcAutoProvisioning. - */ - public static ArcAutoProvisioning fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ArcAutoProvisioning deserializedArcAutoProvisioning = new ArcAutoProvisioning(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedArcAutoProvisioning.enabled = reader.getNullable(JsonReader::getBoolean); - } else if ("configuration".equals(fieldName)) { - deserializedArcAutoProvisioning.configuration = ArcAutoProvisioningConfiguration.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedArcAutoProvisioning; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioningAws.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioningAws.java deleted file mode 100644 index 14168b93b783..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioningAws.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ARC autoprovisioning configuration for an AWS environment. - */ -@Fluent -public class ArcAutoProvisioningAws extends ArcAutoProvisioning { - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of ArcAutoProvisioningAws class. - */ - public ArcAutoProvisioningAws() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the ArcAutoProvisioningAws object itself. - */ - public ArcAutoProvisioningAws withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ArcAutoProvisioningAws withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ArcAutoProvisioningAws withConfiguration(ArcAutoProvisioningConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ArcAutoProvisioningAws from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ArcAutoProvisioningAws 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 ArcAutoProvisioningAws. - */ - public static ArcAutoProvisioningAws fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ArcAutoProvisioningAws deserializedArcAutoProvisioningAws = new ArcAutoProvisioningAws(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedArcAutoProvisioningAws.withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedArcAutoProvisioningAws - .withConfiguration(ArcAutoProvisioningConfiguration.fromJson(reader)); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedArcAutoProvisioningAws.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedArcAutoProvisioningAws; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioningConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioningConfiguration.java deleted file mode 100644 index f53feb5b2844..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioningConfiguration.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * Configuration for servers Arc auto provisioning for a given environment. - */ -@Fluent -public final class ArcAutoProvisioningConfiguration implements JsonSerializable { - /* - * Optional HTTP proxy endpoint to use for the Arc agent - */ - private String proxy; - - /* - * Optional Arc private link scope resource id to link the Arc agent - */ - private String privateLinkScope; - - /** - * Creates an instance of ArcAutoProvisioningConfiguration class. - */ - public ArcAutoProvisioningConfiguration() { - } - - /** - * Get the proxy property: Optional HTTP proxy endpoint to use for the Arc agent. - * - * @return the proxy value. - */ - public String proxy() { - return this.proxy; - } - - /** - * Set the proxy property: Optional HTTP proxy endpoint to use for the Arc agent. - * - * @param proxy the proxy value to set. - * @return the ArcAutoProvisioningConfiguration object itself. - */ - public ArcAutoProvisioningConfiguration withProxy(String proxy) { - this.proxy = proxy; - return this; - } - - /** - * Get the privateLinkScope property: Optional Arc private link scope resource id to link the Arc agent. - * - * @return the privateLinkScope value. - */ - public String privateLinkScope() { - return this.privateLinkScope; - } - - /** - * Set the privateLinkScope property: Optional Arc private link scope resource id to link the Arc agent. - * - * @param privateLinkScope the privateLinkScope value to set. - * @return the ArcAutoProvisioningConfiguration object itself. - */ - public ArcAutoProvisioningConfiguration withPrivateLinkScope(String privateLinkScope) { - this.privateLinkScope = privateLinkScope; - 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("proxy", this.proxy); - jsonWriter.writeStringField("privateLinkScope", this.privateLinkScope); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ArcAutoProvisioningConfiguration from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ArcAutoProvisioningConfiguration 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 ArcAutoProvisioningConfiguration. - */ - public static ArcAutoProvisioningConfiguration fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ArcAutoProvisioningConfiguration deserializedArcAutoProvisioningConfiguration - = new ArcAutoProvisioningConfiguration(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("proxy".equals(fieldName)) { - deserializedArcAutoProvisioningConfiguration.proxy = reader.getString(); - } else if ("privateLinkScope".equals(fieldName)) { - deserializedArcAutoProvisioningConfiguration.privateLinkScope = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedArcAutoProvisioningConfiguration; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioningGcp.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioningGcp.java deleted file mode 100644 index 7ff7b7e7adad..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArcAutoProvisioningGcp.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ARC autoprovisioning configuration for an GCP environment. - */ -@Fluent -public class ArcAutoProvisioningGcp extends ArcAutoProvisioning { - /** - * Creates an instance of ArcAutoProvisioningGcp class. - */ - public ArcAutoProvisioningGcp() { - } - - /** - * {@inheritDoc} - */ - @Override - public ArcAutoProvisioningGcp withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ArcAutoProvisioningGcp withConfiguration(ArcAutoProvisioningConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ArcAutoProvisioningGcp from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ArcAutoProvisioningGcp 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 ArcAutoProvisioningGcp. - */ - public static ArcAutoProvisioningGcp fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ArcAutoProvisioningGcp deserializedArcAutoProvisioningGcp = new ArcAutoProvisioningGcp(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedArcAutoProvisioningGcp.withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedArcAutoProvisioningGcp - .withConfiguration(ArcAutoProvisioningConfiguration.fromJson(reader)); - } else { - reader.skipChildren(); - } - } - - return deserializedArcAutoProvisioningGcp; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArmActionType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArmActionType.java deleted file mode 100644 index b826812d888e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ArmActionType.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - */ -public final class ArmActionType extends ExpandableStringEnum { - /** - * Actions are for internal-only APIs. - */ - public static final ArmActionType INTERNAL = fromString("Internal"); - - /** - * Creates a new instance of ArmActionType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ArmActionType() { - } - - /** - * Creates or finds a ArmActionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ArmActionType. - */ - public static ArmActionType fromString(String name) { - return fromString(name, ArmActionType.class); - } - - /** - * Gets known ArmActionType values. - * - * @return known ArmActionType values. - */ - public static Collection values() { - return values(ArmActionType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AscLocation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AscLocation.java deleted file mode 100644 index 8abe87f10510..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AscLocation.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.AscLocationInner; - -/** - * An immutable client-side representation of AscLocation. - */ -public interface AscLocation { - /** - * 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: An empty set of properties. - * - * @return the properties value. - */ - Object 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.security.fluent.models.AscLocationInner object. - * - * @return the inner object. - */ - AscLocationInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessedResourceType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessedResourceType.java deleted file mode 100644 index cd33f3592b8d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessedResourceType.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Sub-assessment resource type. - */ -public final class AssessedResourceType extends ExpandableStringEnum { - /** - * SqlServerVulnerability. - */ - public static final AssessedResourceType SQL_SERVER_VULNERABILITY = fromString("SqlServerVulnerability"); - - /** - * ContainerRegistryVulnerability. - */ - public static final AssessedResourceType CONTAINER_REGISTRY_VULNERABILITY - = fromString("ContainerRegistryVulnerability"); - - /** - * ServerVulnerability. - */ - public static final AssessedResourceType SERVER_VULNERABILITY = fromString("ServerVulnerability"); - - /** - * ServerVulnerabilityAssessment. - */ - public static final AssessedResourceType SERVER_VULNERABILITY_ASSESSMENT - = fromString("ServerVulnerabilityAssessment"); - - /** - * Creates a new instance of AssessedResourceType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AssessedResourceType() { - } - - /** - * Creates or finds a AssessedResourceType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AssessedResourceType. - */ - public static AssessedResourceType fromString(String name) { - return fromString(name, AssessedResourceType.class); - } - - /** - * Gets known AssessedResourceType values. - * - * @return known AssessedResourceType values. - */ - public static Collection values() { - return values(AssessedResourceType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentLinks.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentLinks.java deleted file mode 100644 index 4b7fa293404e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentLinks.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Links relevant to the assessment. - */ -@Immutable -public final class AssessmentLinks implements JsonSerializable { - /* - * Link to assessment in Azure Portal - */ - private String azurePortalUri; - - /** - * Creates an instance of AssessmentLinks class. - */ - private AssessmentLinks() { - } - - /** - * Get the azurePortalUri property: Link to assessment in Azure Portal. - * - * @return the azurePortalUri value. - */ - public String azurePortalUri() { - return this.azurePortalUri; - } - - /** - * 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 AssessmentLinks from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessmentLinks 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 AssessmentLinks. - */ - public static AssessmentLinks fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessmentLinks deserializedAssessmentLinks = new AssessmentLinks(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("azurePortalUri".equals(fieldName)) { - deserializedAssessmentLinks.azurePortalUri = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessmentLinks; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatus.java deleted file mode 100644 index 6900f02b344e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatus.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * The result of the assessment. - */ -@Fluent -public class AssessmentStatus implements JsonSerializable { - /* - * Programmatic code for the status of the assessment - */ - private AssessmentStatusCode code; - - /* - * Programmatic code for the cause of the assessment status - */ - private String cause; - - /* - * Human readable description of the assessment status - */ - private String description; - - /** - * Creates an instance of AssessmentStatus class. - */ - public AssessmentStatus() { - } - - /** - * Get the code property: Programmatic code for the status of the assessment. - * - * @return the code value. - */ - public AssessmentStatusCode code() { - return this.code; - } - - /** - * Set the code property: Programmatic code for the status of the assessment. - * - * @param code the code value to set. - * @return the AssessmentStatus object itself. - */ - public AssessmentStatus withCode(AssessmentStatusCode code) { - this.code = code; - return this; - } - - /** - * Get the cause property: Programmatic code for the cause of the assessment status. - * - * @return the cause value. - */ - public String cause() { - return this.cause; - } - - /** - * Set the cause property: Programmatic code for the cause of the assessment status. - * - * @param cause the cause value to set. - * @return the AssessmentStatus object itself. - */ - public AssessmentStatus withCause(String cause) { - this.cause = cause; - return this; - } - - /** - * Get the description property: Human readable description of the assessment status. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Human readable description of the assessment status. - * - * @param description the description value to set. - * @return the AssessmentStatus object itself. - */ - public AssessmentStatus withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (code() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property code in model AssessmentStatus")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AssessmentStatus.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("code", this.code == null ? null : this.code.toString()); - jsonWriter.writeStringField("cause", this.cause); - jsonWriter.writeStringField("description", this.description); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AssessmentStatus from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessmentStatus 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 AssessmentStatus. - */ - public static AssessmentStatus fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessmentStatus deserializedAssessmentStatus = new AssessmentStatus(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("code".equals(fieldName)) { - deserializedAssessmentStatus.code = AssessmentStatusCode.fromString(reader.getString()); - } else if ("cause".equals(fieldName)) { - deserializedAssessmentStatus.cause = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedAssessmentStatus.description = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessmentStatus; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatusCode.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatusCode.java deleted file mode 100644 index a83a3061e5a9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatusCode.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Programmatic code for the status of the assessment. - */ -public final class AssessmentStatusCode extends ExpandableStringEnum { - /** - * The resource is healthy. - */ - public static final AssessmentStatusCode HEALTHY = fromString("Healthy"); - - /** - * The resource has a security issue that needs to be addressed. - */ - public static final AssessmentStatusCode UNHEALTHY = fromString("Unhealthy"); - - /** - * Assessment for this resource did not happen. - */ - public static final AssessmentStatusCode NOT_APPLICABLE = fromString("NotApplicable"); - - /** - * Creates a new instance of AssessmentStatusCode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AssessmentStatusCode() { - } - - /** - * Creates or finds a AssessmentStatusCode from its string representation. - * - * @param name a name to look for. - * @return the corresponding AssessmentStatusCode. - */ - public static AssessmentStatusCode fromString(String name) { - return fromString(name, AssessmentStatusCode.class); - } - - /** - * Gets known AssessmentStatusCode values. - * - * @return known AssessmentStatusCode values. - */ - public static Collection values() { - return values(AssessmentStatusCode.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatusResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatusResponse.java deleted file mode 100644 index c115e6fe4a40..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatusResponse.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; - -/** - * The result of the assessment. - */ -@Immutable -public final class AssessmentStatusResponse extends AssessmentStatus { - /* - * The time that the assessment was created and first evaluated. Returned as UTC time in ISO 8601 format - */ - private OffsetDateTime firstEvaluationDate; - - /* - * The time that the status of the assessment last changed. Returned as UTC time in ISO 8601 format - */ - private OffsetDateTime statusChangeDate; - - /** - * Creates an instance of AssessmentStatusResponse class. - */ - private AssessmentStatusResponse() { - } - - /** - * Get the firstEvaluationDate property: The time that the assessment was created and first evaluated. Returned as - * UTC time in ISO 8601 format. - * - * @return the firstEvaluationDate value. - */ - public OffsetDateTime firstEvaluationDate() { - return this.firstEvaluationDate; - } - - /** - * Get the statusChangeDate property: The time that the status of the assessment last changed. Returned as UTC time - * in ISO 8601 format. - * - * @return the statusChangeDate value. - */ - public OffsetDateTime statusChangeDate() { - return this.statusChangeDate; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (code() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property code in model AssessmentStatusResponse")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AssessmentStatusResponse.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("code", code() == null ? null : code().toString()); - jsonWriter.writeStringField("cause", cause()); - jsonWriter.writeStringField("description", description()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AssessmentStatusResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssessmentStatusResponse 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 AssessmentStatusResponse. - */ - public static AssessmentStatusResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssessmentStatusResponse deserializedAssessmentStatusResponse = new AssessmentStatusResponse(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("code".equals(fieldName)) { - deserializedAssessmentStatusResponse.withCode(AssessmentStatusCode.fromString(reader.getString())); - } else if ("cause".equals(fieldName)) { - deserializedAssessmentStatusResponse.withCause(reader.getString()); - } else if ("description".equals(fieldName)) { - deserializedAssessmentStatusResponse.withDescription(reader.getString()); - } else if ("firstEvaluationDate".equals(fieldName)) { - deserializedAssessmentStatusResponse.firstEvaluationDate = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("statusChangeDate".equals(fieldName)) { - deserializedAssessmentStatusResponse.statusChangeDate = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedAssessmentStatusResponse; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentType.java deleted file mode 100644 index 793a8e66a965..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentType.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure - * Policy definition. - */ -public final class AssessmentType extends ExpandableStringEnum { - /** - * Unknown assessment type. - */ - public static final AssessmentType UNKNOWN = fromString("Unknown"); - - /** - * Microsoft Defender for Cloud managed assessments. - */ - public static final AssessmentType BUILT_IN = fromString("BuiltIn"); - - /** - * User defined custom assessments. - */ - public static final AssessmentType CUSTOM = fromString("Custom"); - - /** - * User defined policies that are automatically ingested from Azure Policy to Microsoft Defender for Cloud. - */ - public static final AssessmentType CUSTOM_POLICY = fromString("CustomPolicy"); - - /** - * User assessments pushed directly by the user or other third party to Microsoft Defender for Cloud. - */ - public static final AssessmentType CUSTOMER_MANAGED = fromString("CustomerManaged"); - - /** - * Microsoft Defender for Cloud managed policies. - */ - public static final AssessmentType BUILT_IN_POLICY = fromString("BuiltInPolicy"); - - /** - * Third party assessments that are verified by Microsoft Defender for Cloud. - */ - public static final AssessmentType VERIFIED_PARTNER = fromString("VerifiedPartner"); - - /** - * Microsoft Defender for Cloud managed policies that are manually created by the user. - */ - public static final AssessmentType MANUAL_BUILT_IN_POLICY = fromString("ManualBuiltInPolicy"); - - /** - * Microsoft Defender for Cloud managed assessments that are manually created by the user. - */ - public static final AssessmentType MANUAL_BUILT_IN = fromString("ManualBuiltIn"); - - /** - * User defined policies that are manually created by the user. - */ - public static final AssessmentType MANUAL_CUSTOM_POLICY = fromString("ManualCustomPolicy"); - - /** - * Microsoft Defender for Cloud managed assessments that are dynamically created by the system. - */ - public static final AssessmentType DYNAMIC_BUILT_IN = fromString("DynamicBuiltIn"); - - /** - * Creates a new instance of AssessmentType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AssessmentType() { - } - - /** - * Creates or finds a AssessmentType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AssessmentType. - */ - public static AssessmentType fromString(String name) { - return fromString(name, AssessmentType.class); - } - - /** - * Gets known AssessmentType values. - * - * @return known AssessmentType values. - */ - public static Collection values() { - return values(AssessmentType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Assessments.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Assessments.java deleted file mode 100644 index 98991383b6af..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Assessments.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of Assessments. - */ -public interface Assessments { - /** - * Get a security assessment on your scanned resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param expand OData expand. Optional. - * @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 security assessment on your scanned resource along with {@link Response}. - */ - Response getWithResponse(String resourceId, String assessmentName, ExpandEnum expand, - Context context); - - /** - * Get a security assessment on your scanned resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 security assessment on your scanned resource. - */ - SecurityAssessmentResponse get(String resourceId, String assessmentName); - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @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 deleteByResourceGroupWithResponse(String resourceId, String assessmentName, Context context); - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 deleteByResourceGroup(String resourceId, String assessmentName); - - /** - * Get security assessments on all your scanned resources inside a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 security assessments on all your scanned resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String scope); - - /** - * Get security assessments on all your scanned resources inside a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 security assessments on all your scanned resources inside a scope as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String scope, Context context); - - /** - * Get a security assessment on your scanned resource. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a security assessment on your scanned resource along with {@link Response}. - */ - SecurityAssessmentResponse getById(String id); - - /** - * Get a security assessment on your scanned resource. - * - * @param id the resource ID. - * @param expand OData expand. Optional. - * @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 security assessment on your scanned resource along with {@link Response}. - */ - Response getByIdWithResponse(String id, ExpandEnum expand, Context context); - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new SecurityAssessmentResponse resource. - * - * @param name resource name. - * @return the first stage of the new SecurityAssessmentResponse definition. - */ - SecurityAssessmentResponse.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentsMetadatas.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentsMetadatas.java deleted file mode 100644 index 95355f94463f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentsMetadatas.java +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of AssessmentsMetadatas. - */ -public interface AssessmentsMetadatas { - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @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 metadata information on an assessment type in a specific subscription along with {@link Response}. - */ - Response getInSubscriptionWithResponse(String assessmentMetadataName, - Context context); - - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type in a specific subscription. - */ - SecurityAssessmentMetadataResponse getInSubscription(String assessmentMetadataName); - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @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 deleteInSubscriptionWithResponse(String assessmentMetadataName, Context context); - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 deleteInSubscription(String assessmentMetadataName); - - /** - * Get metadata information on all assessment types in a specific 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 metadata information on all assessment types in a specific subscription as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listBySubscription(); - - /** - * Get metadata information on all assessment types in a specific 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 metadata information on all assessment types in a specific subscription as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listBySubscription(Context context); - - /** - * Get metadata information on an assessment type. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @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 metadata information on an assessment type along with {@link Response}. - */ - Response getWithResponse(String assessmentMetadataName, Context context); - - /** - * Get metadata information on an assessment type. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type. - */ - SecurityAssessmentMetadataResponse get(String assessmentMetadataName); - - /** - * Get metadata information on all assessment types. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on all assessment types as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Get metadata information on all assessment types. - * - * @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 metadata information on all assessment types as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @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 metadata information on an assessment type in a specific subscription along with {@link Response}. - */ - SecurityAssessmentMetadataResponse getInSubscriptionById(String id); - - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @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 metadata information on an assessment type in a specific subscription along with {@link Response}. - */ - Response getInSubscriptionByIdWithResponse(String id, Context context); - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @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 deleteInSubscriptionById(String id); - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteInSubscriptionByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new SecurityAssessmentMetadataResponse resource. - * - * @param name resource name. - * @return the first stage of the new SecurityAssessmentMetadataResponse definition. - */ - SecurityAssessmentMetadataResponse.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssignedAssessmentItem.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssignedAssessmentItem.java deleted file mode 100644 index 0e2621fdd6cd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssignedAssessmentItem.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * Describe the properties of a security assessment object reference (by key). - */ -@Fluent -public final class AssignedAssessmentItem implements JsonSerializable { - /* - * Unique key to a security assessment object - */ - private String assessmentKey; - - /** - * Creates an instance of AssignedAssessmentItem class. - */ - public AssignedAssessmentItem() { - } - - /** - * Get the assessmentKey property: Unique key to a security assessment object. - * - * @return the assessmentKey value. - */ - public String assessmentKey() { - return this.assessmentKey; - } - - /** - * Set the assessmentKey property: Unique key to a security assessment object. - * - * @param assessmentKey the assessmentKey value to set. - * @return the AssignedAssessmentItem object itself. - */ - public AssignedAssessmentItem withAssessmentKey(String assessmentKey) { - this.assessmentKey = assessmentKey; - 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("assessmentKey", this.assessmentKey); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AssignedAssessmentItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssignedAssessmentItem 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 AssignedAssessmentItem. - */ - public static AssignedAssessmentItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssignedAssessmentItem deserializedAssignedAssessmentItem = new AssignedAssessmentItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("assessmentKey".equals(fieldName)) { - deserializedAssignedAssessmentItem.assessmentKey = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAssignedAssessmentItem; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssignedComponentItem.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssignedComponentItem.java deleted file mode 100644 index e2a88e2e8d77..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssignedComponentItem.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * describe the properties of a security assessment object reference (by key). - */ -@Fluent -public final class AssignedComponentItem implements JsonSerializable { - /* - * unique key to a security assessment object - */ - private String key; - - /** - * Creates an instance of AssignedComponentItem class. - */ - public AssignedComponentItem() { - } - - /** - * Get the key property: unique key to a security assessment object. - * - * @return the key value. - */ - public String key() { - return this.key; - } - - /** - * Set the key property: unique key to a security assessment object. - * - * @param key the key value to set. - * @return the AssignedComponentItem object itself. - */ - public AssignedComponentItem withKey(String key) { - this.key = key; - 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("key", this.key); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AssignedComponentItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssignedComponentItem 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 AssignedComponentItem. - */ - public static AssignedComponentItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssignedComponentItem deserializedAssignedComponentItem = new AssignedComponentItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("key".equals(fieldName)) { - deserializedAssignedComponentItem.key = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAssignedComponentItem; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssignedStandardItem.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssignedStandardItem.java deleted file mode 100644 index 511c9d9e9fcd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssignedStandardItem.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * Describe the properties of a of a standard assignments object reference. - */ -@Fluent -public final class AssignedStandardItem implements JsonSerializable { - /* - * Full resourceId of the Microsoft.Security/standard object - */ - private String id; - - /** - * Creates an instance of AssignedStandardItem class. - */ - public AssignedStandardItem() { - } - - /** - * Get the id property: Full resourceId of the Microsoft.Security/standard object. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Full resourceId of the Microsoft.Security/standard object. - * - * @param id the id value to set. - * @return the AssignedStandardItem object itself. - */ - public AssignedStandardItem 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 AssignedStandardItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssignedStandardItem 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 AssignedStandardItem. - */ - public static AssignedStandardItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssignedStandardItem deserializedAssignedStandardItem = new AssignedStandardItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAssignedStandardItem.id = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAssignedStandardItem; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Assignment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Assignment.java deleted file mode 100644 index 68c867dfc267..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Assignment.java +++ /dev/null @@ -1,625 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AssignmentInner; -import java.time.OffsetDateTime; -import java.util.Map; - -/** - * An immutable client-side representation of Assignment. - */ -public interface Assignment { - /** - * 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 tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the kind property: Kind of the resource. - * - * @return the kind value. - */ - String kind(); - - /** - * Gets the etag property: Entity tag is used for comparing two or more entities from the same requested resource. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the displayName property: display name of the standardAssignment. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the description property: description of the standardAssignment. - * - * @return the description value. - */ - String description(); - - /** - * Gets the assignedStandard property: Standard item with key as applied to this standard assignment over the given - * scope. - * - * @return the assignedStandard value. - */ - AssignedStandardItem assignedStandard(); - - /** - * Gets the assignedComponent property: Component item with key as applied to this standard assignment over the - * given scope. - * - * @return the assignedComponent value. - */ - AssignedComponentItem assignedComponent(); - - /** - * Gets the scope property: Scope to which the standardAssignment applies - can be a subscription path or a resource - * group under that subscription. - * - * @return the scope value. - */ - String scope(); - - /** - * Gets the effect property: expected effect of this assignment (Disable/Exempt/etc). - * - * @return the effect value. - */ - String effect(); - - /** - * Gets the expiresOn property: Expiration date of this assignment as a full ISO date. - * - * @return the expiresOn value. - */ - OffsetDateTime expiresOn(); - - /** - * Gets the additionalData property: Additional data about the assignment. - * - * @return the additionalData value. - */ - AssignmentPropertiesAdditionalData additionalData(); - - /** - * Gets the metadata property: The assignment metadata. Metadata is an open ended object and is typically a - * collection of key value pairs. - * - * @return the metadata value. - */ - Object metadata(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AssignmentInner object. - * - * @return the inner object. - */ - AssignmentInner innerModel(); - - /** - * The entirety of the Assignment definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { - } - - /** - * The Assignment definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the Assignment definition. - */ - interface Blank extends WithResourceGroup { - } - - /** - * The stage of the Assignment definition allowing to specify parent resource. - */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @return the next definition stage. - */ - WithCreate withExistingResourceGroup(String resourceGroupName); - } - - /** - * The stage of the Assignment 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.WithLocation, DefinitionStages.WithTags, - DefinitionStages.WithKind, DefinitionStages.WithEtag, DefinitionStages.WithDisplayName, - DefinitionStages.WithDescription, DefinitionStages.WithAssignedStandard, - DefinitionStages.WithAssignedComponent, DefinitionStages.WithScope, DefinitionStages.WithEffect, - DefinitionStages.WithExpiresOn, DefinitionStages.WithAdditionalData, DefinitionStages.WithMetadata { - /** - * Executes the create request. - * - * @return the created resource. - */ - Assignment create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Assignment create(Context context); - } - - /** - * The stage of the Assignment definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(String location); - } - - /** - * The stage of the Assignment definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the Assignment definition allowing to specify kind. - */ - interface WithKind { - /** - * Specifies the kind property: Kind of the resource. - * - * @param kind Kind of the resource. - * @return the next definition stage. - */ - WithCreate withKind(String kind); - } - - /** - * The stage of the Assignment definition allowing to specify etag. - */ - interface WithEtag { - /** - * Specifies the etag property: Entity tag is used for comparing two or more entities from the same - * requested resource.. - * - * @param etag Entity tag is used for comparing two or more entities from the same requested resource. - * @return the next definition stage. - */ - WithCreate withEtag(String etag); - } - - /** - * The stage of the Assignment definition allowing to specify displayName. - */ - interface WithDisplayName { - /** - * Specifies the displayName property: display name of the standardAssignment. - * - * @param displayName display name of the standardAssignment. - * @return the next definition stage. - */ - WithCreate withDisplayName(String displayName); - } - - /** - * The stage of the Assignment definition allowing to specify description. - */ - interface WithDescription { - /** - * Specifies the description property: description of the standardAssignment. - * - * @param description description of the standardAssignment. - * @return the next definition stage. - */ - WithCreate withDescription(String description); - } - - /** - * The stage of the Assignment definition allowing to specify assignedStandard. - */ - interface WithAssignedStandard { - /** - * Specifies the assignedStandard property: Standard item with key as applied to this standard assignment - * over the given scope. - * - * @param assignedStandard Standard item with key as applied to this standard assignment over the given - * scope. - * @return the next definition stage. - */ - WithCreate withAssignedStandard(AssignedStandardItem assignedStandard); - } - - /** - * The stage of the Assignment definition allowing to specify assignedComponent. - */ - interface WithAssignedComponent { - /** - * Specifies the assignedComponent property: Component item with key as applied to this standard assignment - * over the given scope. - * - * @param assignedComponent Component item with key as applied to this standard assignment over the given - * scope. - * @return the next definition stage. - */ - WithCreate withAssignedComponent(AssignedComponentItem assignedComponent); - } - - /** - * The stage of the Assignment definition allowing to specify scope. - */ - interface WithScope { - /** - * Specifies the scope property: Scope to which the standardAssignment applies - can be a subscription path - * or a resource group under that subscription. - * - * @param scope Scope to which the standardAssignment applies - can be a subscription path or a resource - * group under that subscription. - * @return the next definition stage. - */ - WithCreate withScope(String scope); - } - - /** - * The stage of the Assignment definition allowing to specify effect. - */ - interface WithEffect { - /** - * Specifies the effect property: expected effect of this assignment (Disable/Exempt/etc). - * - * @param effect expected effect of this assignment (Disable/Exempt/etc). - * @return the next definition stage. - */ - WithCreate withEffect(String effect); - } - - /** - * The stage of the Assignment definition allowing to specify expiresOn. - */ - interface WithExpiresOn { - /** - * Specifies the expiresOn property: Expiration date of this assignment as a full ISO date. - * - * @param expiresOn Expiration date of this assignment as a full ISO date. - * @return the next definition stage. - */ - WithCreate withExpiresOn(OffsetDateTime expiresOn); - } - - /** - * The stage of the Assignment definition allowing to specify additionalData. - */ - interface WithAdditionalData { - /** - * Specifies the additionalData property: Additional data about the assignment. - * - * @param additionalData Additional data about the assignment. - * @return the next definition stage. - */ - WithCreate withAdditionalData(AssignmentPropertiesAdditionalData additionalData); - } - - /** - * The stage of the Assignment definition allowing to specify metadata. - */ - interface WithMetadata { - /** - * Specifies the metadata property: The assignment metadata. Metadata is an open ended object and is - * typically a collection of key value pairs.. - * - * @param metadata The assignment metadata. Metadata is an open ended object and is typically a collection - * of key value pairs. - * @return the next definition stage. - */ - WithCreate withMetadata(Object metadata); - } - } - - /** - * Begins update for the Assignment resource. - * - * @return the stage of resource update. - */ - Assignment.Update update(); - - /** - * The template for Assignment update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithKind, UpdateStages.WithEtag, - UpdateStages.WithDisplayName, UpdateStages.WithDescription, UpdateStages.WithAssignedStandard, - UpdateStages.WithAssignedComponent, UpdateStages.WithScope, UpdateStages.WithEffect, UpdateStages.WithExpiresOn, - UpdateStages.WithAdditionalData, UpdateStages.WithMetadata { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Assignment apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Assignment apply(Context context); - } - - /** - * The Assignment update stages. - */ - interface UpdateStages { - /** - * The stage of the Assignment update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the Assignment update allowing to specify kind. - */ - interface WithKind { - /** - * Specifies the kind property: Kind of the resource. - * - * @param kind Kind of the resource. - * @return the next definition stage. - */ - Update withKind(String kind); - } - - /** - * The stage of the Assignment update allowing to specify etag. - */ - interface WithEtag { - /** - * Specifies the etag property: Entity tag is used for comparing two or more entities from the same - * requested resource.. - * - * @param etag Entity tag is used for comparing two or more entities from the same requested resource. - * @return the next definition stage. - */ - Update withEtag(String etag); - } - - /** - * The stage of the Assignment update allowing to specify displayName. - */ - interface WithDisplayName { - /** - * Specifies the displayName property: display name of the standardAssignment. - * - * @param displayName display name of the standardAssignment. - * @return the next definition stage. - */ - Update withDisplayName(String displayName); - } - - /** - * The stage of the Assignment update allowing to specify description. - */ - interface WithDescription { - /** - * Specifies the description property: description of the standardAssignment. - * - * @param description description of the standardAssignment. - * @return the next definition stage. - */ - Update withDescription(String description); - } - - /** - * The stage of the Assignment update allowing to specify assignedStandard. - */ - interface WithAssignedStandard { - /** - * Specifies the assignedStandard property: Standard item with key as applied to this standard assignment - * over the given scope. - * - * @param assignedStandard Standard item with key as applied to this standard assignment over the given - * scope. - * @return the next definition stage. - */ - Update withAssignedStandard(AssignedStandardItem assignedStandard); - } - - /** - * The stage of the Assignment update allowing to specify assignedComponent. - */ - interface WithAssignedComponent { - /** - * Specifies the assignedComponent property: Component item with key as applied to this standard assignment - * over the given scope. - * - * @param assignedComponent Component item with key as applied to this standard assignment over the given - * scope. - * @return the next definition stage. - */ - Update withAssignedComponent(AssignedComponentItem assignedComponent); - } - - /** - * The stage of the Assignment update allowing to specify scope. - */ - interface WithScope { - /** - * Specifies the scope property: Scope to which the standardAssignment applies - can be a subscription path - * or a resource group under that subscription. - * - * @param scope Scope to which the standardAssignment applies - can be a subscription path or a resource - * group under that subscription. - * @return the next definition stage. - */ - Update withScope(String scope); - } - - /** - * The stage of the Assignment update allowing to specify effect. - */ - interface WithEffect { - /** - * Specifies the effect property: expected effect of this assignment (Disable/Exempt/etc). - * - * @param effect expected effect of this assignment (Disable/Exempt/etc). - * @return the next definition stage. - */ - Update withEffect(String effect); - } - - /** - * The stage of the Assignment update allowing to specify expiresOn. - */ - interface WithExpiresOn { - /** - * Specifies the expiresOn property: Expiration date of this assignment as a full ISO date. - * - * @param expiresOn Expiration date of this assignment as a full ISO date. - * @return the next definition stage. - */ - Update withExpiresOn(OffsetDateTime expiresOn); - } - - /** - * The stage of the Assignment update allowing to specify additionalData. - */ - interface WithAdditionalData { - /** - * Specifies the additionalData property: Additional data about the assignment. - * - * @param additionalData Additional data about the assignment. - * @return the next definition stage. - */ - Update withAdditionalData(AssignmentPropertiesAdditionalData additionalData); - } - - /** - * The stage of the Assignment update allowing to specify metadata. - */ - interface WithMetadata { - /** - * Specifies the metadata property: The assignment metadata. Metadata is an open ended object and is - * typically a collection of key value pairs.. - * - * @param metadata The assignment metadata. Metadata is an open ended object and is typically a collection - * of key value pairs. - * @return the next definition stage. - */ - Update withMetadata(Object metadata); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Assignment refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Assignment refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssignmentPropertiesAdditionalData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssignmentPropertiesAdditionalData.java deleted file mode 100644 index d41a8fea8430..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssignmentPropertiesAdditionalData.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * Additional data about the assignment. - */ -@Fluent -public final class AssignmentPropertiesAdditionalData implements JsonSerializable { - /* - * Exemption category of this assignment - */ - private String exemptionCategory; - - /** - * Creates an instance of AssignmentPropertiesAdditionalData class. - */ - public AssignmentPropertiesAdditionalData() { - } - - /** - * Get the exemptionCategory property: Exemption category of this assignment. - * - * @return the exemptionCategory value. - */ - public String exemptionCategory() { - return this.exemptionCategory; - } - - /** - * Set the exemptionCategory property: Exemption category of this assignment. - * - * @param exemptionCategory the exemptionCategory value to set. - * @return the AssignmentPropertiesAdditionalData object itself. - */ - public AssignmentPropertiesAdditionalData withExemptionCategory(String exemptionCategory) { - this.exemptionCategory = exemptionCategory; - 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("exemptionCategory", this.exemptionCategory); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AssignmentPropertiesAdditionalData from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AssignmentPropertiesAdditionalData 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 AssignmentPropertiesAdditionalData. - */ - public static AssignmentPropertiesAdditionalData fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AssignmentPropertiesAdditionalData deserializedAssignmentPropertiesAdditionalData - = new AssignmentPropertiesAdditionalData(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("exemptionCategory".equals(fieldName)) { - deserializedAssignmentPropertiesAdditionalData.exemptionCategory = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAssignmentPropertiesAdditionalData; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Assignments.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Assignments.java deleted file mode 100644 index 40749bdd6955..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Assignments.java +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of Assignments. - */ -public interface Assignments { - /** - * Get a specific standard assignment for the requested scope by resourceId. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific standard assignment for the requested scope by resourceId along with {@link Response}. - */ - Response getByResourceGroupWithResponse(String resourceGroupName, String assignmentId, Context context); - - /** - * Get a specific standard assignment for the requested scope by resourceId. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 standard assignment for the requested scope by resourceId. - */ - Assignment getByResourceGroup(String resourceGroupName, String assignmentId); - - /** - * Delete a standard assignment over a given scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @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 deleteByResourceGroupWithResponse(String resourceGroupName, String assignmentId, Context context); - - /** - * Delete a standard assignment over a given scope. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param assignmentId The security assignment key - unique key for the standard assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 deleteByResourceGroup(String resourceGroupName, String assignmentId); - - /** - * Get a list of all relevant standardAssignments available for scope. - * - * @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 a list of all relevant standardAssignments available for scope as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Get a list of all relevant standardAssignments available for scope. - * - * @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 a list of all relevant standardAssignments available for scope as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Get a list of all relevant standardAssignments over a subscription level scope. - * - * @throws com.azure.core.management.exception.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 relevant standardAssignments over a subscription level scope as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Get a list of all relevant standardAssignments over a subscription level scope. - * - * @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 all relevant standardAssignments over a subscription level scope as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Get a specific standard assignment for the requested scope by resourceId. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific standard assignment for the requested scope by resourceId along with {@link Response}. - */ - Assignment getById(String id); - - /** - * Get a specific standard assignment for the requested scope by resourceId. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific standard assignment for the requested scope by resourceId along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete a standard assignment over a given scope. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete a standard assignment over a given scope. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new Assignment resource. - * - * @param name resource name. - * @return the first stage of the new Assignment definition. - */ - Assignment.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AtaExternalSecuritySolution.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AtaExternalSecuritySolution.java deleted file mode 100644 index b2fa25cbdbf9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AtaExternalSecuritySolution.java +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner; -import java.io.IOException; - -/** - * Represents an ATA security solution which sends logs to an OMS workspace. - */ -@Immutable -public final class AtaExternalSecuritySolution extends ExternalSecuritySolutionInner { - /* - * The kind of the external solution - */ - private ExternalSecuritySolutionKind kind = ExternalSecuritySolutionKind.ATA; - - /* - * The external security solution properties for ATA solutions - */ - private AtaSolutionProperties properties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * Location where the resource is stored - */ - private String location; - - /* - * 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 AtaExternalSecuritySolution class. - */ - private AtaExternalSecuritySolution() { - } - - /** - * Get the kind property: The kind of the external solution. - * - * @return the kind value. - */ - @Override - public ExternalSecuritySolutionKind kind() { - return this.kind; - } - - /** - * Get the properties property: The external security solution properties for ATA solutions. - * - * @return the properties value. - */ - @Override - public AtaSolutionProperties properties() { - return this.properties; - } - - /** - * 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 location property: Location where the resource is stored. - * - * @return the location value. - */ - @Override - public String location() { - return this.location; - } - - /** - * 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. - */ - @Override - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AtaExternalSecuritySolution from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AtaExternalSecuritySolution 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 AtaExternalSecuritySolution. - */ - public static AtaExternalSecuritySolution fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AtaExternalSecuritySolution deserializedAtaExternalSecuritySolution = new AtaExternalSecuritySolution(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAtaExternalSecuritySolution.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAtaExternalSecuritySolution.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAtaExternalSecuritySolution.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedAtaExternalSecuritySolution.location = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedAtaExternalSecuritySolution.systemData = SystemData.fromJson(reader); - } else if ("kind".equals(fieldName)) { - deserializedAtaExternalSecuritySolution.kind - = ExternalSecuritySolutionKind.fromString(reader.getString()); - } else if ("properties".equals(fieldName)) { - deserializedAtaExternalSecuritySolution.properties = AtaSolutionProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAtaExternalSecuritySolution; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AtaSolutionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AtaSolutionProperties.java deleted file mode 100644 index 8a3c4dcd3786..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AtaSolutionProperties.java +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * The external security solution properties for ATA solutions. - */ -@Immutable -public final class AtaSolutionProperties extends ExternalSecuritySolutionProperties { - /* - * The lastEventReceived property. - */ - private String lastEventReceived; - - /* - * The solution properties (correspond to the solution kind) - */ - private Map additionalProperties; - - /* - * Represents an OMS workspace to which the solution is connected - */ - private ConnectedWorkspace workspace; - - /* - * The deviceType property. - */ - private String deviceType; - - /* - * The deviceVendor property. - */ - private String deviceVendor; - - /** - * Creates an instance of AtaSolutionProperties class. - */ - private AtaSolutionProperties() { - } - - /** - * Get the lastEventReceived property: The lastEventReceived property. - * - * @return the lastEventReceived value. - */ - public String lastEventReceived() { - return this.lastEventReceived; - } - - /** - * Get the additionalProperties property: The solution properties (correspond to the solution kind). - * - * @return the additionalProperties value. - */ - @Override - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Get the workspace property: Represents an OMS workspace to which the solution is connected. - * - * @return the workspace value. - */ - @Override - public ConnectedWorkspace workspace() { - return this.workspace; - } - - /** - * Get the deviceType property: The deviceType property. - * - * @return the deviceType value. - */ - @Override - public String deviceType() { - return this.deviceType; - } - - /** - * Get the deviceVendor property: The deviceVendor property. - * - * @return the deviceVendor value. - */ - @Override - public String deviceVendor() { - return this.deviceVendor; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (workspace() != null) { - workspace().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("deviceVendor", deviceVendor()); - jsonWriter.writeStringField("deviceType", deviceType()); - jsonWriter.writeJsonField("workspace", workspace()); - jsonWriter.writeStringField("lastEventReceived", this.lastEventReceived); - if (additionalProperties() != null) { - for (Map.Entry additionalProperty : additionalProperties().entrySet()) { - jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); - } - } - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AtaSolutionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AtaSolutionProperties 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 AtaSolutionProperties. - */ - public static AtaSolutionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AtaSolutionProperties deserializedAtaSolutionProperties = new AtaSolutionProperties(); - Map additionalProperties = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("deviceVendor".equals(fieldName)) { - deserializedAtaSolutionProperties.deviceVendor = reader.getString(); - } else if ("deviceType".equals(fieldName)) { - deserializedAtaSolutionProperties.deviceType = reader.getString(); - } else if ("workspace".equals(fieldName)) { - deserializedAtaSolutionProperties.workspace = ConnectedWorkspace.fromJson(reader); - } else if ("lastEventReceived".equals(fieldName)) { - deserializedAtaSolutionProperties.lastEventReceived = reader.getString(); - } else { - if (additionalProperties == null) { - additionalProperties = new LinkedHashMap<>(); - } - - additionalProperties.put(fieldName, reader.readUntyped()); - } - } - deserializedAtaSolutionProperties.additionalProperties = additionalProperties; - - return deserializedAtaSolutionProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AttestationComplianceState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AttestationComplianceState.java deleted file mode 100644 index 6c161689a42f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AttestationComplianceState.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Attest category of this assignment. - */ -public final class AttestationComplianceState extends ExpandableStringEnum { - /** - * unknown. - */ - public static final AttestationComplianceState UNKNOWN = fromString("unknown"); - - /** - * compliant. - */ - public static final AttestationComplianceState COMPLIANT = fromString("compliant"); - - /** - * nonCompliant. - */ - public static final AttestationComplianceState NON_COMPLIANT = fromString("nonCompliant"); - - /** - * Creates a new instance of AttestationComplianceState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AttestationComplianceState() { - } - - /** - * Creates or finds a AttestationComplianceState from its string representation. - * - * @param name a name to look for. - * @return the corresponding AttestationComplianceState. - */ - public static AttestationComplianceState fromString(String name) { - return fromString(name, AttestationComplianceState.class); - } - - /** - * Gets known AttestationComplianceState values. - * - * @return known AttestationComplianceState values. - */ - public static Collection values() { - return values(AttestationComplianceState.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AttestationEvidence.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AttestationEvidence.java deleted file mode 100644 index 2d22a4ed0ecd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AttestationEvidence.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * Describe the properties of a assignment attestation. - */ -@Fluent -public final class AttestationEvidence implements JsonSerializable { - /* - * The description of the evidence - */ - private String description; - - /* - * The source url of the evidence - */ - private String sourceUrl; - - /** - * Creates an instance of AttestationEvidence class. - */ - public AttestationEvidence() { - } - - /** - * Get the description property: The description of the evidence. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description of the evidence. - * - * @param description the description value to set. - * @return the AttestationEvidence object itself. - */ - public AttestationEvidence withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the sourceUrl property: The source url of the evidence. - * - * @return the sourceUrl value. - */ - public String sourceUrl() { - return this.sourceUrl; - } - - /** - * Set the sourceUrl property: The source url of the evidence. - * - * @param sourceUrl the sourceUrl value to set. - * @return the AttestationEvidence object itself. - */ - public AttestationEvidence withSourceUrl(String sourceUrl) { - this.sourceUrl = sourceUrl; - 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("description", this.description); - jsonWriter.writeStringField("sourceUrl", this.sourceUrl); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AttestationEvidence from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AttestationEvidence 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 AttestationEvidence. - */ - public static AttestationEvidence fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AttestationEvidence deserializedAttestationEvidence = new AttestationEvidence(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedAttestationEvidence.description = reader.getString(); - } else if ("sourceUrl".equals(fieldName)) { - deserializedAttestationEvidence.sourceUrl = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAttestationEvidence; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Authentication.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Authentication.java deleted file mode 100644 index bfb6d9c4111e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Authentication.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The environment authentication details. - */ -@Immutable -public class Authentication implements JsonSerializable { - /* - * The authentication type - */ - private AuthenticationType authenticationType = AuthenticationType.fromString("Authentication"); - - /** - * Creates an instance of Authentication class. - */ - public Authentication() { - } - - /** - * Get the authenticationType property: The authentication type. - * - * @return the authenticationType value. - */ - public AuthenticationType authenticationType() { - return this.authenticationType; - } - - /** - * 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("authenticationType", - this.authenticationType == null ? null : this.authenticationType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Authentication from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Authentication 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 Authentication. - */ - public static Authentication fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("authenticationType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AccessToken".equals(discriminatorValue)) { - return AccessTokenAuthentication.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static Authentication fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Authentication deserializedAuthentication = new Authentication(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("authenticationType".equals(fieldName)) { - deserializedAuthentication.authenticationType = AuthenticationType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAuthentication; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationType.java deleted file mode 100644 index 4d1fa499ab72..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationType.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The authentication type. - */ -public final class AuthenticationType extends ExpandableStringEnum { - /** - * AccessToken. - */ - public static final AuthenticationType ACCESS_TOKEN = fromString("AccessToken"); - - /** - * Creates a new instance of AuthenticationType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AuthenticationType() { - } - - /** - * Creates or finds a AuthenticationType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AuthenticationType. - */ - public static AuthenticationType fromString(String name) { - return fromString(name, AuthenticationType.class); - } - - /** - * Gets known AuthenticationType values. - * - * @return known AuthenticationType values. - */ - public static Collection values() { - return values(AuthenticationType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Authorization.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Authorization.java deleted file mode 100644 index aaac37763d1d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Authorization.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * Authorization payload. - */ -@Fluent -public final class Authorization implements JsonSerializable { - /* - * Gets or sets one-time OAuth code to exchange for refresh and access tokens. - * - * Only used during PUT/PATCH operations. The secret is cleared during GET. - */ - private String code; - - /** - * Creates an instance of Authorization class. - */ - public Authorization() { - } - - /** - * Get the code property: Gets or sets one-time OAuth code to exchange for refresh and access tokens. - * - * Only used during PUT/PATCH operations. The secret is cleared during GET. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Set the code property: Gets or sets one-time OAuth code to exchange for refresh and access tokens. - * - * Only used during PUT/PATCH operations. The secret is cleared during GET. - * - * @param code the code value to set. - * @return the Authorization object itself. - */ - public Authorization withCode(String code) { - this.code = code; - 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("code", this.code); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Authorization from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Authorization 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 Authorization. - */ - public static Authorization fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Authorization deserializedAuthorization = new Authorization(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("code".equals(fieldName)) { - deserializedAuthorization.code = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAuthorization; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoDiscovery.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoDiscovery.java deleted file mode 100644 index d48e90e7c71a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoDiscovery.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * AutoDiscovery states. - */ -public final class AutoDiscovery extends ExpandableStringEnum { - /** - * Disabled. - */ - public static final AutoDiscovery DISABLED = fromString("Disabled"); - - /** - * Enabled. - */ - public static final AutoDiscovery ENABLED = fromString("Enabled"); - - /** - * NotApplicable. - */ - public static final AutoDiscovery NOT_APPLICABLE = fromString("NotApplicable"); - - /** - * Creates a new instance of AutoDiscovery value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AutoDiscovery() { - } - - /** - * Creates or finds a AutoDiscovery from its string representation. - * - * @param name a name to look for. - * @return the corresponding AutoDiscovery. - */ - public static AutoDiscovery fromString(String name) { - return fromString(name, AutoDiscovery.class); - } - - /** - * Gets known AutoDiscovery values. - * - * @return known AutoDiscovery values. - */ - public static Collection values() { - return values(AutoDiscovery.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvision.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvision.java deleted file mode 100644 index 100209726127..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvision.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Describes what kind of security agent provisioning action to take. - */ -public final class AutoProvision extends ExpandableStringEnum { - /** - * Install missing security agent on VMs automatically. - */ - public static final AutoProvision ON = fromString("On"); - - /** - * Do not install security agent on the VMs automatically. - */ - public static final AutoProvision OFF = fromString("Off"); - - /** - * Creates a new instance of AutoProvision value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AutoProvision() { - } - - /** - * Creates or finds a AutoProvision from its string representation. - * - * @param name a name to look for. - * @return the corresponding AutoProvision. - */ - public static AutoProvision fromString(String name) { - return fromString(name, AutoProvision.class); - } - - /** - * Gets known AutoProvision values. - * - * @return known AutoProvision values. - */ - public static Collection values() { - return values(AutoProvision.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSetting.java deleted file mode 100644 index 8fa3c5f8a283..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSetting.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; - -/** - * An immutable client-side representation of AutoProvisioningSetting. - */ -public interface AutoProvisioningSetting { - /** - * 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 autoProvision property: Describes what kind of security agent provisioning action to take. - * - * @return the autoProvision value. - */ - AutoProvision autoProvision(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner object. - * - * @return the inner object. - */ - AutoProvisioningSettingInner innerModel(); - - /** - * The entirety of the AutoProvisioningSetting definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { - } - - /** - * The AutoProvisioningSetting definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the AutoProvisioningSetting definition. - */ - interface Blank extends WithCreate { - } - - /** - * The stage of the AutoProvisioningSetting 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.WithAutoProvision { - /** - * Executes the create request. - * - * @return the created resource. - */ - AutoProvisioningSetting create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - AutoProvisioningSetting create(Context context); - } - - /** - * The stage of the AutoProvisioningSetting definition allowing to specify autoProvision. - */ - interface WithAutoProvision { - /** - * Specifies the autoProvision property: Describes what kind of security agent provisioning action to take. - * - * @param autoProvision Describes what kind of security agent provisioning action to take. - * @return the next definition stage. - */ - WithCreate withAutoProvision(AutoProvision autoProvision); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - AutoProvisioningSetting refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - AutoProvisioningSetting refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSettings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSettings.java deleted file mode 100644 index f613da53e326..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSettings.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of AutoProvisioningSettings. - */ -public interface AutoProvisioningSettings { - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @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 auto provisioning setting along with {@link Response}. - */ - Response getWithResponse(String settingName, Context context); - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting. - */ - AutoProvisioningSetting get(String settingName); - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Details of a specific setting. - * - * @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 auto provisioning setting along with {@link Response}. - */ - AutoProvisioningSetting getById(String id); - - /** - * Details of a specific setting. - * - * @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 auto provisioning setting along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new AutoProvisioningSetting resource. - * - * @param name resource name. - * @return the first stage of the new AutoProvisioningSetting definition. - */ - AutoProvisioningSetting.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomatedResponseType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomatedResponseType.java deleted file mode 100644 index 586d4b2f11c5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomatedResponseType.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Optional. Specifies the automated response action to take when malware is detected. - */ -public final class AutomatedResponseType extends ExpandableStringEnum { - /** - * No automated response will be taken when malware is detected. - */ - public static final AutomatedResponseType NONE = fromString("None"); - - /** - * The blob will be soft deleted when malware is detected. - */ - public static final AutomatedResponseType BLOB_SOFT_DELETE = fromString("BlobSoftDelete"); - - /** - * Creates a new instance of AutomatedResponseType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AutomatedResponseType() { - } - - /** - * Creates or finds a AutomatedResponseType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AutomatedResponseType. - */ - public static AutomatedResponseType fromString(String name) { - return fromString(name, AutomatedResponseType.class); - } - - /** - * Gets known AutomatedResponseType values. - * - * @return known AutomatedResponseType values. - */ - public static Collection values() { - return values(AutomatedResponseType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automation.java deleted file mode 100644 index 5841245a7eb4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automation.java +++ /dev/null @@ -1,489 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import java.util.List; -import java.util.Map; - -/** - * An immutable client-side representation of Automation. - */ -public interface Automation { - /** - * 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 tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the kind property: Kind of the resource. - * - * @return the kind value. - */ - String kind(); - - /** - * Gets the etag property: Entity tag is used for comparing two or more entities from the same requested resource. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the description property: The security automation description. - * - * @return the description value. - */ - String description(); - - /** - * Gets the isEnabled property: Indicates whether the security automation is enabled. - * - * @return the isEnabled value. - */ - Boolean isEnabled(); - - /** - * Gets the scopes property: A collection of scopes on which the security automations logic is applied. Supported - * scopes are the subscription itself or a resource group under that subscription. The automation will only apply on - * defined scopes. - * - * @return the scopes value. - */ - List scopes(); - - /** - * Gets the sources property: A collection of the source event types which evaluate the security automation set of - * rules. - * - * @return the sources value. - */ - List sources(); - - /** - * Gets the actions property: A collection of the actions which are triggered if all the configured rules - * evaluations, within at least one rule set, are true. - * - * @return the actions value. - */ - List actions(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AutomationInner object. - * - * @return the inner object. - */ - AutomationInner innerModel(); - - /** - * The entirety of the Automation definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { - } - - /** - * The Automation definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the Automation definition. - */ - interface Blank extends WithResourceGroup { - } - - /** - * The stage of the Automation definition allowing to specify parent resource. - */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @return the next definition stage. - */ - WithCreate withExistingResourceGroup(String resourceGroupName); - } - - /** - * The stage of the Automation 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.WithLocation, DefinitionStages.WithTags, DefinitionStages.WithKind, - DefinitionStages.WithEtag, DefinitionStages.WithDescription, DefinitionStages.WithIsEnabled, - DefinitionStages.WithScopes, DefinitionStages.WithSources, DefinitionStages.WithActions { - /** - * Executes the create request. - * - * @return the created resource. - */ - Automation create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Automation create(Context context); - } - - /** - * The stage of the Automation definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithCreate withRegion(String location); - } - - /** - * The stage of the Automation definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the Automation definition allowing to specify kind. - */ - interface WithKind { - /** - * Specifies the kind property: Kind of the resource. - * - * @param kind Kind of the resource. - * @return the next definition stage. - */ - WithCreate withKind(String kind); - } - - /** - * The stage of the Automation definition allowing to specify etag. - */ - interface WithEtag { - /** - * Specifies the etag property: Entity tag is used for comparing two or more entities from the same - * requested resource.. - * - * @param etag Entity tag is used for comparing two or more entities from the same requested resource. - * @return the next definition stage. - */ - WithCreate withEtag(String etag); - } - - /** - * The stage of the Automation definition allowing to specify description. - */ - interface WithDescription { - /** - * Specifies the description property: The security automation description.. - * - * @param description The security automation description. - * @return the next definition stage. - */ - WithCreate withDescription(String description); - } - - /** - * The stage of the Automation definition allowing to specify isEnabled. - */ - interface WithIsEnabled { - /** - * Specifies the isEnabled property: Indicates whether the security automation is enabled.. - * - * @param isEnabled Indicates whether the security automation is enabled. - * @return the next definition stage. - */ - WithCreate withIsEnabled(Boolean isEnabled); - } - - /** - * The stage of the Automation definition allowing to specify scopes. - */ - interface WithScopes { - /** - * Specifies the scopes property: A collection of scopes on which the security automations logic is applied. - * Supported scopes are the subscription itself or a resource group under that subscription. The automation - * will only apply on defined scopes.. - * - * @param scopes A collection of scopes on which the security automations logic is applied. Supported scopes - * are the subscription itself or a resource group under that subscription. The automation will only apply - * on defined scopes. - * @return the next definition stage. - */ - WithCreate withScopes(List scopes); - } - - /** - * The stage of the Automation definition allowing to specify sources. - */ - interface WithSources { - /** - * Specifies the sources property: A collection of the source event types which evaluate the security - * automation set of rules.. - * - * @param sources A collection of the source event types which evaluate the security automation set of - * rules. - * @return the next definition stage. - */ - WithCreate withSources(List sources); - } - - /** - * The stage of the Automation definition allowing to specify actions. - */ - interface WithActions { - /** - * Specifies the actions property: A collection of the actions which are triggered if all the configured - * rules evaluations, within at least one rule set, are true.. - * - * @param actions A collection of the actions which are triggered if all the configured rules evaluations, - * within at least one rule set, are true. - * @return the next definition stage. - */ - WithCreate withActions(List actions); - } - } - - /** - * Begins update for the Automation resource. - * - * @return the stage of resource update. - */ - Automation.Update update(); - - /** - * The template for Automation update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithDescription, UpdateStages.WithIsEnabled, - UpdateStages.WithScopes, UpdateStages.WithSources, UpdateStages.WithActions { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Automation apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Automation apply(Context context); - } - - /** - * The Automation update stages. - */ - interface UpdateStages { - /** - * The stage of the Automation update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: A list of key value pairs that describe the resource.. - * - * @param tags A list of key value pairs that describe the resource. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the Automation update allowing to specify description. - */ - interface WithDescription { - /** - * Specifies the description property: The security automation description.. - * - * @param description The security automation description. - * @return the next definition stage. - */ - Update withDescription(String description); - } - - /** - * The stage of the Automation update allowing to specify isEnabled. - */ - interface WithIsEnabled { - /** - * Specifies the isEnabled property: Indicates whether the security automation is enabled.. - * - * @param isEnabled Indicates whether the security automation is enabled. - * @return the next definition stage. - */ - Update withIsEnabled(Boolean isEnabled); - } - - /** - * The stage of the Automation update allowing to specify scopes. - */ - interface WithScopes { - /** - * Specifies the scopes property: A collection of scopes on which the security automations logic is applied. - * Supported scopes are the subscription itself or a resource group under that subscription. The automation - * will only apply on defined scopes.. - * - * @param scopes A collection of scopes on which the security automations logic is applied. Supported scopes - * are the subscription itself or a resource group under that subscription. The automation will only apply - * on defined scopes. - * @return the next definition stage. - */ - Update withScopes(List scopes); - } - - /** - * The stage of the Automation update allowing to specify sources. - */ - interface WithSources { - /** - * Specifies the sources property: A collection of the source event types which evaluate the security - * automation set of rules.. - * - * @param sources A collection of the source event types which evaluate the security automation set of - * rules. - * @return the next definition stage. - */ - Update withSources(List sources); - } - - /** - * The stage of the Automation update allowing to specify actions. - */ - interface WithActions { - /** - * Specifies the actions property: A collection of the actions which are triggered if all the configured - * rules evaluations, within at least one rule set, are true.. - * - * @param actions A collection of the actions which are triggered if all the configured rules evaluations, - * within at least one rule set, are true. - * @return the next definition stage. - */ - Update withActions(List actions); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Automation refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Automation refresh(Context context); - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param automation The security automation 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 security automation model state property bag along with {@link Response}. - */ - Response validateWithResponse(AutomationInner automation, Context context); - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param automation The security automation 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 security automation model state property bag. - */ - AutomationValidationStatus validate(AutomationInner automation); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationAction.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationAction.java deleted file mode 100644 index e196490c0b2b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationAction.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The action that should be triggered. - */ -@Immutable -public class AutomationAction implements JsonSerializable { - /* - * The type of the action that will be triggered by the Automation - */ - private ActionType actionType = ActionType.fromString("AutomationAction"); - - /** - * Creates an instance of AutomationAction class. - */ - public AutomationAction() { - } - - /** - * Get the actionType property: The type of the action that will be triggered by the Automation. - * - * @return the actionType value. - */ - public ActionType actionType() { - return this.actionType; - } - - /** - * 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("actionType", this.actionType == null ? null : this.actionType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationAction from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationAction 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 AutomationAction. - */ - public static AutomationAction fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("actionType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("LogicApp".equals(discriminatorValue)) { - return AutomationActionLogicApp.fromJson(readerToUse.reset()); - } else if ("EventHub".equals(discriminatorValue)) { - return AutomationActionEventHub.fromJson(readerToUse.reset()); - } else if ("Workspace".equals(discriminatorValue)) { - return AutomationActionWorkspace.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AutomationAction fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationAction deserializedAutomationAction = new AutomationAction(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("actionType".equals(fieldName)) { - deserializedAutomationAction.actionType = ActionType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationAction; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionEventHub.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionEventHub.java deleted file mode 100644 index 505b55b52ac2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionEventHub.java +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The target Event Hub to which event data will be exported. To learn more about Microsoft Defender for Cloud - * continuous export capabilities, visit https://aka.ms/ASCExportLearnMore. - */ -@Fluent -public final class AutomationActionEventHub extends AutomationAction { - /* - * The type of the action that will be triggered by the Automation - */ - private ActionType actionType = ActionType.EVENT_HUB; - - /* - * The target Event Hub Azure Resource ID. - */ - private String eventHubResourceId; - - /* - * The target Event Hub SAS policy name. - */ - private String sasPolicyName; - - /* - * The target Event Hub connection string (it will not be included in any response). - */ - private String connectionString; - - /* - * Indicates whether the trusted service is enabled or not. - */ - private Boolean isTrustedServiceEnabled; - - /** - * Creates an instance of AutomationActionEventHub class. - */ - public AutomationActionEventHub() { - } - - /** - * Get the actionType property: The type of the action that will be triggered by the Automation. - * - * @return the actionType value. - */ - @Override - public ActionType actionType() { - return this.actionType; - } - - /** - * Get the eventHubResourceId property: The target Event Hub Azure Resource ID. - * - * @return the eventHubResourceId value. - */ - public String eventHubResourceId() { - return this.eventHubResourceId; - } - - /** - * Set the eventHubResourceId property: The target Event Hub Azure Resource ID. - * - * @param eventHubResourceId the eventHubResourceId value to set. - * @return the AutomationActionEventHub object itself. - */ - public AutomationActionEventHub withEventHubResourceId(String eventHubResourceId) { - this.eventHubResourceId = eventHubResourceId; - return this; - } - - /** - * Get the sasPolicyName property: The target Event Hub SAS policy name. - * - * @return the sasPolicyName value. - */ - public String sasPolicyName() { - return this.sasPolicyName; - } - - /** - * Get the connectionString property: The target Event Hub connection string (it will not be included in any - * response). - * - * @return the connectionString value. - */ - public String connectionString() { - return this.connectionString; - } - - /** - * Set the connectionString property: The target Event Hub connection string (it will not be included in any - * response). - * - * @param connectionString the connectionString value to set. - * @return the AutomationActionEventHub object itself. - */ - public AutomationActionEventHub withConnectionString(String connectionString) { - this.connectionString = connectionString; - return this; - } - - /** - * Get the isTrustedServiceEnabled property: Indicates whether the trusted service is enabled or not. - * - * @return the isTrustedServiceEnabled value. - */ - public Boolean isTrustedServiceEnabled() { - return this.isTrustedServiceEnabled; - } - - /** - * Set the isTrustedServiceEnabled property: Indicates whether the trusted service is enabled or not. - * - * @param isTrustedServiceEnabled the isTrustedServiceEnabled value to set. - * @return the AutomationActionEventHub object itself. - */ - public AutomationActionEventHub withIsTrustedServiceEnabled(Boolean isTrustedServiceEnabled) { - this.isTrustedServiceEnabled = isTrustedServiceEnabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("actionType", this.actionType == null ? null : this.actionType.toString()); - jsonWriter.writeStringField("eventHubResourceId", this.eventHubResourceId); - jsonWriter.writeStringField("connectionString", this.connectionString); - jsonWriter.writeBooleanField("isTrustedServiceEnabled", this.isTrustedServiceEnabled); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationActionEventHub from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationActionEventHub 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 AutomationActionEventHub. - */ - public static AutomationActionEventHub fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationActionEventHub deserializedAutomationActionEventHub = new AutomationActionEventHub(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("actionType".equals(fieldName)) { - deserializedAutomationActionEventHub.actionType = ActionType.fromString(reader.getString()); - } else if ("eventHubResourceId".equals(fieldName)) { - deserializedAutomationActionEventHub.eventHubResourceId = reader.getString(); - } else if ("sasPolicyName".equals(fieldName)) { - deserializedAutomationActionEventHub.sasPolicyName = reader.getString(); - } else if ("connectionString".equals(fieldName)) { - deserializedAutomationActionEventHub.connectionString = reader.getString(); - } else if ("isTrustedServiceEnabled".equals(fieldName)) { - deserializedAutomationActionEventHub.isTrustedServiceEnabled - = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationActionEventHub; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionLogicApp.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionLogicApp.java deleted file mode 100644 index c68d59c35b7c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionLogicApp.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The logic app action that should be triggered. To learn more about Microsoft Defender for Cloud's Workflow Automation - * capabilities, visit https://aka.ms/ASCWorkflowAutomationLearnMore. - */ -@Fluent -public final class AutomationActionLogicApp extends AutomationAction { - /* - * The type of the action that will be triggered by the Automation - */ - private ActionType actionType = ActionType.LOGIC_APP; - - /* - * The triggered Logic App Azure Resource ID. This can also reside on other subscriptions, given that you have - * permissions to trigger the Logic App - */ - private String logicAppResourceId; - - /* - * The Logic App trigger URI endpoint (it will not be included in any response). - */ - private String uri; - - /** - * Creates an instance of AutomationActionLogicApp class. - */ - public AutomationActionLogicApp() { - } - - /** - * Get the actionType property: The type of the action that will be triggered by the Automation. - * - * @return the actionType value. - */ - @Override - public ActionType actionType() { - return this.actionType; - } - - /** - * Get the logicAppResourceId property: The triggered Logic App Azure Resource ID. This can also reside on other - * subscriptions, given that you have permissions to trigger the Logic App. - * - * @return the logicAppResourceId value. - */ - public String logicAppResourceId() { - return this.logicAppResourceId; - } - - /** - * Set the logicAppResourceId property: The triggered Logic App Azure Resource ID. This can also reside on other - * subscriptions, given that you have permissions to trigger the Logic App. - * - * @param logicAppResourceId the logicAppResourceId value to set. - * @return the AutomationActionLogicApp object itself. - */ - public AutomationActionLogicApp withLogicAppResourceId(String logicAppResourceId) { - this.logicAppResourceId = logicAppResourceId; - return this; - } - - /** - * Get the uri property: The Logic App trigger URI endpoint (it will not be included in any response). - * - * @return the uri value. - */ - public String uri() { - return this.uri; - } - - /** - * Set the uri property: The Logic App trigger URI endpoint (it will not be included in any response). - * - * @param uri the uri value to set. - * @return the AutomationActionLogicApp object itself. - */ - public AutomationActionLogicApp withUri(String uri) { - this.uri = uri; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("actionType", this.actionType == null ? null : this.actionType.toString()); - jsonWriter.writeStringField("logicAppResourceId", this.logicAppResourceId); - jsonWriter.writeStringField("uri", this.uri); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationActionLogicApp from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationActionLogicApp 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 AutomationActionLogicApp. - */ - public static AutomationActionLogicApp fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationActionLogicApp deserializedAutomationActionLogicApp = new AutomationActionLogicApp(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("actionType".equals(fieldName)) { - deserializedAutomationActionLogicApp.actionType = ActionType.fromString(reader.getString()); - } else if ("logicAppResourceId".equals(fieldName)) { - deserializedAutomationActionLogicApp.logicAppResourceId = reader.getString(); - } else if ("uri".equals(fieldName)) { - deserializedAutomationActionLogicApp.uri = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationActionLogicApp; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionWorkspace.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionWorkspace.java deleted file mode 100644 index ecbb5f2af5c6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionWorkspace.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Log Analytics Workspace to which event data will be exported. Security alerts data will reside in the - * 'SecurityAlert' table and the assessments data will reside in the 'SecurityRecommendation' table (under the - * 'Security'/'SecurityCenterFree' solutions). Note that in order to view the data in the workspace, the Security Center - * Log Analytics free/standard solution needs to be enabled on that workspace. To learn more about Microsoft Defender - * for Cloud continuous export capabilities, visit https://aka.ms/ASCExportLearnMore. - */ -@Fluent -public final class AutomationActionWorkspace extends AutomationAction { - /* - * The type of the action that will be triggered by the Automation - */ - private ActionType actionType = ActionType.WORKSPACE; - - /* - * The fully qualified Log Analytics Workspace Azure Resource ID. - */ - private String workspaceResourceId; - - /** - * Creates an instance of AutomationActionWorkspace class. - */ - public AutomationActionWorkspace() { - } - - /** - * Get the actionType property: The type of the action that will be triggered by the Automation. - * - * @return the actionType value. - */ - @Override - public ActionType actionType() { - return this.actionType; - } - - /** - * Get the workspaceResourceId property: The fully qualified Log Analytics Workspace Azure Resource ID. - * - * @return the workspaceResourceId value. - */ - public String workspaceResourceId() { - return this.workspaceResourceId; - } - - /** - * Set the workspaceResourceId property: The fully qualified Log Analytics Workspace Azure Resource ID. - * - * @param workspaceResourceId the workspaceResourceId value to set. - * @return the AutomationActionWorkspace object itself. - */ - public AutomationActionWorkspace withWorkspaceResourceId(String workspaceResourceId) { - this.workspaceResourceId = workspaceResourceId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("actionType", this.actionType == null ? null : this.actionType.toString()); - jsonWriter.writeStringField("workspaceResourceId", this.workspaceResourceId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationActionWorkspace from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationActionWorkspace 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 AutomationActionWorkspace. - */ - public static AutomationActionWorkspace fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationActionWorkspace deserializedAutomationActionWorkspace = new AutomationActionWorkspace(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("actionType".equals(fieldName)) { - deserializedAutomationActionWorkspace.actionType = ActionType.fromString(reader.getString()); - } else if ("workspaceResourceId".equals(fieldName)) { - deserializedAutomationActionWorkspace.workspaceResourceId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationActionWorkspace; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationRuleSet.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationRuleSet.java deleted file mode 100644 index 311103090bcd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationRuleSet.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * A rule set which evaluates all its rules upon an event interception. Only when all the included rules in the rule set - * will be evaluated as 'true', will the event trigger the defined actions. - */ -@Fluent -public final class AutomationRuleSet implements JsonSerializable { - /* - * The rules property. - */ - private List rules; - - /** - * Creates an instance of AutomationRuleSet class. - */ - public AutomationRuleSet() { - } - - /** - * Get the rules property: The rules property. - * - * @return the rules value. - */ - public List rules() { - return this.rules; - } - - /** - * Set the rules property: The rules property. - * - * @param rules the rules value to set. - * @return the AutomationRuleSet object itself. - */ - public AutomationRuleSet withRules(List rules) { - this.rules = rules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (rules() != null) { - rules().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationRuleSet from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationRuleSet 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 AutomationRuleSet. - */ - public static AutomationRuleSet fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationRuleSet deserializedAutomationRuleSet = new AutomationRuleSet(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("rules".equals(fieldName)) { - List rules - = reader.readArray(reader1 -> AutomationTriggeringRule.fromJson(reader1)); - deserializedAutomationRuleSet.rules = rules; - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationRuleSet; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationScope.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationScope.java deleted file mode 100644 index 13f079587596..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationScope.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * A single automation scope. - */ -@Fluent -public final class AutomationScope implements JsonSerializable { - /* - * The resources scope description. - */ - private String description; - - /* - * The resources scope path. Can be the subscription on which the automation is defined on or a resource group under - * that subscription (fully qualified Azure resource IDs). - */ - private String scopePath; - - /** - * Creates an instance of AutomationScope class. - */ - public AutomationScope() { - } - - /** - * Get the description property: The resources scope description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The resources scope description. - * - * @param description the description value to set. - * @return the AutomationScope object itself. - */ - public AutomationScope withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the scopePath property: The resources scope path. Can be the subscription on which the automation is defined - * on or a resource group under that subscription (fully qualified Azure resource IDs). - * - * @return the scopePath value. - */ - public String scopePath() { - return this.scopePath; - } - - /** - * Set the scopePath property: The resources scope path. Can be the subscription on which the automation is defined - * on or a resource group under that subscription (fully qualified Azure resource IDs). - * - * @param scopePath the scopePath value to set. - * @return the AutomationScope object itself. - */ - public AutomationScope withScopePath(String scopePath) { - this.scopePath = scopePath; - 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("description", this.description); - jsonWriter.writeStringField("scopePath", this.scopePath); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationScope from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationScope 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 AutomationScope. - */ - public static AutomationScope fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationScope deserializedAutomationScope = new AutomationScope(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedAutomationScope.description = reader.getString(); - } else if ("scopePath".equals(fieldName)) { - deserializedAutomationScope.scopePath = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationScope; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationSource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationSource.java deleted file mode 100644 index f5ea0cef63aa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationSource.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * The source event types which evaluate the security automation set of rules. For example - security alerts and - * security assessments. To learn more about the supported security events data models schemas - please visit - * https://aka.ms/ASCAutomationSchemas. - */ -@Fluent -public final class AutomationSource implements JsonSerializable { - /* - * A valid event source type. - */ - private EventSource eventSource; - - /* - * A set of rules which evaluate upon event interception. A logical disjunction is applied between defined rule sets - * (logical 'or'). - */ - private List ruleSets; - - /** - * Creates an instance of AutomationSource class. - */ - public AutomationSource() { - } - - /** - * Get the eventSource property: A valid event source type. - * - * @return the eventSource value. - */ - public EventSource eventSource() { - return this.eventSource; - } - - /** - * Set the eventSource property: A valid event source type. - * - * @param eventSource the eventSource value to set. - * @return the AutomationSource object itself. - */ - public AutomationSource withEventSource(EventSource eventSource) { - this.eventSource = eventSource; - return this; - } - - /** - * Get the ruleSets property: A set of rules which evaluate upon event interception. A logical disjunction is - * applied between defined rule sets (logical 'or'). - * - * @return the ruleSets value. - */ - public List ruleSets() { - return this.ruleSets; - } - - /** - * Set the ruleSets property: A set of rules which evaluate upon event interception. A logical disjunction is - * applied between defined rule sets (logical 'or'). - * - * @param ruleSets the ruleSets value to set. - * @return the AutomationSource object itself. - */ - public AutomationSource withRuleSets(List ruleSets) { - this.ruleSets = ruleSets; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ruleSets() != null) { - ruleSets().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("eventSource", this.eventSource == null ? null : this.eventSource.toString()); - jsonWriter.writeArrayField("ruleSets", this.ruleSets, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationSource from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationSource 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 AutomationSource. - */ - public static AutomationSource fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationSource deserializedAutomationSource = new AutomationSource(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("eventSource".equals(fieldName)) { - deserializedAutomationSource.eventSource = EventSource.fromString(reader.getString()); - } else if ("ruleSets".equals(fieldName)) { - List ruleSets = reader.readArray(reader1 -> AutomationRuleSet.fromJson(reader1)); - deserializedAutomationSource.ruleSets = ruleSets; - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationSource; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationTriggeringRule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationTriggeringRule.java deleted file mode 100644 index 3d7b5359baa0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationTriggeringRule.java +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * A rule which is evaluated upon event interception. The rule is configured by comparing a specific value from the - * event model to an expected value. This comparison is done by using one of the supported operators set. - */ -@Fluent -public final class AutomationTriggeringRule implements JsonSerializable { - /* - * The JPath of the entity model property that should be checked. - */ - private String propertyJPath; - - /* - * The data type of the compared operands (string, integer, floating point number or a boolean [true/false]] - */ - private PropertyType propertyType; - - /* - * The expected value. - */ - private String expectedValue; - - /* - * A valid comparer operator to use. A case-insensitive comparison will be applied for String PropertyType. - */ - private Operator operator; - - /** - * Creates an instance of AutomationTriggeringRule class. - */ - public AutomationTriggeringRule() { - } - - /** - * Get the propertyJPath property: The JPath of the entity model property that should be checked. - * - * @return the propertyJPath value. - */ - public String propertyJPath() { - return this.propertyJPath; - } - - /** - * Set the propertyJPath property: The JPath of the entity model property that should be checked. - * - * @param propertyJPath the propertyJPath value to set. - * @return the AutomationTriggeringRule object itself. - */ - public AutomationTriggeringRule withPropertyJPath(String propertyJPath) { - this.propertyJPath = propertyJPath; - return this; - } - - /** - * Get the propertyType property: The data type of the compared operands (string, integer, floating point number or - * a boolean [true/false]]. - * - * @return the propertyType value. - */ - public PropertyType propertyType() { - return this.propertyType; - } - - /** - * Set the propertyType property: The data type of the compared operands (string, integer, floating point number or - * a boolean [true/false]]. - * - * @param propertyType the propertyType value to set. - * @return the AutomationTriggeringRule object itself. - */ - public AutomationTriggeringRule withPropertyType(PropertyType propertyType) { - this.propertyType = propertyType; - return this; - } - - /** - * Get the expectedValue property: The expected value. - * - * @return the expectedValue value. - */ - public String expectedValue() { - return this.expectedValue; - } - - /** - * Set the expectedValue property: The expected value. - * - * @param expectedValue the expectedValue value to set. - * @return the AutomationTriggeringRule object itself. - */ - public AutomationTriggeringRule withExpectedValue(String expectedValue) { - this.expectedValue = expectedValue; - return this; - } - - /** - * Get the operator property: A valid comparer operator to use. A case-insensitive comparison will be applied for - * String PropertyType. - * - * @return the operator value. - */ - public Operator operator() { - return this.operator; - } - - /** - * Set the operator property: A valid comparer operator to use. A case-insensitive comparison will be applied for - * String PropertyType. - * - * @param operator the operator value to set. - * @return the AutomationTriggeringRule object itself. - */ - public AutomationTriggeringRule withOperator(Operator operator) { - this.operator = operator; - 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("propertyJPath", this.propertyJPath); - jsonWriter.writeStringField("propertyType", this.propertyType == null ? null : this.propertyType.toString()); - jsonWriter.writeStringField("expectedValue", this.expectedValue); - jsonWriter.writeStringField("operator", this.operator == null ? null : this.operator.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationTriggeringRule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationTriggeringRule 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 AutomationTriggeringRule. - */ - public static AutomationTriggeringRule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationTriggeringRule deserializedAutomationTriggeringRule = new AutomationTriggeringRule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("propertyJPath".equals(fieldName)) { - deserializedAutomationTriggeringRule.propertyJPath = reader.getString(); - } else if ("propertyType".equals(fieldName)) { - deserializedAutomationTriggeringRule.propertyType = PropertyType.fromString(reader.getString()); - } else if ("expectedValue".equals(fieldName)) { - deserializedAutomationTriggeringRule.expectedValue = reader.getString(); - } else if ("operator".equals(fieldName)) { - deserializedAutomationTriggeringRule.operator = Operator.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationTriggeringRule; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationUpdateModel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationUpdateModel.java deleted file mode 100644 index 107381f5c567..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationUpdateModel.java +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.AutomationProperties; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * The update model of security automation resource. - */ -@Fluent -public final class AutomationUpdateModel extends Tags { - /* - * Security automation data - */ - private AutomationProperties innerProperties; - - /** - * Creates an instance of AutomationUpdateModel class. - */ - public AutomationUpdateModel() { - } - - /** - * Get the innerProperties property: Security automation data. - * - * @return the innerProperties value. - */ - private AutomationProperties innerProperties() { - return this.innerProperties; - } - - /** - * {@inheritDoc} - */ - @Override - public AutomationUpdateModel withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the description property: The security automation description. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: The security automation description. - * - * @param description the description value to set. - * @return the AutomationUpdateModel object itself. - */ - public AutomationUpdateModel withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the isEnabled property: Indicates whether the security automation is enabled. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().isEnabled(); - } - - /** - * Set the isEnabled property: Indicates whether the security automation is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the AutomationUpdateModel object itself. - */ - public AutomationUpdateModel withIsEnabled(Boolean isEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withIsEnabled(isEnabled); - return this; - } - - /** - * Get the scopes property: A collection of scopes on which the security automations logic is applied. Supported - * scopes are the subscription itself or a resource group under that subscription. The automation will only apply on - * defined scopes. - * - * @return the scopes value. - */ - public List scopes() { - return this.innerProperties() == null ? null : this.innerProperties().scopes(); - } - - /** - * Set the scopes property: A collection of scopes on which the security automations logic is applied. Supported - * scopes are the subscription itself or a resource group under that subscription. The automation will only apply on - * defined scopes. - * - * @param scopes the scopes value to set. - * @return the AutomationUpdateModel object itself. - */ - public AutomationUpdateModel withScopes(List scopes) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withScopes(scopes); - return this; - } - - /** - * Get the sources property: A collection of the source event types which evaluate the security automation set of - * rules. - * - * @return the sources value. - */ - public List sources() { - return this.innerProperties() == null ? null : this.innerProperties().sources(); - } - - /** - * Set the sources property: A collection of the source event types which evaluate the security automation set of - * rules. - * - * @param sources the sources value to set. - * @return the AutomationUpdateModel object itself. - */ - public AutomationUpdateModel withSources(List sources) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withSources(sources); - return this; - } - - /** - * Get the actions property: A collection of the actions which are triggered if all the configured rules - * evaluations, within at least one rule set, are true. - * - * @return the actions value. - */ - public List actions() { - return this.innerProperties() == null ? null : this.innerProperties().actions(); - } - - /** - * Set the actions property: A collection of the actions which are triggered if all the configured rules - * evaluations, within at least one rule set, are true. - * - * @param actions the actions value to set. - * @return the AutomationUpdateModel object itself. - */ - public AutomationUpdateModel withActions(List actions) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withActions(actions); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AutomationUpdateModel from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AutomationUpdateModel 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 AutomationUpdateModel. - */ - public static AutomationUpdateModel fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AutomationUpdateModel deserializedAutomationUpdateModel = new AutomationUpdateModel(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedAutomationUpdateModel.withTags(tags); - } else if ("properties".equals(fieldName)) { - deserializedAutomationUpdateModel.innerProperties = AutomationProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAutomationUpdateModel; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationValidationStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationValidationStatus.java deleted file mode 100644 index 034c391eac69..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationValidationStatus.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner; - -/** - * An immutable client-side representation of AutomationValidationStatus. - */ -public interface AutomationValidationStatus { - /** - * Gets the isValid property: Indicates whether the model is valid or not. - * - * @return the isValid value. - */ - Boolean isValid(); - - /** - * Gets the message property: The validation message. - * - * @return the message value. - */ - String message(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner object. - * - * @return the inner object. - */ - AutomationValidationStatusInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automations.java deleted file mode 100644 index 2eecb20af9e2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automations.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; - -/** - * Resource collection API of Automations. - */ -public interface Automations { - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation 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 security automation resource along with {@link Response}. - */ - Response getByResourceGroupWithResponse(String resourceGroupName, String automationName, - Context context); - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation 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 security automation resource. - */ - Automation getByResourceGroup(String resourceGroupName, String automationName); - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation 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 {@link Response}. - */ - Response deleteByResourceGroupWithResponse(String resourceGroupName, String automationName, Context context); - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation 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. - */ - void deleteByResourceGroup(String resourceGroupName, String automationName); - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations for the specified resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations for the specified 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations for the specified 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 list of security automations response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations for the specified 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 list of security automations response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 security automation model state property bag along with {@link Response}. - */ - Response validateWithResponse(String resourceGroupName, String automationName, - AutomationInner automation, Context context); - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param automationName The security automation name. - * @param automation The security automation 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 security automation model state property bag. - */ - AutomationValidationStatus validate(String resourceGroupName, String automationName, AutomationInner automation); - - /** - * Retrieves information about the model of a security automation. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation resource along with {@link Response}. - */ - Automation getById(String id); - - /** - * Retrieves information about the model of a security automation. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation resource along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes a security automation. - * - * @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 a security automation. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new Automation resource. - * - * @param name resource name. - * @return the first stage of the new Automation definition. - */ - Automation.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsEnvironmentData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsEnvironmentData.java deleted file mode 100644 index 4965bea145a5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsEnvironmentData.java +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The AWS connector environment data. - */ -@Fluent -public final class AwsEnvironmentData extends EnvironmentData { - /* - * The type of the environment data. - */ - private EnvironmentType environmentType = EnvironmentType.AWS_ACCOUNT; - - /* - * The AWS account's organizational data - */ - private AwsOrganizationalData organizationalData; - - /* - * list of regions to scan - */ - private List regions; - - /* - * The AWS account name - */ - private String accountName; - - /* - * Scan interval in hours (value should be between 1-hour to 24-hours) - */ - private Long scanInterval; - - /** - * Creates an instance of AwsEnvironmentData class. - */ - public AwsEnvironmentData() { - } - - /** - * Get the environmentType property: The type of the environment data. - * - * @return the environmentType value. - */ - @Override - public EnvironmentType environmentType() { - return this.environmentType; - } - - /** - * Get the organizationalData property: The AWS account's organizational data. - * - * @return the organizationalData value. - */ - public AwsOrganizationalData organizationalData() { - return this.organizationalData; - } - - /** - * Set the organizationalData property: The AWS account's organizational data. - * - * @param organizationalData the organizationalData value to set. - * @return the AwsEnvironmentData object itself. - */ - public AwsEnvironmentData withOrganizationalData(AwsOrganizationalData organizationalData) { - this.organizationalData = organizationalData; - return this; - } - - /** - * Get the regions property: list of regions to scan. - * - * @return the regions value. - */ - public List regions() { - return this.regions; - } - - /** - * Set the regions property: list of regions to scan. - * - * @param regions the regions value to set. - * @return the AwsEnvironmentData object itself. - */ - public AwsEnvironmentData withRegions(List regions) { - this.regions = regions; - return this; - } - - /** - * Get the accountName property: The AWS account name. - * - * @return the accountName value. - */ - public String accountName() { - return this.accountName; - } - - /** - * Get the scanInterval property: Scan interval in hours (value should be between 1-hour to 24-hours). - * - * @return the scanInterval value. - */ - public Long scanInterval() { - return this.scanInterval; - } - - /** - * Set the scanInterval property: Scan interval in hours (value should be between 1-hour to 24-hours). - * - * @param scanInterval the scanInterval value to set. - * @return the AwsEnvironmentData object itself. - */ - public AwsEnvironmentData withScanInterval(Long scanInterval) { - this.scanInterval = scanInterval; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (organizationalData() != null) { - organizationalData().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("environmentType", - this.environmentType == null ? null : this.environmentType.toString()); - jsonWriter.writeJsonField("organizationalData", this.organizationalData); - jsonWriter.writeArrayField("regions", this.regions, (writer, element) -> writer.writeString(element)); - jsonWriter.writeNumberField("scanInterval", this.scanInterval); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AwsEnvironmentData from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AwsEnvironmentData 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 AwsEnvironmentData. - */ - public static AwsEnvironmentData fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AwsEnvironmentData deserializedAwsEnvironmentData = new AwsEnvironmentData(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("environmentType".equals(fieldName)) { - deserializedAwsEnvironmentData.environmentType = EnvironmentType.fromString(reader.getString()); - } else if ("organizationalData".equals(fieldName)) { - deserializedAwsEnvironmentData.organizationalData = AwsOrganizationalData.fromJson(reader); - } else if ("regions".equals(fieldName)) { - List regions = reader.readArray(reader1 -> reader1.getString()); - deserializedAwsEnvironmentData.regions = regions; - } else if ("accountName".equals(fieldName)) { - deserializedAwsEnvironmentData.accountName = reader.getString(); - } else if ("scanInterval".equals(fieldName)) { - deserializedAwsEnvironmentData.scanInterval = reader.getNullable(JsonReader::getLong); - } else { - reader.skipChildren(); - } - } - - return deserializedAwsEnvironmentData; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalData.java deleted file mode 100644 index 1e170ee7e131..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalData.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The AWS organization data. - */ -@Immutable -public class AwsOrganizationalData implements JsonSerializable { - /* - * The multi cloud account's membership type in the organization - */ - private OrganizationMembershipType organizationMembershipType - = OrganizationMembershipType.fromString("AwsOrganizationalData"); - - /** - * Creates an instance of AwsOrganizationalData class. - */ - public AwsOrganizationalData() { - } - - /** - * Get the organizationMembershipType property: The multi cloud account's membership type in the organization. - * - * @return the organizationMembershipType value. - */ - public OrganizationMembershipType organizationMembershipType() { - return this.organizationMembershipType; - } - - /** - * 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("organizationMembershipType", - this.organizationMembershipType == null ? null : this.organizationMembershipType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AwsOrganizationalData from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AwsOrganizationalData 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 AwsOrganizationalData. - */ - public static AwsOrganizationalData fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("organizationMembershipType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("Organization".equals(discriminatorValue)) { - return AwsOrganizationalDataMaster.fromJson(readerToUse.reset()); - } else if ("Member".equals(discriminatorValue)) { - return AwsOrganizationalDataMember.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static AwsOrganizationalData fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AwsOrganizationalData deserializedAwsOrganizationalData = new AwsOrganizationalData(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("organizationMembershipType".equals(fieldName)) { - deserializedAwsOrganizationalData.organizationMembershipType - = OrganizationMembershipType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAwsOrganizationalData; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalDataMaster.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalDataMaster.java deleted file mode 100644 index a9057e9d1b64..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalDataMaster.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The AWS organization data for the master account. - */ -@Fluent -public final class AwsOrganizationalDataMaster extends AwsOrganizationalData { - /* - * The multi cloud account's membership type in the organization - */ - private OrganizationMembershipType organizationMembershipType = OrganizationMembershipType.ORGANIZATION; - - /* - * If the multi cloud account is of membership type organization, this will be the name of the onboarding stackset - */ - private String stacksetName; - - /* - * If the multi cloud account is of membership type organization, list of accounts excluded from offering - */ - private List excludedAccountIds; - - /** - * Creates an instance of AwsOrganizationalDataMaster class. - */ - public AwsOrganizationalDataMaster() { - } - - /** - * Get the organizationMembershipType property: The multi cloud account's membership type in the organization. - * - * @return the organizationMembershipType value. - */ - @Override - public OrganizationMembershipType organizationMembershipType() { - return this.organizationMembershipType; - } - - /** - * Get the stacksetName property: If the multi cloud account is of membership type organization, this will be the - * name of the onboarding stackset. - * - * @return the stacksetName value. - */ - public String stacksetName() { - return this.stacksetName; - } - - /** - * Set the stacksetName property: If the multi cloud account is of membership type organization, this will be the - * name of the onboarding stackset. - * - * @param stacksetName the stacksetName value to set. - * @return the AwsOrganizationalDataMaster object itself. - */ - public AwsOrganizationalDataMaster withStacksetName(String stacksetName) { - this.stacksetName = stacksetName; - return this; - } - - /** - * Get the excludedAccountIds property: If the multi cloud account is of membership type organization, list of - * accounts excluded from offering. - * - * @return the excludedAccountIds value. - */ - public List excludedAccountIds() { - return this.excludedAccountIds; - } - - /** - * Set the excludedAccountIds property: If the multi cloud account is of membership type organization, list of - * accounts excluded from offering. - * - * @param excludedAccountIds the excludedAccountIds value to set. - * @return the AwsOrganizationalDataMaster object itself. - */ - public AwsOrganizationalDataMaster withExcludedAccountIds(List excludedAccountIds) { - this.excludedAccountIds = excludedAccountIds; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("organizationMembershipType", - this.organizationMembershipType == null ? null : this.organizationMembershipType.toString()); - jsonWriter.writeStringField("stacksetName", this.stacksetName); - jsonWriter.writeArrayField("excludedAccountIds", this.excludedAccountIds, - (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AwsOrganizationalDataMaster from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AwsOrganizationalDataMaster 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 AwsOrganizationalDataMaster. - */ - public static AwsOrganizationalDataMaster fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AwsOrganizationalDataMaster deserializedAwsOrganizationalDataMaster = new AwsOrganizationalDataMaster(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("organizationMembershipType".equals(fieldName)) { - deserializedAwsOrganizationalDataMaster.organizationMembershipType - = OrganizationMembershipType.fromString(reader.getString()); - } else if ("stacksetName".equals(fieldName)) { - deserializedAwsOrganizationalDataMaster.stacksetName = reader.getString(); - } else if ("excludedAccountIds".equals(fieldName)) { - List excludedAccountIds = reader.readArray(reader1 -> reader1.getString()); - deserializedAwsOrganizationalDataMaster.excludedAccountIds = excludedAccountIds; - } else { - reader.skipChildren(); - } - } - - return deserializedAwsOrganizationalDataMaster; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalDataMember.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalDataMember.java deleted file mode 100644 index 654b6b5f696d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalDataMember.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The AWS organization data for the member account. - */ -@Fluent -public final class AwsOrganizationalDataMember extends AwsOrganizationalData { - /* - * The multi cloud account's membership type in the organization - */ - private OrganizationMembershipType organizationMembershipType = OrganizationMembershipType.MEMBER; - - /* - * If the multi cloud account is not of membership type organization, this will be the ID of the account's parent - */ - private String parentHierarchyId; - - /** - * Creates an instance of AwsOrganizationalDataMember class. - */ - public AwsOrganizationalDataMember() { - } - - /** - * Get the organizationMembershipType property: The multi cloud account's membership type in the organization. - * - * @return the organizationMembershipType value. - */ - @Override - public OrganizationMembershipType organizationMembershipType() { - return this.organizationMembershipType; - } - - /** - * Get the parentHierarchyId property: If the multi cloud account is not of membership type organization, this will - * be the ID of the account's parent. - * - * @return the parentHierarchyId value. - */ - public String parentHierarchyId() { - return this.parentHierarchyId; - } - - /** - * Set the parentHierarchyId property: If the multi cloud account is not of membership type organization, this will - * be the ID of the account's parent. - * - * @param parentHierarchyId the parentHierarchyId value to set. - * @return the AwsOrganizationalDataMember object itself. - */ - public AwsOrganizationalDataMember withParentHierarchyId(String parentHierarchyId) { - this.parentHierarchyId = parentHierarchyId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("organizationMembershipType", - this.organizationMembershipType == null ? null : this.organizationMembershipType.toString()); - jsonWriter.writeStringField("parentHierarchyId", this.parentHierarchyId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AwsOrganizationalDataMember from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AwsOrganizationalDataMember 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 AwsOrganizationalDataMember. - */ - public static AwsOrganizationalDataMember fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AwsOrganizationalDataMember deserializedAwsOrganizationalDataMember = new AwsOrganizationalDataMember(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("organizationMembershipType".equals(fieldName)) { - deserializedAwsOrganizationalDataMember.organizationMembershipType - = OrganizationMembershipType.fromString(reader.getString()); - } else if ("parentHierarchyId".equals(fieldName)) { - deserializedAwsOrganizationalDataMember.parentHierarchyId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAwsOrganizationalDataMember; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrg.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrg.java deleted file mode 100644 index 993e6662c8d8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrg.java +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgInner; - -/** - * An immutable client-side representation of AzureDevOpsOrg. - */ -public interface AzureDevOpsOrg { - /** - * 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: Azure DevOps Organization properties. - * - * @return the properties value. - */ - AzureDevOpsOrgProperties properties(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgInner object. - * - * @return the inner object. - */ - AzureDevOpsOrgInner innerModel(); - - /** - * The entirety of the AzureDevOpsOrg definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The AzureDevOpsOrg definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the AzureDevOpsOrg definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the AzureDevOpsOrg definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, securityConnectorName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @return the next definition stage. - */ - WithCreate withExistingSecurityConnector(String resourceGroupName, String securityConnectorName); - } - - /** - * The stage of the AzureDevOpsOrg definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - AzureDevOpsOrg create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - AzureDevOpsOrg create(Context context); - } - - /** - * The stage of the AzureDevOpsOrg definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Azure DevOps Organization properties.. - * - * @param properties Azure DevOps Organization properties. - * @return the next definition stage. - */ - WithCreate withProperties(AzureDevOpsOrgProperties properties); - } - } - - /** - * Begins update for the AzureDevOpsOrg resource. - * - * @return the stage of resource update. - */ - AzureDevOpsOrg.Update update(); - - /** - * The template for AzureDevOpsOrg update. - */ - interface Update extends UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - AzureDevOpsOrg apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - AzureDevOpsOrg apply(Context context); - } - - /** - * The AzureDevOpsOrg update stages. - */ - interface UpdateStages { - /** - * The stage of the AzureDevOpsOrg update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Azure DevOps Organization properties.. - * - * @param properties Azure DevOps Organization properties. - * @return the next definition stage. - */ - Update withProperties(AzureDevOpsOrgProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - AzureDevOpsOrg refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - AzureDevOpsOrg refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgListResponse.java deleted file mode 100644 index 013177e089e9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgListResponse.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgListResponseInner; -import java.util.List; - -/** - * An immutable client-side representation of AzureDevOpsOrgListResponse. - */ -public interface AzureDevOpsOrgListResponse { - /** - * Gets the value property: The AzureDevOpsOrg items on this page. - * - * @return the value value. - */ - List value(); - - /** - * Gets the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - String nextLink(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AzureDevOpsOrgListResponseInner object. - * - * @return the inner object. - */ - AzureDevOpsOrgListResponseInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgProperties.java deleted file mode 100644 index b04d6655513d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgProperties.java +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * Azure DevOps Organization properties. - */ -@Fluent -public final class AzureDevOpsOrgProperties implements JsonSerializable { - /* - * Gets the resource status message. - */ - private String provisioningStatusMessage; - - /* - * Gets the time when resource was last checked. - */ - private OffsetDateTime provisioningStatusUpdateTimeUtc; - - /* - * The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - */ - private DevOpsProvisioningState provisioningState; - - /* - * Details about resource onboarding status across all connectors. - * - * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only - * applicable to top-level resources. - * Onboarded - this resource has already been onboarded by the specified connector. - * NotOnboarded - this resource has not been onboarded to any connector. - * NotApplicable - the onboarding state is not applicable to the current endpoint. - */ - private OnboardingState onboardingState; - - /* - * Configuration payload for PR Annotations. - */ - private ActionableRemediation actionableRemediation; - - /** - * Creates an instance of AzureDevOpsOrgProperties class. - */ - public AzureDevOpsOrgProperties() { - } - - /** - * Get the provisioningStatusMessage property: Gets the resource status message. - * - * @return the provisioningStatusMessage value. - */ - public String provisioningStatusMessage() { - return this.provisioningStatusMessage; - } - - /** - * Get the provisioningStatusUpdateTimeUtc property: Gets the time when resource was last checked. - * - * @return the provisioningStatusUpdateTimeUtc value. - */ - public OffsetDateTime provisioningStatusUpdateTimeUtc() { - return this.provisioningStatusUpdateTimeUtc; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - * - * @return the provisioningState value. - */ - public DevOpsProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the onboardingState property: Details about resource onboarding status across all connectors. - * - * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only - * applicable to top-level resources. - * Onboarded - this resource has already been onboarded by the specified connector. - * NotOnboarded - this resource has not been onboarded to any connector. - * NotApplicable - the onboarding state is not applicable to the current endpoint. - * - * @return the onboardingState value. - */ - public OnboardingState onboardingState() { - return this.onboardingState; - } - - /** - * Set the onboardingState property: Details about resource onboarding status across all connectors. - * - * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only - * applicable to top-level resources. - * Onboarded - this resource has already been onboarded by the specified connector. - * NotOnboarded - this resource has not been onboarded to any connector. - * NotApplicable - the onboarding state is not applicable to the current endpoint. - * - * @param onboardingState the onboardingState value to set. - * @return the AzureDevOpsOrgProperties object itself. - */ - public AzureDevOpsOrgProperties withOnboardingState(OnboardingState onboardingState) { - this.onboardingState = onboardingState; - return this; - } - - /** - * Get the actionableRemediation property: Configuration payload for PR Annotations. - * - * @return the actionableRemediation value. - */ - public ActionableRemediation actionableRemediation() { - return this.actionableRemediation; - } - - /** - * Set the actionableRemediation property: Configuration payload for PR Annotations. - * - * @param actionableRemediation the actionableRemediation value to set. - * @return the AzureDevOpsOrgProperties object itself. - */ - public AzureDevOpsOrgProperties withActionableRemediation(ActionableRemediation actionableRemediation) { - this.actionableRemediation = actionableRemediation; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (actionableRemediation() != null) { - actionableRemediation().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("onboardingState", - this.onboardingState == null ? null : this.onboardingState.toString()); - jsonWriter.writeJsonField("actionableRemediation", this.actionableRemediation); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureDevOpsOrgProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureDevOpsOrgProperties 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 AzureDevOpsOrgProperties. - */ - public static AzureDevOpsOrgProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureDevOpsOrgProperties deserializedAzureDevOpsOrgProperties = new AzureDevOpsOrgProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningStatusMessage".equals(fieldName)) { - deserializedAzureDevOpsOrgProperties.provisioningStatusMessage = reader.getString(); - } else if ("provisioningStatusUpdateTimeUtc".equals(fieldName)) { - deserializedAzureDevOpsOrgProperties.provisioningStatusUpdateTimeUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("provisioningState".equals(fieldName)) { - deserializedAzureDevOpsOrgProperties.provisioningState - = DevOpsProvisioningState.fromString(reader.getString()); - } else if ("onboardingState".equals(fieldName)) { - deserializedAzureDevOpsOrgProperties.onboardingState - = OnboardingState.fromString(reader.getString()); - } else if ("actionableRemediation".equals(fieldName)) { - deserializedAzureDevOpsOrgProperties.actionableRemediation = ActionableRemediation.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureDevOpsOrgProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgs.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgs.java deleted file mode 100644 index f1c8a6de3037..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsOrgs.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of AzureDevOpsOrgs. - */ -public interface AzureDevOpsOrgs { - /** - * Returns a monitored Azure DevOps organization resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName 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 azure DevOps Organization resource along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String securityConnectorName, String orgName, - Context context); - - /** - * Returns a monitored Azure DevOps organization resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName 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 azure DevOps Organization resource. - */ - AzureDevOpsOrg get(String resourceGroupName, String securityConnectorName, String orgName); - - /** - * Returns a list of Azure DevOps organizations onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * Returns a list of Azure DevOps organizations onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); - - /** - * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination along with {@link Response}. - */ - Response listAvailableWithResponse(String resourceGroupName, - String securityConnectorName, Context context); - - /** - * Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination. - */ - AzureDevOpsOrgListResponse listAvailable(String resourceGroupName, String securityConnectorName); - - /** - * Returns a monitored Azure DevOps organization resource. - * - * @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 azure DevOps Organization resource along with {@link Response}. - */ - AzureDevOpsOrg getById(String id); - - /** - * Returns a monitored Azure DevOps organization resource. - * - * @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 azure DevOps Organization resource along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new AzureDevOpsOrg resource. - * - * @param name resource name. - * @return the first stage of the new AzureDevOpsOrg definition. - */ - AzureDevOpsOrg.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProject.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProject.java deleted file mode 100644 index ef10fb5e91b3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProject.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner; - -/** - * An immutable client-side representation of AzureDevOpsProject. - */ -public interface AzureDevOpsProject { - /** - * 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: Azure DevOps Project properties. - * - * @return the properties value. - */ - AzureDevOpsProjectProperties properties(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AzureDevOpsProjectInner object. - * - * @return the inner object. - */ - AzureDevOpsProjectInner innerModel(); - - /** - * The entirety of the AzureDevOpsProject definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The AzureDevOpsProject definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the AzureDevOpsProject definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the AzureDevOpsProject definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, securityConnectorName, orgName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @return the next definition stage. - */ - WithCreate withExistingAzureDevOpsOrg(String resourceGroupName, String securityConnectorName, - String orgName); - } - - /** - * The stage of the AzureDevOpsProject definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - AzureDevOpsProject create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - AzureDevOpsProject create(Context context); - } - - /** - * The stage of the AzureDevOpsProject definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Azure DevOps Project properties.. - * - * @param properties Azure DevOps Project properties. - * @return the next definition stage. - */ - WithCreate withProperties(AzureDevOpsProjectProperties properties); - } - } - - /** - * Begins update for the AzureDevOpsProject resource. - * - * @return the stage of resource update. - */ - AzureDevOpsProject.Update update(); - - /** - * The template for AzureDevOpsProject update. - */ - interface Update extends UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - AzureDevOpsProject apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - AzureDevOpsProject apply(Context context); - } - - /** - * The AzureDevOpsProject update stages. - */ - interface UpdateStages { - /** - * The stage of the AzureDevOpsProject update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Azure DevOps Project properties.. - * - * @param properties Azure DevOps Project properties. - * @return the next definition stage. - */ - Update withProperties(AzureDevOpsProjectProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - AzureDevOpsProject refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - AzureDevOpsProject refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectProperties.java deleted file mode 100644 index 1af04948fac4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjectProperties.java +++ /dev/null @@ -1,257 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * Azure DevOps Project properties. - */ -@Fluent -public final class AzureDevOpsProjectProperties implements JsonSerializable { - /* - * Gets the resource status message. - */ - private String provisioningStatusMessage; - - /* - * Gets the time when resource was last checked. - */ - private OffsetDateTime provisioningStatusUpdateTimeUtc; - - /* - * The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - */ - private DevOpsProvisioningState provisioningState; - - /* - * Gets or sets parent Azure DevOps Organization name. - */ - private String parentOrgName; - - /* - * Gets or sets Azure DevOps Project id. - */ - private String projectId; - - /* - * Details about resource onboarding status across all connectors. - * - * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only - * applicable to top-level resources. - * Onboarded - this resource has already been onboarded by the specified connector. - * NotOnboarded - this resource has not been onboarded to any connector. - * NotApplicable - the onboarding state is not applicable to the current endpoint. - */ - private OnboardingState onboardingState; - - /* - * Configuration payload for PR Annotations. - */ - private ActionableRemediation actionableRemediation; - - /** - * Creates an instance of AzureDevOpsProjectProperties class. - */ - public AzureDevOpsProjectProperties() { - } - - /** - * Get the provisioningStatusMessage property: Gets the resource status message. - * - * @return the provisioningStatusMessage value. - */ - public String provisioningStatusMessage() { - return this.provisioningStatusMessage; - } - - /** - * Get the provisioningStatusUpdateTimeUtc property: Gets the time when resource was last checked. - * - * @return the provisioningStatusUpdateTimeUtc value. - */ - public OffsetDateTime provisioningStatusUpdateTimeUtc() { - return this.provisioningStatusUpdateTimeUtc; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - * - * @return the provisioningState value. - */ - public DevOpsProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the parentOrgName property: Gets or sets parent Azure DevOps Organization name. - * - * @return the parentOrgName value. - */ - public String parentOrgName() { - return this.parentOrgName; - } - - /** - * Set the parentOrgName property: Gets or sets parent Azure DevOps Organization name. - * - * @param parentOrgName the parentOrgName value to set. - * @return the AzureDevOpsProjectProperties object itself. - */ - public AzureDevOpsProjectProperties withParentOrgName(String parentOrgName) { - this.parentOrgName = parentOrgName; - return this; - } - - /** - * Get the projectId property: Gets or sets Azure DevOps Project id. - * - * @return the projectId value. - */ - public String projectId() { - return this.projectId; - } - - /** - * Get the onboardingState property: Details about resource onboarding status across all connectors. - * - * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only - * applicable to top-level resources. - * Onboarded - this resource has already been onboarded by the specified connector. - * NotOnboarded - this resource has not been onboarded to any connector. - * NotApplicable - the onboarding state is not applicable to the current endpoint. - * - * @return the onboardingState value. - */ - public OnboardingState onboardingState() { - return this.onboardingState; - } - - /** - * Set the onboardingState property: Details about resource onboarding status across all connectors. - * - * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only - * applicable to top-level resources. - * Onboarded - this resource has already been onboarded by the specified connector. - * NotOnboarded - this resource has not been onboarded to any connector. - * NotApplicable - the onboarding state is not applicable to the current endpoint. - * - * @param onboardingState the onboardingState value to set. - * @return the AzureDevOpsProjectProperties object itself. - */ - public AzureDevOpsProjectProperties withOnboardingState(OnboardingState onboardingState) { - this.onboardingState = onboardingState; - return this; - } - - /** - * Get the actionableRemediation property: Configuration payload for PR Annotations. - * - * @return the actionableRemediation value. - */ - public ActionableRemediation actionableRemediation() { - return this.actionableRemediation; - } - - /** - * Set the actionableRemediation property: Configuration payload for PR Annotations. - * - * @param actionableRemediation the actionableRemediation value to set. - * @return the AzureDevOpsProjectProperties object itself. - */ - public AzureDevOpsProjectProperties withActionableRemediation(ActionableRemediation actionableRemediation) { - this.actionableRemediation = actionableRemediation; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (actionableRemediation() != null) { - actionableRemediation().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("parentOrgName", this.parentOrgName); - jsonWriter.writeStringField("onboardingState", - this.onboardingState == null ? null : this.onboardingState.toString()); - jsonWriter.writeJsonField("actionableRemediation", this.actionableRemediation); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureDevOpsProjectProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureDevOpsProjectProperties 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 AzureDevOpsProjectProperties. - */ - public static AzureDevOpsProjectProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureDevOpsProjectProperties deserializedAzureDevOpsProjectProperties = new AzureDevOpsProjectProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningStatusMessage".equals(fieldName)) { - deserializedAzureDevOpsProjectProperties.provisioningStatusMessage = reader.getString(); - } else if ("provisioningStatusUpdateTimeUtc".equals(fieldName)) { - deserializedAzureDevOpsProjectProperties.provisioningStatusUpdateTimeUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("provisioningState".equals(fieldName)) { - deserializedAzureDevOpsProjectProperties.provisioningState - = DevOpsProvisioningState.fromString(reader.getString()); - } else if ("parentOrgName".equals(fieldName)) { - deserializedAzureDevOpsProjectProperties.parentOrgName = reader.getString(); - } else if ("projectId".equals(fieldName)) { - deserializedAzureDevOpsProjectProperties.projectId = reader.getString(); - } else if ("onboardingState".equals(fieldName)) { - deserializedAzureDevOpsProjectProperties.onboardingState - = OnboardingState.fromString(reader.getString()); - } else if ("actionableRemediation".equals(fieldName)) { - deserializedAzureDevOpsProjectProperties.actionableRemediation - = ActionableRemediation.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureDevOpsProjectProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjects.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjects.java deleted file mode 100644 index 9170a14de895..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsProjects.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of AzureDevOpsProjects. - */ -public interface AzureDevOpsProjects { - /** - * Returns a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName 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 azure DevOps Project resource along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, Context context); - - /** - * Returns a monitored Azure DevOps project resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName 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 azure DevOps Project resource. - */ - AzureDevOpsProject get(String resourceGroupName, String securityConnectorName, String orgName, String projectName); - - /** - * Returns a list of Azure DevOps projects onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName, String orgName); - - /** - * Returns a list of Azure DevOps projects onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName, String orgName, - Context context); - - /** - * Returns a monitored Azure DevOps project resource. - * - * @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 azure DevOps Project resource along with {@link Response}. - */ - AzureDevOpsProject getById(String id); - - /** - * Returns a monitored Azure DevOps project resource. - * - * @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 azure DevOps Project resource along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new AzureDevOpsProject resource. - * - * @param name resource name. - * @return the first stage of the new AzureDevOpsProject definition. - */ - AzureDevOpsProject.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepos.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepos.java deleted file mode 100644 index 279d05947ab3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepos.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of AzureDevOpsRepos. - */ -public interface AzureDevOpsRepos { - /** - * Returns a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName 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 azure DevOps Repository resource along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String orgName, String projectName, String repoName, Context context); - - /** - * Returns a monitored Azure DevOps repository resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @param repoName The repoName 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 azure DevOps Repository resource. - */ - AzureDevOpsRepository get(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, String repoName); - - /** - * Returns a list of Azure DevOps repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName, String orgName, - String projectName); - - /** - * Returns a list of Azure DevOps repositories onboarded to the connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName, String orgName, - String projectName, Context context); - - /** - * Returns a monitored Azure DevOps repository resource. - * - * @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 azure DevOps Repository resource along with {@link Response}. - */ - AzureDevOpsRepository getById(String id); - - /** - * Returns a monitored Azure DevOps repository resource. - * - * @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 azure DevOps Repository resource along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new AzureDevOpsRepository resource. - * - * @param name resource name. - * @return the first stage of the new AzureDevOpsRepository definition. - */ - AzureDevOpsRepository.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepository.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepository.java deleted file mode 100644 index 3b59c7ab7b85..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepository.java +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AzureDevOpsRepositoryInner; - -/** - * An immutable client-side representation of AzureDevOpsRepository. - */ -public interface AzureDevOpsRepository { - /** - * 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: Azure DevOps Repository properties. - * - * @return the properties value. - */ - AzureDevOpsRepositoryProperties properties(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AzureDevOpsRepositoryInner object. - * - * @return the inner object. - */ - AzureDevOpsRepositoryInner innerModel(); - - /** - * The entirety of the AzureDevOpsRepository definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The AzureDevOpsRepository definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the AzureDevOpsRepository definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the AzureDevOpsRepository definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, securityConnectorName, orgName, projectName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param orgName The orgName parameter. - * @param projectName The projectName parameter. - * @return the next definition stage. - */ - WithCreate withExistingProject(String resourceGroupName, String securityConnectorName, String orgName, - String projectName); - } - - /** - * The stage of the AzureDevOpsRepository definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - AzureDevOpsRepository create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - AzureDevOpsRepository create(Context context); - } - - /** - * The stage of the AzureDevOpsRepository definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Azure DevOps Repository properties.. - * - * @param properties Azure DevOps Repository properties. - * @return the next definition stage. - */ - WithCreate withProperties(AzureDevOpsRepositoryProperties properties); - } - } - - /** - * Begins update for the AzureDevOpsRepository resource. - * - * @return the stage of resource update. - */ - AzureDevOpsRepository.Update update(); - - /** - * The template for AzureDevOpsRepository update. - */ - interface Update extends UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - AzureDevOpsRepository apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - AzureDevOpsRepository apply(Context context); - } - - /** - * The AzureDevOpsRepository update stages. - */ - interface UpdateStages { - /** - * The stage of the AzureDevOpsRepository update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Azure DevOps Repository properties.. - * - * @param properties Azure DevOps Repository properties. - * @return the next definition stage. - */ - Update withProperties(AzureDevOpsRepositoryProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - AzureDevOpsRepository refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - AzureDevOpsRepository refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryProperties.java deleted file mode 100644 index 6878dfbd7498..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsRepositoryProperties.java +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * Azure DevOps Repository properties. - */ -@Fluent -public final class AzureDevOpsRepositoryProperties implements JsonSerializable { - /* - * Gets the resource status message. - */ - private String provisioningStatusMessage; - - /* - * Gets the time when resource was last checked. - */ - private OffsetDateTime provisioningStatusUpdateTimeUtc; - - /* - * The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - */ - private DevOpsProvisioningState provisioningState; - - /* - * Gets or sets parent Azure DevOps Organization name. - */ - private String parentOrgName; - - /* - * Gets or sets parent Azure DevOps Project name. - */ - private String parentProjectName; - - /* - * Gets or sets Azure DevOps Repository id. - */ - private String repoId; - - /* - * Gets or sets Azure DevOps Repository url. - */ - private String repoUrl; - - /* - * Gets or sets Azure DevOps repository visibility, whether it is public or private etc. - */ - private String visibility; - - /* - * Details about resource onboarding status across all connectors. - * - * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only - * applicable to top-level resources. - * Onboarded - this resource has already been onboarded by the specified connector. - * NotOnboarded - this resource has not been onboarded to any connector. - * NotApplicable - the onboarding state is not applicable to the current endpoint. - */ - private OnboardingState onboardingState; - - /* - * Configuration payload for PR Annotations. - */ - private ActionableRemediation actionableRemediation; - - /** - * Creates an instance of AzureDevOpsRepositoryProperties class. - */ - public AzureDevOpsRepositoryProperties() { - } - - /** - * Get the provisioningStatusMessage property: Gets the resource status message. - * - * @return the provisioningStatusMessage value. - */ - public String provisioningStatusMessage() { - return this.provisioningStatusMessage; - } - - /** - * Get the provisioningStatusUpdateTimeUtc property: Gets the time when resource was last checked. - * - * @return the provisioningStatusUpdateTimeUtc value. - */ - public OffsetDateTime provisioningStatusUpdateTimeUtc() { - return this.provisioningStatusUpdateTimeUtc; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - * - * @return the provisioningState value. - */ - public DevOpsProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the parentOrgName property: Gets or sets parent Azure DevOps Organization name. - * - * @return the parentOrgName value. - */ - public String parentOrgName() { - return this.parentOrgName; - } - - /** - * Set the parentOrgName property: Gets or sets parent Azure DevOps Organization name. - * - * @param parentOrgName the parentOrgName value to set. - * @return the AzureDevOpsRepositoryProperties object itself. - */ - public AzureDevOpsRepositoryProperties withParentOrgName(String parentOrgName) { - this.parentOrgName = parentOrgName; - return this; - } - - /** - * Get the parentProjectName property: Gets or sets parent Azure DevOps Project name. - * - * @return the parentProjectName value. - */ - public String parentProjectName() { - return this.parentProjectName; - } - - /** - * Set the parentProjectName property: Gets or sets parent Azure DevOps Project name. - * - * @param parentProjectName the parentProjectName value to set. - * @return the AzureDevOpsRepositoryProperties object itself. - */ - public AzureDevOpsRepositoryProperties withParentProjectName(String parentProjectName) { - this.parentProjectName = parentProjectName; - return this; - } - - /** - * Get the repoId property: Gets or sets Azure DevOps Repository id. - * - * @return the repoId value. - */ - public String repoId() { - return this.repoId; - } - - /** - * Get the repoUrl property: Gets or sets Azure DevOps Repository url. - * - * @return the repoUrl value. - */ - public String repoUrl() { - return this.repoUrl; - } - - /** - * Get the visibility property: Gets or sets Azure DevOps repository visibility, whether it is public or private - * etc. - * - * @return the visibility value. - */ - public String visibility() { - return this.visibility; - } - - /** - * Get the onboardingState property: Details about resource onboarding status across all connectors. - * - * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only - * applicable to top-level resources. - * Onboarded - this resource has already been onboarded by the specified connector. - * NotOnboarded - this resource has not been onboarded to any connector. - * NotApplicable - the onboarding state is not applicable to the current endpoint. - * - * @return the onboardingState value. - */ - public OnboardingState onboardingState() { - return this.onboardingState; - } - - /** - * Set the onboardingState property: Details about resource onboarding status across all connectors. - * - * OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only - * applicable to top-level resources. - * Onboarded - this resource has already been onboarded by the specified connector. - * NotOnboarded - this resource has not been onboarded to any connector. - * NotApplicable - the onboarding state is not applicable to the current endpoint. - * - * @param onboardingState the onboardingState value to set. - * @return the AzureDevOpsRepositoryProperties object itself. - */ - public AzureDevOpsRepositoryProperties withOnboardingState(OnboardingState onboardingState) { - this.onboardingState = onboardingState; - return this; - } - - /** - * Get the actionableRemediation property: Configuration payload for PR Annotations. - * - * @return the actionableRemediation value. - */ - public ActionableRemediation actionableRemediation() { - return this.actionableRemediation; - } - - /** - * Set the actionableRemediation property: Configuration payload for PR Annotations. - * - * @param actionableRemediation the actionableRemediation value to set. - * @return the AzureDevOpsRepositoryProperties object itself. - */ - public AzureDevOpsRepositoryProperties withActionableRemediation(ActionableRemediation actionableRemediation) { - this.actionableRemediation = actionableRemediation; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (actionableRemediation() != null) { - actionableRemediation().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("parentOrgName", this.parentOrgName); - jsonWriter.writeStringField("parentProjectName", this.parentProjectName); - jsonWriter.writeStringField("onboardingState", - this.onboardingState == null ? null : this.onboardingState.toString()); - jsonWriter.writeJsonField("actionableRemediation", this.actionableRemediation); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureDevOpsRepositoryProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureDevOpsRepositoryProperties 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 AzureDevOpsRepositoryProperties. - */ - public static AzureDevOpsRepositoryProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureDevOpsRepositoryProperties deserializedAzureDevOpsRepositoryProperties - = new AzureDevOpsRepositoryProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningStatusMessage".equals(fieldName)) { - deserializedAzureDevOpsRepositoryProperties.provisioningStatusMessage = reader.getString(); - } else if ("provisioningStatusUpdateTimeUtc".equals(fieldName)) { - deserializedAzureDevOpsRepositoryProperties.provisioningStatusUpdateTimeUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("provisioningState".equals(fieldName)) { - deserializedAzureDevOpsRepositoryProperties.provisioningState - = DevOpsProvisioningState.fromString(reader.getString()); - } else if ("parentOrgName".equals(fieldName)) { - deserializedAzureDevOpsRepositoryProperties.parentOrgName = reader.getString(); - } else if ("parentProjectName".equals(fieldName)) { - deserializedAzureDevOpsRepositoryProperties.parentProjectName = reader.getString(); - } else if ("repoId".equals(fieldName)) { - deserializedAzureDevOpsRepositoryProperties.repoId = reader.getString(); - } else if ("repoUrl".equals(fieldName)) { - deserializedAzureDevOpsRepositoryProperties.repoUrl = reader.getString(); - } else if ("visibility".equals(fieldName)) { - deserializedAzureDevOpsRepositoryProperties.visibility = reader.getString(); - } else if ("onboardingState".equals(fieldName)) { - deserializedAzureDevOpsRepositoryProperties.onboardingState - = OnboardingState.fromString(reader.getString()); - } else if ("actionableRemediation".equals(fieldName)) { - deserializedAzureDevOpsRepositoryProperties.actionableRemediation - = ActionableRemediation.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureDevOpsRepositoryProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsScopeEnvironmentData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsScopeEnvironmentData.java deleted file mode 100644 index d23429d03a4f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsScopeEnvironmentData.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The AzureDevOps scope connector's environment data. - */ -@Immutable -public final class AzureDevOpsScopeEnvironmentData extends EnvironmentData { - /* - * The type of the environment data. - */ - private EnvironmentType environmentType = EnvironmentType.AZURE_DEV_OPS_SCOPE; - - /** - * Creates an instance of AzureDevOpsScopeEnvironmentData class. - */ - public AzureDevOpsScopeEnvironmentData() { - } - - /** - * Get the environmentType property: The type of the environment data. - * - * @return the environmentType value. - */ - @Override - public EnvironmentType environmentType() { - return this.environmentType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("environmentType", - this.environmentType == null ? null : this.environmentType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureDevOpsScopeEnvironmentData from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureDevOpsScopeEnvironmentData 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 AzureDevOpsScopeEnvironmentData. - */ - public static AzureDevOpsScopeEnvironmentData fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureDevOpsScopeEnvironmentData deserializedAzureDevOpsScopeEnvironmentData - = new AzureDevOpsScopeEnvironmentData(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("environmentType".equals(fieldName)) { - deserializedAzureDevOpsScopeEnvironmentData.environmentType - = EnvironmentType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureDevOpsScopeEnvironmentData; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureResourceDetails.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureResourceDetails.java deleted file mode 100644 index 105a294f315f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureResourceDetails.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Details of the Azure resource that was assessed. - */ -@Immutable -public final class AzureResourceDetails extends ResourceDetails { - /* - * The platform where the assessed resource resides - */ - private Source source = Source.AZURE; - - /* - * Azure resource Id of the assessed resource - */ - private String id; - - /** - * Creates an instance of AzureResourceDetails class. - */ - public AzureResourceDetails() { - } - - /** - * Get the source property: The platform where the assessed resource resides. - * - * @return the source value. - */ - @Override - public Source source() { - return this.source; - } - - /** - * Get the id property: Azure resource Id of the assessed resource. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("source", this.source == null ? null : this.source.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureResourceDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureResourceDetails 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 AzureResourceDetails. - */ - public static AzureResourceDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureResourceDetails deserializedAzureResourceDetails = new AzureResourceDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("source".equals(fieldName)) { - deserializedAzureResourceDetails.source = Source.fromString(reader.getString()); - } else if ("id".equals(fieldName)) { - deserializedAzureResourceDetails.id = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureResourceDetails; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureResourceIdentifier.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureResourceIdentifier.java deleted file mode 100644 index 8310273a7474..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureResourceIdentifier.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure resource identifier. - */ -@Immutable -public final class AzureResourceIdentifier extends ResourceIdentifier { - /* - * There can be multiple identifiers of different type per alert, this field specify the identifier type. - */ - private ResourceIdentifierType type = ResourceIdentifierType.AZURE_RESOURCE; - - /* - * ARM resource identifier for the cloud resource being alerted on - */ - private String azureResourceId; - - /** - * Creates an instance of AzureResourceIdentifier class. - */ - private AzureResourceIdentifier() { - } - - /** - * Get the type property: There can be multiple identifiers of different type per alert, this field specify the - * identifier type. - * - * @return the type value. - */ - @Override - public ResourceIdentifierType type() { - return this.type; - } - - /** - * Get the azureResourceId property: ARM resource identifier for the cloud resource being alerted on. - * - * @return the azureResourceId value. - */ - public String azureResourceId() { - return this.azureResourceId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureResourceIdentifier from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureResourceIdentifier 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 AzureResourceIdentifier. - */ - public static AzureResourceIdentifier fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureResourceIdentifier deserializedAzureResourceIdentifier = new AzureResourceIdentifier(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedAzureResourceIdentifier.type = ResourceIdentifierType.fromString(reader.getString()); - } else if ("azureResourceId".equals(fieldName)) { - deserializedAzureResourceIdentifier.azureResourceId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureResourceIdentifier; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureResourceLink.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureResourceLink.java deleted file mode 100644 index b9134215bddf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureResourceLink.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Describes an Azure resource with kind. - */ -@Immutable -public final class AzureResourceLink implements JsonSerializable { - /* - * Azure resource Id - */ - private String id; - - /** - * Creates an instance of AzureResourceLink class. - */ - private AzureResourceLink() { - } - - /** - * Get the id property: Azure resource Id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * 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 AzureResourceLink from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureResourceLink 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 AzureResourceLink. - */ - public static AzureResourceLink fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureResourceLink deserializedAzureResourceLink = new AzureResourceLink(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAzureResourceLink.id = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureResourceLink; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureServersSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureServersSetting.java deleted file mode 100644 index 3d5dcd031bb0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureServersSetting.java +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -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.security.fluent.models.ServerVulnerabilityAssessmentsAzureSettingProperties; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsSettingInner; -import java.io.IOException; - -/** - * A vulnerability assessments setting on Azure servers in the defined scope. - */ -@Fluent -public final class AzureServersSetting extends ServerVulnerabilityAssessmentsSettingInner { - /* - * The kind of the server vulnerability assessments setting. - */ - private ServerVulnerabilityAssessmentsSettingKind kind - = ServerVulnerabilityAssessmentsSettingKind.AZURE_SERVERS_SETTING; - - /* - * The vulnerability assessments setting properties on Azure servers in the defined scope. - */ - private ServerVulnerabilityAssessmentsAzureSettingProperties 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 AzureServersSetting class. - */ - public AzureServersSetting() { - } - - /** - * Get the kind property: The kind of the server vulnerability assessments setting. - * - * @return the kind value. - */ - @Override - public ServerVulnerabilityAssessmentsSettingKind kind() { - return this.kind; - } - - /** - * Get the innerProperties property: The vulnerability assessments setting properties on Azure servers in the - * defined scope. - * - * @return the innerProperties value. - */ - private ServerVulnerabilityAssessmentsAzureSettingProperties innerProperties() { - return this.innerProperties; - } - - /** - * 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: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public AzureServersSetting withProperties(ServerVulnerabilityAssessmentsSettingProperties properties) { - super.withProperties(properties); - return this; - } - - /** - * Get the selectedProvider property: The selected vulnerability assessments provider on Azure servers in the - * defined scope. - * - * @return the selectedProvider value. - */ - public ServerVulnerabilityAssessmentsAzureSettingSelectedProvider selectedProvider() { - return this.innerProperties() == null ? null : this.innerProperties().selectedProvider(); - } - - /** - * Set the selectedProvider property: The selected vulnerability assessments provider on Azure servers in the - * defined scope. - * - * @param selectedProvider the selectedProvider value to set. - * @return the AzureServersSetting object itself. - */ - public AzureServersSetting - withSelectedProvider(ServerVulnerabilityAssessmentsAzureSettingSelectedProvider selectedProvider) { - if (this.innerProperties() == null) { - this.innerProperties = new ServerVulnerabilityAssessmentsAzureSettingProperties(); - } - this.innerProperties().withSelectedProvider(selectedProvider); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AzureServersSetting from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureServersSetting 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 AzureServersSetting. - */ - public static AzureServersSetting fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureServersSetting deserializedAzureServersSetting = new AzureServersSetting(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAzureServersSetting.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAzureServersSetting.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAzureServersSetting.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedAzureServersSetting.systemData = SystemData.fromJson(reader); - } else if ("kind".equals(fieldName)) { - deserializedAzureServersSetting.kind - = ServerVulnerabilityAssessmentsSettingKind.fromString(reader.getString()); - } else if ("properties".equals(fieldName)) { - deserializedAzureServersSetting.innerProperties - = ServerVulnerabilityAssessmentsAzureSettingProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureServersSetting; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Baseline.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Baseline.java deleted file mode 100644 index 8ea77b6da7f8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Baseline.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.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; -import java.util.List; - -/** - * Baseline details. - */ -@Immutable -public final class Baseline implements JsonSerializable { - /* - * Expected results. - */ - private List> expectedResults; - - /* - * Baseline update time (UTC). - */ - private OffsetDateTime updatedTime; - - /** - * Creates an instance of Baseline class. - */ - private Baseline() { - } - - /** - * Get the expectedResults property: Expected results. - * - * @return the expectedResults value. - */ - public List> expectedResults() { - return this.expectedResults; - } - - /** - * Get the updatedTime property: Baseline update time (UTC). - * - * @return the updatedTime value. - */ - public OffsetDateTime updatedTime() { - return this.updatedTime; - } - - /** - * 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.writeArrayField("expectedResults", this.expectedResults, - (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeString(element1))); - jsonWriter.writeStringField("updatedTime", - this.updatedTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.updatedTime)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Baseline from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Baseline 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 Baseline. - */ - public static Baseline fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Baseline deserializedBaseline = new Baseline(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("expectedResults".equals(fieldName)) { - List> expectedResults - = reader.readArray(reader1 -> reader1.readArray(reader2 -> reader2.getString())); - deserializedBaseline.expectedResults = expectedResults; - } else if ("updatedTime".equals(fieldName)) { - deserializedBaseline.updatedTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedBaseline; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BaselineAdjustedResult.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BaselineAdjustedResult.java deleted file mode 100644 index 00c89d1aa468..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BaselineAdjustedResult.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The rule result adjusted with baseline. - */ -@Immutable -public final class BaselineAdjustedResult implements JsonSerializable { - /* - * Baseline details. - */ - private Baseline baseline; - - /* - * The rule result status. - */ - private RuleStatus status; - - /* - * Results that are not in the baseline. - */ - private List> resultsNotInBaseline; - - /* - * Results that are in the baseline. - */ - private List> resultsOnlyInBaseline; - - /** - * Creates an instance of BaselineAdjustedResult class. - */ - private BaselineAdjustedResult() { - } - - /** - * Get the baseline property: Baseline details. - * - * @return the baseline value. - */ - public Baseline baseline() { - return this.baseline; - } - - /** - * Get the status property: The rule result status. - * - * @return the status value. - */ - public RuleStatus status() { - return this.status; - } - - /** - * Get the resultsNotInBaseline property: Results that are not in the baseline. - * - * @return the resultsNotInBaseline value. - */ - public List> resultsNotInBaseline() { - return this.resultsNotInBaseline; - } - - /** - * Get the resultsOnlyInBaseline property: Results that are in the baseline. - * - * @return the resultsOnlyInBaseline value. - */ - public List> resultsOnlyInBaseline() { - return this.resultsOnlyInBaseline; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (baseline() != null) { - baseline().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("baseline", this.baseline); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeArrayField("resultsNotInBaseline", this.resultsNotInBaseline, - (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeString(element1))); - jsonWriter.writeArrayField("resultsOnlyInBaseline", this.resultsOnlyInBaseline, - (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeString(element1))); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BaselineAdjustedResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BaselineAdjustedResult 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 BaselineAdjustedResult. - */ - public static BaselineAdjustedResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BaselineAdjustedResult deserializedBaselineAdjustedResult = new BaselineAdjustedResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("baseline".equals(fieldName)) { - deserializedBaselineAdjustedResult.baseline = Baseline.fromJson(reader); - } else if ("status".equals(fieldName)) { - deserializedBaselineAdjustedResult.status = RuleStatus.fromString(reader.getString()); - } else if ("resultsNotInBaseline".equals(fieldName)) { - List> resultsNotInBaseline - = reader.readArray(reader1 -> reader1.readArray(reader2 -> reader2.getString())); - deserializedBaselineAdjustedResult.resultsNotInBaseline = resultsNotInBaseline; - } else if ("resultsOnlyInBaseline".equals(fieldName)) { - List> resultsOnlyInBaseline - = reader.readArray(reader1 -> reader1.readArray(reader2 -> reader2.getString())); - deserializedBaselineAdjustedResult.resultsOnlyInBaseline = resultsOnlyInBaseline; - } else { - reader.skipChildren(); - } - } - - return deserializedBaselineAdjustedResult; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BenchmarkReference.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BenchmarkReference.java deleted file mode 100644 index 06fe4ef41c5e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BenchmarkReference.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The benchmark references. - */ -@Immutable -public final class BenchmarkReference implements JsonSerializable { - /* - * The benchmark name. - */ - private String benchmark; - - /* - * The benchmark reference. - */ - private String reference; - - /** - * Creates an instance of BenchmarkReference class. - */ - private BenchmarkReference() { - } - - /** - * Get the benchmark property: The benchmark name. - * - * @return the benchmark value. - */ - public String benchmark() { - return this.benchmark; - } - - /** - * Get the reference property: The benchmark reference. - * - * @return the reference value. - */ - public String reference() { - return this.reference; - } - - /** - * 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("benchmark", this.benchmark); - jsonWriter.writeStringField("reference", this.reference); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BenchmarkReference from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BenchmarkReference 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 BenchmarkReference. - */ - public static BenchmarkReference fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BenchmarkReference deserializedBenchmarkReference = new BenchmarkReference(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("benchmark".equals(fieldName)) { - deserializedBenchmarkReference.benchmark = reader.getString(); - } else if ("reference".equals(fieldName)) { - deserializedBenchmarkReference.reference = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedBenchmarkReference; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BlobScanResultsOptions.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BlobScanResultsOptions.java deleted file mode 100644 index 0dca5c7252b7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BlobScanResultsOptions.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Optional. Write scan result on BlobIndexTags by default. - */ -public final class BlobScanResultsOptions extends ExpandableStringEnum { - /** - * Write scan results on the blobs index tags. - */ - public static final BlobScanResultsOptions BLOB_INDEX_TAGS = fromString("BlobIndexTags"); - - /** - * Do not write scan results on the blobs index tags. - */ - public static final BlobScanResultsOptions NONE = fromString("None"); - - /** - * Creates a new instance of BlobScanResultsOptions value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public BlobScanResultsOptions() { - } - - /** - * Creates or finds a BlobScanResultsOptions from its string representation. - * - * @param name a name to look for. - * @return the corresponding BlobScanResultsOptions. - */ - public static BlobScanResultsOptions fromString(String name) { - return fromString(name, BlobScanResultsOptions.class); - } - - /** - * Gets known BlobScanResultsOptions values. - * - * @return known BlobScanResultsOptions values. - */ - public static Collection values() { - return values(BlobScanResultsOptions.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BlobsScanSummary.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BlobsScanSummary.java deleted file mode 100644 index b77e064fca83..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BlobsScanSummary.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * A summary of the scan results of the blobs that were scanned. - */ -@Immutable -public final class BlobsScanSummary implements JsonSerializable { - /* - * The total number of blobs that were scanned. - */ - private Long totalBlobsScanned; - - /* - * The number of malicious blobs that were detected during the scan. - */ - private Long maliciousBlobsCount; - - /* - * The number of blobs that were skipped. - */ - private Long skippedBlobsCount; - - /* - * The number of failed blob scans. - */ - private Long failedBlobsCount; - - /* - * The number of gigabytes of data that were scanned. - */ - private Double scannedBlobsInGB; - - /** - * Creates an instance of BlobsScanSummary class. - */ - private BlobsScanSummary() { - } - - /** - * Get the totalBlobsScanned property: The total number of blobs that were scanned. - * - * @return the totalBlobsScanned value. - */ - public Long totalBlobsScanned() { - return this.totalBlobsScanned; - } - - /** - * Get the maliciousBlobsCount property: The number of malicious blobs that were detected during the scan. - * - * @return the maliciousBlobsCount value. - */ - public Long maliciousBlobsCount() { - return this.maliciousBlobsCount; - } - - /** - * Get the skippedBlobsCount property: The number of blobs that were skipped. - * - * @return the skippedBlobsCount value. - */ - public Long skippedBlobsCount() { - return this.skippedBlobsCount; - } - - /** - * Get the failedBlobsCount property: The number of failed blob scans. - * - * @return the failedBlobsCount value. - */ - public Long failedBlobsCount() { - return this.failedBlobsCount; - } - - /** - * Get the scannedBlobsInGB property: The number of gigabytes of data that were scanned. - * - * @return the scannedBlobsInGB value. - */ - public Double scannedBlobsInGB() { - return this.scannedBlobsInGB; - } - - /** - * 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.writeNumberField("totalBlobsScanned", this.totalBlobsScanned); - jsonWriter.writeNumberField("maliciousBlobsCount", this.maliciousBlobsCount); - jsonWriter.writeNumberField("skippedBlobsCount", this.skippedBlobsCount); - jsonWriter.writeNumberField("failedBlobsCount", this.failedBlobsCount); - jsonWriter.writeNumberField("scannedBlobsInGB", this.scannedBlobsInGB); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BlobsScanSummary from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BlobsScanSummary 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 BlobsScanSummary. - */ - public static BlobsScanSummary fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BlobsScanSummary deserializedBlobsScanSummary = new BlobsScanSummary(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("totalBlobsScanned".equals(fieldName)) { - deserializedBlobsScanSummary.totalBlobsScanned = reader.getNullable(JsonReader::getLong); - } else if ("maliciousBlobsCount".equals(fieldName)) { - deserializedBlobsScanSummary.maliciousBlobsCount = reader.getNullable(JsonReader::getLong); - } else if ("skippedBlobsCount".equals(fieldName)) { - deserializedBlobsScanSummary.skippedBlobsCount = reader.getNullable(JsonReader::getLong); - } else if ("failedBlobsCount".equals(fieldName)) { - deserializedBlobsScanSummary.failedBlobsCount = reader.getNullable(JsonReader::getLong); - } else if ("scannedBlobsInGB".equals(fieldName)) { - deserializedBlobsScanSummary.scannedBlobsInGB = reader.getNullable(JsonReader::getDouble); - } else { - reader.skipChildren(); - } - } - - return deserializedBlobsScanSummary; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BuiltInInfoType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BuiltInInfoType.java deleted file mode 100644 index 1eb255919123..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BuiltInInfoType.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Pre-configured sensitive information type. - */ -@Immutable -public final class BuiltInInfoType implements JsonSerializable { - /* - * Display name of the info type - */ - private String name; - - /* - * Id of the info type - */ - private String id; - - /* - * Category of the built-in info type - */ - private String type; - - /** - * Creates an instance of BuiltInInfoType class. - */ - private BuiltInInfoType() { - } - - /** - * Get the name property: Display name of the info type. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the id property: Id of the info type. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the type property: Category of the built-in info type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * 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("id", this.id); - jsonWriter.writeStringField("type", this.type); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of BuiltInInfoType from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of BuiltInInfoType 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 BuiltInInfoType. - */ - public static BuiltInInfoType fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BuiltInInfoType deserializedBuiltInInfoType = new BuiltInInfoType(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedBuiltInInfoType.name = reader.getString(); - } else if ("id".equals(fieldName)) { - deserializedBuiltInInfoType.id = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedBuiltInInfoType.type = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedBuiltInInfoType; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BundleType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BundleType.java deleted file mode 100644 index fba936936331..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BundleType.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Alert Simulator supported bundles. - */ -public final class BundleType extends ExpandableStringEnum { - /** - * AppServices. - */ - public static final BundleType APP_SERVICES = fromString("AppServices"); - - /** - * DNS. - */ - public static final BundleType DNS = fromString("DNS"); - - /** - * KeyVaults. - */ - public static final BundleType KEY_VAULTS = fromString("KeyVaults"); - - /** - * KubernetesService. - */ - public static final BundleType KUBERNETES_SERVICE = fromString("KubernetesService"); - - /** - * ResourceManager. - */ - public static final BundleType RESOURCE_MANAGER = fromString("ResourceManager"); - - /** - * SqlServers. - */ - public static final BundleType SQL_SERVERS = fromString("SqlServers"); - - /** - * StorageAccounts. - */ - public static final BundleType STORAGE_ACCOUNTS = fromString("StorageAccounts"); - - /** - * VirtualMachines. - */ - public static final BundleType VIRTUAL_MACHINES = fromString("VirtualMachines"); - - /** - * CosmosDbs. - */ - public static final BundleType COSMOS_DBS = fromString("CosmosDbs"); - - /** - * Creates a new instance of BundleType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public BundleType() { - } - - /** - * Creates or finds a BundleType from its string representation. - * - * @param name a name to look for. - * @return the corresponding BundleType. - */ - public static BundleType fromString(String name) { - return fromString(name, BundleType.class); - } - - /** - * Gets known BundleType values. - * - * @return known BundleType values. - */ - public static Collection values() { - return values(BundleType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Categories.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Categories.java deleted file mode 100644 index b77e865e3bf8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Categories.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The categories of resource that is at risk when the assessment is unhealthy. - */ -public final class Categories extends ExpandableStringEnum { - /** - * Compute. - */ - public static final Categories COMPUTE = fromString("Compute"); - - /** - * Networking. - */ - public static final Categories NETWORKING = fromString("Networking"); - - /** - * Data. - */ - public static final Categories DATA = fromString("Data"); - - /** - * IdentityAndAccess. - */ - public static final Categories IDENTITY_AND_ACCESS = fromString("IdentityAndAccess"); - - /** - * IoT. - */ - public static final Categories IOT = fromString("IoT"); - - /** - * Container. - */ - public static final Categories CONTAINER = fromString("Container"); - - /** - * AppServices. - */ - public static final Categories APP_SERVICES = fromString("AppServices"); - - /** - * Creates a new instance of Categories value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Categories() { - } - - /** - * Creates or finds a Categories from its string representation. - * - * @param name a name to look for. - * @return the corresponding Categories. - */ - public static Categories fromString(String name) { - return fromString(name, Categories.class); - } - - /** - * Gets known Categories values. - * - * @return known Categories values. - */ - public static Collection values() { - return values(Categories.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CategoryConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CategoryConfiguration.java deleted file mode 100644 index a4bf9266e6d2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CategoryConfiguration.java +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * Severity level per category configuration for PR Annotations. - */ -@Fluent -public final class CategoryConfiguration implements JsonSerializable { - /* - * Gets or sets minimum severity level for a given category. - */ - private String minimumSeverityLevel; - - /* - * Rule categories. - * Code - code scanning results. - * Artifact scanning results. - * Dependencies scanning results. - * IaC results. - * Secrets scanning results. - * Container scanning results. - */ - private RuleCategory category; - - /** - * Creates an instance of CategoryConfiguration class. - */ - public CategoryConfiguration() { - } - - /** - * Get the minimumSeverityLevel property: Gets or sets minimum severity level for a given category. - * - * @return the minimumSeverityLevel value. - */ - public String minimumSeverityLevel() { - return this.minimumSeverityLevel; - } - - /** - * Set the minimumSeverityLevel property: Gets or sets minimum severity level for a given category. - * - * @param minimumSeverityLevel the minimumSeverityLevel value to set. - * @return the CategoryConfiguration object itself. - */ - public CategoryConfiguration withMinimumSeverityLevel(String minimumSeverityLevel) { - this.minimumSeverityLevel = minimumSeverityLevel; - return this; - } - - /** - * Get the category property: Rule categories. - * Code - code scanning results. - * Artifact scanning results. - * Dependencies scanning results. - * IaC results. - * Secrets scanning results. - * Container scanning results. - * - * @return the category value. - */ - public RuleCategory category() { - return this.category; - } - - /** - * Set the category property: Rule categories. - * Code - code scanning results. - * Artifact scanning results. - * Dependencies scanning results. - * IaC results. - * Secrets scanning results. - * Container scanning results. - * - * @param category the category value to set. - * @return the CategoryConfiguration object itself. - */ - public CategoryConfiguration withCategory(RuleCategory category) { - this.category = category; - 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("minimumSeverityLevel", this.minimumSeverityLevel); - jsonWriter.writeStringField("category", this.category == null ? null : this.category.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CategoryConfiguration from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CategoryConfiguration 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 CategoryConfiguration. - */ - public static CategoryConfiguration fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CategoryConfiguration deserializedCategoryConfiguration = new CategoryConfiguration(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("minimumSeverityLevel".equals(fieldName)) { - deserializedCategoryConfiguration.minimumSeverityLevel = reader.getString(); - } else if ("category".equals(fieldName)) { - deserializedCategoryConfiguration.category = RuleCategory.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedCategoryConfiguration; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CefExternalSecuritySolution.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CefExternalSecuritySolution.java deleted file mode 100644 index 3e4c87b9b4c2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CefExternalSecuritySolution.java +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner; -import java.io.IOException; - -/** - * Represents a security solution which sends CEF logs to an OMS workspace. - */ -@Immutable -public final class CefExternalSecuritySolution extends ExternalSecuritySolutionInner { - /* - * The kind of the external solution - */ - private ExternalSecuritySolutionKind kind = ExternalSecuritySolutionKind.CEF; - - /* - * The external security solution properties for CEF solutions - */ - private CefSolutionProperties properties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * Location where the resource is stored - */ - private String location; - - /* - * 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 CefExternalSecuritySolution class. - */ - private CefExternalSecuritySolution() { - } - - /** - * Get the kind property: The kind of the external solution. - * - * @return the kind value. - */ - @Override - public ExternalSecuritySolutionKind kind() { - return this.kind; - } - - /** - * Get the properties property: The external security solution properties for CEF solutions. - * - * @return the properties value. - */ - @Override - public CefSolutionProperties properties() { - return this.properties; - } - - /** - * 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 location property: Location where the resource is stored. - * - * @return the location value. - */ - @Override - public String location() { - return this.location; - } - - /** - * 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. - */ - @Override - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CefExternalSecuritySolution from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CefExternalSecuritySolution 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 CefExternalSecuritySolution. - */ - public static CefExternalSecuritySolution fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CefExternalSecuritySolution deserializedCefExternalSecuritySolution = new CefExternalSecuritySolution(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedCefExternalSecuritySolution.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedCefExternalSecuritySolution.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedCefExternalSecuritySolution.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedCefExternalSecuritySolution.location = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedCefExternalSecuritySolution.systemData = SystemData.fromJson(reader); - } else if ("kind".equals(fieldName)) { - deserializedCefExternalSecuritySolution.kind - = ExternalSecuritySolutionKind.fromString(reader.getString()); - } else if ("properties".equals(fieldName)) { - deserializedCefExternalSecuritySolution.properties = CefSolutionProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCefExternalSecuritySolution; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CefSolutionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CefSolutionProperties.java deleted file mode 100644 index 6f13964c237d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CefSolutionProperties.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * The external security solution properties for CEF solutions. - */ -@Immutable -public final class CefSolutionProperties extends ExternalSecuritySolutionProperties { - /* - * The hostname property. - */ - private String hostname; - - /* - * The agent property. - */ - private String agent; - - /* - * The lastEventReceived property. - */ - private String lastEventReceived; - - /* - * The solution properties (correspond to the solution kind) - */ - private Map additionalProperties; - - /* - * Represents an OMS workspace to which the solution is connected - */ - private ConnectedWorkspace workspace; - - /* - * The deviceType property. - */ - private String deviceType; - - /* - * The deviceVendor property. - */ - private String deviceVendor; - - /** - * Creates an instance of CefSolutionProperties class. - */ - private CefSolutionProperties() { - } - - /** - * Get the hostname property: The hostname property. - * - * @return the hostname value. - */ - public String hostname() { - return this.hostname; - } - - /** - * Get the agent property: The agent property. - * - * @return the agent value. - */ - public String agent() { - return this.agent; - } - - /** - * Get the lastEventReceived property: The lastEventReceived property. - * - * @return the lastEventReceived value. - */ - public String lastEventReceived() { - return this.lastEventReceived; - } - - /** - * Get the additionalProperties property: The solution properties (correspond to the solution kind). - * - * @return the additionalProperties value. - */ - @Override - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Get the workspace property: Represents an OMS workspace to which the solution is connected. - * - * @return the workspace value. - */ - @Override - public ConnectedWorkspace workspace() { - return this.workspace; - } - - /** - * Get the deviceType property: The deviceType property. - * - * @return the deviceType value. - */ - @Override - public String deviceType() { - return this.deviceType; - } - - /** - * Get the deviceVendor property: The deviceVendor property. - * - * @return the deviceVendor value. - */ - @Override - public String deviceVendor() { - return this.deviceVendor; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (workspace() != null) { - workspace().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("deviceVendor", deviceVendor()); - jsonWriter.writeStringField("deviceType", deviceType()); - jsonWriter.writeJsonField("workspace", workspace()); - jsonWriter.writeStringField("hostname", this.hostname); - jsonWriter.writeStringField("agent", this.agent); - jsonWriter.writeStringField("lastEventReceived", this.lastEventReceived); - if (additionalProperties() != null) { - for (Map.Entry additionalProperty : additionalProperties().entrySet()) { - jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); - } - } - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CefSolutionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CefSolutionProperties 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 CefSolutionProperties. - */ - public static CefSolutionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CefSolutionProperties deserializedCefSolutionProperties = new CefSolutionProperties(); - Map additionalProperties = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("deviceVendor".equals(fieldName)) { - deserializedCefSolutionProperties.deviceVendor = reader.getString(); - } else if ("deviceType".equals(fieldName)) { - deserializedCefSolutionProperties.deviceType = reader.getString(); - } else if ("workspace".equals(fieldName)) { - deserializedCefSolutionProperties.workspace = ConnectedWorkspace.fromJson(reader); - } else if ("hostname".equals(fieldName)) { - deserializedCefSolutionProperties.hostname = reader.getString(); - } else if ("agent".equals(fieldName)) { - deserializedCefSolutionProperties.agent = reader.getString(); - } else if ("lastEventReceived".equals(fieldName)) { - deserializedCefSolutionProperties.lastEventReceived = reader.getString(); - } else { - if (additionalProperties == null) { - additionalProperties = new LinkedHashMap<>(); - } - - additionalProperties.put(fieldName, reader.readUntyped()); - } - } - deserializedCefSolutionProperties.additionalProperties = additionalProperties; - - return deserializedCefSolutionProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudName.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudName.java deleted file mode 100644 index c178dfff8d65..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudName.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The multi cloud resource's cloud name. - */ -public final class CloudName extends ExpandableStringEnum { - /** - * Azure. - */ - public static final CloudName AZURE = fromString("Azure"); - - /** - * AWS. - */ - public static final CloudName AWS = fromString("AWS"); - - /** - * GCP. - */ - public static final CloudName GCP = fromString("GCP"); - - /** - * Github. - */ - public static final CloudName GITHUB = fromString("Github"); - - /** - * AzureDevOps. - */ - public static final CloudName AZURE_DEV_OPS = fromString("AzureDevOps"); - - /** - * GitLab. - */ - public static final CloudName GIT_LAB = fromString("GitLab"); - - /** - * DockerHub. - */ - public static final CloudName DOCKER_HUB = fromString("DockerHub"); - - /** - * JFrog. - */ - public static final CloudName JFROG = fromString("JFrog"); - - /** - * Creates a new instance of CloudName value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public CloudName() { - } - - /** - * Creates or finds a CloudName from its string representation. - * - * @param name a name to look for. - * @return the corresponding CloudName. - */ - public static CloudName fromString(String name) { - return fromString(name, CloudName.class); - } - - /** - * Gets known CloudName values. - * - * @return known CloudName values. - */ - public static Collection values() { - return values(CloudName.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudOffering.java deleted file mode 100644 index e73f3e6c5fe4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudOffering.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The security offering details. - */ -@Immutable -public class CloudOffering implements JsonSerializable { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.fromString("cloudOffering"); - - /* - * The offering description. - */ - private String description; - - /** - * Creates an instance of CloudOffering class. - */ - public CloudOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Get the description property: The offering description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The offering description. - * - * @param description the description value to set. - * @return the CloudOffering object itself. - */ - CloudOffering withDescription(String description) { - this.description = description; - 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("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CloudOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CloudOffering 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 CloudOffering. - */ - public static CloudOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("offeringType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("CspmMonitorAws".equals(discriminatorValue)) { - return CspmMonitorAwsOffering.fromJson(readerToUse.reset()); - } else if ("DefenderForContainersAws".equals(discriminatorValue)) { - return DefenderForContainersAwsOffering.fromJson(readerToUse.reset()); - } else if ("DefenderForServersAws".equals(discriminatorValue)) { - return DefenderForServersAwsOffering.fromJson(readerToUse.reset()); - } else if ("DefenderForDatabasesAws".equals(discriminatorValue)) { - return DefenderFoDatabasesAwsOffering.fromJson(readerToUse.reset()); - } else if ("CspmMonitorGcp".equals(discriminatorValue)) { - return CspmMonitorGcpOffering.fromJson(readerToUse.reset()); - } else if ("DefenderForServersGcp".equals(discriminatorValue)) { - return DefenderForServersGcpOffering.fromJson(readerToUse.reset()); - } else if ("DefenderForDatabasesGcp".equals(discriminatorValue)) { - return DefenderForDatabasesGcpOffering.fromJson(readerToUse.reset()); - } else if ("DefenderForContainersGcp".equals(discriminatorValue)) { - return DefenderForContainersGcpOffering.fromJson(readerToUse.reset()); - } else if ("CspmMonitorGithub".equals(discriminatorValue)) { - return CspmMonitorGithubOffering.fromJson(readerToUse.reset()); - } else if ("CspmMonitorAzureDevOps".equals(discriminatorValue)) { - return CspmMonitorAzureDevOpsOffering.fromJson(readerToUse.reset()); - } else if ("DefenderCspmAws".equals(discriminatorValue)) { - return DefenderCspmAwsOffering.fromJson(readerToUse.reset()); - } else if ("DefenderCspmGcp".equals(discriminatorValue)) { - return DefenderCspmGcpOffering.fromJson(readerToUse.reset()); - } else if ("CspmMonitorGitLab".equals(discriminatorValue)) { - return CspmMonitorGitLabOffering.fromJson(readerToUse.reset()); - } else if ("CspmMonitorDockerHub".equals(discriminatorValue)) { - return CspmMonitorDockerHubOffering.fromJson(readerToUse.reset()); - } else if ("DefenderForContainersDockerHub".equals(discriminatorValue)) { - return DefenderForContainersDockerHubOffering.fromJson(readerToUse.reset()); - } else if ("DefenderCspmDockerHub".equals(discriminatorValue)) { - return DefenderCspmDockerHubOffering.fromJson(readerToUse.reset()); - } else if ("CspmMonitorJFrog".equals(discriminatorValue)) { - return CspmMonitorJFrogOffering.fromJson(readerToUse.reset()); - } else if ("DefenderForContainersJFrog".equals(discriminatorValue)) { - return DefenderForContainersJFrogOffering.fromJson(readerToUse.reset()); - } else if ("DefenderCspmJFrog".equals(discriminatorValue)) { - return DefenderCspmJFrogOffering.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static CloudOffering fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CloudOffering deserializedCloudOffering = new CloudOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("offeringType".equals(fieldName)) { - deserializedCloudOffering.offeringType = OfferingType.fromString(reader.getString()); - } else if ("description".equals(fieldName)) { - deserializedCloudOffering.description = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCloudOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Compliance.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Compliance.java deleted file mode 100644 index 1a0155629058..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Compliance.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.ComplianceInner; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * An immutable client-side representation of Compliance. - */ -public interface Compliance { - /** - * 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 assessmentTimestampUtcDate property: The timestamp when the Compliance calculation was conducted. - * - * @return the assessmentTimestampUtcDate value. - */ - OffsetDateTime assessmentTimestampUtcDate(); - - /** - * Gets the resourceCount property: The resource count of the given subscription for which the Compliance - * calculation was conducted (needed for Management Group Compliance calculation). - * - * @return the resourceCount value. - */ - Integer resourceCount(); - - /** - * Gets the assessmentResult property: An array of segment, which is the actually the compliance assessment. - * - * @return the assessmentResult value. - */ - List assessmentResult(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ComplianceInner object. - * - * @return the inner object. - */ - ComplianceInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceResult.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceResult.java deleted file mode 100644 index e01faad609a8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceResult.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.ComplianceResultInner; - -/** - * An immutable client-side representation of ComplianceResult. - */ -public interface ComplianceResult { - /** - * 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 resourceStatus property: The status of the resource regarding a single assessment. - * - * @return the resourceStatus value. - */ - ResourceStatus resourceStatus(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ComplianceResultInner object. - * - * @return the inner object. - */ - ComplianceResultInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceResults.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceResults.java deleted file mode 100644 index 2b84a79a988e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceResults.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ComplianceResults. - */ -public interface ComplianceResults { - /** - * Security Compliance Result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param complianceResultName The compliance result key. - * @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 compliance result along with {@link Response}. - */ - Response getWithResponse(String resourceId, String complianceResultName, Context context); - - /** - * Security Compliance Result. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param complianceResultName The compliance result key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 compliance result. - */ - ComplianceResult get(String resourceId, String complianceResultName); - - /** - * Security compliance results in the subscription. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of compliance results response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String scope); - - /** - * Security compliance results in the subscription. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of compliance results response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String scope, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceSegment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceSegment.java deleted file mode 100644 index 834ac9098401..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceSegment.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * A segment of a compliance assessment. - */ -@Immutable -public final class ComplianceSegment implements JsonSerializable { - /* - * The segment type, e.g. compliant, non-compliance, insufficient coverage, N/A, etc. - */ - private String segmentType; - - /* - * The size (%) of the segment. - */ - private Double percentage; - - /** - * Creates an instance of ComplianceSegment class. - */ - private ComplianceSegment() { - } - - /** - * Get the segmentType property: The segment type, e.g. compliant, non-compliance, insufficient coverage, N/A, etc. - * - * @return the segmentType value. - */ - public String segmentType() { - return this.segmentType; - } - - /** - * Get the percentage property: The size (%) of the segment. - * - * @return the percentage value. - */ - public Double percentage() { - return this.percentage; - } - - /** - * 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 ComplianceSegment from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComplianceSegment 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 ComplianceSegment. - */ - public static ComplianceSegment fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ComplianceSegment deserializedComplianceSegment = new ComplianceSegment(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("segmentType".equals(fieldName)) { - deserializedComplianceSegment.segmentType = reader.getString(); - } else if ("percentage".equals(fieldName)) { - deserializedComplianceSegment.percentage = reader.getNullable(JsonReader::getDouble); - } else { - reader.skipChildren(); - } - } - - return deserializedComplianceSegment; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Compliances.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Compliances.java deleted file mode 100644 index 3b685e02a389..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Compliances.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of Compliances. - */ -public interface Compliances { - /** - * Details of a specific Compliance. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param complianceName name of the Compliance. - * @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 compliance of a scope along with {@link Response}. - */ - Response getWithResponse(String scope, String complianceName, Context context); - - /** - * Details of a specific Compliance. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param complianceName name of the Compliance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope. - */ - Compliance get(String scope, String complianceName); - - /** - * The Compliance scores of the specific management group. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of Compliance objects response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String scope); - - /** - * The Compliance scores of the specific management group. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of Compliance objects response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String scope, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectableResource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectableResource.java deleted file mode 100644 index ad3e5c2d9290..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectableResource.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Describes the allowed inbound and outbound traffic of an Azure resource. - */ -@Immutable -public final class ConnectableResource implements JsonSerializable { - /* - * The Azure resource id - */ - private String id; - - /* - * The list of Azure resources that the resource has inbound allowed connection from - */ - private List inboundConnectedResources; - - /* - * The list of Azure resources that the resource has outbound allowed connection to - */ - private List outboundConnectedResources; - - /** - * Creates an instance of ConnectableResource class. - */ - private ConnectableResource() { - } - - /** - * Get the id property: The Azure resource id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the inboundConnectedResources property: The list of Azure resources that the resource has inbound allowed - * connection from. - * - * @return the inboundConnectedResources value. - */ - public List inboundConnectedResources() { - return this.inboundConnectedResources; - } - - /** - * Get the outboundConnectedResources property: The list of Azure resources that the resource has outbound allowed - * connection to. - * - * @return the outboundConnectedResources value. - */ - public List outboundConnectedResources() { - return this.outboundConnectedResources; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (inboundConnectedResources() != null) { - inboundConnectedResources().forEach(e -> e.validate()); - } - if (outboundConnectedResources() != null) { - outboundConnectedResources().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ConnectableResource from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ConnectableResource 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 ConnectableResource. - */ - public static ConnectableResource fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ConnectableResource deserializedConnectableResource = new ConnectableResource(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedConnectableResource.id = reader.getString(); - } else if ("inboundConnectedResources".equals(fieldName)) { - List inboundConnectedResources - = reader.readArray(reader1 -> ConnectedResource.fromJson(reader1)); - deserializedConnectableResource.inboundConnectedResources = inboundConnectedResources; - } else if ("outboundConnectedResources".equals(fieldName)) { - List outboundConnectedResources - = reader.readArray(reader1 -> ConnectedResource.fromJson(reader1)); - deserializedConnectableResource.outboundConnectedResources = outboundConnectedResources; - } else { - reader.skipChildren(); - } - } - - return deserializedConnectableResource; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectedResource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectedResource.java deleted file mode 100644 index 84800e4896a6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectedResource.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Describes properties of a connected resource. - */ -@Immutable -public final class ConnectedResource implements JsonSerializable { - /* - * The Azure resource id of the connected resource - */ - private String connectedResourceId; - - /* - * The allowed tcp ports - */ - private String tcpPorts; - - /* - * The allowed udp ports - */ - private String udpPorts; - - /** - * Creates an instance of ConnectedResource class. - */ - private ConnectedResource() { - } - - /** - * Get the connectedResourceId property: The Azure resource id of the connected resource. - * - * @return the connectedResourceId value. - */ - public String connectedResourceId() { - return this.connectedResourceId; - } - - /** - * Get the tcpPorts property: The allowed tcp ports. - * - * @return the tcpPorts value. - */ - public String tcpPorts() { - return this.tcpPorts; - } - - /** - * Get the udpPorts property: The allowed udp ports. - * - * @return the udpPorts value. - */ - public String udpPorts() { - return this.udpPorts; - } - - /** - * 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 ConnectedResource from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ConnectedResource 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 ConnectedResource. - */ - public static ConnectedResource fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ConnectedResource deserializedConnectedResource = new ConnectedResource(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("connectedResourceId".equals(fieldName)) { - deserializedConnectedResource.connectedResourceId = reader.getString(); - } else if ("tcpPorts".equals(fieldName)) { - deserializedConnectedResource.tcpPorts = reader.getString(); - } else if ("udpPorts".equals(fieldName)) { - deserializedConnectedResource.udpPorts = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedConnectedResource; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectedWorkspace.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectedWorkspace.java deleted file mode 100644 index bb06282e0ab2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectedWorkspace.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Represents an OMS workspace to which the solution is connected. - */ -@Immutable -public final class ConnectedWorkspace implements JsonSerializable { - /* - * Azure resource ID of the connected OMS workspace - */ - private String id; - - /** - * Creates an instance of ConnectedWorkspace class. - */ - private ConnectedWorkspace() { - } - - /** - * Get the id property: Azure resource ID of the connected OMS workspace. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * 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 ConnectedWorkspace from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ConnectedWorkspace 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 ConnectedWorkspace. - */ - public static ConnectedWorkspace fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ConnectedWorkspace deserializedConnectedWorkspace = new ConnectedWorkspace(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedConnectedWorkspace.id = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedConnectedWorkspace; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionType.java deleted file mode 100644 index 3154ce4e40e5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionType.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for ConnectionType. - */ -public final class ConnectionType extends ExpandableStringEnum { - /** - * Internal. - */ - public static final ConnectionType INTERNAL = fromString("Internal"); - - /** - * External. - */ - public static final ConnectionType EXTERNAL = fromString("External"); - - /** - * Creates a new instance of ConnectionType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ConnectionType() { - } - - /** - * Creates or finds a ConnectionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ConnectionType. - */ - public static ConnectionType fromString(String name) { - return fromString(name, ConnectionType.class); - } - - /** - * Gets known ConnectionType values. - * - * @return known ConnectionType values. - */ - public static Collection values() { - return values(ConnectionType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ContainerRegistryVulnerabilityProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ContainerRegistryVulnerabilityProperties.java deleted file mode 100644 index ea7c1482728e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ContainerRegistryVulnerabilityProperties.java +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** - * Additional context fields for container registry Vulnerability assessment. - */ -@Immutable -public final class ContainerRegistryVulnerabilityProperties extends AdditionalData { - /* - * Sub-assessment resource type - */ - private AssessedResourceType assessedResourceType = AssessedResourceType.CONTAINER_REGISTRY_VULNERABILITY; - - /* - * Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered, Vulnerability - */ - private String type; - - /* - * Dictionary from cvss version to cvss details object - */ - private Map cvss; - - /* - * Indicates whether a patch is available or not - */ - private Boolean patchable; - - /* - * List of CVEs - */ - private List cve; - - /* - * Published time - */ - private OffsetDateTime publishedTime; - - /* - * The vendorReferences property. - */ - private List vendorReferences; - - /* - * Name of the repository which the vulnerable image belongs to - */ - private String repositoryName; - - /* - * Digest of the vulnerable image - */ - private String imageDigest; - - /** - * Creates an instance of ContainerRegistryVulnerabilityProperties class. - */ - private ContainerRegistryVulnerabilityProperties() { - } - - /** - * Get the assessedResourceType property: Sub-assessment resource type. - * - * @return the assessedResourceType value. - */ - @Override - public AssessedResourceType assessedResourceType() { - return this.assessedResourceType; - } - - /** - * Get the type property: Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered, - * Vulnerability. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the cvss property: Dictionary from cvss version to cvss details object. - * - * @return the cvss value. - */ - public Map cvss() { - return this.cvss; - } - - /** - * Get the patchable property: Indicates whether a patch is available or not. - * - * @return the patchable value. - */ - public Boolean patchable() { - return this.patchable; - } - - /** - * Get the cve property: List of CVEs. - * - * @return the cve value. - */ - public List cve() { - return this.cve; - } - - /** - * Get the publishedTime property: Published time. - * - * @return the publishedTime value. - */ - public OffsetDateTime publishedTime() { - return this.publishedTime; - } - - /** - * Get the vendorReferences property: The vendorReferences property. - * - * @return the vendorReferences value. - */ - public List vendorReferences() { - return this.vendorReferences; - } - - /** - * Get the repositoryName property: Name of the repository which the vulnerable image belongs to. - * - * @return the repositoryName value. - */ - public String repositoryName() { - return this.repositoryName; - } - - /** - * Get the imageDigest property: Digest of the vulnerable image. - * - * @return the imageDigest value. - */ - public String imageDigest() { - return this.imageDigest; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (cvss() != null) { - cvss().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - if (cve() != null) { - cve().forEach(e -> e.validate()); - } - if (vendorReferences() != null) { - vendorReferences().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("assessedResourceType", - this.assessedResourceType == null ? null : this.assessedResourceType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ContainerRegistryVulnerabilityProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ContainerRegistryVulnerabilityProperties 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 ContainerRegistryVulnerabilityProperties. - */ - public static ContainerRegistryVulnerabilityProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ContainerRegistryVulnerabilityProperties deserializedContainerRegistryVulnerabilityProperties - = new ContainerRegistryVulnerabilityProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("assessedResourceType".equals(fieldName)) { - deserializedContainerRegistryVulnerabilityProperties.assessedResourceType - = AssessedResourceType.fromString(reader.getString()); - } else if ("type".equals(fieldName)) { - deserializedContainerRegistryVulnerabilityProperties.type = reader.getString(); - } else if ("cvss".equals(fieldName)) { - Map cvss = reader.readMap(reader1 -> Cvss.fromJson(reader1)); - deserializedContainerRegistryVulnerabilityProperties.cvss = cvss; - } else if ("patchable".equals(fieldName)) { - deserializedContainerRegistryVulnerabilityProperties.patchable - = reader.getNullable(JsonReader::getBoolean); - } else if ("cve".equals(fieldName)) { - List cve = reader.readArray(reader1 -> Cve.fromJson(reader1)); - deserializedContainerRegistryVulnerabilityProperties.cve = cve; - } else if ("publishedTime".equals(fieldName)) { - deserializedContainerRegistryVulnerabilityProperties.publishedTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("vendorReferences".equals(fieldName)) { - List vendorReferences - = reader.readArray(reader1 -> VendorReference.fromJson(reader1)); - deserializedContainerRegistryVulnerabilityProperties.vendorReferences = vendorReferences; - } else if ("repositoryName".equals(fieldName)) { - deserializedContainerRegistryVulnerabilityProperties.repositoryName = reader.getString(); - } else if ("imageDigest".equals(fieldName)) { - deserializedContainerRegistryVulnerabilityProperties.imageDigest = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedContainerRegistryVulnerabilityProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ControlType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ControlType.java deleted file mode 100644 index 0086a941a9fa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ControlType.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The type of security control (for example, BuiltIn). - */ -public final class ControlType extends ExpandableStringEnum { - /** - * Microsoft Defender for Cloud managed assessments. - */ - public static final ControlType BUILT_IN = fromString("BuiltIn"); - - /** - * Non Microsoft Defender for Cloud managed assessments. - */ - public static final ControlType CUSTOM = fromString("Custom"); - - /** - * Creates a new instance of ControlType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ControlType() { - } - - /** - * Creates or finds a ControlType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ControlType. - */ - public static ControlType fromString(String name) { - return fromString(name, ControlType.class); - } - - /** - * Gets known ControlType values. - * - * @return known ControlType values. - */ - public static Collection values() { - return values(ControlType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOffering.java deleted file mode 100644 index 2ecc6d39bab7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOffering.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The CSPM monitoring for AWS offering. - */ -@Fluent -public final class CspmMonitorAwsOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.CSPM_MONITOR_AWS; - - /* - * The native cloud connection configuration - */ - private CspmMonitorAwsOfferingNativeCloudConnection nativeCloudConnection; - - /** - * Creates an instance of CspmMonitorAwsOffering class. - */ - public CspmMonitorAwsOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Get the nativeCloudConnection property: The native cloud connection configuration. - * - * @return the nativeCloudConnection value. - */ - public CspmMonitorAwsOfferingNativeCloudConnection nativeCloudConnection() { - return this.nativeCloudConnection; - } - - /** - * Set the nativeCloudConnection property: The native cloud connection configuration. - * - * @param nativeCloudConnection the nativeCloudConnection value to set. - * @return the CspmMonitorAwsOffering object itself. - */ - public CspmMonitorAwsOffering - withNativeCloudConnection(CspmMonitorAwsOfferingNativeCloudConnection nativeCloudConnection) { - this.nativeCloudConnection = nativeCloudConnection; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (nativeCloudConnection() != null) { - nativeCloudConnection().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("nativeCloudConnection", this.nativeCloudConnection); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CspmMonitorAwsOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CspmMonitorAwsOffering 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 CspmMonitorAwsOffering. - */ - public static CspmMonitorAwsOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CspmMonitorAwsOffering deserializedCspmMonitorAwsOffering = new CspmMonitorAwsOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedCspmMonitorAwsOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedCspmMonitorAwsOffering.offeringType = OfferingType.fromString(reader.getString()); - } else if ("nativeCloudConnection".equals(fieldName)) { - deserializedCspmMonitorAwsOffering.nativeCloudConnection - = CspmMonitorAwsOfferingNativeCloudConnection.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCspmMonitorAwsOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOfferingNativeCloudConnection.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOfferingNativeCloudConnection.java deleted file mode 100644 index ec5169db73e2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOfferingNativeCloudConnection.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 native cloud connection configuration. - */ -@Fluent -public final class CspmMonitorAwsOfferingNativeCloudConnection - implements JsonSerializable { - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of CspmMonitorAwsOfferingNativeCloudConnection class. - */ - public CspmMonitorAwsOfferingNativeCloudConnection() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the CspmMonitorAwsOfferingNativeCloudConnection object itself. - */ - public CspmMonitorAwsOfferingNativeCloudConnection withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - 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("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CspmMonitorAwsOfferingNativeCloudConnection from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CspmMonitorAwsOfferingNativeCloudConnection 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 CspmMonitorAwsOfferingNativeCloudConnection. - */ - public static CspmMonitorAwsOfferingNativeCloudConnection fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CspmMonitorAwsOfferingNativeCloudConnection deserializedCspmMonitorAwsOfferingNativeCloudConnection - = new CspmMonitorAwsOfferingNativeCloudConnection(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("cloudRoleArn".equals(fieldName)) { - deserializedCspmMonitorAwsOfferingNativeCloudConnection.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCspmMonitorAwsOfferingNativeCloudConnection; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAzureDevOpsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAzureDevOpsOffering.java deleted file mode 100644 index e891ab1bfacf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAzureDevOpsOffering.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The CSPM monitoring for AzureDevOps offering. - */ -@Immutable -public final class CspmMonitorAzureDevOpsOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.CSPM_MONITOR_AZURE_DEV_OPS; - - /** - * Creates an instance of CspmMonitorAzureDevOpsOffering class. - */ - public CspmMonitorAzureDevOpsOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CspmMonitorAzureDevOpsOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CspmMonitorAzureDevOpsOffering 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 CspmMonitorAzureDevOpsOffering. - */ - public static CspmMonitorAzureDevOpsOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CspmMonitorAzureDevOpsOffering deserializedCspmMonitorAzureDevOpsOffering - = new CspmMonitorAzureDevOpsOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedCspmMonitorAzureDevOpsOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedCspmMonitorAzureDevOpsOffering.offeringType - = OfferingType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedCspmMonitorAzureDevOpsOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorDockerHubOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorDockerHubOffering.java deleted file mode 100644 index 5d73f0fa82c7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorDockerHubOffering.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The CSPM (Cloud security posture management) monitoring for Docker Hub offering. - */ -@Immutable -public final class CspmMonitorDockerHubOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.CSPM_MONITOR_DOCKER_HUB; - - /** - * Creates an instance of CspmMonitorDockerHubOffering class. - */ - public CspmMonitorDockerHubOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CspmMonitorDockerHubOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CspmMonitorDockerHubOffering 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 CspmMonitorDockerHubOffering. - */ - public static CspmMonitorDockerHubOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CspmMonitorDockerHubOffering deserializedCspmMonitorDockerHubOffering = new CspmMonitorDockerHubOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedCspmMonitorDockerHubOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedCspmMonitorDockerHubOffering.offeringType = OfferingType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedCspmMonitorDockerHubOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGcpOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGcpOffering.java deleted file mode 100644 index ab89bafa45fa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGcpOffering.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The CSPM monitoring for GCP offering. - */ -@Fluent -public final class CspmMonitorGcpOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.CSPM_MONITOR_GCP; - - /* - * The native cloud connection configuration - */ - private CspmMonitorGcpOfferingNativeCloudConnection nativeCloudConnection; - - /** - * Creates an instance of CspmMonitorGcpOffering class. - */ - public CspmMonitorGcpOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Get the nativeCloudConnection property: The native cloud connection configuration. - * - * @return the nativeCloudConnection value. - */ - public CspmMonitorGcpOfferingNativeCloudConnection nativeCloudConnection() { - return this.nativeCloudConnection; - } - - /** - * Set the nativeCloudConnection property: The native cloud connection configuration. - * - * @param nativeCloudConnection the nativeCloudConnection value to set. - * @return the CspmMonitorGcpOffering object itself. - */ - public CspmMonitorGcpOffering - withNativeCloudConnection(CspmMonitorGcpOfferingNativeCloudConnection nativeCloudConnection) { - this.nativeCloudConnection = nativeCloudConnection; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (nativeCloudConnection() != null) { - nativeCloudConnection().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("nativeCloudConnection", this.nativeCloudConnection); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CspmMonitorGcpOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CspmMonitorGcpOffering 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 CspmMonitorGcpOffering. - */ - public static CspmMonitorGcpOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CspmMonitorGcpOffering deserializedCspmMonitorGcpOffering = new CspmMonitorGcpOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedCspmMonitorGcpOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedCspmMonitorGcpOffering.offeringType = OfferingType.fromString(reader.getString()); - } else if ("nativeCloudConnection".equals(fieldName)) { - deserializedCspmMonitorGcpOffering.nativeCloudConnection - = CspmMonitorGcpOfferingNativeCloudConnection.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedCspmMonitorGcpOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGcpOfferingNativeCloudConnection.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGcpOfferingNativeCloudConnection.java deleted file mode 100644 index b1b782685ddb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGcpOfferingNativeCloudConnection.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 native cloud connection configuration. - */ -@Fluent -public final class CspmMonitorGcpOfferingNativeCloudConnection - implements JsonSerializable { - /* - * The GCP workload identity provider id for the offering - */ - private String workloadIdentityProviderId; - - /* - * The service account email address in GCP for this offering - */ - private String serviceAccountEmailAddress; - - /** - * Creates an instance of CspmMonitorGcpOfferingNativeCloudConnection class. - */ - public CspmMonitorGcpOfferingNativeCloudConnection() { - } - - /** - * Get the workloadIdentityProviderId property: The GCP workload identity provider id for the offering. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The GCP workload identity provider id for the offering. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the CspmMonitorGcpOfferingNativeCloudConnection object itself. - */ - public CspmMonitorGcpOfferingNativeCloudConnection - withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this offering. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this offering. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the CspmMonitorGcpOfferingNativeCloudConnection object itself. - */ - public CspmMonitorGcpOfferingNativeCloudConnection - withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - 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("workloadIdentityProviderId", this.workloadIdentityProviderId); - jsonWriter.writeStringField("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CspmMonitorGcpOfferingNativeCloudConnection from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CspmMonitorGcpOfferingNativeCloudConnection 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 CspmMonitorGcpOfferingNativeCloudConnection. - */ - public static CspmMonitorGcpOfferingNativeCloudConnection fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CspmMonitorGcpOfferingNativeCloudConnection deserializedCspmMonitorGcpOfferingNativeCloudConnection - = new CspmMonitorGcpOfferingNativeCloudConnection(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedCspmMonitorGcpOfferingNativeCloudConnection.workloadIdentityProviderId - = reader.getString(); - } else if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedCspmMonitorGcpOfferingNativeCloudConnection.serviceAccountEmailAddress - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCspmMonitorGcpOfferingNativeCloudConnection; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGitLabOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGitLabOffering.java deleted file mode 100644 index 14c6e9635447..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGitLabOffering.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The CSPM (Cloud security posture management) monitoring for gitlab offering. - */ -@Immutable -public final class CspmMonitorGitLabOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.CSPM_MONITOR_GIT_LAB; - - /** - * Creates an instance of CspmMonitorGitLabOffering class. - */ - public CspmMonitorGitLabOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CspmMonitorGitLabOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CspmMonitorGitLabOffering 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 CspmMonitorGitLabOffering. - */ - public static CspmMonitorGitLabOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CspmMonitorGitLabOffering deserializedCspmMonitorGitLabOffering = new CspmMonitorGitLabOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedCspmMonitorGitLabOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedCspmMonitorGitLabOffering.offeringType = OfferingType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedCspmMonitorGitLabOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGithubOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGithubOffering.java deleted file mode 100644 index 380b3c191634..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGithubOffering.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The CSPM monitoring for github offering. - */ -@Immutable -public final class CspmMonitorGithubOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.CSPM_MONITOR_GITHUB; - - /** - * Creates an instance of CspmMonitorGithubOffering class. - */ - public CspmMonitorGithubOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CspmMonitorGithubOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CspmMonitorGithubOffering 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 CspmMonitorGithubOffering. - */ - public static CspmMonitorGithubOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CspmMonitorGithubOffering deserializedCspmMonitorGithubOffering = new CspmMonitorGithubOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedCspmMonitorGithubOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedCspmMonitorGithubOffering.offeringType = OfferingType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedCspmMonitorGithubOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorJFrogOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorJFrogOffering.java deleted file mode 100644 index 44c1db199f48..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorJFrogOffering.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The CSPM (Cloud security posture management) monitoring for JFrog Artifactory offering. - */ -@Immutable -public final class CspmMonitorJFrogOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.CSPM_MONITOR_JFROG; - - /** - * Creates an instance of CspmMonitorJFrogOffering class. - */ - public CspmMonitorJFrogOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CspmMonitorJFrogOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CspmMonitorJFrogOffering 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 CspmMonitorJFrogOffering. - */ - public static CspmMonitorJFrogOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CspmMonitorJFrogOffering deserializedCspmMonitorJFrogOffering = new CspmMonitorJFrogOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedCspmMonitorJFrogOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedCspmMonitorJFrogOffering.offeringType = OfferingType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedCspmMonitorJFrogOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAlertRule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAlertRule.java deleted file mode 100644 index bcf50b692e77..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAlertRule.java +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * A custom alert rule. - */ -@Fluent -public class CustomAlertRule implements JsonSerializable { - /* - * The type of the custom alert rule. - */ - private String ruleType = "CustomAlertRule"; - - /* - * The display name of the custom alert. - */ - private String displayName; - - /* - * The description of the custom alert. - */ - private String description; - - /* - * Status of the custom alert. - */ - private boolean isEnabled; - - /** - * Creates an instance of CustomAlertRule class. - */ - public CustomAlertRule() { - } - - /** - * Get the ruleType property: The type of the custom alert rule. - * - * @return the ruleType value. - */ - public String ruleType() { - return this.ruleType; - } - - /** - * Get the displayName property: The display name of the custom alert. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the custom alert. - * - * @param displayName the displayName value to set. - * @return the CustomAlertRule object itself. - */ - CustomAlertRule withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the description property: The description of the custom alert. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description of the custom alert. - * - * @param description the description value to set. - * @return the CustomAlertRule object itself. - */ - CustomAlertRule withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the isEnabled property: Status of the custom alert. - * - * @return the isEnabled value. - */ - public boolean isEnabled() { - return this.isEnabled; - } - - /** - * Set the isEnabled property: Status of the custom alert. - * - * @param isEnabled the isEnabled value to set. - * @return the CustomAlertRule object itself. - */ - public CustomAlertRule withIsEnabled(boolean isEnabled) { - this.isEnabled = isEnabled; - 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("isEnabled", this.isEnabled); - jsonWriter.writeStringField("ruleType", this.ruleType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CustomAlertRule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CustomAlertRule 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 CustomAlertRule. - */ - public static CustomAlertRule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("ruleType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("ListCustomAlertRule".equals(discriminatorValue)) { - return ListCustomAlertRule.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("DenylistCustomAlertRule".equals(discriminatorValue)) { - return DenylistCustomAlertRule.fromJson(readerToUse.reset()); - } else if ("AllowlistCustomAlertRule".equals(discriminatorValue)) { - return AllowlistCustomAlertRule.fromJson(readerToUse.reset()); - } else if ("ThresholdCustomAlertRule".equals(discriminatorValue)) { - return ThresholdCustomAlertRule.fromJsonKnownDiscriminator(readerToUse.reset()); - } else if ("TimeWindowCustomAlertRule".equals(discriminatorValue)) { - return TimeWindowCustomAlertRule.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static CustomAlertRule fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - CustomAlertRule deserializedCustomAlertRule = new CustomAlertRule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("isEnabled".equals(fieldName)) { - deserializedCustomAlertRule.isEnabled = reader.getBoolean(); - } else if ("ruleType".equals(fieldName)) { - deserializedCustomAlertRule.ruleType = reader.getString(); - } else if ("displayName".equals(fieldName)) { - deserializedCustomAlertRule.displayName = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedCustomAlertRule.description = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCustomAlertRule; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomRecommendation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomRecommendation.java deleted file mode 100644 index 54f985d64b53..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomRecommendation.java +++ /dev/null @@ -1,404 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.CustomRecommendationInner; -import java.util.List; - -/** - * An immutable client-side representation of CustomRecommendation. - */ -public interface CustomRecommendation { - /** - * 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 query property: KQL query representing the Recommendation results required. - * - * @return the query value. - */ - String query(); - - /** - * Gets the cloudProviders property: List of all standard supported clouds. - * - * @return the cloudProviders value. - */ - List cloudProviders(); - - /** - * Gets the severity property: The severity to relate to the assessments generated by this Recommendation. - * - * @return the severity value. - */ - SeverityEnum severity(); - - /** - * Gets the securityIssue property: The severity to relate to the assessments generated by this Recommendation. - * - * @return the securityIssue value. - */ - SecurityIssue securityIssue(); - - /** - * Gets the displayName property: The display name of the assessments generated by this Recommendation. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the description property: The description to relate to the assessments generated by this Recommendation. - * - * @return the description value. - */ - String description(); - - /** - * Gets the remediationDescription property: The remediation description to relate to the assessments generated by - * this Recommendation. - * - * @return the remediationDescription value. - */ - String remediationDescription(); - - /** - * Gets the assessmentKey property: The assessment metadata key used when an assessment is generated for this - * Recommendation. - * - * @return the assessmentKey value. - */ - String assessmentKey(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.CustomRecommendationInner object. - * - * @return the inner object. - */ - CustomRecommendationInner innerModel(); - - /** - * The entirety of the CustomRecommendation definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { - } - - /** - * The CustomRecommendation definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the CustomRecommendation definition. - */ - interface Blank extends WithScope { - } - - /** - * The stage of the CustomRecommendation definition allowing to specify parent resource. - */ - interface WithScope { - /** - * Specifies scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @return the next definition stage. - */ - WithCreate withExistingScope(String scope); - } - - /** - * The stage of the CustomRecommendation 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.WithQuery, DefinitionStages.WithCloudProviders, - DefinitionStages.WithSeverity, DefinitionStages.WithSecurityIssue, DefinitionStages.WithDisplayName, - DefinitionStages.WithDescription, DefinitionStages.WithRemediationDescription { - /** - * Executes the create request. - * - * @return the created resource. - */ - CustomRecommendation create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - CustomRecommendation create(Context context); - } - - /** - * The stage of the CustomRecommendation definition allowing to specify query. - */ - interface WithQuery { - /** - * Specifies the query property: KQL query representing the Recommendation results required.. - * - * @param query KQL query representing the Recommendation results required. - * @return the next definition stage. - */ - WithCreate withQuery(String query); - } - - /** - * The stage of the CustomRecommendation definition allowing to specify cloudProviders. - */ - interface WithCloudProviders { - /** - * Specifies the cloudProviders property: List of all standard supported clouds.. - * - * @param cloudProviders List of all standard supported clouds. - * @return the next definition stage. - */ - WithCreate withCloudProviders(List cloudProviders); - } - - /** - * The stage of the CustomRecommendation definition allowing to specify severity. - */ - interface WithSeverity { - /** - * Specifies the severity property: The severity to relate to the assessments generated by this - * Recommendation.. - * - * @param severity The severity to relate to the assessments generated by this Recommendation. - * @return the next definition stage. - */ - WithCreate withSeverity(SeverityEnum severity); - } - - /** - * The stage of the CustomRecommendation definition allowing to specify securityIssue. - */ - interface WithSecurityIssue { - /** - * Specifies the securityIssue property: The severity to relate to the assessments generated by this - * Recommendation.. - * - * @param securityIssue The severity to relate to the assessments generated by this Recommendation. - * @return the next definition stage. - */ - WithCreate withSecurityIssue(SecurityIssue securityIssue); - } - - /** - * The stage of the CustomRecommendation definition allowing to specify displayName. - */ - interface WithDisplayName { - /** - * Specifies the displayName property: The display name of the assessments generated by this - * Recommendation.. - * - * @param displayName The display name of the assessments generated by this Recommendation. - * @return the next definition stage. - */ - WithCreate withDisplayName(String displayName); - } - - /** - * The stage of the CustomRecommendation definition allowing to specify description. - */ - interface WithDescription { - /** - * Specifies the description property: The description to relate to the assessments generated by this - * Recommendation.. - * - * @param description The description to relate to the assessments generated by this Recommendation. - * @return the next definition stage. - */ - WithCreate withDescription(String description); - } - - /** - * The stage of the CustomRecommendation definition allowing to specify remediationDescription. - */ - interface WithRemediationDescription { - /** - * Specifies the remediationDescription property: The remediation description to relate to the assessments - * generated by this Recommendation.. - * - * @param remediationDescription The remediation description to relate to the assessments generated by this - * Recommendation. - * @return the next definition stage. - */ - WithCreate withRemediationDescription(String remediationDescription); - } - } - - /** - * Begins update for the CustomRecommendation resource. - * - * @return the stage of resource update. - */ - CustomRecommendation.Update update(); - - /** - * The template for CustomRecommendation update. - */ - interface Update extends UpdateStages.WithQuery, UpdateStages.WithCloudProviders, UpdateStages.WithSeverity, - UpdateStages.WithSecurityIssue, UpdateStages.WithDisplayName, UpdateStages.WithDescription, - UpdateStages.WithRemediationDescription { - /** - * Executes the update request. - * - * @return the updated resource. - */ - CustomRecommendation apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - CustomRecommendation apply(Context context); - } - - /** - * The CustomRecommendation update stages. - */ - interface UpdateStages { - /** - * The stage of the CustomRecommendation update allowing to specify query. - */ - interface WithQuery { - /** - * Specifies the query property: KQL query representing the Recommendation results required.. - * - * @param query KQL query representing the Recommendation results required. - * @return the next definition stage. - */ - Update withQuery(String query); - } - - /** - * The stage of the CustomRecommendation update allowing to specify cloudProviders. - */ - interface WithCloudProviders { - /** - * Specifies the cloudProviders property: List of all standard supported clouds.. - * - * @param cloudProviders List of all standard supported clouds. - * @return the next definition stage. - */ - Update withCloudProviders(List cloudProviders); - } - - /** - * The stage of the CustomRecommendation update allowing to specify severity. - */ - interface WithSeverity { - /** - * Specifies the severity property: The severity to relate to the assessments generated by this - * Recommendation.. - * - * @param severity The severity to relate to the assessments generated by this Recommendation. - * @return the next definition stage. - */ - Update withSeverity(SeverityEnum severity); - } - - /** - * The stage of the CustomRecommendation update allowing to specify securityIssue. - */ - interface WithSecurityIssue { - /** - * Specifies the securityIssue property: The severity to relate to the assessments generated by this - * Recommendation.. - * - * @param securityIssue The severity to relate to the assessments generated by this Recommendation. - * @return the next definition stage. - */ - Update withSecurityIssue(SecurityIssue securityIssue); - } - - /** - * The stage of the CustomRecommendation update allowing to specify displayName. - */ - interface WithDisplayName { - /** - * Specifies the displayName property: The display name of the assessments generated by this - * Recommendation.. - * - * @param displayName The display name of the assessments generated by this Recommendation. - * @return the next definition stage. - */ - Update withDisplayName(String displayName); - } - - /** - * The stage of the CustomRecommendation update allowing to specify description. - */ - interface WithDescription { - /** - * Specifies the description property: The description to relate to the assessments generated by this - * Recommendation.. - * - * @param description The description to relate to the assessments generated by this Recommendation. - * @return the next definition stage. - */ - Update withDescription(String description); - } - - /** - * The stage of the CustomRecommendation update allowing to specify remediationDescription. - */ - interface WithRemediationDescription { - /** - * Specifies the remediationDescription property: The remediation description to relate to the assessments - * generated by this Recommendation.. - * - * @param remediationDescription The remediation description to relate to the assessments generated by this - * Recommendation. - * @return the next definition stage. - */ - Update withRemediationDescription(String remediationDescription); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - CustomRecommendation refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - CustomRecommendation refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomRecommendations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomRecommendations.java deleted file mode 100644 index 35f4996200d4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomRecommendations.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of CustomRecommendations. - */ -public interface CustomRecommendations { - /** - * Get a specific custom recommendation for the requested scope by customRecommendationName. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific custom recommendation for the requested scope by customRecommendationName along with - * {@link Response}. - */ - Response getWithResponse(String scope, String customRecommendationName, Context context); - - /** - * Get a specific custom recommendation for the requested scope by customRecommendationName. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 custom recommendation for the requested scope by customRecommendationName. - */ - CustomRecommendation get(String scope, String customRecommendationName); - - /** - * Delete a custom recommendation over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @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 deleteByResourceGroupWithResponse(String scope, String customRecommendationName, Context context); - - /** - * Delete a custom recommendation over a given scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the resource. - * @param customRecommendationName Name of the Custom Recommendation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 deleteByResourceGroup(String scope, String customRecommendationName); - - /** - * Get a list of all relevant custom recommendations over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant custom recommendations over a scope as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String scope); - - /** - * Get a list of all relevant custom recommendations over a scope. - * - * @param scope The fully qualified Azure Resource manager identifier of the 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 list of all relevant custom recommendations over a scope as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String scope, Context context); - - /** - * Get a specific custom recommendation for the requested scope by customRecommendationName. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific custom recommendation for the requested scope by customRecommendationName along with - * {@link Response}. - */ - CustomRecommendation getById(String id); - - /** - * Get a specific custom recommendation for the requested scope by customRecommendationName. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific custom recommendation for the requested scope by customRecommendationName along with - * {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete a custom recommendation over a given scope. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete a custom recommendation over a given scope. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new CustomRecommendation resource. - * - * @param name resource name. - * @return the first stage of the new CustomRecommendation definition. - */ - CustomRecommendation.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Cve.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Cve.java deleted file mode 100644 index a4ef8a19c817..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Cve.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * CVE details. - */ -@Immutable -public final class Cve implements JsonSerializable { - /* - * CVE title - */ - private String title; - - /* - * Link url - */ - private String link; - - /** - * Creates an instance of Cve class. - */ - private Cve() { - } - - /** - * Get the title property: CVE title. - * - * @return the title value. - */ - public String title() { - return this.title; - } - - /** - * Get the link property: Link url. - * - * @return the link value. - */ - public String link() { - return this.link; - } - - /** - * 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 Cve from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Cve 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 Cve. - */ - public static Cve fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Cve deserializedCve = new Cve(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("title".equals(fieldName)) { - deserializedCve.title = reader.getString(); - } else if ("link".equals(fieldName)) { - deserializedCve.link = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedCve; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Cvss.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Cvss.java deleted file mode 100644 index ff912d628826..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Cvss.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * CVSS details. - */ -@Immutable -public final class Cvss implements JsonSerializable { - /* - * CVSS base - */ - private Float base; - - /** - * Creates an instance of Cvss class. - */ - private Cvss() { - } - - /** - * Get the base property: CVSS base. - * - * @return the base value. - */ - public Float base() { - return this.base; - } - - /** - * 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 Cvss from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Cvss 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 Cvss. - */ - public static Cvss fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Cvss deserializedCvss = new Cvss(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("base".equals(fieldName)) { - deserializedCvss.base = reader.getNullable(JsonReader::getFloat); - } else { - reader.skipChildren(); - } - } - - return deserializedCvss; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataExportSettings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataExportSettings.java deleted file mode 100644 index adab15b29852..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataExportSettings.java +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -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.security.fluent.models.DataExportSettingProperties; -import com.azure.resourcemanager.security.fluent.models.SettingInner; -import java.io.IOException; - -/** - * Represents a data export setting. - */ -@Fluent -public final class DataExportSettings extends SettingInner { - /* - * the kind of the settings string - */ - private SettingKind kind = SettingKind.DATA_EXPORT_SETTINGS; - - /* - * Data export setting data - */ - private DataExportSettingProperties 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 DataExportSettings class. - */ - public DataExportSettings() { - } - - /** - * Get the kind property: the kind of the settings string. - * - * @return the kind value. - */ - @Override - public SettingKind kind() { - return this.kind; - } - - /** - * Get the innerProperties property: Data export setting data. - * - * @return the innerProperties value. - */ - private DataExportSettingProperties innerProperties() { - return this.innerProperties; - } - - /** - * 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: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public DataExportSettings withProperties(SettingProperties properties) { - super.withProperties(properties); - return this; - } - - /** - * Get the enabled property: Is the data export setting enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.innerProperties() == null ? null : this.innerProperties().enabled(); - } - - /** - * Set the enabled property: Is the data export setting enabled. - * - * @param enabled the enabled value to set. - * @return the DataExportSettings object itself. - */ - public DataExportSettings withEnabled(Boolean enabled) { - if (this.innerProperties() == null) { - this.innerProperties = new DataExportSettingProperties(); - } - this.innerProperties().withEnabled(enabled); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); - jsonWriter.writeJsonField("properties", this.innerProperties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DataExportSettings from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DataExportSettings 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 DataExportSettings. - */ - public static DataExportSettings fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DataExportSettings deserializedDataExportSettings = new DataExportSettings(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedDataExportSettings.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedDataExportSettings.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedDataExportSettings.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedDataExportSettings.systemData = SystemData.fromJson(reader); - } else if ("kind".equals(fieldName)) { - deserializedDataExportSettings.kind = SettingKind.fromString(reader.getString()); - } else if ("properties".equals(fieldName)) { - deserializedDataExportSettings.innerProperties = DataExportSettingProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDataExportSettings; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataSource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataSource.java deleted file mode 100644 index 09ac98c9e2c0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataSource.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for DataSource. - */ -public final class DataSource extends ExpandableStringEnum { - /** - * Devices twin data. - */ - public static final DataSource TWIN_DATA = fromString("TwinData"); - - /** - * Creates a new instance of DataSource value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DataSource() { - } - - /** - * Creates or finds a DataSource from its string representation. - * - * @param name a name to look for. - * @return the corresponding DataSource. - */ - public static DataSource fromString(String name) { - return fromString(name, DataSource.class); - } - - /** - * Gets known DataSource values. - * - * @return known DataSource values. - */ - public static Collection values() { - return values(DataSource.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOffering.java deleted file mode 100644 index d658ad9f371d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOffering.java +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The CSPM P1 for AWS offering. - */ -@Fluent -public final class DefenderCspmAwsOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_CSPM_AWS; - - /* - * The Microsoft Defender for CSPM offering VM scanning configuration - */ - private DefenderCspmAwsOfferingVmScanners vmScanners; - - /* - * The Microsoft Defender Data Sensitivity discovery configuration - */ - private DefenderCspmAwsOfferingDataSensitivityDiscovery dataSensitivityDiscovery; - - /* - * The databases DSPM configuration - */ - private DefenderCspmAwsOfferingDatabasesDspm databasesDspm; - - /* - * Defenders CSPM Permissions Management offering configurations - */ - private DefenderCspmAwsOfferingCiem ciem; - - /* - * The Microsoft Defender container image assessment configuration - */ - private DefenderCspmAwsOfferingMdcContainersImageAssessment mdcContainersImageAssessment; - - /* - * The Microsoft Defender container agentless discovery K8s configuration - */ - private DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S; - - /** - * Creates an instance of DefenderCspmAwsOffering class. - */ - public DefenderCspmAwsOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Get the vmScanners property: The Microsoft Defender for CSPM offering VM scanning configuration. - * - * @return the vmScanners value. - */ - public DefenderCspmAwsOfferingVmScanners vmScanners() { - return this.vmScanners; - } - - /** - * Set the vmScanners property: The Microsoft Defender for CSPM offering VM scanning configuration. - * - * @param vmScanners the vmScanners value to set. - * @return the DefenderCspmAwsOffering object itself. - */ - public DefenderCspmAwsOffering withVmScanners(DefenderCspmAwsOfferingVmScanners vmScanners) { - this.vmScanners = vmScanners; - return this; - } - - /** - * Get the dataSensitivityDiscovery property: The Microsoft Defender Data Sensitivity discovery configuration. - * - * @return the dataSensitivityDiscovery value. - */ - public DefenderCspmAwsOfferingDataSensitivityDiscovery dataSensitivityDiscovery() { - return this.dataSensitivityDiscovery; - } - - /** - * Set the dataSensitivityDiscovery property: The Microsoft Defender Data Sensitivity discovery configuration. - * - * @param dataSensitivityDiscovery the dataSensitivityDiscovery value to set. - * @return the DefenderCspmAwsOffering object itself. - */ - public DefenderCspmAwsOffering - withDataSensitivityDiscovery(DefenderCspmAwsOfferingDataSensitivityDiscovery dataSensitivityDiscovery) { - this.dataSensitivityDiscovery = dataSensitivityDiscovery; - return this; - } - - /** - * Get the databasesDspm property: The databases DSPM configuration. - * - * @return the databasesDspm value. - */ - public DefenderCspmAwsOfferingDatabasesDspm databasesDspm() { - return this.databasesDspm; - } - - /** - * Set the databasesDspm property: The databases DSPM configuration. - * - * @param databasesDspm the databasesDspm value to set. - * @return the DefenderCspmAwsOffering object itself. - */ - public DefenderCspmAwsOffering withDatabasesDspm(DefenderCspmAwsOfferingDatabasesDspm databasesDspm) { - this.databasesDspm = databasesDspm; - return this; - } - - /** - * Get the ciem property: Defenders CSPM Permissions Management offering configurations. - * - * @return the ciem value. - */ - public DefenderCspmAwsOfferingCiem ciem() { - return this.ciem; - } - - /** - * Set the ciem property: Defenders CSPM Permissions Management offering configurations. - * - * @param ciem the ciem value to set. - * @return the DefenderCspmAwsOffering object itself. - */ - public DefenderCspmAwsOffering withCiem(DefenderCspmAwsOfferingCiem ciem) { - this.ciem = ciem; - return this; - } - - /** - * Get the mdcContainersImageAssessment property: The Microsoft Defender container image assessment configuration. - * - * @return the mdcContainersImageAssessment value. - */ - public DefenderCspmAwsOfferingMdcContainersImageAssessment mdcContainersImageAssessment() { - return this.mdcContainersImageAssessment; - } - - /** - * Set the mdcContainersImageAssessment property: The Microsoft Defender container image assessment configuration. - * - * @param mdcContainersImageAssessment the mdcContainersImageAssessment value to set. - * @return the DefenderCspmAwsOffering object itself. - */ - public DefenderCspmAwsOffering withMdcContainersImageAssessment( - DefenderCspmAwsOfferingMdcContainersImageAssessment mdcContainersImageAssessment) { - this.mdcContainersImageAssessment = mdcContainersImageAssessment; - return this; - } - - /** - * Get the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender container agentless discovery K8s - * configuration. - * - * @return the mdcContainersAgentlessDiscoveryK8S value. - */ - public DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S() { - return this.mdcContainersAgentlessDiscoveryK8S; - } - - /** - * Set the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender container agentless discovery K8s - * configuration. - * - * @param mdcContainersAgentlessDiscoveryK8S the mdcContainersAgentlessDiscoveryK8S value to set. - * @return the DefenderCspmAwsOffering object itself. - */ - public DefenderCspmAwsOffering withMdcContainersAgentlessDiscoveryK8S( - DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S) { - this.mdcContainersAgentlessDiscoveryK8S = mdcContainersAgentlessDiscoveryK8S; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (vmScanners() != null) { - vmScanners().validate(); - } - if (dataSensitivityDiscovery() != null) { - dataSensitivityDiscovery().validate(); - } - if (databasesDspm() != null) { - databasesDspm().validate(); - } - if (ciem() != null) { - ciem().validate(); - } - if (mdcContainersImageAssessment() != null) { - mdcContainersImageAssessment().validate(); - } - if (mdcContainersAgentlessDiscoveryK8S() != null) { - mdcContainersAgentlessDiscoveryK8S().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("vmScanners", this.vmScanners); - jsonWriter.writeJsonField("dataSensitivityDiscovery", this.dataSensitivityDiscovery); - jsonWriter.writeJsonField("databasesDspm", this.databasesDspm); - jsonWriter.writeJsonField("ciem", this.ciem); - jsonWriter.writeJsonField("mdcContainersImageAssessment", this.mdcContainersImageAssessment); - jsonWriter.writeJsonField("mdcContainersAgentlessDiscoveryK8s", this.mdcContainersAgentlessDiscoveryK8S); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmAwsOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmAwsOffering 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 DefenderCspmAwsOffering. - */ - public static DefenderCspmAwsOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmAwsOffering deserializedDefenderCspmAwsOffering = new DefenderCspmAwsOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderCspmAwsOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderCspmAwsOffering.offeringType = OfferingType.fromString(reader.getString()); - } else if ("vmScanners".equals(fieldName)) { - deserializedDefenderCspmAwsOffering.vmScanners = DefenderCspmAwsOfferingVmScanners.fromJson(reader); - } else if ("dataSensitivityDiscovery".equals(fieldName)) { - deserializedDefenderCspmAwsOffering.dataSensitivityDiscovery - = DefenderCspmAwsOfferingDataSensitivityDiscovery.fromJson(reader); - } else if ("databasesDspm".equals(fieldName)) { - deserializedDefenderCspmAwsOffering.databasesDspm - = DefenderCspmAwsOfferingDatabasesDspm.fromJson(reader); - } else if ("ciem".equals(fieldName)) { - deserializedDefenderCspmAwsOffering.ciem = DefenderCspmAwsOfferingCiem.fromJson(reader); - } else if ("mdcContainersImageAssessment".equals(fieldName)) { - deserializedDefenderCspmAwsOffering.mdcContainersImageAssessment - = DefenderCspmAwsOfferingMdcContainersImageAssessment.fromJson(reader); - } else if ("mdcContainersAgentlessDiscoveryK8s".equals(fieldName)) { - deserializedDefenderCspmAwsOffering.mdcContainersAgentlessDiscoveryK8S - = DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmAwsOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiem.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiem.java deleted file mode 100644 index 5d1eab59b204..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiem.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * Defenders CSPM Permissions Management offering configurations. - */ -@Fluent -public final class DefenderCspmAwsOfferingCiem implements JsonSerializable { - /* - * Defender CSPM Permissions Management discovery configuration - */ - private DefenderCspmAwsOfferingCiemDiscovery ciemDiscovery; - - /* - * AWS Defender CSPM Permissions Management OIDC (open id connect) connection configurations - */ - private DefenderCspmAwsOfferingCiemOidc ciemOidc; - - /** - * Creates an instance of DefenderCspmAwsOfferingCiem class. - */ - public DefenderCspmAwsOfferingCiem() { - } - - /** - * Get the ciemDiscovery property: Defender CSPM Permissions Management discovery configuration. - * - * @return the ciemDiscovery value. - */ - public DefenderCspmAwsOfferingCiemDiscovery ciemDiscovery() { - return this.ciemDiscovery; - } - - /** - * Set the ciemDiscovery property: Defender CSPM Permissions Management discovery configuration. - * - * @param ciemDiscovery the ciemDiscovery value to set. - * @return the DefenderCspmAwsOfferingCiem object itself. - */ - public DefenderCspmAwsOfferingCiem withCiemDiscovery(DefenderCspmAwsOfferingCiemDiscovery ciemDiscovery) { - this.ciemDiscovery = ciemDiscovery; - return this; - } - - /** - * Get the ciemOidc property: AWS Defender CSPM Permissions Management OIDC (open id connect) connection - * configurations. - * - * @return the ciemOidc value. - */ - public DefenderCspmAwsOfferingCiemOidc ciemOidc() { - return this.ciemOidc; - } - - /** - * Set the ciemOidc property: AWS Defender CSPM Permissions Management OIDC (open id connect) connection - * configurations. - * - * @param ciemOidc the ciemOidc value to set. - * @return the DefenderCspmAwsOfferingCiem object itself. - */ - public DefenderCspmAwsOfferingCiem withCiemOidc(DefenderCspmAwsOfferingCiemOidc ciemOidc) { - this.ciemOidc = ciemOidc; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ciemDiscovery() != null) { - ciemDiscovery().validate(); - } - if (ciemOidc() != null) { - ciemOidc().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("ciemDiscovery", this.ciemDiscovery); - jsonWriter.writeJsonField("ciemOidc", this.ciemOidc); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmAwsOfferingCiem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmAwsOfferingCiem 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 DefenderCspmAwsOfferingCiem. - */ - public static DefenderCspmAwsOfferingCiem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmAwsOfferingCiem deserializedDefenderCspmAwsOfferingCiem = new DefenderCspmAwsOfferingCiem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("ciemDiscovery".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingCiem.ciemDiscovery - = DefenderCspmAwsOfferingCiemDiscovery.fromJson(reader); - } else if ("ciemOidc".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingCiem.ciemOidc = DefenderCspmAwsOfferingCiemOidc.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmAwsOfferingCiem; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemDiscovery.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemDiscovery.java deleted file mode 100644 index e280e3725308..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemDiscovery.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * Defender CSPM Permissions Management discovery configuration. - */ -@Fluent -public final class DefenderCspmAwsOfferingCiemDiscovery - implements JsonSerializable { - /* - * The cloud role ARN in AWS for Permissions Management discovery - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderCspmAwsOfferingCiemDiscovery class. - */ - public DefenderCspmAwsOfferingCiemDiscovery() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for Permissions Management discovery. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for Permissions Management discovery. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderCspmAwsOfferingCiemDiscovery object itself. - */ - public DefenderCspmAwsOfferingCiemDiscovery withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - 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("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmAwsOfferingCiemDiscovery from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmAwsOfferingCiemDiscovery 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 DefenderCspmAwsOfferingCiemDiscovery. - */ - public static DefenderCspmAwsOfferingCiemDiscovery fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmAwsOfferingCiemDiscovery deserializedDefenderCspmAwsOfferingCiemDiscovery - = new DefenderCspmAwsOfferingCiemDiscovery(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingCiemDiscovery.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmAwsOfferingCiemDiscovery; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemOidc.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemOidc.java deleted file mode 100644 index e6537ec83878..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingCiemOidc.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * AWS Defender CSPM Permissions Management OIDC (open id connect) connection configurations. - */ -@Fluent -public final class DefenderCspmAwsOfferingCiemOidc implements JsonSerializable { - /* - * The cloud role ARN in AWS for Permissions Management used for oidc connection - */ - private String cloudRoleArn; - - /* - * the azure active directory app name used of authenticating against AWS - */ - private String azureActiveDirectoryAppName; - - /** - * Creates an instance of DefenderCspmAwsOfferingCiemOidc class. - */ - public DefenderCspmAwsOfferingCiemOidc() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for Permissions Management used for oidc connection. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for Permissions Management used for oidc connection. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderCspmAwsOfferingCiemOidc object itself. - */ - public DefenderCspmAwsOfferingCiemOidc withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Get the azureActiveDirectoryAppName property: the azure active directory app name used of authenticating against - * AWS. - * - * @return the azureActiveDirectoryAppName value. - */ - public String azureActiveDirectoryAppName() { - return this.azureActiveDirectoryAppName; - } - - /** - * Set the azureActiveDirectoryAppName property: the azure active directory app name used of authenticating against - * AWS. - * - * @param azureActiveDirectoryAppName the azureActiveDirectoryAppName value to set. - * @return the DefenderCspmAwsOfferingCiemOidc object itself. - */ - public DefenderCspmAwsOfferingCiemOidc withAzureActiveDirectoryAppName(String azureActiveDirectoryAppName) { - this.azureActiveDirectoryAppName = azureActiveDirectoryAppName; - 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("cloudRoleArn", this.cloudRoleArn); - jsonWriter.writeStringField("azureActiveDirectoryAppName", this.azureActiveDirectoryAppName); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmAwsOfferingCiemOidc from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmAwsOfferingCiemOidc 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 DefenderCspmAwsOfferingCiemOidc. - */ - public static DefenderCspmAwsOfferingCiemOidc fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmAwsOfferingCiemOidc deserializedDefenderCspmAwsOfferingCiemOidc - = new DefenderCspmAwsOfferingCiemOidc(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingCiemOidc.cloudRoleArn = reader.getString(); - } else if ("azureActiveDirectoryAppName".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingCiemOidc.azureActiveDirectoryAppName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmAwsOfferingCiemOidc; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingDataSensitivityDiscovery.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingDataSensitivityDiscovery.java deleted file mode 100644 index c3eff26e0413..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingDataSensitivityDiscovery.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 Microsoft Defender Data Sensitivity discovery configuration. - */ -@Fluent -public final class DefenderCspmAwsOfferingDataSensitivityDiscovery - implements JsonSerializable { - /* - * Is Microsoft Defender Data Sensitivity discovery enabled - */ - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderCspmAwsOfferingDataSensitivityDiscovery class. - */ - public DefenderCspmAwsOfferingDataSensitivityDiscovery() { - } - - /** - * Get the enabled property: Is Microsoft Defender Data Sensitivity discovery enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender Data Sensitivity discovery enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderCspmAwsOfferingDataSensitivityDiscovery object itself. - */ - public DefenderCspmAwsOfferingDataSensitivityDiscovery withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderCspmAwsOfferingDataSensitivityDiscovery object itself. - */ - public DefenderCspmAwsOfferingDataSensitivityDiscovery withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - 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("enabled", this.enabled); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmAwsOfferingDataSensitivityDiscovery from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmAwsOfferingDataSensitivityDiscovery 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 DefenderCspmAwsOfferingDataSensitivityDiscovery. - */ - public static DefenderCspmAwsOfferingDataSensitivityDiscovery fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmAwsOfferingDataSensitivityDiscovery deserializedDefenderCspmAwsOfferingDataSensitivityDiscovery - = new DefenderCspmAwsOfferingDataSensitivityDiscovery(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingDataSensitivityDiscovery.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingDataSensitivityDiscovery.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmAwsOfferingDataSensitivityDiscovery; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingDatabasesDspm.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingDatabasesDspm.java deleted file mode 100644 index 61806cb04f69..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingDatabasesDspm.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 databases DSPM configuration. - */ -@Fluent -public final class DefenderCspmAwsOfferingDatabasesDspm - implements JsonSerializable { - /* - * Is databases DSPM protection enabled - */ - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderCspmAwsOfferingDatabasesDspm class. - */ - public DefenderCspmAwsOfferingDatabasesDspm() { - } - - /** - * Get the enabled property: Is databases DSPM protection enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is databases DSPM protection enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderCspmAwsOfferingDatabasesDspm object itself. - */ - public DefenderCspmAwsOfferingDatabasesDspm withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderCspmAwsOfferingDatabasesDspm object itself. - */ - public DefenderCspmAwsOfferingDatabasesDspm withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - 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("enabled", this.enabled); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmAwsOfferingDatabasesDspm from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmAwsOfferingDatabasesDspm 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 DefenderCspmAwsOfferingDatabasesDspm. - */ - public static DefenderCspmAwsOfferingDatabasesDspm fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmAwsOfferingDatabasesDspm deserializedDefenderCspmAwsOfferingDatabasesDspm - = new DefenderCspmAwsOfferingDatabasesDspm(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingDatabasesDspm.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingDatabasesDspm.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmAwsOfferingDatabasesDspm; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S.java deleted file mode 100644 index 0a106fd804ef..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 Microsoft Defender container agentless discovery K8s configuration. - */ -@Fluent -public final class DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S - implements JsonSerializable { - /* - * Is Microsoft Defender container agentless discovery K8s enabled - */ - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S class. - */ - public DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S() { - } - - /** - * Get the enabled property: Is Microsoft Defender container agentless discovery K8s enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender container agentless discovery K8s enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S object itself. - */ - public DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S object itself. - */ - public DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - 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("enabled", this.enabled); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S 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 - * DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S. - */ - public static DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S deserializedDefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S - = new DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S.cloudRoleArn - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersImageAssessment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersImageAssessment.java deleted file mode 100644 index 40e7a40d2d5d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingMdcContainersImageAssessment.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 Microsoft Defender container image assessment configuration. - */ -@Fluent -public final class DefenderCspmAwsOfferingMdcContainersImageAssessment - implements JsonSerializable { - /* - * Is Microsoft Defender container image assessment enabled - */ - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderCspmAwsOfferingMdcContainersImageAssessment class. - */ - public DefenderCspmAwsOfferingMdcContainersImageAssessment() { - } - - /** - * Get the enabled property: Is Microsoft Defender container image assessment enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender container image assessment enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderCspmAwsOfferingMdcContainersImageAssessment object itself. - */ - public DefenderCspmAwsOfferingMdcContainersImageAssessment withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderCspmAwsOfferingMdcContainersImageAssessment object itself. - */ - public DefenderCspmAwsOfferingMdcContainersImageAssessment withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - 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("enabled", this.enabled); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmAwsOfferingMdcContainersImageAssessment from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmAwsOfferingMdcContainersImageAssessment 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 DefenderCspmAwsOfferingMdcContainersImageAssessment. - */ - public static DefenderCspmAwsOfferingMdcContainersImageAssessment fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmAwsOfferingMdcContainersImageAssessment deserializedDefenderCspmAwsOfferingMdcContainersImageAssessment - = new DefenderCspmAwsOfferingMdcContainersImageAssessment(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingMdcContainersImageAssessment.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingMdcContainersImageAssessment.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmAwsOfferingMdcContainersImageAssessment; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingVmScanners.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingVmScanners.java deleted file mode 100644 index ca3d562ef3df..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingVmScanners.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender for CSPM offering VM scanning configuration. - */ -@Fluent -public final class DefenderCspmAwsOfferingVmScanners extends VmScannersAws { - /** - * Creates an instance of DefenderCspmAwsOfferingVmScanners class. - */ - public DefenderCspmAwsOfferingVmScanners() { - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderCspmAwsOfferingVmScanners withCloudRoleArn(String cloudRoleArn) { - super.withCloudRoleArn(cloudRoleArn); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderCspmAwsOfferingVmScanners withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderCspmAwsOfferingVmScanners withConfiguration(VmScannersBaseConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - jsonWriter.writeStringField("cloudRoleArn", cloudRoleArn()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmAwsOfferingVmScanners from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmAwsOfferingVmScanners 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 DefenderCspmAwsOfferingVmScanners. - */ - public static DefenderCspmAwsOfferingVmScanners fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmAwsOfferingVmScanners deserializedDefenderCspmAwsOfferingVmScanners - = new DefenderCspmAwsOfferingVmScanners(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingVmScanners - .withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingVmScanners - .withConfiguration(VmScannersBaseConfiguration.fromJson(reader)); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderCspmAwsOfferingVmScanners.withCloudRoleArn(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmAwsOfferingVmScanners; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmDockerHubOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmDockerHubOffering.java deleted file mode 100644 index 1af60c3a9b2a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmDockerHubOffering.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Defender for CSPM Docker Hub offering configurations. - */ -@Immutable -public final class DefenderCspmDockerHubOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_CSPM_DOCKER_HUB; - - /** - * Creates an instance of DefenderCspmDockerHubOffering class. - */ - public DefenderCspmDockerHubOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmDockerHubOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmDockerHubOffering 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 DefenderCspmDockerHubOffering. - */ - public static DefenderCspmDockerHubOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmDockerHubOffering deserializedDefenderCspmDockerHubOffering - = new DefenderCspmDockerHubOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderCspmDockerHubOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderCspmDockerHubOffering.offeringType - = OfferingType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmDockerHubOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOffering.java deleted file mode 100644 index 713dd598ac3b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOffering.java +++ /dev/null @@ -1,251 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The CSPM P1 for GCP offering. - */ -@Fluent -public final class DefenderCspmGcpOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_CSPM_GCP; - - /* - * GCP Defenders CSPM Permissions Management OIDC (Open ID connect) connection configurations - */ - private DefenderCspmGcpOfferingCiemDiscovery ciemDiscovery; - - /* - * The Microsoft Defender for CSPM VM scanning configuration - */ - private DefenderCspmGcpOfferingVmScanners vmScanners; - - /* - * The Microsoft Defender Data Sensitivity discovery configuration - */ - private DefenderCspmGcpOfferingDataSensitivityDiscovery dataSensitivityDiscovery; - - /* - * The Microsoft Defender Container image assessment configuration - */ - private DefenderCspmGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment; - - /* - * The Microsoft Defender Container agentless discovery configuration - */ - private DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S; - - /** - * Creates an instance of DefenderCspmGcpOffering class. - */ - public DefenderCspmGcpOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Get the ciemDiscovery property: GCP Defenders CSPM Permissions Management OIDC (Open ID connect) connection - * configurations. - * - * @return the ciemDiscovery value. - */ - public DefenderCspmGcpOfferingCiemDiscovery ciemDiscovery() { - return this.ciemDiscovery; - } - - /** - * Set the ciemDiscovery property: GCP Defenders CSPM Permissions Management OIDC (Open ID connect) connection - * configurations. - * - * @param ciemDiscovery the ciemDiscovery value to set. - * @return the DefenderCspmGcpOffering object itself. - */ - public DefenderCspmGcpOffering withCiemDiscovery(DefenderCspmGcpOfferingCiemDiscovery ciemDiscovery) { - this.ciemDiscovery = ciemDiscovery; - return this; - } - - /** - * Get the vmScanners property: The Microsoft Defender for CSPM VM scanning configuration. - * - * @return the vmScanners value. - */ - public DefenderCspmGcpOfferingVmScanners vmScanners() { - return this.vmScanners; - } - - /** - * Set the vmScanners property: The Microsoft Defender for CSPM VM scanning configuration. - * - * @param vmScanners the vmScanners value to set. - * @return the DefenderCspmGcpOffering object itself. - */ - public DefenderCspmGcpOffering withVmScanners(DefenderCspmGcpOfferingVmScanners vmScanners) { - this.vmScanners = vmScanners; - return this; - } - - /** - * Get the dataSensitivityDiscovery property: The Microsoft Defender Data Sensitivity discovery configuration. - * - * @return the dataSensitivityDiscovery value. - */ - public DefenderCspmGcpOfferingDataSensitivityDiscovery dataSensitivityDiscovery() { - return this.dataSensitivityDiscovery; - } - - /** - * Set the dataSensitivityDiscovery property: The Microsoft Defender Data Sensitivity discovery configuration. - * - * @param dataSensitivityDiscovery the dataSensitivityDiscovery value to set. - * @return the DefenderCspmGcpOffering object itself. - */ - public DefenderCspmGcpOffering - withDataSensitivityDiscovery(DefenderCspmGcpOfferingDataSensitivityDiscovery dataSensitivityDiscovery) { - this.dataSensitivityDiscovery = dataSensitivityDiscovery; - return this; - } - - /** - * Get the mdcContainersImageAssessment property: The Microsoft Defender Container image assessment configuration. - * - * @return the mdcContainersImageAssessment value. - */ - public DefenderCspmGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment() { - return this.mdcContainersImageAssessment; - } - - /** - * Set the mdcContainersImageAssessment property: The Microsoft Defender Container image assessment configuration. - * - * @param mdcContainersImageAssessment the mdcContainersImageAssessment value to set. - * @return the DefenderCspmGcpOffering object itself. - */ - public DefenderCspmGcpOffering withMdcContainersImageAssessment( - DefenderCspmGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment) { - this.mdcContainersImageAssessment = mdcContainersImageAssessment; - return this; - } - - /** - * Get the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender Container agentless discovery - * configuration. - * - * @return the mdcContainersAgentlessDiscoveryK8S value. - */ - public DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S() { - return this.mdcContainersAgentlessDiscoveryK8S; - } - - /** - * Set the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender Container agentless discovery - * configuration. - * - * @param mdcContainersAgentlessDiscoveryK8S the mdcContainersAgentlessDiscoveryK8S value to set. - * @return the DefenderCspmGcpOffering object itself. - */ - public DefenderCspmGcpOffering withMdcContainersAgentlessDiscoveryK8S( - DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S) { - this.mdcContainersAgentlessDiscoveryK8S = mdcContainersAgentlessDiscoveryK8S; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (ciemDiscovery() != null) { - ciemDiscovery().validate(); - } - if (vmScanners() != null) { - vmScanners().validate(); - } - if (dataSensitivityDiscovery() != null) { - dataSensitivityDiscovery().validate(); - } - if (mdcContainersImageAssessment() != null) { - mdcContainersImageAssessment().validate(); - } - if (mdcContainersAgentlessDiscoveryK8S() != null) { - mdcContainersAgentlessDiscoveryK8S().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("ciemDiscovery", this.ciemDiscovery); - jsonWriter.writeJsonField("vmScanners", this.vmScanners); - jsonWriter.writeJsonField("dataSensitivityDiscovery", this.dataSensitivityDiscovery); - jsonWriter.writeJsonField("mdcContainersImageAssessment", this.mdcContainersImageAssessment); - jsonWriter.writeJsonField("mdcContainersAgentlessDiscoveryK8s", this.mdcContainersAgentlessDiscoveryK8S); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmGcpOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmGcpOffering 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 DefenderCspmGcpOffering. - */ - public static DefenderCspmGcpOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmGcpOffering deserializedDefenderCspmGcpOffering = new DefenderCspmGcpOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderCspmGcpOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderCspmGcpOffering.offeringType = OfferingType.fromString(reader.getString()); - } else if ("ciemDiscovery".equals(fieldName)) { - deserializedDefenderCspmGcpOffering.ciemDiscovery - = DefenderCspmGcpOfferingCiemDiscovery.fromJson(reader); - } else if ("vmScanners".equals(fieldName)) { - deserializedDefenderCspmGcpOffering.vmScanners = DefenderCspmGcpOfferingVmScanners.fromJson(reader); - } else if ("dataSensitivityDiscovery".equals(fieldName)) { - deserializedDefenderCspmGcpOffering.dataSensitivityDiscovery - = DefenderCspmGcpOfferingDataSensitivityDiscovery.fromJson(reader); - } else if ("mdcContainersImageAssessment".equals(fieldName)) { - deserializedDefenderCspmGcpOffering.mdcContainersImageAssessment - = DefenderCspmGcpOfferingMdcContainersImageAssessment.fromJson(reader); - } else if ("mdcContainersAgentlessDiscoveryK8s".equals(fieldName)) { - deserializedDefenderCspmGcpOffering.mdcContainersAgentlessDiscoveryK8S - = DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmGcpOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingCiemDiscovery.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingCiemDiscovery.java deleted file mode 100644 index d43a81fed60a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingCiemDiscovery.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * GCP Defenders CSPM Permissions Management OIDC (Open ID connect) connection configurations. - */ -@Fluent -public final class DefenderCspmGcpOfferingCiemDiscovery - implements JsonSerializable { - /* - * The GCP workload identity provider id for Permissions Management offering - */ - private String workloadIdentityProviderId; - - /* - * The service account email address in GCP for Permissions Management offering - */ - private String serviceAccountEmailAddress; - - /* - * the azure active directory app name used of authenticating against GCP workload identity federation - */ - private String azureActiveDirectoryAppName; - - /** - * Creates an instance of DefenderCspmGcpOfferingCiemDiscovery class. - */ - public DefenderCspmGcpOfferingCiemDiscovery() { - } - - /** - * Get the workloadIdentityProviderId property: The GCP workload identity provider id for Permissions Management - * offering. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The GCP workload identity provider id for Permissions Management - * offering. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderCspmGcpOfferingCiemDiscovery object itself. - */ - public DefenderCspmGcpOfferingCiemDiscovery withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for Permissions Management - * offering. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for Permissions Management - * offering. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderCspmGcpOfferingCiemDiscovery object itself. - */ - public DefenderCspmGcpOfferingCiemDiscovery withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Get the azureActiveDirectoryAppName property: the azure active directory app name used of authenticating against - * GCP workload identity federation. - * - * @return the azureActiveDirectoryAppName value. - */ - public String azureActiveDirectoryAppName() { - return this.azureActiveDirectoryAppName; - } - - /** - * Set the azureActiveDirectoryAppName property: the azure active directory app name used of authenticating against - * GCP workload identity federation. - * - * @param azureActiveDirectoryAppName the azureActiveDirectoryAppName value to set. - * @return the DefenderCspmGcpOfferingCiemDiscovery object itself. - */ - public DefenderCspmGcpOfferingCiemDiscovery withAzureActiveDirectoryAppName(String azureActiveDirectoryAppName) { - this.azureActiveDirectoryAppName = azureActiveDirectoryAppName; - 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("workloadIdentityProviderId", this.workloadIdentityProviderId); - jsonWriter.writeStringField("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - jsonWriter.writeStringField("azureActiveDirectoryAppName", this.azureActiveDirectoryAppName); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmGcpOfferingCiemDiscovery from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmGcpOfferingCiemDiscovery 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 DefenderCspmGcpOfferingCiemDiscovery. - */ - public static DefenderCspmGcpOfferingCiemDiscovery fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmGcpOfferingCiemDiscovery deserializedDefenderCspmGcpOfferingCiemDiscovery - = new DefenderCspmGcpOfferingCiemDiscovery(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingCiemDiscovery.workloadIdentityProviderId = reader.getString(); - } else if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingCiemDiscovery.serviceAccountEmailAddress = reader.getString(); - } else if ("azureActiveDirectoryAppName".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingCiemDiscovery.azureActiveDirectoryAppName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmGcpOfferingCiemDiscovery; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingDataSensitivityDiscovery.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingDataSensitivityDiscovery.java deleted file mode 100644 index 0cd4d6535ac9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingDataSensitivityDiscovery.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 Microsoft Defender Data Sensitivity discovery configuration. - */ -@Fluent -public final class DefenderCspmGcpOfferingDataSensitivityDiscovery - implements JsonSerializable { - /* - * Is Microsoft Defender Data Sensitivity discovery enabled - */ - private Boolean enabled; - - /* - * The workload identity provider id in GCP for this feature - */ - private String workloadIdentityProviderId; - - /* - * The service account email address in GCP for this feature - */ - private String serviceAccountEmailAddress; - - /** - * Creates an instance of DefenderCspmGcpOfferingDataSensitivityDiscovery class. - */ - public DefenderCspmGcpOfferingDataSensitivityDiscovery() { - } - - /** - * Get the enabled property: Is Microsoft Defender Data Sensitivity discovery enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender Data Sensitivity discovery enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderCspmGcpOfferingDataSensitivityDiscovery object itself. - */ - public DefenderCspmGcpOfferingDataSensitivityDiscovery withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderCspmGcpOfferingDataSensitivityDiscovery object itself. - */ - public DefenderCspmGcpOfferingDataSensitivityDiscovery - withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderCspmGcpOfferingDataSensitivityDiscovery object itself. - */ - public DefenderCspmGcpOfferingDataSensitivityDiscovery - withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - 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("enabled", this.enabled); - jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); - jsonWriter.writeStringField("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmGcpOfferingDataSensitivityDiscovery from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmGcpOfferingDataSensitivityDiscovery 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 DefenderCspmGcpOfferingDataSensitivityDiscovery. - */ - public static DefenderCspmGcpOfferingDataSensitivityDiscovery fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmGcpOfferingDataSensitivityDiscovery deserializedDefenderCspmGcpOfferingDataSensitivityDiscovery - = new DefenderCspmGcpOfferingDataSensitivityDiscovery(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingDataSensitivityDiscovery.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingDataSensitivityDiscovery.workloadIdentityProviderId - = reader.getString(); - } else if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingDataSensitivityDiscovery.serviceAccountEmailAddress - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmGcpOfferingDataSensitivityDiscovery; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S.java deleted file mode 100644 index 99c638d98f87..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 Microsoft Defender Container agentless discovery configuration. - */ -@Fluent -public final class DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S - implements JsonSerializable { - /* - * Is Microsoft Defender container agentless discovery enabled - */ - private Boolean enabled; - - /* - * The workload identity provider id in GCP for this feature - */ - private String workloadIdentityProviderId; - - /* - * The service account email address in GCP for this feature - */ - private String serviceAccountEmailAddress; - - /** - * Creates an instance of DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S class. - */ - public DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S() { - } - - /** - * Get the enabled property: Is Microsoft Defender container agentless discovery enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender container agentless discovery enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S object itself. - */ - public DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S object itself. - */ - public DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S - withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S object itself. - */ - public DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S - withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - 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("enabled", this.enabled); - jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); - jsonWriter.writeStringField("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S 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 - * DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S. - */ - public static DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S deserializedDefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S - = new DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S.workloadIdentityProviderId - = reader.getString(); - } else if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S.serviceAccountEmailAddress - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersImageAssessment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersImageAssessment.java deleted file mode 100644 index 94ca9d93f683..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingMdcContainersImageAssessment.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 Microsoft Defender Container image assessment configuration. - */ -@Fluent -public final class DefenderCspmGcpOfferingMdcContainersImageAssessment - implements JsonSerializable { - /* - * Is Microsoft Defender container image assessment enabled - */ - private Boolean enabled; - - /* - * The workload identity provider id in GCP for this feature - */ - private String workloadIdentityProviderId; - - /* - * The service account email address in GCP for this feature - */ - private String serviceAccountEmailAddress; - - /** - * Creates an instance of DefenderCspmGcpOfferingMdcContainersImageAssessment class. - */ - public DefenderCspmGcpOfferingMdcContainersImageAssessment() { - } - - /** - * Get the enabled property: Is Microsoft Defender container image assessment enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender container image assessment enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderCspmGcpOfferingMdcContainersImageAssessment object itself. - */ - public DefenderCspmGcpOfferingMdcContainersImageAssessment withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderCspmGcpOfferingMdcContainersImageAssessment object itself. - */ - public DefenderCspmGcpOfferingMdcContainersImageAssessment - withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderCspmGcpOfferingMdcContainersImageAssessment object itself. - */ - public DefenderCspmGcpOfferingMdcContainersImageAssessment - withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - 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("enabled", this.enabled); - jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); - jsonWriter.writeStringField("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmGcpOfferingMdcContainersImageAssessment from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmGcpOfferingMdcContainersImageAssessment 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 DefenderCspmGcpOfferingMdcContainersImageAssessment. - */ - public static DefenderCspmGcpOfferingMdcContainersImageAssessment fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmGcpOfferingMdcContainersImageAssessment deserializedDefenderCspmGcpOfferingMdcContainersImageAssessment - = new DefenderCspmGcpOfferingMdcContainersImageAssessment(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingMdcContainersImageAssessment.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingMdcContainersImageAssessment.workloadIdentityProviderId - = reader.getString(); - } else if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingMdcContainersImageAssessment.serviceAccountEmailAddress - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmGcpOfferingMdcContainersImageAssessment; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingVmScanners.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingVmScanners.java deleted file mode 100644 index c5960edd5905..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOfferingVmScanners.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender for CSPM VM scanning configuration. - */ -@Fluent -public final class DefenderCspmGcpOfferingVmScanners extends VmScannersGcp { - /** - * Creates an instance of DefenderCspmGcpOfferingVmScanners class. - */ - public DefenderCspmGcpOfferingVmScanners() { - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderCspmGcpOfferingVmScanners withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderCspmGcpOfferingVmScanners withConfiguration(VmScannersBaseConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmGcpOfferingVmScanners from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmGcpOfferingVmScanners 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 DefenderCspmGcpOfferingVmScanners. - */ - public static DefenderCspmGcpOfferingVmScanners fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmGcpOfferingVmScanners deserializedDefenderCspmGcpOfferingVmScanners - = new DefenderCspmGcpOfferingVmScanners(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingVmScanners - .withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderCspmGcpOfferingVmScanners - .withConfiguration(VmScannersBaseConfiguration.fromJson(reader)); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmGcpOfferingVmScanners; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmJFrogOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmJFrogOffering.java deleted file mode 100644 index 85b6537bb488..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmJFrogOffering.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The CSPM P1 for JFrog Artifactory offering. - */ -@Fluent -public final class DefenderCspmJFrogOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_CSPM_JFROG; - - /* - * The Microsoft Defender Container image assessment configuration - */ - private DefenderCspmJFrogOfferingMdcContainersImageAssessment mdcContainersImageAssessment; - - /** - * Creates an instance of DefenderCspmJFrogOffering class. - */ - public DefenderCspmJFrogOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Get the mdcContainersImageAssessment property: The Microsoft Defender Container image assessment configuration. - * - * @return the mdcContainersImageAssessment value. - */ - public DefenderCspmJFrogOfferingMdcContainersImageAssessment mdcContainersImageAssessment() { - return this.mdcContainersImageAssessment; - } - - /** - * Set the mdcContainersImageAssessment property: The Microsoft Defender Container image assessment configuration. - * - * @param mdcContainersImageAssessment the mdcContainersImageAssessment value to set. - * @return the DefenderCspmJFrogOffering object itself. - */ - public DefenderCspmJFrogOffering withMdcContainersImageAssessment( - DefenderCspmJFrogOfferingMdcContainersImageAssessment mdcContainersImageAssessment) { - this.mdcContainersImageAssessment = mdcContainersImageAssessment; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (mdcContainersImageAssessment() != null) { - mdcContainersImageAssessment().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("mdcContainersImageAssessment", this.mdcContainersImageAssessment); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmJFrogOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmJFrogOffering 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 DefenderCspmJFrogOffering. - */ - public static DefenderCspmJFrogOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmJFrogOffering deserializedDefenderCspmJFrogOffering = new DefenderCspmJFrogOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderCspmJFrogOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderCspmJFrogOffering.offeringType = OfferingType.fromString(reader.getString()); - } else if ("mdcContainersImageAssessment".equals(fieldName)) { - deserializedDefenderCspmJFrogOffering.mdcContainersImageAssessment - = DefenderCspmJFrogOfferingMdcContainersImageAssessment.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmJFrogOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmJFrogOfferingMdcContainersImageAssessment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmJFrogOfferingMdcContainersImageAssessment.java deleted file mode 100644 index 21e1ea8fe26b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmJFrogOfferingMdcContainersImageAssessment.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 Microsoft Defender Container image assessment configuration. - */ -@Fluent -public final class DefenderCspmJFrogOfferingMdcContainersImageAssessment - implements JsonSerializable { - /* - * Is Microsoft Defender container image assessment enabled - */ - private Boolean enabled; - - /** - * Creates an instance of DefenderCspmJFrogOfferingMdcContainersImageAssessment class. - */ - public DefenderCspmJFrogOfferingMdcContainersImageAssessment() { - } - - /** - * Get the enabled property: Is Microsoft Defender container image assessment enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender container image assessment enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderCspmJFrogOfferingMdcContainersImageAssessment object itself. - */ - public DefenderCspmJFrogOfferingMdcContainersImageAssessment withEnabled(Boolean enabled) { - this.enabled = enabled; - 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("enabled", this.enabled); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderCspmJFrogOfferingMdcContainersImageAssessment from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderCspmJFrogOfferingMdcContainersImageAssessment 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 DefenderCspmJFrogOfferingMdcContainersImageAssessment. - */ - public static DefenderCspmJFrogOfferingMdcContainersImageAssessment fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderCspmJFrogOfferingMdcContainersImageAssessment deserializedDefenderCspmJFrogOfferingMdcContainersImageAssessment - = new DefenderCspmJFrogOfferingMdcContainersImageAssessment(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderCspmJFrogOfferingMdcContainersImageAssessment.enabled - = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderCspmJFrogOfferingMdcContainersImageAssessment; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOffering.java deleted file mode 100644 index 11f39d3b66ab..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOffering.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Defender for Databases AWS offering. - */ -@Fluent -public final class DefenderFoDatabasesAwsOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_FOR_DATABASES_AWS; - - /* - * The ARC autoprovisioning configuration - */ - private DefenderFoDatabasesAwsOfferingArcAutoProvisioning arcAutoProvisioning; - - /* - * The RDS configuration - */ - private DefenderFoDatabasesAwsOfferingRds rds; - - /* - * The databases data security posture management (DSPM) configuration - */ - private DefenderFoDatabasesAwsOfferingDatabasesDspm databasesDspm; - - /** - * Creates an instance of DefenderFoDatabasesAwsOffering class. - */ - public DefenderFoDatabasesAwsOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Get the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @return the arcAutoProvisioning value. - */ - public DefenderFoDatabasesAwsOfferingArcAutoProvisioning arcAutoProvisioning() { - return this.arcAutoProvisioning; - } - - /** - * Set the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @param arcAutoProvisioning the arcAutoProvisioning value to set. - * @return the DefenderFoDatabasesAwsOffering object itself. - */ - public DefenderFoDatabasesAwsOffering - withArcAutoProvisioning(DefenderFoDatabasesAwsOfferingArcAutoProvisioning arcAutoProvisioning) { - this.arcAutoProvisioning = arcAutoProvisioning; - return this; - } - - /** - * Get the rds property: The RDS configuration. - * - * @return the rds value. - */ - public DefenderFoDatabasesAwsOfferingRds rds() { - return this.rds; - } - - /** - * Set the rds property: The RDS configuration. - * - * @param rds the rds value to set. - * @return the DefenderFoDatabasesAwsOffering object itself. - */ - public DefenderFoDatabasesAwsOffering withRds(DefenderFoDatabasesAwsOfferingRds rds) { - this.rds = rds; - return this; - } - - /** - * Get the databasesDspm property: The databases data security posture management (DSPM) configuration. - * - * @return the databasesDspm value. - */ - public DefenderFoDatabasesAwsOfferingDatabasesDspm databasesDspm() { - return this.databasesDspm; - } - - /** - * Set the databasesDspm property: The databases data security posture management (DSPM) configuration. - * - * @param databasesDspm the databasesDspm value to set. - * @return the DefenderFoDatabasesAwsOffering object itself. - */ - public DefenderFoDatabasesAwsOffering withDatabasesDspm(DefenderFoDatabasesAwsOfferingDatabasesDspm databasesDspm) { - this.databasesDspm = databasesDspm; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (arcAutoProvisioning() != null) { - arcAutoProvisioning().validate(); - } - if (rds() != null) { - rds().validate(); - } - if (databasesDspm() != null) { - databasesDspm().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("arcAutoProvisioning", this.arcAutoProvisioning); - jsonWriter.writeJsonField("rds", this.rds); - jsonWriter.writeJsonField("databasesDspm", this.databasesDspm); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderFoDatabasesAwsOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderFoDatabasesAwsOffering 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 DefenderFoDatabasesAwsOffering. - */ - public static DefenderFoDatabasesAwsOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderFoDatabasesAwsOffering deserializedDefenderFoDatabasesAwsOffering - = new DefenderFoDatabasesAwsOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOffering.offeringType - = OfferingType.fromString(reader.getString()); - } else if ("arcAutoProvisioning".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOffering.arcAutoProvisioning - = DefenderFoDatabasesAwsOfferingArcAutoProvisioning.fromJson(reader); - } else if ("rds".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOffering.rds = DefenderFoDatabasesAwsOfferingRds.fromJson(reader); - } else if ("databasesDspm".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOffering.databasesDspm - = DefenderFoDatabasesAwsOfferingDatabasesDspm.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderFoDatabasesAwsOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingArcAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingArcAutoProvisioning.java deleted file mode 100644 index 5e6e13bb6643..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingArcAutoProvisioning.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ARC autoprovisioning configuration. - */ -@Fluent -public final class DefenderFoDatabasesAwsOfferingArcAutoProvisioning extends ArcAutoProvisioningAws { - /** - * Creates an instance of DefenderFoDatabasesAwsOfferingArcAutoProvisioning class. - */ - public DefenderFoDatabasesAwsOfferingArcAutoProvisioning() { - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderFoDatabasesAwsOfferingArcAutoProvisioning withCloudRoleArn(String cloudRoleArn) { - super.withCloudRoleArn(cloudRoleArn); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderFoDatabasesAwsOfferingArcAutoProvisioning withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderFoDatabasesAwsOfferingArcAutoProvisioning - withConfiguration(ArcAutoProvisioningConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - jsonWriter.writeStringField("cloudRoleArn", cloudRoleArn()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderFoDatabasesAwsOfferingArcAutoProvisioning from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderFoDatabasesAwsOfferingArcAutoProvisioning 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 DefenderFoDatabasesAwsOfferingArcAutoProvisioning. - */ - public static DefenderFoDatabasesAwsOfferingArcAutoProvisioning fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderFoDatabasesAwsOfferingArcAutoProvisioning deserializedDefenderFoDatabasesAwsOfferingArcAutoProvisioning - = new DefenderFoDatabasesAwsOfferingArcAutoProvisioning(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOfferingArcAutoProvisioning - .withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOfferingArcAutoProvisioning - .withConfiguration(ArcAutoProvisioningConfiguration.fromJson(reader)); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOfferingArcAutoProvisioning.withCloudRoleArn(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderFoDatabasesAwsOfferingArcAutoProvisioning; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingDatabasesDspm.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingDatabasesDspm.java deleted file mode 100644 index 063375105c2b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingDatabasesDspm.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 databases data security posture management (DSPM) configuration. - */ -@Fluent -public final class DefenderFoDatabasesAwsOfferingDatabasesDspm - implements JsonSerializable { - /* - * Is databases data security posture management (DSPM) protection enabled - */ - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderFoDatabasesAwsOfferingDatabasesDspm class. - */ - public DefenderFoDatabasesAwsOfferingDatabasesDspm() { - } - - /** - * Get the enabled property: Is databases data security posture management (DSPM) protection enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is databases data security posture management (DSPM) protection enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderFoDatabasesAwsOfferingDatabasesDspm object itself. - */ - public DefenderFoDatabasesAwsOfferingDatabasesDspm withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderFoDatabasesAwsOfferingDatabasesDspm object itself. - */ - public DefenderFoDatabasesAwsOfferingDatabasesDspm withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - 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("enabled", this.enabled); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderFoDatabasesAwsOfferingDatabasesDspm from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderFoDatabasesAwsOfferingDatabasesDspm 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 DefenderFoDatabasesAwsOfferingDatabasesDspm. - */ - public static DefenderFoDatabasesAwsOfferingDatabasesDspm fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderFoDatabasesAwsOfferingDatabasesDspm deserializedDefenderFoDatabasesAwsOfferingDatabasesDspm - = new DefenderFoDatabasesAwsOfferingDatabasesDspm(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOfferingDatabasesDspm.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOfferingDatabasesDspm.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderFoDatabasesAwsOfferingDatabasesDspm; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingRds.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingRds.java deleted file mode 100644 index 51f2add77b99..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingRds.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 RDS configuration. - */ -@Fluent -public final class DefenderFoDatabasesAwsOfferingRds implements JsonSerializable { - /* - * Is RDS protection enabled - */ - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderFoDatabasesAwsOfferingRds class. - */ - public DefenderFoDatabasesAwsOfferingRds() { - } - - /** - * Get the enabled property: Is RDS protection enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is RDS protection enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderFoDatabasesAwsOfferingRds object itself. - */ - public DefenderFoDatabasesAwsOfferingRds withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderFoDatabasesAwsOfferingRds object itself. - */ - public DefenderFoDatabasesAwsOfferingRds withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - 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("enabled", this.enabled); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderFoDatabasesAwsOfferingRds from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderFoDatabasesAwsOfferingRds 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 DefenderFoDatabasesAwsOfferingRds. - */ - public static DefenderFoDatabasesAwsOfferingRds fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderFoDatabasesAwsOfferingRds deserializedDefenderFoDatabasesAwsOfferingRds - = new DefenderFoDatabasesAwsOfferingRds(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOfferingRds.enabled = reader.getNullable(JsonReader::getBoolean); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderFoDatabasesAwsOfferingRds.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderFoDatabasesAwsOfferingRds; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOffering.java deleted file mode 100644 index 0a3dc19cfda1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOffering.java +++ /dev/null @@ -1,471 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Defender for Containers AWS offering. - */ -@Fluent -public final class DefenderForContainersAwsOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_FOR_CONTAINERS_AWS; - - /* - * The kubernetes service connection configuration - */ - private DefenderForContainersAwsOfferingKubernetesService kubernetesService; - - /* - * The kubernetes data collection connection configuration - */ - private DefenderForContainersAwsOfferingKubernetesDataCollection kubernetesDataCollection; - - /* - * The cloudwatch to kinesis connection configuration - */ - private DefenderForContainersAwsOfferingCloudWatchToKinesis cloudWatchToKinesis; - - /* - * The kinesis to s3 connection configuration - */ - private DefenderForContainersAwsOfferingKinesisToS3 kinesisToS3; - - /* - * Is audit logs data collection enabled - */ - private Boolean enableAuditLogsAutoProvisioning; - - /* - * Is Microsoft Defender for Cloud Kubernetes agent auto provisioning enabled - */ - private Boolean enableDefenderAgentAutoProvisioning; - - /* - * Is Policy Kubernetes agent auto provisioning enabled - */ - private Boolean enablePolicyAgentAutoProvisioning; - - /* - * The retention time in days of kube audit logs set on the CloudWatch log group - */ - private Long kubeAuditRetentionTime; - - /* - * The externalId used by the data reader to prevent the confused deputy attack - */ - private String dataCollectionExternalId; - - /* - * The Microsoft Defender container image assessment configuration - */ - private DefenderForContainersAwsOfferingMdcContainersImageAssessment mdcContainersImageAssessment; - - /* - * The Microsoft Defender container agentless discovery K8s configuration - */ - private DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S; - - /* - * The Microsoft Defender for Container K8s VM host scanning configuration - */ - private DefenderForContainersAwsOfferingVmScanners vmScanners; - - /** - * Creates an instance of DefenderForContainersAwsOffering class. - */ - public DefenderForContainersAwsOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Get the kubernetesService property: The kubernetes service connection configuration. - * - * @return the kubernetesService value. - */ - public DefenderForContainersAwsOfferingKubernetesService kubernetesService() { - return this.kubernetesService; - } - - /** - * Set the kubernetesService property: The kubernetes service connection configuration. - * - * @param kubernetesService the kubernetesService value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering - withKubernetesService(DefenderForContainersAwsOfferingKubernetesService kubernetesService) { - this.kubernetesService = kubernetesService; - return this; - } - - /** - * Get the kubernetesDataCollection property: The kubernetes data collection connection configuration. - * - * @return the kubernetesDataCollection value. - */ - public DefenderForContainersAwsOfferingKubernetesDataCollection kubernetesDataCollection() { - return this.kubernetesDataCollection; - } - - /** - * Set the kubernetesDataCollection property: The kubernetes data collection connection configuration. - * - * @param kubernetesDataCollection the kubernetesDataCollection value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withKubernetesDataCollection( - DefenderForContainersAwsOfferingKubernetesDataCollection kubernetesDataCollection) { - this.kubernetesDataCollection = kubernetesDataCollection; - return this; - } - - /** - * Get the cloudWatchToKinesis property: The cloudwatch to kinesis connection configuration. - * - * @return the cloudWatchToKinesis value. - */ - public DefenderForContainersAwsOfferingCloudWatchToKinesis cloudWatchToKinesis() { - return this.cloudWatchToKinesis; - } - - /** - * Set the cloudWatchToKinesis property: The cloudwatch to kinesis connection configuration. - * - * @param cloudWatchToKinesis the cloudWatchToKinesis value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering - withCloudWatchToKinesis(DefenderForContainersAwsOfferingCloudWatchToKinesis cloudWatchToKinesis) { - this.cloudWatchToKinesis = cloudWatchToKinesis; - return this; - } - - /** - * Get the kinesisToS3 property: The kinesis to s3 connection configuration. - * - * @return the kinesisToS3 value. - */ - public DefenderForContainersAwsOfferingKinesisToS3 kinesisToS3() { - return this.kinesisToS3; - } - - /** - * Set the kinesisToS3 property: The kinesis to s3 connection configuration. - * - * @param kinesisToS3 the kinesisToS3 value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withKinesisToS3(DefenderForContainersAwsOfferingKinesisToS3 kinesisToS3) { - this.kinesisToS3 = kinesisToS3; - return this; - } - - /** - * Get the enableAuditLogsAutoProvisioning property: Is audit logs data collection enabled. - * - * @return the enableAuditLogsAutoProvisioning value. - */ - public Boolean enableAuditLogsAutoProvisioning() { - return this.enableAuditLogsAutoProvisioning; - } - - /** - * Set the enableAuditLogsAutoProvisioning property: Is audit logs data collection enabled. - * - * @param enableAuditLogsAutoProvisioning the enableAuditLogsAutoProvisioning value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering - withEnableAuditLogsAutoProvisioning(Boolean enableAuditLogsAutoProvisioning) { - this.enableAuditLogsAutoProvisioning = enableAuditLogsAutoProvisioning; - return this; - } - - /** - * Get the enableDefenderAgentAutoProvisioning property: Is Microsoft Defender for Cloud Kubernetes agent auto - * provisioning enabled. - * - * @return the enableDefenderAgentAutoProvisioning value. - */ - public Boolean enableDefenderAgentAutoProvisioning() { - return this.enableDefenderAgentAutoProvisioning; - } - - /** - * Set the enableDefenderAgentAutoProvisioning property: Is Microsoft Defender for Cloud Kubernetes agent auto - * provisioning enabled. - * - * @param enableDefenderAgentAutoProvisioning the enableDefenderAgentAutoProvisioning value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering - withEnableDefenderAgentAutoProvisioning(Boolean enableDefenderAgentAutoProvisioning) { - this.enableDefenderAgentAutoProvisioning = enableDefenderAgentAutoProvisioning; - return this; - } - - /** - * Get the enablePolicyAgentAutoProvisioning property: Is Policy Kubernetes agent auto provisioning enabled. - * - * @return the enablePolicyAgentAutoProvisioning value. - */ - public Boolean enablePolicyAgentAutoProvisioning() { - return this.enablePolicyAgentAutoProvisioning; - } - - /** - * Set the enablePolicyAgentAutoProvisioning property: Is Policy Kubernetes agent auto provisioning enabled. - * - * @param enablePolicyAgentAutoProvisioning the enablePolicyAgentAutoProvisioning value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering - withEnablePolicyAgentAutoProvisioning(Boolean enablePolicyAgentAutoProvisioning) { - this.enablePolicyAgentAutoProvisioning = enablePolicyAgentAutoProvisioning; - return this; - } - - /** - * Get the kubeAuditRetentionTime property: The retention time in days of kube audit logs set on the CloudWatch log - * group. - * - * @return the kubeAuditRetentionTime value. - */ - public Long kubeAuditRetentionTime() { - return this.kubeAuditRetentionTime; - } - - /** - * Set the kubeAuditRetentionTime property: The retention time in days of kube audit logs set on the CloudWatch log - * group. - * - * @param kubeAuditRetentionTime the kubeAuditRetentionTime value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withKubeAuditRetentionTime(Long kubeAuditRetentionTime) { - this.kubeAuditRetentionTime = kubeAuditRetentionTime; - return this; - } - - /** - * Get the dataCollectionExternalId property: The externalId used by the data reader to prevent the confused deputy - * attack. - * - * @return the dataCollectionExternalId value. - */ - public String dataCollectionExternalId() { - return this.dataCollectionExternalId; - } - - /** - * Set the dataCollectionExternalId property: The externalId used by the data reader to prevent the confused deputy - * attack. - * - * @param dataCollectionExternalId the dataCollectionExternalId value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withDataCollectionExternalId(String dataCollectionExternalId) { - this.dataCollectionExternalId = dataCollectionExternalId; - return this; - } - - /** - * Get the mdcContainersImageAssessment property: The Microsoft Defender container image assessment configuration. - * - * @return the mdcContainersImageAssessment value. - */ - public DefenderForContainersAwsOfferingMdcContainersImageAssessment mdcContainersImageAssessment() { - return this.mdcContainersImageAssessment; - } - - /** - * Set the mdcContainersImageAssessment property: The Microsoft Defender container image assessment configuration. - * - * @param mdcContainersImageAssessment the mdcContainersImageAssessment value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withMdcContainersImageAssessment( - DefenderForContainersAwsOfferingMdcContainersImageAssessment mdcContainersImageAssessment) { - this.mdcContainersImageAssessment = mdcContainersImageAssessment; - return this; - } - - /** - * Get the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender container agentless discovery K8s - * configuration. - * - * @return the mdcContainersAgentlessDiscoveryK8S value. - */ - public DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S() { - return this.mdcContainersAgentlessDiscoveryK8S; - } - - /** - * Set the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender container agentless discovery K8s - * configuration. - * - * @param mdcContainersAgentlessDiscoveryK8S the mdcContainersAgentlessDiscoveryK8S value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withMdcContainersAgentlessDiscoveryK8S( - DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S) { - this.mdcContainersAgentlessDiscoveryK8S = mdcContainersAgentlessDiscoveryK8S; - return this; - } - - /** - * Get the vmScanners property: The Microsoft Defender for Container K8s VM host scanning configuration. - * - * @return the vmScanners value. - */ - public DefenderForContainersAwsOfferingVmScanners vmScanners() { - return this.vmScanners; - } - - /** - * Set the vmScanners property: The Microsoft Defender for Container K8s VM host scanning configuration. - * - * @param vmScanners the vmScanners value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withVmScanners(DefenderForContainersAwsOfferingVmScanners vmScanners) { - this.vmScanners = vmScanners; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (kubernetesService() != null) { - kubernetesService().validate(); - } - if (kubernetesDataCollection() != null) { - kubernetesDataCollection().validate(); - } - if (cloudWatchToKinesis() != null) { - cloudWatchToKinesis().validate(); - } - if (kinesisToS3() != null) { - kinesisToS3().validate(); - } - if (mdcContainersImageAssessment() != null) { - mdcContainersImageAssessment().validate(); - } - if (mdcContainersAgentlessDiscoveryK8S() != null) { - mdcContainersAgentlessDiscoveryK8S().validate(); - } - if (vmScanners() != null) { - vmScanners().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("kubernetesService", this.kubernetesService); - jsonWriter.writeJsonField("kubernetesDataCollection", this.kubernetesDataCollection); - jsonWriter.writeJsonField("cloudWatchToKinesis", this.cloudWatchToKinesis); - jsonWriter.writeJsonField("kinesisToS3", this.kinesisToS3); - jsonWriter.writeBooleanField("enableAuditLogsAutoProvisioning", this.enableAuditLogsAutoProvisioning); - jsonWriter.writeBooleanField("enableDefenderAgentAutoProvisioning", this.enableDefenderAgentAutoProvisioning); - jsonWriter.writeBooleanField("enablePolicyAgentAutoProvisioning", this.enablePolicyAgentAutoProvisioning); - jsonWriter.writeNumberField("kubeAuditRetentionTime", this.kubeAuditRetentionTime); - jsonWriter.writeStringField("dataCollectionExternalId", this.dataCollectionExternalId); - jsonWriter.writeJsonField("mdcContainersImageAssessment", this.mdcContainersImageAssessment); - jsonWriter.writeJsonField("mdcContainersAgentlessDiscoveryK8s", this.mdcContainersAgentlessDiscoveryK8S); - jsonWriter.writeJsonField("vmScanners", this.vmScanners); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersAwsOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersAwsOffering 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 DefenderForContainersAwsOffering. - */ - public static DefenderForContainersAwsOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersAwsOffering deserializedDefenderForContainersAwsOffering - = new DefenderForContainersAwsOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.offeringType - = OfferingType.fromString(reader.getString()); - } else if ("kubernetesService".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.kubernetesService - = DefenderForContainersAwsOfferingKubernetesService.fromJson(reader); - } else if ("kubernetesDataCollection".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.kubernetesDataCollection - = DefenderForContainersAwsOfferingKubernetesDataCollection.fromJson(reader); - } else if ("cloudWatchToKinesis".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.cloudWatchToKinesis - = DefenderForContainersAwsOfferingCloudWatchToKinesis.fromJson(reader); - } else if ("kinesisToS3".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.kinesisToS3 - = DefenderForContainersAwsOfferingKinesisToS3.fromJson(reader); - } else if ("enableAuditLogsAutoProvisioning".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.enableAuditLogsAutoProvisioning - = reader.getNullable(JsonReader::getBoolean); - } else if ("enableDefenderAgentAutoProvisioning".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.enableDefenderAgentAutoProvisioning - = reader.getNullable(JsonReader::getBoolean); - } else if ("enablePolicyAgentAutoProvisioning".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.enablePolicyAgentAutoProvisioning - = reader.getNullable(JsonReader::getBoolean); - } else if ("kubeAuditRetentionTime".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.kubeAuditRetentionTime - = reader.getNullable(JsonReader::getLong); - } else if ("dataCollectionExternalId".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.dataCollectionExternalId = reader.getString(); - } else if ("mdcContainersImageAssessment".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.mdcContainersImageAssessment - = DefenderForContainersAwsOfferingMdcContainersImageAssessment.fromJson(reader); - } else if ("mdcContainersAgentlessDiscoveryK8s".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.mdcContainersAgentlessDiscoveryK8S - = DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S.fromJson(reader); - } else if ("vmScanners".equals(fieldName)) { - deserializedDefenderForContainersAwsOffering.vmScanners - = DefenderForContainersAwsOfferingVmScanners.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersAwsOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingCloudWatchToKinesis.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingCloudWatchToKinesis.java deleted file mode 100644 index e4fcc8542c94..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingCloudWatchToKinesis.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 cloudwatch to kinesis connection configuration. - */ -@Fluent -public final class DefenderForContainersAwsOfferingCloudWatchToKinesis - implements JsonSerializable { - /* - * The cloud role ARN in AWS used by CloudWatch to transfer data into Kinesis - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderForContainersAwsOfferingCloudWatchToKinesis class. - */ - public DefenderForContainersAwsOfferingCloudWatchToKinesis() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS used by CloudWatch to transfer data into Kinesis. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS used by CloudWatch to transfer data into Kinesis. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderForContainersAwsOfferingCloudWatchToKinesis object itself. - */ - public DefenderForContainersAwsOfferingCloudWatchToKinesis withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - 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("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersAwsOfferingCloudWatchToKinesis from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersAwsOfferingCloudWatchToKinesis 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 DefenderForContainersAwsOfferingCloudWatchToKinesis. - */ - public static DefenderForContainersAwsOfferingCloudWatchToKinesis fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersAwsOfferingCloudWatchToKinesis deserializedDefenderForContainersAwsOfferingCloudWatchToKinesis - = new DefenderForContainersAwsOfferingCloudWatchToKinesis(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingCloudWatchToKinesis.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersAwsOfferingCloudWatchToKinesis; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKinesisToS3.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKinesisToS3.java deleted file mode 100644 index e7da36168aa2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKinesisToS3.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 kinesis to s3 connection configuration. - */ -@Fluent -public final class DefenderForContainersAwsOfferingKinesisToS3 - implements JsonSerializable { - /* - * The cloud role ARN in AWS used by Kinesis to transfer data into S3 - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderForContainersAwsOfferingKinesisToS3 class. - */ - public DefenderForContainersAwsOfferingKinesisToS3() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS used by Kinesis to transfer data into S3. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS used by Kinesis to transfer data into S3. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderForContainersAwsOfferingKinesisToS3 object itself. - */ - public DefenderForContainersAwsOfferingKinesisToS3 withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - 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("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersAwsOfferingKinesisToS3 from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersAwsOfferingKinesisToS3 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 DefenderForContainersAwsOfferingKinesisToS3. - */ - public static DefenderForContainersAwsOfferingKinesisToS3 fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersAwsOfferingKinesisToS3 deserializedDefenderForContainersAwsOfferingKinesisToS3 - = new DefenderForContainersAwsOfferingKinesisToS3(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingKinesisToS3.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersAwsOfferingKinesisToS3; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesDataCollection.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesDataCollection.java deleted file mode 100644 index b9ceb6f5ca32..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesDataCollection.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 kubernetes data collection connection configuration. - */ -@Fluent -public final class DefenderForContainersAwsOfferingKubernetesDataCollection - implements JsonSerializable { - /* - * The cloud role ARN in AWS for this feature used for reading data - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderForContainersAwsOfferingKubernetesDataCollection class. - */ - public DefenderForContainersAwsOfferingKubernetesDataCollection() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature used for reading data. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature used for reading data. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderForContainersAwsOfferingKubernetesDataCollection object itself. - */ - public DefenderForContainersAwsOfferingKubernetesDataCollection withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - 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("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersAwsOfferingKubernetesDataCollection from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersAwsOfferingKubernetesDataCollection 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 - * DefenderForContainersAwsOfferingKubernetesDataCollection. - */ - public static DefenderForContainersAwsOfferingKubernetesDataCollection fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersAwsOfferingKubernetesDataCollection deserializedDefenderForContainersAwsOfferingKubernetesDataCollection - = new DefenderForContainersAwsOfferingKubernetesDataCollection(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingKubernetesDataCollection.cloudRoleArn - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersAwsOfferingKubernetesDataCollection; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesService.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesService.java deleted file mode 100644 index da5b61e6e47f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesService.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 kubernetes service connection configuration. - */ -@Fluent -public final class DefenderForContainersAwsOfferingKubernetesService - implements JsonSerializable { - /* - * The cloud role ARN in AWS for this feature used for provisioning resources - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderForContainersAwsOfferingKubernetesService class. - */ - public DefenderForContainersAwsOfferingKubernetesService() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature used for provisioning resources. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature used for provisioning resources. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderForContainersAwsOfferingKubernetesService object itself. - */ - public DefenderForContainersAwsOfferingKubernetesService withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - 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("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersAwsOfferingKubernetesService from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersAwsOfferingKubernetesService 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 DefenderForContainersAwsOfferingKubernetesService. - */ - public static DefenderForContainersAwsOfferingKubernetesService fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersAwsOfferingKubernetesService deserializedDefenderForContainersAwsOfferingKubernetesService - = new DefenderForContainersAwsOfferingKubernetesService(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingKubernetesService.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersAwsOfferingKubernetesService; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S.java deleted file mode 100644 index d188ecbb7741..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 Microsoft Defender container agentless discovery K8s configuration. - */ -@Fluent -public final class DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S - implements JsonSerializable { - /* - * Is Microsoft Defender container agentless discovery K8s enabled - */ - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S class. - */ - public DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S() { - } - - /** - * Get the enabled property: Is Microsoft Defender container agentless discovery K8s enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender container agentless discovery K8s enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S object itself. - */ - public DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S object itself. - */ - public DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - 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("enabled", this.enabled); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S 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 - * DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S. - */ - public static DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S deserializedDefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S - = new DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S.cloudRoleArn - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersImageAssessment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersImageAssessment.java deleted file mode 100644 index 9dba92eadee4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingMdcContainersImageAssessment.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 Microsoft Defender container image assessment configuration. - */ -@Fluent -public final class DefenderForContainersAwsOfferingMdcContainersImageAssessment - implements JsonSerializable { - /* - * Is Microsoft Defender container image assessment enabled - */ - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderForContainersAwsOfferingMdcContainersImageAssessment class. - */ - public DefenderForContainersAwsOfferingMdcContainersImageAssessment() { - } - - /** - * Get the enabled property: Is Microsoft Defender container image assessment enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender container image assessment enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForContainersAwsOfferingMdcContainersImageAssessment object itself. - */ - public DefenderForContainersAwsOfferingMdcContainersImageAssessment withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderForContainersAwsOfferingMdcContainersImageAssessment object itself. - */ - public DefenderForContainersAwsOfferingMdcContainersImageAssessment withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - 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("enabled", this.enabled); - jsonWriter.writeStringField("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersAwsOfferingMdcContainersImageAssessment from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersAwsOfferingMdcContainersImageAssessment 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 - * DefenderForContainersAwsOfferingMdcContainersImageAssessment. - */ - public static DefenderForContainersAwsOfferingMdcContainersImageAssessment fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersAwsOfferingMdcContainersImageAssessment deserializedDefenderForContainersAwsOfferingMdcContainersImageAssessment - = new DefenderForContainersAwsOfferingMdcContainersImageAssessment(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingMdcContainersImageAssessment.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingMdcContainersImageAssessment.cloudRoleArn - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersAwsOfferingMdcContainersImageAssessment; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingVmScanners.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingVmScanners.java deleted file mode 100644 index fe83044d60bb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingVmScanners.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender for Container K8s VM host scanning configuration. - */ -@Fluent -public final class DefenderForContainersAwsOfferingVmScanners extends VmScannersAws { - /** - * Creates an instance of DefenderForContainersAwsOfferingVmScanners class. - */ - public DefenderForContainersAwsOfferingVmScanners() { - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForContainersAwsOfferingVmScanners withCloudRoleArn(String cloudRoleArn) { - super.withCloudRoleArn(cloudRoleArn); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForContainersAwsOfferingVmScanners withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForContainersAwsOfferingVmScanners withConfiguration(VmScannersBaseConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - jsonWriter.writeStringField("cloudRoleArn", cloudRoleArn()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersAwsOfferingVmScanners from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersAwsOfferingVmScanners 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 DefenderForContainersAwsOfferingVmScanners. - */ - public static DefenderForContainersAwsOfferingVmScanners fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersAwsOfferingVmScanners deserializedDefenderForContainersAwsOfferingVmScanners - = new DefenderForContainersAwsOfferingVmScanners(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingVmScanners - .withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingVmScanners - .withConfiguration(VmScannersBaseConfiguration.fromJson(reader)); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderForContainersAwsOfferingVmScanners.withCloudRoleArn(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersAwsOfferingVmScanners; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersDockerHubOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersDockerHubOffering.java deleted file mode 100644 index 9154af14476f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersDockerHubOffering.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Defender for containers Docker Hub offering configurations. - */ -@Immutable -public final class DefenderForContainersDockerHubOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_FOR_CONTAINERS_DOCKER_HUB; - - /** - * Creates an instance of DefenderForContainersDockerHubOffering class. - */ - public DefenderForContainersDockerHubOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersDockerHubOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersDockerHubOffering 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 DefenderForContainersDockerHubOffering. - */ - public static DefenderForContainersDockerHubOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersDockerHubOffering deserializedDefenderForContainersDockerHubOffering - = new DefenderForContainersDockerHubOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderForContainersDockerHubOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderForContainersDockerHubOffering.offeringType - = OfferingType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersDockerHubOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOffering.java deleted file mode 100644 index 1195c0a19230..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOffering.java +++ /dev/null @@ -1,345 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The containers GCP offering. - */ -@Fluent -public final class DefenderForContainersGcpOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_FOR_CONTAINERS_GCP; - - /* - * The native cloud connection configuration - */ - private DefenderForContainersGcpOfferingNativeCloudConnection nativeCloudConnection; - - /* - * The native cloud connection configuration - */ - private DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection dataPipelineNativeCloudConnection; - - /* - * Is audit logs data collection enabled - */ - private Boolean enableAuditLogsAutoProvisioning; - - /* - * Is Microsoft Defender for Cloud Kubernetes agent auto provisioning enabled - */ - private Boolean enableDefenderAgentAutoProvisioning; - - /* - * Is Policy Kubernetes agent auto provisioning enabled - */ - private Boolean enablePolicyAgentAutoProvisioning; - - /* - * The Microsoft Defender Container image assessment configuration - */ - private DefenderForContainersGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment; - - /* - * The Microsoft Defender Container agentless discovery configuration - */ - private DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S; - - /* - * The Microsoft Defender for Container K8s VM host scanning configuration - */ - private DefenderForContainersGcpOfferingVmScanners vmScanners; - - /** - * Creates an instance of DefenderForContainersGcpOffering class. - */ - public DefenderForContainersGcpOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Get the nativeCloudConnection property: The native cloud connection configuration. - * - * @return the nativeCloudConnection value. - */ - public DefenderForContainersGcpOfferingNativeCloudConnection nativeCloudConnection() { - return this.nativeCloudConnection; - } - - /** - * Set the nativeCloudConnection property: The native cloud connection configuration. - * - * @param nativeCloudConnection the nativeCloudConnection value to set. - * @return the DefenderForContainersGcpOffering object itself. - */ - public DefenderForContainersGcpOffering - withNativeCloudConnection(DefenderForContainersGcpOfferingNativeCloudConnection nativeCloudConnection) { - this.nativeCloudConnection = nativeCloudConnection; - return this; - } - - /** - * Get the dataPipelineNativeCloudConnection property: The native cloud connection configuration. - * - * @return the dataPipelineNativeCloudConnection value. - */ - public DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection dataPipelineNativeCloudConnection() { - return this.dataPipelineNativeCloudConnection; - } - - /** - * Set the dataPipelineNativeCloudConnection property: The native cloud connection configuration. - * - * @param dataPipelineNativeCloudConnection the dataPipelineNativeCloudConnection value to set. - * @return the DefenderForContainersGcpOffering object itself. - */ - public DefenderForContainersGcpOffering withDataPipelineNativeCloudConnection( - DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection dataPipelineNativeCloudConnection) { - this.dataPipelineNativeCloudConnection = dataPipelineNativeCloudConnection; - return this; - } - - /** - * Get the enableAuditLogsAutoProvisioning property: Is audit logs data collection enabled. - * - * @return the enableAuditLogsAutoProvisioning value. - */ - public Boolean enableAuditLogsAutoProvisioning() { - return this.enableAuditLogsAutoProvisioning; - } - - /** - * Set the enableAuditLogsAutoProvisioning property: Is audit logs data collection enabled. - * - * @param enableAuditLogsAutoProvisioning the enableAuditLogsAutoProvisioning value to set. - * @return the DefenderForContainersGcpOffering object itself. - */ - public DefenderForContainersGcpOffering - withEnableAuditLogsAutoProvisioning(Boolean enableAuditLogsAutoProvisioning) { - this.enableAuditLogsAutoProvisioning = enableAuditLogsAutoProvisioning; - return this; - } - - /** - * Get the enableDefenderAgentAutoProvisioning property: Is Microsoft Defender for Cloud Kubernetes agent auto - * provisioning enabled. - * - * @return the enableDefenderAgentAutoProvisioning value. - */ - public Boolean enableDefenderAgentAutoProvisioning() { - return this.enableDefenderAgentAutoProvisioning; - } - - /** - * Set the enableDefenderAgentAutoProvisioning property: Is Microsoft Defender for Cloud Kubernetes agent auto - * provisioning enabled. - * - * @param enableDefenderAgentAutoProvisioning the enableDefenderAgentAutoProvisioning value to set. - * @return the DefenderForContainersGcpOffering object itself. - */ - public DefenderForContainersGcpOffering - withEnableDefenderAgentAutoProvisioning(Boolean enableDefenderAgentAutoProvisioning) { - this.enableDefenderAgentAutoProvisioning = enableDefenderAgentAutoProvisioning; - return this; - } - - /** - * Get the enablePolicyAgentAutoProvisioning property: Is Policy Kubernetes agent auto provisioning enabled. - * - * @return the enablePolicyAgentAutoProvisioning value. - */ - public Boolean enablePolicyAgentAutoProvisioning() { - return this.enablePolicyAgentAutoProvisioning; - } - - /** - * Set the enablePolicyAgentAutoProvisioning property: Is Policy Kubernetes agent auto provisioning enabled. - * - * @param enablePolicyAgentAutoProvisioning the enablePolicyAgentAutoProvisioning value to set. - * @return the DefenderForContainersGcpOffering object itself. - */ - public DefenderForContainersGcpOffering - withEnablePolicyAgentAutoProvisioning(Boolean enablePolicyAgentAutoProvisioning) { - this.enablePolicyAgentAutoProvisioning = enablePolicyAgentAutoProvisioning; - return this; - } - - /** - * Get the mdcContainersImageAssessment property: The Microsoft Defender Container image assessment configuration. - * - * @return the mdcContainersImageAssessment value. - */ - public DefenderForContainersGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment() { - return this.mdcContainersImageAssessment; - } - - /** - * Set the mdcContainersImageAssessment property: The Microsoft Defender Container image assessment configuration. - * - * @param mdcContainersImageAssessment the mdcContainersImageAssessment value to set. - * @return the DefenderForContainersGcpOffering object itself. - */ - public DefenderForContainersGcpOffering withMdcContainersImageAssessment( - DefenderForContainersGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment) { - this.mdcContainersImageAssessment = mdcContainersImageAssessment; - return this; - } - - /** - * Get the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender Container agentless discovery - * configuration. - * - * @return the mdcContainersAgentlessDiscoveryK8S value. - */ - public DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S() { - return this.mdcContainersAgentlessDiscoveryK8S; - } - - /** - * Set the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender Container agentless discovery - * configuration. - * - * @param mdcContainersAgentlessDiscoveryK8S the mdcContainersAgentlessDiscoveryK8S value to set. - * @return the DefenderForContainersGcpOffering object itself. - */ - public DefenderForContainersGcpOffering withMdcContainersAgentlessDiscoveryK8S( - DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S) { - this.mdcContainersAgentlessDiscoveryK8S = mdcContainersAgentlessDiscoveryK8S; - return this; - } - - /** - * Get the vmScanners property: The Microsoft Defender for Container K8s VM host scanning configuration. - * - * @return the vmScanners value. - */ - public DefenderForContainersGcpOfferingVmScanners vmScanners() { - return this.vmScanners; - } - - /** - * Set the vmScanners property: The Microsoft Defender for Container K8s VM host scanning configuration. - * - * @param vmScanners the vmScanners value to set. - * @return the DefenderForContainersGcpOffering object itself. - */ - public DefenderForContainersGcpOffering withVmScanners(DefenderForContainersGcpOfferingVmScanners vmScanners) { - this.vmScanners = vmScanners; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (nativeCloudConnection() != null) { - nativeCloudConnection().validate(); - } - if (dataPipelineNativeCloudConnection() != null) { - dataPipelineNativeCloudConnection().validate(); - } - if (mdcContainersImageAssessment() != null) { - mdcContainersImageAssessment().validate(); - } - if (mdcContainersAgentlessDiscoveryK8S() != null) { - mdcContainersAgentlessDiscoveryK8S().validate(); - } - if (vmScanners() != null) { - vmScanners().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("nativeCloudConnection", this.nativeCloudConnection); - jsonWriter.writeJsonField("dataPipelineNativeCloudConnection", this.dataPipelineNativeCloudConnection); - jsonWriter.writeBooleanField("enableAuditLogsAutoProvisioning", this.enableAuditLogsAutoProvisioning); - jsonWriter.writeBooleanField("enableDefenderAgentAutoProvisioning", this.enableDefenderAgentAutoProvisioning); - jsonWriter.writeBooleanField("enablePolicyAgentAutoProvisioning", this.enablePolicyAgentAutoProvisioning); - jsonWriter.writeJsonField("mdcContainersImageAssessment", this.mdcContainersImageAssessment); - jsonWriter.writeJsonField("mdcContainersAgentlessDiscoveryK8s", this.mdcContainersAgentlessDiscoveryK8S); - jsonWriter.writeJsonField("vmScanners", this.vmScanners); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersGcpOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersGcpOffering 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 DefenderForContainersGcpOffering. - */ - public static DefenderForContainersGcpOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersGcpOffering deserializedDefenderForContainersGcpOffering - = new DefenderForContainersGcpOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderForContainersGcpOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderForContainersGcpOffering.offeringType - = OfferingType.fromString(reader.getString()); - } else if ("nativeCloudConnection".equals(fieldName)) { - deserializedDefenderForContainersGcpOffering.nativeCloudConnection - = DefenderForContainersGcpOfferingNativeCloudConnection.fromJson(reader); - } else if ("dataPipelineNativeCloudConnection".equals(fieldName)) { - deserializedDefenderForContainersGcpOffering.dataPipelineNativeCloudConnection - = DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.fromJson(reader); - } else if ("enableAuditLogsAutoProvisioning".equals(fieldName)) { - deserializedDefenderForContainersGcpOffering.enableAuditLogsAutoProvisioning - = reader.getNullable(JsonReader::getBoolean); - } else if ("enableDefenderAgentAutoProvisioning".equals(fieldName)) { - deserializedDefenderForContainersGcpOffering.enableDefenderAgentAutoProvisioning - = reader.getNullable(JsonReader::getBoolean); - } else if ("enablePolicyAgentAutoProvisioning".equals(fieldName)) { - deserializedDefenderForContainersGcpOffering.enablePolicyAgentAutoProvisioning - = reader.getNullable(JsonReader::getBoolean); - } else if ("mdcContainersImageAssessment".equals(fieldName)) { - deserializedDefenderForContainersGcpOffering.mdcContainersImageAssessment - = DefenderForContainersGcpOfferingMdcContainersImageAssessment.fromJson(reader); - } else if ("mdcContainersAgentlessDiscoveryK8s".equals(fieldName)) { - deserializedDefenderForContainersGcpOffering.mdcContainersAgentlessDiscoveryK8S - = DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S.fromJson(reader); - } else if ("vmScanners".equals(fieldName)) { - deserializedDefenderForContainersGcpOffering.vmScanners - = DefenderForContainersGcpOfferingVmScanners.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersGcpOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.java deleted file mode 100644 index e5d173c1c120..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 native cloud connection configuration. - */ -@Fluent -public final class DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection - implements JsonSerializable { - /* - * The data collection service account email address in GCP for this offering - */ - private String serviceAccountEmailAddress; - - /* - * The data collection GCP workload identity provider id for this offering - */ - private String workloadIdentityProviderId; - - /** - * Creates an instance of DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection class. - */ - public DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection() { - } - - /** - * Get the serviceAccountEmailAddress property: The data collection service account email address in GCP for this - * offering. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The data collection service account email address in GCP for this - * offering. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection object itself. - */ - public DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection - withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The data collection GCP workload identity provider id for this - * offering. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The data collection GCP workload identity provider id for this - * offering. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection object itself. - */ - public DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection - withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - 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("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection 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 - * DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection. - */ - public static DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection deserializedDefenderForContainersGcpOfferingDataPipelineNativeCloudConnection - = new DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.serviceAccountEmailAddress - = reader.getString(); - } else if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.workloadIdentityProviderId - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersGcpOfferingDataPipelineNativeCloudConnection; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S.java deleted file mode 100644 index e61739d37f67..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 Microsoft Defender Container agentless discovery configuration. - */ -@Fluent -public final class DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S - implements JsonSerializable { - /* - * Is Microsoft Defender container agentless discovery enabled - */ - private Boolean enabled; - - /* - * The workload identity provider id in GCP for this feature - */ - private String workloadIdentityProviderId; - - /* - * The service account email address in GCP for this feature - */ - private String serviceAccountEmailAddress; - - /** - * Creates an instance of DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S class. - */ - public DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S() { - } - - /** - * Get the enabled property: Is Microsoft Defender container agentless discovery enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender container agentless discovery enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S object itself. - */ - public DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S object itself. - */ - public DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S - withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S object itself. - */ - public DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S - withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - 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("enabled", this.enabled); - jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); - jsonWriter.writeStringField("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S 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 - * DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S. - */ - public static DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S deserializedDefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S - = new DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S.workloadIdentityProviderId - = reader.getString(); - } else if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S.serviceAccountEmailAddress - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersImageAssessment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersImageAssessment.java deleted file mode 100644 index 81924b7c3b8d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingMdcContainersImageAssessment.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 Microsoft Defender Container image assessment configuration. - */ -@Fluent -public final class DefenderForContainersGcpOfferingMdcContainersImageAssessment - implements JsonSerializable { - /* - * Is Microsoft Defender container image assessment enabled - */ - private Boolean enabled; - - /* - * The workload identity provider id in GCP for this feature - */ - private String workloadIdentityProviderId; - - /* - * The service account email address in GCP for this feature - */ - private String serviceAccountEmailAddress; - - /** - * Creates an instance of DefenderForContainersGcpOfferingMdcContainersImageAssessment class. - */ - public DefenderForContainersGcpOfferingMdcContainersImageAssessment() { - } - - /** - * Get the enabled property: Is Microsoft Defender container image assessment enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender container image assessment enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForContainersGcpOfferingMdcContainersImageAssessment object itself. - */ - public DefenderForContainersGcpOfferingMdcContainersImageAssessment withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderForContainersGcpOfferingMdcContainersImageAssessment object itself. - */ - public DefenderForContainersGcpOfferingMdcContainersImageAssessment - withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderForContainersGcpOfferingMdcContainersImageAssessment object itself. - */ - public DefenderForContainersGcpOfferingMdcContainersImageAssessment - withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - 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("enabled", this.enabled); - jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); - jsonWriter.writeStringField("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersGcpOfferingMdcContainersImageAssessment from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersGcpOfferingMdcContainersImageAssessment 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 - * DefenderForContainersGcpOfferingMdcContainersImageAssessment. - */ - public static DefenderForContainersGcpOfferingMdcContainersImageAssessment fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersGcpOfferingMdcContainersImageAssessment deserializedDefenderForContainersGcpOfferingMdcContainersImageAssessment - = new DefenderForContainersGcpOfferingMdcContainersImageAssessment(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingMdcContainersImageAssessment.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingMdcContainersImageAssessment.workloadIdentityProviderId - = reader.getString(); - } else if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingMdcContainersImageAssessment.serviceAccountEmailAddress - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersGcpOfferingMdcContainersImageAssessment; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingNativeCloudConnection.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingNativeCloudConnection.java deleted file mode 100644 index 7db5f7b198ec..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingNativeCloudConnection.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 native cloud connection configuration. - */ -@Fluent -public final class DefenderForContainersGcpOfferingNativeCloudConnection - implements JsonSerializable { - /* - * The service account email address in GCP for this offering - */ - private String serviceAccountEmailAddress; - - /* - * The GCP workload identity provider id for this offering - */ - private String workloadIdentityProviderId; - - /** - * Creates an instance of DefenderForContainersGcpOfferingNativeCloudConnection class. - */ - public DefenderForContainersGcpOfferingNativeCloudConnection() { - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this offering. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this offering. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderForContainersGcpOfferingNativeCloudConnection object itself. - */ - public DefenderForContainersGcpOfferingNativeCloudConnection - withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The GCP workload identity provider id for this offering. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The GCP workload identity provider id for this offering. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderForContainersGcpOfferingNativeCloudConnection object itself. - */ - public DefenderForContainersGcpOfferingNativeCloudConnection - withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - 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("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersGcpOfferingNativeCloudConnection from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersGcpOfferingNativeCloudConnection 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 DefenderForContainersGcpOfferingNativeCloudConnection. - */ - public static DefenderForContainersGcpOfferingNativeCloudConnection fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersGcpOfferingNativeCloudConnection deserializedDefenderForContainersGcpOfferingNativeCloudConnection - = new DefenderForContainersGcpOfferingNativeCloudConnection(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingNativeCloudConnection.serviceAccountEmailAddress - = reader.getString(); - } else if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingNativeCloudConnection.workloadIdentityProviderId - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersGcpOfferingNativeCloudConnection; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingVmScanners.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingVmScanners.java deleted file mode 100644 index f269f23e6c48..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingVmScanners.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender for Container K8s VM host scanning configuration. - */ -@Fluent -public final class DefenderForContainersGcpOfferingVmScanners extends VmScannersGcp { - /** - * Creates an instance of DefenderForContainersGcpOfferingVmScanners class. - */ - public DefenderForContainersGcpOfferingVmScanners() { - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForContainersGcpOfferingVmScanners withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForContainersGcpOfferingVmScanners withConfiguration(VmScannersBaseConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersGcpOfferingVmScanners from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersGcpOfferingVmScanners 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 DefenderForContainersGcpOfferingVmScanners. - */ - public static DefenderForContainersGcpOfferingVmScanners fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersGcpOfferingVmScanners deserializedDefenderForContainersGcpOfferingVmScanners - = new DefenderForContainersGcpOfferingVmScanners(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingVmScanners - .withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForContainersGcpOfferingVmScanners - .withConfiguration(VmScannersBaseConfiguration.fromJson(reader)); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersGcpOfferingVmScanners; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersJFrogOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersJFrogOffering.java deleted file mode 100644 index 30d5c4c8fdec..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersJFrogOffering.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Defender for Containers for JFrog Artifactory offering. - */ -@Immutable -public final class DefenderForContainersJFrogOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_FOR_CONTAINERS_JFROG; - - /** - * Creates an instance of DefenderForContainersJFrogOffering class. - */ - public DefenderForContainersJFrogOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForContainersJFrogOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForContainersJFrogOffering 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 DefenderForContainersJFrogOffering. - */ - public static DefenderForContainersJFrogOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForContainersJFrogOffering deserializedDefenderForContainersJFrogOffering - = new DefenderForContainersJFrogOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderForContainersJFrogOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderForContainersJFrogOffering.offeringType - = OfferingType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForContainersJFrogOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOffering.java deleted file mode 100644 index e0cb25b08574..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOffering.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Defender for Databases GCP offering configurations. - */ -@Fluent -public final class DefenderForDatabasesGcpOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_FOR_DATABASES_GCP; - - /* - * The ARC autoprovisioning configuration - */ - private DefenderForDatabasesGcpOfferingArcAutoProvisioning arcAutoProvisioning; - - /* - * The native cloud connection configuration - */ - private DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning defenderForDatabasesArcAutoProvisioning; - - /** - * Creates an instance of DefenderForDatabasesGcpOffering class. - */ - public DefenderForDatabasesGcpOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Get the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @return the arcAutoProvisioning value. - */ - public DefenderForDatabasesGcpOfferingArcAutoProvisioning arcAutoProvisioning() { - return this.arcAutoProvisioning; - } - - /** - * Set the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @param arcAutoProvisioning the arcAutoProvisioning value to set. - * @return the DefenderForDatabasesGcpOffering object itself. - */ - public DefenderForDatabasesGcpOffering - withArcAutoProvisioning(DefenderForDatabasesGcpOfferingArcAutoProvisioning arcAutoProvisioning) { - this.arcAutoProvisioning = arcAutoProvisioning; - return this; - } - - /** - * Get the defenderForDatabasesArcAutoProvisioning property: The native cloud connection configuration. - * - * @return the defenderForDatabasesArcAutoProvisioning value. - */ - public DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning - defenderForDatabasesArcAutoProvisioning() { - return this.defenderForDatabasesArcAutoProvisioning; - } - - /** - * Set the defenderForDatabasesArcAutoProvisioning property: The native cloud connection configuration. - * - * @param defenderForDatabasesArcAutoProvisioning the defenderForDatabasesArcAutoProvisioning value to set. - * @return the DefenderForDatabasesGcpOffering object itself. - */ - public DefenderForDatabasesGcpOffering withDefenderForDatabasesArcAutoProvisioning( - DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning defenderForDatabasesArcAutoProvisioning) { - this.defenderForDatabasesArcAutoProvisioning = defenderForDatabasesArcAutoProvisioning; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (arcAutoProvisioning() != null) { - arcAutoProvisioning().validate(); - } - if (defenderForDatabasesArcAutoProvisioning() != null) { - defenderForDatabasesArcAutoProvisioning().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("arcAutoProvisioning", this.arcAutoProvisioning); - jsonWriter.writeJsonField("defenderForDatabasesArcAutoProvisioning", - this.defenderForDatabasesArcAutoProvisioning); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForDatabasesGcpOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForDatabasesGcpOffering 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 DefenderForDatabasesGcpOffering. - */ - public static DefenderForDatabasesGcpOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForDatabasesGcpOffering deserializedDefenderForDatabasesGcpOffering - = new DefenderForDatabasesGcpOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderForDatabasesGcpOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderForDatabasesGcpOffering.offeringType - = OfferingType.fromString(reader.getString()); - } else if ("arcAutoProvisioning".equals(fieldName)) { - deserializedDefenderForDatabasesGcpOffering.arcAutoProvisioning - = DefenderForDatabasesGcpOfferingArcAutoProvisioning.fromJson(reader); - } else if ("defenderForDatabasesArcAutoProvisioning".equals(fieldName)) { - deserializedDefenderForDatabasesGcpOffering.defenderForDatabasesArcAutoProvisioning - = DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForDatabasesGcpOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingArcAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingArcAutoProvisioning.java deleted file mode 100644 index 254eae105233..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingArcAutoProvisioning.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ARC autoprovisioning configuration. - */ -@Fluent -public final class DefenderForDatabasesGcpOfferingArcAutoProvisioning extends ArcAutoProvisioningGcp { - /** - * Creates an instance of DefenderForDatabasesGcpOfferingArcAutoProvisioning class. - */ - public DefenderForDatabasesGcpOfferingArcAutoProvisioning() { - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForDatabasesGcpOfferingArcAutoProvisioning withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForDatabasesGcpOfferingArcAutoProvisioning - withConfiguration(ArcAutoProvisioningConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForDatabasesGcpOfferingArcAutoProvisioning from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForDatabasesGcpOfferingArcAutoProvisioning 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 DefenderForDatabasesGcpOfferingArcAutoProvisioning. - */ - public static DefenderForDatabasesGcpOfferingArcAutoProvisioning fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForDatabasesGcpOfferingArcAutoProvisioning deserializedDefenderForDatabasesGcpOfferingArcAutoProvisioning - = new DefenderForDatabasesGcpOfferingArcAutoProvisioning(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForDatabasesGcpOfferingArcAutoProvisioning - .withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForDatabasesGcpOfferingArcAutoProvisioning - .withConfiguration(ArcAutoProvisioningConfiguration.fromJson(reader)); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForDatabasesGcpOfferingArcAutoProvisioning; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning.java deleted file mode 100644 index be22f3fad84d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 native cloud connection configuration. - */ -@Fluent -public final class DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning - implements JsonSerializable { - /* - * The service account email address in GCP for this offering - */ - private String serviceAccountEmailAddress; - - /* - * The GCP workload identity provider id for this offering - */ - private String workloadIdentityProviderId; - - /** - * Creates an instance of DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning class. - */ - public DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning() { - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this offering. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this offering. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning object itself. - */ - public DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning - withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The GCP workload identity provider id for this offering. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The GCP workload identity provider id for this offering. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning object itself. - */ - public DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning - withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - 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("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning 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 - * DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning. - */ - public static DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning deserializedDefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning - = new DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedDefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning.serviceAccountEmailAddress - = reader.getString(); - } else if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedDefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning.workloadIdentityProviderId - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOffering.java deleted file mode 100644 index 1c615386ecfb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOffering.java +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Defender for Servers AWS offering. - */ -@Fluent -public final class DefenderForServersAwsOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_FOR_SERVERS_AWS; - - /* - * The Defender for servers connection configuration - */ - private DefenderForServersAwsOfferingDefenderForServers defenderForServers; - - /* - * The ARC autoprovisioning configuration - */ - private DefenderForServersAwsOfferingArcAutoProvisioning arcAutoProvisioning; - - /* - * The Vulnerability Assessment autoprovisioning configuration - */ - private DefenderForServersAwsOfferingVaAutoProvisioning vaAutoProvisioning; - - /* - * The Microsoft Defender for Endpoint autoprovisioning configuration - */ - private DefenderForServersAwsOfferingMdeAutoProvisioning mdeAutoProvisioning; - - /* - * configuration for the servers offering subPlan - */ - private DefenderForServersAwsOfferingSubPlan subPlan; - - /* - * The Microsoft Defender for Server VM scanning configuration - */ - private DefenderForServersAwsOfferingVmScanners vmScanners; - - /** - * Creates an instance of DefenderForServersAwsOffering class. - */ - public DefenderForServersAwsOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Get the defenderForServers property: The Defender for servers connection configuration. - * - * @return the defenderForServers value. - */ - public DefenderForServersAwsOfferingDefenderForServers defenderForServers() { - return this.defenderForServers; - } - - /** - * Set the defenderForServers property: The Defender for servers connection configuration. - * - * @param defenderForServers the defenderForServers value to set. - * @return the DefenderForServersAwsOffering object itself. - */ - public DefenderForServersAwsOffering - withDefenderForServers(DefenderForServersAwsOfferingDefenderForServers defenderForServers) { - this.defenderForServers = defenderForServers; - return this; - } - - /** - * Get the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @return the arcAutoProvisioning value. - */ - public DefenderForServersAwsOfferingArcAutoProvisioning arcAutoProvisioning() { - return this.arcAutoProvisioning; - } - - /** - * Set the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @param arcAutoProvisioning the arcAutoProvisioning value to set. - * @return the DefenderForServersAwsOffering object itself. - */ - public DefenderForServersAwsOffering - withArcAutoProvisioning(DefenderForServersAwsOfferingArcAutoProvisioning arcAutoProvisioning) { - this.arcAutoProvisioning = arcAutoProvisioning; - return this; - } - - /** - * Get the vaAutoProvisioning property: The Vulnerability Assessment autoprovisioning configuration. - * - * @return the vaAutoProvisioning value. - */ - public DefenderForServersAwsOfferingVaAutoProvisioning vaAutoProvisioning() { - return this.vaAutoProvisioning; - } - - /** - * Set the vaAutoProvisioning property: The Vulnerability Assessment autoprovisioning configuration. - * - * @param vaAutoProvisioning the vaAutoProvisioning value to set. - * @return the DefenderForServersAwsOffering object itself. - */ - public DefenderForServersAwsOffering - withVaAutoProvisioning(DefenderForServersAwsOfferingVaAutoProvisioning vaAutoProvisioning) { - this.vaAutoProvisioning = vaAutoProvisioning; - return this; - } - - /** - * Get the mdeAutoProvisioning property: The Microsoft Defender for Endpoint autoprovisioning configuration. - * - * @return the mdeAutoProvisioning value. - */ - public DefenderForServersAwsOfferingMdeAutoProvisioning mdeAutoProvisioning() { - return this.mdeAutoProvisioning; - } - - /** - * Set the mdeAutoProvisioning property: The Microsoft Defender for Endpoint autoprovisioning configuration. - * - * @param mdeAutoProvisioning the mdeAutoProvisioning value to set. - * @return the DefenderForServersAwsOffering object itself. - */ - public DefenderForServersAwsOffering - withMdeAutoProvisioning(DefenderForServersAwsOfferingMdeAutoProvisioning mdeAutoProvisioning) { - this.mdeAutoProvisioning = mdeAutoProvisioning; - return this; - } - - /** - * Get the subPlan property: configuration for the servers offering subPlan. - * - * @return the subPlan value. - */ - public DefenderForServersAwsOfferingSubPlan subPlan() { - return this.subPlan; - } - - /** - * Set the subPlan property: configuration for the servers offering subPlan. - * - * @param subPlan the subPlan value to set. - * @return the DefenderForServersAwsOffering object itself. - */ - public DefenderForServersAwsOffering withSubPlan(DefenderForServersAwsOfferingSubPlan subPlan) { - this.subPlan = subPlan; - return this; - } - - /** - * Get the vmScanners property: The Microsoft Defender for Server VM scanning configuration. - * - * @return the vmScanners value. - */ - public DefenderForServersAwsOfferingVmScanners vmScanners() { - return this.vmScanners; - } - - /** - * Set the vmScanners property: The Microsoft Defender for Server VM scanning configuration. - * - * @param vmScanners the vmScanners value to set. - * @return the DefenderForServersAwsOffering object itself. - */ - public DefenderForServersAwsOffering withVmScanners(DefenderForServersAwsOfferingVmScanners vmScanners) { - this.vmScanners = vmScanners; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (defenderForServers() != null) { - defenderForServers().validate(); - } - if (arcAutoProvisioning() != null) { - arcAutoProvisioning().validate(); - } - if (vaAutoProvisioning() != null) { - vaAutoProvisioning().validate(); - } - if (mdeAutoProvisioning() != null) { - mdeAutoProvisioning().validate(); - } - if (subPlan() != null) { - subPlan().validate(); - } - if (vmScanners() != null) { - vmScanners().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("defenderForServers", this.defenderForServers); - jsonWriter.writeJsonField("arcAutoProvisioning", this.arcAutoProvisioning); - jsonWriter.writeJsonField("vaAutoProvisioning", this.vaAutoProvisioning); - jsonWriter.writeJsonField("mdeAutoProvisioning", this.mdeAutoProvisioning); - jsonWriter.writeJsonField("subPlan", this.subPlan); - jsonWriter.writeJsonField("vmScanners", this.vmScanners); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersAwsOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersAwsOffering 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 DefenderForServersAwsOffering. - */ - public static DefenderForServersAwsOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersAwsOffering deserializedDefenderForServersAwsOffering - = new DefenderForServersAwsOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderForServersAwsOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderForServersAwsOffering.offeringType - = OfferingType.fromString(reader.getString()); - } else if ("defenderForServers".equals(fieldName)) { - deserializedDefenderForServersAwsOffering.defenderForServers - = DefenderForServersAwsOfferingDefenderForServers.fromJson(reader); - } else if ("arcAutoProvisioning".equals(fieldName)) { - deserializedDefenderForServersAwsOffering.arcAutoProvisioning - = DefenderForServersAwsOfferingArcAutoProvisioning.fromJson(reader); - } else if ("vaAutoProvisioning".equals(fieldName)) { - deserializedDefenderForServersAwsOffering.vaAutoProvisioning - = DefenderForServersAwsOfferingVaAutoProvisioning.fromJson(reader); - } else if ("mdeAutoProvisioning".equals(fieldName)) { - deserializedDefenderForServersAwsOffering.mdeAutoProvisioning - = DefenderForServersAwsOfferingMdeAutoProvisioning.fromJson(reader); - } else if ("subPlan".equals(fieldName)) { - deserializedDefenderForServersAwsOffering.subPlan - = DefenderForServersAwsOfferingSubPlan.fromJson(reader); - } else if ("vmScanners".equals(fieldName)) { - deserializedDefenderForServersAwsOffering.vmScanners - = DefenderForServersAwsOfferingVmScanners.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersAwsOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioning.java deleted file mode 100644 index b0235c5faf3a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioning.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ARC autoprovisioning configuration. - */ -@Fluent -public final class DefenderForServersAwsOfferingArcAutoProvisioning extends ArcAutoProvisioningAws { - /** - * Creates an instance of DefenderForServersAwsOfferingArcAutoProvisioning class. - */ - public DefenderForServersAwsOfferingArcAutoProvisioning() { - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForServersAwsOfferingArcAutoProvisioning withCloudRoleArn(String cloudRoleArn) { - super.withCloudRoleArn(cloudRoleArn); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForServersAwsOfferingArcAutoProvisioning withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForServersAwsOfferingArcAutoProvisioning - withConfiguration(ArcAutoProvisioningConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - jsonWriter.writeStringField("cloudRoleArn", cloudRoleArn()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersAwsOfferingArcAutoProvisioning from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersAwsOfferingArcAutoProvisioning 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 DefenderForServersAwsOfferingArcAutoProvisioning. - */ - public static DefenderForServersAwsOfferingArcAutoProvisioning fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersAwsOfferingArcAutoProvisioning deserializedDefenderForServersAwsOfferingArcAutoProvisioning - = new DefenderForServersAwsOfferingArcAutoProvisioning(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingArcAutoProvisioning - .withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingArcAutoProvisioning - .withConfiguration(ArcAutoProvisioningConfiguration.fromJson(reader)); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingArcAutoProvisioning.withCloudRoleArn(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersAwsOfferingArcAutoProvisioning; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingDefenderForServers.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingDefenderForServers.java deleted file mode 100644 index c4b874afcd07..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingDefenderForServers.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 Defender for servers connection configuration. - */ -@Fluent -public final class DefenderForServersAwsOfferingDefenderForServers - implements JsonSerializable { - /* - * The cloud role ARN in AWS for this feature - */ - private String cloudRoleArn; - - /** - * Creates an instance of DefenderForServersAwsOfferingDefenderForServers class. - */ - public DefenderForServersAwsOfferingDefenderForServers() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderForServersAwsOfferingDefenderForServers object itself. - */ - public DefenderForServersAwsOfferingDefenderForServers withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - 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("cloudRoleArn", this.cloudRoleArn); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersAwsOfferingDefenderForServers from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersAwsOfferingDefenderForServers 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 DefenderForServersAwsOfferingDefenderForServers. - */ - public static DefenderForServersAwsOfferingDefenderForServers fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersAwsOfferingDefenderForServers deserializedDefenderForServersAwsOfferingDefenderForServers - = new DefenderForServersAwsOfferingDefenderForServers(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingDefenderForServers.cloudRoleArn = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersAwsOfferingDefenderForServers; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingMdeAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingMdeAutoProvisioning.java deleted file mode 100644 index ae44fbc78966..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingMdeAutoProvisioning.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 Microsoft Defender for Endpoint autoprovisioning configuration. - */ -@Fluent -public final class DefenderForServersAwsOfferingMdeAutoProvisioning - implements JsonSerializable { - /* - * Is Microsoft Defender for Endpoint auto provisioning enabled - */ - private Boolean enabled; - - /* - * configuration for Microsoft Defender for Endpoint autoprovisioning - */ - private Object configuration; - - /** - * Creates an instance of DefenderForServersAwsOfferingMdeAutoProvisioning class. - */ - public DefenderForServersAwsOfferingMdeAutoProvisioning() { - } - - /** - * Get the enabled property: Is Microsoft Defender for Endpoint auto provisioning enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender for Endpoint auto provisioning enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForServersAwsOfferingMdeAutoProvisioning object itself. - */ - public DefenderForServersAwsOfferingMdeAutoProvisioning withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the configuration property: configuration for Microsoft Defender for Endpoint autoprovisioning. - * - * @return the configuration value. - */ - public Object configuration() { - return this.configuration; - } - - /** - * Set the configuration property: configuration for Microsoft Defender for Endpoint autoprovisioning. - * - * @param configuration the configuration value to set. - * @return the DefenderForServersAwsOfferingMdeAutoProvisioning object itself. - */ - public DefenderForServersAwsOfferingMdeAutoProvisioning withConfiguration(Object configuration) { - this.configuration = configuration; - 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("enabled", this.enabled); - if (this.configuration != null) { - jsonWriter.writeUntypedField("configuration", this.configuration); - } - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersAwsOfferingMdeAutoProvisioning from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersAwsOfferingMdeAutoProvisioning 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 DefenderForServersAwsOfferingMdeAutoProvisioning. - */ - public static DefenderForServersAwsOfferingMdeAutoProvisioning fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersAwsOfferingMdeAutoProvisioning deserializedDefenderForServersAwsOfferingMdeAutoProvisioning - = new DefenderForServersAwsOfferingMdeAutoProvisioning(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingMdeAutoProvisioning.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingMdeAutoProvisioning.configuration = reader.readUntyped(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersAwsOfferingMdeAutoProvisioning; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingSubPlan.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingSubPlan.java deleted file mode 100644 index 38d813b0b053..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingSubPlan.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * configuration for the servers offering subPlan. - */ -@Fluent -public final class DefenderForServersAwsOfferingSubPlan - implements JsonSerializable { - /* - * The available sub plans - */ - private SubPlan type; - - /** - * Creates an instance of DefenderForServersAwsOfferingSubPlan class. - */ - public DefenderForServersAwsOfferingSubPlan() { - } - - /** - * Get the type property: The available sub plans. - * - * @return the type value. - */ - public SubPlan type() { - return this.type; - } - - /** - * Set the type property: The available sub plans. - * - * @param type the type value to set. - * @return the DefenderForServersAwsOfferingSubPlan object itself. - */ - public DefenderForServersAwsOfferingSubPlan withType(SubPlan type) { - this.type = type; - 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("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersAwsOfferingSubPlan from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersAwsOfferingSubPlan 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 DefenderForServersAwsOfferingSubPlan. - */ - public static DefenderForServersAwsOfferingSubPlan fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersAwsOfferingSubPlan deserializedDefenderForServersAwsOfferingSubPlan - = new DefenderForServersAwsOfferingSubPlan(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingSubPlan.type = SubPlan.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersAwsOfferingSubPlan; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVaAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVaAutoProvisioning.java deleted file mode 100644 index 68adb7597064..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVaAutoProvisioning.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 Vulnerability Assessment autoprovisioning configuration. - */ -@Fluent -public final class DefenderForServersAwsOfferingVaAutoProvisioning - implements JsonSerializable { - /* - * Is Vulnerability Assessment auto provisioning enabled - */ - private Boolean enabled; - - /* - * configuration for Vulnerability Assessment autoprovisioning - */ - private DefenderForServersAwsOfferingVaAutoProvisioningConfiguration configuration; - - /** - * Creates an instance of DefenderForServersAwsOfferingVaAutoProvisioning class. - */ - public DefenderForServersAwsOfferingVaAutoProvisioning() { - } - - /** - * Get the enabled property: Is Vulnerability Assessment auto provisioning enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Vulnerability Assessment auto provisioning enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForServersAwsOfferingVaAutoProvisioning object itself. - */ - public DefenderForServersAwsOfferingVaAutoProvisioning withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the configuration property: configuration for Vulnerability Assessment autoprovisioning. - * - * @return the configuration value. - */ - public DefenderForServersAwsOfferingVaAutoProvisioningConfiguration configuration() { - return this.configuration; - } - - /** - * Set the configuration property: configuration for Vulnerability Assessment autoprovisioning. - * - * @param configuration the configuration value to set. - * @return the DefenderForServersAwsOfferingVaAutoProvisioning object itself. - */ - public DefenderForServersAwsOfferingVaAutoProvisioning - withConfiguration(DefenderForServersAwsOfferingVaAutoProvisioningConfiguration configuration) { - this.configuration = configuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeJsonField("configuration", this.configuration); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersAwsOfferingVaAutoProvisioning from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersAwsOfferingVaAutoProvisioning 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 DefenderForServersAwsOfferingVaAutoProvisioning. - */ - public static DefenderForServersAwsOfferingVaAutoProvisioning fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersAwsOfferingVaAutoProvisioning deserializedDefenderForServersAwsOfferingVaAutoProvisioning - = new DefenderForServersAwsOfferingVaAutoProvisioning(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingVaAutoProvisioning.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingVaAutoProvisioning.configuration - = DefenderForServersAwsOfferingVaAutoProvisioningConfiguration.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersAwsOfferingVaAutoProvisioning; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVaAutoProvisioningConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVaAutoProvisioningConfiguration.java deleted file mode 100644 index 37f6842aeda2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVaAutoProvisioningConfiguration.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * configuration for Vulnerability Assessment autoprovisioning. - */ -@Fluent -public final class DefenderForServersAwsOfferingVaAutoProvisioningConfiguration - implements JsonSerializable { - /* - * The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys' - */ - private Type type; - - /** - * Creates an instance of DefenderForServersAwsOfferingVaAutoProvisioningConfiguration class. - */ - public DefenderForServersAwsOfferingVaAutoProvisioningConfiguration() { - } - - /** - * Get the type property: The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. - * - * @return the type value. - */ - public Type type() { - return this.type; - } - - /** - * Set the type property: The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. - * - * @param type the type value to set. - * @return the DefenderForServersAwsOfferingVaAutoProvisioningConfiguration object itself. - */ - public DefenderForServersAwsOfferingVaAutoProvisioningConfiguration withType(Type type) { - this.type = type; - 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("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersAwsOfferingVaAutoProvisioningConfiguration from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersAwsOfferingVaAutoProvisioningConfiguration 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 - * DefenderForServersAwsOfferingVaAutoProvisioningConfiguration. - */ - public static DefenderForServersAwsOfferingVaAutoProvisioningConfiguration fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersAwsOfferingVaAutoProvisioningConfiguration deserializedDefenderForServersAwsOfferingVaAutoProvisioningConfiguration - = new DefenderForServersAwsOfferingVaAutoProvisioningConfiguration(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingVaAutoProvisioningConfiguration.type - = Type.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersAwsOfferingVaAutoProvisioningConfiguration; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVmScanners.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVmScanners.java deleted file mode 100644 index 519eb19db606..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVmScanners.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender for Server VM scanning configuration. - */ -@Fluent -public final class DefenderForServersAwsOfferingVmScanners extends VmScannersAws { - /** - * Creates an instance of DefenderForServersAwsOfferingVmScanners class. - */ - public DefenderForServersAwsOfferingVmScanners() { - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForServersAwsOfferingVmScanners withCloudRoleArn(String cloudRoleArn) { - super.withCloudRoleArn(cloudRoleArn); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForServersAwsOfferingVmScanners withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForServersAwsOfferingVmScanners withConfiguration(VmScannersBaseConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - jsonWriter.writeStringField("cloudRoleArn", cloudRoleArn()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersAwsOfferingVmScanners from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersAwsOfferingVmScanners 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 DefenderForServersAwsOfferingVmScanners. - */ - public static DefenderForServersAwsOfferingVmScanners fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersAwsOfferingVmScanners deserializedDefenderForServersAwsOfferingVmScanners - = new DefenderForServersAwsOfferingVmScanners(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingVmScanners - .withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingVmScanners - .withConfiguration(VmScannersBaseConfiguration.fromJson(reader)); - } else if ("cloudRoleArn".equals(fieldName)) { - deserializedDefenderForServersAwsOfferingVmScanners.withCloudRoleArn(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersAwsOfferingVmScanners; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOffering.java deleted file mode 100644 index 567ad0cec0fc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOffering.java +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Defender for Servers GCP offering configurations. - */ -@Fluent -public final class DefenderForServersGcpOffering extends CloudOffering { - /* - * The type of the security offering. - */ - private OfferingType offeringType = OfferingType.DEFENDER_FOR_SERVERS_GCP; - - /* - * The Defender for servers connection configuration - */ - private DefenderForServersGcpOfferingDefenderForServers defenderForServers; - - /* - * The ARC autoprovisioning configuration - */ - private DefenderForServersGcpOfferingArcAutoProvisioning arcAutoProvisioning; - - /* - * The Vulnerability Assessment autoprovisioning configuration - */ - private DefenderForServersGcpOfferingVaAutoProvisioning vaAutoProvisioning; - - /* - * The Microsoft Defender for Endpoint autoprovisioning configuration - */ - private DefenderForServersGcpOfferingMdeAutoProvisioning mdeAutoProvisioning; - - /* - * configuration for the servers offering subPlan - */ - private DefenderForServersGcpOfferingSubPlan subPlan; - - /* - * The Microsoft Defender for Server VM scanning configuration - */ - private DefenderForServersGcpOfferingVmScanners vmScanners; - - /** - * Creates an instance of DefenderForServersGcpOffering class. - */ - public DefenderForServersGcpOffering() { - } - - /** - * Get the offeringType property: The type of the security offering. - * - * @return the offeringType value. - */ - @Override - public OfferingType offeringType() { - return this.offeringType; - } - - /** - * Get the defenderForServers property: The Defender for servers connection configuration. - * - * @return the defenderForServers value. - */ - public DefenderForServersGcpOfferingDefenderForServers defenderForServers() { - return this.defenderForServers; - } - - /** - * Set the defenderForServers property: The Defender for servers connection configuration. - * - * @param defenderForServers the defenderForServers value to set. - * @return the DefenderForServersGcpOffering object itself. - */ - public DefenderForServersGcpOffering - withDefenderForServers(DefenderForServersGcpOfferingDefenderForServers defenderForServers) { - this.defenderForServers = defenderForServers; - return this; - } - - /** - * Get the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @return the arcAutoProvisioning value. - */ - public DefenderForServersGcpOfferingArcAutoProvisioning arcAutoProvisioning() { - return this.arcAutoProvisioning; - } - - /** - * Set the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @param arcAutoProvisioning the arcAutoProvisioning value to set. - * @return the DefenderForServersGcpOffering object itself. - */ - public DefenderForServersGcpOffering - withArcAutoProvisioning(DefenderForServersGcpOfferingArcAutoProvisioning arcAutoProvisioning) { - this.arcAutoProvisioning = arcAutoProvisioning; - return this; - } - - /** - * Get the vaAutoProvisioning property: The Vulnerability Assessment autoprovisioning configuration. - * - * @return the vaAutoProvisioning value. - */ - public DefenderForServersGcpOfferingVaAutoProvisioning vaAutoProvisioning() { - return this.vaAutoProvisioning; - } - - /** - * Set the vaAutoProvisioning property: The Vulnerability Assessment autoprovisioning configuration. - * - * @param vaAutoProvisioning the vaAutoProvisioning value to set. - * @return the DefenderForServersGcpOffering object itself. - */ - public DefenderForServersGcpOffering - withVaAutoProvisioning(DefenderForServersGcpOfferingVaAutoProvisioning vaAutoProvisioning) { - this.vaAutoProvisioning = vaAutoProvisioning; - return this; - } - - /** - * Get the mdeAutoProvisioning property: The Microsoft Defender for Endpoint autoprovisioning configuration. - * - * @return the mdeAutoProvisioning value. - */ - public DefenderForServersGcpOfferingMdeAutoProvisioning mdeAutoProvisioning() { - return this.mdeAutoProvisioning; - } - - /** - * Set the mdeAutoProvisioning property: The Microsoft Defender for Endpoint autoprovisioning configuration. - * - * @param mdeAutoProvisioning the mdeAutoProvisioning value to set. - * @return the DefenderForServersGcpOffering object itself. - */ - public DefenderForServersGcpOffering - withMdeAutoProvisioning(DefenderForServersGcpOfferingMdeAutoProvisioning mdeAutoProvisioning) { - this.mdeAutoProvisioning = mdeAutoProvisioning; - return this; - } - - /** - * Get the subPlan property: configuration for the servers offering subPlan. - * - * @return the subPlan value. - */ - public DefenderForServersGcpOfferingSubPlan subPlan() { - return this.subPlan; - } - - /** - * Set the subPlan property: configuration for the servers offering subPlan. - * - * @param subPlan the subPlan value to set. - * @return the DefenderForServersGcpOffering object itself. - */ - public DefenderForServersGcpOffering withSubPlan(DefenderForServersGcpOfferingSubPlan subPlan) { - this.subPlan = subPlan; - return this; - } - - /** - * Get the vmScanners property: The Microsoft Defender for Server VM scanning configuration. - * - * @return the vmScanners value. - */ - public DefenderForServersGcpOfferingVmScanners vmScanners() { - return this.vmScanners; - } - - /** - * Set the vmScanners property: The Microsoft Defender for Server VM scanning configuration. - * - * @param vmScanners the vmScanners value to set. - * @return the DefenderForServersGcpOffering object itself. - */ - public DefenderForServersGcpOffering withVmScanners(DefenderForServersGcpOfferingVmScanners vmScanners) { - this.vmScanners = vmScanners; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (defenderForServers() != null) { - defenderForServers().validate(); - } - if (arcAutoProvisioning() != null) { - arcAutoProvisioning().validate(); - } - if (vaAutoProvisioning() != null) { - vaAutoProvisioning().validate(); - } - if (mdeAutoProvisioning() != null) { - mdeAutoProvisioning().validate(); - } - if (subPlan() != null) { - subPlan().validate(); - } - if (vmScanners() != null) { - vmScanners().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString()); - jsonWriter.writeJsonField("defenderForServers", this.defenderForServers); - jsonWriter.writeJsonField("arcAutoProvisioning", this.arcAutoProvisioning); - jsonWriter.writeJsonField("vaAutoProvisioning", this.vaAutoProvisioning); - jsonWriter.writeJsonField("mdeAutoProvisioning", this.mdeAutoProvisioning); - jsonWriter.writeJsonField("subPlan", this.subPlan); - jsonWriter.writeJsonField("vmScanners", this.vmScanners); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersGcpOffering from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersGcpOffering 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 DefenderForServersGcpOffering. - */ - public static DefenderForServersGcpOffering fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersGcpOffering deserializedDefenderForServersGcpOffering - = new DefenderForServersGcpOffering(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("description".equals(fieldName)) { - deserializedDefenderForServersGcpOffering.withDescription(reader.getString()); - } else if ("offeringType".equals(fieldName)) { - deserializedDefenderForServersGcpOffering.offeringType - = OfferingType.fromString(reader.getString()); - } else if ("defenderForServers".equals(fieldName)) { - deserializedDefenderForServersGcpOffering.defenderForServers - = DefenderForServersGcpOfferingDefenderForServers.fromJson(reader); - } else if ("arcAutoProvisioning".equals(fieldName)) { - deserializedDefenderForServersGcpOffering.arcAutoProvisioning - = DefenderForServersGcpOfferingArcAutoProvisioning.fromJson(reader); - } else if ("vaAutoProvisioning".equals(fieldName)) { - deserializedDefenderForServersGcpOffering.vaAutoProvisioning - = DefenderForServersGcpOfferingVaAutoProvisioning.fromJson(reader); - } else if ("mdeAutoProvisioning".equals(fieldName)) { - deserializedDefenderForServersGcpOffering.mdeAutoProvisioning - = DefenderForServersGcpOfferingMdeAutoProvisioning.fromJson(reader); - } else if ("subPlan".equals(fieldName)) { - deserializedDefenderForServersGcpOffering.subPlan - = DefenderForServersGcpOfferingSubPlan.fromJson(reader); - } else if ("vmScanners".equals(fieldName)) { - deserializedDefenderForServersGcpOffering.vmScanners - = DefenderForServersGcpOfferingVmScanners.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersGcpOffering; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingArcAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingArcAutoProvisioning.java deleted file mode 100644 index c810aa343585..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingArcAutoProvisioning.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ARC autoprovisioning configuration. - */ -@Fluent -public final class DefenderForServersGcpOfferingArcAutoProvisioning extends ArcAutoProvisioningGcp { - /** - * Creates an instance of DefenderForServersGcpOfferingArcAutoProvisioning class. - */ - public DefenderForServersGcpOfferingArcAutoProvisioning() { - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForServersGcpOfferingArcAutoProvisioning withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForServersGcpOfferingArcAutoProvisioning - withConfiguration(ArcAutoProvisioningConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersGcpOfferingArcAutoProvisioning from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersGcpOfferingArcAutoProvisioning 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 DefenderForServersGcpOfferingArcAutoProvisioning. - */ - public static DefenderForServersGcpOfferingArcAutoProvisioning fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersGcpOfferingArcAutoProvisioning deserializedDefenderForServersGcpOfferingArcAutoProvisioning - = new DefenderForServersGcpOfferingArcAutoProvisioning(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingArcAutoProvisioning - .withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingArcAutoProvisioning - .withConfiguration(ArcAutoProvisioningConfiguration.fromJson(reader)); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersGcpOfferingArcAutoProvisioning; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingDefenderForServers.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingDefenderForServers.java deleted file mode 100644 index 863d28b246e4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingDefenderForServers.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 Defender for servers connection configuration. - */ -@Fluent -public final class DefenderForServersGcpOfferingDefenderForServers - implements JsonSerializable { - /* - * The workload identity provider id in GCP for this feature - */ - private String workloadIdentityProviderId; - - /* - * The service account email address in GCP for this feature - */ - private String serviceAccountEmailAddress; - - /** - * Creates an instance of DefenderForServersGcpOfferingDefenderForServers class. - */ - public DefenderForServersGcpOfferingDefenderForServers() { - } - - /** - * Get the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderForServersGcpOfferingDefenderForServers object itself. - */ - public DefenderForServersGcpOfferingDefenderForServers - withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderForServersGcpOfferingDefenderForServers object itself. - */ - public DefenderForServersGcpOfferingDefenderForServers - withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - 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("workloadIdentityProviderId", this.workloadIdentityProviderId); - jsonWriter.writeStringField("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersGcpOfferingDefenderForServers from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersGcpOfferingDefenderForServers 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 DefenderForServersGcpOfferingDefenderForServers. - */ - public static DefenderForServersGcpOfferingDefenderForServers fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersGcpOfferingDefenderForServers deserializedDefenderForServersGcpOfferingDefenderForServers - = new DefenderForServersGcpOfferingDefenderForServers(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingDefenderForServers.workloadIdentityProviderId - = reader.getString(); - } else if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingDefenderForServers.serviceAccountEmailAddress - = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersGcpOfferingDefenderForServers; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingMdeAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingMdeAutoProvisioning.java deleted file mode 100644 index 20f3e63d0d33..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingMdeAutoProvisioning.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 Microsoft Defender for Endpoint autoprovisioning configuration. - */ -@Fluent -public final class DefenderForServersGcpOfferingMdeAutoProvisioning - implements JsonSerializable { - /* - * Is Microsoft Defender for Endpoint auto provisioning enabled - */ - private Boolean enabled; - - /* - * configuration for Microsoft Defender for Endpoint autoprovisioning - */ - private Object configuration; - - /** - * Creates an instance of DefenderForServersGcpOfferingMdeAutoProvisioning class. - */ - public DefenderForServersGcpOfferingMdeAutoProvisioning() { - } - - /** - * Get the enabled property: Is Microsoft Defender for Endpoint auto provisioning enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender for Endpoint auto provisioning enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForServersGcpOfferingMdeAutoProvisioning object itself. - */ - public DefenderForServersGcpOfferingMdeAutoProvisioning withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the configuration property: configuration for Microsoft Defender for Endpoint autoprovisioning. - * - * @return the configuration value. - */ - public Object configuration() { - return this.configuration; - } - - /** - * Set the configuration property: configuration for Microsoft Defender for Endpoint autoprovisioning. - * - * @param configuration the configuration value to set. - * @return the DefenderForServersGcpOfferingMdeAutoProvisioning object itself. - */ - public DefenderForServersGcpOfferingMdeAutoProvisioning withConfiguration(Object configuration) { - this.configuration = configuration; - 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("enabled", this.enabled); - if (this.configuration != null) { - jsonWriter.writeUntypedField("configuration", this.configuration); - } - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersGcpOfferingMdeAutoProvisioning from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersGcpOfferingMdeAutoProvisioning 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 DefenderForServersGcpOfferingMdeAutoProvisioning. - */ - public static DefenderForServersGcpOfferingMdeAutoProvisioning fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersGcpOfferingMdeAutoProvisioning deserializedDefenderForServersGcpOfferingMdeAutoProvisioning - = new DefenderForServersGcpOfferingMdeAutoProvisioning(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingMdeAutoProvisioning.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingMdeAutoProvisioning.configuration = reader.readUntyped(); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersGcpOfferingMdeAutoProvisioning; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingSubPlan.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingSubPlan.java deleted file mode 100644 index 2e1f5db33f5d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingSubPlan.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * configuration for the servers offering subPlan. - */ -@Fluent -public final class DefenderForServersGcpOfferingSubPlan - implements JsonSerializable { - /* - * The available sub plans - */ - private SubPlan type; - - /** - * Creates an instance of DefenderForServersGcpOfferingSubPlan class. - */ - public DefenderForServersGcpOfferingSubPlan() { - } - - /** - * Get the type property: The available sub plans. - * - * @return the type value. - */ - public SubPlan type() { - return this.type; - } - - /** - * Set the type property: The available sub plans. - * - * @param type the type value to set. - * @return the DefenderForServersGcpOfferingSubPlan object itself. - */ - public DefenderForServersGcpOfferingSubPlan withType(SubPlan type) { - this.type = type; - 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("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersGcpOfferingSubPlan from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersGcpOfferingSubPlan 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 DefenderForServersGcpOfferingSubPlan. - */ - public static DefenderForServersGcpOfferingSubPlan fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersGcpOfferingSubPlan deserializedDefenderForServersGcpOfferingSubPlan - = new DefenderForServersGcpOfferingSubPlan(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingSubPlan.type = SubPlan.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersGcpOfferingSubPlan; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVaAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVaAutoProvisioning.java deleted file mode 100644 index b41b6d462aa0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVaAutoProvisioning.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 Vulnerability Assessment autoprovisioning configuration. - */ -@Fluent -public final class DefenderForServersGcpOfferingVaAutoProvisioning - implements JsonSerializable { - /* - * Is Vulnerability Assessment auto provisioning enabled - */ - private Boolean enabled; - - /* - * configuration for Vulnerability Assessment autoprovisioning - */ - private DefenderForServersGcpOfferingVaAutoProvisioningConfiguration configuration; - - /** - * Creates an instance of DefenderForServersGcpOfferingVaAutoProvisioning class. - */ - public DefenderForServersGcpOfferingVaAutoProvisioning() { - } - - /** - * Get the enabled property: Is Vulnerability Assessment auto provisioning enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Vulnerability Assessment auto provisioning enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForServersGcpOfferingVaAutoProvisioning object itself. - */ - public DefenderForServersGcpOfferingVaAutoProvisioning withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the configuration property: configuration for Vulnerability Assessment autoprovisioning. - * - * @return the configuration value. - */ - public DefenderForServersGcpOfferingVaAutoProvisioningConfiguration configuration() { - return this.configuration; - } - - /** - * Set the configuration property: configuration for Vulnerability Assessment autoprovisioning. - * - * @param configuration the configuration value to set. - * @return the DefenderForServersGcpOfferingVaAutoProvisioning object itself. - */ - public DefenderForServersGcpOfferingVaAutoProvisioning - withConfiguration(DefenderForServersGcpOfferingVaAutoProvisioningConfiguration configuration) { - this.configuration = configuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeJsonField("configuration", this.configuration); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersGcpOfferingVaAutoProvisioning from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersGcpOfferingVaAutoProvisioning 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 DefenderForServersGcpOfferingVaAutoProvisioning. - */ - public static DefenderForServersGcpOfferingVaAutoProvisioning fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersGcpOfferingVaAutoProvisioning deserializedDefenderForServersGcpOfferingVaAutoProvisioning - = new DefenderForServersGcpOfferingVaAutoProvisioning(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingVaAutoProvisioning.enabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingVaAutoProvisioning.configuration - = DefenderForServersGcpOfferingVaAutoProvisioningConfiguration.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersGcpOfferingVaAutoProvisioning; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVaAutoProvisioningConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVaAutoProvisioningConfiguration.java deleted file mode 100644 index 6bbf1d0da4ec..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVaAutoProvisioningConfiguration.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * configuration for Vulnerability Assessment autoprovisioning. - */ -@Fluent -public final class DefenderForServersGcpOfferingVaAutoProvisioningConfiguration - implements JsonSerializable { - /* - * The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys' - */ - private Type type; - - /** - * Creates an instance of DefenderForServersGcpOfferingVaAutoProvisioningConfiguration class. - */ - public DefenderForServersGcpOfferingVaAutoProvisioningConfiguration() { - } - - /** - * Get the type property: The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. - * - * @return the type value. - */ - public Type type() { - return this.type; - } - - /** - * Set the type property: The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. - * - * @param type the type value to set. - * @return the DefenderForServersGcpOfferingVaAutoProvisioningConfiguration object itself. - */ - public DefenderForServersGcpOfferingVaAutoProvisioningConfiguration withType(Type type) { - this.type = type; - 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("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersGcpOfferingVaAutoProvisioningConfiguration from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersGcpOfferingVaAutoProvisioningConfiguration 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 - * DefenderForServersGcpOfferingVaAutoProvisioningConfiguration. - */ - public static DefenderForServersGcpOfferingVaAutoProvisioningConfiguration fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersGcpOfferingVaAutoProvisioningConfiguration deserializedDefenderForServersGcpOfferingVaAutoProvisioningConfiguration - = new DefenderForServersGcpOfferingVaAutoProvisioningConfiguration(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingVaAutoProvisioningConfiguration.type - = Type.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersGcpOfferingVaAutoProvisioningConfiguration; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVmScanners.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVmScanners.java deleted file mode 100644 index b2c9457a4d29..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVmScanners.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Microsoft Defender for Server VM scanning configuration. - */ -@Fluent -public final class DefenderForServersGcpOfferingVmScanners extends VmScannersGcp { - /** - * Creates an instance of DefenderForServersGcpOfferingVmScanners class. - */ - public DefenderForServersGcpOfferingVmScanners() { - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForServersGcpOfferingVmScanners withEnabled(Boolean enabled) { - super.withEnabled(enabled); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DefenderForServersGcpOfferingVmScanners withConfiguration(VmScannersBaseConfiguration configuration) { - super.withConfiguration(configuration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("enabled", enabled()); - jsonWriter.writeJsonField("configuration", configuration()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForServersGcpOfferingVmScanners from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForServersGcpOfferingVmScanners 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 DefenderForServersGcpOfferingVmScanners. - */ - public static DefenderForServersGcpOfferingVmScanners fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForServersGcpOfferingVmScanners deserializedDefenderForServersGcpOfferingVmScanners - = new DefenderForServersGcpOfferingVmScanners(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("enabled".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingVmScanners - .withEnabled(reader.getNullable(JsonReader::getBoolean)); - } else if ("configuration".equals(fieldName)) { - deserializedDefenderForServersGcpOfferingVmScanners - .withConfiguration(VmScannersBaseConfiguration.fromJson(reader)); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForServersGcpOfferingVmScanners; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorageSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorageSetting.java deleted file mode 100644 index 7aec0681ac90..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorageSetting.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.DefenderForStorageSettingInner; - -/** - * An immutable client-side representation of DefenderForStorageSetting. - */ -public interface DefenderForStorageSetting { - /** - * 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: Defender for Storage resource properties. - * - * @return the properties value. - */ - DefenderForStorageSettingProperties 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.security.fluent.models.DefenderForStorageSettingInner object. - * - * @return the inner object. - */ - DefenderForStorageSettingInner innerModel(); - - /** - * The entirety of the DefenderForStorageSetting definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { - } - - /** - * The DefenderForStorageSetting definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the DefenderForStorageSetting definition. - */ - interface Blank extends WithScope { - } - - /** - * The stage of the DefenderForStorageSetting definition allowing to specify parent resource. - */ - interface WithScope { - /** - * Specifies resourceId. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @return the next definition stage. - */ - WithCreate withExistingResourceId(String resourceId); - } - - /** - * The stage of the DefenderForStorageSetting definition which contains all the minimum required properties for - * the resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - DefenderForStorageSetting create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - DefenderForStorageSetting create(Context context); - } - - /** - * The stage of the DefenderForStorageSetting definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Defender for Storage resource properties.. - * - * @param properties Defender for Storage resource properties. - * @return the next definition stage. - */ - WithCreate withProperties(DefenderForStorageSettingProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - DefenderForStorageSetting refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - DefenderForStorageSetting refresh(Context context); - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. Blobs and Files will be scanned - * for malware. - * - * @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 describes the state of a malware scan operation along with {@link Response}. - */ - Response startMalwareScanWithResponse(Context context); - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. Blobs and Files will be scanned - * for malware. - * - * @throws com.azure.core.management.exception.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 state of a malware scan operation. - */ - MalwareScan startMalwareScan(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorageSettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorageSettingProperties.java deleted file mode 100644 index 5f5b80cf4b02..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorageSettingProperties.java +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * Defender for Storage resource properties. - */ -@Fluent -public final class DefenderForStorageSettingProperties - implements JsonSerializable { - /* - * Indicates whether Defender for Storage is enabled on this storage account. - */ - private Boolean isEnabled; - - /* - * Properties of Malware Scanning. - */ - private MalwareScanningProperties malwareScanning; - - /* - * Properties of Sensitive Data Discovery. - */ - private SensitiveDataDiscoveryProperties sensitiveDataDiscovery; - - /* - * Indicates whether the settings defined for this storage account should override the settings defined for the - * subscription. - */ - private Boolean overrideSubscriptionLevelSettings; - - /** - * Creates an instance of DefenderForStorageSettingProperties class. - */ - public DefenderForStorageSettingProperties() { - } - - /** - * Get the isEnabled property: Indicates whether Defender for Storage is enabled on this storage account. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.isEnabled; - } - - /** - * Set the isEnabled property: Indicates whether Defender for Storage is enabled on this storage account. - * - * @param isEnabled the isEnabled value to set. - * @return the DefenderForStorageSettingProperties object itself. - */ - public DefenderForStorageSettingProperties withIsEnabled(Boolean isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - /** - * Get the malwareScanning property: Properties of Malware Scanning. - * - * @return the malwareScanning value. - */ - public MalwareScanningProperties malwareScanning() { - return this.malwareScanning; - } - - /** - * Set the malwareScanning property: Properties of Malware Scanning. - * - * @param malwareScanning the malwareScanning value to set. - * @return the DefenderForStorageSettingProperties object itself. - */ - public DefenderForStorageSettingProperties withMalwareScanning(MalwareScanningProperties malwareScanning) { - this.malwareScanning = malwareScanning; - return this; - } - - /** - * Get the sensitiveDataDiscovery property: Properties of Sensitive Data Discovery. - * - * @return the sensitiveDataDiscovery value. - */ - public SensitiveDataDiscoveryProperties sensitiveDataDiscovery() { - return this.sensitiveDataDiscovery; - } - - /** - * Set the sensitiveDataDiscovery property: Properties of Sensitive Data Discovery. - * - * @param sensitiveDataDiscovery the sensitiveDataDiscovery value to set. - * @return the DefenderForStorageSettingProperties object itself. - */ - public DefenderForStorageSettingProperties - withSensitiveDataDiscovery(SensitiveDataDiscoveryProperties sensitiveDataDiscovery) { - this.sensitiveDataDiscovery = sensitiveDataDiscovery; - return this; - } - - /** - * Get the overrideSubscriptionLevelSettings property: Indicates whether the settings defined for this storage - * account should override the settings defined for the subscription. - * - * @return the overrideSubscriptionLevelSettings value. - */ - public Boolean overrideSubscriptionLevelSettings() { - return this.overrideSubscriptionLevelSettings; - } - - /** - * Set the overrideSubscriptionLevelSettings property: Indicates whether the settings defined for this storage - * account should override the settings defined for the subscription. - * - * @param overrideSubscriptionLevelSettings the overrideSubscriptionLevelSettings value to set. - * @return the DefenderForStorageSettingProperties object itself. - */ - public DefenderForStorageSettingProperties - withOverrideSubscriptionLevelSettings(Boolean overrideSubscriptionLevelSettings) { - this.overrideSubscriptionLevelSettings = overrideSubscriptionLevelSettings; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (malwareScanning() != null) { - malwareScanning().validate(); - } - if (sensitiveDataDiscovery() != null) { - sensitiveDataDiscovery().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("isEnabled", this.isEnabled); - jsonWriter.writeJsonField("malwareScanning", this.malwareScanning); - jsonWriter.writeJsonField("sensitiveDataDiscovery", this.sensitiveDataDiscovery); - jsonWriter.writeBooleanField("overrideSubscriptionLevelSettings", this.overrideSubscriptionLevelSettings); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DefenderForStorageSettingProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DefenderForStorageSettingProperties 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 DefenderForStorageSettingProperties. - */ - public static DefenderForStorageSettingProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DefenderForStorageSettingProperties deserializedDefenderForStorageSettingProperties - = new DefenderForStorageSettingProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("isEnabled".equals(fieldName)) { - deserializedDefenderForStorageSettingProperties.isEnabled - = reader.getNullable(JsonReader::getBoolean); - } else if ("malwareScanning".equals(fieldName)) { - deserializedDefenderForStorageSettingProperties.malwareScanning - = MalwareScanningProperties.fromJson(reader); - } else if ("sensitiveDataDiscovery".equals(fieldName)) { - deserializedDefenderForStorageSettingProperties.sensitiveDataDiscovery - = SensitiveDataDiscoveryProperties.fromJson(reader); - } else if ("overrideSubscriptionLevelSettings".equals(fieldName)) { - deserializedDefenderForStorageSettingProperties.overrideSubscriptionLevelSettings - = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedDefenderForStorageSettingProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorages.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorages.java deleted file mode 100644 index f889055af858..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForStorages.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of DefenderForStorages. - */ -public interface DefenderForStorages { - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting 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 Defender for Storage settings for the specified storage account along with {@link Response}. - */ - Response getWithResponse(String resourceId, SettingName settingName, Context context); - - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting 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 Defender for Storage settings for the specified storage account. - */ - DefenderForStorageSetting get(String resourceId, SettingName settingName); - - /** - * Lists the Defender for Storage settings for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of Defender for Storage settings as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceId); - - /** - * Lists the Defender for Storage settings for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of Defender for Storage settings as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceId, Context context); - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. Blobs and Files will be scanned - * for malware. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting 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 describes the state of a malware scan operation along with {@link Response}. - */ - Response startMalwareScanWithResponse(String resourceId, SettingName settingName, Context context); - - /** - * Initiate a Defender for Storage malware scan for the specified storage account. Blobs and Files will be scanned - * for malware. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting 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 describes the state of a malware scan operation. - */ - MalwareScan startMalwareScan(String resourceId, SettingName settingName); - - /** - * Cancels a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a GUID. - * @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 describes the state of a malware scan operation along with {@link Response}. - */ - Response cancelMalwareScanWithResponse(String resourceId, SettingName settingName, String scanId, - Context context); - - /** - * Cancels a Defender for Storage malware scan for the specified storage account. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 state of a malware scan operation. - */ - MalwareScan cancelMalwareScan(String resourceId, SettingName settingName, String scanId); - - /** - * Gets the Defender for Storage malware scan for the specified storage resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a GUID. - * @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 Defender for Storage malware scan for the specified storage resource along with {@link Response}. - */ - Response getMalwareScanWithResponse(String resourceId, SettingName settingName, String scanId, - Context context); - - /** - * Gets the Defender for Storage malware scan for the specified storage resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param settingName The defender for storage setting name. - * @param scanId The identifier of the scan. Can be either 'latest' or a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage malware scan for the specified storage resource. - */ - MalwareScan getMalwareScan(String resourceId, SettingName settingName, String scanId); - - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage settings for the specified storage account along with {@link Response}. - */ - DefenderForStorageSetting getById(String id); - - /** - * Gets the Defender for Storage settings for the specified storage account. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Defender for Storage settings for the specified storage account along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new DefenderForStorageSetting resource. - * - * @param name resource name. - * @return the first stage of the new DefenderForStorageSetting definition. - */ - DefenderForStorageSetting.DefinitionStages.Blank define(SettingName name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DenylistCustomAlertRule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DenylistCustomAlertRule.java deleted file mode 100644 index 13f261bd17d6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DenylistCustomAlertRule.java +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * A custom alert rule that checks if a value (depends on the custom alert type) is denied. - */ -@Fluent -public final class DenylistCustomAlertRule extends ListCustomAlertRule { - /* - * The ruleType property. - */ - private String ruleType = "DenylistCustomAlertRule"; - - /* - * The values to deny. The format of the values depends on the rule type. - */ - private List denylistValues; - - /** - * Creates an instance of DenylistCustomAlertRule class. - */ - public DenylistCustomAlertRule() { - } - - /** - * Get the ruleType property: The ruleType property. - * - * @return the ruleType value. - */ - @Override - public String ruleType() { - return this.ruleType; - } - - /** - * Get the denylistValues property: The values to deny. The format of the values depends on the rule type. - * - * @return the denylistValues value. - */ - public List denylistValues() { - return this.denylistValues; - } - - /** - * Set the denylistValues property: The values to deny. The format of the values depends on the rule type. - * - * @param denylistValues the denylistValues value to set. - * @return the DenylistCustomAlertRule object itself. - */ - public DenylistCustomAlertRule withDenylistValues(List denylistValues) { - this.denylistValues = denylistValues; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DenylistCustomAlertRule withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (denylistValues() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property denylistValues in model DenylistCustomAlertRule")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DenylistCustomAlertRule.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeBooleanField("isEnabled", isEnabled()); - jsonWriter.writeArrayField("denylistValues", this.denylistValues, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("ruleType", this.ruleType); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DenylistCustomAlertRule from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DenylistCustomAlertRule 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 DenylistCustomAlertRule. - */ - public static DenylistCustomAlertRule fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DenylistCustomAlertRule deserializedDenylistCustomAlertRule = new DenylistCustomAlertRule(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("isEnabled".equals(fieldName)) { - deserializedDenylistCustomAlertRule.withIsEnabled(reader.getBoolean()); - } else if ("displayName".equals(fieldName)) { - deserializedDenylistCustomAlertRule.withDisplayName(reader.getString()); - } else if ("description".equals(fieldName)) { - deserializedDenylistCustomAlertRule.withDescription(reader.getString()); - } else if ("valueType".equals(fieldName)) { - deserializedDenylistCustomAlertRule.withValueType(ValueType.fromString(reader.getString())); - } else if ("denylistValues".equals(fieldName)) { - List denylistValues = reader.readArray(reader1 -> reader1.getString()); - deserializedDenylistCustomAlertRule.denylistValues = denylistValues; - } else if ("ruleType".equals(fieldName)) { - deserializedDenylistCustomAlertRule.ruleType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDenylistCustomAlertRule; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsCapability.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsCapability.java deleted file mode 100644 index 58dae0eb795e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsCapability.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Details about DevOps capability. - */ -@Immutable -public final class DevOpsCapability implements JsonSerializable { - /* - * Gets the name of the DevOps capability. - */ - private String name; - - /* - * Gets the value of the DevOps capability. - */ - private String value; - - /** - * Creates an instance of DevOpsCapability class. - */ - private DevOpsCapability() { - } - - /** - * Get the name property: Gets the name of the DevOps capability. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the value property: Gets the value of the DevOps capability. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * 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 DevOpsCapability from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DevOpsCapability 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 DevOpsCapability. - */ - public static DevOpsCapability fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DevOpsCapability deserializedDevOpsCapability = new DevOpsCapability(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedDevOpsCapability.name = reader.getString(); - } else if ("value".equals(fieldName)) { - deserializedDevOpsCapability.value = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDevOpsCapability; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfiguration.java deleted file mode 100644 index 5a5bdfc596ce..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfiguration.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; - -/** - * An immutable client-side representation of DevOpsConfiguration. - */ -public interface DevOpsConfiguration { - /** - * 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: DevOps Configuration properties. - * - * @return the properties value. - */ - DevOpsConfigurationProperties 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.security.fluent.models.DevOpsConfigurationInner object. - * - * @return the inner object. - */ - DevOpsConfigurationInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationProperties.java deleted file mode 100644 index 72b5166687d1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurationProperties.java +++ /dev/null @@ -1,282 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * DevOps Configuration properties. - */ -@Fluent -public final class DevOpsConfigurationProperties implements JsonSerializable { - /* - * Gets the resource status message. - */ - private String provisioningStatusMessage; - - /* - * Gets the time when resource was last checked. - */ - private OffsetDateTime provisioningStatusUpdateTimeUtc; - - /* - * The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - */ - private DevOpsProvisioningState provisioningState; - - /* - * Authorization payload. - */ - private Authorization authorization; - - /* - * AutoDiscovery states. - */ - private AutoDiscovery autoDiscovery; - - /* - * List of top-level inventory to select when AutoDiscovery is disabled. - * This field is ignored when AutoDiscovery is enabled. - */ - private List topLevelInventoryList; - - /* - * List of capabilities assigned to the DevOps configuration during the discovery process. - */ - private List capabilities; - - /* - * Details about Agentless configuration. - */ - private AgentlessConfiguration agentlessConfiguration; - - /** - * Creates an instance of DevOpsConfigurationProperties class. - */ - public DevOpsConfigurationProperties() { - } - - /** - * Get the provisioningStatusMessage property: Gets the resource status message. - * - * @return the provisioningStatusMessage value. - */ - public String provisioningStatusMessage() { - return this.provisioningStatusMessage; - } - - /** - * Get the provisioningStatusUpdateTimeUtc property: Gets the time when resource was last checked. - * - * @return the provisioningStatusUpdateTimeUtc value. - */ - public OffsetDateTime provisioningStatusUpdateTimeUtc() { - return this.provisioningStatusUpdateTimeUtc; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - * - * @return the provisioningState value. - */ - public DevOpsProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the authorization property: Authorization payload. - * - * @return the authorization value. - */ - public Authorization authorization() { - return this.authorization; - } - - /** - * Set the authorization property: Authorization payload. - * - * @param authorization the authorization value to set. - * @return the DevOpsConfigurationProperties object itself. - */ - public DevOpsConfigurationProperties withAuthorization(Authorization authorization) { - this.authorization = authorization; - return this; - } - - /** - * Get the autoDiscovery property: AutoDiscovery states. - * - * @return the autoDiscovery value. - */ - public AutoDiscovery autoDiscovery() { - return this.autoDiscovery; - } - - /** - * Set the autoDiscovery property: AutoDiscovery states. - * - * @param autoDiscovery the autoDiscovery value to set. - * @return the DevOpsConfigurationProperties object itself. - */ - public DevOpsConfigurationProperties withAutoDiscovery(AutoDiscovery autoDiscovery) { - this.autoDiscovery = autoDiscovery; - return this; - } - - /** - * Get the topLevelInventoryList property: List of top-level inventory to select when AutoDiscovery is disabled. - * This field is ignored when AutoDiscovery is enabled. - * - * @return the topLevelInventoryList value. - */ - public List topLevelInventoryList() { - return this.topLevelInventoryList; - } - - /** - * Set the topLevelInventoryList property: List of top-level inventory to select when AutoDiscovery is disabled. - * This field is ignored when AutoDiscovery is enabled. - * - * @param topLevelInventoryList the topLevelInventoryList value to set. - * @return the DevOpsConfigurationProperties object itself. - */ - public DevOpsConfigurationProperties withTopLevelInventoryList(List topLevelInventoryList) { - this.topLevelInventoryList = topLevelInventoryList; - return this; - } - - /** - * Get the capabilities property: List of capabilities assigned to the DevOps configuration during the discovery - * process. - * - * @return the capabilities value. - */ - public List capabilities() { - return this.capabilities; - } - - /** - * Get the agentlessConfiguration property: Details about Agentless configuration. - * - * @return the agentlessConfiguration value. - */ - public AgentlessConfiguration agentlessConfiguration() { - return this.agentlessConfiguration; - } - - /** - * Set the agentlessConfiguration property: Details about Agentless configuration. - * - * @param agentlessConfiguration the agentlessConfiguration value to set. - * @return the DevOpsConfigurationProperties object itself. - */ - public DevOpsConfigurationProperties withAgentlessConfiguration(AgentlessConfiguration agentlessConfiguration) { - this.agentlessConfiguration = agentlessConfiguration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (authorization() != null) { - authorization().validate(); - } - if (capabilities() != null) { - capabilities().forEach(e -> e.validate()); - } - if (agentlessConfiguration() != null) { - agentlessConfiguration().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("authorization", this.authorization); - jsonWriter.writeStringField("autoDiscovery", this.autoDiscovery == null ? null : this.autoDiscovery.toString()); - jsonWriter.writeArrayField("topLevelInventoryList", this.topLevelInventoryList, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("agentlessConfiguration", this.agentlessConfiguration); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DevOpsConfigurationProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DevOpsConfigurationProperties 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 DevOpsConfigurationProperties. - */ - public static DevOpsConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DevOpsConfigurationProperties deserializedDevOpsConfigurationProperties - = new DevOpsConfigurationProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("provisioningStatusMessage".equals(fieldName)) { - deserializedDevOpsConfigurationProperties.provisioningStatusMessage = reader.getString(); - } else if ("provisioningStatusUpdateTimeUtc".equals(fieldName)) { - deserializedDevOpsConfigurationProperties.provisioningStatusUpdateTimeUtc = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("provisioningState".equals(fieldName)) { - deserializedDevOpsConfigurationProperties.provisioningState - = DevOpsProvisioningState.fromString(reader.getString()); - } else if ("authorization".equals(fieldName)) { - deserializedDevOpsConfigurationProperties.authorization = Authorization.fromJson(reader); - } else if ("autoDiscovery".equals(fieldName)) { - deserializedDevOpsConfigurationProperties.autoDiscovery - = AutoDiscovery.fromString(reader.getString()); - } else if ("topLevelInventoryList".equals(fieldName)) { - List topLevelInventoryList = reader.readArray(reader1 -> reader1.getString()); - deserializedDevOpsConfigurationProperties.topLevelInventoryList = topLevelInventoryList; - } else if ("capabilities".equals(fieldName)) { - List capabilities - = reader.readArray(reader1 -> DevOpsCapability.fromJson(reader1)); - deserializedDevOpsConfigurationProperties.capabilities = capabilities; - } else if ("agentlessConfiguration".equals(fieldName)) { - deserializedDevOpsConfigurationProperties.agentlessConfiguration - = AgentlessConfiguration.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDevOpsConfigurationProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurations.java deleted file mode 100644 index ccef00abe50d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsConfigurations.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; - -/** - * Resource collection API of DevOpsConfigurations. - */ -public interface DevOpsConfigurations { - /** - * Gets a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 a DevOps Configuration along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String securityConnectorName, - Context context); - - /** - * Gets a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 a DevOps Configuration. - */ - DevOpsConfiguration get(String resourceGroupName, String securityConnectorName); - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource. - */ - DevOpsConfiguration createOrUpdate(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration); - - /** - * Creates or updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @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 devOps Configuration resource. - */ - DevOpsConfiguration createOrUpdate(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration, Context context); - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return devOps Configuration resource. - */ - DevOpsConfiguration update(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration); - - /** - * Updates a DevOps Configuration. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param devOpsConfiguration The DevOps configuration resource payload. - * @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 devOps Configuration resource. - */ - DevOpsConfiguration update(String resourceGroupName, String securityConnectorName, - DevOpsConfigurationInner devOpsConfiguration, Context context); - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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. - */ - void deleteByResourceGroup(String resourceGroupName, String securityConnectorName); - - /** - * Deletes a DevOps Connector. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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. - */ - void delete(String resourceGroupName, String securityConnectorName, Context context); - - /** - * List DevOps Configurations. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * List DevOps Configurations. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector 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 list of RP resources which supports pagination as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsOperationResults.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsOperationResults.java deleted file mode 100644 index 1bc16b65e4cc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsOperationResults.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of DevOpsOperationResults. - */ -public interface DevOpsOperationResults { - /** - * Get devops long running operation result. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param operationResultId The operationResultId 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 devops long running operation result along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String securityConnectorName, - String operationResultId, Context context); - - /** - * Get devops long running operation result. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param securityConnectorName The security connector name. - * @param operationResultId The operationResultId 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 devops long running operation result. - */ - OperationStatusResult get(String resourceGroupName, String securityConnectorName, String operationResultId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsProvisioningState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsProvisioningState.java deleted file mode 100644 index 06124b52fde6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DevOpsProvisioningState.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The provisioning state of the resource. - * - * Pending - Provisioning pending. - * Failed - Provisioning failed. - * Succeeded - Successful provisioning. - * Canceled - Provisioning canceled. - * PendingDeletion - Deletion pending. - * DeletionSuccess - Deletion successful. - * DeletionFailure - Deletion failure. - */ -public final class DevOpsProvisioningState extends ExpandableStringEnum { - /** - * Succeeded. - */ - public static final DevOpsProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** - * Failed. - */ - public static final DevOpsProvisioningState FAILED = fromString("Failed"); - - /** - * Canceled. - */ - public static final DevOpsProvisioningState CANCELED = fromString("Canceled"); - - /** - * Pending. - */ - public static final DevOpsProvisioningState PENDING = fromString("Pending"); - - /** - * PendingDeletion. - */ - public static final DevOpsProvisioningState PENDING_DELETION = fromString("PendingDeletion"); - - /** - * DeletionSuccess. - */ - public static final DevOpsProvisioningState DELETION_SUCCESS = fromString("DeletionSuccess"); - - /** - * DeletionFailure. - */ - public static final DevOpsProvisioningState DELETION_FAILURE = fromString("DeletionFailure"); - - /** - * Creates a new instance of DevOpsProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DevOpsProvisioningState() { - } - - /** - * Creates or finds a DevOpsProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding DevOpsProvisioningState. - */ - public static DevOpsProvisioningState fromString(String name) { - return fromString(name, DevOpsProvisioningState.class); - } - - /** - * Gets known DevOpsProvisioningState values. - * - * @return known DevOpsProvisioningState values. - */ - public static Collection values() { - return values(DevOpsProvisioningState.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroup.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroup.java deleted file mode 100644 index 779dae450392..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroup.java +++ /dev/null @@ -1,282 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.DeviceSecurityGroupInner; -import java.util.List; - -/** - * An immutable client-side representation of DeviceSecurityGroup. - */ -public interface DeviceSecurityGroup { - /** - * 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 thresholdRules property: The list of custom alert threshold rules. - * - * @return the thresholdRules value. - */ - List thresholdRules(); - - /** - * Gets the timeWindowRules property: The list of custom alert time-window rules. - * - * @return the timeWindowRules value. - */ - List timeWindowRules(); - - /** - * Gets the allowlistRules property: The allow-list custom alert rules. - * - * @return the allowlistRules value. - */ - List allowlistRules(); - - /** - * Gets the denylistRules property: The deny-list custom alert rules. - * - * @return the denylistRules value. - */ - List denylistRules(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.DeviceSecurityGroupInner object. - * - * @return the inner object. - */ - DeviceSecurityGroupInner innerModel(); - - /** - * The entirety of the DeviceSecurityGroup definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { - } - - /** - * The DeviceSecurityGroup definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the DeviceSecurityGroup definition. - */ - interface Blank extends WithScope { - } - - /** - * The stage of the DeviceSecurityGroup definition allowing to specify parent resource. - */ - interface WithScope { - /** - * Specifies resourceId. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @return the next definition stage. - */ - WithCreate withExistingResourceId(String resourceId); - } - - /** - * The stage of the DeviceSecurityGroup 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.WithThresholdRules, DefinitionStages.WithTimeWindowRules, - DefinitionStages.WithAllowlistRules, DefinitionStages.WithDenylistRules { - /** - * Executes the create request. - * - * @return the created resource. - */ - DeviceSecurityGroup create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - DeviceSecurityGroup create(Context context); - } - - /** - * The stage of the DeviceSecurityGroup definition allowing to specify thresholdRules. - */ - interface WithThresholdRules { - /** - * Specifies the thresholdRules property: The list of custom alert threshold rules.. - * - * @param thresholdRules The list of custom alert threshold rules. - * @return the next definition stage. - */ - WithCreate withThresholdRules(List thresholdRules); - } - - /** - * The stage of the DeviceSecurityGroup definition allowing to specify timeWindowRules. - */ - interface WithTimeWindowRules { - /** - * Specifies the timeWindowRules property: The list of custom alert time-window rules.. - * - * @param timeWindowRules The list of custom alert time-window rules. - * @return the next definition stage. - */ - WithCreate withTimeWindowRules(List timeWindowRules); - } - - /** - * The stage of the DeviceSecurityGroup definition allowing to specify allowlistRules. - */ - interface WithAllowlistRules { - /** - * Specifies the allowlistRules property: The allow-list custom alert rules.. - * - * @param allowlistRules The allow-list custom alert rules. - * @return the next definition stage. - */ - WithCreate withAllowlistRules(List allowlistRules); - } - - /** - * The stage of the DeviceSecurityGroup definition allowing to specify denylistRules. - */ - interface WithDenylistRules { - /** - * Specifies the denylistRules property: The deny-list custom alert rules.. - * - * @param denylistRules The deny-list custom alert rules. - * @return the next definition stage. - */ - WithCreate withDenylistRules(List denylistRules); - } - } - - /** - * Begins update for the DeviceSecurityGroup resource. - * - * @return the stage of resource update. - */ - DeviceSecurityGroup.Update update(); - - /** - * The template for DeviceSecurityGroup update. - */ - interface Update extends UpdateStages.WithThresholdRules, UpdateStages.WithTimeWindowRules, - UpdateStages.WithAllowlistRules, UpdateStages.WithDenylistRules { - /** - * Executes the update request. - * - * @return the updated resource. - */ - DeviceSecurityGroup apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - DeviceSecurityGroup apply(Context context); - } - - /** - * The DeviceSecurityGroup update stages. - */ - interface UpdateStages { - /** - * The stage of the DeviceSecurityGroup update allowing to specify thresholdRules. - */ - interface WithThresholdRules { - /** - * Specifies the thresholdRules property: The list of custom alert threshold rules.. - * - * @param thresholdRules The list of custom alert threshold rules. - * @return the next definition stage. - */ - Update withThresholdRules(List thresholdRules); - } - - /** - * The stage of the DeviceSecurityGroup update allowing to specify timeWindowRules. - */ - interface WithTimeWindowRules { - /** - * Specifies the timeWindowRules property: The list of custom alert time-window rules.. - * - * @param timeWindowRules The list of custom alert time-window rules. - * @return the next definition stage. - */ - Update withTimeWindowRules(List timeWindowRules); - } - - /** - * The stage of the DeviceSecurityGroup update allowing to specify allowlistRules. - */ - interface WithAllowlistRules { - /** - * Specifies the allowlistRules property: The allow-list custom alert rules.. - * - * @param allowlistRules The allow-list custom alert rules. - * @return the next definition stage. - */ - Update withAllowlistRules(List allowlistRules); - } - - /** - * The stage of the DeviceSecurityGroup update allowing to specify denylistRules. - */ - interface WithDenylistRules { - /** - * Specifies the denylistRules property: The deny-list custom alert rules.. - * - * @param denylistRules The deny-list custom alert rules. - * @return the next definition stage. - */ - Update withDenylistRules(List denylistRules); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - DeviceSecurityGroup refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - DeviceSecurityGroup refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroups.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroups.java deleted file mode 100644 index 7bf695d70343..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroups.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of DeviceSecurityGroups. - */ -public interface DeviceSecurityGroups { - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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 the device security group resource along with {@link Response}. - */ - Response getWithResponse(String resourceId, String deviceSecurityGroupName, Context context); - - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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 the device security group resource. - */ - DeviceSecurityGroup get(String resourceId, String deviceSecurityGroupName); - - /** - * User this method to deletes the device security group. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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 the {@link Response}. - */ - Response deleteByResourceGroupWithResponse(String resourceId, String deviceSecurityGroupName, - Context context); - - /** - * User this method to deletes the device security group. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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. - */ - void deleteByResourceGroup(String resourceId, String deviceSecurityGroupName); - - /** - * Use this method get the list of device security groups for the specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of device security groups as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceId); - - /** - * Use this method get the list of device security groups for the specified IoT Hub resource. - * - * @param resourceId The fully qualified Azure Resource manager identifier of the 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 list of device security groups as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceId, Context context); - - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource along with {@link Response}. - */ - DeviceSecurityGroup getById(String id); - - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * User this method to deletes the device security group. - * - * @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); - - /** - * User this method to deletes the device security group. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new DeviceSecurityGroup resource. - * - * @param name resource name. - * @return the first stage of the new DeviceSecurityGroup definition. - */ - DeviceSecurityGroup.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolution.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolution.java deleted file mode 100644 index 9473f49523b8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolution.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner; - -/** - * An immutable client-side representation of DiscoveredSecuritySolution. - */ -public interface DiscoveredSecuritySolution { - /** - * 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 location property: Location where the resource is stored. - * - * @return the location value. - */ - String location(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the securityFamily property: The security family of the discovered solution. - * - * @return the securityFamily value. - */ - SecurityFamily securityFamily(); - - /** - * Gets the offer property: The security solutions' image offer. - * - * @return the offer value. - */ - String offer(); - - /** - * Gets the publisher property: The security solutions' image publisher. - * - * @return the publisher value. - */ - String publisher(); - - /** - * Gets the sku property: The security solutions' image sku. - * - * @return the sku value. - */ - String sku(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner object. - * - * @return the inner object. - */ - DiscoveredSecuritySolutionInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolutions.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolutions.java deleted file mode 100644 index 11b409cf8f92..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolutions.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of DiscoveredSecuritySolutions. - */ -public interface DiscoveredSecuritySolutions { - /** - * Gets a specific discovered Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param discoveredSecuritySolutionName Name of a discovered security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific discovered Security Solution along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String ascLocation, - String discoveredSecuritySolutionName, Context context); - - /** - * Gets a specific discovered Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param discoveredSecuritySolutionName Name of a discovered security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 discovered Security Solution. - */ - DiscoveredSecuritySolution get(String resourceGroupName, String ascLocation, String discoveredSecuritySolutionName); - - /** - * Gets a list of discovered Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription and location as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByHomeRegion(String ascLocation); - - /** - * Gets a list of discovered Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription and location as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByHomeRegion(String ascLocation, Context context); - - /** - * Gets a list of discovered Security Solutions for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Gets a list of discovered Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DockerHubEnvironmentData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DockerHubEnvironmentData.java deleted file mode 100644 index 13dc167d0f5c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DockerHubEnvironmentData.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The Docker Hub connector environment data. - */ -@Fluent -public final class DockerHubEnvironmentData extends EnvironmentData { - /* - * The type of the environment data. - */ - private EnvironmentType environmentType = EnvironmentType.DOCKER_HUB_ORGANIZATION; - - /* - * The Docker Hub organization authentication details - */ - private Authentication authentication; - - /* - * Scan interval in hours (value should be between 1-hour to 24-hours) - */ - private Long scanInterval; - - /** - * Creates an instance of DockerHubEnvironmentData class. - */ - public DockerHubEnvironmentData() { - } - - /** - * Get the environmentType property: The type of the environment data. - * - * @return the environmentType value. - */ - @Override - public EnvironmentType environmentType() { - return this.environmentType; - } - - /** - * Get the authentication property: The Docker Hub organization authentication details. - * - * @return the authentication value. - */ - public Authentication authentication() { - return this.authentication; - } - - /** - * Set the authentication property: The Docker Hub organization authentication details. - * - * @param authentication the authentication value to set. - * @return the DockerHubEnvironmentData object itself. - */ - public DockerHubEnvironmentData withAuthentication(Authentication authentication) { - this.authentication = authentication; - return this; - } - - /** - * Get the scanInterval property: Scan interval in hours (value should be between 1-hour to 24-hours). - * - * @return the scanInterval value. - */ - public Long scanInterval() { - return this.scanInterval; - } - - /** - * Set the scanInterval property: Scan interval in hours (value should be between 1-hour to 24-hours). - * - * @param scanInterval the scanInterval value to set. - * @return the DockerHubEnvironmentData object itself. - */ - public DockerHubEnvironmentData withScanInterval(Long scanInterval) { - this.scanInterval = scanInterval; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (authentication() != null) { - authentication().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("environmentType", - this.environmentType == null ? null : this.environmentType.toString()); - jsonWriter.writeJsonField("authentication", this.authentication); - jsonWriter.writeNumberField("scanInterval", this.scanInterval); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DockerHubEnvironmentData from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DockerHubEnvironmentData 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 DockerHubEnvironmentData. - */ - public static DockerHubEnvironmentData fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DockerHubEnvironmentData deserializedDockerHubEnvironmentData = new DockerHubEnvironmentData(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("environmentType".equals(fieldName)) { - deserializedDockerHubEnvironmentData.environmentType - = EnvironmentType.fromString(reader.getString()); - } else if ("authentication".equals(fieldName)) { - deserializedDockerHubEnvironmentData.authentication = Authentication.fromJson(reader); - } else if ("scanInterval".equals(fieldName)) { - deserializedDockerHubEnvironmentData.scanInterval = reader.getNullable(JsonReader::getLong); - } else { - reader.skipChildren(); - } - } - - return deserializedDockerHubEnvironmentData; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Effect.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Effect.java deleted file mode 100644 index 52ede70ad74a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Effect.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Expected effect of this assignment (Audit/Exempt/Attest). - */ -public final class Effect extends ExpandableStringEnum { - /** - * Audit. - */ - public static final Effect AUDIT = fromString("Audit"); - - /** - * Exempt. - */ - public static final Effect EXEMPT = fromString("Exempt"); - - /** - * Attest. - */ - public static final Effect ATTEST = fromString("Attest"); - - /** - * Creates a new instance of Effect value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Effect() { - } - - /** - * Creates or finds a Effect from its string representation. - * - * @param name a name to look for. - * @return the corresponding Effect. - */ - public static Effect fromString(String name) { - return fromString(name, Effect.class); - } - - /** - * Gets known Effect values. - * - * @return known Effect values. - */ - public static Collection values() { - return values(Effect.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Enforce.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Enforce.java deleted file mode 100644 index 0b001d348438..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Enforce.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * If set to "False", it allows the descendants of this scope to override the pricing configuration set on this scope - * (allows setting inherited="False"). If set to "True", it prevents overrides and forces this pricing configuration on - * all the descendants of this scope. This field is only available for subscription-level pricing. - */ -public final class Enforce extends ExpandableStringEnum { - /** - * Allows the descendants of this scope to override the pricing configuration set on this scope (allows setting - * inherited="False"). - */ - public static final Enforce FALSE = fromString("False"); - - /** - * Prevents overrides and forces the current scope's pricing configuration to all descendants. - */ - public static final Enforce TRUE = fromString("True"); - - /** - * Creates a new instance of Enforce value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Enforce() { - } - - /** - * Creates or finds a Enforce from its string representation. - * - * @param name a name to look for. - * @return the corresponding Enforce. - */ - public static Enforce fromString(String name) { - return fromString(name, Enforce.class); - } - - /** - * Gets known Enforce values. - * - * @return known Enforce values. - */ - public static Collection values() { - return values(Enforce.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentData.java deleted file mode 100644 index 9ebb245e2b6a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentData.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The security connector environment data. - */ -@Immutable -public class EnvironmentData implements JsonSerializable { - /* - * The type of the environment data. - */ - private EnvironmentType environmentType = EnvironmentType.fromString("EnvironmentData"); - - /** - * Creates an instance of EnvironmentData class. - */ - public EnvironmentData() { - } - - /** - * Get the environmentType property: The type of the environment data. - * - * @return the environmentType value. - */ - public EnvironmentType environmentType() { - return this.environmentType; - } - - /** - * 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("environmentType", - this.environmentType == null ? null : this.environmentType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EnvironmentData from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EnvironmentData 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 EnvironmentData. - */ - public static EnvironmentData fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("environmentType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("AwsAccount".equals(discriminatorValue)) { - return AwsEnvironmentData.fromJson(readerToUse.reset()); - } else if ("GcpProject".equals(discriminatorValue)) { - return GcpProjectEnvironmentData.fromJson(readerToUse.reset()); - } else if ("GithubScope".equals(discriminatorValue)) { - return GithubScopeEnvironmentData.fromJson(readerToUse.reset()); - } else if ("AzureDevOpsScope".equals(discriminatorValue)) { - return AzureDevOpsScopeEnvironmentData.fromJson(readerToUse.reset()); - } else if ("GitlabScope".equals(discriminatorValue)) { - return GitlabScopeEnvironmentData.fromJson(readerToUse.reset()); - } else if ("DockerHubOrganization".equals(discriminatorValue)) { - return DockerHubEnvironmentData.fromJson(readerToUse.reset()); - } else if ("JFrogArtifactory".equals(discriminatorValue)) { - return JFrogEnvironmentData.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static EnvironmentData fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EnvironmentData deserializedEnvironmentData = new EnvironmentData(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("environmentType".equals(fieldName)) { - deserializedEnvironmentData.environmentType = EnvironmentType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedEnvironmentData; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentDetails.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentDetails.java deleted file mode 100644 index 8e14f7e32356..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentDetails.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The environment details of the resource. - */ -@Immutable -public final class EnvironmentDetails implements JsonSerializable { - /* - * The native resource id of the resource (in case of Azure - the resource Id, in case of MC - the native resource - * id) - */ - private String nativeResourceId; - - /* - * The hierarchy id of the connector (in case of Azure - the subscription Id, in case of MC - the hierarchyId id) - */ - private String environmentHierarchyId; - - /* - * The organizational hierarchy id of the connector (in case of Azure - the subscription Id, in case of MC - the - * organizational hierarchyId id) - */ - private String organizationalHierarchyId; - - /* - * The subscription Id - */ - private String subscriptionId; - - /* - * The tenant Id - */ - private String tenantId; - - /** - * Creates an instance of EnvironmentDetails class. - */ - private EnvironmentDetails() { - } - - /** - * Get the nativeResourceId property: The native resource id of the resource (in case of Azure - the resource Id, in - * case of MC - the native resource id). - * - * @return the nativeResourceId value. - */ - public String nativeResourceId() { - return this.nativeResourceId; - } - - /** - * Get the environmentHierarchyId property: The hierarchy id of the connector (in case of Azure - the subscription - * Id, in case of MC - the hierarchyId id). - * - * @return the environmentHierarchyId value. - */ - public String environmentHierarchyId() { - return this.environmentHierarchyId; - } - - /** - * Get the organizationalHierarchyId property: The organizational hierarchy id of the connector (in case of Azure - - * the subscription Id, in case of MC - the organizational hierarchyId id). - * - * @return the organizationalHierarchyId value. - */ - public String organizationalHierarchyId() { - return this.organizationalHierarchyId; - } - - /** - * Get the subscriptionId property: The subscription Id. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Get the tenantId property: The tenant Id. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * 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("nativeResourceId", this.nativeResourceId); - jsonWriter.writeStringField("environmentHierarchyId", this.environmentHierarchyId); - jsonWriter.writeStringField("organizationalHierarchyId", this.organizationalHierarchyId); - jsonWriter.writeStringField("subscriptionId", this.subscriptionId); - jsonWriter.writeStringField("tenantId", this.tenantId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EnvironmentDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EnvironmentDetails 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 EnvironmentDetails. - */ - public static EnvironmentDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EnvironmentDetails deserializedEnvironmentDetails = new EnvironmentDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nativeResourceId".equals(fieldName)) { - deserializedEnvironmentDetails.nativeResourceId = reader.getString(); - } else if ("environmentHierarchyId".equals(fieldName)) { - deserializedEnvironmentDetails.environmentHierarchyId = reader.getString(); - } else if ("organizationalHierarchyId".equals(fieldName)) { - deserializedEnvironmentDetails.organizationalHierarchyId = reader.getString(); - } else if ("subscriptionId".equals(fieldName)) { - deserializedEnvironmentDetails.subscriptionId = reader.getString(); - } else if ("tenantId".equals(fieldName)) { - deserializedEnvironmentDetails.tenantId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedEnvironmentDetails; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentType.java deleted file mode 100644 index 56787a939591..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentType.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The type of the environment data. - */ -public final class EnvironmentType extends ExpandableStringEnum { - /** - * AwsAccount. - */ - public static final EnvironmentType AWS_ACCOUNT = fromString("AwsAccount"); - - /** - * GcpProject. - */ - public static final EnvironmentType GCP_PROJECT = fromString("GcpProject"); - - /** - * GithubScope. - */ - public static final EnvironmentType GITHUB_SCOPE = fromString("GithubScope"); - - /** - * AzureDevOpsScope. - */ - public static final EnvironmentType AZURE_DEV_OPS_SCOPE = fromString("AzureDevOpsScope"); - - /** - * GitlabScope. - */ - public static final EnvironmentType GITLAB_SCOPE = fromString("GitlabScope"); - - /** - * DockerHubOrganization. - */ - public static final EnvironmentType DOCKER_HUB_ORGANIZATION = fromString("DockerHubOrganization"); - - /** - * JFrogArtifactory. - */ - public static final EnvironmentType JFROG_ARTIFACTORY = fromString("JFrogArtifactory"); - - /** - * Creates a new instance of EnvironmentType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public EnvironmentType() { - } - - /** - * Creates or finds a EnvironmentType from its string representation. - * - * @param name a name to look for. - * @return the corresponding EnvironmentType. - */ - public static EnvironmentType fromString(String name) { - return fromString(name, EnvironmentType.class); - } - - /** - * Gets known EnvironmentType values. - * - * @return known EnvironmentType values. - */ - public static Collection values() { - return values(EnvironmentType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EventSource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EventSource.java deleted file mode 100644 index 44a72c12c6d5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EventSource.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * A valid event source type. - */ -public final class EventSource extends ExpandableStringEnum { - /** - * Assessments. - */ - public static final EventSource ASSESSMENTS = fromString("Assessments"); - - /** - * AssessmentsSnapshot. - */ - public static final EventSource ASSESSMENTS_SNAPSHOT = fromString("AssessmentsSnapshot"); - - /** - * SubAssessments. - */ - public static final EventSource SUB_ASSESSMENTS = fromString("SubAssessments"); - - /** - * SubAssessmentsSnapshot. - */ - public static final EventSource SUB_ASSESSMENTS_SNAPSHOT = fromString("SubAssessmentsSnapshot"); - - /** - * Alerts. - */ - public static final EventSource ALERTS = fromString("Alerts"); - - /** - * SecureScores. - */ - public static final EventSource SECURE_SCORES = fromString("SecureScores"); - - /** - * SecureScoresSnapshot. - */ - public static final EventSource SECURE_SCORES_SNAPSHOT = fromString("SecureScoresSnapshot"); - - /** - * SecureScoreControls. - */ - public static final EventSource SECURE_SCORE_CONTROLS = fromString("SecureScoreControls"); - - /** - * SecureScoreControlsSnapshot. - */ - public static final EventSource SECURE_SCORE_CONTROLS_SNAPSHOT = fromString("SecureScoreControlsSnapshot"); - - /** - * RegulatoryComplianceAssessment. - */ - public static final EventSource REGULATORY_COMPLIANCE_ASSESSMENT = fromString("RegulatoryComplianceAssessment"); - - /** - * RegulatoryComplianceAssessmentSnapshot. - */ - public static final EventSource REGULATORY_COMPLIANCE_ASSESSMENT_SNAPSHOT - = fromString("RegulatoryComplianceAssessmentSnapshot"); - - /** - * AttackPaths. - */ - public static final EventSource ATTACK_PATHS = fromString("AttackPaths"); - - /** - * AttackPathsSnapshot. - */ - public static final EventSource ATTACK_PATHS_SNAPSHOT = fromString("AttackPathsSnapshot"); - - /** - * Creates a new instance of EventSource value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public EventSource() { - } - - /** - * Creates or finds a EventSource from its string representation. - * - * @param name a name to look for. - * @return the corresponding EventSource. - */ - public static EventSource fromString(String name) { - return fromString(name, EventSource.class); - } - - /** - * Gets known EventSource values. - * - * @return known EventSource values. - */ - public static Collection values() { - return values(EventSource.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExecuteGovernanceRuleParams.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExecuteGovernanceRuleParams.java deleted file mode 100644 index da8a43f887fe..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExecuteGovernanceRuleParams.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * Governance rule execution parameters. - */ -@Fluent -public final class ExecuteGovernanceRuleParams implements JsonSerializable { - /* - * Describe if governance rule should be override - */ - private Boolean override; - - /** - * Creates an instance of ExecuteGovernanceRuleParams class. - */ - public ExecuteGovernanceRuleParams() { - } - - /** - * Get the override property: Describe if governance rule should be override. - * - * @return the override value. - */ - public Boolean override() { - return this.override; - } - - /** - * Set the override property: Describe if governance rule should be override. - * - * @param override the override value to set. - * @return the ExecuteGovernanceRuleParams object itself. - */ - public ExecuteGovernanceRuleParams withOverride(Boolean override) { - this.override = override; - 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("override", this.override); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ExecuteGovernanceRuleParams from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ExecuteGovernanceRuleParams 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 ExecuteGovernanceRuleParams. - */ - public static ExecuteGovernanceRuleParams fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ExecuteGovernanceRuleParams deserializedExecuteGovernanceRuleParams = new ExecuteGovernanceRuleParams(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("override".equals(fieldName)) { - deserializedExecuteGovernanceRuleParams.override = reader.getNullable(JsonReader::getBoolean); - } else { - reader.skipChildren(); - } - } - - return deserializedExecuteGovernanceRuleParams; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExemptionCategory.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExemptionCategory.java deleted file mode 100644 index 5feaac6b49ca..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExemptionCategory.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Exemption category of this assignment. - */ -public final class ExemptionCategory extends ExpandableStringEnum { - /** - * waiver. - */ - public static final ExemptionCategory WAIVER = fromString("waiver"); - - /** - * mitigated. - */ - public static final ExemptionCategory MITIGATED = fromString("mitigated"); - - /** - * Creates a new instance of ExemptionCategory value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ExemptionCategory() { - } - - /** - * Creates or finds a ExemptionCategory from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExemptionCategory. - */ - public static ExemptionCategory fromString(String name) { - return fromString(name, ExemptionCategory.class); - } - - /** - * Gets known ExemptionCategory values. - * - * @return known ExemptionCategory values. - */ - public static Collection values() { - return values(ExemptionCategory.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExpandControlsEnum.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExpandControlsEnum.java deleted file mode 100644 index 64187f1416fd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExpandControlsEnum.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for ExpandControlsEnum. - */ -public final class ExpandControlsEnum extends ExpandableStringEnum { - /** - * Add definition object for each control. - */ - public static final ExpandControlsEnum DEFINITION = fromString("definition"); - - /** - * Creates a new instance of ExpandControlsEnum value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ExpandControlsEnum() { - } - - /** - * Creates or finds a ExpandControlsEnum from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExpandControlsEnum. - */ - public static ExpandControlsEnum fromString(String name) { - return fromString(name, ExpandControlsEnum.class); - } - - /** - * Gets known ExpandControlsEnum values. - * - * @return known ExpandControlsEnum values. - */ - public static Collection values() { - return values(ExpandControlsEnum.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExpandEnum.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExpandEnum.java deleted file mode 100644 index 710a8126dc6c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExpandEnum.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for ExpandEnum. - */ -public final class ExpandEnum extends ExpandableStringEnum { - /** - * All links associated with an assessment. - */ - public static final ExpandEnum LINKS = fromString("links"); - - /** - * Assessment metadata. - */ - public static final ExpandEnum METADATA = fromString("metadata"); - - /** - * Creates a new instance of ExpandEnum value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ExpandEnum() { - } - - /** - * Creates or finds a ExpandEnum from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExpandEnum. - */ - public static ExpandEnum fromString(String name) { - return fromString(name, ExpandEnum.class); - } - - /** - * Gets known ExpandEnum values. - * - * @return known ExpandEnum values. - */ - public static Collection values() { - return values(ExpandEnum.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExportData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExportData.java deleted file mode 100644 index f816af18af57..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExportData.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for ExportData. - */ -public final class ExportData extends ExpandableStringEnum { - /** - * Agent raw events. - */ - public static final ExportData RAW_EVENTS = fromString("RawEvents"); - - /** - * Creates a new instance of ExportData value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ExportData() { - } - - /** - * Creates or finds a ExportData from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExportData. - */ - public static ExportData fromString(String name) { - return fromString(name, ExportData.class); - } - - /** - * Gets known ExportData values. - * - * @return known ExportData values. - */ - public static Collection values() { - return values(ExportData.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Extension.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Extension.java deleted file mode 100644 index 102f752a7e39..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Extension.java +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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; - -/** - * A plan's extension properties. - */ -@Fluent -public final class Extension implements JsonSerializable { - /* - * The extension name. Supported values are:

**AgentlessDiscoveryForKubernetes** - Provides zero footprint, - * API-based discovery of Kubernetes clusters, their configurations and deployments. The collected data is used to - * create a contextualized security graph for Kubernetes clusters, provide risk hunting capabilities, and visualize - * risks and threats to Kubernetes environments and workloads.
Available for CloudPosture plan and Containers - * plan.

**OnUploadMalwareScanning** - Limits the GB to be scanned per month for each storage account within - * the subscription. Once this limit reached on a given storage account, Blobs won't be scanned during current - * calendar month.
Available for StorageAccounts plan (DefenderForStorageV2 sub - * plans).

**SensitiveDataDiscovery** - Sensitive data discovery identifies Blob storage container with - * sensitive data such as credentials, credit cards, and more, to help prioritize and investigate security - * events.
Available for StorageAccounts plan (DefenderForStorageV2 sub plan) and CloudPosture - * plan.

**ContainerRegistriesVulnerabilityAssessments** - Provides vulnerability management for images - * stored in your container registries.
Available for CloudPosture plan and Containers - * plan.

**MdeDesignatedSubscription** - Direct onboarding is a seamless integration between Defender for - * Endpoint and Defender for Cloud that doesn't require extra software deployment on your servers. The onboarded - * resources will be presented under a designated Azure Subscription you configure
Available for VirtualMachines - * plan (P1 and P2 sub plans).

**AgentlessVmScanning** - Scans your machines for installed software, - * vulnerabilities, malware and secret scanning without relying on agents or impacting machine performance. Learn - * more here - * https://learn.microsoft.com/en-us/azure/defender-for-cloud/concept-agentless-data-collection.
Available for - * CloudPosture plan, VirtualMachines plan (P2 sub plan) and Containers plan.

**EntraPermissionsManagement** - * - Permissions Management provides Cloud Infrastructure Entitlement Management (CIEM) capabilities that helps - * organizations to manage and control user access and entitlements in their cloud infrastructure - important attack - * vector for cloud environments.
Permissions Management analyzes all permissions and active usage, and suggests - * recommendations to reduce permissions to enforce the principle of least privilege. Learn more here - * https://learn.microsoft.com/en-us/azure/defender-for-cloud/permissions-management.
Available for CloudPosture - * plan.

**FileIntegrityMonitoring** - File integrity monitoring (FIM), examines operating system - * files.
Windows registries, Linux system files, in real time, for changes that might indicate an - * attack.
Available for VirtualMachines plan (P2 sub plan).

**ContainerSensor** - The sensor is based on - * IG and provides a rich threat detection suite for Kubernetes clusters, nodes, and workloads, powered by Microsoft - * leading threat intelligence, provides mapping to MITRE ATT&CK framework.
Available for Containers plan. - *

**AIPromptEvidence** - Exposes the prompts passed between the user and the AI model as alert evidence. - * This helps classify and triage the alerts with relevant user context. The prompt snippets will include only - * segments of the user prompt or model response that were deemed suspicious and relevant for security - * classifications. The prompt evidence will be available through Defender portal as part of each - * alert.
Available for AI plan.

- */ - private String name; - - /* - * Indicates whether the extension is enabled. - */ - private IsEnabled isEnabled; - - /* - * Property values associated with the extension. - */ - private Map additionalExtensionProperties; - - /* - * Optional. A status describing the success/failure of the extension's enablement/disablement operation. - */ - private OperationStatus operationStatus; - - /** - * Creates an instance of Extension class. - */ - public Extension() { - } - - /** - * Get the name property: The extension name. Supported values are: - * <br><br>**AgentlessDiscoveryForKubernetes** - Provides zero footprint, API-based discovery of - * Kubernetes clusters, their configurations and deployments. The collected data is used to create a contextualized - * security graph for Kubernetes clusters, provide risk hunting capabilities, and visualize risks and threats to - * Kubernetes environments and workloads.<br>Available for CloudPosture plan and Containers - * plan.<br><br>**OnUploadMalwareScanning** - Limits the GB to be scanned per month for each storage - * account within the subscription. Once this limit reached on a given storage account, Blobs won't be scanned - * during current calendar month.<br>Available for StorageAccounts plan (DefenderForStorageV2 sub - * plans).<br><br>**SensitiveDataDiscovery** - Sensitive data discovery identifies Blob storage - * container with sensitive data such as credentials, credit cards, and more, to help prioritize and investigate - * security events.<br>Available for StorageAccounts plan (DefenderForStorageV2 sub plan) and CloudPosture - * plan.<br><br>**ContainerRegistriesVulnerabilityAssessments** - Provides vulnerability management for - * images stored in your container registries.<br>Available for CloudPosture plan and Containers - * plan.<br><br>**MdeDesignatedSubscription** - Direct onboarding is a seamless integration between - * Defender for Endpoint and Defender for Cloud that doesn't require extra software deployment on your servers. The - * onboarded resources will be presented under a designated Azure Subscription you configure<br>Available for - * VirtualMachines plan (P1 and P2 sub plans).<br><br>**AgentlessVmScanning** - Scans your machines for - * installed software, vulnerabilities, malware and secret scanning without relying on agents or impacting machine - * performance. Learn more here - * https://learn.microsoft.com/en-us/azure/defender-for-cloud/concept-agentless-data-collection.<br>Available - * for CloudPosture plan, VirtualMachines plan (P2 sub plan) and Containers - * plan.<br><br>**EntraPermissionsManagement** - Permissions Management provides Cloud Infrastructure - * Entitlement Management (CIEM) capabilities that helps organizations to manage and control user access and - * entitlements in their cloud infrastructure - important attack vector for cloud environments.<br>Permissions - * Management analyzes all permissions and active usage, and suggests recommendations to reduce permissions to - * enforce the principle of least privilege. Learn more here - * https://learn.microsoft.com/en-us/azure/defender-for-cloud/permissions-management.<br>Available for - * CloudPosture plan. <br><br>**FileIntegrityMonitoring** - File integrity monitoring (FIM), examines - * operating system files.<br>Windows registries, Linux system files, in real time, for changes that might - * indicate an attack.<br>Available for VirtualMachines plan (P2 sub plan). - * <br><br>**ContainerSensor** - The sensor is based on IG and provides a rich threat detection suite - * for Kubernetes clusters, nodes, and workloads, powered by Microsoft leading threat intelligence, provides mapping - * to MITRE ATT&CK framework.<br>Available for Containers plan. <br><br>**AIPromptEvidence** - - * Exposes the prompts passed between the user and the AI model as alert evidence. This helps classify and triage - * the alerts with relevant user context. The prompt snippets will include only segments of the user prompt or model - * response that were deemed suspicious and relevant for security classifications. The prompt evidence will be - * available through Defender portal as part of each alert.<br>Available for AI plan. <br><br>. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The extension name. Supported values are: - * <br><br>**AgentlessDiscoveryForKubernetes** - Provides zero footprint, API-based discovery of - * Kubernetes clusters, their configurations and deployments. The collected data is used to create a contextualized - * security graph for Kubernetes clusters, provide risk hunting capabilities, and visualize risks and threats to - * Kubernetes environments and workloads.<br>Available for CloudPosture plan and Containers - * plan.<br><br>**OnUploadMalwareScanning** - Limits the GB to be scanned per month for each storage - * account within the subscription. Once this limit reached on a given storage account, Blobs won't be scanned - * during current calendar month.<br>Available for StorageAccounts plan (DefenderForStorageV2 sub - * plans).<br><br>**SensitiveDataDiscovery** - Sensitive data discovery identifies Blob storage - * container with sensitive data such as credentials, credit cards, and more, to help prioritize and investigate - * security events.<br>Available for StorageAccounts plan (DefenderForStorageV2 sub plan) and CloudPosture - * plan.<br><br>**ContainerRegistriesVulnerabilityAssessments** - Provides vulnerability management for - * images stored in your container registries.<br>Available for CloudPosture plan and Containers - * plan.<br><br>**MdeDesignatedSubscription** - Direct onboarding is a seamless integration between - * Defender for Endpoint and Defender for Cloud that doesn't require extra software deployment on your servers. The - * onboarded resources will be presented under a designated Azure Subscription you configure<br>Available for - * VirtualMachines plan (P1 and P2 sub plans).<br><br>**AgentlessVmScanning** - Scans your machines for - * installed software, vulnerabilities, malware and secret scanning without relying on agents or impacting machine - * performance. Learn more here - * https://learn.microsoft.com/en-us/azure/defender-for-cloud/concept-agentless-data-collection.<br>Available - * for CloudPosture plan, VirtualMachines plan (P2 sub plan) and Containers - * plan.<br><br>**EntraPermissionsManagement** - Permissions Management provides Cloud Infrastructure - * Entitlement Management (CIEM) capabilities that helps organizations to manage and control user access and - * entitlements in their cloud infrastructure - important attack vector for cloud environments.<br>Permissions - * Management analyzes all permissions and active usage, and suggests recommendations to reduce permissions to - * enforce the principle of least privilege. Learn more here - * https://learn.microsoft.com/en-us/azure/defender-for-cloud/permissions-management.<br>Available for - * CloudPosture plan. <br><br>**FileIntegrityMonitoring** - File integrity monitoring (FIM), examines - * operating system files.<br>Windows registries, Linux system files, in real time, for changes that might - * indicate an attack.<br>Available for VirtualMachines plan (P2 sub plan). - * <br><br>**ContainerSensor** - The sensor is based on IG and provides a rich threat detection suite - * for Kubernetes clusters, nodes, and workloads, powered by Microsoft leading threat intelligence, provides mapping - * to MITRE ATT&CK framework.<br>Available for Containers plan. <br><br>**AIPromptEvidence** - - * Exposes the prompts passed between the user and the AI model as alert evidence. This helps classify and triage - * the alerts with relevant user context. The prompt snippets will include only segments of the user prompt or model - * response that were deemed suspicious and relevant for security classifications. The prompt evidence will be - * available through Defender portal as part of each alert.<br>Available for AI plan. <br><br>. - * - * @param name the name value to set. - * @return the Extension object itself. - */ - public Extension withName(String name) { - this.name = name; - return this; - } - - /** - * Get the isEnabled property: Indicates whether the extension is enabled. - * - * @return the isEnabled value. - */ - public IsEnabled isEnabled() { - return this.isEnabled; - } - - /** - * Set the isEnabled property: Indicates whether the extension is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the Extension object itself. - */ - public Extension withIsEnabled(IsEnabled isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - /** - * Get the additionalExtensionProperties property: Property values associated with the extension. - * - * @return the additionalExtensionProperties value. - */ - public Map additionalExtensionProperties() { - return this.additionalExtensionProperties; - } - - /** - * Set the additionalExtensionProperties property: Property values associated with the extension. - * - * @param additionalExtensionProperties the additionalExtensionProperties value to set. - * @return the Extension object itself. - */ - public Extension withAdditionalExtensionProperties(Map additionalExtensionProperties) { - this.additionalExtensionProperties = additionalExtensionProperties; - return this; - } - - /** - * Get the operationStatus property: Optional. A status describing the success/failure of the extension's - * enablement/disablement operation. - * - * @return the operationStatus value. - */ - public OperationStatus operationStatus() { - return this.operationStatus; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property name in model Extension")); - } - if (isEnabled() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property isEnabled in model Extension")); - } - if (operationStatus() != null) { - operationStatus().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Extension.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("isEnabled", this.isEnabled == null ? null : this.isEnabled.toString()); - jsonWriter.writeMapField("additionalExtensionProperties", this.additionalExtensionProperties, - (writer, element) -> writer.writeUntyped(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Extension from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Extension 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 Extension. - */ - public static Extension fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Extension deserializedExtension = new Extension(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedExtension.name = reader.getString(); - } else if ("isEnabled".equals(fieldName)) { - deserializedExtension.isEnabled = IsEnabled.fromString(reader.getString()); - } else if ("additionalExtensionProperties".equals(fieldName)) { - Map additionalExtensionProperties - = reader.readMap(reader1 -> reader1.readUntyped()); - deserializedExtension.additionalExtensionProperties = additionalExtensionProperties; - } else if ("operationStatus".equals(fieldName)) { - deserializedExtension.operationStatus = OperationStatus.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedExtension; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolution.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolution.java deleted file mode 100644 index ea5fa2c77611..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolution.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner; - -/** - * An immutable client-side representation of ExternalSecuritySolution. - */ -public interface ExternalSecuritySolution { - /** - * 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 kind property: The kind of the external solution. - * - * @return the kind value. - */ - ExternalSecuritySolutionKind kind(); - - /** - * Gets the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - Object properties(); - - /** - * Gets the location property: Location where the resource is stored. - * - * @return the location value. - */ - String location(); - - /** - * 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.security.fluent.models.ExternalSecuritySolutionInner object. - * - * @return the inner object. - */ - ExternalSecuritySolutionInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKind.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKind.java deleted file mode 100644 index 46eaf4f97a12..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKind.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The kind of the external solution. - */ -public final class ExternalSecuritySolutionKind extends ExpandableStringEnum { - /** - * CEF. - */ - public static final ExternalSecuritySolutionKind CEF = fromString("CEF"); - - /** - * ATA. - */ - public static final ExternalSecuritySolutionKind ATA = fromString("ATA"); - - /** - * AAD. - */ - public static final ExternalSecuritySolutionKind AAD = fromString("AAD"); - - /** - * Creates a new instance of ExternalSecuritySolutionKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ExternalSecuritySolutionKind() { - } - - /** - * Creates or finds a ExternalSecuritySolutionKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExternalSecuritySolutionKind. - */ - public static ExternalSecuritySolutionKind fromString(String name) { - return fromString(name, ExternalSecuritySolutionKind.class); - } - - /** - * Gets known ExternalSecuritySolutionKind values. - * - * @return known ExternalSecuritySolutionKind values. - */ - public static Collection values() { - return values(ExternalSecuritySolutionKind.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionProperties.java deleted file mode 100644 index 911eb0f382c3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionProperties.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * The solution properties (correspond to the solution kind). - */ -@Immutable -public class ExternalSecuritySolutionProperties implements JsonSerializable { - /* - * The deviceVendor property. - */ - private String deviceVendor; - - /* - * The deviceType property. - */ - private String deviceType; - - /* - * Represents an OMS workspace to which the solution is connected - */ - private ConnectedWorkspace workspace; - - /* - * The solution properties (correspond to the solution kind) - */ - private Map additionalProperties; - - /** - * Creates an instance of ExternalSecuritySolutionProperties class. - */ - protected ExternalSecuritySolutionProperties() { - } - - /** - * Get the deviceVendor property: The deviceVendor property. - * - * @return the deviceVendor value. - */ - public String deviceVendor() { - return this.deviceVendor; - } - - /** - * Set the deviceVendor property: The deviceVendor property. - * - * @param deviceVendor the deviceVendor value to set. - * @return the ExternalSecuritySolutionProperties object itself. - */ - ExternalSecuritySolutionProperties withDeviceVendor(String deviceVendor) { - this.deviceVendor = deviceVendor; - return this; - } - - /** - * Get the deviceType property: The deviceType property. - * - * @return the deviceType value. - */ - public String deviceType() { - return this.deviceType; - } - - /** - * Set the deviceType property: The deviceType property. - * - * @param deviceType the deviceType value to set. - * @return the ExternalSecuritySolutionProperties object itself. - */ - ExternalSecuritySolutionProperties withDeviceType(String deviceType) { - this.deviceType = deviceType; - return this; - } - - /** - * Get the workspace property: Represents an OMS workspace to which the solution is connected. - * - * @return the workspace value. - */ - public ConnectedWorkspace workspace() { - return this.workspace; - } - - /** - * Set the workspace property: Represents an OMS workspace to which the solution is connected. - * - * @param workspace the workspace value to set. - * @return the ExternalSecuritySolutionProperties object itself. - */ - ExternalSecuritySolutionProperties withWorkspace(ConnectedWorkspace workspace) { - this.workspace = workspace; - return this; - } - - /** - * Get the additionalProperties property: The solution properties (correspond to the solution kind). - * - * @return the additionalProperties value. - */ - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: The solution properties (correspond to the solution kind). - * - * @param additionalProperties the additionalProperties value to set. - * @return the ExternalSecuritySolutionProperties object itself. - */ - ExternalSecuritySolutionProperties withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (workspace() != null) { - workspace().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("deviceVendor", this.deviceVendor); - jsonWriter.writeStringField("deviceType", this.deviceType); - jsonWriter.writeJsonField("workspace", this.workspace); - if (additionalProperties != null) { - for (Map.Entry additionalProperty : additionalProperties.entrySet()) { - jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); - } - } - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ExternalSecuritySolutionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ExternalSecuritySolutionProperties 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 ExternalSecuritySolutionProperties. - */ - public static ExternalSecuritySolutionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ExternalSecuritySolutionProperties deserializedExternalSecuritySolutionProperties - = new ExternalSecuritySolutionProperties(); - Map additionalProperties = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("deviceVendor".equals(fieldName)) { - deserializedExternalSecuritySolutionProperties.deviceVendor = reader.getString(); - } else if ("deviceType".equals(fieldName)) { - deserializedExternalSecuritySolutionProperties.deviceType = reader.getString(); - } else if ("workspace".equals(fieldName)) { - deserializedExternalSecuritySolutionProperties.workspace = ConnectedWorkspace.fromJson(reader); - } else { - if (additionalProperties == null) { - additionalProperties = new LinkedHashMap<>(); - } - - additionalProperties.put(fieldName, reader.readUntyped()); - } - } - deserializedExternalSecuritySolutionProperties.additionalProperties = additionalProperties; - - return deserializedExternalSecuritySolutionProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutions.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutions.java deleted file mode 100644 index 5566ba633fee..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutions.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ExternalSecuritySolutions. - */ -public interface ExternalSecuritySolutions { - /** - * Gets a specific external Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param externalSecuritySolutionsName Name of an external security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific external Security Solution along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String ascLocation, - String externalSecuritySolutionsName, Context context); - - /** - * Gets a specific external Security Solution. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param externalSecuritySolutionsName Name of an external security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 external Security Solution. - */ - ExternalSecuritySolution get(String resourceGroupName, String ascLocation, String externalSecuritySolutionsName); - - /** - * Gets a list of external Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external Security Solutions for the subscription and location as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByHomeRegion(String ascLocation); - - /** - * Gets a list of external Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external Security Solutions for the subscription and location as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByHomeRegion(String ascLocation, Context context); - - /** - * Gets a list of external security solutions for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external security solutions for the subscription as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Gets a list of external security solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external security solutions for the subscription as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FilesScanSummary.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FilesScanSummary.java deleted file mode 100644 index 6a6477d92cbf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FilesScanSummary.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * A summary of the scan results of the files that were scanned. - */ -@Immutable -public final class FilesScanSummary implements JsonSerializable { - /* - * The total number of files that were scanned. - */ - private Long totalFilesScanned; - - /* - * The number of malicious files that were detected during the scan. - */ - private Long maliciousFilesCount; - - /* - * The number of files that were skipped. - */ - private Long skippedFilesCount; - - /* - * The number of failed file scans. - */ - private Long failedFilesCount; - - /* - * The number of gigabytes of data that were scanned. - */ - private Double scannedFilesInGB; - - /** - * Creates an instance of FilesScanSummary class. - */ - private FilesScanSummary() { - } - - /** - * Get the totalFilesScanned property: The total number of files that were scanned. - * - * @return the totalFilesScanned value. - */ - public Long totalFilesScanned() { - return this.totalFilesScanned; - } - - /** - * Get the maliciousFilesCount property: The number of malicious files that were detected during the scan. - * - * @return the maliciousFilesCount value. - */ - public Long maliciousFilesCount() { - return this.maliciousFilesCount; - } - - /** - * Get the skippedFilesCount property: The number of files that were skipped. - * - * @return the skippedFilesCount value. - */ - public Long skippedFilesCount() { - return this.skippedFilesCount; - } - - /** - * Get the failedFilesCount property: The number of failed file scans. - * - * @return the failedFilesCount value. - */ - public Long failedFilesCount() { - return this.failedFilesCount; - } - - /** - * Get the scannedFilesInGB property: The number of gigabytes of data that were scanned. - * - * @return the scannedFilesInGB value. - */ - public Double scannedFilesInGB() { - return this.scannedFilesInGB; - } - - /** - * 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.writeNumberField("totalFilesScanned", this.totalFilesScanned); - jsonWriter.writeNumberField("maliciousFilesCount", this.maliciousFilesCount); - jsonWriter.writeNumberField("skippedFilesCount", this.skippedFilesCount); - jsonWriter.writeNumberField("failedFilesCount", this.failedFilesCount); - jsonWriter.writeNumberField("scannedFilesInGB", this.scannedFilesInGB); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FilesScanSummary from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FilesScanSummary 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 FilesScanSummary. - */ - public static FilesScanSummary fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FilesScanSummary deserializedFilesScanSummary = new FilesScanSummary(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("totalFilesScanned".equals(fieldName)) { - deserializedFilesScanSummary.totalFilesScanned = reader.getNullable(JsonReader::getLong); - } else if ("maliciousFilesCount".equals(fieldName)) { - deserializedFilesScanSummary.maliciousFilesCount = reader.getNullable(JsonReader::getLong); - } else if ("skippedFilesCount".equals(fieldName)) { - deserializedFilesScanSummary.skippedFilesCount = reader.getNullable(JsonReader::getLong); - } else if ("failedFilesCount".equals(fieldName)) { - deserializedFilesScanSummary.failedFilesCount = reader.getNullable(JsonReader::getLong); - } else if ("scannedFilesInGB".equals(fieldName)) { - deserializedFilesScanSummary.scannedFilesInGB = reader.getNullable(JsonReader::getDouble); - } else { - reader.skipChildren(); - } - } - - return deserializedFilesScanSummary; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalData.java deleted file mode 100644 index 7da0eb3e509e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalData.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The gcpOrganization data. - */ -@Immutable -public class GcpOrganizationalData implements JsonSerializable { - /* - * The multi cloud account's membership type in the organization - */ - private OrganizationMembershipType organizationMembershipType - = OrganizationMembershipType.fromString("GcpOrganizationalData"); - - /** - * Creates an instance of GcpOrganizationalData class. - */ - public GcpOrganizationalData() { - } - - /** - * Get the organizationMembershipType property: The multi cloud account's membership type in the organization. - * - * @return the organizationMembershipType value. - */ - public OrganizationMembershipType organizationMembershipType() { - return this.organizationMembershipType; - } - - /** - * 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("organizationMembershipType", - this.organizationMembershipType == null ? null : this.organizationMembershipType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GcpOrganizationalData from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GcpOrganizationalData 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 GcpOrganizationalData. - */ - public static GcpOrganizationalData fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - readerToUse.nextToken(); // Prepare for reading - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("organizationMembershipType".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("Organization".equals(discriminatorValue)) { - return GcpOrganizationalDataOrganization.fromJson(readerToUse.reset()); - } else if ("Member".equals(discriminatorValue)) { - return GcpOrganizationalDataMember.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - static GcpOrganizationalData fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GcpOrganizationalData deserializedGcpOrganizationalData = new GcpOrganizationalData(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("organizationMembershipType".equals(fieldName)) { - deserializedGcpOrganizationalData.organizationMembershipType - = OrganizationMembershipType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedGcpOrganizationalData; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalDataMember.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalDataMember.java deleted file mode 100644 index 888ccb7b723c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalDataMember.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The gcpOrganization data for the member account. - */ -@Fluent -public final class GcpOrganizationalDataMember extends GcpOrganizationalData { - /* - * The multi cloud account's membership type in the organization - */ - private OrganizationMembershipType organizationMembershipType = OrganizationMembershipType.MEMBER; - - /* - * If the multi cloud account is not of membership type organization, this will be the ID of the project's parent - */ - private String parentHierarchyId; - - /* - * The GCP management project number from organizational onboarding - */ - private String managementProjectNumber; - - /** - * Creates an instance of GcpOrganizationalDataMember class. - */ - public GcpOrganizationalDataMember() { - } - - /** - * Get the organizationMembershipType property: The multi cloud account's membership type in the organization. - * - * @return the organizationMembershipType value. - */ - @Override - public OrganizationMembershipType organizationMembershipType() { - return this.organizationMembershipType; - } - - /** - * Get the parentHierarchyId property: If the multi cloud account is not of membership type organization, this will - * be the ID of the project's parent. - * - * @return the parentHierarchyId value. - */ - public String parentHierarchyId() { - return this.parentHierarchyId; - } - - /** - * Set the parentHierarchyId property: If the multi cloud account is not of membership type organization, this will - * be the ID of the project's parent. - * - * @param parentHierarchyId the parentHierarchyId value to set. - * @return the GcpOrganizationalDataMember object itself. - */ - public GcpOrganizationalDataMember withParentHierarchyId(String parentHierarchyId) { - this.parentHierarchyId = parentHierarchyId; - return this; - } - - /** - * Get the managementProjectNumber property: The GCP management project number from organizational onboarding. - * - * @return the managementProjectNumber value. - */ - public String managementProjectNumber() { - return this.managementProjectNumber; - } - - /** - * Set the managementProjectNumber property: The GCP management project number from organizational onboarding. - * - * @param managementProjectNumber the managementProjectNumber value to set. - * @return the GcpOrganizationalDataMember object itself. - */ - public GcpOrganizationalDataMember withManagementProjectNumber(String managementProjectNumber) { - this.managementProjectNumber = managementProjectNumber; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("organizationMembershipType", - this.organizationMembershipType == null ? null : this.organizationMembershipType.toString()); - jsonWriter.writeStringField("parentHierarchyId", this.parentHierarchyId); - jsonWriter.writeStringField("managementProjectNumber", this.managementProjectNumber); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GcpOrganizationalDataMember from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GcpOrganizationalDataMember 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 GcpOrganizationalDataMember. - */ - public static GcpOrganizationalDataMember fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GcpOrganizationalDataMember deserializedGcpOrganizationalDataMember = new GcpOrganizationalDataMember(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("organizationMembershipType".equals(fieldName)) { - deserializedGcpOrganizationalDataMember.organizationMembershipType - = OrganizationMembershipType.fromString(reader.getString()); - } else if ("parentHierarchyId".equals(fieldName)) { - deserializedGcpOrganizationalDataMember.parentHierarchyId = reader.getString(); - } else if ("managementProjectNumber".equals(fieldName)) { - deserializedGcpOrganizationalDataMember.managementProjectNumber = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGcpOrganizationalDataMember; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalDataOrganization.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalDataOrganization.java deleted file mode 100644 index 67344fe134ed..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalDataOrganization.java +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The gcpOrganization data for the parent account. - */ -@Fluent -public final class GcpOrganizationalDataOrganization extends GcpOrganizationalData { - /* - * The multi cloud account's membership type in the organization - */ - private OrganizationMembershipType organizationMembershipType = OrganizationMembershipType.ORGANIZATION; - - /* - * If the multi cloud account is of membership type organization, list of accounts excluded from offering - */ - private List excludedProjectNumbers; - - /* - * The service account email address which represents the organization level permissions container. - */ - private String serviceAccountEmailAddress; - - /* - * The GCP workload identity provider id which represents the permissions required to auto provision security - * connectors - */ - private String workloadIdentityProviderId; - - /* - * GCP organization name - */ - private String organizationName; - - /** - * Creates an instance of GcpOrganizationalDataOrganization class. - */ - public GcpOrganizationalDataOrganization() { - } - - /** - * Get the organizationMembershipType property: The multi cloud account's membership type in the organization. - * - * @return the organizationMembershipType value. - */ - @Override - public OrganizationMembershipType organizationMembershipType() { - return this.organizationMembershipType; - } - - /** - * Get the excludedProjectNumbers property: If the multi cloud account is of membership type organization, list of - * accounts excluded from offering. - * - * @return the excludedProjectNumbers value. - */ - public List excludedProjectNumbers() { - return this.excludedProjectNumbers; - } - - /** - * Set the excludedProjectNumbers property: If the multi cloud account is of membership type organization, list of - * accounts excluded from offering. - * - * @param excludedProjectNumbers the excludedProjectNumbers value to set. - * @return the GcpOrganizationalDataOrganization object itself. - */ - public GcpOrganizationalDataOrganization withExcludedProjectNumbers(List excludedProjectNumbers) { - this.excludedProjectNumbers = excludedProjectNumbers; - return this; - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address which represents the organization - * level permissions container. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address which represents the organization - * level permissions container. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the GcpOrganizationalDataOrganization object itself. - */ - public GcpOrganizationalDataOrganization withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The GCP workload identity provider id which represents the - * permissions required to auto provision security connectors. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The GCP workload identity provider id which represents the - * permissions required to auto provision security connectors. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the GcpOrganizationalDataOrganization object itself. - */ - public GcpOrganizationalDataOrganization withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Get the organizationName property: GCP organization name. - * - * @return the organizationName value. - */ - public String organizationName() { - return this.organizationName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("organizationMembershipType", - this.organizationMembershipType == null ? null : this.organizationMembershipType.toString()); - jsonWriter.writeArrayField("excludedProjectNumbers", this.excludedProjectNumbers, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("serviceAccountEmailAddress", this.serviceAccountEmailAddress); - jsonWriter.writeStringField("workloadIdentityProviderId", this.workloadIdentityProviderId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GcpOrganizationalDataOrganization from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GcpOrganizationalDataOrganization 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 GcpOrganizationalDataOrganization. - */ - public static GcpOrganizationalDataOrganization fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GcpOrganizationalDataOrganization deserializedGcpOrganizationalDataOrganization - = new GcpOrganizationalDataOrganization(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("organizationMembershipType".equals(fieldName)) { - deserializedGcpOrganizationalDataOrganization.organizationMembershipType - = OrganizationMembershipType.fromString(reader.getString()); - } else if ("excludedProjectNumbers".equals(fieldName)) { - List excludedProjectNumbers = reader.readArray(reader1 -> reader1.getString()); - deserializedGcpOrganizationalDataOrganization.excludedProjectNumbers = excludedProjectNumbers; - } else if ("serviceAccountEmailAddress".equals(fieldName)) { - deserializedGcpOrganizationalDataOrganization.serviceAccountEmailAddress = reader.getString(); - } else if ("workloadIdentityProviderId".equals(fieldName)) { - deserializedGcpOrganizationalDataOrganization.workloadIdentityProviderId = reader.getString(); - } else if ("organizationName".equals(fieldName)) { - deserializedGcpOrganizationalDataOrganization.organizationName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGcpOrganizationalDataOrganization; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectDetails.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectDetails.java deleted file mode 100644 index be8ed647524b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectDetails.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.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 details about the project represented by the security connector. - */ -@Fluent -public final class GcpProjectDetails implements JsonSerializable { - /* - * The unique GCP Project number - */ - private String projectNumber; - - /* - * The GCP Project id - */ - private String projectId; - - /* - * The GCP workload identity federation pool id - */ - private String workloadIdentityPoolId; - - /* - * GCP project name - */ - private String projectName; - - /** - * Creates an instance of GcpProjectDetails class. - */ - public GcpProjectDetails() { - } - - /** - * Get the projectNumber property: The unique GCP Project number. - * - * @return the projectNumber value. - */ - public String projectNumber() { - return this.projectNumber; - } - - /** - * Set the projectNumber property: The unique GCP Project number. - * - * @param projectNumber the projectNumber value to set. - * @return the GcpProjectDetails object itself. - */ - public GcpProjectDetails withProjectNumber(String projectNumber) { - this.projectNumber = projectNumber; - return this; - } - - /** - * Get the projectId property: The GCP Project id. - * - * @return the projectId value. - */ - public String projectId() { - return this.projectId; - } - - /** - * Set the projectId property: The GCP Project id. - * - * @param projectId the projectId value to set. - * @return the GcpProjectDetails object itself. - */ - public GcpProjectDetails withProjectId(String projectId) { - this.projectId = projectId; - return this; - } - - /** - * Get the workloadIdentityPoolId property: The GCP workload identity federation pool id. - * - * @return the workloadIdentityPoolId value. - */ - public String workloadIdentityPoolId() { - return this.workloadIdentityPoolId; - } - - /** - * Get the projectName property: GCP project name. - * - * @return the projectName value. - */ - public String projectName() { - return this.projectName; - } - - /** - * 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("projectNumber", this.projectNumber); - jsonWriter.writeStringField("projectId", this.projectId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GcpProjectDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GcpProjectDetails 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 GcpProjectDetails. - */ - public static GcpProjectDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GcpProjectDetails deserializedGcpProjectDetails = new GcpProjectDetails(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("projectNumber".equals(fieldName)) { - deserializedGcpProjectDetails.projectNumber = reader.getString(); - } else if ("projectId".equals(fieldName)) { - deserializedGcpProjectDetails.projectId = reader.getString(); - } else if ("workloadIdentityPoolId".equals(fieldName)) { - deserializedGcpProjectDetails.workloadIdentityPoolId = reader.getString(); - } else if ("projectName".equals(fieldName)) { - deserializedGcpProjectDetails.projectName = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedGcpProjectDetails; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectEnvironmentData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectEnvironmentData.java deleted file mode 100644 index 465058bf2701..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectEnvironmentData.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The GCP project connector environment data. - */ -@Fluent -public final class GcpProjectEnvironmentData extends EnvironmentData { - /* - * The type of the environment data. - */ - private EnvironmentType environmentType = EnvironmentType.GCP_PROJECT; - - /* - * The Gcp project's organizational data - */ - private GcpOrganizationalData organizationalData; - - /* - * The Gcp project's details - */ - private GcpProjectDetails projectDetails; - - /* - * Scan interval in hours (value should be between 1-hour to 24-hours) - */ - private Long scanInterval; - - /** - * Creates an instance of GcpProjectEnvironmentData class. - */ - public GcpProjectEnvironmentData() { - } - - /** - * Get the environmentType property: The type of the environment data. - * - * @return the environmentType value. - */ - @Override - public EnvironmentType environmentType() { - return this.environmentType; - } - - /** - * Get the organizationalData property: The Gcp project's organizational data. - * - * @return the organizationalData value. - */ - public GcpOrganizationalData organizationalData() { - return this.organizationalData; - } - - /** - * Set the organizationalData property: The Gcp project's organizational data. - * - * @param organizationalData the organizationalData value to set. - * @return the GcpProjectEnvironmentData object itself. - */ - public GcpProjectEnvironmentData withOrganizationalData(GcpOrganizationalData organizationalData) { - this.organizationalData = organizationalData; - return this; - } - - /** - * Get the projectDetails property: The Gcp project's details. - * - * @return the projectDetails value. - */ - public GcpProjectDetails projectDetails() { - return this.projectDetails; - } - - /** - * Set the projectDetails property: The Gcp project's details. - * - * @param projectDetails the projectDetails value to set. - * @return the GcpProjectEnvironmentData object itself. - */ - public GcpProjectEnvironmentData withProjectDetails(GcpProjectDetails projectDetails) { - this.projectDetails = projectDetails; - return this; - } - - /** - * Get the scanInterval property: Scan interval in hours (value should be between 1-hour to 24-hours). - * - * @return the scanInterval value. - */ - public Long scanInterval() { - return this.scanInterval; - } - - /** - * Set the scanInterval property: Scan interval in hours (value should be between 1-hour to 24-hours). - * - * @param scanInterval the scanInterval value to set. - * @return the GcpProjectEnvironmentData object itself. - */ - public GcpProjectEnvironmentData withScanInterval(Long scanInterval) { - this.scanInterval = scanInterval; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (organizationalData() != null) { - organizationalData().validate(); - } - if (projectDetails() != null) { - projectDetails().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("environmentType", - this.environmentType == null ? null : this.environmentType.toString()); - jsonWriter.writeJsonField("organizationalData", this.organizationalData); - jsonWriter.writeJsonField("projectDetails", this.projectDetails); - jsonWriter.writeNumberField("scanInterval", this.scanInterval); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GcpProjectEnvironmentData from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GcpProjectEnvironmentData 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 GcpProjectEnvironmentData. - */ - public static GcpProjectEnvironmentData fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GcpProjectEnvironmentData deserializedGcpProjectEnvironmentData = new GcpProjectEnvironmentData(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("environmentType".equals(fieldName)) { - deserializedGcpProjectEnvironmentData.environmentType - = EnvironmentType.fromString(reader.getString()); - } else if ("organizationalData".equals(fieldName)) { - deserializedGcpProjectEnvironmentData.organizationalData = GcpOrganizationalData.fromJson(reader); - } else if ("projectDetails".equals(fieldName)) { - deserializedGcpProjectEnvironmentData.projectDetails = GcpProjectDetails.fromJson(reader); - } else if ("scanInterval".equals(fieldName)) { - deserializedGcpProjectEnvironmentData.scanInterval = reader.getNullable(JsonReader::getLong); - } else { - reader.skipChildren(); - } - } - - return deserializedGcpProjectEnvironmentData; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsListResponse.java deleted file mode 100644 index d11feedc6af2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsListResponse.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner; -import java.util.List; - -/** - * An immutable client-side representation of GetSensitivitySettingsListResponse. - */ -public interface GetSensitivitySettingsListResponse { - /** - * Gets the value property: The value property. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner object. - * - * @return the inner object. - */ - GetSensitivitySettingsListResponseInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponse.java deleted file mode 100644 index 24ad7f4a9720..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponse.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; - -/** - * An immutable client-side representation of GetSensitivitySettingsResponse. - */ -public interface GetSensitivitySettingsResponse { - /** - * 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: The sensitivity settings properties. - * - * @return the properties value. - */ - GetSensitivitySettingsResponseProperties 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.security.fluent.models.GetSensitivitySettingsResponseInner object. - * - * @return the inner object. - */ - GetSensitivitySettingsResponseInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponseProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponseProperties.java deleted file mode 100644 index 8cfbe9d234dd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponseProperties.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The sensitivity settings properties. - */ -@Immutable -public final class GetSensitivitySettingsResponseProperties - implements JsonSerializable { - /* - * List of selected sensitive info types' IDs. - */ - private List sensitiveInfoTypesIds; - - /* - * The order of the sensitivity threshold label. Any label at or above this order will be considered sensitive. If - * set to -1, sensitivity by labels is turned off - */ - private Float sensitivityThresholdLabelOrder; - - /* - * The id of the sensitivity threshold label. Any label at or above this rank will be considered sensitive. - */ - private String sensitivityThresholdLabelId; - - /* - * Microsoft information protection built-in and custom information types, labels, and integration status. - */ - private GetSensitivitySettingsResponsePropertiesMipInformation mipInformation; - - /** - * Creates an instance of GetSensitivitySettingsResponseProperties class. - */ - private GetSensitivitySettingsResponseProperties() { - } - - /** - * Get the sensitiveInfoTypesIds property: List of selected sensitive info types' IDs. - * - * @return the sensitiveInfoTypesIds value. - */ - public List sensitiveInfoTypesIds() { - return this.sensitiveInfoTypesIds; - } - - /** - * Get the sensitivityThresholdLabelOrder property: The order of the sensitivity threshold label. Any label at or - * above this order will be considered sensitive. If set to -1, sensitivity by labels is turned off. - * - * @return the sensitivityThresholdLabelOrder value. - */ - public Float sensitivityThresholdLabelOrder() { - return this.sensitivityThresholdLabelOrder; - } - - /** - * Get the sensitivityThresholdLabelId property: The id of the sensitivity threshold label. Any label at or above - * this rank will be considered sensitive. - * - * @return the sensitivityThresholdLabelId value. - */ - public String sensitivityThresholdLabelId() { - return this.sensitivityThresholdLabelId; - } - - /** - * Get the mipInformation property: Microsoft information protection built-in and custom information types, labels, - * and integration status. - * - * @return the mipInformation value. - */ - public GetSensitivitySettingsResponsePropertiesMipInformation mipInformation() { - return this.mipInformation; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (mipInformation() != null) { - mipInformation().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("sensitiveInfoTypesIds", this.sensitiveInfoTypesIds, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeNumberField("sensitivityThresholdLabelOrder", this.sensitivityThresholdLabelOrder); - jsonWriter.writeStringField("sensitivityThresholdLabelId", this.sensitivityThresholdLabelId); - jsonWriter.writeJsonField("mipInformation", this.mipInformation); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of GetSensitivitySettingsResponseProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of GetSensitivitySettingsResponseProperties 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 GetSensitivitySettingsResponseProperties. - */ - public static GetSensitivitySettingsResponseProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - GetSensitivitySettingsResponseProperties deserializedGetSensitivitySettingsResponseProperties - = new GetSensitivitySettingsResponseProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("sensitiveInfoTypesIds".equals(fieldName)) { - List sensitiveInfoTypesIds = reader.readArray(reader1 -> reader1.getString()); - deserializedGetSensitivitySettingsResponseProperties.sensitiveInfoTypesIds = sensitiveInfoTypesIds; - } else if ("sensitivityThresholdLabelOrder".equals(fieldName)) { - deserializedGetSensitivitySettingsResponseProperties.sensitivityThresholdLabelOrder - = reader.getNullable(JsonReader::getFloat); - } else if ("sensitivityThresholdLabelId".equals(fieldName)) { - deserializedGetSensitivitySettingsResponseProperties.sensitivityThresholdLabelId - = reader.getString(); - } else if ("mipInformation".equals(fieldName)) { - deserializedGetSensitivitySettingsResponseProperties.mipInformation - = GetSensitivitySettingsResponsePropertiesMipInformation.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedGetSensitivitySettingsResponseProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponsePropertiesMipInformation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponsePropertiesMipInformation.java deleted file mode 100644 index 2c6d69e1d4af..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponsePropertiesMipInformation.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Microsoft information protection built-in and custom information types, labels, and integration status. - */ -@Immutable -public final class GetSensitivitySettingsResponsePropertiesMipInformation - implements JsonSerializable { - /* - * Microsoft information protection integration status - */ - private MipIntegrationStatus mipIntegrationStatus; - - /* - * List of Microsoft information protection sensitivity labels - */ - private List